@almadar/ui 5.69.0 → 5.71.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 (68) hide show
  1. package/dist/avl/index.cjs +2034 -1854
  2. package/dist/avl/index.d.cts +93 -56
  3. package/dist/avl/index.js +758 -578
  4. package/dist/components/avl/molecules/AvlEventWireEdge.d.ts +2 -1
  5. package/dist/components/avl/molecules/AvlTransitionEdge.d.ts +2 -1
  6. package/dist/components/avl/molecules/avl-behavior-compose-converter.d.ts +7 -5
  7. package/dist/components/avl/molecules/avl-behavior-compose-types.d.ts +41 -21
  8. package/dist/components/avl/molecules/avl-canvas-types.d.ts +10 -7
  9. package/dist/components/avl/molecules/avl-preview-converter.d.ts +5 -5
  10. package/dist/components/avl/molecules/avl-preview-types.d.ts +15 -4
  11. package/dist/components/avl/organisms/FlowCanvas.d.ts +2 -2
  12. package/dist/components/avl/organisms/avl-schema-parser.d.ts +18 -16
  13. package/dist/components/core/atoms/Button.d.ts +2 -0
  14. package/dist/components/core/atoms/ConditionalWrapper.d.ts +5 -4
  15. package/dist/components/core/molecules/Carousel.d.ts +2 -2
  16. package/dist/components/core/molecules/OrbitalVisualization.d.ts +4 -3
  17. package/dist/components/core/molecules/PageHeader.d.ts +3 -3
  18. package/dist/components/core/molecules/RepeatableFormSection.d.ts +4 -3
  19. package/dist/components/core/molecules/ViolationAlert.d.ts +2 -0
  20. package/dist/components/core/molecules/WizardContainer.d.ts +23 -22
  21. package/dist/components/core/organisms/CardGrid.d.ts +2 -2
  22. package/dist/components/core/organisms/CustomPattern.d.ts +3 -4
  23. package/dist/components/core/organisms/DataTable.d.ts +2 -2
  24. package/dist/components/core/organisms/DetailPanel.d.ts +1 -1
  25. package/dist/components/core/organisms/Form.d.ts +11 -11
  26. package/dist/components/core/organisms/List.d.ts +3 -5
  27. package/dist/components/core/organisms/StatCard.d.ts +2 -2
  28. package/dist/components/core/organisms/book/types.d.ts +1 -1
  29. package/dist/components/core/organisms/debug/RuntimeDebugger.d.ts +2 -1
  30. package/dist/components/core/organisms/debug/tabs/EventDispatcherTab.d.ts +2 -1
  31. package/dist/components/core/organisms/layout/DashboardGrid.d.ts +0 -2
  32. package/dist/components/core/organisms/types.d.ts +3 -2
  33. package/dist/components/game/atoms/ScoreDisplay.d.ts +3 -1
  34. package/dist/components/game/molecules/three/hooks/useSceneGraph.d.ts +2 -1
  35. package/dist/components/game/molecules/three/index.cjs +37 -24
  36. package/dist/components/game/molecules/three/index.js +37 -24
  37. package/dist/components/game/organisms/HolidayRunnerBoard.d.ts +19 -17
  38. package/dist/components/game/organisms/PinballBoard.d.ts +4 -4
  39. package/dist/components/game/organisms/RacingBoard.d.ts +25 -17
  40. package/dist/components/game/organisms/SpaceShmupBoard.d.ts +28 -11
  41. package/dist/components/game/organisms/boardEntity.d.ts +6 -6
  42. package/dist/components/game/organisms/puzzles/debugger/DebuggerBoard.d.ts +16 -2
  43. package/dist/components/game/organisms/puzzles/event-handler/puzzleObject.d.ts +21 -10
  44. package/dist/components/game/organisms/puzzles/state-architect/StateJsonView.d.ts +2 -1
  45. package/dist/components/index.cjs +1771 -1614
  46. package/dist/components/index.js +650 -493
  47. package/dist/docs/index.cjs +107 -104
  48. package/dist/docs/index.d.cts +2 -0
  49. package/dist/docs/index.js +38 -35
  50. package/dist/lib/getNestedValue.d.ts +2 -13
  51. package/dist/marketing/index.cjs +97 -98
  52. package/dist/marketing/index.d.cts +2 -0
  53. package/dist/marketing/index.js +54 -55
  54. package/dist/providers/index.cjs +1744 -1587
  55. package/dist/providers/index.js +635 -478
  56. package/dist/runtime/index.cjs +1802 -1645
  57. package/dist/runtime/index.js +641 -484
  58. package/package.json +1 -1
  59. package/themes/almadar-website.css +2 -2
  60. package/themes/almadar.css +2 -2
  61. package/themes/arctic.css +2 -2
  62. package/themes/kiosk.css +2 -2
  63. package/themes/lavender.css +3 -3
  64. package/themes/midnight.css +2 -2
  65. package/themes/neon.css +2 -2
  66. package/themes/notion-editorial.css +2 -2
  67. package/themes/sunset.css +2 -2
  68. package/themes/trait-wars.css +2 -2
package/dist/avl/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import * as React94 from 'react';
3
- import React94__default, { createContext, useState, useMemo, useRef, useEffect, useContext, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, useSyncExternalStore, lazy, useId, forwardRef, useImperativeHandle, Component } from 'react';
2
+ import * as React98 from 'react';
3
+ import React98__default, { createContext, useState, useMemo, useRef, useEffect, useContext, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, useSyncExternalStore, lazy, useId, forwardRef, useImperativeHandle, Component } from 'react';
4
4
  import { OrbitalProvider, EventBusContext, useTraitScope, VerificationProvider, TraitScopeProvider } from '@almadar/ui/providers';
5
5
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
6
6
  import ELK from 'elkjs/lib/elk.bundled.js';
