@almadar/ui 5.87.0 → 5.91.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 (27) hide show
  1. package/dist/avl/index.cjs +1510 -1426
  2. package/dist/avl/index.js +500 -416
  3. package/dist/components/game/2d/{organisms → molecules}/ObjectRulePanel.d.ts +9 -4
  4. package/dist/components/game/2d/molecules/StateGraph.d.ts +38 -0
  5. package/dist/components/game/2d/molecules/StateJsonView.d.ts +37 -0
  6. package/dist/components/game/2d/{organisms → molecules}/TraitSlot.d.ts +6 -3
  7. package/dist/components/game/2d/{organisms → molecules}/TraitStateViewer.d.ts +0 -2
  8. package/dist/components/game/2d/molecules/VariablePanel.d.ts +28 -0
  9. package/dist/components/game/2d/molecules/index.d.ts +12 -11
  10. package/dist/components/game/2d/organisms/EventHandlerBoard.d.ts +1 -1
  11. package/dist/components/game/2d/organisms/SequenceBar.d.ts +1 -1
  12. package/dist/components/game/shared/lib/puzzleObject.d.ts +1 -1
  13. package/dist/components/index.cjs +275 -189
  14. package/dist/components/index.js +275 -190
  15. package/dist/providers/index.cjs +1377 -1293
  16. package/dist/providers/index.js +476 -392
  17. package/dist/runtime/index.cjs +1371 -1287
  18. package/dist/runtime/index.js +480 -396
  19. package/package.json +1 -1
  20. package/dist/components/game/2d/organisms/StateJsonView.d.ts +0 -17
  21. package/dist/components/game/2d/organisms/VariablePanel.d.ts +0 -22
  22. /package/dist/components/game/2d/{organisms → molecules}/ActionPalette.d.ts +0 -0
  23. /package/dist/components/game/2d/{organisms → molecules}/ActionTile.d.ts +0 -0
  24. /package/dist/components/game/2d/{organisms → molecules}/EventLog.d.ts +0 -0
  25. /package/dist/components/game/2d/{organisms → molecules}/RuleEditor.d.ts +0 -0
  26. /package/dist/components/game/2d/{organisms → molecules}/StateNode.d.ts +0 -0
  27. /package/dist/components/game/2d/{organisms → molecules}/TransitionArrow.d.ts +0 -0
@@ -1,5 +1,5 @@
1
- import * as React95 from 'react';
2
- import React95__default, { useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, createContext, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
1
+ import * as React96 from 'react';
2
+ import React96__default, { useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, createContext, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
3
3
  import { EventBusContext, useTraitScope, useEntitySchemaOptional, useEntitySchema, getAllPages, OrbitalProvider, TraitScopeProvider, ServerBridgeProvider, useCurrentPagePath, VerificationProvider, EntitySchemaProvider, OrbitalThemeProvider, useServerBridge } from '@almadar/ui/providers';
4
4
  export { EntitySchemaProvider, ServerBridgeProvider, TraitContext, TraitProvider, useEntitySchema, useEntitySchemaOptional, useServerBridge, useTrait, useTraitContext } from '@almadar/ui/providers';
5
5
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
@@ -937,7 +937,7 @@ var init_Box = __esm({
937
937
  fixed: "fixed",
938
938
  sticky: "sticky"
939
939
  };
940
- Box = React95__default.forwardRef(
940
+ Box = React96__default.forwardRef(
941
941
  ({
942
942
  padding,
943
943
  paddingX,
@@ -1002,7 +1002,7 @@ var init_Box = __esm({
1002
1002
  onPointerDown?.(e);
1003
1003
  }, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
1004
1004
  const isClickable = action || onClick;
1005
- return React95__default.createElement(
1005
+ return React96__default.createElement(
1006
1006
  Component,
1007
1007
  {
1008
1008
  ref,
@@ -1098,7 +1098,7 @@ function loadLib(key, importer) {
1098
1098
  return p;
1099
1099
  }
1100
1100
  function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
1101
- const Lazy = React95__default.lazy(async () => {
1101
+ const Lazy = React96__default.lazy(async () => {
1102
1102
  const lib = await loadLib(libKey, importer);
1103
1103
  const Comp = pick(lib);
1104
1104
  if (!Comp) {
@@ -1108,7 +1108,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
1108
1108
  return { default: Comp };
1109
1109
  });
1110
1110
  const Wrapped = (props) => /* @__PURE__ */ jsx(
1111
- React95__default.Suspense,
1111
+ React96__default.Suspense,
1112
1112
  {
1113
1113
  fallback: /* @__PURE__ */ jsx(
1114
1114
  "span",
@@ -1839,7 +1839,7 @@ var init_Icon = __esm({
1839
1839
  const directIcon = typeof icon === "string" ? void 0 : icon;
1840
1840
  const effectiveName = typeof icon === "string" ? icon : name;
1841
1841
  const family = useIconFamily();
1842
- const RenderedComponent = React95__default.useMemo(() => {
1842
+ const RenderedComponent = React96__default.useMemo(() => {
1843
1843
  if (directIcon) return null;
1844
1844
  return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
1845
1845
  }, [directIcon, effectiveName, family]);
@@ -1901,7 +1901,7 @@ function resolveIconProp(value, sizeClass) {
1901
1901
  const IconComp = value;
1902
1902
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
1903
1903
  }
1904
- if (React95__default.isValidElement(value)) {
1904
+ if (React96__default.isValidElement(value)) {
1905
1905
  return value;
1906
1906
  }
1907
1907
  if (typeof value === "object" && value !== null && isIconLike(value)) {
@@ -1977,7 +1977,7 @@ var init_Button = __esm({
1977
1977
  md: "h-icon-default w-icon-default",
1978
1978
  lg: "h-icon-default w-icon-default"
1979
1979
  };
1980
- Button = React95__default.forwardRef(
1980
+ Button = React96__default.forwardRef(
1981
1981
  ({
1982
1982
  className,
1983
1983
  variant = "primary",
@@ -2045,7 +2045,7 @@ var Dialog;
2045
2045
  var init_Dialog = __esm({
2046
2046
  "components/core/atoms/Dialog.tsx"() {
2047
2047
  init_cn();
2048
- Dialog = React95__default.forwardRef(
2048
+ Dialog = React96__default.forwardRef(
2049
2049
  ({
2050
2050
  role = "dialog",
2051
2051
  "aria-modal": ariaModal = true,
@@ -2163,7 +2163,7 @@ var init_Typography = __esm({
2163
2163
  }) => {
2164
2164
  const variant = variantProp ?? (level ? `h${level}` : "body1");
2165
2165
  const Component = as || defaultElements[variant];
2166
- return React95__default.createElement(
2166
+ return React96__default.createElement(
2167
2167
  Component,
2168
2168
  {
2169
2169
  id,
@@ -2658,7 +2658,7 @@ var init_Badge = __esm({
2658
2658
  md: "px-2.5 py-1 text-sm",
2659
2659
  lg: "px-3 py-1.5 text-base"
2660
2660
  };
2661
- Badge = React95__default.forwardRef(
2661
+ Badge = React96__default.forwardRef(
2662
2662
  ({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
2663
2663
  const iconSizes3 = {
2664
2664
  sm: "h-icon-default w-icon-default",
@@ -2995,7 +2995,7 @@ var init_SvgFlow = __esm({
2995
2995
  width = 100,
2996
2996
  height = 100
2997
2997
  }) => {
2998
- const markerId = React95__default.useMemo(() => {
2998
+ const markerId = React96__default.useMemo(() => {
2999
2999
  flowIdCounter += 1;
3000
3000
  return `almadar-flow-arrow-${flowIdCounter}`;
3001
3001
  }, []);
@@ -3588,7 +3588,7 @@ var init_SvgRing = __esm({
3588
3588
  width = 100,
3589
3589
  height = 100
3590
3590
  }) => {
3591
- const gradientId = React95__default.useMemo(() => {
3591
+ const gradientId = React96__default.useMemo(() => {
3592
3592
  ringIdCounter += 1;
3593
3593
  return `almadar-ring-glow-${ringIdCounter}`;
3594
3594
  }, []);
@@ -3769,7 +3769,7 @@ var init_Input = __esm({
3769
3769
  init_cn();
3770
3770
  init_Icon();
3771
3771
  init_useEventBus();
3772
- Input = React95__default.forwardRef(
3772
+ Input = React96__default.forwardRef(
3773
3773
  ({
3774
3774
  className,
3775
3775
  inputType,
@@ -3929,7 +3929,7 @@ var Label;
3929
3929
  var init_Label = __esm({
3930
3930
  "components/core/atoms/Label.tsx"() {
3931
3931
  init_cn();
3932
- Label = React95__default.forwardRef(
3932
+ Label = React96__default.forwardRef(
3933
3933
  ({ className, required, children, ...props }, ref) => {
3934
3934
  return /* @__PURE__ */ jsxs(
3935
3935
  "label",
@@ -3956,7 +3956,7 @@ var init_Textarea = __esm({
3956
3956
  "components/core/atoms/Textarea.tsx"() {
3957
3957
  init_cn();
3958
3958
  init_useEventBus();
3959
- Textarea = React95__default.forwardRef(
3959
+ Textarea = React96__default.forwardRef(
3960
3960
  ({ className, error, onChange, ...props }, ref) => {
3961
3961
  const eventBus = useEventBus();
3962
3962
  const handleChange = (e) => {
@@ -4195,7 +4195,7 @@ var init_Select = __esm({
4195
4195
  init_cn();
4196
4196
  init_Icon();
4197
4197
  init_useEventBus();
4198
- Select = React95__default.forwardRef(
4198
+ Select = React96__default.forwardRef(
4199
4199
  (props, _ref) => {
4200
4200
  const { multiple, searchable, clearable } = props;
4201
4201
  if (multiple || searchable || clearable) {
@@ -4212,7 +4212,7 @@ var init_Checkbox = __esm({
4212
4212
  "components/core/atoms/Checkbox.tsx"() {
4213
4213
  init_cn();
4214
4214
  init_useEventBus();
4215
- Checkbox = React95__default.forwardRef(
4215
+ Checkbox = React96__default.forwardRef(
4216
4216
  ({ className, label, id, onChange, ...props }, ref) => {
4217
4217
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
4218
4218
  const eventBus = useEventBus();
@@ -4266,7 +4266,7 @@ var init_Spinner = __esm({
4266
4266
  md: "h-6 w-6",
4267
4267
  lg: "h-8 w-8"
4268
4268
  };
4269
- Spinner = React95__default.forwardRef(
4269
+ Spinner = React96__default.forwardRef(
4270
4270
  ({ className, size = "md", overlay, ...props }, ref) => {
4271
4271
  if (overlay) {
4272
4272
  return /* @__PURE__ */ jsx(
@@ -4356,7 +4356,7 @@ var init_Card = __esm({
4356
4356
  chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
4357
4357
  "tile-image-first": "p-0 overflow-hidden"
4358
4358
  };
4359
- Card = React95__default.forwardRef(
4359
+ Card = React96__default.forwardRef(
4360
4360
  ({
4361
4361
  className,
4362
4362
  variant = "bordered",
@@ -4404,9 +4404,9 @@ var init_Card = __esm({
4404
4404
  }
4405
4405
  );
4406
4406
  Card.displayName = "Card";
4407
- CardHeader = React95__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
4407
+ CardHeader = React96__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
4408
4408
  CardHeader.displayName = "CardHeader";
4409
- CardTitle = React95__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
4409
+ CardTitle = React96__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
4410
4410
  "h3",
4411
4411
  {
4412
4412
  ref,
@@ -4419,11 +4419,11 @@ var init_Card = __esm({
4419
4419
  }
4420
4420
  ));
4421
4421
  CardTitle.displayName = "CardTitle";
4422
- CardContent = React95__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
4422
+ CardContent = React96__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
4423
4423
  CardContent.displayName = "CardContent";
4424
4424
  CardBody = CardContent;
4425
4425
  CardBody.displayName = "CardBody";
4426
- CardFooter = React95__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
4426
+ CardFooter = React96__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
4427
4427
  "div",
4428
4428
  {
4429
4429
  ref,
@@ -4478,7 +4478,7 @@ var init_FilterPill = __esm({
4478
4478
  md: "w-3.5 h-3.5",
4479
4479
  lg: "w-4 h-4"
4480
4480
  };
4481
- FilterPill = React95__default.forwardRef(
4481
+ FilterPill = React96__default.forwardRef(
4482
4482
  ({
4483
4483
  className,
4484
4484
  variant = "default",
@@ -4607,8 +4607,8 @@ var init_Avatar = __esm({
4607
4607
  actionPayload
4608
4608
  }) => {
4609
4609
  const eventBus = useEventBus();
4610
- const [imgFailed, setImgFailed] = React95__default.useState(false);
4611
- React95__default.useEffect(() => {
4610
+ const [imgFailed, setImgFailed] = React96__default.useState(false);
4611
+ React96__default.useEffect(() => {
4612
4612
  setImgFailed(false);
4613
4613
  }, [src]);
4614
4614
  const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
@@ -4721,7 +4721,7 @@ var init_Center = __esm({
4721
4721
  as: Component = "div"
4722
4722
  }) => {
4723
4723
  const mergedStyle = minHeight ? { minHeight, ...style } : style;
4724
- return React95__default.createElement(Component, {
4724
+ return React96__default.createElement(Component, {
4725
4725
  className: cn(
4726
4726
  inline ? "inline-flex" : "flex",
4727
4727
  horizontal && "justify-center",
@@ -4989,7 +4989,7 @@ var init_Radio = __esm({
4989
4989
  md: "w-2.5 h-2.5",
4990
4990
  lg: "w-3 h-3"
4991
4991
  };
4992
- Radio = React95__default.forwardRef(
4992
+ Radio = React96__default.forwardRef(
4993
4993
  ({
4994
4994
  label,
4995
4995
  helperText,
@@ -5006,12 +5006,12 @@ var init_Radio = __esm({
5006
5006
  onChange,
5007
5007
  ...props
5008
5008
  }, ref) => {
5009
- const reactId = React95__default.useId();
5009
+ const reactId = React96__default.useId();
5010
5010
  const baseId = id || `radio-${reactId}`;
5011
5011
  const hasError = !!error;
5012
5012
  const eventBus = useEventBus();
5013
- const [selected, setSelected] = React95__default.useState(value);
5014
- React95__default.useEffect(() => {
5013
+ const [selected, setSelected] = React96__default.useState(value);
5014
+ React96__default.useEffect(() => {
5015
5015
  if (value !== void 0) setSelected(value);
5016
5016
  }, [value]);
5017
5017
  const pick = (next, e) => {
@@ -5193,7 +5193,7 @@ var init_Switch = __esm({
5193
5193
  "components/core/atoms/Switch.tsx"() {
5194
5194
  "use client";
5195
5195
  init_cn();
5196
- Switch = React95.forwardRef(
5196
+ Switch = React96.forwardRef(
5197
5197
  ({
5198
5198
  checked,
5199
5199
  defaultChecked = false,
@@ -5204,10 +5204,10 @@ var init_Switch = __esm({
5204
5204
  name,
5205
5205
  className
5206
5206
  }, ref) => {
5207
- const [isChecked, setIsChecked] = React95.useState(
5207
+ const [isChecked, setIsChecked] = React96.useState(
5208
5208
  checked !== void 0 ? checked : defaultChecked
5209
5209
  );
5210
- React95.useEffect(() => {
5210
+ React96.useEffect(() => {
5211
5211
  if (checked !== void 0) {
5212
5212
  setIsChecked(checked);
5213
5213
  }
@@ -5370,7 +5370,7 @@ var init_Stack = __esm({
5370
5370
  };
5371
5371
  const isHorizontal = direction === "horizontal";
5372
5372
  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";
5373
- return React95__default.createElement(
5373
+ return React96__default.createElement(
5374
5374
  Component,
5375
5375
  {
5376
5376
  className: cn(
@@ -5570,7 +5570,7 @@ var Aside;
5570
5570
  var init_Aside = __esm({
5571
5571
  "components/core/atoms/Aside.tsx"() {
5572
5572
  init_cn();
5573
- Aside = React95__default.forwardRef(
5573
+ Aside = React96__default.forwardRef(
5574
5574
  ({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
5575
5575
  );
5576
5576
  Aside.displayName = "Aside";
@@ -5649,9 +5649,9 @@ var init_LawReferenceTooltip = __esm({
5649
5649
  className
5650
5650
  }) => {
5651
5651
  const { t } = useTranslate();
5652
- const [isVisible, setIsVisible] = React95__default.useState(false);
5653
- const timeoutRef = React95__default.useRef(null);
5654
- const triggerRef = React95__default.useRef(null);
5652
+ const [isVisible, setIsVisible] = React96__default.useState(false);
5653
+ const timeoutRef = React96__default.useRef(null);
5654
+ const triggerRef = React96__default.useRef(null);
5655
5655
  const handleMouseEnter = () => {
5656
5656
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
5657
5657
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -5662,7 +5662,7 @@ var init_LawReferenceTooltip = __esm({
5662
5662
  };
5663
5663
  const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
5664
5664
  const open = isVisible || revealed;
5665
- React95__default.useEffect(() => {
5665
+ React96__default.useEffect(() => {
5666
5666
  return () => {
5667
5667
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
5668
5668
  };
@@ -5872,7 +5872,7 @@ var init_StatusDot = __esm({
5872
5872
  md: "w-2.5 h-2.5",
5873
5873
  lg: "w-3 h-3"
5874
5874
  };
5875
- StatusDot = React95__default.forwardRef(
5875
+ StatusDot = React96__default.forwardRef(
5876
5876
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
5877
5877
  return /* @__PURE__ */ jsx(
5878
5878
  "span",
@@ -5926,7 +5926,7 @@ var init_TrendIndicator = __esm({
5926
5926
  down: "trending-down",
5927
5927
  flat: "arrow-right"
5928
5928
  };
5929
- TrendIndicator = React95__default.forwardRef(
5929
+ TrendIndicator = React96__default.forwardRef(
5930
5930
  ({
5931
5931
  className,
5932
5932
  value,
@@ -5993,7 +5993,7 @@ var init_RangeSlider = __esm({
5993
5993
  md: "w-4 h-4",
5994
5994
  lg: "w-5 h-5"
5995
5995
  };
5996
- RangeSlider = React95__default.forwardRef(
5996
+ RangeSlider = React96__default.forwardRef(
5997
5997
  ({
5998
5998
  className,
5999
5999
  min = 0,
@@ -6552,7 +6552,7 @@ var init_ContentSection = __esm({
6552
6552
  md: "py-16",
6553
6553
  lg: "py-24"
6554
6554
  };
6555
- ContentSection = React95__default.forwardRef(
6555
+ ContentSection = React96__default.forwardRef(
6556
6556
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
6557
6557
  return /* @__PURE__ */ jsx(
6558
6558
  Box,
@@ -7086,7 +7086,7 @@ var init_AnimatedReveal = __esm({
7086
7086
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
7087
7087
  "none": {}
7088
7088
  };
7089
- AnimatedReveal = React95__default.forwardRef(
7089
+ AnimatedReveal = React96__default.forwardRef(
7090
7090
  ({
7091
7091
  trigger = "scroll",
7092
7092
  animation = "fade-up",
@@ -7246,7 +7246,7 @@ var init_AnimatedGraphic = __esm({
7246
7246
  "components/marketing/atoms/AnimatedGraphic.tsx"() {
7247
7247
  "use client";
7248
7248
  init_cn();
7249
- AnimatedGraphic = React95__default.forwardRef(
7249
+ AnimatedGraphic = React96__default.forwardRef(
7250
7250
  ({
7251
7251
  src,
7252
7252
  svgContent,
@@ -7269,7 +7269,7 @@ var init_AnimatedGraphic = __esm({
7269
7269
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
7270
7270
  const resolvedSvg = svgContent ?? fetchedSvg;
7271
7271
  const prevAnimateRef = useRef(animate);
7272
- const setRef = React95__default.useCallback(
7272
+ const setRef = React96__default.useCallback(
7273
7273
  (node) => {
7274
7274
  containerRef.current = node;
7275
7275
  if (typeof ref === "function") ref(node);
@@ -7876,7 +7876,7 @@ function GameCard({
7876
7876
  className
7877
7877
  }) {
7878
7878
  const eventBus = useEventBus();
7879
- const handleClick = React95.useCallback(() => {
7879
+ const handleClick = React96.useCallback(() => {
7880
7880
  if (disabled) return;
7881
7881
  onClick?.(id);
7882
7882
  if (clickEvent) eventBus.emit(`UI:${clickEvent}`, { cardId: id });
@@ -8158,9 +8158,9 @@ function ControlButton({
8158
8158
  className
8159
8159
  }) {
8160
8160
  const eventBus = useEventBus();
8161
- const [isPressed, setIsPressed] = React95.useState(false);
8161
+ const [isPressed, setIsPressed] = React96.useState(false);
8162
8162
  const actualPressed = pressed ?? isPressed;
8163
- const handlePointerDown = React95.useCallback(
8163
+ const handlePointerDown = React96.useCallback(
8164
8164
  (e) => {
8165
8165
  e.preventDefault();
8166
8166
  if (disabled) return;
@@ -8170,7 +8170,7 @@ function ControlButton({
8170
8170
  },
8171
8171
  [disabled, pressEvent, eventBus, onPress]
8172
8172
  );
8173
- const handlePointerUp = React95.useCallback(
8173
+ const handlePointerUp = React96.useCallback(
8174
8174
  (e) => {
8175
8175
  e.preventDefault();
8176
8176
  if (disabled) return;
@@ -8180,7 +8180,7 @@ function ControlButton({
8180
8180
  },
8181
8181
  [disabled, releaseEvent, eventBus, onRelease]
8182
8182
  );
8183
- const handlePointerLeave = React95.useCallback(
8183
+ const handlePointerLeave = React96.useCallback(
8184
8184
  (e) => {
8185
8185
  if (isPressed) {
8186
8186
  setIsPressed(false);
@@ -9199,8 +9199,8 @@ function MiniMap({
9199
9199
  tileAssets,
9200
9200
  unitAssets
9201
9201
  }) {
9202
- const canvasRef = React95.useRef(null);
9203
- const imgCacheRef = React95.useRef(/* @__PURE__ */ new Map());
9202
+ const canvasRef = React96.useRef(null);
9203
+ const imgCacheRef = React96.useRef(/* @__PURE__ */ new Map());
9204
9204
  function loadImg(url) {
9205
9205
  const cached = imgCacheRef.current.get(url);
9206
9206
  if (cached) return cached.complete ? cached : null;
@@ -9215,7 +9215,7 @@ function MiniMap({
9215
9215
  imgCacheRef.current.set(url, img);
9216
9216
  return null;
9217
9217
  }
9218
- React95.useEffect(() => {
9218
+ React96.useEffect(() => {
9219
9219
  const canvas = canvasRef.current;
9220
9220
  if (!canvas) return;
9221
9221
  const ctx = canvas.getContext("2d");
@@ -9350,8 +9350,8 @@ function ControlGrid({
9350
9350
  className
9351
9351
  }) {
9352
9352
  const eventBus = useEventBus();
9353
- const [active, setActive] = React95.useState(/* @__PURE__ */ new Set());
9354
- const handlePress = React95.useCallback(
9353
+ const [active, setActive] = React96.useState(/* @__PURE__ */ new Set());
9354
+ const handlePress = React96.useCallback(
9355
9355
  (id) => {
9356
9356
  setActive((prev) => new Set(prev).add(id));
9357
9357
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -9365,7 +9365,7 @@ function ControlGrid({
9365
9365
  },
9366
9366
  [kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
9367
9367
  );
9368
- const handleRelease = React95.useCallback(
9368
+ const handleRelease = React96.useCallback(
9369
9369
  (id) => {
9370
9370
  setActive((prev) => {
9371
9371
  const next = new Set(prev);
@@ -9623,7 +9623,7 @@ function InventoryGrid({
9623
9623
  const eventBus = useEventBus();
9624
9624
  const slotCount = totalSlots ?? items.length;
9625
9625
  const emptySlotCount = Math.max(0, slotCount - items.length);
9626
- const handleSelect = React95.useCallback(
9626
+ const handleSelect = React96.useCallback(
9627
9627
  (id) => {
9628
9628
  onSelect?.(id);
9629
9629
  if (selectEvent) {
@@ -9840,7 +9840,7 @@ function GameMenu({
9840
9840
  }) {
9841
9841
  const resolvedOptions = options ?? menuItems ?? DEFAULT_MENU_OPTIONS;
9842
9842
  const eventBus = useEventBus();
9843
- const handleOptionClick = React95.useCallback(
9843
+ const handleOptionClick = React96.useCallback(
9844
9844
  (option) => {
9845
9845
  if (option.event) {
9846
9846
  eventBus.emit(`UI:${option.event}`, { option });
@@ -9917,6 +9917,214 @@ var init_GameMenu = __esm({
9917
9917
  GameMenu.displayName = "GameMenu";
9918
9918
  }
9919
9919
  });
9920
+ function StateNode({
9921
+ name,
9922
+ isCurrent = false,
9923
+ isSelected = false,
9924
+ isInitial = false,
9925
+ position,
9926
+ onClick,
9927
+ className
9928
+ }) {
9929
+ return /* @__PURE__ */ jsx(
9930
+ Box,
9931
+ {
9932
+ position: "absolute",
9933
+ display: "flex",
9934
+ className: cn(
9935
+ "items-center justify-center rounded-pill border-3 transition-all cursor-pointer select-none",
9936
+ "min-w-[80px] h-[80px] px-3",
9937
+ isCurrent && "bg-primary/20 border-primary shadow-lg shadow-primary/30 scale-110",
9938
+ isSelected && !isCurrent && "bg-accent/20 border-accent ring-2 ring-accent/50",
9939
+ !isCurrent && !isSelected && "bg-card border-border hover:border-muted-foreground hover:scale-105",
9940
+ className
9941
+ ),
9942
+ style: {
9943
+ left: position.x,
9944
+ top: position.y,
9945
+ transform: "translate(-50%, -50%)"
9946
+ },
9947
+ onClick,
9948
+ children: /* @__PURE__ */ jsxs(Box, { className: "text-center", children: [
9949
+ isInitial && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground text-xs block", children: "\u25B6 start" }),
9950
+ /* @__PURE__ */ jsx(
9951
+ Typography,
9952
+ {
9953
+ variant: "body2",
9954
+ className: cn(
9955
+ "font-bold whitespace-nowrap",
9956
+ isCurrent ? "text-primary" : "text-foreground"
9957
+ ),
9958
+ children: name
9959
+ }
9960
+ )
9961
+ ] })
9962
+ }
9963
+ );
9964
+ }
9965
+ var init_StateNode = __esm({
9966
+ "components/game/2d/molecules/StateNode.tsx"() {
9967
+ init_atoms();
9968
+ init_cn();
9969
+ StateNode.displayName = "StateNode";
9970
+ }
9971
+ });
9972
+ function TransitionArrow({
9973
+ from,
9974
+ to,
9975
+ eventLabel,
9976
+ guardHint,
9977
+ isActive = false,
9978
+ onClick,
9979
+ className
9980
+ }) {
9981
+ const dx = to.x - from.x;
9982
+ const dy = to.y - from.y;
9983
+ const dist = Math.sqrt(dx * dx + dy * dy);
9984
+ if (dist === 0) return /* @__PURE__ */ jsx(Fragment, {});
9985
+ const nx = dx / dist;
9986
+ const ny = dy / dist;
9987
+ const startX = from.x + nx * NODE_RADIUS;
9988
+ const startY = from.y + ny * NODE_RADIUS;
9989
+ const endX = to.x - nx * NODE_RADIUS;
9990
+ const endY = to.y - ny * NODE_RADIUS;
9991
+ const midX = (startX + endX) / 2;
9992
+ const midY = (startY + endY) / 2;
9993
+ const perpX = -ny * 20;
9994
+ const perpY = nx * 20;
9995
+ const ctrlX = midX + perpX;
9996
+ const ctrlY = midY + perpY;
9997
+ const path = `M ${startX} ${startY} Q ${ctrlX} ${ctrlY} ${endX} ${endY}`;
9998
+ return /* @__PURE__ */ jsxs("g", { className: cn("cursor-pointer", className), onClick, children: [
9999
+ /* @__PURE__ */ jsx(
10000
+ "path",
10001
+ {
10002
+ d: path,
10003
+ fill: "none",
10004
+ stroke: isActive ? "var(--color-primary)" : "var(--color-border)",
10005
+ strokeWidth: isActive ? 3 : 2,
10006
+ markerEnd: isActive ? "url(#arrowhead-active)" : "url(#arrowhead)"
10007
+ }
10008
+ ),
10009
+ /* @__PURE__ */ jsx(
10010
+ "text",
10011
+ {
10012
+ x: ctrlX,
10013
+ y: ctrlY - 8,
10014
+ textAnchor: "middle",
10015
+ fill: isActive ? "var(--color-primary)" : "var(--color-foreground)",
10016
+ fontSize: 12,
10017
+ fontWeight: isActive ? "bold" : "normal",
10018
+ className: "select-none",
10019
+ children: eventLabel
10020
+ }
10021
+ ),
10022
+ guardHint && /* @__PURE__ */ jsx(
10023
+ "text",
10024
+ {
10025
+ x: ctrlX,
10026
+ y: ctrlY + 6,
10027
+ textAnchor: "middle",
10028
+ fill: "var(--color-warning)",
10029
+ fontSize: 10,
10030
+ className: "select-none",
10031
+ children: "\u26A0 " + guardHint
10032
+ }
10033
+ )
10034
+ ] });
10035
+ }
10036
+ var NODE_RADIUS;
10037
+ var init_TransitionArrow = __esm({
10038
+ "components/game/2d/molecules/TransitionArrow.tsx"() {
10039
+ init_cn();
10040
+ NODE_RADIUS = 40;
10041
+ TransitionArrow.displayName = "TransitionArrow";
10042
+ }
10043
+ });
10044
+ function layoutStates(states, width, height) {
10045
+ const cx = width / 2;
10046
+ const cy = height / 2;
10047
+ const radius = Math.min(cx, cy) - 60;
10048
+ const positions = {};
10049
+ states.forEach((state, i) => {
10050
+ const angle = 2 * Math.PI * i / Math.max(states.length, 1) - Math.PI / 2;
10051
+ positions[state] = { x: cx + radius * Math.cos(angle), y: cy + radius * Math.sin(angle) };
10052
+ });
10053
+ return positions;
10054
+ }
10055
+ function StateGraph({
10056
+ states,
10057
+ transitions = [],
10058
+ currentState,
10059
+ selectedState,
10060
+ addingFrom,
10061
+ initialState,
10062
+ width = 500,
10063
+ height = 400,
10064
+ nodeClickEvent,
10065
+ className
10066
+ }) {
10067
+ const eventBus = useEventBus();
10068
+ const nodes = states ?? [];
10069
+ const positions = React96.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
10070
+ return /* @__PURE__ */ jsxs(
10071
+ Box,
10072
+ {
10073
+ position: "relative",
10074
+ className: cn("rounded-container border border-border bg-background overflow-hidden", className),
10075
+ style: { width, height },
10076
+ children: [
10077
+ /* @__PURE__ */ jsxs("svg", { width, height, className: "absolute inset-0", style: { pointerEvents: "none" }, children: [
10078
+ /* @__PURE__ */ jsxs("defs", { children: [
10079
+ /* @__PURE__ */ jsx("marker", { id: "arrowhead", markerWidth: "10", markerHeight: "7", refX: "10", refY: "3.5", orient: "auto", children: /* @__PURE__ */ jsx("polygon", { points: "0 0, 10 3.5, 0 7", fill: "var(--color-border)" }) }),
10080
+ /* @__PURE__ */ jsx("marker", { id: "arrowhead-active", markerWidth: "10", markerHeight: "7", refX: "10", refY: "3.5", orient: "auto", children: /* @__PURE__ */ jsx("polygon", { points: "0 0, 10 3.5, 0 7", fill: "var(--color-primary)" }) })
10081
+ ] }),
10082
+ transitions.map((tr, i) => {
10083
+ const fromPos = positions[tr.from];
10084
+ const toPos = positions[tr.to];
10085
+ if (!fromPos || !toPos) return null;
10086
+ return /* @__PURE__ */ jsx(
10087
+ TransitionArrow,
10088
+ {
10089
+ from: fromPos,
10090
+ to: toPos,
10091
+ eventLabel: tr.event,
10092
+ guardHint: tr.guardHint,
10093
+ isActive: tr.from === currentState
10094
+ },
10095
+ `${tr.from}-${tr.event}-${tr.to}-${i}`
10096
+ );
10097
+ })
10098
+ ] }),
10099
+ nodes.map((state) => {
10100
+ const pos = positions[state];
10101
+ if (!pos) return null;
10102
+ return /* @__PURE__ */ jsx(
10103
+ StateNode,
10104
+ {
10105
+ name: state,
10106
+ position: pos,
10107
+ isCurrent: state === currentState,
10108
+ isSelected: state === selectedState || state === addingFrom,
10109
+ isInitial: state === initialState,
10110
+ onClick: nodeClickEvent ? () => eventBus.emit(`UI:${nodeClickEvent}`, { stateId: state }) : void 0
10111
+ },
10112
+ state
10113
+ );
10114
+ })
10115
+ ]
10116
+ }
10117
+ );
10118
+ }
10119
+ var init_StateGraph = __esm({
10120
+ "components/game/2d/molecules/StateGraph.tsx"() {
10121
+ init_atoms();
10122
+ init_cn();
10123
+ init_useEventBus();
10124
+ init_StateNode();
10125
+ init_TransitionArrow();
10126
+ }
10127
+ });
9920
10128
  function useCamera() {
9921
10129
  const cameraRef = useRef({ x: 0, y: 0, zoom: 1 });
9922
10130
  const targetCameraRef = useRef(null);
@@ -11335,7 +11543,7 @@ function LinearView({
11335
11543
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
11336
11544
  const isDone = i < currentIdx;
11337
11545
  const isCurrent = i === currentIdx;
11338
- return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
11546
+ return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
11339
11547
  i > 0 && /* @__PURE__ */ jsx(
11340
11548
  Typography,
11341
11549
  {
@@ -11532,7 +11740,7 @@ function TraitStateViewer({
11532
11740
  }
11533
11741
  var SIZE_CONFIG;
11534
11742
  var init_TraitStateViewer = __esm({
11535
- "components/game/2d/organisms/TraitStateViewer.tsx"() {
11743
+ "components/game/2d/molecules/TraitStateViewer.tsx"() {
11536
11744
  "use client";
11537
11745
  init_cn();
11538
11746
  init_Box();
@@ -11565,7 +11773,8 @@ function TraitSlot({
11565
11773
  onClick,
11566
11774
  onRemove,
11567
11775
  clickEvent,
11568
- removeEvent
11776
+ removeEvent,
11777
+ dropEvent
11569
11778
  }) {
11570
11779
  const { emit } = useEventBus();
11571
11780
  const [isHovered, setIsHovered] = useState(false);
@@ -11597,29 +11806,30 @@ function TraitSlot({
11597
11806
  onDragStart?.(equippedItem);
11598
11807
  }, [equippedItem, draggable, onDragStart]);
11599
11808
  const handleDragOver = useCallback((e) => {
11600
- if (locked || !onItemDrop) return;
11809
+ if (locked || !onItemDrop && !dropEvent) return;
11601
11810
  if (e.dataTransfer.types.includes(DRAG_MIME)) {
11602
11811
  e.preventDefault();
11603
11812
  const allowed = e.dataTransfer.effectAllowed;
11604
11813
  e.dataTransfer.dropEffect = allowed === "copy" ? "copy" : "move";
11605
11814
  setIsDragOver(true);
11606
11815
  }
11607
- }, [locked, onItemDrop]);
11816
+ }, [locked, onItemDrop, dropEvent]);
11608
11817
  const handleDragLeave = useCallback(() => {
11609
11818
  setIsDragOver(false);
11610
11819
  }, []);
11611
11820
  const handleDrop = useCallback((e) => {
11612
11821
  e.preventDefault();
11613
11822
  setIsDragOver(false);
11614
- if (locked || !onItemDrop) return;
11823
+ if (locked || !onItemDrop && !dropEvent) return;
11615
11824
  const raw = e.dataTransfer.getData(DRAG_MIME);
11616
11825
  if (!raw) return;
11617
11826
  try {
11618
11827
  const item = JSON.parse(raw);
11619
- onItemDrop(item);
11828
+ if (dropEvent) emit(`UI:${dropEvent}`, { slotNumber, itemId: item.id });
11829
+ else onItemDrop?.(item);
11620
11830
  } catch {
11621
11831
  }
11622
- }, [locked, onItemDrop]);
11832
+ }, [locked, onItemDrop, dropEvent, emit, slotNumber]);
11623
11833
  const getTooltipStyle = () => {
11624
11834
  if (!slotRef.current) return {};
11625
11835
  const rect = slotRef.current.getBoundingClientRect();
@@ -11739,7 +11949,7 @@ function TraitSlot({
11739
11949
  }
11740
11950
  var SIZE_CONFIG2, DRAG_MIME;
11741
11951
  var init_TraitSlot = __esm({
11742
- "components/game/2d/organisms/TraitSlot.tsx"() {
11952
+ "components/game/2d/molecules/TraitSlot.tsx"() {
11743
11953
  "use client";
11744
11954
  init_cn();
11745
11955
  init_useEventBus();
@@ -11798,7 +12008,7 @@ function ActionTile({
11798
12008
  }
11799
12009
  var DRAG_MIME2, SIZE_CONFIG3;
11800
12010
  var init_ActionTile = __esm({
11801
- "components/game/2d/organisms/ActionTile.tsx"() {
12011
+ "components/game/2d/molecules/ActionTile.tsx"() {
11802
12012
  init_atoms();
11803
12013
  init_cn();
11804
12014
  DRAG_MIME2 = "application/x-almadar-slot-item";
@@ -11835,7 +12045,7 @@ function ActionPalette({
11835
12045
  ] });
11836
12046
  }
11837
12047
  var init_ActionPalette = __esm({
11838
- "components/game/2d/organisms/ActionPalette.tsx"() {
12048
+ "components/game/2d/molecules/ActionPalette.tsx"() {
11839
12049
  init_atoms();
11840
12050
  init_cn();
11841
12051
  init_ActionTile();
@@ -11863,7 +12073,7 @@ function SequenceBar({
11863
12073
  onSlotRemove(index);
11864
12074
  }, [onSlotRemove, playing]);
11865
12075
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
11866
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
12076
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
11867
12077
  i > 0 && /* @__PURE__ */ jsx(
11868
12078
  Typography,
11869
12079
  {
@@ -12211,7 +12421,7 @@ function RuleEditor({
12211
12421
  ] });
12212
12422
  }
12213
12423
  var init_RuleEditor = __esm({
12214
- "components/game/2d/organisms/RuleEditor.tsx"() {
12424
+ "components/game/2d/molecules/RuleEditor.tsx"() {
12215
12425
  init_atoms();
12216
12426
  init_cn();
12217
12427
  RuleEditor.displayName = "RuleEditor";
@@ -12252,7 +12462,7 @@ function EventLog({
12252
12462
  }
12253
12463
  var STATUS_STYLES, STATUS_DOTS;
12254
12464
  var init_EventLog = __esm({
12255
- "components/game/2d/organisms/EventLog.tsx"() {
12465
+ "components/game/2d/molecules/EventLog.tsx"() {
12256
12466
  init_atoms();
12257
12467
  init_cn();
12258
12468
  STATUS_STYLES = {
@@ -12307,10 +12517,12 @@ var init_puzzleObject = __esm({
12307
12517
  function ObjectRulePanel({
12308
12518
  object,
12309
12519
  onRulesChange,
12520
+ rulesChangeEvent,
12310
12521
  disabled = false,
12311
12522
  className
12312
12523
  }) {
12313
12524
  const { t } = useTranslate();
12525
+ const { emit } = useEventBus();
12314
12526
  const id = objId(object);
12315
12527
  const name = objName(object);
12316
12528
  const icon = objIcon(object);
@@ -12321,15 +12533,19 @@ function ObjectRulePanel({
12321
12533
  const rules = objRules(object);
12322
12534
  const maxRules = objMaxRules(object);
12323
12535
  const canAdd = rules.length < maxRules;
12536
+ const emitRules = useCallback((newRules) => {
12537
+ if (rulesChangeEvent) emit(`UI:${rulesChangeEvent}`, { objectId: id, rules: newRules });
12538
+ else onRulesChange?.(id, newRules);
12539
+ }, [rulesChangeEvent, emit, id, onRulesChange]);
12324
12540
  const handleRuleChange = useCallback((index, updatedRule) => {
12325
12541
  const newRules = [...rules];
12326
12542
  newRules[index] = updatedRule;
12327
- onRulesChange(id, newRules);
12328
- }, [id, rules, onRulesChange]);
12543
+ emitRules(newRules);
12544
+ }, [rules, emitRules]);
12329
12545
  const handleRuleRemove = useCallback((index) => {
12330
12546
  const newRules = rules.filter((_, i) => i !== index);
12331
- onRulesChange(id, newRules);
12332
- }, [id, rules, onRulesChange]);
12547
+ emitRules(newRules);
12548
+ }, [rules, emitRules]);
12333
12549
  const handleAddRule = useCallback(() => {
12334
12550
  if (!canAdd || disabled) return;
12335
12551
  const firstEvent = availableEvents[0]?.value || "";
@@ -12339,8 +12555,8 @@ function ObjectRulePanel({
12339
12555
  whenEvent: firstEvent,
12340
12556
  thenAction: firstAction
12341
12557
  };
12342
- onRulesChange(id, [...rules, newRule]);
12343
- }, [canAdd, disabled, id, rules, availableEvents, availableActions, onRulesChange]);
12558
+ emitRules([...rules, newRule]);
12559
+ }, [canAdd, disabled, rules, availableEvents, availableActions, emitRules]);
12344
12560
  const machine = {
12345
12561
  name,
12346
12562
  states,
@@ -12380,9 +12596,10 @@ function ObjectRulePanel({
12380
12596
  }
12381
12597
  var nextRuleId;
12382
12598
  var init_ObjectRulePanel = __esm({
12383
- "components/game/2d/organisms/ObjectRulePanel.tsx"() {
12599
+ "components/game/2d/molecules/ObjectRulePanel.tsx"() {
12384
12600
  init_atoms();
12385
12601
  init_cn();
12602
+ init_useEventBus();
12386
12603
  init_TraitStateViewer();
12387
12604
  init_RuleEditor();
12388
12605
  init_puzzleObject();
@@ -12604,130 +12821,6 @@ var init_EventHandlerBoard = __esm({
12604
12821
  EventHandlerBoard.displayName = "EventHandlerBoard";
12605
12822
  }
12606
12823
  });
12607
- function StateNode({
12608
- name,
12609
- isCurrent = false,
12610
- isSelected = false,
12611
- isInitial = false,
12612
- position,
12613
- onClick,
12614
- className
12615
- }) {
12616
- return /* @__PURE__ */ jsx(
12617
- Box,
12618
- {
12619
- position: "absolute",
12620
- display: "flex",
12621
- className: cn(
12622
- "items-center justify-center rounded-pill border-3 transition-all cursor-pointer select-none",
12623
- "min-w-[80px] h-[80px] px-3",
12624
- isCurrent && "bg-primary/20 border-primary shadow-lg shadow-primary/30 scale-110",
12625
- isSelected && !isCurrent && "bg-accent/20 border-accent ring-2 ring-accent/50",
12626
- !isCurrent && !isSelected && "bg-card border-border hover:border-muted-foreground hover:scale-105",
12627
- className
12628
- ),
12629
- style: {
12630
- left: position.x,
12631
- top: position.y,
12632
- transform: "translate(-50%, -50%)"
12633
- },
12634
- onClick,
12635
- children: /* @__PURE__ */ jsxs(Box, { className: "text-center", children: [
12636
- isInitial && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground text-xs block", children: "\u25B6 start" }),
12637
- /* @__PURE__ */ jsx(
12638
- Typography,
12639
- {
12640
- variant: "body2",
12641
- className: cn(
12642
- "font-bold whitespace-nowrap",
12643
- isCurrent ? "text-primary" : "text-foreground"
12644
- ),
12645
- children: name
12646
- }
12647
- )
12648
- ] })
12649
- }
12650
- );
12651
- }
12652
- var init_StateNode = __esm({
12653
- "components/game/2d/organisms/StateNode.tsx"() {
12654
- init_atoms();
12655
- init_cn();
12656
- StateNode.displayName = "StateNode";
12657
- }
12658
- });
12659
- function TransitionArrow({
12660
- from,
12661
- to,
12662
- eventLabel,
12663
- guardHint,
12664
- isActive = false,
12665
- onClick,
12666
- className
12667
- }) {
12668
- const dx = to.x - from.x;
12669
- const dy = to.y - from.y;
12670
- const dist = Math.sqrt(dx * dx + dy * dy);
12671
- if (dist === 0) return /* @__PURE__ */ jsx(Fragment, {});
12672
- const nx = dx / dist;
12673
- const ny = dy / dist;
12674
- const startX = from.x + nx * NODE_RADIUS;
12675
- const startY = from.y + ny * NODE_RADIUS;
12676
- const endX = to.x - nx * NODE_RADIUS;
12677
- const endY = to.y - ny * NODE_RADIUS;
12678
- const midX = (startX + endX) / 2;
12679
- const midY = (startY + endY) / 2;
12680
- const perpX = -ny * 20;
12681
- const perpY = nx * 20;
12682
- const ctrlX = midX + perpX;
12683
- const ctrlY = midY + perpY;
12684
- const path = `M ${startX} ${startY} Q ${ctrlX} ${ctrlY} ${endX} ${endY}`;
12685
- return /* @__PURE__ */ jsxs("g", { className: cn("cursor-pointer", className), onClick, children: [
12686
- /* @__PURE__ */ jsx(
12687
- "path",
12688
- {
12689
- d: path,
12690
- fill: "none",
12691
- stroke: isActive ? "var(--color-primary)" : "var(--color-border)",
12692
- strokeWidth: isActive ? 3 : 2,
12693
- markerEnd: isActive ? "url(#arrowhead-active)" : "url(#arrowhead)"
12694
- }
12695
- ),
12696
- /* @__PURE__ */ jsx(
12697
- "text",
12698
- {
12699
- x: ctrlX,
12700
- y: ctrlY - 8,
12701
- textAnchor: "middle",
12702
- fill: isActive ? "var(--color-primary)" : "var(--color-foreground)",
12703
- fontSize: 12,
12704
- fontWeight: isActive ? "bold" : "normal",
12705
- className: "select-none",
12706
- children: eventLabel
12707
- }
12708
- ),
12709
- guardHint && /* @__PURE__ */ jsx(
12710
- "text",
12711
- {
12712
- x: ctrlX,
12713
- y: ctrlY + 6,
12714
- textAnchor: "middle",
12715
- fill: "var(--color-warning)",
12716
- fontSize: 10,
12717
- className: "select-none",
12718
- children: "\u26A0 " + guardHint
12719
- }
12720
- )
12721
- ] });
12722
- }
12723
- var NODE_RADIUS;
12724
- var init_TransitionArrow = __esm({
12725
- "components/game/2d/organisms/TransitionArrow.tsx"() {
12726
- init_cn();
12727
- NODE_RADIUS = 40;
12728
- TransitionArrow.displayName = "TransitionArrow";
12729
- }
12730
- });
12731
12824
  function VariablePanel({
12732
12825
  entityName,
12733
12826
  variables,
@@ -12736,61 +12829,35 @@ function VariablePanel({
12736
12829
  const { t } = useTranslate();
12737
12830
  return /* @__PURE__ */ jsxs(VStack, { className: cn("p-3 rounded-lg bg-card border border-border", className), gap: "sm", children: [
12738
12831
  /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-muted-foreground font-medium", children: t("stateArchitect.variables", { name: entityName }) }),
12739
- variables.map((v) => {
12740
- const name = v.name == null ? "" : String(v.name);
12741
- const value = numField(v.value);
12742
- const max = numField(v.max, 100);
12743
- const min = numField(v.min, 0);
12744
- const unit = v.unit == null ? "" : String(v.unit);
12745
- const pct = Math.round((value - min) / (max - min) * 100);
12746
- const isHigh = pct > 80;
12747
- const isLow = pct < 20;
12748
- return /* @__PURE__ */ jsxs(VStack, { gap: "none", children: [
12749
- /* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between", children: [
12750
- /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-foreground font-medium", children: name }),
12751
- /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: cn(
12752
- isHigh ? "text-error" : isLow ? "text-warning" : "text-foreground"
12753
- ), children: [
12754
- value,
12755
- unit,
12756
- " / ",
12757
- max,
12758
- unit
12759
- ] })
12760
- ] }),
12761
- /* @__PURE__ */ jsx(
12762
- ProgressBar,
12763
- {
12764
- value: pct,
12765
- color: isHigh ? "danger" : isLow ? "warning" : "primary",
12766
- size: "sm"
12767
- }
12768
- )
12769
- ] }, name);
12770
- })
12832
+ (variables ?? []).map((v) => /* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between", children: [
12833
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-foreground font-medium", children: v.name }),
12834
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-accent font-mono", children: v.value })
12835
+ ] }, v.name))
12771
12836
  ] });
12772
12837
  }
12773
- var numField;
12774
12838
  var init_VariablePanel = __esm({
12775
- "components/game/2d/organisms/VariablePanel.tsx"() {
12839
+ "components/game/2d/molecules/VariablePanel.tsx"() {
12776
12840
  init_atoms();
12777
12841
  init_cn();
12778
- numField = (v, fallback = 0) => {
12779
- const n = Number(v);
12780
- return Number.isFinite(n) ? n : fallback;
12781
- };
12782
12842
  VariablePanel.displayName = "VariablePanel";
12783
12843
  }
12784
12844
  });
12785
12845
  function StateJsonView({
12786
- data,
12846
+ name,
12847
+ initialState,
12848
+ states,
12849
+ transitions,
12787
12850
  label,
12788
12851
  defaultExpanded = false,
12789
12852
  className
12790
12853
  }) {
12791
12854
  const { t } = useTranslate();
12792
12855
  const [expanded, setExpanded] = useState(defaultExpanded);
12793
- const jsonString = JSON.stringify(data, null, 2);
12856
+ const jsonString = JSON.stringify(
12857
+ { name, initialState, states: states ?? [], transitions: transitions ?? [] },
12858
+ null,
12859
+ 2
12860
+ );
12794
12861
  return /* @__PURE__ */ jsxs(VStack, { className: cn("rounded-lg border border-border overflow-hidden", className), gap: "none", children: [
12795
12862
  /* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between p-2 bg-muted", gap: "sm", children: [
12796
12863
  /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground font-medium", children: label ?? t("stateArchitect.viewCode") }),
@@ -12807,13 +12874,13 @@ function StateJsonView({
12807
12874
  ] });
12808
12875
  }
12809
12876
  var init_StateJsonView = __esm({
12810
- "components/game/2d/organisms/StateJsonView.tsx"() {
12877
+ "components/game/2d/molecules/StateJsonView.tsx"() {
12811
12878
  init_atoms();
12812
12879
  init_cn();
12813
12880
  StateJsonView.displayName = "StateJsonView";
12814
12881
  }
12815
12882
  });
12816
- function layoutStates(states, width, height) {
12883
+ function layoutStates2(states, width, height) {
12817
12884
  const cx = width / 2;
12818
12885
  const cy = height / 2;
12819
12886
  const radius = Math.min(cx, cy) - 60;
@@ -12881,7 +12948,7 @@ function StateArchitectBoard({
12881
12948
  }, []);
12882
12949
  const GRAPH_W = 500;
12883
12950
  const GRAPH_H = 400;
12884
- const positions = useMemo(() => layoutStates(entityStates, GRAPH_W, GRAPH_H), [entityStates]);
12951
+ const positions = useMemo(() => layoutStates2(entityStates, GRAPH_W, GRAPH_H), [entityStates]);
12885
12952
  const handleStateClick = useCallback((state) => {
12886
12953
  if (isTesting) return;
12887
12954
  if (addingFrom) {
@@ -12976,7 +13043,7 @@ function StateArchitectBoard({
12976
13043
  setAddingFrom(null);
12977
13044
  if (playAgainEvent) emit(`UI:${playAgainEvent}`, {});
12978
13045
  }, [initialState, entityVariables, playAgainEvent, emit]);
12979
- const codeData = useMemo(() => ({
13046
+ useMemo(() => ({
12980
13047
  name: entityName,
12981
13048
  states: entityStates,
12982
13049
  initialState,
@@ -13111,7 +13178,7 @@ function StateArchitectBoard({
13111
13178
  VariablePanel,
13112
13179
  {
13113
13180
  entityName,
13114
- variables
13181
+ variables: variables.map((v) => ({ name: String(v.name ?? ""), value: String(v.value ?? "") }))
13115
13182
  }
13116
13183
  ),
13117
13184
  testResults.length > 0 && /* @__PURE__ */ jsxs(VStack, { className: "p-3 rounded-container bg-card border border-border", gap: "xs", children: [
@@ -13122,7 +13189,16 @@ function StateArchitectBoard({
13122
13189
  !r.passed && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-error", children: t("stateArchitect.gotState", { state: r.actualState }) })
13123
13190
  ] }, i))
13124
13191
  ] }),
13125
- resolved.showCodeView !== false && /* @__PURE__ */ jsx(StateJsonView, { data: codeData, label: "View Code" })
13192
+ resolved.showCodeView !== false && /* @__PURE__ */ jsx(
13193
+ StateJsonView,
13194
+ {
13195
+ name: entityName,
13196
+ initialState,
13197
+ states: entityStates,
13198
+ transitions: transitions.map((tr) => ({ from: tr.from, to: tr.to, event: tr.event })),
13199
+ label: "View Code"
13200
+ }
13201
+ )
13126
13202
  ] })
13127
13203
  ] }),
13128
13204
  isSuccess && /* @__PURE__ */ jsx(Box, { className: "p-4 rounded-container bg-success/20 border border-success text-center", children: /* @__PURE__ */ jsx(Typography, { variant: "h5", className: "text-success", children: str(resolved.successMessage) || t("stateArchitect.allPassed") }) }),
@@ -14863,7 +14939,7 @@ var init_ErrorBoundary = __esm({
14863
14939
  }
14864
14940
  );
14865
14941
  };
14866
- ErrorBoundary = class extends React95__default.Component {
14942
+ ErrorBoundary = class extends React96__default.Component {
14867
14943
  constructor(props) {
14868
14944
  super(props);
14869
14945
  __publicField(this, "reset", () => {
@@ -15145,7 +15221,7 @@ var init_Container = __esm({
15145
15221
  as: Component = "div"
15146
15222
  }) => {
15147
15223
  const resolvedSize = maxWidth ?? size ?? "lg";
15148
- return React95__default.createElement(
15224
+ return React96__default.createElement(
15149
15225
  Component,
15150
15226
  {
15151
15227
  className: cn(
@@ -17813,7 +17889,7 @@ var init_CodeBlock = __esm({
17813
17889
  DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
17814
17890
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
17815
17891
  HIDDEN_LINE_NUMBERS = { display: "none" };
17816
- CodeBlock = React95__default.memo(
17892
+ CodeBlock = React96__default.memo(
17817
17893
  ({
17818
17894
  code: rawCode,
17819
17895
  language = "text",
@@ -18400,7 +18476,7 @@ var init_MarkdownContent = __esm({
18400
18476
  init_Box();
18401
18477
  init_CodeBlock();
18402
18478
  init_cn();
18403
- MarkdownContent = React95__default.memo(
18479
+ MarkdownContent = React96__default.memo(
18404
18480
  ({ content, direction = "ltr", className }) => {
18405
18481
  const { t: _t } = useTranslate();
18406
18482
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -19677,7 +19753,7 @@ var init_StateMachineView = __esm({
19677
19753
  style: { top: title ? 30 : 0 },
19678
19754
  children: [
19679
19755
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
19680
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React95__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
19756
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React96__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
19681
19757
  StateNode2,
19682
19758
  {
19683
19759
  state,
@@ -25234,8 +25310,8 @@ var init_Menu = __esm({
25234
25310
  "bottom-end": "bottom-start"
25235
25311
  };
25236
25312
  const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
25237
- const triggerChild = React95__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
25238
- const triggerElement = React95__default.cloneElement(
25313
+ const triggerChild = React96__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
25314
+ const triggerElement = React96__default.cloneElement(
25239
25315
  triggerChild,
25240
25316
  {
25241
25317
  ref: triggerRef,
@@ -25330,14 +25406,14 @@ function useDataDnd(args) {
25330
25406
  const isZone = Boolean(dragGroup || accepts || sortable);
25331
25407
  const enabled = isZone || Boolean(dndRoot);
25332
25408
  const eventBus = useEventBus();
25333
- const parentRoot = React95__default.useContext(RootCtx);
25409
+ const parentRoot = React96__default.useContext(RootCtx);
25334
25410
  const isRoot = enabled && parentRoot === null;
25335
- const zoneId = React95__default.useId();
25411
+ const zoneId = React96__default.useId();
25336
25412
  const ownGroup = dragGroup ?? accepts ?? zoneId;
25337
- const [optimisticOrders, setOptimisticOrders] = React95__default.useState(() => /* @__PURE__ */ new Map());
25338
- const optimisticOrdersRef = React95__default.useRef(optimisticOrders);
25413
+ const [optimisticOrders, setOptimisticOrders] = React96__default.useState(() => /* @__PURE__ */ new Map());
25414
+ const optimisticOrdersRef = React96__default.useRef(optimisticOrders);
25339
25415
  optimisticOrdersRef.current = optimisticOrders;
25340
- const clearOptimisticOrder = React95__default.useCallback((group) => {
25416
+ const clearOptimisticOrder = React96__default.useCallback((group) => {
25341
25417
  setOptimisticOrders((prev) => {
25342
25418
  if (!prev.has(group)) return prev;
25343
25419
  const next = new Map(prev);
@@ -25362,7 +25438,7 @@ function useDataDnd(args) {
25362
25438
  const raw = it[dndItemIdField];
25363
25439
  return raw != null ? String(raw) : `__idx_${idx}`;
25364
25440
  }).join("|");
25365
- const itemIds = React95__default.useMemo(
25441
+ const itemIds = React96__default.useMemo(
25366
25442
  () => orderedItems.map((it, idx) => {
25367
25443
  const raw = it[dndItemIdField];
25368
25444
  return raw != null ? String(raw) : `__idx_${idx}`;
@@ -25373,7 +25449,7 @@ function useDataDnd(args) {
25373
25449
  const raw = it[dndItemIdField];
25374
25450
  return raw != null ? String(raw) : `__${idx}`;
25375
25451
  }).join("|");
25376
- React95__default.useEffect(() => {
25452
+ React96__default.useEffect(() => {
25377
25453
  const root = isRoot ? null : parentRoot;
25378
25454
  if (root) {
25379
25455
  root.clearOptimisticOrder(ownGroup);
@@ -25381,20 +25457,20 @@ function useDataDnd(args) {
25381
25457
  clearOptimisticOrder(ownGroup);
25382
25458
  }
25383
25459
  }, [itemsContentSig, ownGroup]);
25384
- const zonesRef = React95__default.useRef(/* @__PURE__ */ new Map());
25385
- const registerZone = React95__default.useCallback((zoneId2, meta2) => {
25460
+ const zonesRef = React96__default.useRef(/* @__PURE__ */ new Map());
25461
+ const registerZone = React96__default.useCallback((zoneId2, meta2) => {
25386
25462
  zonesRef.current.set(zoneId2, meta2);
25387
25463
  }, []);
25388
- const unregisterZone = React95__default.useCallback((zoneId2) => {
25464
+ const unregisterZone = React96__default.useCallback((zoneId2) => {
25389
25465
  zonesRef.current.delete(zoneId2);
25390
25466
  }, []);
25391
- const [activeDrag, setActiveDrag] = React95__default.useState(null);
25392
- const [overZoneGroup, setOverZoneGroup] = React95__default.useState(null);
25393
- const meta = React95__default.useMemo(
25467
+ const [activeDrag, setActiveDrag] = React96__default.useState(null);
25468
+ const [overZoneGroup, setOverZoneGroup] = React96__default.useState(null);
25469
+ const meta = React96__default.useMemo(
25394
25470
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
25395
25471
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
25396
25472
  );
25397
- React95__default.useEffect(() => {
25473
+ React96__default.useEffect(() => {
25398
25474
  const target = isRoot ? null : parentRoot;
25399
25475
  if (!target) {
25400
25476
  zonesRef.current.set(zoneId, meta);
@@ -25413,7 +25489,7 @@ function useDataDnd(args) {
25413
25489
  }, [parentRoot, isRoot, zoneId, meta]);
25414
25490
  const sensors = useAlmadarDndSensors(true);
25415
25491
  const collisionDetection = almadarDndCollisionDetection;
25416
- const findZoneByItem = React95__default.useCallback(
25492
+ const findZoneByItem = React96__default.useCallback(
25417
25493
  (id) => {
25418
25494
  for (const z of zonesRef.current.values()) {
25419
25495
  if (z.itemIds.includes(id)) return z;
@@ -25422,7 +25498,7 @@ function useDataDnd(args) {
25422
25498
  },
25423
25499
  []
25424
25500
  );
25425
- React95__default.useCallback(
25501
+ React96__default.useCallback(
25426
25502
  (group) => {
25427
25503
  for (const z of zonesRef.current.values()) {
25428
25504
  if (z.group === group) return z;
@@ -25431,7 +25507,7 @@ function useDataDnd(args) {
25431
25507
  },
25432
25508
  []
25433
25509
  );
25434
- const handleDragEnd = React95__default.useCallback(
25510
+ const handleDragEnd = React96__default.useCallback(
25435
25511
  (event) => {
25436
25512
  const { active, over } = event;
25437
25513
  const activeIdStr = String(active.id);
@@ -25522,8 +25598,8 @@ function useDataDnd(args) {
25522
25598
  },
25523
25599
  [eventBus]
25524
25600
  );
25525
- const sortableData = React95__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
25526
- const SortableItem = React95__default.useCallback(
25601
+ const sortableData = React96__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
25602
+ const SortableItem = React96__default.useCallback(
25527
25603
  ({ id, children }) => {
25528
25604
  const {
25529
25605
  attributes,
@@ -25563,7 +25639,7 @@ function useDataDnd(args) {
25563
25639
  id: droppableId,
25564
25640
  data: sortableData
25565
25641
  });
25566
- const ctx = React95__default.useContext(RootCtx);
25642
+ const ctx = React96__default.useContext(RootCtx);
25567
25643
  const activeDrag2 = ctx?.activeDrag ?? null;
25568
25644
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
25569
25645
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -25578,7 +25654,7 @@ function useDataDnd(args) {
25578
25654
  showForeignPlaceholder,
25579
25655
  ctxAvailable: ctx != null
25580
25656
  });
25581
- React95__default.useEffect(() => {
25657
+ React96__default.useEffect(() => {
25582
25658
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
25583
25659
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
25584
25660
  return /* @__PURE__ */ jsx(
@@ -25592,11 +25668,11 @@ function useDataDnd(args) {
25592
25668
  }
25593
25669
  );
25594
25670
  };
25595
- const rootContextValue = React95__default.useMemo(
25671
+ const rootContextValue = React96__default.useMemo(
25596
25672
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
25597
25673
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
25598
25674
  );
25599
- const handleDragStart = React95__default.useCallback((event) => {
25675
+ const handleDragStart = React96__default.useCallback((event) => {
25600
25676
  const sourceZone = findZoneByItem(event.active.id);
25601
25677
  const rect = event.active.rect.current.initial;
25602
25678
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -25615,7 +25691,7 @@ function useDataDnd(args) {
25615
25691
  isRoot
25616
25692
  });
25617
25693
  }, [findZoneByItem, isRoot, zoneId]);
25618
- const handleDragOver = React95__default.useCallback((event) => {
25694
+ const handleDragOver = React96__default.useCallback((event) => {
25619
25695
  const { active, over } = event;
25620
25696
  const overData = over?.data?.current;
25621
25697
  const overGroup = overData?.dndGroup ?? null;
@@ -25685,7 +25761,7 @@ function useDataDnd(args) {
25685
25761
  return next;
25686
25762
  });
25687
25763
  }, []);
25688
- const handleDragCancel = React95__default.useCallback((event) => {
25764
+ const handleDragCancel = React96__default.useCallback((event) => {
25689
25765
  setActiveDrag(null);
25690
25766
  setOverZoneGroup(null);
25691
25767
  dndLog.warn("dragCancel", {
@@ -25693,12 +25769,12 @@ function useDataDnd(args) {
25693
25769
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
25694
25770
  });
25695
25771
  }, []);
25696
- const handleDragEndWithCleanup = React95__default.useCallback((event) => {
25772
+ const handleDragEndWithCleanup = React96__default.useCallback((event) => {
25697
25773
  handleDragEnd(event);
25698
25774
  setActiveDrag(null);
25699
25775
  setOverZoneGroup(null);
25700
25776
  }, [handleDragEnd]);
25701
- const wrapContainer = React95__default.useCallback(
25777
+ const wrapContainer = React96__default.useCallback(
25702
25778
  (children) => {
25703
25779
  if (!enabled) return children;
25704
25780
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -25752,7 +25828,7 @@ var init_useDataDnd = __esm({
25752
25828
  init_useAlmadarDndCollision();
25753
25829
  init_Box();
25754
25830
  dndLog = createLogger("almadar:ui:dnd");
25755
- RootCtx = React95__default.createContext(null);
25831
+ RootCtx = React96__default.createContext(null);
25756
25832
  }
25757
25833
  });
25758
25834
  function renderIconInput(icon, props) {
@@ -26278,7 +26354,7 @@ function DataList({
26278
26354
  }) {
26279
26355
  const eventBus = useEventBus();
26280
26356
  const { t } = useTranslate();
26281
- const [visibleCount, setVisibleCount] = React95__default.useState(pageSize || Infinity);
26357
+ const [visibleCount, setVisibleCount] = React96__default.useState(pageSize || Infinity);
26282
26358
  const fieldDefs = fields ?? columns ?? [];
26283
26359
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
26284
26360
  const dnd = useDataDnd({
@@ -26297,7 +26373,7 @@ function DataList({
26297
26373
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
26298
26374
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
26299
26375
  const hasRenderProp = typeof children === "function";
26300
- React95__default.useEffect(() => {
26376
+ React96__default.useEffect(() => {
26301
26377
  const renderItemTypeOf = typeof schemaRenderItem;
26302
26378
  const childrenTypeOf = typeof children;
26303
26379
  if (data.length > 0 && !hasRenderProp) {
@@ -26401,7 +26477,7 @@ function DataList({
26401
26477
  const items2 = [...data];
26402
26478
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
26403
26479
  const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
26404
- return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
26480
+ return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
26405
26481
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
26406
26482
  group.items.map((itemData, index) => {
26407
26483
  const id = itemData.id || `${gi}-${index}`;
@@ -26542,7 +26618,7 @@ function DataList({
26542
26618
  className
26543
26619
  ),
26544
26620
  children: [
26545
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
26621
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
26546
26622
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
26547
26623
  group.items.map(
26548
26624
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -26627,7 +26703,7 @@ var init_FormSection = __esm({
26627
26703
  columns = 1,
26628
26704
  className
26629
26705
  }) => {
26630
- const [collapsed, setCollapsed] = React95__default.useState(defaultCollapsed);
26706
+ const [collapsed, setCollapsed] = React96__default.useState(defaultCollapsed);
26631
26707
  const { t } = useTranslate();
26632
26708
  const eventBus = useEventBus();
26633
26709
  const gridClass = {
@@ -26635,7 +26711,7 @@ var init_FormSection = __esm({
26635
26711
  2: "grid-cols-1 md:grid-cols-2",
26636
26712
  3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
26637
26713
  }[columns];
26638
- React95__default.useCallback(() => {
26714
+ React96__default.useCallback(() => {
26639
26715
  if (collapsible) {
26640
26716
  setCollapsed((prev) => !prev);
26641
26717
  eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
@@ -27521,7 +27597,7 @@ var init_Flex = __esm({
27521
27597
  flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
27522
27598
  }
27523
27599
  }
27524
- return React95__default.createElement(Component, {
27600
+ return React96__default.createElement(Component, {
27525
27601
  className: cn(
27526
27602
  inline ? "inline-flex" : "flex",
27527
27603
  directionStyles[direction],
@@ -27640,7 +27716,7 @@ var init_Grid = __esm({
27640
27716
  as: Component = "div"
27641
27717
  }) => {
27642
27718
  const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
27643
- return React95__default.createElement(
27719
+ return React96__default.createElement(
27644
27720
  Component,
27645
27721
  {
27646
27722
  className: cn(
@@ -27836,9 +27912,9 @@ var init_Popover = __esm({
27836
27912
  onMouseLeave: handleClose,
27837
27913
  onPointerDown: tapTriggerProps.onPointerDown
27838
27914
  };
27839
- const childElement = React95__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
27915
+ const childElement = React96__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
27840
27916
  const childPointerDown = childElement.props.onPointerDown;
27841
- const triggerElement = React95__default.cloneElement(
27917
+ const triggerElement = React96__default.cloneElement(
27842
27918
  childElement,
27843
27919
  {
27844
27920
  ref: triggerRef,
@@ -28440,9 +28516,9 @@ var init_Tooltip = __esm({
28440
28516
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
28441
28517
  };
28442
28518
  }, []);
28443
- const triggerElement = React95__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
28519
+ const triggerElement = React96__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
28444
28520
  const childPointerDown = triggerElement.props.onPointerDown;
28445
- const trigger = React95__default.cloneElement(triggerElement, {
28521
+ const trigger = React96__default.cloneElement(triggerElement, {
28446
28522
  ref: triggerRef,
28447
28523
  onMouseEnter: handleMouseEnter,
28448
28524
  onMouseLeave: handleMouseLeave,
@@ -28532,7 +28608,7 @@ var init_WizardProgress = __esm({
28532
28608
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
28533
28609
  const isActive = index === currentStep;
28534
28610
  const isCompleted = index < currentStep;
28535
- return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
28611
+ return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
28536
28612
  /* @__PURE__ */ jsx(
28537
28613
  "button",
28538
28614
  {
@@ -30092,7 +30168,7 @@ var init_MapView = __esm({
30092
30168
  shadowSize: [41, 41]
30093
30169
  });
30094
30170
  L.Marker.prototype.options.icon = defaultIcon;
30095
- const { useEffect: useEffect67, useRef: useRef65, useCallback: useCallback99, useState: useState97 } = React95__default;
30171
+ const { useEffect: useEffect67, useRef: useRef65, useCallback: useCallback99, useState: useState97 } = React96__default;
30096
30172
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
30097
30173
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
30098
30174
  function MapUpdater({ centerLat, centerLng, zoom }) {
@@ -31007,8 +31083,8 @@ function TableView({
31007
31083
  }) {
31008
31084
  const eventBus = useEventBus();
31009
31085
  const { t } = useTranslate();
31010
- const [visibleCount, setVisibleCount] = React95__default.useState(pageSize > 0 ? pageSize : Infinity);
31011
- const [localSelected, setLocalSelected] = React95__default.useState(/* @__PURE__ */ new Set());
31086
+ const [visibleCount, setVisibleCount] = React96__default.useState(pageSize > 0 ? pageSize : Infinity);
31087
+ const [localSelected, setLocalSelected] = React96__default.useState(/* @__PURE__ */ new Set());
31012
31088
  const colDefs = columns ?? fields ?? [];
31013
31089
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
31014
31090
  const dnd = useDataDnd({
@@ -31203,12 +31279,12 @@ function TableView({
31203
31279
  ]
31204
31280
  }
31205
31281
  );
31206
- return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React95__default.Fragment, { children: rowInner }, id);
31282
+ return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React96__default.Fragment, { children: rowInner }, id);
31207
31283
  };
31208
31284
  const items = Array.from(data);
31209
31285
  const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
31210
31286
  let runningIndex = 0;
31211
- const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
31287
+ const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
31212
31288
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
31213
31289
  group.items.map((row) => renderRow(row, runningIndex++))
31214
31290
  ] }, gi)) });
@@ -32427,7 +32503,7 @@ var init_StepFlow = __esm({
32427
32503
  className
32428
32504
  }) => {
32429
32505
  if (orientation === "vertical") {
32430
- return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React95__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
32506
+ return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React96__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
32431
32507
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
32432
32508
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
32433
32509
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -32438,7 +32514,7 @@ var init_StepFlow = __esm({
32438
32514
  ] })
32439
32515
  ] }) }, index)) });
32440
32516
  }
32441
- 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(React95__default.Fragment, { children: [
32517
+ 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(React96__default.Fragment, { children: [
32442
32518
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
32443
32519
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
32444
32520
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -33423,7 +33499,7 @@ var init_LikertScale = __esm({
33423
33499
  md: "text-base",
33424
33500
  lg: "text-lg"
33425
33501
  };
33426
- LikertScale = React95__default.forwardRef(
33502
+ LikertScale = React96__default.forwardRef(
33427
33503
  ({
33428
33504
  question,
33429
33505
  options = DEFAULT_LIKERT_OPTIONS,
@@ -33435,7 +33511,7 @@ var init_LikertScale = __esm({
33435
33511
  variant = "radios",
33436
33512
  className
33437
33513
  }, ref) => {
33438
- const groupId = React95__default.useId();
33514
+ const groupId = React96__default.useId();
33439
33515
  const eventBus = useEventBus();
33440
33516
  const handleSelect = useCallback(
33441
33517
  (next) => {
@@ -35717,7 +35793,7 @@ var init_DocBreadcrumb = __esm({
35717
35793
  "aria-label": t("aria.breadcrumb"),
35718
35794
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
35719
35795
  const isLast = idx === items.length - 1;
35720
- return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
35796
+ return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
35721
35797
  idx > 0 && /* @__PURE__ */ jsx(
35722
35798
  Icon,
35723
35799
  {
@@ -36586,7 +36662,7 @@ var init_MiniStateMachine = __esm({
36586
36662
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
36587
36663
  const tc = transitionCounts[s.name] ?? 0;
36588
36664
  const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
36589
- return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
36665
+ return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
36590
36666
  /* @__PURE__ */ jsx(
36591
36667
  AvlState,
36592
36668
  {
@@ -36790,7 +36866,7 @@ var init_PageHeader = __esm({
36790
36866
  info: "bg-info/10 text-info"
36791
36867
  };
36792
36868
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
36793
- 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(React95__default.Fragment, { children: [
36869
+ 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(React96__default.Fragment, { children: [
36794
36870
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
36795
36871
  crumb.href ? /* @__PURE__ */ jsx(
36796
36872
  "a",
@@ -37148,7 +37224,7 @@ var init_Section = __esm({
37148
37224
  as: Component = "section"
37149
37225
  }) => {
37150
37226
  const hasHeader = title || description || action;
37151
- return React95__default.createElement(
37227
+ return React96__default.createElement(
37152
37228
  Component,
37153
37229
  {
37154
37230
  className: cn(
@@ -37522,7 +37598,7 @@ var init_WizardContainer = __esm({
37522
37598
  const isCompleted = index < currentStep;
37523
37599
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
37524
37600
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
37525
- return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
37601
+ return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
37526
37602
  /* @__PURE__ */ jsx(
37527
37603
  Button,
37528
37604
  {
@@ -39955,7 +40031,7 @@ var init_DetailPanel = __esm({
39955
40031
  }
39956
40032
  });
39957
40033
  function extractTitle(children) {
39958
- if (!React95__default.isValidElement(children)) return void 0;
40034
+ if (!React96__default.isValidElement(children)) return void 0;
39959
40035
  const props = children.props;
39960
40036
  if (typeof props.title === "string") {
39961
40037
  return props.title;
@@ -40305,12 +40381,12 @@ var init_Form = __esm({
40305
40381
  const isSchemaEntity = isOrbitalEntitySchema(entity);
40306
40382
  const resolvedEntity = isSchemaEntity ? entity : void 0;
40307
40383
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
40308
- const normalizedInitialData = React95__default.useMemo(() => {
40384
+ const normalizedInitialData = React96__default.useMemo(() => {
40309
40385
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
40310
40386
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
40311
40387
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
40312
40388
  }, [entity, initialData]);
40313
- const entityDerivedFields = React95__default.useMemo(() => {
40389
+ const entityDerivedFields = React96__default.useMemo(() => {
40314
40390
  if (fields && fields.length > 0) return void 0;
40315
40391
  if (!resolvedEntity) return void 0;
40316
40392
  return resolvedEntity.fields.map(
@@ -40331,16 +40407,16 @@ var init_Form = __esm({
40331
40407
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
40332
40408
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
40333
40409
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
40334
- const [formData, setFormData] = React95__default.useState(
40410
+ const [formData, setFormData] = React96__default.useState(
40335
40411
  normalizedInitialData
40336
40412
  );
40337
- const [collapsedSections, setCollapsedSections] = React95__default.useState(
40413
+ const [collapsedSections, setCollapsedSections] = React96__default.useState(
40338
40414
  /* @__PURE__ */ new Set()
40339
40415
  );
40340
- const [submitError, setSubmitError] = React95__default.useState(null);
40341
- const formRef = React95__default.useRef(null);
40416
+ const [submitError, setSubmitError] = React96__default.useState(null);
40417
+ const formRef = React96__default.useRef(null);
40342
40418
  const formMode = props.mode;
40343
- const mountedRef = React95__default.useRef(false);
40419
+ const mountedRef = React96__default.useRef(false);
40344
40420
  if (!mountedRef.current) {
40345
40421
  mountedRef.current = true;
40346
40422
  debug("forms", "mount", {
@@ -40353,7 +40429,7 @@ var init_Form = __esm({
40353
40429
  });
40354
40430
  }
40355
40431
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
40356
- const evalContext = React95__default.useMemo(
40432
+ const evalContext = React96__default.useMemo(
40357
40433
  () => ({
40358
40434
  formValues: formData,
40359
40435
  globalVariables: externalContext?.globalVariables ?? {},
@@ -40362,7 +40438,7 @@ var init_Form = __esm({
40362
40438
  }),
40363
40439
  [formData, externalContext]
40364
40440
  );
40365
- React95__default.useEffect(() => {
40441
+ React96__default.useEffect(() => {
40366
40442
  debug("forms", "initialData-sync", {
40367
40443
  mode: formMode,
40368
40444
  normalizedInitialData,
@@ -40373,7 +40449,7 @@ var init_Form = __esm({
40373
40449
  setFormData(normalizedInitialData);
40374
40450
  }
40375
40451
  }, [normalizedInitialData]);
40376
- const processCalculations = React95__default.useCallback(
40452
+ const processCalculations = React96__default.useCallback(
40377
40453
  (changedFieldId, newFormData) => {
40378
40454
  if (!hiddenCalculations.length) return;
40379
40455
  const context = {
@@ -40398,7 +40474,7 @@ var init_Form = __esm({
40398
40474
  },
40399
40475
  [hiddenCalculations, externalContext, eventBus]
40400
40476
  );
40401
- const checkViolations = React95__default.useCallback(
40477
+ const checkViolations = React96__default.useCallback(
40402
40478
  (changedFieldId, newFormData) => {
40403
40479
  if (!violationTriggers.length) return;
40404
40480
  const context = {
@@ -40436,7 +40512,7 @@ var init_Form = __esm({
40436
40512
  processCalculations(name, newFormData);
40437
40513
  checkViolations(name, newFormData);
40438
40514
  };
40439
- const isFieldVisible = React95__default.useCallback(
40515
+ const isFieldVisible = React96__default.useCallback(
40440
40516
  (fieldName) => {
40441
40517
  const condition = conditionalFields[fieldName];
40442
40518
  if (!condition) return true;
@@ -40444,7 +40520,7 @@ var init_Form = __esm({
40444
40520
  },
40445
40521
  [conditionalFields, evalContext]
40446
40522
  );
40447
- const isSectionVisible = React95__default.useCallback(
40523
+ const isSectionVisible = React96__default.useCallback(
40448
40524
  (section) => {
40449
40525
  if (!section.condition) return true;
40450
40526
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -40520,7 +40596,7 @@ var init_Form = __esm({
40520
40596
  eventBus.emit(`UI:${onCancel}`);
40521
40597
  }
40522
40598
  };
40523
- const renderField = React95__default.useCallback(
40599
+ const renderField = React96__default.useCallback(
40524
40600
  (field) => {
40525
40601
  const fieldName = field.name || field.field;
40526
40602
  if (!fieldName) return null;
@@ -40541,7 +40617,7 @@ var init_Form = __esm({
40541
40617
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
40542
40618
  );
40543
40619
  const effectiveFields = entityDerivedFields ?? fields;
40544
- const normalizedFields = React95__default.useMemo(() => {
40620
+ const normalizedFields = React96__default.useMemo(() => {
40545
40621
  if (!effectiveFields || effectiveFields.length === 0) return [];
40546
40622
  return effectiveFields.map((field) => {
40547
40623
  if (typeof field === "string") {
@@ -40565,7 +40641,7 @@ var init_Form = __esm({
40565
40641
  return field;
40566
40642
  });
40567
40643
  }, [effectiveFields, resolvedEntity]);
40568
- const schemaFields = React95__default.useMemo(() => {
40644
+ const schemaFields = React96__default.useMemo(() => {
40569
40645
  if (normalizedFields.length === 0) return null;
40570
40646
  if (isDebugEnabled()) {
40571
40647
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -40575,7 +40651,7 @@ var init_Form = __esm({
40575
40651
  }
40576
40652
  return normalizedFields.map(renderField).filter(Boolean);
40577
40653
  }, [normalizedFields, renderField, entityName, conditionalFields]);
40578
- const sectionElements = React95__default.useMemo(() => {
40654
+ const sectionElements = React96__default.useMemo(() => {
40579
40655
  if (!sections || sections.length === 0) return null;
40580
40656
  return sections.map((section) => {
40581
40657
  if (!isSectionVisible(section)) {
@@ -41300,7 +41376,7 @@ var init_List = __esm({
41300
41376
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
41301
41377
  return [];
41302
41378
  }, [entity]);
41303
- const getItemActions = React95__default.useCallback(
41379
+ const getItemActions = React96__default.useCallback(
41304
41380
  (item) => {
41305
41381
  if (!itemActions) return [];
41306
41382
  if (typeof itemActions === "function") {
@@ -41775,7 +41851,7 @@ var init_MediaGallery = __esm({
41775
41851
  [selectable, selectedItems, selectionEvent, eventBus]
41776
41852
  );
41777
41853
  const entityData = Array.isArray(entity) ? entity : [];
41778
- const items = React95__default.useMemo(() => {
41854
+ const items = React96__default.useMemo(() => {
41779
41855
  if (propItems) return propItems;
41780
41856
  if (entityData.length === 0) return [];
41781
41857
  return entityData.map((record, idx) => {
@@ -41938,7 +42014,7 @@ var init_MediaGallery = __esm({
41938
42014
  }
41939
42015
  });
41940
42016
  function extractTitle2(children) {
41941
- if (!React95__default.isValidElement(children)) return void 0;
42017
+ if (!React96__default.isValidElement(children)) return void 0;
41942
42018
  const props = children.props;
41943
42019
  if (typeof props.title === "string") {
41944
42020
  return props.title;
@@ -42212,7 +42288,7 @@ var init_debugRegistry = __esm({
42212
42288
  }
42213
42289
  });
42214
42290
  function useDebugData() {
42215
- const [data, setData] = React95.useState(() => ({
42291
+ const [data, setData] = React96.useState(() => ({
42216
42292
  traits: [],
42217
42293
  ticks: [],
42218
42294
  guards: [],
@@ -42226,7 +42302,7 @@ function useDebugData() {
42226
42302
  },
42227
42303
  lastUpdate: Date.now()
42228
42304
  }));
42229
- React95.useEffect(() => {
42305
+ React96.useEffect(() => {
42230
42306
  const updateData = () => {
42231
42307
  setData({
42232
42308
  traits: getAllTraits(),
@@ -42335,12 +42411,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
42335
42411
  return positions;
42336
42412
  }
42337
42413
  function WalkMinimap() {
42338
- const [walkStep, setWalkStep] = React95.useState(null);
42339
- const [traits2, setTraits] = React95.useState([]);
42340
- const [coveredEdges, setCoveredEdges] = React95.useState([]);
42341
- const [completedTraits, setCompletedTraits] = React95.useState(/* @__PURE__ */ new Set());
42342
- const prevTraitRef = React95.useRef(null);
42343
- React95.useEffect(() => {
42414
+ const [walkStep, setWalkStep] = React96.useState(null);
42415
+ const [traits2, setTraits] = React96.useState([]);
42416
+ const [coveredEdges, setCoveredEdges] = React96.useState([]);
42417
+ const [completedTraits, setCompletedTraits] = React96.useState(/* @__PURE__ */ new Set());
42418
+ const prevTraitRef = React96.useRef(null);
42419
+ React96.useEffect(() => {
42344
42420
  const interval = setInterval(() => {
42345
42421
  const w = window;
42346
42422
  const step = w.__orbitalWalkStep;
@@ -42776,15 +42852,15 @@ var init_EntitiesTab = __esm({
42776
42852
  });
42777
42853
  function EventFlowTab({ events: events2 }) {
42778
42854
  const { t } = useTranslate();
42779
- const [filter, setFilter] = React95.useState("all");
42780
- const containerRef = React95.useRef(null);
42781
- const [autoScroll, setAutoScroll] = React95.useState(true);
42782
- React95.useEffect(() => {
42855
+ const [filter, setFilter] = React96.useState("all");
42856
+ const containerRef = React96.useRef(null);
42857
+ const [autoScroll, setAutoScroll] = React96.useState(true);
42858
+ React96.useEffect(() => {
42783
42859
  if (autoScroll && containerRef.current) {
42784
42860
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
42785
42861
  }
42786
42862
  }, [events2.length, autoScroll]);
42787
- const filteredEvents = React95.useMemo(() => {
42863
+ const filteredEvents = React96.useMemo(() => {
42788
42864
  if (filter === "all") return events2;
42789
42865
  return events2.filter((e) => e.type === filter);
42790
42866
  }, [events2, filter]);
@@ -42900,7 +42976,7 @@ var init_EventFlowTab = __esm({
42900
42976
  });
42901
42977
  function GuardsPanel({ guards }) {
42902
42978
  const { t } = useTranslate();
42903
- const [filter, setFilter] = React95.useState("all");
42979
+ const [filter, setFilter] = React96.useState("all");
42904
42980
  if (guards.length === 0) {
42905
42981
  return /* @__PURE__ */ jsx(
42906
42982
  EmptyState,
@@ -42913,7 +42989,7 @@ function GuardsPanel({ guards }) {
42913
42989
  }
42914
42990
  const passedCount = guards.filter((g) => g.result).length;
42915
42991
  const failedCount = guards.length - passedCount;
42916
- const filteredGuards = React95.useMemo(() => {
42992
+ const filteredGuards = React96.useMemo(() => {
42917
42993
  if (filter === "all") return guards;
42918
42994
  if (filter === "passed") return guards.filter((g) => g.result);
42919
42995
  return guards.filter((g) => !g.result);
@@ -43076,10 +43152,10 @@ function EffectBadge({ effect }) {
43076
43152
  }
43077
43153
  function TransitionTimeline({ transitions }) {
43078
43154
  const { t } = useTranslate();
43079
- const containerRef = React95.useRef(null);
43080
- const [autoScroll, setAutoScroll] = React95.useState(true);
43081
- const [expandedId, setExpandedId] = React95.useState(null);
43082
- React95.useEffect(() => {
43155
+ const containerRef = React96.useRef(null);
43156
+ const [autoScroll, setAutoScroll] = React96.useState(true);
43157
+ const [expandedId, setExpandedId] = React96.useState(null);
43158
+ React96.useEffect(() => {
43083
43159
  if (autoScroll && containerRef.current) {
43084
43160
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
43085
43161
  }
@@ -43359,9 +43435,9 @@ function getAllEvents(traits2) {
43359
43435
  function EventDispatcherTab({ traits: traits2, schema }) {
43360
43436
  const eventBus = useEventBus();
43361
43437
  const { t } = useTranslate();
43362
- const [log9, setLog] = React95.useState([]);
43363
- const prevStatesRef = React95.useRef(/* @__PURE__ */ new Map());
43364
- React95.useEffect(() => {
43438
+ const [log9, setLog] = React96.useState([]);
43439
+ const prevStatesRef = React96.useRef(/* @__PURE__ */ new Map());
43440
+ React96.useEffect(() => {
43365
43441
  for (const trait of traits2) {
43366
43442
  const prev = prevStatesRef.current.get(trait.id);
43367
43443
  if (prev && prev !== trait.currentState) {
@@ -43530,10 +43606,10 @@ function VerifyModePanel({
43530
43606
  localCount
43531
43607
  }) {
43532
43608
  const { t } = useTranslate();
43533
- const [expanded, setExpanded] = React95.useState(true);
43534
- const scrollRef = React95.useRef(null);
43535
- const prevCountRef = React95.useRef(0);
43536
- React95.useEffect(() => {
43609
+ const [expanded, setExpanded] = React96.useState(true);
43610
+ const scrollRef = React96.useRef(null);
43611
+ const prevCountRef = React96.useRef(0);
43612
+ React96.useEffect(() => {
43537
43613
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
43538
43614
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
43539
43615
  }
@@ -43590,10 +43666,10 @@ function RuntimeDebugger({
43590
43666
  schema
43591
43667
  }) {
43592
43668
  const { t } = useTranslate();
43593
- const [isCollapsed, setIsCollapsed] = React95.useState(mode === "verify" ? true : defaultCollapsed);
43594
- const [isVisible, setIsVisible] = React95.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
43669
+ const [isCollapsed, setIsCollapsed] = React96.useState(mode === "verify" ? true : defaultCollapsed);
43670
+ const [isVisible, setIsVisible] = React96.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
43595
43671
  const debugData = useDebugData();
43596
- React95.useEffect(() => {
43672
+ React96.useEffect(() => {
43597
43673
  if (mode === "inline") return;
43598
43674
  return onDebugToggle((enabled) => {
43599
43675
  setIsVisible(enabled);
@@ -43602,7 +43678,7 @@ function RuntimeDebugger({
43602
43678
  }
43603
43679
  });
43604
43680
  }, [mode]);
43605
- React95.useEffect(() => {
43681
+ React96.useEffect(() => {
43606
43682
  if (mode === "inline") return;
43607
43683
  const handleKeyDown = (e) => {
43608
43684
  if (e.key === "`" && isVisible) {
@@ -44122,7 +44198,7 @@ var init_StatCard = __esm({
44122
44198
  const labelToUse = propLabel ?? propTitle;
44123
44199
  const eventBus = useEventBus();
44124
44200
  const { t } = useTranslate();
44125
- const handleActionClick = React95__default.useCallback(() => {
44201
+ const handleActionClick = React96__default.useCallback(() => {
44126
44202
  if (action?.event) {
44127
44203
  eventBus.emit(`UI:${action.event}`, {});
44128
44204
  }
@@ -44133,7 +44209,7 @@ var init_StatCard = __esm({
44133
44209
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
44134
44210
  const isLoading = externalLoading ?? false;
44135
44211
  const error = externalError;
44136
- const computeMetricValue = React95__default.useCallback(
44212
+ const computeMetricValue = React96__default.useCallback(
44137
44213
  (metric, items) => {
44138
44214
  if (metric.value !== void 0) {
44139
44215
  return metric.value;
@@ -44172,7 +44248,7 @@ var init_StatCard = __esm({
44172
44248
  },
44173
44249
  []
44174
44250
  );
44175
- const schemaStats = React95__default.useMemo(() => {
44251
+ const schemaStats = React96__default.useMemo(() => {
44176
44252
  if (!metrics || metrics.length === 0) return null;
44177
44253
  return metrics.map((metric) => ({
44178
44254
  label: metric.label,
@@ -44180,7 +44256,7 @@ var init_StatCard = __esm({
44180
44256
  format: metric.format
44181
44257
  }));
44182
44258
  }, [metrics, data, computeMetricValue]);
44183
- const calculatedTrend = React95__default.useMemo(() => {
44259
+ const calculatedTrend = React96__default.useMemo(() => {
44184
44260
  if (manualTrend !== void 0) return manualTrend;
44185
44261
  if (previousValue === void 0 || currentValue === void 0)
44186
44262
  return void 0;
@@ -44820,8 +44896,8 @@ var init_SubagentTracePanel = __esm({
44820
44896
  ] });
44821
44897
  };
44822
44898
  InlineActivityStream = ({ activities, autoScroll = true, className }) => {
44823
- const endRef = React95__default.useRef(null);
44824
- React95__default.useEffect(() => {
44899
+ const endRef = React96__default.useRef(null);
44900
+ React96__default.useEffect(() => {
44825
44901
  if (!autoScroll) return;
44826
44902
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
44827
44903
  }, [activities.length, autoScroll]);
@@ -44915,7 +44991,7 @@ var init_SubagentTracePanel = __esm({
44915
44991
  };
44916
44992
  SubagentRichCard = ({ subagent }) => {
44917
44993
  const { t } = useTranslate();
44918
- const activities = React95__default.useMemo(
44994
+ const activities = React96__default.useMemo(
44919
44995
  () => subagentMessagesToActivities(subagent.messages),
44920
44996
  [subagent.messages]
44921
44997
  );
@@ -44992,8 +45068,8 @@ var init_SubagentTracePanel = __esm({
44992
45068
  ] });
44993
45069
  };
44994
45070
  CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
44995
- const endRef = React95__default.useRef(null);
44996
- React95__default.useEffect(() => {
45071
+ const endRef = React96__default.useRef(null);
45072
+ React96__default.useEffect(() => {
44997
45073
  if (!autoScroll) return;
44998
45074
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
44999
45075
  }, [messages.length, autoScroll]);
@@ -45423,7 +45499,7 @@ var init_Timeline = __esm({
45423
45499
  }) => {
45424
45500
  const { t } = useTranslate();
45425
45501
  const entityData = entity ?? [];
45426
- const items = React95__default.useMemo(() => {
45502
+ const items = React96__default.useMemo(() => {
45427
45503
  if (propItems) return propItems;
45428
45504
  if (entityData.length === 0) return [];
45429
45505
  return entityData.map((record, idx) => {
@@ -45525,7 +45601,7 @@ var init_Timeline = __esm({
45525
45601
  }
45526
45602
  });
45527
45603
  function extractToastProps(children) {
45528
- if (!React95__default.isValidElement(children)) {
45604
+ if (!React96__default.isValidElement(children)) {
45529
45605
  if (typeof children === "string") {
45530
45606
  return { message: children };
45531
45607
  }
@@ -45567,7 +45643,7 @@ var init_ToastSlot = __esm({
45567
45643
  eventBus.emit(`${prefix}CLOSE`);
45568
45644
  };
45569
45645
  if (!isVisible) return null;
45570
- const isCustomContent = React95__default.isValidElement(children) && !message;
45646
+ const isCustomContent = React96__default.isValidElement(children) && !message;
45571
45647
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
45572
45648
  Toast,
45573
45649
  {
@@ -45584,7 +45660,7 @@ var init_ToastSlot = __esm({
45584
45660
  }
45585
45661
  });
45586
45662
  function lazyThree(name, loader) {
45587
- const Lazy = React95__default.lazy(
45663
+ const Lazy = React96__default.lazy(
45588
45664
  () => loader().then((m) => {
45589
45665
  const Resolved = m[name];
45590
45666
  if (!Resolved) {
@@ -45596,13 +45672,13 @@ function lazyThree(name, loader) {
45596
45672
  })
45597
45673
  );
45598
45674
  function ThreeWrapper(props) {
45599
- return React95__default.createElement(
45675
+ return React96__default.createElement(
45600
45676
  ThreeBoundary,
45601
45677
  { name },
45602
- React95__default.createElement(
45603
- React95__default.Suspense,
45678
+ React96__default.createElement(
45679
+ React96__default.Suspense,
45604
45680
  { fallback: null },
45605
- React95__default.createElement(Lazy, props)
45681
+ React96__default.createElement(Lazy, props)
45606
45682
  )
45607
45683
  );
45608
45684
  }
@@ -45763,6 +45839,7 @@ var init_component_registry_generated = __esm({
45763
45839
  init_Navigation();
45764
45840
  init_NegotiatorBoard();
45765
45841
  init_NumberStepper();
45842
+ init_ObjectRulePanel();
45766
45843
  init_OptionConstraintGroup();
45767
45844
  init_OrbitalVisualization();
45768
45845
  init_Overlay();
@@ -45824,7 +45901,9 @@ var init_component_registry_generated = __esm({
45824
45901
  init_StatCard();
45825
45902
  init_StatDisplay();
45826
45903
  init_StateArchitectBoard();
45904
+ init_StateGraph();
45827
45905
  init_StateIndicator();
45906
+ init_StateJsonView();
45828
45907
  init_StateMachineView();
45829
45908
  init_StatsGrid();
45830
45909
  init_StatsOrganism();
@@ -45871,6 +45950,7 @@ var init_component_registry_generated = __esm({
45871
45950
  init_Typography();
45872
45951
  init_UISlotRenderer();
45873
45952
  init_UploadDropZone();
45953
+ init_VariablePanel();
45874
45954
  init_VersionDiff();
45875
45955
  init_ViolationAlert();
45876
45956
  init_VoteStack();
@@ -45878,7 +45958,7 @@ var init_component_registry_generated = __esm({
45878
45958
  init_WizardContainer();
45879
45959
  init_WizardNavigation();
45880
45960
  init_WizardProgress();
45881
- ThreeBoundary = class extends React95__default.Component {
45961
+ ThreeBoundary = class extends React96__default.Component {
45882
45962
  constructor() {
45883
45963
  super(...arguments);
45884
45964
  __publicField(this, "state", { failed: false });
@@ -45888,7 +45968,7 @@ var init_component_registry_generated = __esm({
45888
45968
  }
45889
45969
  render() {
45890
45970
  if (this.state.failed) {
45891
- return React95__default.createElement(
45971
+ return React96__default.createElement(
45892
45972
  "div",
45893
45973
  {
45894
45974
  "data-testid": "three-unavailable",
@@ -46071,6 +46151,7 @@ var init_component_registry_generated = __esm({
46071
46151
  "Navigation": Navigation,
46072
46152
  "NegotiatorBoard": NegotiatorBoard,
46073
46153
  "NumberStepper": NumberStepper,
46154
+ "ObjectRulePanel": ObjectRulePanel,
46074
46155
  "OptionConstraintGroup": OptionConstraintGroup,
46075
46156
  "OrbitalVisualization": OrbitalVisualization,
46076
46157
  "Overlay": Overlay,
@@ -46135,7 +46216,9 @@ var init_component_registry_generated = __esm({
46135
46216
  "StatCard": StatCard,
46136
46217
  "StatDisplay": StatDisplay,
46137
46218
  "StateArchitectBoard": StateArchitectBoard,
46219
+ "StateGraph": StateGraph,
46138
46220
  "StateIndicator": StateIndicator,
46221
+ "StateJsonView": StateJsonView,
46139
46222
  "StateMachineView": StateMachineView,
46140
46223
  "StatsGrid": StatsGrid,
46141
46224
  "StatsOrganism": StatsOrganism,
@@ -46183,6 +46266,7 @@ var init_component_registry_generated = __esm({
46183
46266
  "UISlotRenderer": UISlotRenderer,
46184
46267
  "UploadDropZone": UploadDropZone,
46185
46268
  "VStack": VStack,
46269
+ "VariablePanel": VariablePanel,
46186
46270
  "VersionDiff": VersionDiff,
46187
46271
  "ViolationAlert": ViolationAlert,
46188
46272
  "VoteStack": VoteStack,
@@ -46208,7 +46292,7 @@ function SuspenseConfigProvider({
46208
46292
  config,
46209
46293
  children
46210
46294
  }) {
46211
- return React95__default.createElement(
46295
+ return React96__default.createElement(
46212
46296
  SuspenseConfigContext.Provider,
46213
46297
  { value: config },
46214
46298
  children
@@ -46250,7 +46334,7 @@ function enrichFormFields(fields, entityDef) {
46250
46334
  }
46251
46335
  return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
46252
46336
  }
46253
- if (field && typeof field === "object" && !Array.isArray(field) && !React95__default.isValidElement(field) && !(field instanceof Date)) {
46337
+ if (field && typeof field === "object" && !Array.isArray(field) && !React96__default.isValidElement(field) && !(field instanceof Date)) {
46254
46338
  const obj = field;
46255
46339
  const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
46256
46340
  if (!fieldName) return field;
@@ -46703,7 +46787,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
46703
46787
  const key = `${parentId}-${index}-trait:${traitName}`;
46704
46788
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
46705
46789
  }
46706
- return /* @__PURE__ */ jsx(React95__default.Fragment, { children: child }, `${parentId}-${index}`);
46790
+ return /* @__PURE__ */ jsx(React96__default.Fragment, { children: child }, `${parentId}-${index}`);
46707
46791
  }
46708
46792
  if (!child || typeof child !== "object") return null;
46709
46793
  const childId = `${parentId}-${index}`;
@@ -46743,14 +46827,14 @@ function isPatternConfig(value) {
46743
46827
  if (value === null || value === void 0) return false;
46744
46828
  if (typeof value !== "object") return false;
46745
46829
  if (Array.isArray(value)) return false;
46746
- if (React95__default.isValidElement(value)) return false;
46830
+ if (React96__default.isValidElement(value)) return false;
46747
46831
  if (value instanceof Date) return false;
46748
46832
  if (typeof value === "function") return false;
46749
46833
  const record = value;
46750
46834
  return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
46751
46835
  }
46752
46836
  function isPlainConfigObject(value) {
46753
- if (React95__default.isValidElement(value)) return false;
46837
+ if (React96__default.isValidElement(value)) return false;
46754
46838
  if (value instanceof Date) return false;
46755
46839
  const proto = Object.getPrototypeOf(value);
46756
46840
  return proto === Object.prototype || proto === null;
@@ -46876,7 +46960,7 @@ function SlotContentRenderer({
46876
46960
  for (const slotKey of CONTENT_NODE_SLOTS) {
46877
46961
  const slotVal = restProps[slotKey];
46878
46962
  if (slotVal === void 0 || slotVal === null) continue;
46879
- if (React95__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
46963
+ if (React96__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
46880
46964
  if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
46881
46965
  nodeSlotOverrides[slotKey] = renderPatternChildren(
46882
46966
  slotVal,
@@ -46925,7 +47009,7 @@ function SlotContentRenderer({
46925
47009
  const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
46926
47010
  if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
46927
47011
  const sample = resolvedItems[0];
46928
- if (sample && typeof sample === "object" && !Array.isArray(sample) && !React95__default.isValidElement(sample) && !(sample instanceof Date)) {
47012
+ if (sample && typeof sample === "object" && !Array.isArray(sample) && !React96__default.isValidElement(sample) && !(sample instanceof Date)) {
46929
47013
  const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
46930
47014
  finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
46931
47015
  }
@@ -47217,7 +47301,7 @@ function resolveLambdaBindings(body, params, item, index) {
47217
47301
  if (Array.isArray(body)) {
47218
47302
  return body.map((b) => recur(b));
47219
47303
  }
47220
- if (body !== null && typeof body === "object" && !React95__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
47304
+ if (body !== null && typeof body === "object" && !React96__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
47221
47305
  const out = {};
47222
47306
  for (const [k, v] of Object.entries(body)) {
47223
47307
  out[k] = recur(v);
@@ -47236,7 +47320,7 @@ function getSlotContentRenderer2() {
47236
47320
  function makeLambdaFn(params, lambdaBody, callerKey) {
47237
47321
  return (item, index) => {
47238
47322
  const resolvedBody = resolveLambdaBindings(lambdaBody, params, item, index);
47239
- if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React95__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
47323
+ if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React96__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
47240
47324
  return null;
47241
47325
  }
47242
47326
  const record = resolvedBody;
@@ -47255,7 +47339,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
47255
47339
  props: childProps,
47256
47340
  priority: 0
47257
47341
  };
47258
- return React95__default.createElement(SlotContentRenderer2, { content: childContent });
47342
+ return React96__default.createElement(SlotContentRenderer2, { content: childContent });
47259
47343
  };
47260
47344
  }
47261
47345
  function convertNode(node, callerKey) {
@@ -47274,7 +47358,7 @@ function convertNode(node, callerKey) {
47274
47358
  });
47275
47359
  return anyChanged ? mapped : node;
47276
47360
  }
47277
- if (typeof node === "object" && !React95__default.isValidElement(node) && !(node instanceof Date)) {
47361
+ if (typeof node === "object" && !React96__default.isValidElement(node) && !(node instanceof Date)) {
47278
47362
  return convertObjectProps(node);
47279
47363
  }
47280
47364
  return node;