@@ -3181,9 +3181,8 @@ var init_Typography = __esm({
3181
3181
  }) => {
3182
3182
  const variant = variantProp ?? (level ? `h${level}` : "body1");
3183
3183
  const Component2 = as || defaultElements[variant];
3184
- const Comp = Component2;
3185
- return /* @__PURE__ */ jsx(
3186
- Comp,
3184
+ return React98__default.createElement(
3185
+ Component2,
3187
3186
  {
3188
3187
  id,
3189
3188
  className: cn(
@@ -3196,9 +3195,9 @@ var init_Typography = __esm({
3196
3195
  overflow && overflowStyles[overflow],
3197
3196
  className
3198
3197
  ),
3199
- style,
3200
- children: children ?? content
3201
- }
3198
+ style
3199
+ },
3200
+ children ?? content
3202
3201
  );
3203
3202
  };
3204
3203
  Typography.displayName = "Typography";
@@ -3519,7 +3518,7 @@ var init_Box = __esm({
3519
3518
  fixed: "fixed",
3520
3519
  sticky: "sticky"
3521
3520
  };
3522
- Box = React94__default.forwardRef(
3521
+ Box = React98__default.forwardRef(
3523
3522
  ({
3524
3523
  padding,
3525
3524
  paddingX,
@@ -3584,7 +3583,7 @@ var init_Box = __esm({
3584
3583
  onPointerDown?.(e);
3585
3584
  }, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
3586
3585
  const isClickable = action || onClick;
3587
- return React94__default.createElement(
3586
+ return React98__default.createElement(
3588
3587
  Component2,
3589
3588
  {
3590
3589
  ref,
@@ -3680,9 +3679,8 @@ var init_Stack = __esm({
3680
3679
  };
3681
3680
  const isHorizontal = direction === "horizontal";
3682
3681
  const directionClass = responsive && isHorizontal ? reverse ? "flex-col-reverse md:flex-row-reverse" : "flex-col md:flex-row" : isHorizontal ? reverse ? "flex-row-reverse" : "flex-row" : reverse ? "flex-col-reverse" : "flex-col";
3683
- const Comp = Component2;
3684
- return /* @__PURE__ */ jsx(
3685
- Comp,
3682
+ return React98__default.createElement(
3683
+ Component2,
3686
3684
  {
3687
3685
  className: cn(
3688
3686
  "flex",
@@ -3698,9 +3696,9 @@ var init_Stack = __esm({
3698
3696
  onClick: action || onClick ? handleClick : void 0,
3699
3697
  onKeyDown,
3700
3698
  role,
3701
- tabIndex,
3702
- children
3703
- }
3699
+ tabIndex
3700
+ },
3701
+ children
3704
3702
  );
3705
3703
  };
3706
3704
  VStack = (props) => /* @__PURE__ */ jsx(Stack, { direction: "vertical", ...props });
@@ -4078,9 +4076,9 @@ async function computeTraitLayout(data) {
4078
4076
  y: n.y ?? 0,
4079
4077
  width: n.width ?? 110,
4080
4078
  height: n.height ?? STATE_H,
4081
- isInitial: stateInfo?.isInitial,
4082
- isTerminal: stateInfo?.isTerminal,
4083
- role: getStateRole(name, stateInfo?.isInitial, stateInfo?.isTerminal, tc, maxTC),
4079
+ isInitial: stateInfo?.isInitial ?? void 0,
4080
+ isTerminal: stateInfo?.isTerminal ?? void 0,
4081
+ role: getStateRole(name, stateInfo?.isInitial ?? void 0, stateInfo?.isTerminal ?? void 0, tc, maxTC),
4084
4082
  transitionCount: tc
4085
4083
  };
4086
4084
  });
@@ -4091,12 +4089,10 @@ async function computeTraitLayout(data) {
4091
4089
  const sections = e.sections ?? [];
4092
4090
  const points = [];
4093
4091
  for (const section of sections) {
4094
- const startPoint = section.startPoint;
4095
- const endPoint = section.endPoint;
4096
4092
  const bendPoints = section.bendPoints ?? [];
4097
- points.push({ x: startPoint.x, y: startPoint.y });
4093
+ points.push({ x: section.startPoint.x, y: section.startPoint.y });
4098
4094
  for (const bp of bendPoints) points.push({ x: bp.x, y: bp.y });
4099
- points.push({ x: endPoint.x, y: endPoint.y });
4095
+ points.push({ x: section.endPoint.x, y: section.endPoint.y });
4100
4096
  }
4101
4097
  const isSelf = t.from === t.to;
4102
4098
  const isBackward = !isSelf && (nodeXMap[t.to] ?? 0) <= (nodeXMap[t.from] ?? 0);
@@ -4174,8 +4170,8 @@ var init_MiniStateMachine = __esm({
4174
4170
  states.map((s, i) => {
4175
4171
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
4176
4172
  const tc = transitionCounts[s.name] ?? 0;
4177
- const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
4178
- return /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
4173
+ const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
4174
+ return /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
4179
4175
  /* @__PURE__ */ jsx(
4180
4176
  AvlState,
4181
4177
  {
@@ -4185,8 +4181,8 @@ var init_MiniStateMachine = __esm({
4185
4181
  height: NODE_H,
4186
4182
  name: "",
4187
4183
  role,
4188
- isInitial: s.isInitial,
4189
- isTerminal: s.isTerminal
4184
+ isInitial: s.isInitial ?? void 0,
4185
+ isTerminal: s.isTerminal ?? void 0
4190
4186
  }
4191
4187
  ),
4192
4188
  i < states.length - 1 && /* @__PURE__ */ jsxs("g", { children: [
@@ -4550,7 +4546,7 @@ function loadLib(key, importer) {
4550
4546
  return p2;
4551
4547
  }
4552
4548
  function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
4553
- const Lazy = React94__default.lazy(async () => {
4549
+ const Lazy = React98__default.lazy(async () => {
4554
4550
  const lib = await loadLib(libKey, importer);
4555
4551
  const Comp = pick(lib);
4556
4552
  if (!Comp) {
@@ -4560,7 +4556,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
4560
4556
  return { default: Comp };
4561
4557
  });
4562
4558
  const Wrapped = (props) => /* @__PURE__ */ jsx(
4563
- React94__default.Suspense,
4559
+ React98__default.Suspense,
4564
4560
  {
4565
4561
  fallback: /* @__PURE__ */ jsx(
4566
4562
  "span",
@@ -5228,9 +5224,10 @@ function resolveIcon(name) {
5228
5224
  function doResolve(name) {
5229
5225
  if (iconAliases[name]) return iconAliases[name];
5230
5226
  const pascalName = kebabToPascal2(name);
5231
- const directLookup = LucideIcons2[pascalName];
5227
+ const lucideMap = LucideIcons2;
5228
+ const directLookup = lucideMap[pascalName];
5232
5229
  if (directLookup && typeof directLookup === "object") return directLookup;
5233
- const asIs = LucideIcons2[name];
5230
+ const asIs = lucideMap[name];
5234
5231
  if (asIs && typeof asIs === "object") return asIs;
5235
5232
  return LucideIcons2.HelpCircle;
5236
5233
  }
@@ -5286,7 +5283,7 @@ var init_Icon = __esm({
5286
5283
  const directIcon = typeof icon === "string" ? void 0 : icon;
5287
5284
  const effectiveName = typeof icon === "string" ? icon : name;
5288
5285
  const family = useIconFamily();
5289
- const RenderedComponent = React94__default.useMemo(() => {
5286
+ const RenderedComponent = React98__default.useMemo(() => {
5290
5287
  if (directIcon) return null;
5291
5288
  return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
5292
5289
  }, [directIcon, effectiveName, family]);
@@ -5336,6 +5333,9 @@ var init_Icon = __esm({
5336
5333
  Icon.displayName = "Icon";
5337
5334
  }
5338
5335
  });
5336
+ function isIconLike(v) {
5337
+ return typeof v.render === "function";
5338
+ }
5339
5339
  function resolveIconProp(value, sizeClass) {
5340
5340
  if (!value) return null;
5341
5341
  if (typeof value === "string") {
@@ -5345,10 +5345,10 @@ function resolveIconProp(value, sizeClass) {
5345
5345
  const IconComp = value;
5346
5346
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
5347
5347
  }
5348
- if (React94__default.isValidElement(value)) {
5348
+ if (React98__default.isValidElement(value)) {
5349
5349
  return value;
5350
5350
  }
5351
- if (typeof value === "object" && value !== null && "render" in value) {
5351
+ if (typeof value === "object" && value !== null && isIconLike(value)) {
5352
5352
  const IconComp = value;
5353
5353
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
5354
5354
  }
@@ -5421,7 +5421,7 @@ var init_Button = __esm({
5421
5421
  md: "h-icon-default w-icon-default",
5422
5422
  lg: "h-icon-default w-icon-default"
5423
5423
  };
5424
- Button = React94__default.forwardRef(
5424
+ Button = React98__default.forwardRef(
5425
5425
  ({
5426
5426
  className,
5427
5427
  variant = "primary",
@@ -5437,6 +5437,7 @@ var init_Button = __esm({
5437
5437
  label,
5438
5438
  children,
5439
5439
  onClick,
5440
+ "data-testid": dataTestId,
5440
5441
  ...props
5441
5442
  }, ref) => {
5442
5443
  const eventBus = useEventBus();
@@ -5469,7 +5470,7 @@ var init_Button = __esm({
5469
5470
  ),
5470
5471
  onClick: handleClick,
5471
5472
  ...props,
5472
- "data-testid": props["data-testid"] ?? (action ? `action-${action}` : void 0),
5473
+ "data-testid": dataTestId ?? (action ? `action-${action}` : void 0),
5473
5474
  children: [
5474
5475
  isLoading ? /* @__PURE__ */ jsx(Loader2, { className: "h-icon-default w-icon-default animate-spin" }) : resolvedLeftIcon && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: resolvedLeftIcon }),
5475
5476
  children || label,
@@ -5486,7 +5487,7 @@ var Dialog;
5486
5487
  var init_Dialog = __esm({
5487
5488
  "components/core/atoms/Dialog.tsx"() {
5488
5489
  init_cn();
5489
- Dialog = React94__default.forwardRef(
5490
+ Dialog = React98__default.forwardRef(
5490
5491
  ({
5491
5492
  role = "dialog",
5492
5493
  "aria-modal": ariaModal = true,
@@ -5981,7 +5982,7 @@ var init_Badge = __esm({
5981
5982
  md: "px-2.5 py-1 text-sm",
5982
5983
  lg: "px-3 py-1.5 text-base"
5983
5984
  };
5984
- Badge = React94__default.forwardRef(
5985
+ Badge = React98__default.forwardRef(
5985
5986
  ({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
5986
5987
  const iconSizes3 = {
5987
5988
  sm: "h-icon-default w-icon-default",
@@ -6317,7 +6318,7 @@ var init_SvgFlow = __esm({
6317
6318
  width = 100,
6318
6319
  height = 100
6319
6320
  }) => {
6320
- const markerId = React94__default.useMemo(() => {
6321
+ const markerId = React98__default.useMemo(() => {
6321
6322
  flowIdCounter += 1;
6322
6323
  return `almadar-flow-arrow-${flowIdCounter}`;
6323
6324
  }, []);
@@ -6910,7 +6911,7 @@ var init_SvgRing = __esm({
6910
6911
  width = 100,
6911
6912
  height = 100
6912
6913
  }) => {
6913
- const gradientId = React94__default.useMemo(() => {
6914
+ const gradientId = React98__default.useMemo(() => {
6914
6915
  ringIdCounter += 1;
6915
6916
  return `almadar-ring-glow-${ringIdCounter}`;
6916
6917
  }, []);
@@ -7091,7 +7092,7 @@ var init_Input = __esm({
7091
7092
  init_cn();
7092
7093
  init_Icon();
7093
7094
  init_useEventBus();
7094
- Input = React94__default.forwardRef(
7095
+ Input = React98__default.forwardRef(
7095
7096
  ({
7096
7097
  className,
7097
7098
  inputType,
@@ -7251,7 +7252,7 @@ var Label;
7251
7252
  var init_Label = __esm({
7252
7253
  "components/core/atoms/Label.tsx"() {
7253
7254
  init_cn();
7254
- Label = React94__default.forwardRef(
7255
+ Label = React98__default.forwardRef(
7255
7256
  ({ className, required, children, ...props }, ref) => {
7256
7257
  return /* @__PURE__ */ jsxs(
7257
7258
  "label",
@@ -7278,7 +7279,7 @@ var init_Textarea = __esm({
7278
7279
  "components/core/atoms/Textarea.tsx"() {
7279
7280
  init_cn();
7280
7281
  init_useEventBus();
7281
- Textarea = React94__default.forwardRef(
7282
+ Textarea = React98__default.forwardRef(
7282
7283
  ({ className, error, onChange, ...props }, ref) => {
7283
7284
  const eventBus = useEventBus();
7284
7285
  const handleChange = (e) => {
@@ -7517,7 +7518,7 @@ var init_Select = __esm({
7517
7518
  init_cn();
7518
7519
  init_Icon();
7519
7520
  init_useEventBus();
7520
- Select = React94__default.forwardRef(
7521
+ Select = React98__default.forwardRef(
7521
7522
  (props, _ref) => {
7522
7523
  const { multiple, searchable, clearable } = props;
7523
7524
  if (multiple || searchable || clearable) {
@@ -7534,7 +7535,7 @@ var init_Checkbox = __esm({
7534
7535
  "components/core/atoms/Checkbox.tsx"() {
7535
7536
  init_cn();
7536
7537
  init_useEventBus();
7537
- Checkbox = React94__default.forwardRef(
7538
+ Checkbox = React98__default.forwardRef(
7538
7539
  ({ className, label, id, onChange, ...props }, ref) => {
7539
7540
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
7540
7541
  const eventBus = useEventBus();
@@ -7588,7 +7589,7 @@ var init_Spinner = __esm({
7588
7589
  md: "h-6 w-6",
7589
7590
  lg: "h-8 w-8"
7590
7591
  };
7591
- Spinner = React94__default.forwardRef(
7592
+ Spinner = React98__default.forwardRef(
7592
7593
  ({ className, size = "md", overlay, ...props }, ref) => {
7593
7594
  if (overlay) {
7594
7595
  return /* @__PURE__ */ jsx(
@@ -7678,7 +7679,7 @@ var init_Card = __esm({
7678
7679
  chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
7679
7680
  "tile-image-first": "p-0 overflow-hidden"
7680
7681
  };
7681
- Card = React94__default.forwardRef(
7682
+ Card = React98__default.forwardRef(
7682
7683
  ({
7683
7684
  className,
7684
7685
  variant = "bordered",
@@ -7726,9 +7727,9 @@ var init_Card = __esm({
7726
7727
  }
7727
7728
  );
7728
7729
  Card.displayName = "Card";
7729
- CardHeader = React94__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
7730
+ CardHeader = React98__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
7730
7731
  CardHeader.displayName = "CardHeader";
7731
- CardTitle = React94__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7732
+ CardTitle = React98__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7732
7733
  "h3",
7733
7734
  {
7734
7735
  ref,
@@ -7741,11 +7742,11 @@ var init_Card = __esm({
7741
7742
  }
7742
7743
  ));
7743
7744
  CardTitle.displayName = "CardTitle";
7744
- CardContent = React94__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
7745
+ CardContent = React98__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
7745
7746
  CardContent.displayName = "CardContent";
7746
7747
  CardBody = CardContent;
7747
7748
  CardBody.displayName = "CardBody";
7748
- CardFooter = React94__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7749
+ CardFooter = React98__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7749
7750
  "div",
7750
7751
  {
7751
7752
  ref,
@@ -7800,7 +7801,7 @@ var init_FilterPill = __esm({
7800
7801
  md: "w-3.5 h-3.5",
7801
7802
  lg: "w-4 h-4"
7802
7803
  };
7803
- FilterPill = React94__default.forwardRef(
7804
+ FilterPill = React98__default.forwardRef(
7804
7805
  ({
7805
7806
  className,
7806
7807
  variant = "default",
@@ -7929,8 +7930,8 @@ var init_Avatar = __esm({
7929
7930
  actionPayload
7930
7931
  }) => {
7931
7932
  const eventBus = useEventBus();
7932
- const [imgFailed, setImgFailed] = React94__default.useState(false);
7933
- React94__default.useEffect(() => {
7933
+ const [imgFailed, setImgFailed] = React98__default.useState(false);
7934
+ React98__default.useEffect(() => {
7934
7935
  setImgFailed(false);
7935
7936
  }, [src]);
7936
7937
  const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
@@ -8043,22 +8044,18 @@ var init_Center = __esm({
8043
8044
  as: Component2 = "div"
8044
8045
  }) => {
8045
8046
  const mergedStyle = minHeight ? { minHeight, ...style } : style;
8046
- const Comp = Component2;
8047
- return /* @__PURE__ */ jsx(
8048
- Comp,
8049
- {
8050
- className: cn(
8051
- inline ? "inline-flex" : "flex",
8052
- horizontal && "justify-center",
8053
- vertical && "items-center",
8054
- fullHeight && "h-full",
8055
- fullWidth && "w-full",
8056
- className
8057
- ),
8058
- style: mergedStyle,
8059
- children
8060
- }
8061
- );
8047
+ return React98__default.createElement(Component2, {
8048
+ className: cn(
8049
+ inline ? "inline-flex" : "flex",
8050
+ horizontal && "justify-center",
8051
+ vertical && "items-center",
8052
+ fullHeight && "h-full",
8053
+ fullWidth && "w-full",
8054
+ className
8055
+ ),
8056
+ style: mergedStyle,
8057
+ children
8058
+ });
8062
8059
  };
8063
8060
  }
8064
8061
  });
@@ -8315,7 +8312,7 @@ var init_Radio = __esm({
8315
8312
  md: "w-2.5 h-2.5",
8316
8313
  lg: "w-3 h-3"
8317
8314
  };
8318
- Radio = React94__default.forwardRef(
8315
+ Radio = React98__default.forwardRef(
8319
8316
  ({
8320
8317
  label,
8321
8318
  helperText,
@@ -8332,12 +8329,12 @@ var init_Radio = __esm({
8332
8329
  onChange,
8333
8330
  ...props
8334
8331
  }, ref) => {
8335
- const reactId = React94__default.useId();
8332
+ const reactId = React98__default.useId();
8336
8333
  const baseId = id || `radio-${reactId}`;
8337
8334
  const hasError = !!error;
8338
8335
  const eventBus = useEventBus();
8339
- const [selected, setSelected] = React94__default.useState(value);
8340
- React94__default.useEffect(() => {
8336
+ const [selected, setSelected] = React98__default.useState(value);
8337
+ React98__default.useEffect(() => {
8341
8338
  if (value !== void 0) setSelected(value);
8342
8339
  }, [value]);
8343
8340
  const pick = (next, e) => {
@@ -8519,7 +8516,7 @@ var init_Switch = __esm({
8519
8516
  "components/core/atoms/Switch.tsx"() {
8520
8517
  "use client";
8521
8518
  init_cn();
8522
- Switch = React94.forwardRef(
8519
+ Switch = React98.forwardRef(
8523
8520
  ({
8524
8521
  checked,
8525
8522
  defaultChecked = false,
@@ -8530,10 +8527,10 @@ var init_Switch = __esm({
8530
8527
  name,
8531
8528
  className
8532
8529
  }, ref) => {
8533
- const [isChecked, setIsChecked] = React94.useState(
8530
+ const [isChecked, setIsChecked] = React98.useState(
8534
8531
  checked !== void 0 ? checked : defaultChecked
8535
8532
  );
8536
- React94.useEffect(() => {
8533
+ React98.useEffect(() => {
8537
8534
  if (checked !== void 0) {
8538
8535
  setIsChecked(checked);
8539
8536
  }
@@ -8807,7 +8804,7 @@ var Aside;
8807
8804
  var init_Aside = __esm({
8808
8805
  "components/core/atoms/Aside.tsx"() {
8809
8806
  init_cn();
8810
- Aside = React94__default.forwardRef(
8807
+ Aside = React98__default.forwardRef(
8811
8808
  ({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
8812
8809
  );
8813
8810
  Aside.displayName = "Aside";
@@ -8886,9 +8883,9 @@ var init_LawReferenceTooltip = __esm({
8886
8883
  className
8887
8884
  }) => {
8888
8885
  const { t } = useTranslate();
8889
- const [isVisible, setIsVisible] = React94__default.useState(false);
8890
- const timeoutRef = React94__default.useRef(null);
8891
- const triggerRef = React94__default.useRef(null);
8886
+ const [isVisible, setIsVisible] = React98__default.useState(false);
8887
+ const timeoutRef = React98__default.useRef(null);
8888
+ const triggerRef = React98__default.useRef(null);
8892
8889
  const handleMouseEnter = () => {
8893
8890
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
8894
8891
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -8899,7 +8896,7 @@ var init_LawReferenceTooltip = __esm({
8899
8896
  };
8900
8897
  const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
8901
8898
  const open = isVisible || revealed;
8902
- React94__default.useEffect(() => {
8899
+ React98__default.useEffect(() => {
8903
8900
  return () => {
8904
8901
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
8905
8902
  };
@@ -9111,7 +9108,7 @@ var init_StatusDot = __esm({
9111
9108
  md: "w-2.5 h-2.5",
9112
9109
  lg: "w-3 h-3"
9113
9110
  };
9114
- StatusDot = React94__default.forwardRef(
9111
+ StatusDot = React98__default.forwardRef(
9115
9112
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
9116
9113
  return /* @__PURE__ */ jsx(
9117
9114
  "span",
@@ -9165,7 +9162,7 @@ var init_TrendIndicator = __esm({
9165
9162
  down: "trending-down",
9166
9163
  flat: "arrow-right"
9167
9164
  };
9168
- TrendIndicator = React94__default.forwardRef(
9165
+ TrendIndicator = React98__default.forwardRef(
9169
9166
  ({
9170
9167
  className,
9171
9168
  value,
@@ -9232,7 +9229,7 @@ var init_RangeSlider = __esm({
9232
9229
  md: "w-4 h-4",
9233
9230
  lg: "w-5 h-5"
9234
9231
  };
9235
- RangeSlider = React94__default.forwardRef(
9232
+ RangeSlider = React98__default.forwardRef(
9236
9233
  ({
9237
9234
  className,
9238
9235
  min = 0,
@@ -9740,7 +9737,7 @@ var init_ContentSection = __esm({
9740
9737
  md: "py-16",
9741
9738
  lg: "py-24"
9742
9739
  };
9743
- ContentSection = React94__default.forwardRef(
9740
+ ContentSection = React98__default.forwardRef(
9744
9741
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
9745
9742
  return /* @__PURE__ */ jsx(
9746
9743
  Box,
@@ -10274,7 +10271,7 @@ var init_AnimatedReveal = __esm({
10274
10271
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
10275
10272
  "none": {}
10276
10273
  };
10277
- AnimatedReveal = React94__default.forwardRef(
10274
+ AnimatedReveal = React98__default.forwardRef(
10278
10275
  ({
10279
10276
  trigger = "scroll",
10280
10277
  animation = "fade-up",
@@ -10434,7 +10431,7 @@ var init_AnimatedGraphic = __esm({
10434
10431
  "components/marketing/atoms/AnimatedGraphic.tsx"() {
10435
10432
  "use client";
10436
10433
  init_cn();
10437
- AnimatedGraphic = React94__default.forwardRef(
10434
+ AnimatedGraphic = React98__default.forwardRef(
10438
10435
  ({
10439
10436
  src,
10440
10437
  svgContent,
@@ -10457,7 +10454,7 @@ var init_AnimatedGraphic = __esm({
10457
10454
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
10458
10455
  const resolvedSvg = svgContent ?? fetchedSvg;
10459
10456
  const prevAnimateRef = useRef(animate);
10460
- const setRef = React94__default.useCallback(
10457
+ const setRef = React98__default.useCallback(
10461
10458
  (node) => {
10462
10459
  containerRef.current = node;
10463
10460
  if (typeof ref === "function") ref(node);
@@ -10674,18 +10671,18 @@ var init_HealthBar = __esm({
10674
10671
  function ScoreDisplay({
10675
10672
  assetUrl = DEFAULT_ASSET_URL,
10676
10673
  value,
10674
+ score,
10677
10675
  label,
10678
10676
  icon,
10679
10677
  size = "md",
10680
10678
  className,
10681
10679
  animated = true,
10682
- locale = "en-US",
10683
- ...rest
10680
+ locale = "en-US"
10684
10681
  }) {
10685
- const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
10686
- const [displayValue, setDisplayValue] = React94.useState(resolvedValue);
10687
- const [isAnimating, setIsAnimating] = React94.useState(false);
10688
- React94.useEffect(() => {
10682
+ const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof score === "number" && !Number.isNaN(score) ? score : 0;
10683
+ const [displayValue, setDisplayValue] = React98.useState(resolvedValue);
10684
+ const [isAnimating, setIsAnimating] = React98.useState(false);
10685
+ React98.useEffect(() => {
10689
10686
  if (!animated || displayValue === resolvedValue) {
10690
10687
  setDisplayValue(resolvedValue);
10691
10688
  return;
@@ -10768,9 +10765,9 @@ function ControlButton({
10768
10765
  className
10769
10766
  }) {
10770
10767
  const eventBus = useEventBus();
10771
- const [isPressed, setIsPressed] = React94.useState(false);
10768
+ const [isPressed, setIsPressed] = React98.useState(false);
10772
10769
  const actualPressed = pressed ?? isPressed;
10773
- const handlePointerDown = React94.useCallback(
10770
+ const handlePointerDown = React98.useCallback(
10774
10771
  (e) => {
10775
10772
  e.preventDefault();
10776
10773
  if (disabled) return;
@@ -10780,7 +10777,7 @@ function ControlButton({
10780
10777
  },
10781
10778
  [disabled, pressEvent, eventBus, onPress]
10782
10779
  );
10783
- const handlePointerUp = React94.useCallback(
10780
+ const handlePointerUp = React98.useCallback(
10784
10781
  (e) => {
10785
10782
  e.preventDefault();
10786
10783
  if (disabled) return;
@@ -10790,7 +10787,7 @@ function ControlButton({
10790
10787
  },
10791
10788
  [disabled, releaseEvent, eventBus, onRelease]
10792
10789
  );
10793
- const handlePointerLeave = React94.useCallback(
10790
+ const handlePointerLeave = React98.useCallback(
10794
10791
  (e) => {
10795
10792
  if (isPressed) {
10796
10793
  setIsPressed(false);
@@ -11419,8 +11416,8 @@ function XPBar({
11419
11416
  }) {
11420
11417
  const sizes = sizeMap9[size];
11421
11418
  const percentage = max > 0 ? Math.max(0, Math.min(100, current / max * 100)) : 0;
11422
- const [fillWidth, setFillWidth] = React94.useState(animated ? 0 : percentage);
11423
- React94.useEffect(() => {
11419
+ const [fillWidth, setFillWidth] = React98.useState(animated ? 0 : percentage);
11420
+ React98.useEffect(() => {
11424
11421
  if (!animated) {
11425
11422
  setFillWidth(percentage);
11426
11423
  return;
@@ -11928,9 +11925,9 @@ function MiniMap({
11928
11925
  viewportRect = DEFAULT_VIEWPORT,
11929
11926
  className
11930
11927
  }) {
11931
- const canvasRef = React94.useRef(null);
11932
- const frameRef = React94.useRef(0);
11933
- React94.useEffect(() => {
11928
+ const canvasRef = React98.useRef(null);
11929
+ const frameRef = React98.useRef(0);
11930
+ React98.useEffect(() => {
11934
11931
  const canvas = canvasRef.current;
11935
11932
  if (!canvas) return;
11936
11933
  const ctx = canvas.getContext("2d");
@@ -12119,7 +12116,7 @@ var init_ErrorBoundary = __esm({
12119
12116
  }
12120
12117
  );
12121
12118
  };
12122
- ErrorBoundary = class extends React94__default.Component {
12119
+ ErrorBoundary = class extends React98__default.Component {
12123
12120
  constructor(props) {
12124
12121
  super(props);
12125
12122
  __publicField(this, "reset", () => {
@@ -12430,9 +12427,8 @@ var init_Container = __esm({
12430
12427
  as: Component2 = "div"
12431
12428
  }) => {
12432
12429
  const resolvedSize = maxWidth ?? size ?? "lg";
12433
- const Comp = Component2;
12434
- return /* @__PURE__ */ jsx(
12435
- Comp,
12430
+ return React98__default.createElement(
12431
+ Component2,
12436
12432
  {
12437
12433
  className: cn(
12438
12434
  "w-full",
@@ -12440,9 +12436,9 @@ var init_Container = __esm({
12440
12436
  paddingStyles3[padding],
12441
12437
  center && "mx-auto",
12442
12438
  className
12443
- ),
12444
- children
12445
- }
12439
+ )
12440
+ },
12441
+ children
12446
12442
  );
12447
12443
  };
12448
12444
  Container.displayName = "Container";
@@ -13154,8 +13150,8 @@ function ActionButtons({
13154
13150
  disabled
13155
13151
  }) {
13156
13152
  const eventBus = useEventBus();
13157
- const [activeButtons, setActiveButtons] = React94.useState(/* @__PURE__ */ new Set());
13158
- const handlePress = React94.useCallback(
13153
+ const [activeButtons, setActiveButtons] = React98.useState(/* @__PURE__ */ new Set());
13154
+ const handlePress = React98.useCallback(
13159
13155
  (id) => {
13160
13156
  setActiveButtons((prev) => new Set(prev).add(id));
13161
13157
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -13163,7 +13159,7 @@ function ActionButtons({
13163
13159
  },
13164
13160
  [actionEvent, eventBus, onAction]
13165
13161
  );
13166
- const handleRelease = React94.useCallback(
13162
+ const handleRelease = React98.useCallback(
13167
13163
  (id) => {
13168
13164
  setActiveButtons((prev) => {
13169
13165
  const next = new Set(prev);
@@ -15662,9 +15658,37 @@ function BattleBoard({
15662
15658
  className
15663
15659
  }) {
15664
15660
  const board = boardEntity(entity) ?? {};
15665
- const rawTiles = propTiles ?? (Array.isArray(board.tiles) ? board.tiles : []);
15661
+ function asFieldObj(v) {
15662
+ if (v === null || typeof v !== "object" || Array.isArray(v) || v instanceof Date) return null;
15663
+ return v;
15664
+ }
15665
+ const rawTiles = propTiles ?? (Array.isArray(board.tiles) ? board.tiles.flatMap((v) => {
15666
+ const o = asFieldObj(v);
15667
+ if (o === null || typeof o.x !== "number" || typeof o.y !== "number") return [];
15668
+ const tile = { x: o.x, y: o.y };
15669
+ if (typeof o.terrain === "string") tile.terrain = o.terrain;
15670
+ if (typeof o.terrainSprite === "string") tile.terrainSprite = o.terrainSprite;
15671
+ if (typeof o.passable === "boolean") tile.passable = o.passable;
15672
+ if (typeof o.movementCost === "number") tile.movementCost = o.movementCost;
15673
+ if (typeof o.elevation === "number") tile.elevation = o.elevation;
15674
+ if (typeof o.type === "string") tile.type = o.type;
15675
+ if (typeof o.tileType === "string") tile.tileType = o.tileType;
15676
+ if (typeof o.id === "string") tile.id = o.id;
15677
+ if (typeof o.modelUrl === "string") tile.modelUrl = o.modelUrl;
15678
+ return [tile];
15679
+ }) : []);
15666
15680
  const tiles = rawTiles.length === 0 ? DEFAULT_BATTLE_TILES : rawTiles;
15667
- const features = propFeatures ?? (Array.isArray(board.features) ? board.features : []);
15681
+ const features = propFeatures ?? (Array.isArray(board.features) ? board.features.flatMap((v) => {
15682
+ const o = asFieldObj(v);
15683
+ if (o === null || typeof o.type !== "string" || typeof o.x !== "number" || typeof o.y !== "number") return [];
15684
+ const feat = { type: o.type, x: o.x, y: o.y };
15685
+ if (typeof o.id === "string") feat.id = o.id;
15686
+ if (typeof o.sprite === "string") feat.sprite = o.sprite;
15687
+ if (typeof o.color === "string") feat.color = o.color;
15688
+ if (typeof o.elevation === "number") feat.elevation = o.elevation;
15689
+ if (typeof o.assetUrl === "string") feat.assetUrl = o.assetUrl;
15690
+ return [feat];
15691
+ }) : []);
15668
15692
  const boardWidth = num(board.gridWidth ?? board.boardWidth, BATTLE_GRID_W);
15669
15693
  const boardHeight = num(board.gridHeight ?? board.boardHeight, BATTLE_GRID_H);
15670
15694
  const assetManifest = propAssetManifest ?? board.assetManifest;
@@ -15763,7 +15787,12 @@ function BattleBoard({
15763
15787
  return units.filter((u) => unitHealth(u) > 0).map((unit) => {
15764
15788
  const id = str(unit.id);
15765
15789
  const pos = movingPositions.get(id) ?? unitPosition(unit);
15766
- const unitTraits = Array.isArray(unit.traits) ? unit.traits : void 0;
15790
+ const unitTraits = Array.isArray(unit.traits) ? unit.traits.flatMap((v) => {
15791
+ const o = asFieldObj(v);
15792
+ if (o === null || typeof o.name !== "string" || typeof o.currentState !== "string" || !Array.isArray(o.states)) return [];
15793
+ const stateNames = Array.from(o.states).flatMap((s) => typeof s === "string" ? [s] : []);
15794
+ return [{ name: o.name, currentState: o.currentState, states: stateNames, cooldown: typeof o.cooldown === "number" ? o.cooldown : void 0 }];
15795
+ }) : void 0;
15767
15796
  return {
15768
15797
  id,
15769
15798
  position: pos,
@@ -16546,7 +16575,7 @@ var init_CodeBlock = __esm({
16546
16575
  };
16547
16576
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
16548
16577
  HIDDEN_LINE_NUMBERS = { display: "none" };
16549
- CodeBlock = React94__default.memo(
16578
+ CodeBlock = React98__default.memo(
16550
16579
  ({
16551
16580
  code: rawCode,
16552
16581
  language = "text",
@@ -17133,7 +17162,7 @@ var init_MarkdownContent = __esm({
17133
17162
  init_Box();
17134
17163
  init_CodeBlock();
17135
17164
  init_cn();
17136
- MarkdownContent = React94__default.memo(
17165
+ MarkdownContent = React98__default.memo(
17137
17166
  ({ content, direction = "ltr", className }) => {
17138
17167
  const { t: _t } = useTranslate();
17139
17168
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -18502,7 +18531,7 @@ var init_StateMachineView = __esm({
18502
18531
  style: { top: title ? 30 : 0 },
18503
18532
  children: [
18504
18533
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
18505
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React94__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
18534
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React98__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
18506
18535
  StateNode,
18507
18536
  {
18508
18537
  state,
@@ -19321,12 +19350,13 @@ var init_ContentRenderer = __esm({
19321
19350
  );
19322
19351
  case "orbital": {
19323
19352
  const parsed = segment.schema;
19353
+ const isFullSchema = (v) => Array.isArray(v.orbitals);
19324
19354
  const inlineTrait = {
19325
19355
  name: "inline",
19326
19356
  scope: "instance",
19327
19357
  stateMachine: parsed
19328
19358
  };
19329
- const schema = Array.isArray(parsed.orbitals) ? parsed : {
19359
+ const schema = isFullSchema(parsed) ? parsed : {
19330
19360
  name: "inline",
19331
19361
  orbitals: [{
19332
19362
  name: "inline",
@@ -20552,8 +20582,21 @@ function BuilderBoard({
20552
20582
  const resolved = boardEntity(entity);
20553
20583
  const [headerError, setHeaderError] = useState(false);
20554
20584
  const [selectedComponent, setSelectedComponent] = useState(null);
20555
- const components = Array.isArray(resolved?.components) ? resolved.components : [];
20556
- const slots = Array.isArray(resolved?.slots) ? resolved.slots : [];
20585
+ const components = rows(resolved?.components).map((r2) => ({
20586
+ id: str(r2.id),
20587
+ label: str(r2.label),
20588
+ description: str(r2.description) || void 0,
20589
+ iconEmoji: str(r2.iconEmoji) || void 0,
20590
+ iconUrl: str(r2.iconUrl) || void 0,
20591
+ category: str(r2.category) || void 0
20592
+ }));
20593
+ const slots = rows(resolved?.slots).map((r2) => ({
20594
+ id: str(r2.id),
20595
+ label: str(r2.label) || void 0,
20596
+ description: str(r2.description) || void 0,
20597
+ requiredComponentId: str(r2.requiredComponentId),
20598
+ placedComponentId: str(r2.placedComponentId) || void 0
20599
+ }));
20557
20600
  const placements = {};
20558
20601
  for (const slot of slots) {
20559
20602
  if (slot.placedComponentId) placements[slot.id] = slot.placedComponentId;
@@ -22457,7 +22500,7 @@ function CardHand({
22457
22500
  className
22458
22501
  }) {
22459
22502
  const eventBus = useEventBus();
22460
- const handleClick = React94.useCallback(
22503
+ const handleClick = React98.useCallback(
22461
22504
  (card) => {
22462
22505
  if (card.disabled) return;
22463
22506
  onCardClick?.(card.id);
@@ -23204,14 +23247,15 @@ var init_CardGrid = __esm({
23204
23247
  bodyFields.length > 0 && /* @__PURE__ */ jsx(Box, { className: "px-4 py-3 flex-1", children: /* @__PURE__ */ jsx(VStack, { gap: "xs", children: bodyFields.map((field) => {
23205
23248
  const value = getNestedValue(itemData, field);
23206
23249
  if (value === void 0 || value === null || value === "") return null;
23207
- const boolVal = asBooleanValue(value);
23250
+ const fieldValue = value;
23251
+ const boolVal = asBooleanValue(fieldValue);
23208
23252
  if (boolVal !== null) {
23209
23253
  return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-between", children: [
23210
23254
  /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: fieldLabel(field) }),
23211
23255
  boolVal ? /* @__PURE__ */ jsx(Badge, { variant: "success", children: t("common.yes") || "Yes" }) : /* @__PURE__ */ jsx(Badge, { variant: "neutral", children: t("common.no") || "No" })
23212
23256
  ] }, field);
23213
23257
  }
23214
- const displayValue = isDateField(field) ? formatDate(value) : STATUS_FIELDS.has(field.toLowerCase()) ? void 0 : String(value);
23258
+ const displayValue = isDateField(field) ? formatDate(fieldValue) : STATUS_FIELDS.has(field.toLowerCase()) ? void 0 : String(value);
23215
23259
  if (!displayValue) return null;
23216
23260
  return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-between", children: [
23217
23261
  /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: fieldLabel(field) }),
@@ -23596,9 +23640,9 @@ function CastleBoard({
23596
23640
  const eventBus = useEventBus();
23597
23641
  const { t } = useTranslate();
23598
23642
  const resolved = boardEntity(entity);
23599
- const tiles = propTiles ?? (Array.isArray(resolved?.tiles) ? resolved.tiles : []);
23600
- const features = propFeatures ?? (Array.isArray(resolved?.features) ? resolved.features : []);
23601
- const units = propUnits ?? (Array.isArray(resolved?.units) ? resolved.units : []);
23643
+ const tiles = propTiles ?? (resolved?.tiles ?? []);
23644
+ const features = propFeatures ?? (resolved?.features ?? []);
23645
+ const units = propUnits ?? (resolved?.units ?? []);
23602
23646
  const assetManifest = propAssetManifest ?? resolved?.assetManifest;
23603
23647
  const backgroundImage = resolved?.backgroundImage;
23604
23648
  const gold = num(resolved?.gold);
@@ -25133,8 +25177,8 @@ function ClassifierBoard({
25133
25177
  const { t } = useTranslate();
25134
25178
  const resolved = boardEntity(entity);
25135
25179
  const [headerError, setHeaderError] = useState(false);
25136
- const items = Array.isArray(resolved?.items) ? resolved.items : [];
25137
- const categories = Array.isArray(resolved?.categories) ? resolved.categories : [];
25180
+ const items = rows(resolved?.items);
25181
+ const categories = rows(resolved?.categories);
25138
25182
  const result = str(resolved?.result);
25139
25183
  const submitted = result === "win";
25140
25184
  const attempts = num(resolved?.attempts);
@@ -25935,7 +25979,7 @@ function CraftingRecipe({
25935
25979
  className
25936
25980
  }) {
25937
25981
  const eventBus = useEventBus();
25938
- const handleCraft = React94.useCallback(() => {
25982
+ const handleCraft = React98.useCallback(() => {
25939
25983
  onCraft?.();
25940
25984
  if (craftEvent) {
25941
25985
  eventBus.emit(craftEvent, { output: output.label });
@@ -25952,7 +25996,7 @@ function CraftingRecipe({
25952
25996
  children: [
25953
25997
  /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
25954
25998
  const hasSufficient = ingredient.available >= ingredient.required;
25955
- return /* @__PURE__ */ jsxs(React94.Fragment, { children: [
25999
+ return /* @__PURE__ */ jsxs(React98.Fragment, { children: [
25956
26000
  /* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
25957
26001
  ItemSlot,
25958
26002
  {
@@ -26024,8 +26068,8 @@ function DPad({
26024
26068
  }) {
26025
26069
  const eventBus = useEventBus();
26026
26070
  const sizes = sizeMap15[size];
26027
- const [activeDirections, setActiveDirections] = React94.useState(/* @__PURE__ */ new Set());
26028
- const handlePress = React94.useCallback(
26071
+ const [activeDirections, setActiveDirections] = React98.useState(/* @__PURE__ */ new Set());
26072
+ const handlePress = React98.useCallback(
26029
26073
  (direction) => {
26030
26074
  setActiveDirections((prev) => new Set(prev).add(direction));
26031
26075
  if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
@@ -26033,7 +26077,7 @@ function DPad({
26033
26077
  },
26034
26078
  [directionEvent, eventBus, onDirection]
26035
26079
  );
26036
- const handleRelease = React94.useCallback(
26080
+ const handleRelease = React98.useCallback(
26037
26081
  (direction) => {
26038
26082
  setActiveDirections((prev) => {
26039
26083
  const next = new Set(prev);
@@ -26918,8 +26962,8 @@ var init_Menu = __esm({
26918
26962
  "bottom-end": "bottom-start"
26919
26963
  };
26920
26964
  const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
26921
- const triggerChild = React94__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
26922
- const triggerElement = React94__default.cloneElement(
26965
+ const triggerChild = React98__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
26966
+ const triggerElement = React98__default.cloneElement(
26923
26967
  triggerChild,
26924
26968
  {
26925
26969
  ref: triggerRef,
@@ -27014,14 +27058,14 @@ function useDataDnd(args) {
27014
27058
  const isZone = Boolean(dragGroup || accepts || sortable);
27015
27059
  const enabled = isZone || Boolean(dndRoot);
27016
27060
  const eventBus = useEventBus();
27017
- const parentRoot = React94__default.useContext(RootCtx);
27061
+ const parentRoot = React98__default.useContext(RootCtx);
27018
27062
  const isRoot = enabled && parentRoot === null;
27019
- const zoneId = React94__default.useId();
27063
+ const zoneId = React98__default.useId();
27020
27064
  const ownGroup = dragGroup ?? accepts ?? zoneId;
27021
- const [optimisticOrders, setOptimisticOrders] = React94__default.useState(() => /* @__PURE__ */ new Map());
27022
- const optimisticOrdersRef = React94__default.useRef(optimisticOrders);
27065
+ const [optimisticOrders, setOptimisticOrders] = React98__default.useState(() => /* @__PURE__ */ new Map());
27066
+ const optimisticOrdersRef = React98__default.useRef(optimisticOrders);
27023
27067
  optimisticOrdersRef.current = optimisticOrders;
27024
- const clearOptimisticOrder = React94__default.useCallback((group) => {
27068
+ const clearOptimisticOrder = React98__default.useCallback((group) => {
27025
27069
  setOptimisticOrders((prev) => {
27026
27070
  if (!prev.has(group)) return prev;
27027
27071
  const next = new Map(prev);
@@ -27044,17 +27088,20 @@ function useDataDnd(args) {
27044
27088
  }
27045
27089
  const itemIdsSignature = orderedItems.map((it, idx) => {
27046
27090
  const raw = it[dndItemIdField];
27047
- return String(raw ?? `__idx_${idx}`);
27091
+ return raw != null ? String(raw) : `__idx_${idx}`;
27048
27092
  }).join("|");
27049
- const itemIds = React94__default.useMemo(
27093
+ const itemIds = React98__default.useMemo(
27050
27094
  () => orderedItems.map((it, idx) => {
27051
27095
  const raw = it[dndItemIdField];
27052
- return raw ?? `__idx_${idx}`;
27096
+ return raw != null ? String(raw) : `__idx_${idx}`;
27053
27097
  }),
27054
27098
  [itemIdsSignature]
27055
27099
  );
27056
- const itemsContentSig = items.map((it, idx) => String(it[dndItemIdField] ?? `__${idx}`)).join("|");
27057
- React94__default.useEffect(() => {
27100
+ const itemsContentSig = items.map((it, idx) => {
27101
+ const raw = it[dndItemIdField];
27102
+ return raw != null ? String(raw) : `__${idx}`;
27103
+ }).join("|");
27104
+ React98__default.useEffect(() => {
27058
27105
  const root = isRoot ? null : parentRoot;
27059
27106
  if (root) {
27060
27107
  root.clearOptimisticOrder(ownGroup);
@@ -27062,20 +27109,20 @@ function useDataDnd(args) {
27062
27109
  clearOptimisticOrder(ownGroup);
27063
27110
  }
27064
27111
  }, [itemsContentSig, ownGroup]);
27065
- const zonesRef = React94__default.useRef(/* @__PURE__ */ new Map());
27066
- const registerZone = React94__default.useCallback((zoneId2, meta2) => {
27112
+ const zonesRef = React98__default.useRef(/* @__PURE__ */ new Map());
27113
+ const registerZone = React98__default.useCallback((zoneId2, meta2) => {
27067
27114
  zonesRef.current.set(zoneId2, meta2);
27068
27115
  }, []);
27069
- const unregisterZone = React94__default.useCallback((zoneId2) => {
27116
+ const unregisterZone = React98__default.useCallback((zoneId2) => {
27070
27117
  zonesRef.current.delete(zoneId2);
27071
27118
  }, []);
27072
- const [activeDrag, setActiveDrag] = React94__default.useState(null);
27073
- const [overZoneGroup, setOverZoneGroup] = React94__default.useState(null);
27074
- const meta = React94__default.useMemo(
27119
+ const [activeDrag, setActiveDrag] = React98__default.useState(null);
27120
+ const [overZoneGroup, setOverZoneGroup] = React98__default.useState(null);
27121
+ const meta = React98__default.useMemo(
27075
27122
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
27076
27123
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
27077
27124
  );
27078
- React94__default.useEffect(() => {
27125
+ React98__default.useEffect(() => {
27079
27126
  const target = isRoot ? null : parentRoot;
27080
27127
  if (!target) {
27081
27128
  zonesRef.current.set(zoneId, meta);
@@ -27094,7 +27141,7 @@ function useDataDnd(args) {
27094
27141
  }, [parentRoot, isRoot, zoneId, meta]);
27095
27142
  const sensors = useAlmadarDndSensors(true);
27096
27143
  const collisionDetection = almadarDndCollisionDetection;
27097
- const findZoneByItem = React94__default.useCallback(
27144
+ const findZoneByItem = React98__default.useCallback(
27098
27145
  (id) => {
27099
27146
  for (const z of zonesRef.current.values()) {
27100
27147
  if (z.itemIds.includes(id)) return z;
@@ -27103,7 +27150,7 @@ function useDataDnd(args) {
27103
27150
  },
27104
27151
  []
27105
27152
  );
27106
- React94__default.useCallback(
27153
+ React98__default.useCallback(
27107
27154
  (group) => {
27108
27155
  for (const z of zonesRef.current.values()) {
27109
27156
  if (z.group === group) return z;
@@ -27112,7 +27159,7 @@ function useDataDnd(args) {
27112
27159
  },
27113
27160
  []
27114
27161
  );
27115
- const handleDragEnd = React94__default.useCallback(
27162
+ const handleDragEnd = React98__default.useCallback(
27116
27163
  (event) => {
27117
27164
  const { active, over } = event;
27118
27165
  const activeIdStr = String(active.id);
@@ -27203,8 +27250,8 @@ function useDataDnd(args) {
27203
27250
  },
27204
27251
  [eventBus]
27205
27252
  );
27206
- const sortableData = React94__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
27207
- const SortableItem = React94__default.useCallback(
27253
+ const sortableData = React98__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
27254
+ const SortableItem = React98__default.useCallback(
27208
27255
  ({ id, children }) => {
27209
27256
  const {
27210
27257
  attributes,
@@ -27244,7 +27291,7 @@ function useDataDnd(args) {
27244
27291
  id: droppableId,
27245
27292
  data: sortableData
27246
27293
  });
27247
- const ctx = React94__default.useContext(RootCtx);
27294
+ const ctx = React98__default.useContext(RootCtx);
27248
27295
  const activeDrag2 = ctx?.activeDrag ?? null;
27249
27296
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
27250
27297
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -27259,7 +27306,7 @@ function useDataDnd(args) {
27259
27306
  showForeignPlaceholder,
27260
27307
  ctxAvailable: ctx != null
27261
27308
  });
27262
- React94__default.useEffect(() => {
27309
+ React98__default.useEffect(() => {
27263
27310
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
27264
27311
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
27265
27312
  return /* @__PURE__ */ jsx(
@@ -27273,11 +27320,11 @@ function useDataDnd(args) {
27273
27320
  }
27274
27321
  );
27275
27322
  };
27276
- const rootContextValue = React94__default.useMemo(
27323
+ const rootContextValue = React98__default.useMemo(
27277
27324
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
27278
27325
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
27279
27326
  );
27280
- const handleDragStart = React94__default.useCallback((event) => {
27327
+ const handleDragStart = React98__default.useCallback((event) => {
27281
27328
  const sourceZone = findZoneByItem(event.active.id);
27282
27329
  const rect = event.active.rect.current.initial;
27283
27330
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -27296,7 +27343,7 @@ function useDataDnd(args) {
27296
27343
  isRoot
27297
27344
  });
27298
27345
  }, [findZoneByItem, isRoot, zoneId]);
27299
- const handleDragOver = React94__default.useCallback((event) => {
27346
+ const handleDragOver = React98__default.useCallback((event) => {
27300
27347
  const { active, over } = event;
27301
27348
  const overData = over?.data?.current;
27302
27349
  const overGroup = overData?.dndGroup ?? null;
@@ -27366,7 +27413,7 @@ function useDataDnd(args) {
27366
27413
  return next;
27367
27414
  });
27368
27415
  }, []);
27369
- const handleDragCancel = React94__default.useCallback((event) => {
27416
+ const handleDragCancel = React98__default.useCallback((event) => {
27370
27417
  setActiveDrag(null);
27371
27418
  setOverZoneGroup(null);
27372
27419
  dndLog.warn("dragCancel", {
@@ -27374,12 +27421,12 @@ function useDataDnd(args) {
27374
27421
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
27375
27422
  });
27376
27423
  }, []);
27377
- const handleDragEndWithCleanup = React94__default.useCallback((event) => {
27424
+ const handleDragEndWithCleanup = React98__default.useCallback((event) => {
27378
27425
  handleDragEnd(event);
27379
27426
  setActiveDrag(null);
27380
27427
  setOverZoneGroup(null);
27381
27428
  }, [handleDragEnd]);
27382
- const wrapContainer = React94__default.useCallback(
27429
+ const wrapContainer = React98__default.useCallback(
27383
27430
  (children) => {
27384
27431
  if (!enabled) return children;
27385
27432
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -27433,7 +27480,7 @@ var init_useDataDnd = __esm({
27433
27480
  init_useAlmadarDndCollision();
27434
27481
  init_Box();
27435
27482
  dndLog = createLogger("almadar:ui:dnd");
27436
- RootCtx = React94__default.createContext(null);
27483
+ RootCtx = React98__default.createContext(null);
27437
27484
  }
27438
27485
  });
27439
27486
  function renderIconInput(icon, props) {
@@ -27576,8 +27623,8 @@ function DataGrid({
27576
27623
  const hasRenderProp = typeof children === "function";
27577
27624
  useEffect(() => {
27578
27625
  if (data.length > 0 && !hasRenderProp && fieldDefs.length === 0) {
27579
- const renderItemRaw = schemaRenderItem;
27580
- const isFnLambda = Array.isArray(renderItemRaw) && renderItemRaw.length >= 3 && (renderItemRaw[0] === "fn" || renderItemRaw[0] === "lambda");
27626
+ const schemaArr = Array.isArray(schemaRenderItem) ? schemaRenderItem : null;
27627
+ const isFnLambda = schemaArr !== null && schemaArr.length >= 3 && (schemaArr[0] === "fn" || schemaArr[0] === "lambda");
27581
27628
  dataGridLog.warn("renderItem-unresolved", {
27582
27629
  rowCount: data.length,
27583
27630
  renderItemIsFnLambda: isFnLambda
@@ -27959,7 +28006,7 @@ function DataList({
27959
28006
  }) {
27960
28007
  const eventBus = useEventBus();
27961
28008
  const { t } = useTranslate();
27962
- const [visibleCount, setVisibleCount] = React94__default.useState(pageSize || Infinity);
28009
+ const [visibleCount, setVisibleCount] = React98__default.useState(pageSize || Infinity);
27963
28010
  const fieldDefs = fields ?? columns ?? [];
27964
28011
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
27965
28012
  const dnd = useDataDnd({
@@ -27978,21 +28025,20 @@ function DataList({
27978
28025
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
27979
28026
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
27980
28027
  const hasRenderProp = typeof children === "function";
27981
- React94__default.useEffect(() => {
28028
+ React98__default.useEffect(() => {
27982
28029
  const renderItemTypeOf = typeof schemaRenderItem;
27983
28030
  const childrenTypeOf = typeof children;
27984
28031
  if (data.length > 0 && !hasRenderProp) {
27985
28032
  const firstRow = data[0];
27986
28033
  const sampleKeys = firstRow ? Object.keys(firstRow).slice(0, 6) : [];
27987
- const renderItemRaw = schemaRenderItem;
27988
- const isFnLambda = Array.isArray(renderItemRaw) && renderItemRaw.length >= 3 && (renderItemRaw[0] === "fn" || renderItemRaw[0] === "lambda");
28034
+ const isFnLambda = Array.isArray(schemaRenderItem) && schemaRenderItem.length >= 3 && (schemaRenderItem[0] === "fn" || schemaRenderItem[0] === "lambda");
27989
28035
  dataListLog.warn("renderItem-unresolved", {
27990
28036
  rowCount: data.length,
27991
28037
  fieldsCount: fieldDefs.length,
27992
28038
  renderItemTypeOf,
27993
- renderItemIsArray: Array.isArray(renderItemRaw),
28039
+ renderItemIsArray: Array.isArray(schemaRenderItem),
27994
28040
  renderItemIsFnLambda: isFnLambda,
27995
- renderItemHead: Array.isArray(renderItemRaw) ? String(renderItemRaw[0]) : void 0,
28041
+ renderItemHead: Array.isArray(schemaRenderItem) ? String(schemaRenderItem[0]) : void 0,
27996
28042
  childrenTypeOf,
27997
28043
  sampleRowKeys: sampleKeys
27998
28044
  });
@@ -28080,10 +28126,10 @@ function DataList({
28080
28126
  const isCompact = variant === "compact";
28081
28127
  const isMessage = variant === "message";
28082
28128
  if (isMessage) {
28083
- const items2 = data.map((item) => item);
28129
+ const items2 = [...data];
28084
28130
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
28085
28131
  const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
28086
- return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
28132
+ return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
28087
28133
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
28088
28134
  group.items.map((itemData, index) => {
28089
28135
  const id = itemData.id || `${gi}-${index}`;
@@ -28129,7 +28175,7 @@ function DataList({
28129
28175
  })
28130
28176
  ] }, gi)) });
28131
28177
  }
28132
- const items = data.map((item) => item);
28178
+ const items = [...data];
28133
28179
  const groups = groupBy ? groupData(items, groupBy) : [{ label: "", items }];
28134
28180
  const idFieldName = dndItemIdField ?? "id";
28135
28181
  const renderItem = (itemData, index, isLast) => {
@@ -28224,7 +28270,7 @@ function DataList({
28224
28270
  className
28225
28271
  ),
28226
28272
  children: [
28227
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
28273
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
28228
28274
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
28229
28275
  group.items.map(
28230
28276
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -29017,23 +29063,19 @@ var init_Flex = __esm({
29017
29063
  flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
29018
29064
  }
29019
29065
  }
29020
- const Comp = Component2;
29021
- return /* @__PURE__ */ jsx(
29022
- Comp,
29023
- {
29024
- className: cn(
29025
- inline ? "inline-flex" : "flex",
29026
- directionStyles[direction],
29027
- wrapStyles[wrap],
29028
- alignStyles3[align],
29029
- justifyStyles2[justify],
29030
- gapStyles6[gap],
29031
- className
29032
- ),
29033
- style: Object.keys(flexStyle).length > 0 ? flexStyle : void 0,
29034
- children
29035
- }
29036
- );
29066
+ return React98__default.createElement(Component2, {
29067
+ className: cn(
29068
+ inline ? "inline-flex" : "flex",
29069
+ directionStyles[direction],
29070
+ wrapStyles[wrap],
29071
+ alignStyles3[align],
29072
+ justifyStyles2[justify],
29073
+ gapStyles6[gap],
29074
+ className
29075
+ ),
29076
+ style: Object.keys(flexStyle).length > 0 ? flexStyle : void 0,
29077
+ children
29078
+ });
29037
29079
  };
29038
29080
  Flex.displayName = "Flex";
29039
29081
  }
@@ -29140,7 +29182,7 @@ var init_Grid = __esm({
29140
29182
  as: Component2 = "div"
29141
29183
  }) => {
29142
29184
  const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
29143
- return React94__default.createElement(
29185
+ return React98__default.createElement(
29144
29186
  Component2,
29145
29187
  {
29146
29188
  className: cn(
@@ -29336,9 +29378,9 @@ var init_Popover = __esm({
29336
29378
  onMouseLeave: handleClose,
29337
29379
  onPointerDown: tapTriggerProps.onPointerDown
29338
29380
  };
29339
- const childElement = React94__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
29381
+ const childElement = React98__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
29340
29382
  const childPointerDown = childElement.props.onPointerDown;
29341
- const triggerElement = React94__default.cloneElement(
29383
+ const triggerElement = React98__default.cloneElement(
29342
29384
  childElement,
29343
29385
  {
29344
29386
  ref: triggerRef,
@@ -29940,9 +29982,9 @@ var init_Tooltip = __esm({
29940
29982
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
29941
29983
  };
29942
29984
  }, []);
29943
- const triggerElement = React94__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
29985
+ const triggerElement = React98__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
29944
29986
  const childPointerDown = triggerElement.props.onPointerDown;
29945
- const trigger = React94__default.cloneElement(triggerElement, {
29987
+ const trigger = React98__default.cloneElement(triggerElement, {
29946
29988
  ref: triggerRef,
29947
29989
  onMouseEnter: handleMouseEnter,
29948
29990
  onMouseLeave: handleMouseLeave,
@@ -30032,7 +30074,7 @@ var init_WizardProgress = __esm({
30032
30074
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
30033
30075
  const isActive = index === currentStep;
30034
30076
  const isCompleted = index < currentStep;
30035
- return /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
30077
+ return /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
30036
30078
  /* @__PURE__ */ jsx(
30037
30079
  "button",
30038
30080
  {
@@ -30344,13 +30386,14 @@ var init_ViolationAlert = __esm({
30344
30386
  onNavigateToField,
30345
30387
  compact = false,
30346
30388
  className,
30347
- ...flatProps
30389
+ message
30348
30390
  }) => {
30349
30391
  const { t } = useTranslate();
30392
+ const fallbackMessage = message ?? t("violationAlert.fallbackMessage");
30350
30393
  const resolvedViolation = violation ?? {
30351
30394
  law: "",
30352
30395
  article: "",
30353
- message: flatProps.message ?? t("violationAlert.fallbackMessage"),
30396
+ message: fallbackMessage,
30354
30397
  actionType: "measure"
30355
30398
  };
30356
30399
  const effectiveSeverity = severity ?? (resolvedViolation.actionType === "measure" ? "warning" : "error");
@@ -31095,7 +31138,7 @@ function InventoryGrid({
31095
31138
  const eventBus = useEventBus();
31096
31139
  const slotCount = totalSlots ?? items.length;
31097
31140
  const emptySlotCount = Math.max(0, slotCount - items.length);
31098
- const handleSelect = React94.useCallback(
31141
+ const handleSelect = React98.useCallback(
31099
31142
  (id) => {
31100
31143
  onSelect?.(id);
31101
31144
  if (selectEvent) {
@@ -31330,31 +31373,31 @@ function GameCanvas2D({
31330
31373
  assetBaseUrl,
31331
31374
  className
31332
31375
  }) {
31333
- const canvasRef = React94.useRef(null);
31334
- const rafRef = React94.useRef(0);
31335
- const frameRef = React94.useRef(0);
31336
- const lastTimeRef = React94.useRef(0);
31337
- const imageCache = React94.useRef(/* @__PURE__ */ new Map());
31376
+ const canvasRef = React98.useRef(null);
31377
+ const rafRef = React98.useRef(0);
31378
+ const frameRef = React98.useRef(0);
31379
+ const lastTimeRef = React98.useRef(0);
31380
+ const imageCache = React98.useRef(/* @__PURE__ */ new Map());
31338
31381
  const emit = useEmitEvent();
31339
- const onDrawRef = React94.useRef(onDraw);
31382
+ const onDrawRef = React98.useRef(onDraw);
31340
31383
  onDrawRef.current = onDraw;
31341
- const onTickRef = React94.useRef(onTick);
31384
+ const onTickRef = React98.useRef(onTick);
31342
31385
  onTickRef.current = onTick;
31343
- const tickEventRef = React94.useRef(tickEvent);
31386
+ const tickEventRef = React98.useRef(tickEvent);
31344
31387
  tickEventRef.current = tickEvent;
31345
- const drawEventRef = React94.useRef(drawEvent);
31388
+ const drawEventRef = React98.useRef(drawEvent);
31346
31389
  drawEventRef.current = drawEvent;
31347
- const emitRef = React94.useRef(emit);
31390
+ const emitRef = React98.useRef(emit);
31348
31391
  emitRef.current = emit;
31349
- const assetBaseUrlRef = React94.useRef(assetBaseUrl);
31392
+ const assetBaseUrlRef = React98.useRef(assetBaseUrl);
31350
31393
  assetBaseUrlRef.current = assetBaseUrl;
31351
- const backgroundImageRef = React94.useRef(backgroundImage);
31394
+ const backgroundImageRef = React98.useRef(backgroundImage);
31352
31395
  backgroundImageRef.current = backgroundImage;
31353
- const widthRef = React94.useRef(width);
31396
+ const widthRef = React98.useRef(width);
31354
31397
  widthRef.current = width;
31355
- const heightRef = React94.useRef(height);
31398
+ const heightRef = React98.useRef(height);
31356
31399
  heightRef.current = height;
31357
- const loadImage = React94.useCallback((url) => {
31400
+ const loadImage = React98.useCallback((url) => {
31358
31401
  const base = assetBaseUrlRef.current;
31359
31402
  if (!url.startsWith("http") && !base) return null;
31360
31403
  const fullUrl = url.startsWith("http") ? url : `${base}${url}`;
@@ -31368,7 +31411,7 @@ function GameCanvas2D({
31368
31411
  }
31369
31412
  return null;
31370
31413
  }, []);
31371
- React94.useEffect(() => {
31414
+ React98.useEffect(() => {
31372
31415
  const canvas = canvasRef.current;
31373
31416
  if (!canvas) return;
31374
31417
  const ctx = canvas.getContext("2d");
@@ -31693,7 +31736,7 @@ function TurnPanel({
31693
31736
  className
31694
31737
  }) {
31695
31738
  const eventBus = useEventBus();
31696
- const handleAction = React94.useCallback(
31739
+ const handleAction = React98.useCallback(
31697
31740
  (event) => {
31698
31741
  if (event) {
31699
31742
  eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
@@ -31874,7 +31917,7 @@ function UnitCommandBar({
31874
31917
  className
31875
31918
  }) {
31876
31919
  const eventBus = useEventBus();
31877
- const handleCommand = React94.useCallback(
31920
+ const handleCommand = React98.useCallback(
31878
31921
  (event) => {
31879
31922
  if (event) {
31880
31923
  eventBus.emit(event, { unitId: selectedUnitId });
@@ -32425,7 +32468,7 @@ function GameMenu({
32425
32468
  } catch {
32426
32469
  }
32427
32470
  const eventBus = eventBusProp || eventBusFromHook;
32428
- const handleOptionClick = React94.useCallback(
32471
+ const handleOptionClick = React98.useCallback(
32429
32472
  (option) => {
32430
32473
  if (option.event && eventBus) {
32431
32474
  eventBus.emit(`UI:${option.event}`, { option });
@@ -32544,7 +32587,7 @@ function GameOverScreen({
32544
32587
  } catch {
32545
32588
  }
32546
32589
  const eventBus = eventBusProp || eventBusFromHook;
32547
- const handleActionClick = React94.useCallback(
32590
+ const handleActionClick = React98.useCallback(
32548
32591
  (action) => {
32549
32592
  if (action.event && eventBus) {
32550
32593
  eventBus.emit(`UI:${action.event}`, { action });
@@ -33476,7 +33519,7 @@ var init_MapView = __esm({
33476
33519
  shadowSize: [41, 41]
33477
33520
  });
33478
33521
  L.Marker.prototype.options.icon = defaultIcon;
33479
- const { useEffect: useEffect89, useRef: useRef82, useCallback: useCallback133, useState: useState125 } = React94__default;
33522
+ const { useEffect: useEffect89, useRef: useRef82, useCallback: useCallback133, useState: useState125 } = React98__default;
33480
33523
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
33481
33524
  const { useEventBus: useEventBus4 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
33482
33525
  function MapUpdater({ centerLat, centerLng, zoom }) {
@@ -34312,6 +34355,15 @@ function renderIconInput3(icon, props) {
34312
34355
  function columnLabel(col) {
34313
34356
  return col.header ?? col.label ?? col.key.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
34314
34357
  }
34358
+ function asFieldValue(v) {
34359
+ if (v === void 0 || v === null) return v;
34360
+ const t = typeof v;
34361
+ if (t === "string" || t === "number" || t === "boolean") return v;
34362
+ if (v instanceof Date) return v;
34363
+ if (Array.isArray(v)) return v;
34364
+ if (t === "object") return v;
34365
+ return void 0;
34366
+ }
34315
34367
  function statusVariant4(value) {
34316
34368
  const v = value.toLowerCase();
34317
34369
  if (["active", "completed", "done", "approved", "published", "resolved", "open", "online", "ok"].includes(v)) return "success";
@@ -34382,8 +34434,8 @@ function TableView({
34382
34434
  }) {
34383
34435
  const eventBus = useEventBus();
34384
34436
  const { t } = useTranslate();
34385
- const [visibleCount, setVisibleCount] = React94__default.useState(pageSize > 0 ? pageSize : Infinity);
34386
- const [localSelected, setLocalSelected] = React94__default.useState(/* @__PURE__ */ new Set());
34437
+ const [visibleCount, setVisibleCount] = React98__default.useState(pageSize > 0 ? pageSize : Infinity);
34438
+ const [localSelected, setLocalSelected] = React98__default.useState(/* @__PURE__ */ new Set());
34387
34439
  const colDefs = columns ?? fields ?? [];
34388
34440
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
34389
34441
  const dnd = useDataDnd({
@@ -34528,7 +34580,7 @@ function TableView({
34528
34580
  }
34529
34581
  ) }),
34530
34582
  hasRenderProp ? /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0", children: children(row, index) }) : colDefs.map((col) => {
34531
- const raw = getNestedValue(row, col.field ?? col.key);
34583
+ const raw = asFieldValue(getNestedValue(row, col.field ?? col.key));
34532
34584
  const cellBase = cn(
34533
34585
  "flex items-center min-w-0",
34534
34586
  alignClass[col.align ?? "left"],
@@ -34578,12 +34630,12 @@ function TableView({
34578
34630
  ]
34579
34631
  }
34580
34632
  );
34581
- return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React94__default.Fragment, { children: rowInner }, id);
34633
+ return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React98__default.Fragment, { children: rowInner }, id);
34582
34634
  };
34583
- const items = data.map((row) => row);
34635
+ const items = Array.from(data);
34584
34636
  const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
34585
34637
  let runningIndex = 0;
34586
- const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
34638
+ const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
34587
34639
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
34588
34640
  group.items.map((row) => renderRow(row, runningIndex++))
34589
34641
  ] }, gi)) });
@@ -35940,7 +35992,7 @@ var init_StepFlow = __esm({
35940
35992
  className
35941
35993
  }) => {
35942
35994
  if (orientation === "vertical") {
35943
- return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React94__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
35995
+ return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React98__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
35944
35996
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
35945
35997
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
35946
35998
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -35951,7 +36003,7 @@ var init_StepFlow = __esm({
35951
36003
  ] })
35952
36004
  ] }) }, index)) });
35953
36005
  }
35954
- 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(React94__default.Fragment, { children: [
36006
+ 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(React98__default.Fragment, { children: [
35955
36007
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
35956
36008
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
35957
36009
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -36936,7 +36988,7 @@ var init_LikertScale = __esm({
36936
36988
  md: "text-base",
36937
36989
  lg: "text-lg"
36938
36990
  };
36939
- LikertScale = React94__default.forwardRef(
36991
+ LikertScale = React98__default.forwardRef(
36940
36992
  ({
36941
36993
  question,
36942
36994
  options = DEFAULT_LIKERT_OPTIONS,
@@ -36948,7 +37000,7 @@ var init_LikertScale = __esm({
36948
37000
  variant = "radios",
36949
37001
  className
36950
37002
  }, ref) => {
36951
- const groupId = React94__default.useId();
37003
+ const groupId = React98__default.useId();
36952
37004
  const eventBus = useEventBus();
36953
37005
  const handleSelect = useCallback(
36954
37006
  (next) => {
@@ -37843,11 +37895,11 @@ function nextBlockId(prefix = "blk") {
37843
37895
  function normalizeBlocks(raw) {
37844
37896
  if (!Array.isArray(raw) || raw.length === 0) return [createBlock("paragraph")];
37845
37897
  return raw.map((row) => {
37846
- const r2 = row;
37847
- const rawType = r2.type;
37898
+ const entity = row;
37899
+ const rawType = entity.type;
37848
37900
  const type = typeof rawType === "string" && BLOCK_TYPES.has(rawType) ? rawType : "paragraph";
37849
- const id = typeof r2.id === "string" && r2.id ? r2.id : nextBlockId(type);
37850
- return { ...r2, id, type };
37901
+ const id = typeof entity.id === "string" && entity.id ? entity.id : nextBlockId(type);
37902
+ return { ...entity, id, type };
37851
37903
  });
37852
37904
  }
37853
37905
  function createBlock(type) {
@@ -39230,7 +39282,7 @@ var init_DocBreadcrumb = __esm({
39230
39282
  "aria-label": t("aria.breadcrumb"),
39231
39283
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
39232
39284
  const isLast = idx === items.length - 1;
39233
- return /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
39285
+ return /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
39234
39286
  idx > 0 && /* @__PURE__ */ jsx(
39235
39287
  Icon,
39236
39288
  {
@@ -39894,7 +39946,7 @@ var init_PageHeader = __esm({
39894
39946
  info: "bg-info/10 text-info"
39895
39947
  };
39896
39948
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
39897
- 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(React94__default.Fragment, { children: [
39949
+ 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(React98__default.Fragment, { children: [
39898
39950
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
39899
39951
  crumb.href ? /* @__PURE__ */ jsx(
39900
39952
  "a",
@@ -40252,52 +40304,49 @@ var init_Section = __esm({
40252
40304
  as: Component2 = "section"
40253
40305
  }) => {
40254
40306
  const hasHeader = title || description || action;
40255
- const Comp = Component2;
40256
- return /* @__PURE__ */ jsxs(
40257
- Comp,
40307
+ return React98__default.createElement(
40308
+ Component2,
40258
40309
  {
40259
40310
  className: cn(
40260
40311
  paddingStyles4[padding],
40261
40312
  variantStyles9[variant],
40262
40313
  className
40263
- ),
40264
- children: [
40265
- hasHeader && /* @__PURE__ */ jsxs(
40266
- Box,
40267
- {
40268
- className: cn(
40269
- "flex flex-col sm:flex-row sm:items-start sm:justify-between gap-2 sm:gap-4",
40270
- divider && "pb-4 mb-4 border-b-[length:var(--border-width)] border-border",
40271
- !divider && "mb-4",
40272
- headerClassName
40273
- ),
40274
- children: [
40275
- /* @__PURE__ */ jsxs(Box, { className: "flex-1 min-w-0", children: [
40276
- title && /* @__PURE__ */ jsx(
40277
- Typography,
40278
- {
40279
- variant: "h4",
40280
- className: "text-foreground font-semibold",
40281
- children: title
40282
- }
40283
- ),
40284
- description && /* @__PURE__ */ jsx(
40285
- Typography,
40286
- {
40287
- variant: "body",
40288
- color: "muted",
40289
- className: "mt-1",
40290
- children: description
40291
- }
40292
- )
40293
- ] }),
40294
- action && /* @__PURE__ */ jsx(Box, { className: "flex-shrink-0 flex items-center gap-2", children: action })
40295
- ]
40296
- }
40314
+ )
40315
+ },
40316
+ hasHeader && /* @__PURE__ */ jsxs(
40317
+ Box,
40318
+ {
40319
+ className: cn(
40320
+ "flex flex-col sm:flex-row sm:items-start sm:justify-between gap-2 sm:gap-4",
40321
+ divider && "pb-4 mb-4 border-b-[length:var(--border-width)] border-border",
40322
+ !divider && "mb-4",
40323
+ headerClassName
40297
40324
  ),
40298
- /* @__PURE__ */ jsx(Box, { className: contentClassName, children })
40299
- ]
40300
- }
40325
+ children: [
40326
+ /* @__PURE__ */ jsxs(Box, { className: "flex-1 min-w-0", children: [
40327
+ title && /* @__PURE__ */ jsx(
40328
+ Typography,
40329
+ {
40330
+ variant: "h4",
40331
+ className: "text-foreground font-semibold",
40332
+ children: title
40333
+ }
40334
+ ),
40335
+ description && /* @__PURE__ */ jsx(
40336
+ Typography,
40337
+ {
40338
+ variant: "body",
40339
+ color: "muted",
40340
+ className: "mt-1",
40341
+ children: description
40342
+ }
40343
+ )
40344
+ ] }),
40345
+ action && /* @__PURE__ */ jsx(Box, { className: "flex-shrink-0 flex items-center gap-2", children: action })
40346
+ ]
40347
+ }
40348
+ ),
40349
+ /* @__PURE__ */ jsx(Box, { className: contentClassName, children })
40301
40350
  );
40302
40351
  };
40303
40352
  Section.displayName = "Section";
@@ -40623,7 +40672,7 @@ var init_WizardContainer = __esm({
40623
40672
  const isCompleted = index < currentStep;
40624
40673
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
40625
40674
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
40626
- return /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
40675
+ return /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
40627
40676
  /* @__PURE__ */ jsx(
40628
40677
  Button,
40629
40678
  {
@@ -42566,6 +42615,22 @@ var init_DataTable = __esm({
42566
42615
  DataTable.displayName = "DataTable";
42567
42616
  }
42568
42617
  });
42618
+ function toDebuggerLine(v) {
42619
+ if (v === null || typeof v !== "object" || Array.isArray(v) || v instanceof Date) return null;
42620
+ const id = v["id"];
42621
+ const content = v["content"];
42622
+ const isBug = v["isBug"];
42623
+ if (typeof id !== "string" || typeof content !== "string" || typeof isBug !== "boolean") return null;
42624
+ const isFlagged = v["isFlagged"];
42625
+ const explanation = v["explanation"];
42626
+ return {
42627
+ id,
42628
+ content,
42629
+ isBug,
42630
+ isFlagged: typeof isFlagged === "boolean" ? isFlagged : void 0,
42631
+ explanation: typeof explanation === "string" ? explanation : void 0
42632
+ };
42633
+ }
42569
42634
  function DebuggerBoard({
42570
42635
  entity,
42571
42636
  completeEvent = "PUZZLE_COMPLETE",
@@ -42578,7 +42643,10 @@ function DebuggerBoard({
42578
42643
  const { t } = useTranslate();
42579
42644
  const resolved = boardEntity(entity);
42580
42645
  const [headerError, setHeaderError] = useState(false);
42581
- const lines = Array.isArray(resolved?.lines) ? resolved.lines : [];
42646
+ const lines = Array.isArray(resolved?.lines) ? resolved.lines.flatMap((v) => {
42647
+ const l = toDebuggerLine(v);
42648
+ return l ? [l] : [];
42649
+ }) : [];
42582
42650
  const result = str(resolved?.result) || "none";
42583
42651
  const attempts = num(resolved?.attempts);
42584
42652
  const submitted = result === "win";
@@ -43183,7 +43251,7 @@ var init_DetailPanel = __esm({
43183
43251
  }
43184
43252
  });
43185
43253
  function extractTitle(children) {
43186
- if (!React94__default.isValidElement(children)) return void 0;
43254
+ if (!React98__default.isValidElement(children)) return void 0;
43187
43255
  const props = children.props;
43188
43256
  if (typeof props.title === "string") {
43189
43257
  return props.title;
@@ -43238,7 +43306,7 @@ function LinearView({
43238
43306
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
43239
43307
  const isDone = i < currentIdx;
43240
43308
  const isCurrent = i === currentIdx;
43241
- return /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
43309
+ return /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
43242
43310
  i > 0 && /* @__PURE__ */ jsx(
43243
43311
  Typography,
43244
43312
  {
@@ -44060,12 +44128,12 @@ function evaluateFormExpression(expr, formCtx) {
44060
44128
  return evaluate(expr, ctx);
44061
44129
  }
44062
44130
  function isOrbitalEntitySchema(value) {
44063
- if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
44131
+ if (value === null || value === void 0 || typeof value !== "object" || Array.isArray(value)) return false;
44064
44132
  const fields = value.fields;
44065
44133
  return Array.isArray(fields);
44066
44134
  }
44067
44135
  function isPlainEntityRow(value) {
44068
- if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
44136
+ if (value === null || value === void 0 || typeof value !== "object" || Array.isArray(value)) return false;
44069
44137
  const fields = value.fields;
44070
44138
  return !Array.isArray(fields);
44071
44139
  }
@@ -44224,12 +44292,12 @@ var init_Form = __esm({
44224
44292
  const isSchemaEntity = isOrbitalEntitySchema(entity);
44225
44293
  const resolvedEntity = isSchemaEntity ? entity : void 0;
44226
44294
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
44227
- const normalizedInitialData = React94__default.useMemo(() => {
44295
+ const normalizedInitialData = React98__default.useMemo(() => {
44228
44296
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
44229
44297
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
44230
44298
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
44231
44299
  }, [entity, initialData]);
44232
- const entityDerivedFields = React94__default.useMemo(() => {
44300
+ const entityDerivedFields = React98__default.useMemo(() => {
44233
44301
  if (fields && fields.length > 0) return void 0;
44234
44302
  if (!resolvedEntity) return void 0;
44235
44303
  return resolvedEntity.fields.map(
@@ -44237,6 +44305,7 @@ var init_Form = __esm({
44237
44305
  name: f3.name,
44238
44306
  type: f3.type,
44239
44307
  required: f3.required,
44308
+ // EntityField.default is typed `unknown` upstream — safe cast: schema defaults are always FieldValues.
44240
44309
  defaultValue: f3.default,
44241
44310
  // EntityField is a discriminated union — `values` lives on Scalar/Enum, `relation` lives on Relation.
44242
44311
  values: "values" in f3 ? f3.values : void 0,
@@ -44249,16 +44318,16 @@ var init_Form = __esm({
44249
44318
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
44250
44319
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
44251
44320
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
44252
- const [formData, setFormData] = React94__default.useState(
44321
+ const [formData, setFormData] = React98__default.useState(
44253
44322
  normalizedInitialData
44254
44323
  );
44255
- const [collapsedSections, setCollapsedSections] = React94__default.useState(
44324
+ const [collapsedSections, setCollapsedSections] = React98__default.useState(
44256
44325
  /* @__PURE__ */ new Set()
44257
44326
  );
44258
- const [submitError, setSubmitError] = React94__default.useState(null);
44259
- const formRef = React94__default.useRef(null);
44327
+ const [submitError, setSubmitError] = React98__default.useState(null);
44328
+ const formRef = React98__default.useRef(null);
44260
44329
  const formMode = props.mode;
44261
- const mountedRef = React94__default.useRef(false);
44330
+ const mountedRef = React98__default.useRef(false);
44262
44331
  if (!mountedRef.current) {
44263
44332
  mountedRef.current = true;
44264
44333
  debug("forms", "mount", {
@@ -44271,7 +44340,7 @@ var init_Form = __esm({
44271
44340
  });
44272
44341
  }
44273
44342
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
44274
- const evalContext = React94__default.useMemo(
44343
+ const evalContext = React98__default.useMemo(
44275
44344
  () => ({
44276
44345
  formValues: formData,
44277
44346
  globalVariables: externalContext?.globalVariables ?? {},
@@ -44280,7 +44349,7 @@ var init_Form = __esm({
44280
44349
  }),
44281
44350
  [formData, externalContext]
44282
44351
  );
44283
- React94__default.useEffect(() => {
44352
+ React98__default.useEffect(() => {
44284
44353
  debug("forms", "initialData-sync", {
44285
44354
  mode: formMode,
44286
44355
  normalizedInitialData,
@@ -44291,7 +44360,7 @@ var init_Form = __esm({
44291
44360
  setFormData(normalizedInitialData);
44292
44361
  }
44293
44362
  }, [normalizedInitialData]);
44294
- const processCalculations = React94__default.useCallback(
44363
+ const processCalculations = React98__default.useCallback(
44295
44364
  (changedFieldId, newFormData) => {
44296
44365
  if (!hiddenCalculations.length) return;
44297
44366
  const context = {
@@ -44316,7 +44385,7 @@ var init_Form = __esm({
44316
44385
  },
44317
44386
  [hiddenCalculations, externalContext, eventBus]
44318
44387
  );
44319
- const checkViolations = React94__default.useCallback(
44388
+ const checkViolations = React98__default.useCallback(
44320
44389
  (changedFieldId, newFormData) => {
44321
44390
  if (!violationTriggers.length) return;
44322
44391
  const context = {
@@ -44354,7 +44423,7 @@ var init_Form = __esm({
44354
44423
  processCalculations(name, newFormData);
44355
44424
  checkViolations(name, newFormData);
44356
44425
  };
44357
- const isFieldVisible = React94__default.useCallback(
44426
+ const isFieldVisible = React98__default.useCallback(
44358
44427
  (fieldName) => {
44359
44428
  const condition = conditionalFields[fieldName];
44360
44429
  if (!condition) return true;
@@ -44362,7 +44431,7 @@ var init_Form = __esm({
44362
44431
  },
44363
44432
  [conditionalFields, evalContext]
44364
44433
  );
44365
- const isSectionVisible = React94__default.useCallback(
44434
+ const isSectionVisible = React98__default.useCallback(
44366
44435
  (section) => {
44367
44436
  if (!section.condition) return true;
44368
44437
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -44438,7 +44507,7 @@ var init_Form = __esm({
44438
44507
  eventBus.emit(`UI:${onCancel}`);
44439
44508
  }
44440
44509
  };
44441
- const renderField = React94__default.useCallback(
44510
+ const renderField = React98__default.useCallback(
44442
44511
  (field) => {
44443
44512
  const fieldName = field.name || field.field;
44444
44513
  if (!fieldName) return null;
@@ -44459,7 +44528,7 @@ var init_Form = __esm({
44459
44528
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
44460
44529
  );
44461
44530
  const effectiveFields = entityDerivedFields ?? fields;
44462
- const normalizedFields = React94__default.useMemo(() => {
44531
+ const normalizedFields = React98__default.useMemo(() => {
44463
44532
  if (!effectiveFields || effectiveFields.length === 0) return [];
44464
44533
  return effectiveFields.map((field) => {
44465
44534
  if (typeof field === "string") {
@@ -44469,6 +44538,7 @@ var init_Form = __esm({
44469
44538
  name: field,
44470
44539
  type: entityField.type,
44471
44540
  required: entityField.required,
44541
+ // EntityField.default is typed `unknown` upstream — safe cast: schema defaults are always FieldValues.
44472
44542
  defaultValue: entityField.default,
44473
44543
  // EntityField is a discriminated union — `values` lives on Scalar/Enum, `relation` lives on Relation.
44474
44544
  values: "values" in entityField ? entityField.values : void 0,
@@ -44482,7 +44552,7 @@ var init_Form = __esm({
44482
44552
  return field;
44483
44553
  });
44484
44554
  }, [effectiveFields, resolvedEntity]);
44485
- const schemaFields = React94__default.useMemo(() => {
44555
+ const schemaFields = React98__default.useMemo(() => {
44486
44556
  if (normalizedFields.length === 0) return null;
44487
44557
  if (isDebugEnabled()) {
44488
44558
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -44492,7 +44562,7 @@ var init_Form = __esm({
44492
44562
  }
44493
44563
  return normalizedFields.map(renderField).filter(Boolean);
44494
44564
  }, [normalizedFields, renderField, entityName, conditionalFields]);
44495
- const sectionElements = React94__default.useMemo(() => {
44565
+ const sectionElements = React98__default.useMemo(() => {
44496
44566
  if (!sections || sections.length === 0) return null;
44497
44567
  return sections.map((section) => {
44498
44568
  if (!isSectionVisible(section)) {
@@ -46748,6 +46818,14 @@ var init_GameBoard3D = __esm({
46748
46818
  GameBoard3D.displayName = "GameBoard3D";
46749
46819
  }
46750
46820
  });
46821
+ function asDescriptor(v) {
46822
+ if (Array.isArray(v) || React98__default.isValidElement(v)) return null;
46823
+ const o = v;
46824
+ if (typeof o.type !== "string") return null;
46825
+ const props = o.props !== void 0 && typeof o.props === "object" && !Array.isArray(o.props) && o.props !== null ? o.props : void 0;
46826
+ const _id = typeof o._id === "string" ? o._id : void 0;
46827
+ return { type: o.type, props, _id };
46828
+ }
46751
46829
  function getSlotContentRenderer2() {
46752
46830
  if (_scr) return _scr;
46753
46831
  const mod = (init_UISlotRenderer(), __toCommonJS(UISlotRenderer_exports));
@@ -46756,17 +46834,16 @@ function getSlotContentRenderer2() {
46756
46834
  }
46757
46835
  function resolveDescriptor(value, idPrefix) {
46758
46836
  if (value === null || value === void 0) return value;
46759
- if (React94__default.isValidElement(value)) return value;
46837
+ if (React98__default.isValidElement(value)) return value;
46760
46838
  if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
46761
46839
  if (Array.isArray(value)) {
46762
- return value.map((item, i) => /* @__PURE__ */ jsx(React94__default.Fragment, { children: resolveDescriptor(item, `${idPrefix}-${i}`) }, i));
46840
+ return value.map((item, i) => /* @__PURE__ */ jsx(React98__default.Fragment, { children: resolveDescriptor(item, `${idPrefix}-${i}`) }, i));
46763
46841
  }
46764
- if (typeof value === "object") {
46765
- const rec = value;
46766
- if (typeof rec.type === "string" && getComponentForPattern(rec.type) !== null) {
46767
- const { type, props: nestedProps, _id, ...flatProps } = rec;
46768
- const resolvedProps = nestedProps !== void 0 ? nestedProps : flatProps;
46769
- const content = { id: _id ?? idPrefix, pattern: type, props: resolvedProps, priority: 0 };
46842
+ if (typeof value === "object" && value !== null) {
46843
+ const desc = asDescriptor(value);
46844
+ if (desc !== null && getComponentForPattern(desc.type) !== null) {
46845
+ const resolvedProps = desc.props ?? {};
46846
+ const content = { id: desc._id ?? idPrefix, pattern: desc.type, props: resolvedProps, priority: 0 };
46770
46847
  const SCR = getSlotContentRenderer2();
46771
46848
  return /* @__PURE__ */ jsx(SCR, { content, onDismiss: () => void 0 });
46772
46849
  }
@@ -46860,16 +46937,19 @@ function getSlotContentRenderer3() {
46860
46937
  }
46861
46938
  function resolveDescriptor2(value, idPrefix) {
46862
46939
  if (value === null || value === void 0) return value;
46863
- if (React94__default.isValidElement(value)) return value;
46940
+ if (React98__default.isValidElement(value)) return value;
46864
46941
  if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
46865
46942
  if (Array.isArray(value)) {
46866
- return value.map((item, i) => /* @__PURE__ */ jsx(React94__default.Fragment, { children: resolveDescriptor2(item, `${idPrefix}-${i}`) }, i));
46943
+ return value.map((item, i) => /* @__PURE__ */ jsx(React98__default.Fragment, { children: resolveDescriptor2(item, `${idPrefix}-${i}`) }, i));
46867
46944
  }
46868
46945
  if (typeof value === "object") {
46869
46946
  const rec = value;
46870
46947
  if (typeof rec.type === "string" && getComponentForPattern(rec.type) !== null) {
46871
- const { type, props: nestedProps, _id, ...flatProps } = rec;
46872
- const resolvedProps = nestedProps !== void 0 ? nestedProps : flatProps;
46948
+ const type = rec.type;
46949
+ const _id = typeof rec._id === "string" ? rec._id : void 0;
46950
+ const nestedProps = rec.props !== void 0 && typeof rec.props === "object" && !Array.isArray(rec.props) && rec.props !== null ? rec.props : void 0;
46951
+ const { type: _t, props: _p, _id: _d, ...flatRest } = rec;
46952
+ const resolvedProps = nestedProps !== void 0 ? nestedProps : flatRest;
46873
46953
  const content = { id: _id ?? idPrefix, pattern: type, props: resolvedProps, priority: 0 };
46874
46954
  const SCR = getSlotContentRenderer3();
46875
46955
  return /* @__PURE__ */ jsx(SCR, { content, onDismiss: () => void 0 });
@@ -47197,35 +47277,44 @@ var init_HexStrategyBoard = __esm({
47197
47277
  }
47198
47278
  });
47199
47279
  function HolidayRunnerBoard({
47200
- backgroundImage,
47280
+ tiles,
47281
+ units,
47282
+ features,
47283
+ assetManifest,
47201
47284
  assetBaseUrl,
47202
- width = 800,
47203
- height = 400,
47204
- fps = 60,
47285
+ scale = 0.45,
47286
+ showMinimap = false,
47287
+ enableCamera = true,
47288
+ tileClickEvent,
47289
+ unitClickEvent,
47205
47290
  isLoading,
47206
47291
  error,
47207
47292
  className
47208
47293
  }) {
47209
- return /* @__PURE__ */ jsxs("div", { className: cn("holiday-runner-board relative w-full h-full", className), children: [
47210
- 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" }) }),
47211
- 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 }) }),
47212
- /* @__PURE__ */ jsx(
47213
- GameCanvas2D,
47214
- {
47215
- width,
47216
- height,
47217
- fps,
47218
- backgroundImage: backgroundImage ?? "",
47219
- assetBaseUrl
47220
- }
47221
- )
47222
- ] });
47294
+ return /* @__PURE__ */ jsx("div", { className: cn("holiday-runner-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
47295
+ IsometricCanvas_default,
47296
+ {
47297
+ tileLayout: "flat",
47298
+ tiles,
47299
+ units,
47300
+ features,
47301
+ assetManifest,
47302
+ assetBaseUrl,
47303
+ scale,
47304
+ showMinimap,
47305
+ enableCamera,
47306
+ tileClickEvent,
47307
+ unitClickEvent,
47308
+ isLoading,
47309
+ error
47310
+ }
47311
+ ) });
47223
47312
  }
47224
47313
  var init_HolidayRunnerBoard = __esm({
47225
47314
  "components/game/organisms/HolidayRunnerBoard.tsx"() {
47226
47315
  "use client";
47227
47316
  init_cn();
47228
- init_GameCanvas2D();
47317
+ init_IsometricCanvas();
47229
47318
  HolidayRunnerBoard.displayName = "HolidayRunnerBoard";
47230
47319
  }
47231
47320
  });
@@ -47564,7 +47653,7 @@ var init_List = __esm({
47564
47653
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
47565
47654
  return [];
47566
47655
  }, [entity]);
47567
- const getItemActions = React94__default.useCallback(
47656
+ const getItemActions = React98__default.useCallback(
47568
47657
  (item) => {
47569
47658
  if (!itemActions) return [];
47570
47659
  if (typeof itemActions === "function") {
@@ -47621,15 +47710,14 @@ var init_List = __esm({
47621
47710
  };
47622
47711
  if (effectiveFieldNames && effectiveFieldNames.length > 0) {
47623
47712
  const firstField = effectiveFieldNames[0];
47624
- const itemRecord = item;
47625
- if (!normalizedItem.title && getNestedValue(itemRecord, firstField)) {
47713
+ if (!normalizedItem.title && getNestedValue(item, firstField)) {
47626
47714
  normalizedItem.title = String(
47627
- getNestedValue(itemRecord, firstField)
47715
+ getNestedValue(item, firstField)
47628
47716
  );
47629
47717
  }
47630
47718
  normalizedItem._fields = effectiveFieldNames.reduce(
47631
47719
  (acc, field) => {
47632
- const value = getNestedValue(itemRecord, field);
47720
+ const value = getNestedValue(item, field);
47633
47721
  if (value !== void 0 && value !== null) {
47634
47722
  acc[field] = value;
47635
47723
  }
@@ -48082,16 +48170,18 @@ var init_MediaGallery = __esm({
48082
48170
  [selectable, selectedItems, selectionEvent, eventBus]
48083
48171
  );
48084
48172
  const entityData = Array.isArray(entity) ? entity : [];
48085
- const items = React94__default.useMemo(() => {
48173
+ const items = React98__default.useMemo(() => {
48086
48174
  if (propItems) return propItems;
48087
48175
  if (entityData.length === 0) return [];
48088
- return entityData.map((record, idx) => ({
48089
- id: String(record.id ?? idx),
48090
- src: String(record.src ?? record.url ?? record.image ?? ""),
48091
- alt: record.alt ? String(record.alt) : void 0,
48092
- thumbnail: record.thumbnail ? String(record.thumbnail) : void 0,
48093
- caption: record.caption ? String(record.caption) : record.title ? String(record.title) : void 0
48094
- }));
48176
+ return entityData.map((record, idx) => {
48177
+ return {
48178
+ id: String(record.id ?? idx),
48179
+ src: String(record.src ?? ("url" in record ? record.url : "") ?? ("image" in record ? record.image : "") ?? ""),
48180
+ alt: record.alt ? String(record.alt) : void 0,
48181
+ thumbnail: record.thumbnail ? String(record.thumbnail) : void 0,
48182
+ caption: record.caption ? String(record.caption) : "title" in record ? String(record.title) : void 0
48183
+ };
48184
+ });
48095
48185
  }, [propItems, entityData]);
48096
48186
  if (isLoading) {
48097
48187
  return /* @__PURE__ */ jsx(LoadingState, { message: t("common.loading"), className });
@@ -48285,7 +48375,7 @@ var init_MinigolfBoard = __esm({
48285
48375
  }
48286
48376
  });
48287
48377
  function extractTitle2(children) {
48288
- if (!React94__default.isValidElement(children)) return void 0;
48378
+ if (!React98__default.isValidElement(children)) return void 0;
48289
48379
  const props = children.props;
48290
48380
  if (typeof props.title === "string") {
48291
48381
  return props.title;
@@ -48351,8 +48441,16 @@ function NegotiatorBoard({
48351
48441
  const lastPlayerAction = str(resolved?.lastPlayerAction);
48352
48442
  const lastOpponentAction = str(resolved?.lastOpponentAction);
48353
48443
  const lastPayoff = num(resolved?.lastPayoff);
48354
- const actions = Array.isArray(resolved?.actions) ? resolved.actions : [];
48355
- const payoffMatrix = Array.isArray(resolved?.payoffMatrix) ? resolved.payoffMatrix : [];
48444
+ const actions = Array.isArray(resolved?.actions) ? resolved.actions.flatMap((item) => {
48445
+ if (item !== null && typeof item === "object" && !Array.isArray(item) && !(item instanceof Date) && typeof item.id === "string" && typeof item.label === "string")
48446
+ return [{ id: item.id, label: item.label, description: typeof item.description === "string" ? item.description : void 0 }];
48447
+ return [];
48448
+ }) : [];
48449
+ const payoffMatrix = Array.isArray(resolved?.payoffMatrix) ? resolved.payoffMatrix.flatMap((item) => {
48450
+ if (item !== null && typeof item === "object" && !Array.isArray(item) && !(item instanceof Date) && typeof item.playerAction === "string" && typeof item.opponentAction === "string")
48451
+ return [{ playerAction: item.playerAction, opponentAction: item.opponentAction, playerPayoff: typeof item.playerPayoff === "number" ? item.playerPayoff : 0, opponentPayoff: typeof item.opponentPayoff === "number" ? item.opponentPayoff : 0 }];
48452
+ return [];
48453
+ }) : [];
48356
48454
  const prevRoundRef = useRef(currentRound);
48357
48455
  useEffect(() => {
48358
48456
  if (currentRound > prevRoundRef.current && lastPlayerAction) {
@@ -48943,25 +49041,36 @@ var init_PricingPageTemplate = __esm({
48943
49041
  }
48944
49042
  });
48945
49043
  function RacingBoard({
48946
- backgroundImage,
49044
+ tiles,
49045
+ units,
49046
+ features,
49047
+ assetManifest,
48947
49048
  assetBaseUrl,
48948
- width = 800,
48949
- height = 600,
48950
- fps = 60,
48951
- tickEvent,
48952
- drawEvent,
49049
+ scale = 0.45,
49050
+ showMinimap = true,
49051
+ enableCamera = true,
49052
+ tileClickEvent,
49053
+ unitClickEvent,
49054
+ isLoading,
49055
+ error,
48953
49056
  className
48954
49057
  }) {
48955
49058
  return /* @__PURE__ */ jsx("div", { className: cn("racing-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
48956
- GameCanvas2D,
49059
+ IsometricCanvas_default,
48957
49060
  {
48958
- backgroundImage,
49061
+ tileLayout: "flat",
49062
+ tiles,
49063
+ units,
49064
+ features,
49065
+ assetManifest,
48959
49066
  assetBaseUrl,
48960
- width,
48961
- height,
48962
- fps,
48963
- tickEvent: typeof tickEvent === "string" ? tickEvent : void 0,
48964
- drawEvent: typeof drawEvent === "string" ? drawEvent : void 0
49067
+ scale,
49068
+ showMinimap,
49069
+ enableCamera,
49070
+ tileClickEvent,
49071
+ unitClickEvent,
49072
+ isLoading,
49073
+ error
48965
49074
  }
48966
49075
  ) });
48967
49076
  }
@@ -48969,7 +49078,7 @@ var init_RacingBoard = __esm({
48969
49078
  "components/game/organisms/RacingBoard.tsx"() {
48970
49079
  "use client";
48971
49080
  init_cn();
48972
- init_GameCanvas2D();
49081
+ init_IsometricCanvas();
48973
49082
  RacingBoard.displayName = "RacingBoard";
48974
49083
  }
48975
49084
  });
@@ -49467,7 +49576,7 @@ var init_debugRegistry = __esm({
49467
49576
  }
49468
49577
  });
49469
49578
  function useDebugData() {
49470
- const [data, setData] = React94.useState(() => ({
49579
+ const [data, setData] = React98.useState(() => ({
49471
49580
  traits: [],
49472
49581
  ticks: [],
49473
49582
  guards: [],
@@ -49481,7 +49590,7 @@ function useDebugData() {
49481
49590
  },
49482
49591
  lastUpdate: Date.now()
49483
49592
  }));
49484
- React94.useEffect(() => {
49593
+ React98.useEffect(() => {
49485
49594
  const updateData = () => {
49486
49595
  setData({
49487
49596
  traits: getAllTraits(),
@@ -49590,12 +49699,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
49590
49699
  return positions;
49591
49700
  }
49592
49701
  function WalkMinimap() {
49593
- const [walkStep, setWalkStep] = React94.useState(null);
49594
- const [traits2, setTraits] = React94.useState([]);
49595
- const [coveredEdges, setCoveredEdges] = React94.useState([]);
49596
- const [completedTraits, setCompletedTraits] = React94.useState(/* @__PURE__ */ new Set());
49597
- const prevTraitRef = React94.useRef(null);
49598
- React94.useEffect(() => {
49702
+ const [walkStep, setWalkStep] = React98.useState(null);
49703
+ const [traits2, setTraits] = React98.useState([]);
49704
+ const [coveredEdges, setCoveredEdges] = React98.useState([]);
49705
+ const [completedTraits, setCompletedTraits] = React98.useState(/* @__PURE__ */ new Set());
49706
+ const prevTraitRef = React98.useRef(null);
49707
+ React98.useEffect(() => {
49599
49708
  const interval = setInterval(() => {
49600
49709
  const w = window;
49601
49710
  const step = w.__orbitalWalkStep;
@@ -50031,15 +50140,15 @@ var init_EntitiesTab = __esm({
50031
50140
  });
50032
50141
  function EventFlowTab({ events: events2 }) {
50033
50142
  const { t } = useTranslate();
50034
- const [filter, setFilter] = React94.useState("all");
50035
- const containerRef = React94.useRef(null);
50036
- const [autoScroll, setAutoScroll] = React94.useState(true);
50037
- React94.useEffect(() => {
50143
+ const [filter, setFilter] = React98.useState("all");
50144
+ const containerRef = React98.useRef(null);
50145
+ const [autoScroll, setAutoScroll] = React98.useState(true);
50146
+ React98.useEffect(() => {
50038
50147
  if (autoScroll && containerRef.current) {
50039
50148
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
50040
50149
  }
50041
50150
  }, [events2.length, autoScroll]);
50042
- const filteredEvents = React94.useMemo(() => {
50151
+ const filteredEvents = React98.useMemo(() => {
50043
50152
  if (filter === "all") return events2;
50044
50153
  return events2.filter((e) => e.type === filter);
50045
50154
  }, [events2, filter]);
@@ -50155,7 +50264,7 @@ var init_EventFlowTab = __esm({
50155
50264
  });
50156
50265
  function GuardsPanel({ guards }) {
50157
50266
  const { t } = useTranslate();
50158
- const [filter, setFilter] = React94.useState("all");
50267
+ const [filter, setFilter] = React98.useState("all");
50159
50268
  if (guards.length === 0) {
50160
50269
  return /* @__PURE__ */ jsx(
50161
50270
  EmptyState,
@@ -50168,7 +50277,7 @@ function GuardsPanel({ guards }) {
50168
50277
  }
50169
50278
  const passedCount = guards.filter((g) => g.result).length;
50170
50279
  const failedCount = guards.length - passedCount;
50171
- const filteredGuards = React94.useMemo(() => {
50280
+ const filteredGuards = React98.useMemo(() => {
50172
50281
  if (filter === "all") return guards;
50173
50282
  if (filter === "passed") return guards.filter((g) => g.result);
50174
50283
  return guards.filter((g) => !g.result);
@@ -50331,10 +50440,10 @@ function EffectBadge({ effect }) {
50331
50440
  }
50332
50441
  function TransitionTimeline({ transitions }) {
50333
50442
  const { t } = useTranslate();
50334
- const containerRef = React94.useRef(null);
50335
- const [autoScroll, setAutoScroll] = React94.useState(true);
50336
- const [expandedId, setExpandedId] = React94.useState(null);
50337
- React94.useEffect(() => {
50443
+ const containerRef = React98.useRef(null);
50444
+ const [autoScroll, setAutoScroll] = React98.useState(true);
50445
+ const [expandedId, setExpandedId] = React98.useState(null);
50446
+ React98.useEffect(() => {
50338
50447
  if (autoScroll && containerRef.current) {
50339
50448
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
50340
50449
  }
@@ -50540,18 +50649,18 @@ var init_ServerBridgeTab = __esm({
50540
50649
  });
50541
50650
  function extractPayloadFields(schema, eventName) {
50542
50651
  if (!schema) return [];
50543
- const orbitals = schema.orbitals;
50544
- if (!orbitals) return [];
50545
- for (const orbital of orbitals) {
50546
- const traits2 = orbital.traits ?? [];
50547
- for (const trait of traits2) {
50548
- const sm = trait.stateMachine;
50652
+ for (const orbital of schema.orbitals) {
50653
+ const traitRefs = orbital.traits ?? [];
50654
+ for (const traitRef of traitRefs) {
50655
+ if (!isInlineTrait(traitRef)) continue;
50656
+ const inlineTrait = traitRef;
50657
+ const sm = inlineTrait.stateMachine;
50549
50658
  if (!sm) continue;
50550
50659
  const events2 = sm.events ?? [];
50551
50660
  for (const evt of events2) {
50552
50661
  if (evt.name !== eventName) continue;
50553
- const payload = evt.payload ?? [];
50554
- return payload.map((f3) => ({
50662
+ const payloadFields = evt.payloadSchema ?? [];
50663
+ return payloadFields.map((f3) => ({
50555
50664
  name: f3.name,
50556
50665
  type: f3.type ?? "string"
50557
50666
  }));
@@ -50614,9 +50723,9 @@ function getAllEvents(traits2) {
50614
50723
  function EventDispatcherTab({ traits: traits2, schema }) {
50615
50724
  const eventBus = useEventBus();
50616
50725
  const { t } = useTranslate();
50617
- const [log15, setLog] = React94.useState([]);
50618
- const prevStatesRef = React94.useRef(/* @__PURE__ */ new Map());
50619
- React94.useEffect(() => {
50726
+ const [log15, setLog] = React98.useState([]);
50727
+ const prevStatesRef = React98.useRef(/* @__PURE__ */ new Map());
50728
+ React98.useEffect(() => {
50620
50729
  for (const trait of traits2) {
50621
50730
  const prev = prevStatesRef.current.get(trait.id);
50622
50731
  if (prev && prev !== trait.currentState) {
@@ -50785,10 +50894,10 @@ function VerifyModePanel({
50785
50894
  localCount
50786
50895
  }) {
50787
50896
  const { t } = useTranslate();
50788
- const [expanded, setExpanded] = React94.useState(true);
50789
- const scrollRef = React94.useRef(null);
50790
- const prevCountRef = React94.useRef(0);
50791
- React94.useEffect(() => {
50897
+ const [expanded, setExpanded] = React98.useState(true);
50898
+ const scrollRef = React98.useRef(null);
50899
+ const prevCountRef = React98.useRef(0);
50900
+ React98.useEffect(() => {
50792
50901
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
50793
50902
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
50794
50903
  }
@@ -50845,10 +50954,10 @@ function RuntimeDebugger({
50845
50954
  schema
50846
50955
  }) {
50847
50956
  const { t } = useTranslate();
50848
- const [isCollapsed, setIsCollapsed] = React94.useState(mode === "verify" ? true : defaultCollapsed);
50849
- const [isVisible, setIsVisible] = React94.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
50957
+ const [isCollapsed, setIsCollapsed] = React98.useState(mode === "verify" ? true : defaultCollapsed);
50958
+ const [isVisible, setIsVisible] = React98.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
50850
50959
  const debugData = useDebugData();
50851
- React94.useEffect(() => {
50960
+ React98.useEffect(() => {
50852
50961
  if (mode === "inline") return;
50853
50962
  return onDebugToggle((enabled) => {
50854
50963
  setIsVisible(enabled);
@@ -50857,7 +50966,7 @@ function RuntimeDebugger({
50857
50966
  }
50858
50967
  });
50859
50968
  }, [mode]);
50860
- React94.useEffect(() => {
50969
+ React98.useEffect(() => {
50861
50970
  if (mode === "inline") return;
50862
50971
  const handleKeyDown = (e) => {
50863
50972
  if (e.key === "`" && isVisible) {
@@ -51417,7 +51526,7 @@ function SequenceBar({
51417
51526
  onSlotRemove(index);
51418
51527
  }, [onSlotRemove, playing]);
51419
51528
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
51420
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
51529
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
51421
51530
  i > 0 && /* @__PURE__ */ jsx(
51422
51531
  Typography,
51423
51532
  {
@@ -52032,6 +52141,29 @@ var init_SimulationCanvas = __esm({
52032
52141
  SimulationCanvas.displayName = "SimulationCanvas";
52033
52142
  }
52034
52143
  });
52144
+ function readSimulatorParameters(v) {
52145
+ if (!Array.isArray(v)) return [];
52146
+ const result = [];
52147
+ for (const item of v) {
52148
+ if (typeof item === "object" && item !== null && !Array.isArray(item) && !(item instanceof Date)) {
52149
+ const param = item;
52150
+ if ("id" in item && "label" in item && "unit" in item && "min" in item && "max" in item && "step" in item) {
52151
+ result.push({
52152
+ id: str(param.id),
52153
+ label: str(param.label),
52154
+ unit: str(param.unit),
52155
+ min: num(param.min),
52156
+ max: num(param.max),
52157
+ step: num(param.step),
52158
+ initial: num(param.initial),
52159
+ correct: num(param.correct),
52160
+ tolerance: num(param.tolerance)
52161
+ });
52162
+ }
52163
+ }
52164
+ }
52165
+ return result;
52166
+ }
52035
52167
  function SimulatorBoard({
52036
52168
  entity,
52037
52169
  completeEvent = "PUZZLE_COMPLETE",
@@ -52044,7 +52176,7 @@ function SimulatorBoard({
52044
52176
  const { emit } = useEventBus();
52045
52177
  const { t } = useTranslate();
52046
52178
  const resolved = boardEntity(entity);
52047
- const parameters = Array.isArray(resolved?.parameters) ? resolved.parameters : [];
52179
+ const parameters = readSimulatorParameters(resolved?.parameters);
52048
52180
  const [headerError, setHeaderError] = useState(false);
52049
52181
  if (!resolved) return null;
52050
52182
  const paramA = num(resolved.paramA);
@@ -52071,8 +52203,14 @@ function SimulatorBoard({
52071
52203
  const handlePlayAgain = () => {
52072
52204
  if (playAgainEvent) emit(`UI:${playAgainEvent}`, {});
52073
52205
  };
52074
- const theme = resolved.theme ?? void 0;
52075
- const themeBackground = theme?.background;
52206
+ const themeBackground = (() => {
52207
+ const t2 = resolved.theme;
52208
+ if (typeof t2 === "object" && t2 !== null && !Array.isArray(t2) && !(t2 instanceof Date)) {
52209
+ const bg = t2.background;
52210
+ return str(bg);
52211
+ }
52212
+ return "";
52213
+ })();
52076
52214
  const headerImage = str(resolved.headerImage);
52077
52215
  const hint = str(resolved.hint);
52078
52216
  const showHint = isComplete && !isWin && attempts >= 2 && Boolean(hint);
@@ -52221,35 +52359,44 @@ var init_SokobanBoard = __esm({
52221
52359
  }
52222
52360
  });
52223
52361
  function SpaceShmupBoard({
52224
- backgroundImage,
52362
+ tiles,
52363
+ units,
52364
+ features,
52365
+ assetManifest,
52225
52366
  assetBaseUrl,
52226
- width = 800,
52227
- height = 600,
52228
- fps = 60,
52367
+ scale = 0.45,
52368
+ showMinimap = false,
52369
+ enableCamera = true,
52370
+ tileClickEvent,
52371
+ unitClickEvent,
52229
52372
  isLoading,
52230
52373
  error,
52231
52374
  className
52232
52375
  }) {
52233
- return /* @__PURE__ */ jsxs("div", { className: cn("space-shmup-board relative w-full h-full", className), children: [
52234
- 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" }) }),
52235
- 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 }) }),
52236
- /* @__PURE__ */ jsx(
52237
- GameCanvas2D,
52238
- {
52239
- backgroundImage,
52240
- assetBaseUrl,
52241
- width,
52242
- height,
52243
- fps
52244
- }
52245
- )
52246
- ] });
52376
+ return /* @__PURE__ */ jsx("div", { className: cn("space-shmup-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
52377
+ IsometricCanvas_default,
52378
+ {
52379
+ tileLayout: "flat",
52380
+ tiles,
52381
+ units,
52382
+ features,
52383
+ assetManifest,
52384
+ assetBaseUrl,
52385
+ scale,
52386
+ showMinimap,
52387
+ enableCamera,
52388
+ tileClickEvent,
52389
+ unitClickEvent,
52390
+ isLoading,
52391
+ error
52392
+ }
52393
+ ) });
52247
52394
  }
52248
52395
  var init_SpaceShmupBoard = __esm({
52249
52396
  "components/game/organisms/SpaceShmupBoard.tsx"() {
52250
52397
  "use client";
52251
52398
  init_cn();
52252
- init_GameCanvas2D();
52399
+ init_IsometricCanvas();
52253
52400
  SpaceShmupBoard.displayName = "SpaceShmupBoard";
52254
52401
  }
52255
52402
  });
@@ -52468,7 +52615,7 @@ var init_StatCard = __esm({
52468
52615
  const labelToUse = propLabel ?? propTitle;
52469
52616
  const eventBus = useEventBus();
52470
52617
  const { t } = useTranslate();
52471
- const handleActionClick = React94__default.useCallback(() => {
52618
+ const handleActionClick = React98__default.useCallback(() => {
52472
52619
  if (action?.event) {
52473
52620
  eventBus.emit(`UI:${action.event}`, {});
52474
52621
  }
@@ -52479,7 +52626,7 @@ var init_StatCard = __esm({
52479
52626
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
52480
52627
  const isLoading = externalLoading ?? false;
52481
52628
  const error = externalError;
52482
- const computeMetricValue = React94__default.useCallback(
52629
+ const computeMetricValue = React98__default.useCallback(
52483
52630
  (metric, items) => {
52484
52631
  if (metric.value !== void 0) {
52485
52632
  return metric.value;
@@ -52518,7 +52665,7 @@ var init_StatCard = __esm({
52518
52665
  },
52519
52666
  []
52520
52667
  );
52521
- const schemaStats = React94__default.useMemo(() => {
52668
+ const schemaStats = React98__default.useMemo(() => {
52522
52669
  if (!metrics || metrics.length === 0) return null;
52523
52670
  return metrics.map((metric) => ({
52524
52671
  label: metric.label,
@@ -52526,7 +52673,7 @@ var init_StatCard = __esm({
52526
52673
  format: metric.format
52527
52674
  }));
52528
52675
  }, [metrics, data, computeMetricValue]);
52529
- const calculatedTrend = React94__default.useMemo(() => {
52676
+ const calculatedTrend = React98__default.useMemo(() => {
52530
52677
  if (manualTrend !== void 0) return manualTrend;
52531
52678
  if (previousValue === void 0 || currentValue === void 0)
52532
52679
  return void 0;
@@ -52869,8 +53016,25 @@ function StateArchitectBoard({
52869
53016
  const initialState = str(resolved?.initialState);
52870
53017
  const entityName = str(resolved?.entityName);
52871
53018
  const availableEvents = Array.isArray(resolved?.availableEvents) ? resolved.availableEvents : [];
52872
- const testCases = Array.isArray(resolved?.testCases) ? resolved.testCases : [];
52873
- const entityTransitions = Array.isArray(resolved?.transitions) ? resolved.transitions : [];
53019
+ const testCases = (Array.isArray(resolved?.testCases) ? resolved.testCases : []).map((item) => {
53020
+ const o = typeof item === "object" && item !== null && !Array.isArray(item) ? item : {};
53021
+ const eventsField = o["events"];
53022
+ return {
53023
+ events: Array.isArray(eventsField) ? eventsField : [],
53024
+ expectedState: str(o["expectedState"]),
53025
+ label: str(o["label"])
53026
+ };
53027
+ });
53028
+ const entityTransitions = (Array.isArray(resolved?.transitions) ? resolved.transitions : []).map((item) => {
53029
+ const o = typeof item === "object" && item !== null && !Array.isArray(item) ? item : {};
53030
+ return {
53031
+ id: str(o["id"]),
53032
+ from: str(o["from"]),
53033
+ to: str(o["to"]),
53034
+ event: str(o["event"]),
53035
+ ...o["guardHint"] ? { guardHint: str(o["guardHint"]) } : {}
53036
+ };
53037
+ });
52874
53038
  const entityVariables = rows(resolved?.variables);
52875
53039
  const transitions = entityTransitions;
52876
53040
  const attempts = typeof resolved?.attempts === "number" ? resolved.attempts : 0;
@@ -53715,8 +53879,8 @@ var init_SubagentTracePanel = __esm({
53715
53879
  ] });
53716
53880
  };
53717
53881
  InlineActivityStream = ({ activities, autoScroll = true, className }) => {
53718
- const endRef = React94__default.useRef(null);
53719
- React94__default.useEffect(() => {
53882
+ const endRef = React98__default.useRef(null);
53883
+ React98__default.useEffect(() => {
53720
53884
  if (!autoScroll) return;
53721
53885
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
53722
53886
  }, [activities.length, autoScroll]);
@@ -53810,7 +53974,7 @@ var init_SubagentTracePanel = __esm({
53810
53974
  };
53811
53975
  SubagentRichCard = ({ subagent }) => {
53812
53976
  const { t } = useTranslate();
53813
- const activities = React94__default.useMemo(
53977
+ const activities = React98__default.useMemo(
53814
53978
  () => subagentMessagesToActivities(subagent.messages),
53815
53979
  [subagent.messages]
53816
53980
  );
@@ -53887,8 +54051,8 @@ var init_SubagentTracePanel = __esm({
53887
54051
  ] });
53888
54052
  };
53889
54053
  CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
53890
- const endRef = React94__default.useRef(null);
53891
- React94__default.useEffect(() => {
54054
+ const endRef = React98__default.useRef(null);
54055
+ React98__default.useEffect(() => {
53892
54056
  if (!autoScroll) return;
53893
54057
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
53894
54058
  }, [messages.length, autoScroll]);
@@ -54359,17 +54523,12 @@ var init_Timeline = __esm({
54359
54523
  look = "vertical-spacious"
54360
54524
  }) => {
54361
54525
  const { t } = useTranslate();
54362
- const entityData = Array.isArray(entity) ? entity : [];
54363
- const items = React94__default.useMemo(() => {
54526
+ const entityData = entity ?? [];
54527
+ const items = React98__default.useMemo(() => {
54364
54528
  if (propItems) return propItems;
54365
54529
  if (entityData.length === 0) return [];
54366
54530
  return entityData.map((record, idx) => {
54367
- const resolveField = (f3) => {
54368
- if (typeof f3 === "string") return f3;
54369
- if (f3 && typeof f3 === "object" && "name" in f3) return String(f3.name);
54370
- return "";
54371
- };
54372
- const resolvedFields = fields?.map(resolveField) ?? [];
54531
+ const resolvedFields = fields ?? [];
54373
54532
  const titleField = resolvedFields[0] || "title";
54374
54533
  const descField = resolvedFields[1] || "description";
54375
54534
  const dateField = resolvedFields.find(
@@ -54467,7 +54626,7 @@ var init_Timeline = __esm({
54467
54626
  }
54468
54627
  });
54469
54628
  function extractToastProps(children) {
54470
- if (!React94__default.isValidElement(children)) {
54629
+ if (!React98__default.isValidElement(children)) {
54471
54630
  if (typeof children === "string") {
54472
54631
  return { message: children };
54473
54632
  }
@@ -54505,7 +54664,7 @@ var init_ToastSlot = __esm({
54505
54664
  eventBus.emit("UI:CLOSE");
54506
54665
  };
54507
54666
  if (!isVisible) return null;
54508
- const isCustomContent = React94__default.isValidElement(children) && !message;
54667
+ const isCustomContent = React98__default.isValidElement(children) && !message;
54509
54668
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
54510
54669
  Toast,
54511
54670
  {
@@ -55777,7 +55936,7 @@ function WorldMapBoard({
55777
55936
  const resolved = boardEntity(entity);
55778
55937
  const entityUnits = rows(resolved?.units);
55779
55938
  const entityTiles = rows(resolved?.tiles);
55780
- const features = propFeatures ?? (Array.isArray(resolved?.features) ? resolved.features : []);
55939
+ const features = propFeatures ?? rows(resolved?.features);
55781
55940
  const selectedHeroId = resolved?.selectedHeroId ?? null;
55782
55941
  const assetManifest = propAssetManifest ?? resolved?.assetManifest;
55783
55942
  const backgroundImage = resolved?.backgroundImage;
@@ -55910,7 +56069,8 @@ function WorldMapBoard({
55910
56069
  if (heroMoveEvent) {
55911
56070
  eventBus.emit(`UI:${heroMoveEvent}`, { heroId, toX: x, toY: y });
55912
56071
  }
55913
- const feature = tile ? str(tile.feature) : "";
56072
+ const tileWithFeature = tile;
56073
+ const feature = tileWithFeature ? str(tileWithFeature.feature) : "";
55914
56074
  if (feature && feature !== "none") {
55915
56075
  const tileRow = tile;
55916
56076
  onFeatureEnter?.(heroId, tileRow);
@@ -56121,7 +56281,7 @@ var init_WorldMapTemplate = __esm({
56121
56281
  }
56122
56282
  });
56123
56283
  function lazyThree(name, loader) {
56124
- const Lazy = React94__default.lazy(
56284
+ const Lazy = React98__default.lazy(
56125
56285
  () => loader().then((m) => {
56126
56286
  const Resolved = m[name];
56127
56287
  if (!Resolved) {
@@ -56133,13 +56293,13 @@ function lazyThree(name, loader) {
56133
56293
  })
56134
56294
  );
56135
56295
  function ThreeWrapper(props) {
56136
- return React94__default.createElement(
56296
+ return React98__default.createElement(
56137
56297
  ThreeBoundary,
56138
56298
  { name },
56139
- React94__default.createElement(
56140
- React94__default.Suspense,
56299
+ React98__default.createElement(
56300
+ React98__default.Suspense,
56141
56301
  { fallback: null },
56142
- React94__default.createElement(Lazy, props)
56302
+ React98__default.createElement(Lazy, props)
56143
56303
  )
56144
56304
  );
56145
56305
  }
@@ -56462,7 +56622,7 @@ var init_component_registry_generated = __esm({
56462
56622
  init_WorldMapBoard();
56463
56623
  init_WorldMapTemplate();
56464
56624
  init_XPBar();
56465
- ThreeBoundary = class extends React94__default.Component {
56625
+ ThreeBoundary = class extends React98__default.Component {
56466
56626
  constructor() {
56467
56627
  super(...arguments);
56468
56628
  __publicField(this, "state", { failed: false });
@@ -56472,7 +56632,7 @@ var init_component_registry_generated = __esm({
56472
56632
  }
56473
56633
  render() {
56474
56634
  if (this.state.failed) {
56475
- return React94__default.createElement(
56635
+ return React98__default.createElement(
56476
56636
  "div",
56477
56637
  {
56478
56638
  "data-testid": "three-unavailable",
@@ -56838,7 +56998,7 @@ function SuspenseConfigProvider({
56838
56998
  config,
56839
56999
  children
56840
57000
  }) {
56841
- return React94__default.createElement(
57001
+ return React98__default.createElement(
56842
57002
  SuspenseConfigContext.Provider,
56843
57003
  { value: config },
56844
57004
  children
@@ -56854,9 +57014,7 @@ function getComponentForPattern3(patternType) {
56854
57014
  if (!mapping) {
56855
57015
  return null;
56856
57016
  }
56857
- const name = typeof mapping === "string" ? mapping : mapping.component;
56858
- if (!name) return null;
56859
- return COMPONENT_REGISTRY[name] ?? null;
57017
+ return COMPONENT_REGISTRY[mapping] ?? null;
56860
57018
  }
56861
57019
  function enrichFormFields(fields, entityDef) {
56862
57020
  const fieldMap = new Map(entityDef.fields.map((f3) => [f3.name, f3]));
@@ -56868,7 +57026,7 @@ function enrichFormFields(fields, entityDef) {
56868
57026
  name: field,
56869
57027
  label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()),
56870
57028
  type: entityField.type,
56871
- required: entityField.required
57029
+ required: entityField.required ?? false
56872
57030
  };
56873
57031
  if (entityField.values && entityField.values.length > 0) {
56874
57032
  enriched.values = entityField.values;
@@ -56876,15 +57034,15 @@ function enrichFormFields(fields, entityDef) {
56876
57034
  enriched.values = entityField.enumValues;
56877
57035
  }
56878
57036
  if (entityField.relation) {
56879
- enriched.relation = entityField.relation;
57037
+ enriched.relation = entityField.relation.entity;
56880
57038
  }
56881
57039
  return enriched;
56882
57040
  }
56883
57041
  return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
56884
57042
  }
56885
- if (field && typeof field === "object" && !Array.isArray(field)) {
57043
+ if (field && typeof field === "object" && !Array.isArray(field) && !React98__default.isValidElement(field) && !(field instanceof Date)) {
56886
57044
  const obj = field;
56887
- const fieldName = obj.name ?? obj.field;
57045
+ const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
56888
57046
  if (!fieldName) return field;
56889
57047
  if (obj.type || obj.inputType) return field;
56890
57048
  const entityField = fieldMap.get(fieldName);
@@ -56901,7 +57059,7 @@ function enrichFormFields(fields, entityDef) {
56901
57059
  }
56902
57060
  }
56903
57061
  if (!obj.relation && entityField.relation) {
56904
- enriched.relation = entityField.relation;
57062
+ enriched.relation = entityField.relation.entity;
56905
57063
  }
56906
57064
  return enriched;
56907
57065
  }
@@ -57328,7 +57486,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
57328
57486
  const key = `${parentId}-${index}-trait:${traitName}`;
57329
57487
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
57330
57488
  }
57331
- return /* @__PURE__ */ jsx(React94__default.Fragment, { children: child }, `${parentId}-${index}`);
57489
+ return /* @__PURE__ */ jsx(React98__default.Fragment, { children: child }, `${parentId}-${index}`);
57332
57490
  }
57333
57491
  if (!child || typeof child !== "object") return null;
57334
57492
  const childId = `${parentId}-${index}`;
@@ -57368,14 +57526,14 @@ function isPatternConfig(value) {
57368
57526
  if (value === null || value === void 0) return false;
57369
57527
  if (typeof value !== "object") return false;
57370
57528
  if (Array.isArray(value)) return false;
57371
- if (React94__default.isValidElement(value)) return false;
57529
+ if (React98__default.isValidElement(value)) return false;
57372
57530
  if (value instanceof Date) return false;
57373
57531
  if (typeof value === "function") return false;
57374
57532
  const record = value;
57375
57533
  return "type" in record && typeof record.type === "string" && getComponentForPattern(record.type) !== null;
57376
57534
  }
57377
57535
  function isPlainConfigObject(value) {
57378
- if (React94__default.isValidElement(value)) return false;
57536
+ if (React98__default.isValidElement(value)) return false;
57379
57537
  if (value instanceof Date) return false;
57380
57538
  const proto = Object.getPrototypeOf(value);
57381
57539
  return proto === Object.prototype || proto === null;
@@ -57501,7 +57659,7 @@ function SlotContentRenderer({
57501
57659
  for (const slotKey of CONTENT_NODE_SLOTS) {
57502
57660
  const slotVal = restProps[slotKey];
57503
57661
  if (slotVal === void 0 || slotVal === null) continue;
57504
- if (React94__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
57662
+ if (React98__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
57505
57663
  if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
57506
57664
  nodeSlotOverrides[slotKey] = renderPatternChildren(
57507
57665
  slotVal,
@@ -57546,19 +57704,18 @@ function SlotContentRenderer({
57546
57704
  for (const [k, v] of Object.entries(nodeSlotOverrides)) {
57547
57705
  finalProps[k] = v;
57548
57706
  }
57549
- const resolvedItems = Array.isArray(
57550
- finalProps.entity
57551
- ) ? finalProps.entity : null;
57707
+ const entityVal = finalProps.entity;
57708
+ const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
57552
57709
  if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
57553
57710
  const sample = resolvedItems[0];
57554
- if (sample && typeof sample === "object") {
57711
+ if (sample && typeof sample === "object" && !Array.isArray(sample) && !React98__default.isValidElement(sample) && !(sample instanceof Date)) {
57555
57712
  const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
57556
57713
  finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
57557
57714
  }
57558
57715
  }
57559
57716
  const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
57560
- if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
57561
- finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
57717
+ if (isFormPattern && entityDef && Array.isArray(finalProps.fields) && finalProps.fields[0] !== "fn") {
57718
+ finalProps.fields = enrichFormFields([...finalProps.fields], entityDef);
57562
57719
  }
57563
57720
  const acceptsChildren = PATTERNS_WITH_CHILDREN.has(content.pattern);
57564
57721
  return /* @__PURE__ */ jsx(
@@ -57914,7 +58071,7 @@ var AvlTransition = ({
57914
58071
  opacity = 1,
57915
58072
  className
57916
58073
  }) => {
57917
- const ids = React94__default.useMemo(() => {
58074
+ const ids = React98__default.useMemo(() => {
57918
58075
  avlTransitionId += 1;
57919
58076
  return { arrow: `avl-tr-${avlTransitionId}-arrow` };
57920
58077
  }, []);
@@ -58475,7 +58632,7 @@ var AvlStateMachine = ({
58475
58632
  color = "var(--color-primary)",
58476
58633
  animated = false
58477
58634
  }) => {
58478
- const ids = React94__default.useMemo(() => {
58635
+ const ids = React98__default.useMemo(() => {
58479
58636
  avlSmId += 1;
58480
58637
  const base = `avl-sm-${avlSmId}`;
58481
58638
  return { glow: `${base}-glow`, grad: `${base}-grad` };
@@ -58674,7 +58831,7 @@ var AvlOrbitalUnit = ({
58674
58831
  color = "var(--color-primary)",
58675
58832
  animated = false
58676
58833
  }) => {
58677
- const ids = React94__default.useMemo(() => {
58834
+ const ids = React98__default.useMemo(() => {
58678
58835
  avlOuId += 1;
58679
58836
  const base = `avl-ou-${avlOuId}`;
58680
58837
  return { glow: `${base}-glow`, grad: `${base}-grad` };
@@ -58770,7 +58927,7 @@ var AvlClosedCircuit = ({
58770
58927
  color = "var(--color-primary)",
58771
58928
  animated = false
58772
58929
  }) => {
58773
- const ids = React94__default.useMemo(() => {
58930
+ const ids = React98__default.useMemo(() => {
58774
58931
  avlCcId += 1;
58775
58932
  const base = `avl-cc-${avlCcId}`;
58776
58933
  return { glow: `${base}-glow`, grad: `${base}-grad`, arrow: `${base}-arrow` };
@@ -58925,7 +59082,7 @@ var AvlEmitListen = ({
58925
59082
  color = "var(--color-primary)",
58926
59083
  animated = false
58927
59084
  }) => {
58928
- const ids = React94__default.useMemo(() => {
59085
+ const ids = React98__default.useMemo(() => {
58929
59086
  avlElId += 1;
58930
59087
  const base = `avl-el-${avlElId}`;
58931
59088
  return { arrow: `${base}-arrow`, grad: `${base}-grad` };
@@ -59199,7 +59356,7 @@ function renderNode(node, color, glowId) {
59199
59356
  const baseR = node.type === "operator" ? 20 : 16;
59200
59357
  const r2 = Math.max(baseR, labelLen * 3.5 + 6);
59201
59358
  const nc = nodeColor(node.type, color);
59202
- return /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
59359
+ return /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
59203
59360
  node.children.map((child, i) => {
59204
59361
  const childR = Math.max(
59205
59362
  child.type === "operator" ? 20 : 16,
@@ -59256,7 +59413,7 @@ var AvlExprTree = ({
59256
59413
  className,
59257
59414
  color = "var(--color-primary)"
59258
59415
  }) => {
59259
- const ids = React94__default.useMemo(() => {
59416
+ const ids = React98__default.useMemo(() => {
59260
59417
  avlEtId += 1;
59261
59418
  return { glow: `avl-et-${avlEtId}-glow` };
59262
59419
  }, []);
@@ -59721,9 +59878,17 @@ function getEntity(orbital) {
59721
59878
  if (typeof entity === "string") {
59722
59879
  return { name: entity, fields: [], persistence: "runtime" };
59723
59880
  }
59881
+ if ("extends" in entity) {
59882
+ const ec = entity;
59883
+ return {
59884
+ name: ec.name ?? orbital.name,
59885
+ fields: ec.fields ?? [],
59886
+ persistence: ec.persistence ?? "runtime"
59887
+ };
59888
+ }
59724
59889
  const e = entity;
59725
59890
  return {
59726
- name: e.name ?? orbital.name,
59891
+ name: e.name,
59727
59892
  fields: e.fields ?? [],
59728
59893
  persistence: e.persistence ?? "runtime"
59729
59894
  };
@@ -59732,6 +59897,7 @@ function getTraits(orbital) {
59732
59897
  if (!orbital.traits) return [];
59733
59898
  return orbital.traits.map((t) => {
59734
59899
  if (typeof t === "string") return { name: t };
59900
+ if ("ref" in t && !("stateMachine" in t)) return { name: t.name ?? t.ref };
59735
59901
  return t;
59736
59902
  });
59737
59903
  }
@@ -59739,6 +59905,7 @@ function getPages(orbital) {
59739
59905
  if (!orbital.pages) return [];
59740
59906
  return orbital.pages.map((p2) => {
59741
59907
  if (typeof p2 === "string") return { name: p2, path: `/${p2.toLowerCase()}` };
59908
+ if ("ref" in p2 && !("path" in p2)) return { name: p2.ref, path: `/${p2.ref.toLowerCase()}` };
59742
59909
  return p2;
59743
59910
  });
59744
59911
  }
@@ -59757,12 +59924,12 @@ function getEvents(sm) {
59757
59924
  function getEmits(trait) {
59758
59925
  const emits = trait.emits;
59759
59926
  if (!emits) return [];
59760
- return emits.map((e) => typeof e === "string" ? e : e.event ?? e.name ?? "");
59927
+ return emits.map((e) => e.event ?? "");
59761
59928
  }
59762
59929
  function getListens(trait) {
59763
59930
  const listens = trait.listens;
59764
59931
  if (!listens) return [];
59765
- return listens.map((l) => typeof l === "string" ? l : l.event ?? "");
59932
+ return listens.map((l) => l.event ?? "");
59766
59933
  }
59767
59934
  function parseEffectType(effect) {
59768
59935
  if (Array.isArray(effect)) {
@@ -59933,14 +60100,14 @@ function parseTraitLevel(schema, orbitalName, traitName) {
59933
60100
  if (!sm) return null;
59934
60101
  const states = getStates(sm).map((s) => ({
59935
60102
  name: s.name ?? "",
59936
- isInitial: s.isInitial ?? false,
59937
- isTerminal: s.isTerminal ?? false
60103
+ isInitial: s.isInitial ?? null,
60104
+ isTerminal: s.isTerminal ?? null
59938
60105
  }));
59939
60106
  const transitions = getTransitions(sm).map((t, i) => ({
59940
60107
  from: t.from ?? "",
59941
60108
  to: t.to ?? "",
59942
60109
  event: t.event ?? "",
59943
- guard: t.guard,
60110
+ guard: t.guard ?? null,
59944
60111
  effects: (t.effects ?? []).map(parseEffectType),
59945
60112
  index: i
59946
60113
  }));
@@ -59959,13 +60126,14 @@ function parseTransitionLevel(schema, orbitalName, traitName, transitionIndex) {
59959
60126
  if (!traitData) return null;
59960
60127
  const transition = traitData.transitions[transitionIndex];
59961
60128
  if (!transition) return null;
59962
- const guard = transition.guard ? exprToTree(transition.guard) : null;
60129
+ const guardVal = transition.guard;
60130
+ const guard = guardVal != null ? exprToTree(guardVal) : null;
59963
60131
  const effects = transition.effects.map(
59964
60132
  (e) => exprToTree([e.type, ...e.args])
59965
60133
  );
59966
60134
  const slotTargets = transition.effects.filter((e) => e.type === "render-ui").map((e) => ({
59967
60135
  name: String(e.args[0] ?? "main"),
59968
- pattern: typeof e.args[1] === "object" && e.args[1] !== null ? e.args[1].type ?? "unknown" : String(e.args[1] ?? "unknown")
60136
+ pattern: typeof e.args[1] === "object" && e.args[1] !== null && !Array.isArray(e.args[1]) ? e.args[1].type ?? "unknown" : String(e.args[1] ?? "unknown")
59969
60137
  }));
59970
60138
  return {
59971
60139
  from: transition.from,
@@ -60021,8 +60189,8 @@ function schemaToFlowGraph(schema) {
60021
60189
  data: {
60022
60190
  edgeKind: "eventWire",
60023
60191
  event: link.eventName,
60024
- fromTrait: link.emitterTrait,
60025
- toTrait: link.listenerTrait
60192
+ fromTrait: link.emitterTrait ?? null,
60193
+ toTrait: link.listenerTrait ?? null
60026
60194
  }
60027
60195
  });
60028
60196
  }
@@ -60079,9 +60247,9 @@ var SystemNode = ({ data }) => {
60079
60247
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
60080
60248
  stateChain.length > 0 && /* @__PURE__ */ jsx("svg", { width: stateChain.length * 14 + 2, height: 10, viewBox: `0 0 ${stateChain.length * 14 + 2} 10`, children: stateChain.map((s, i) => {
60081
60249
  const tc = transitionCounts[s.name] ?? 0;
60082
- const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
60083
- return /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
60084
- /* @__PURE__ */ jsx(AvlState, { x: i * 14 + 1, y: 1, width: 10, height: 8, name: "", role, isInitial: s.isInitial, isTerminal: s.isTerminal }),
60250
+ const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
60251
+ return /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
60252
+ /* @__PURE__ */ jsx(AvlState, { x: i * 14 + 1, y: 1, width: 10, height: 8, name: "", role, isInitial: s.isInitial ?? void 0, isTerminal: s.isTerminal ?? void 0 }),
60085
60253
  i < stateChain.length - 1 && /* @__PURE__ */ jsx("line", { x1: i * 14 + 12, y1: 5, x2: i * 14 + 15, y2: 5, stroke: "var(--color-border)", strokeWidth: 0.5 })
60086
60254
  ] }, s.name);
60087
60255
  }) }),
@@ -60114,17 +60282,17 @@ var DetailView = ({ data }) => {
60114
60282
  transitionCounts[t2.to] = (transitionCounts[t2.to] ?? 0) + 1;
60115
60283
  }
60116
60284
  const maxTC = Math.max(...Object.values(transitionCounts), 0);
60117
- const fromRole = getStateRole(transition.from, fromState?.isInitial, fromState?.isTerminal, transitionCounts[transition.from] ?? 0, maxTC);
60118
- const toRole = getStateRole(transition.to, toState?.isInitial, toState?.isTerminal, transitionCounts[transition.to] ?? 0, maxTC);
60285
+ const fromRole = getStateRole(transition.from, fromState?.isInitial ?? void 0, fromState?.isTerminal ?? void 0, transitionCounts[transition.from] ?? 0, maxTC);
60286
+ const toRole = getStateRole(transition.to, toState?.isInitial ?? void 0, toState?.isTerminal ?? void 0, transitionCounts[transition.to] ?? 0, maxTC);
60119
60287
  const hasGuard = transition.guard != null;
60120
60288
  return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border-2 border-[var(--color-border)] bg-[var(--color-card)] overflow-hidden", style: { minWidth: 380, maxWidth: 500 }, children: [
60121
60289
  /* @__PURE__ */ jsx("div", { className: "px-4 py-3 border-b border-[var(--color-border)] bg-[var(--color-background)]", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
60122
- /* @__PURE__ */ jsx("svg", { width: 90, height: 32, viewBox: "0 0 90 32", children: /* @__PURE__ */ jsx(AvlState, { x: 0, y: 0, width: 80, height: 28, name: transition.from, role: fromRole, isInitial: fromState?.isInitial, isTerminal: fromState?.isTerminal }) }),
60290
+ /* @__PURE__ */ jsx("svg", { width: 90, height: 32, viewBox: "0 0 90 32", children: /* @__PURE__ */ jsx(AvlState, { x: 0, y: 0, width: 80, height: 28, name: transition.from, role: fromRole, isInitial: fromState?.isInitial ?? void 0, isTerminal: fromState?.isTerminal ?? void 0 }) }),
60123
60291
  /* @__PURE__ */ jsxs("svg", { width: 24, height: 16, viewBox: "0 0 24 16", children: [
60124
60292
  /* @__PURE__ */ jsx("line", { x1: 0, y1: 8, x2: 18, y2: 8, stroke: "var(--color-muted-foreground)", strokeWidth: 2 }),
60125
60293
  /* @__PURE__ */ jsx("polygon", { points: "18,4 24,8 18,12", fill: "var(--color-muted-foreground)" })
60126
60294
  ] }),
60127
- /* @__PURE__ */ jsx("svg", { width: 90, height: 32, viewBox: "0 0 90 32", children: /* @__PURE__ */ jsx(AvlState, { x: 0, y: 0, width: 80, height: 28, name: transition.to, role: toRole, isInitial: toState?.isInitial, isTerminal: toState?.isTerminal }) })
60295
+ /* @__PURE__ */ jsx("svg", { width: 90, height: 32, viewBox: "0 0 90 32", children: /* @__PURE__ */ jsx(AvlState, { x: 0, y: 0, width: 80, height: 28, name: transition.to, role: toRole, isInitial: toState?.isInitial ?? void 0, isTerminal: toState?.isTerminal ?? void 0 }) })
60128
60296
  ] }) }),
60129
60297
  /* @__PURE__ */ jsxs("div", { className: "px-4 py-3 space-y-3", children: [
60130
60298
  /* @__PURE__ */ jsxs("div", { children: [
@@ -60461,7 +60629,7 @@ function getTraits2(orbital) {
60461
60629
  if (!orbital.traits) return [];
60462
60630
  return orbital.traits.map((t) => {
60463
60631
  if (typeof t === "string") return { name: t };
60464
- if ("ref" in t) return { name: t.ref };
60632
+ if (typeof t === "object" && t !== null && "ref" in t) return { name: t.ref };
60465
60633
  return t;
60466
60634
  });
60467
60635
  }
@@ -60490,8 +60658,8 @@ function getPages2(orbital) {
60490
60658
  if (!orbital.pages) return [];
60491
60659
  return orbital.pages.map((p2) => {
60492
60660
  if (typeof p2 === "string") return `/${p2.toLowerCase()}`;
60493
- const po = p2;
60494
- return po.path ?? `/${po.name ?? ""}`.toLowerCase();
60661
+ if ("ref" in p2) return p2.path ?? `/${p2.ref}`.toLowerCase();
60662
+ return p2.path ?? `/${p2.name}`.toLowerCase();
60495
60663
  });
60496
60664
  }
60497
60665
  function getEmits2(trait) {
@@ -60508,13 +60676,11 @@ function extractRenderUI(effects) {
60508
60676
  const patterns = [];
60509
60677
  for (const eff of effects) {
60510
60678
  if (!Array.isArray(eff)) continue;
60511
- const [type, ...args] = eff;
60512
- if (type === "render-ui" && args.length >= 2) {
60513
- const slot = args[0];
60514
- const pattern = args[1];
60515
- if (pattern !== null && pattern !== void 0 && typeof pattern === "object") {
60516
- patterns.push({ slot, pattern });
60517
- }
60679
+ if (eff[0] !== "render-ui" || eff.length < 3) continue;
60680
+ const slot = eff[1];
60681
+ const pattern = eff[2];
60682
+ if (pattern !== null && pattern !== void 0 && typeof pattern === "object" && !Array.isArray(pattern)) {
60683
+ patterns.push({ slot, pattern });
60518
60684
  }
60519
60685
  }
60520
60686
  return patterns;
@@ -60531,14 +60697,14 @@ function extractEffectTypes(effects) {
60531
60697
  function findEventSources(config, path = "root", depth = 0, totalSiblings = 1, siblingIndex = 0) {
60532
60698
  const sources = [];
60533
60699
  if (depth > 10) return sources;
60534
- const patternType = config.type;
60535
- const event = config.event;
60536
- if (patternType && event && typeof event === "string") {
60700
+ const patternType = typeof config.type === "string" ? config.type : void 0;
60701
+ const event = typeof config.event === "string" ? config.event : void 0;
60702
+ if (patternType && event) {
60537
60703
  const positionHint = totalSiblings > 1 ? (siblingIndex + 0.5) / totalSiblings : 0.5 + depth * 0.1;
60538
60704
  sources.push({
60539
60705
  event,
60540
60706
  patternType,
60541
- label: config.label ?? config.content ?? config.text,
60707
+ label: typeof config.label === "string" ? config.label : typeof config.content === "string" ? config.content : typeof config.text === "string" ? config.text : void 0,
60542
60708
  path,
60543
60709
  positionHint: Math.min(Math.max(positionHint, 0.1), 0.9)
60544
60710
  });
@@ -60547,7 +60713,7 @@ function findEventSources(config, path = "root", depth = 0, totalSiblings = 1, s
60547
60713
  if (Array.isArray(children)) {
60548
60714
  for (let i = 0; i < children.length; i++) {
60549
60715
  const child = children[i];
60550
- if (child && typeof child === "object") {
60716
+ if (child !== null && typeof child === "object" && !Array.isArray(child)) {
60551
60717
  sources.push(
60552
60718
  ...findEventSources(child, `${path}.children.${i}`, depth + 1, children.length, i)
60553
60719
  );
@@ -60556,7 +60722,7 @@ function findEventSources(config, path = "root", depth = 0, totalSiblings = 1, s
60556
60722
  }
60557
60723
  for (const [key, value] of Object.entries(config)) {
60558
60724
  if (key === "children" || key === "type" || key === "event") continue;
60559
- if (value && typeof value === "object" && !Array.isArray(value) && "type" in value) {
60725
+ if (value !== null && typeof value === "object" && !Array.isArray(value) && "type" in value) {
60560
60726
  sources.push(
60561
60727
  ...findEventSources(value, `${path}.${key}`, depth + 1, totalSiblings, siblingIndex)
60562
60728
  );
@@ -60693,10 +60859,10 @@ function schemaToOverviewGraph(schema, mockData, behaviorMeta, layoutHint, orbit
60693
60859
  if (!sm) continue;
60694
60860
  const smEvents = trait.stateMachine?.events ?? [];
60695
60861
  const matchingEvent = smEvents.find((ev) => ev.key === source.event);
60696
- if (matchingEvent?.payload && Array.isArray(matchingEvent.payload)) {
60697
- source.payloadFields = matchingEvent.payload.map((p2) => ({
60698
- name: String(p2.name ?? ""),
60699
- type: String(p2.type ?? "string"),
60862
+ if (matchingEvent?.payloadSchema && Array.isArray(matchingEvent.payloadSchema)) {
60863
+ source.payloadFields = matchingEvent.payloadSchema.map((p2) => ({
60864
+ name: p2.name ?? "",
60865
+ type: p2.type ?? "string",
60700
60866
  ...p2.required ? { required: true } : {}
60701
60867
  }));
60702
60868
  break;
@@ -61232,7 +61398,7 @@ function resolveLambdaBindings(body, params, item, index) {
61232
61398
  if (Array.isArray(body)) {
61233
61399
  return body.map((b) => recur(b));
61234
61400
  }
61235
- if (body !== null && typeof body === "object" && !React94__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
61401
+ if (body !== null && typeof body === "object" && !React98__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
61236
61402
  const out = {};
61237
61403
  for (const [k, v] of Object.entries(body)) {
61238
61404
  out[k] = recur(v);
@@ -61251,7 +61417,7 @@ function getSlotContentRenderer4() {
61251
61417
  function makeLambdaFn(params, lambdaBody, callerKey) {
61252
61418
  return (item, index) => {
61253
61419
  const resolvedBody = resolveLambdaBindings(lambdaBody, params, item, index);
61254
- if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React94__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
61420
+ if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React98__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
61255
61421
  return null;
61256
61422
  }
61257
61423
  const record = resolvedBody;
@@ -61270,7 +61436,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
61270
61436
  props: childProps,
61271
61437
  priority: 0
61272
61438
  };
61273
- return React94__default.createElement(SlotContentRenderer2, { content: childContent });
61439
+ return React98__default.createElement(SlotContentRenderer2, { content: childContent });
61274
61440
  };
61275
61441
  }
61276
61442
  function convertNode(node, callerKey) {
@@ -61289,7 +61455,7 @@ function convertNode(node, callerKey) {
61289
61455
  });
61290
61456
  return anyChanged ? mapped : node;
61291
61457
  }
61292
- if (typeof node === "object" && !React94__default.isValidElement(node) && !(node instanceof Date)) {
61458
+ if (typeof node === "object" && !React98__default.isValidElement(node) && !(node instanceof Date)) {
61293
61459
  return convertObjectProps(node);
61294
61460
  }
61295
61461
  return node;
@@ -62883,7 +63049,7 @@ function buildMockData(schema) {
62883
63049
  perfEnd("build-mock-data", t, { orbitalCount: schema.orbitals.length, entityCount: Object.keys(result).length });
62884
63050
  return result;
62885
63051
  }
62886
- function isInlineTrait2(traitRef) {
63052
+ function isInlineTrait3(traitRef) {
62887
63053
  return typeof traitRef === "object" && traitRef !== null && "stateMachine" in traitRef;
62888
63054
  }
62889
63055
  function findDataState(sm, initialStateName) {
@@ -62915,7 +63081,7 @@ function adjustSchemaForMockData(schema, mockData) {
62915
63081
  const updatedOrbitals = schema.orbitals.map((orbital) => {
62916
63082
  const traits2 = orbital.traits ?? [];
62917
63083
  const updatedTraits = traits2.map((traitRef) => {
62918
- if (!isInlineTrait2(traitRef)) return traitRef;
63084
+ if (!isInlineTrait3(traitRef)) return traitRef;
62919
63085
  const updated = rewriteTraitInitialState(traitRef, mockData);
62920
63086
  if (updated !== traitRef) changed = true;
62921
63087
  return updated;
@@ -63485,7 +63651,7 @@ function useCanvasDroppable({
63485
63651
  function defaultEmit(eventBus, drop) {
63486
63652
  const { payload, target, resolved } = drop;
63487
63653
  if (payload.kind === "pattern") {
63488
- const patternType = payload.data.type;
63654
+ const patternType = payload.data["type"];
63489
63655
  if (typeof patternType !== "string") {
63490
63656
  log13.warn("default-emit:pattern:missing-type");
63491
63657
  return;
@@ -63500,7 +63666,7 @@ function defaultEmit(eventBus, drop) {
63500
63666
  return;
63501
63667
  }
63502
63668
  if (payload.kind === "behavior") {
63503
- const behaviorName = payload.data.name;
63669
+ const behaviorName = payload.data["name"];
63504
63670
  if (typeof behaviorName !== "string") {
63505
63671
  log13.warn("default-emit:behavior:missing-name");
63506
63672
  return;
@@ -63521,8 +63687,8 @@ function CanvasDndProvider({
63521
63687
  }) {
63522
63688
  const eventBus = useEventBus();
63523
63689
  const sensors = useAlmadarDndSensors(false);
63524
- const [activePayload, setActivePayload] = React94__default.useState(null);
63525
- const handleDragStart = React94__default.useCallback((e) => {
63690
+ const [activePayload, setActivePayload] = React98__default.useState(null);
63691
+ const handleDragStart = React98__default.useCallback((e) => {
63526
63692
  const data = e.active.data.current;
63527
63693
  const payload = data?.payload;
63528
63694
  if (payload) {
@@ -63533,7 +63699,7 @@ function CanvasDndProvider({
63533
63699
  log13.warn("dragStart:missing-payload", { id: e.active.id });
63534
63700
  }
63535
63701
  }, [eventBus]);
63536
- const handleDragEnd = React94__default.useCallback((e) => {
63702
+ const handleDragEnd = React98__default.useCallback((e) => {
63537
63703
  setActivePayload(null);
63538
63704
  const activeData = e.active.data.current;
63539
63705
  const payload = activeData?.payload;
@@ -63562,7 +63728,7 @@ function CanvasDndProvider({
63562
63728
  const suppressed = onDrop ? onDrop(drop) === true : false;
63563
63729
  if (!suppressed) defaultEmit(eventBus, drop);
63564
63730
  }, [eventBus, onDrop]);
63565
- const handleDragCancel = React94__default.useCallback(() => {
63731
+ const handleDragCancel = React98__default.useCallback(() => {
63566
63732
  setActivePayload(null);
63567
63733
  log13.info("dragCancel");
63568
63734
  }, []);
@@ -64320,7 +64486,7 @@ var OrbPreviewNodeInner = (props) => {
64320
64486
  }
64321
64487
  );
64322
64488
  };
64323
- var OrbPreviewNode = React94__default.memo(OrbPreviewNodeInner);
64489
+ var OrbPreviewNode = React98__default.memo(OrbPreviewNodeInner);
64324
64490
  OrbPreviewNode.displayName = "OrbPreviewNode";
64325
64491
  orbPreviewLog.debug("export-resolved", () => ({
64326
64492
  type: typeof OrbPreviewNode,
@@ -64425,7 +64591,7 @@ var EventFlowEdgeInner = (props) => {
64425
64591
  ) })
64426
64592
  ] });
64427
64593
  };
64428
- var EventFlowEdge = React94__default.memo(EventFlowEdgeInner);
64594
+ var EventFlowEdge = React98__default.memo(EventFlowEdgeInner);
64429
64595
  EventFlowEdge.displayName = "EventFlowEdge";
64430
64596
 
64431
64597
  // components/avl/molecules/BehaviorComposeNode.tsx
@@ -64489,7 +64655,7 @@ var BehaviorComposeNodeInner = (props) => {
64489
64655
  Box,
64490
64656
  {
64491
64657
  style: { height: 3, backgroundColor: layerColor },
64492
- title: data.layer
64658
+ title: data.layer ?? void 0
64493
64659
  }
64494
64660
  ),
64495
64661
  /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-2 px-3 py-1.5 border-b border-border/40 drag-handle cursor-grab", children: [
@@ -64504,9 +64670,9 @@ var BehaviorComposeNodeInner = (props) => {
64504
64670
  {
64505
64671
  name: data.behaviorName,
64506
64672
  level: data.level,
64507
- domain: data.domain,
64673
+ domain: data.domain ?? void 0,
64508
64674
  stateCount: data.stateCount,
64509
- fieldCount: data.fieldCount,
64675
+ fieldCount: data.fieldCount ?? void 0,
64510
64676
  persistence: data.persistence,
64511
64677
  effectTypes: data.effectTypes,
64512
64678
  children: data.children,
@@ -64572,7 +64738,7 @@ var BehaviorComposeNodeInner = (props) => {
64572
64738
  }
64573
64739
  );
64574
64740
  };
64575
- var BehaviorComposeNode = React94__default.memo(BehaviorComposeNodeInner);
64741
+ var BehaviorComposeNode = React98__default.memo(BehaviorComposeNodeInner);
64576
64742
  BehaviorComposeNode.displayName = "BehaviorComposeNode";
64577
64743
 
64578
64744
  // components/avl/molecules/avl-behavior-compose-converter.ts
@@ -64593,17 +64759,17 @@ function behaviorsToComposeGraph(entries, wires, layoutHint) {
64593
64759
  data: {
64594
64760
  behaviorName: entry.behaviorName,
64595
64761
  level: entry.level,
64596
- domain: entry.domain,
64597
- layer: entry.layer,
64762
+ domain: entry.domain ?? null,
64763
+ layer: entry.layer ?? null,
64598
64764
  entityName: entry.entityName,
64599
64765
  stateCount: entry.stateCount,
64600
- fieldCount: entry.fieldCount,
64601
- persistence: entry.persistence,
64602
- effectTypes: entry.effectTypes,
64603
- children: entry.children,
64604
- connections: entry.connections,
64766
+ fieldCount: entry.fieldCount ?? null,
64767
+ persistence: entry.persistence ?? null,
64768
+ effectTypes: entry.effectTypes ?? null,
64769
+ children: entry.children ?? null,
64770
+ connections: entry.connections ?? null,
64605
64771
  connectableEvents: entry.connectableEvents,
64606
- composableWith: entry.composableWith,
64772
+ composableWith: entry.composableWith ?? null,
64607
64773
  orbitalNames: entry.orbitalNames
64608
64774
  }
64609
64775
  });
@@ -64622,11 +64788,20 @@ function behaviorsToComposeGraph(entries, wires, layoutHint) {
64622
64788
  }
64623
64789
  function registryEntryToCanvasEntry(entry, orbitalNames) {
64624
64790
  const events2 = entry.connectableEvents;
64625
- const connectableEvents = events2.map((eventName, i) => ({
64626
- event: eventName,
64627
- payloadFields: entry.eventPayloads[eventName],
64628
- positionHint: events2.length > 1 ? 0.1 + i * 0.8 / (events2.length - 1) : 0.5
64629
- }));
64791
+ const connectableEvents = events2.map((eventName, i) => {
64792
+ const rawFields = entry.eventPayloads[eventName];
64793
+ const payloadFields = rawFields ? rawFields.map((f3) => ({
64794
+ name: f3.name,
64795
+ type: f3.type,
64796
+ required: f3.required ?? null,
64797
+ description: null
64798
+ })) : null;
64799
+ return {
64800
+ event: eventName,
64801
+ payloadFields,
64802
+ positionHint: events2.length > 1 ? 0.1 + i * 0.8 / (events2.length - 1) : 0.5
64803
+ };
64804
+ });
64630
64805
  return {
64631
64806
  behaviorName: entry.name,
64632
64807
  level: entry.level,
@@ -64731,28 +64906,31 @@ function findPatternInTree(root, path) {
64731
64906
  const parts = cleanPath.split(".");
64732
64907
  let current = root;
64733
64908
  for (const part of parts) {
64734
- if (current === null || current === void 0 || typeof current !== "object") return null;
64735
- const record = current;
64736
- if (part === "children") {
64737
- if (Array.isArray(record.children)) {
64738
- current = record.children;
64739
- } else {
64740
- const nestedProps = record.props;
64741
- if (nestedProps && typeof nestedProps === "object" && !Array.isArray(nestedProps) && Array.isArray(nestedProps.children)) {
64742
- current = nestedProps.children;
64743
- } else {
64744
- return null;
64745
- }
64746
- }
64747
- } else if (Array.isArray(current)) {
64909
+ if (current === null) return null;
64910
+ if (Array.isArray(current)) {
64748
64911
  const idx = parseInt(part, 10);
64749
64912
  if (isNaN(idx) || idx < 0 || idx >= current.length) return null;
64750
- current = current[idx];
64913
+ const item = current[idx];
64914
+ current = item && typeof item === "object" && !Array.isArray(item) ? item : null;
64751
64915
  } else {
64752
- current = record[part];
64916
+ if (part === "children") {
64917
+ if (Array.isArray(current.children)) {
64918
+ current = current.children;
64919
+ } else {
64920
+ const nestedProps = current.props;
64921
+ if (nestedProps && typeof nestedProps === "object" && !Array.isArray(nestedProps) && Array.isArray(nestedProps.children)) {
64922
+ current = nestedProps.children;
64923
+ } else {
64924
+ return null;
64925
+ }
64926
+ }
64927
+ } else {
64928
+ const rawVal = current[part];
64929
+ current = rawVal && typeof rawVal === "object" && !Array.isArray(rawVal) ? rawVal : null;
64930
+ }
64753
64931
  }
64754
64932
  }
64755
- return typeof current === "object" && current !== null ? current : null;
64933
+ return Array.isArray(current) ? null : current;
64756
64934
  }
64757
64935
  var FIELD_TYPE_OPTIONS = FieldTypeSchema.options.map((v) => ({ value: v, label: v }));
64758
64936
  var EFFECT_TYPE_OPTIONS = Object.keys(EFFECT_TYPE_TO_CATEGORY).map((v) => ({ value: v, label: v }));
@@ -64787,7 +64965,9 @@ function OrbInspector({ node, schema, editable = false, userType = "builder", th
64787
64965
  const tryEffects = (effects) => {
64788
64966
  for (const eff of effects) {
64789
64967
  if (!Array.isArray(eff) || eff[0] !== "render-ui" || !eff[2]) continue;
64790
- const found = findPatternInTree(eff[2], patternId);
64968
+ const root = eff[2];
64969
+ if (typeof root !== "object" || root === null || Array.isArray(root)) continue;
64970
+ const found = findPatternInTree(root, patternId);
64791
64971
  if (!found) continue;
64792
64972
  if (selectedPattern.patternType && typeof found.type === "string" && found.type !== selectedPattern.patternType) {
64793
64973
  continue;
@@ -65216,9 +65396,9 @@ function OrbPatternTree({ config, depth }) {
65216
65396
  return /* @__PURE__ */ jsxs(Box, { style: { paddingLeft: depth * 12 }, children: [
65217
65397
  /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-primary font-semibold text-xs", children: type }),
65218
65398
  propEntries.slice(0, 5).map(([key, val]) => {
65219
- const display = typeof val === "string" ? val.startsWith("@") ? /* @__PURE__ */ jsx("span", { className: "text-purple-500", children: val }) : `"${val}"` : Array.isArray(val) && typeof val[0] === "string" && val[0].includes("/") ? /* @__PURE__ */ jsxs("span", { className: "text-amber-600", children: [
65399
+ const display = typeof val === "string" ? val.startsWith("@") ? /* @__PURE__ */ jsx("span", { className: "text-purple-500", children: val }) : `"${val}"` : Array.isArray(val) && val.length > 0 && typeof val[0] === "string" && val[0].includes("/") ? /* @__PURE__ */ jsxs("span", { className: "text-amber-600", children: [
65220
65400
  "(",
65221
- val.join(" "),
65401
+ val.map(String).join(" "),
65222
65402
  ")"
65223
65403
  ] }) : String(val);
65224
65404
  return /* @__PURE__ */ jsxs(Box, { className: "flex gap-1 text-xs", children: [
@@ -65584,7 +65764,7 @@ var TraitCardNodeInner = (props) => {
65584
65764
  }
65585
65765
  );
65586
65766
  };
65587
- var TraitCardNode = React94__default.memo(TraitCardNodeInner);
65767
+ var TraitCardNode = React98__default.memo(TraitCardNodeInner);
65588
65768
  TraitCardNode.displayName = "TraitCardNode";
65589
65769
 
65590
65770
  // components/avl/organisms/FlowCanvas.tsx
@@ -65657,7 +65837,7 @@ function FlowCanvasInner({
65657
65837
  initialOrbital
65658
65838
  );
65659
65839
  const [expandedBehaviorAlias, setExpandedBehaviorAlias] = useState(void 0);
65660
- const screenSizeUserOverrideRef = React94__default.useRef(false);
65840
+ const screenSizeUserOverrideRef = React98__default.useRef(false);
65661
65841
  const [screenSize, setScreenSize] = useState(
65662
65842
  () => typeof window === "undefined" ? "laptop" : detectScreenSize(window.innerWidth)
65663
65843
  );
@@ -66041,7 +66221,7 @@ var ZoomBreadcrumb = ({
66041
66221
  if (eventName && band === "detail") {
66042
66222
  segments.push({ icon: "\u26A1", label: eventName });
66043
66223
  }
66044
- return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-xs text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
66224
+ return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-xs text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
66045
66225
  i > 0 && /* @__PURE__ */ jsx("span", { className: "opacity-40", children: ">" }),
66046
66226
  /* @__PURE__ */ jsx("span", { className: "opacity-60", children: seg.icon }),
66047
66227
  /* @__PURE__ */ jsx("span", { children: seg.label })
@@ -66382,7 +66562,7 @@ var EventWireOverlay = ({
66382
66562
  containerW,
66383
66563
  containerH
66384
66564
  }) => {
66385
- const ids = React94__default.useMemo(() => {
66565
+ const ids = React98__default.useMemo(() => {
66386
66566
  avlOczWireId += 1;
66387
66567
  return { arrow: `avl-ocz-wire-${avlOczWireId}-arrow` };
66388
66568
  }, []);
@@ -66749,7 +66929,7 @@ var AvlOrbitalsCosmicZoom = ({
66749
66929
  borderRadius: 6,
66750
66930
  border: `1px solid ${color}`
66751
66931
  },
66752
- children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React94__default.Fragment, { children: [
66932
+ children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
66753
66933
  i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", style: { opacity: 0.5, color }, children: "/" }),
66754
66934
  i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
66755
66935
  Box,