@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
package/dist/avl/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import * as React104 from 'react';
3
- import React104__default, { createContext, useState, useMemo, useRef, useEffect, useContext, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, useSyncExternalStore, lazy, useId } from 'react';
2
+ import * as React105 from 'react';
3
+ import React105__default, { createContext, useState, useMemo, useRef, useEffect, useContext, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, useSyncExternalStore, lazy, useId } from 'react';
4
4
  import { getAllPages, OrbitalProvider, EventBusContext, useTraitScope, ServerBridgeProvider, VerificationProvider, EntitySchemaProvider, OrbitalThemeProvider, useServerBridge, useEntitySchema, useEntitySchemaOptional, TraitScopeProvider, useCurrentPagePath } from '@almadar/ui/providers';
5
5
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
6
6
  import ELK from 'elkjs/lib/elk.bundled.js';
@@ -3174,7 +3174,7 @@ var init_Typography = __esm({
3174
3174
  }) => {
3175
3175
  const variant = variantProp ?? (level ? `h${level}` : "body1");
3176
3176
  const Component = as || defaultElements[variant];
3177
- return React104__default.createElement(
3177
+ return React105__default.createElement(
3178
3178
  Component,
3179
3179
  {
3180
3180
  id,
@@ -3511,7 +3511,7 @@ var init_Box = __esm({
3511
3511
  fixed: "fixed",
3512
3512
  sticky: "sticky"
3513
3513
  };
3514
- Box = React104__default.forwardRef(
3514
+ Box = React105__default.forwardRef(
3515
3515
  ({
3516
3516
  padding,
3517
3517
  paddingX,
@@ -3576,7 +3576,7 @@ var init_Box = __esm({
3576
3576
  onPointerDown?.(e);
3577
3577
  }, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
3578
3578
  const isClickable = action || onClick;
3579
- return React104__default.createElement(
3579
+ return React105__default.createElement(
3580
3580
  Component,
3581
3581
  {
3582
3582
  ref,
@@ -3672,7 +3672,7 @@ var init_Stack = __esm({
3672
3672
  };
3673
3673
  const isHorizontal = direction === "horizontal";
3674
3674
  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";
3675
- return React104__default.createElement(
3675
+ return React105__default.createElement(
3676
3676
  Component,
3677
3677
  {
3678
3678
  className: cn(
@@ -4164,7 +4164,7 @@ var init_MiniStateMachine = __esm({
4164
4164
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
4165
4165
  const tc = transitionCounts[s.name] ?? 0;
4166
4166
  const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
4167
- return /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
4167
+ return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
4168
4168
  /* @__PURE__ */ jsx(
4169
4169
  AvlState,
4170
4170
  {
@@ -4494,7 +4494,7 @@ function loadLib(key, importer) {
4494
4494
  return p;
4495
4495
  }
4496
4496
  function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
4497
- const Lazy = React104__default.lazy(async () => {
4497
+ const Lazy = React105__default.lazy(async () => {
4498
4498
  const lib = await loadLib(libKey, importer);
4499
4499
  const Comp = pick(lib);
4500
4500
  if (!Comp) {
@@ -4504,7 +4504,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
4504
4504
  return { default: Comp };
4505
4505
  });
4506
4506
  const Wrapped = (props) => /* @__PURE__ */ jsx(
4507
- React104__default.Suspense,
4507
+ React105__default.Suspense,
4508
4508
  {
4509
4509
  fallback: /* @__PURE__ */ jsx(
4510
4510
  "span",
@@ -5235,7 +5235,7 @@ var init_Icon = __esm({
5235
5235
  const directIcon = typeof icon === "string" ? void 0 : icon;
5236
5236
  const effectiveName = typeof icon === "string" ? icon : name;
5237
5237
  const family = useIconFamily();
5238
- const RenderedComponent = React104__default.useMemo(() => {
5238
+ const RenderedComponent = React105__default.useMemo(() => {
5239
5239
  if (directIcon) return null;
5240
5240
  return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
5241
5241
  }, [directIcon, effectiveName, family]);
@@ -5297,7 +5297,7 @@ function resolveIconProp(value, sizeClass) {
5297
5297
  const IconComp = value;
5298
5298
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
5299
5299
  }
5300
- if (React104__default.isValidElement(value)) {
5300
+ if (React105__default.isValidElement(value)) {
5301
5301
  return value;
5302
5302
  }
5303
5303
  if (typeof value === "object" && value !== null && isIconLike(value)) {
@@ -5373,7 +5373,7 @@ var init_Button = __esm({
5373
5373
  md: "h-icon-default w-icon-default",
5374
5374
  lg: "h-icon-default w-icon-default"
5375
5375
  };
5376
- Button = React104__default.forwardRef(
5376
+ Button = React105__default.forwardRef(
5377
5377
  ({
5378
5378
  className,
5379
5379
  variant = "primary",
@@ -5441,7 +5441,7 @@ var Dialog;
5441
5441
  var init_Dialog = __esm({
5442
5442
  "components/core/atoms/Dialog.tsx"() {
5443
5443
  init_cn();
5444
- Dialog = React104__default.forwardRef(
5444
+ Dialog = React105__default.forwardRef(
5445
5445
  ({
5446
5446
  role = "dialog",
5447
5447
  "aria-modal": ariaModal = true,
@@ -5936,7 +5936,7 @@ var init_Badge = __esm({
5936
5936
  md: "px-2.5 py-1 text-sm",
5937
5937
  lg: "px-3 py-1.5 text-base"
5938
5938
  };
5939
- Badge = React104__default.forwardRef(
5939
+ Badge = React105__default.forwardRef(
5940
5940
  ({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
5941
5941
  const iconSizes3 = {
5942
5942
  sm: "h-icon-default w-icon-default",
@@ -6273,7 +6273,7 @@ var init_SvgFlow = __esm({
6273
6273
  width = 100,
6274
6274
  height = 100
6275
6275
  }) => {
6276
- const markerId = React104__default.useMemo(() => {
6276
+ const markerId = React105__default.useMemo(() => {
6277
6277
  flowIdCounter += 1;
6278
6278
  return `almadar-flow-arrow-${flowIdCounter}`;
6279
6279
  }, []);
@@ -6866,7 +6866,7 @@ var init_SvgRing = __esm({
6866
6866
  width = 100,
6867
6867
  height = 100
6868
6868
  }) => {
6869
- const gradientId = React104__default.useMemo(() => {
6869
+ const gradientId = React105__default.useMemo(() => {
6870
6870
  ringIdCounter += 1;
6871
6871
  return `almadar-ring-glow-${ringIdCounter}`;
6872
6872
  }, []);
@@ -7047,7 +7047,7 @@ var init_Input = __esm({
7047
7047
  init_cn();
7048
7048
  init_Icon();
7049
7049
  init_useEventBus();
7050
- Input = React104__default.forwardRef(
7050
+ Input = React105__default.forwardRef(
7051
7051
  ({
7052
7052
  className,
7053
7053
  inputType,
@@ -7207,7 +7207,7 @@ var Label;
7207
7207
  var init_Label = __esm({
7208
7208
  "components/core/atoms/Label.tsx"() {
7209
7209
  init_cn();
7210
- Label = React104__default.forwardRef(
7210
+ Label = React105__default.forwardRef(
7211
7211
  ({ className, required, children, ...props }, ref) => {
7212
7212
  return /* @__PURE__ */ jsxs(
7213
7213
  "label",
@@ -7234,7 +7234,7 @@ var init_Textarea = __esm({
7234
7234
  "components/core/atoms/Textarea.tsx"() {
7235
7235
  init_cn();
7236
7236
  init_useEventBus();
7237
- Textarea = React104__default.forwardRef(
7237
+ Textarea = React105__default.forwardRef(
7238
7238
  ({ className, error, onChange, ...props }, ref) => {
7239
7239
  const eventBus = useEventBus();
7240
7240
  const handleChange = (e) => {
@@ -7473,7 +7473,7 @@ var init_Select = __esm({
7473
7473
  init_cn();
7474
7474
  init_Icon();
7475
7475
  init_useEventBus();
7476
- Select = React104__default.forwardRef(
7476
+ Select = React105__default.forwardRef(
7477
7477
  (props, _ref) => {
7478
7478
  const { multiple, searchable, clearable } = props;
7479
7479
  if (multiple || searchable || clearable) {
@@ -7490,7 +7490,7 @@ var init_Checkbox = __esm({
7490
7490
  "components/core/atoms/Checkbox.tsx"() {
7491
7491
  init_cn();
7492
7492
  init_useEventBus();
7493
- Checkbox = React104__default.forwardRef(
7493
+ Checkbox = React105__default.forwardRef(
7494
7494
  ({ className, label, id, onChange, ...props }, ref) => {
7495
7495
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
7496
7496
  const eventBus = useEventBus();
@@ -7544,7 +7544,7 @@ var init_Spinner = __esm({
7544
7544
  md: "h-6 w-6",
7545
7545
  lg: "h-8 w-8"
7546
7546
  };
7547
- Spinner = React104__default.forwardRef(
7547
+ Spinner = React105__default.forwardRef(
7548
7548
  ({ className, size = "md", overlay, ...props }, ref) => {
7549
7549
  if (overlay) {
7550
7550
  return /* @__PURE__ */ jsx(
@@ -7634,7 +7634,7 @@ var init_Card = __esm({
7634
7634
  chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
7635
7635
  "tile-image-first": "p-0 overflow-hidden"
7636
7636
  };
7637
- Card = React104__default.forwardRef(
7637
+ Card = React105__default.forwardRef(
7638
7638
  ({
7639
7639
  className,
7640
7640
  variant = "bordered",
@@ -7682,9 +7682,9 @@ var init_Card = __esm({
7682
7682
  }
7683
7683
  );
7684
7684
  Card.displayName = "Card";
7685
- CardHeader = React104__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
7685
+ CardHeader = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
7686
7686
  CardHeader.displayName = "CardHeader";
7687
- CardTitle = React104__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7687
+ CardTitle = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7688
7688
  "h3",
7689
7689
  {
7690
7690
  ref,
@@ -7697,11 +7697,11 @@ var init_Card = __esm({
7697
7697
  }
7698
7698
  ));
7699
7699
  CardTitle.displayName = "CardTitle";
7700
- CardContent = React104__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
7700
+ CardContent = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
7701
7701
  CardContent.displayName = "CardContent";
7702
7702
  CardBody = CardContent;
7703
7703
  CardBody.displayName = "CardBody";
7704
- CardFooter = React104__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7704
+ CardFooter = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
7705
7705
  "div",
7706
7706
  {
7707
7707
  ref,
@@ -7756,7 +7756,7 @@ var init_FilterPill = __esm({
7756
7756
  md: "w-3.5 h-3.5",
7757
7757
  lg: "w-4 h-4"
7758
7758
  };
7759
- FilterPill = React104__default.forwardRef(
7759
+ FilterPill = React105__default.forwardRef(
7760
7760
  ({
7761
7761
  className,
7762
7762
  variant = "default",
@@ -7885,8 +7885,8 @@ var init_Avatar = __esm({
7885
7885
  actionPayload
7886
7886
  }) => {
7887
7887
  const eventBus = useEventBus();
7888
- const [imgFailed, setImgFailed] = React104__default.useState(false);
7889
- React104__default.useEffect(() => {
7888
+ const [imgFailed, setImgFailed] = React105__default.useState(false);
7889
+ React105__default.useEffect(() => {
7890
7890
  setImgFailed(false);
7891
7891
  }, [src]);
7892
7892
  const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
@@ -7999,7 +7999,7 @@ var init_Center = __esm({
7999
7999
  as: Component = "div"
8000
8000
  }) => {
8001
8001
  const mergedStyle = minHeight ? { minHeight, ...style } : style;
8002
- return React104__default.createElement(Component, {
8002
+ return React105__default.createElement(Component, {
8003
8003
  className: cn(
8004
8004
  inline ? "inline-flex" : "flex",
8005
8005
  horizontal && "justify-center",
@@ -8267,7 +8267,7 @@ var init_Radio = __esm({
8267
8267
  md: "w-2.5 h-2.5",
8268
8268
  lg: "w-3 h-3"
8269
8269
  };
8270
- Radio = React104__default.forwardRef(
8270
+ Radio = React105__default.forwardRef(
8271
8271
  ({
8272
8272
  label,
8273
8273
  helperText,
@@ -8284,12 +8284,12 @@ var init_Radio = __esm({
8284
8284
  onChange,
8285
8285
  ...props
8286
8286
  }, ref) => {
8287
- const reactId = React104__default.useId();
8287
+ const reactId = React105__default.useId();
8288
8288
  const baseId = id || `radio-${reactId}`;
8289
8289
  const hasError = !!error;
8290
8290
  const eventBus = useEventBus();
8291
- const [selected, setSelected] = React104__default.useState(value);
8292
- React104__default.useEffect(() => {
8291
+ const [selected, setSelected] = React105__default.useState(value);
8292
+ React105__default.useEffect(() => {
8293
8293
  if (value !== void 0) setSelected(value);
8294
8294
  }, [value]);
8295
8295
  const pick = (next, e) => {
@@ -8471,7 +8471,7 @@ var init_Switch = __esm({
8471
8471
  "components/core/atoms/Switch.tsx"() {
8472
8472
  "use client";
8473
8473
  init_cn();
8474
- Switch = React104.forwardRef(
8474
+ Switch = React105.forwardRef(
8475
8475
  ({
8476
8476
  checked,
8477
8477
  defaultChecked = false,
@@ -8482,10 +8482,10 @@ var init_Switch = __esm({
8482
8482
  name,
8483
8483
  className
8484
8484
  }, ref) => {
8485
- const [isChecked, setIsChecked] = React104.useState(
8485
+ const [isChecked, setIsChecked] = React105.useState(
8486
8486
  checked !== void 0 ? checked : defaultChecked
8487
8487
  );
8488
- React104.useEffect(() => {
8488
+ React105.useEffect(() => {
8489
8489
  if (checked !== void 0) {
8490
8490
  setIsChecked(checked);
8491
8491
  }
@@ -8763,7 +8763,7 @@ var Aside;
8763
8763
  var init_Aside = __esm({
8764
8764
  "components/core/atoms/Aside.tsx"() {
8765
8765
  init_cn();
8766
- Aside = React104__default.forwardRef(
8766
+ Aside = React105__default.forwardRef(
8767
8767
  ({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
8768
8768
  );
8769
8769
  Aside.displayName = "Aside";
@@ -8842,9 +8842,9 @@ var init_LawReferenceTooltip = __esm({
8842
8842
  className
8843
8843
  }) => {
8844
8844
  const { t } = useTranslate();
8845
- const [isVisible, setIsVisible] = React104__default.useState(false);
8846
- const timeoutRef = React104__default.useRef(null);
8847
- const triggerRef = React104__default.useRef(null);
8845
+ const [isVisible, setIsVisible] = React105__default.useState(false);
8846
+ const timeoutRef = React105__default.useRef(null);
8847
+ const triggerRef = React105__default.useRef(null);
8848
8848
  const handleMouseEnter = () => {
8849
8849
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
8850
8850
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -8855,7 +8855,7 @@ var init_LawReferenceTooltip = __esm({
8855
8855
  };
8856
8856
  const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
8857
8857
  const open = isVisible || revealed;
8858
- React104__default.useEffect(() => {
8858
+ React105__default.useEffect(() => {
8859
8859
  return () => {
8860
8860
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
8861
8861
  };
@@ -9065,7 +9065,7 @@ var init_StatusDot = __esm({
9065
9065
  md: "w-2.5 h-2.5",
9066
9066
  lg: "w-3 h-3"
9067
9067
  };
9068
- StatusDot = React104__default.forwardRef(
9068
+ StatusDot = React105__default.forwardRef(
9069
9069
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
9070
9070
  return /* @__PURE__ */ jsx(
9071
9071
  "span",
@@ -9119,7 +9119,7 @@ var init_TrendIndicator = __esm({
9119
9119
  down: "trending-down",
9120
9120
  flat: "arrow-right"
9121
9121
  };
9122
- TrendIndicator = React104__default.forwardRef(
9122
+ TrendIndicator = React105__default.forwardRef(
9123
9123
  ({
9124
9124
  className,
9125
9125
  value,
@@ -9186,7 +9186,7 @@ var init_RangeSlider = __esm({
9186
9186
  md: "w-4 h-4",
9187
9187
  lg: "w-5 h-5"
9188
9188
  };
9189
- RangeSlider = React104__default.forwardRef(
9189
+ RangeSlider = React105__default.forwardRef(
9190
9190
  ({
9191
9191
  className,
9192
9192
  min = 0,
@@ -9780,7 +9780,7 @@ var init_ContentSection = __esm({
9780
9780
  md: "py-16",
9781
9781
  lg: "py-24"
9782
9782
  };
9783
- ContentSection = React104__default.forwardRef(
9783
+ ContentSection = React105__default.forwardRef(
9784
9784
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
9785
9785
  return /* @__PURE__ */ jsx(
9786
9786
  Box,
@@ -10314,7 +10314,7 @@ var init_AnimatedReveal = __esm({
10314
10314
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
10315
10315
  "none": {}
10316
10316
  };
10317
- AnimatedReveal = React104__default.forwardRef(
10317
+ AnimatedReveal = React105__default.forwardRef(
10318
10318
  ({
10319
10319
  trigger = "scroll",
10320
10320
  animation = "fade-up",
@@ -10474,7 +10474,7 @@ var init_AnimatedGraphic = __esm({
10474
10474
  "components/marketing/atoms/AnimatedGraphic.tsx"() {
10475
10475
  "use client";
10476
10476
  init_cn();
10477
- AnimatedGraphic = React104__default.forwardRef(
10477
+ AnimatedGraphic = React105__default.forwardRef(
10478
10478
  ({
10479
10479
  src,
10480
10480
  svgContent,
@@ -10497,7 +10497,7 @@ var init_AnimatedGraphic = __esm({
10497
10497
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
10498
10498
  const resolvedSvg = svgContent ?? fetchedSvg;
10499
10499
  const prevAnimateRef = useRef(animate);
10500
- const setRef = React104__default.useCallback(
10500
+ const setRef = React105__default.useCallback(
10501
10501
  (node) => {
10502
10502
  containerRef.current = node;
10503
10503
  if (typeof ref === "function") ref(node);
@@ -11104,7 +11104,7 @@ function GameCard({
11104
11104
  className
11105
11105
  }) {
11106
11106
  const eventBus = useEventBus();
11107
- const handleClick = React104.useCallback(() => {
11107
+ const handleClick = React105.useCallback(() => {
11108
11108
  if (disabled) return;
11109
11109
  onClick?.(id);
11110
11110
  if (clickEvent) eventBus.emit(`UI:${clickEvent}`, { cardId: id });
@@ -11386,9 +11386,9 @@ function ControlButton({
11386
11386
  className
11387
11387
  }) {
11388
11388
  const eventBus = useEventBus();
11389
- const [isPressed, setIsPressed] = React104.useState(false);
11389
+ const [isPressed, setIsPressed] = React105.useState(false);
11390
11390
  const actualPressed = pressed ?? isPressed;
11391
- const handlePointerDown = React104.useCallback(
11391
+ const handlePointerDown = React105.useCallback(
11392
11392
  (e) => {
11393
11393
  e.preventDefault();
11394
11394
  if (disabled) return;
@@ -11398,7 +11398,7 @@ function ControlButton({
11398
11398
  },
11399
11399
  [disabled, pressEvent, eventBus, onPress]
11400
11400
  );
11401
- const handlePointerUp = React104.useCallback(
11401
+ const handlePointerUp = React105.useCallback(
11402
11402
  (e) => {
11403
11403
  e.preventDefault();
11404
11404
  if (disabled) return;
@@ -11408,7 +11408,7 @@ function ControlButton({
11408
11408
  },
11409
11409
  [disabled, releaseEvent, eventBus, onRelease]
11410
11410
  );
11411
- const handlePointerLeave = React104.useCallback(
11411
+ const handlePointerLeave = React105.useCallback(
11412
11412
  (e) => {
11413
11413
  if (isPressed) {
11414
11414
  setIsPressed(false);
@@ -12427,8 +12427,8 @@ function MiniMap({
12427
12427
  tileAssets,
12428
12428
  unitAssets
12429
12429
  }) {
12430
- const canvasRef = React104.useRef(null);
12431
- const imgCacheRef = React104.useRef(/* @__PURE__ */ new Map());
12430
+ const canvasRef = React105.useRef(null);
12431
+ const imgCacheRef = React105.useRef(/* @__PURE__ */ new Map());
12432
12432
  function loadImg(url) {
12433
12433
  const cached = imgCacheRef.current.get(url);
12434
12434
  if (cached) return cached.complete ? cached : null;
@@ -12443,7 +12443,7 @@ function MiniMap({
12443
12443
  imgCacheRef.current.set(url, img);
12444
12444
  return null;
12445
12445
  }
12446
- React104.useEffect(() => {
12446
+ React105.useEffect(() => {
12447
12447
  const canvas = canvasRef.current;
12448
12448
  if (!canvas) return;
12449
12449
  const ctx = canvas.getContext("2d");
@@ -12578,8 +12578,8 @@ function ControlGrid({
12578
12578
  className
12579
12579
  }) {
12580
12580
  const eventBus = useEventBus();
12581
- const [active, setActive] = React104.useState(/* @__PURE__ */ new Set());
12582
- const handlePress = React104.useCallback(
12581
+ const [active, setActive] = React105.useState(/* @__PURE__ */ new Set());
12582
+ const handlePress = React105.useCallback(
12583
12583
  (id) => {
12584
12584
  setActive((prev) => new Set(prev).add(id));
12585
12585
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -12593,7 +12593,7 @@ function ControlGrid({
12593
12593
  },
12594
12594
  [kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
12595
12595
  );
12596
- const handleRelease = React104.useCallback(
12596
+ const handleRelease = React105.useCallback(
12597
12597
  (id) => {
12598
12598
  setActive((prev) => {
12599
12599
  const next = new Set(prev);
@@ -12851,7 +12851,7 @@ function InventoryGrid({
12851
12851
  const eventBus = useEventBus();
12852
12852
  const slotCount = totalSlots ?? items.length;
12853
12853
  const emptySlotCount = Math.max(0, slotCount - items.length);
12854
- const handleSelect = React104.useCallback(
12854
+ const handleSelect = React105.useCallback(
12855
12855
  (id) => {
12856
12856
  onSelect?.(id);
12857
12857
  if (selectEvent) {
@@ -13068,7 +13068,7 @@ function GameMenu({
13068
13068
  }) {
13069
13069
  const resolvedOptions = options ?? menuItems ?? DEFAULT_MENU_OPTIONS;
13070
13070
  const eventBus = useEventBus();
13071
- const handleOptionClick = React104.useCallback(
13071
+ const handleOptionClick = React105.useCallback(
13072
13072
  (option) => {
13073
13073
  if (option.event) {
13074
13074
  eventBus.emit(`UI:${option.event}`, { option });
@@ -13145,6 +13145,214 @@ var init_GameMenu = __esm({
13145
13145
  GameMenu.displayName = "GameMenu";
13146
13146
  }
13147
13147
  });
13148
+ function StateNode({
13149
+ name,
13150
+ isCurrent = false,
13151
+ isSelected = false,
13152
+ isInitial = false,
13153
+ position,
13154
+ onClick,
13155
+ className
13156
+ }) {
13157
+ return /* @__PURE__ */ jsx(
13158
+ Box,
13159
+ {
13160
+ position: "absolute",
13161
+ display: "flex",
13162
+ className: cn(
13163
+ "items-center justify-center rounded-pill border-3 transition-all cursor-pointer select-none",
13164
+ "min-w-[80px] h-[80px] px-3",
13165
+ isCurrent && "bg-primary/20 border-primary shadow-lg shadow-primary/30 scale-110",
13166
+ isSelected && !isCurrent && "bg-accent/20 border-accent ring-2 ring-accent/50",
13167
+ !isCurrent && !isSelected && "bg-card border-border hover:border-muted-foreground hover:scale-105",
13168
+ className
13169
+ ),
13170
+ style: {
13171
+ left: position.x,
13172
+ top: position.y,
13173
+ transform: "translate(-50%, -50%)"
13174
+ },
13175
+ onClick,
13176
+ children: /* @__PURE__ */ jsxs(Box, { className: "text-center", children: [
13177
+ isInitial && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground text-xs block", children: "\u25B6 start" }),
13178
+ /* @__PURE__ */ jsx(
13179
+ Typography,
13180
+ {
13181
+ variant: "body2",
13182
+ className: cn(
13183
+ "font-bold whitespace-nowrap",
13184
+ isCurrent ? "text-primary" : "text-foreground"
13185
+ ),
13186
+ children: name
13187
+ }
13188
+ )
13189
+ ] })
13190
+ }
13191
+ );
13192
+ }
13193
+ var init_StateNode = __esm({
13194
+ "components/game/2d/molecules/StateNode.tsx"() {
13195
+ init_atoms();
13196
+ init_cn();
13197
+ StateNode.displayName = "StateNode";
13198
+ }
13199
+ });
13200
+ function TransitionArrow({
13201
+ from,
13202
+ to,
13203
+ eventLabel,
13204
+ guardHint,
13205
+ isActive = false,
13206
+ onClick,
13207
+ className
13208
+ }) {
13209
+ const dx = to.x - from.x;
13210
+ const dy = to.y - from.y;
13211
+ const dist = Math.sqrt(dx * dx + dy * dy);
13212
+ if (dist === 0) return /* @__PURE__ */ jsx(Fragment, {});
13213
+ const nx = dx / dist;
13214
+ const ny = dy / dist;
13215
+ const startX = from.x + nx * NODE_RADIUS;
13216
+ const startY = from.y + ny * NODE_RADIUS;
13217
+ const endX = to.x - nx * NODE_RADIUS;
13218
+ const endY = to.y - ny * NODE_RADIUS;
13219
+ const midX = (startX + endX) / 2;
13220
+ const midY = (startY + endY) / 2;
13221
+ const perpX = -ny * 20;
13222
+ const perpY = nx * 20;
13223
+ const ctrlX = midX + perpX;
13224
+ const ctrlY = midY + perpY;
13225
+ const path = `M ${startX} ${startY} Q ${ctrlX} ${ctrlY} ${endX} ${endY}`;
13226
+ return /* @__PURE__ */ jsxs("g", { className: cn("cursor-pointer", className), onClick, children: [
13227
+ /* @__PURE__ */ jsx(
13228
+ "path",
13229
+ {
13230
+ d: path,
13231
+ fill: "none",
13232
+ stroke: isActive ? "var(--color-primary)" : "var(--color-border)",
13233
+ strokeWidth: isActive ? 3 : 2,
13234
+ markerEnd: isActive ? "url(#arrowhead-active)" : "url(#arrowhead)"
13235
+ }
13236
+ ),
13237
+ /* @__PURE__ */ jsx(
13238
+ "text",
13239
+ {
13240
+ x: ctrlX,
13241
+ y: ctrlY - 8,
13242
+ textAnchor: "middle",
13243
+ fill: isActive ? "var(--color-primary)" : "var(--color-foreground)",
13244
+ fontSize: 12,
13245
+ fontWeight: isActive ? "bold" : "normal",
13246
+ className: "select-none",
13247
+ children: eventLabel
13248
+ }
13249
+ ),
13250
+ guardHint && /* @__PURE__ */ jsx(
13251
+ "text",
13252
+ {
13253
+ x: ctrlX,
13254
+ y: ctrlY + 6,
13255
+ textAnchor: "middle",
13256
+ fill: "var(--color-warning)",
13257
+ fontSize: 10,
13258
+ className: "select-none",
13259
+ children: "\u26A0 " + guardHint
13260
+ }
13261
+ )
13262
+ ] });
13263
+ }
13264
+ var NODE_RADIUS;
13265
+ var init_TransitionArrow = __esm({
13266
+ "components/game/2d/molecules/TransitionArrow.tsx"() {
13267
+ init_cn();
13268
+ NODE_RADIUS = 40;
13269
+ TransitionArrow.displayName = "TransitionArrow";
13270
+ }
13271
+ });
13272
+ function layoutStates(states, width, height) {
13273
+ const cx = width / 2;
13274
+ const cy = height / 2;
13275
+ const radius = Math.min(cx, cy) - 60;
13276
+ const positions = {};
13277
+ states.forEach((state, i) => {
13278
+ const angle = 2 * Math.PI * i / Math.max(states.length, 1) - Math.PI / 2;
13279
+ positions[state] = { x: cx + radius * Math.cos(angle), y: cy + radius * Math.sin(angle) };
13280
+ });
13281
+ return positions;
13282
+ }
13283
+ function StateGraph({
13284
+ states,
13285
+ transitions = [],
13286
+ currentState,
13287
+ selectedState,
13288
+ addingFrom,
13289
+ initialState,
13290
+ width = 500,
13291
+ height = 400,
13292
+ nodeClickEvent,
13293
+ className
13294
+ }) {
13295
+ const eventBus = useEventBus();
13296
+ const nodes = states ?? [];
13297
+ const positions = React105.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
13298
+ return /* @__PURE__ */ jsxs(
13299
+ Box,
13300
+ {
13301
+ position: "relative",
13302
+ className: cn("rounded-container border border-border bg-background overflow-hidden", className),
13303
+ style: { width, height },
13304
+ children: [
13305
+ /* @__PURE__ */ jsxs("svg", { width, height, className: "absolute inset-0", style: { pointerEvents: "none" }, children: [
13306
+ /* @__PURE__ */ jsxs("defs", { children: [
13307
+ /* @__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)" }) }),
13308
+ /* @__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)" }) })
13309
+ ] }),
13310
+ transitions.map((tr, i) => {
13311
+ const fromPos = positions[tr.from];
13312
+ const toPos = positions[tr.to];
13313
+ if (!fromPos || !toPos) return null;
13314
+ return /* @__PURE__ */ jsx(
13315
+ TransitionArrow,
13316
+ {
13317
+ from: fromPos,
13318
+ to: toPos,
13319
+ eventLabel: tr.event,
13320
+ guardHint: tr.guardHint,
13321
+ isActive: tr.from === currentState
13322
+ },
13323
+ `${tr.from}-${tr.event}-${tr.to}-${i}`
13324
+ );
13325
+ })
13326
+ ] }),
13327
+ nodes.map((state) => {
13328
+ const pos = positions[state];
13329
+ if (!pos) return null;
13330
+ return /* @__PURE__ */ jsx(
13331
+ StateNode,
13332
+ {
13333
+ name: state,
13334
+ position: pos,
13335
+ isCurrent: state === currentState,
13336
+ isSelected: state === selectedState || state === addingFrom,
13337
+ isInitial: state === initialState,
13338
+ onClick: nodeClickEvent ? () => eventBus.emit(`UI:${nodeClickEvent}`, { stateId: state }) : void 0
13339
+ },
13340
+ state
13341
+ );
13342
+ })
13343
+ ]
13344
+ }
13345
+ );
13346
+ }
13347
+ var init_StateGraph = __esm({
13348
+ "components/game/2d/molecules/StateGraph.tsx"() {
13349
+ init_atoms();
13350
+ init_cn();
13351
+ init_useEventBus();
13352
+ init_StateNode();
13353
+ init_TransitionArrow();
13354
+ }
13355
+ });
13148
13356
  function useCamera() {
13149
13357
  const cameraRef = useRef({ x: 0, y: 0, zoom: 1 });
13150
13358
  const targetCameraRef = useRef(null);
@@ -14742,7 +14950,7 @@ function LinearView({
14742
14950
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
14743
14951
  const isDone = i < currentIdx;
14744
14952
  const isCurrent = i === currentIdx;
14745
- return /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
14953
+ return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
14746
14954
  i > 0 && /* @__PURE__ */ jsx(
14747
14955
  Typography,
14748
14956
  {
@@ -14939,7 +15147,7 @@ function TraitStateViewer({
14939
15147
  }
14940
15148
  var SIZE_CONFIG;
14941
15149
  var init_TraitStateViewer = __esm({
14942
- "components/game/2d/organisms/TraitStateViewer.tsx"() {
15150
+ "components/game/2d/molecules/TraitStateViewer.tsx"() {
14943
15151
  "use client";
14944
15152
  init_cn();
14945
15153
  init_Box();
@@ -14972,7 +15180,8 @@ function TraitSlot({
14972
15180
  onClick,
14973
15181
  onRemove,
14974
15182
  clickEvent,
14975
- removeEvent
15183
+ removeEvent,
15184
+ dropEvent
14976
15185
  }) {
14977
15186
  const { emit } = useEventBus();
14978
15187
  const [isHovered, setIsHovered] = useState(false);
@@ -15004,29 +15213,30 @@ function TraitSlot({
15004
15213
  onDragStart?.(equippedItem);
15005
15214
  }, [equippedItem, draggable, onDragStart]);
15006
15215
  const handleDragOver = useCallback((e) => {
15007
- if (locked || !onItemDrop) return;
15216
+ if (locked || !onItemDrop && !dropEvent) return;
15008
15217
  if (e.dataTransfer.types.includes(DRAG_MIME)) {
15009
15218
  e.preventDefault();
15010
15219
  const allowed = e.dataTransfer.effectAllowed;
15011
15220
  e.dataTransfer.dropEffect = allowed === "copy" ? "copy" : "move";
15012
15221
  setIsDragOver(true);
15013
15222
  }
15014
- }, [locked, onItemDrop]);
15223
+ }, [locked, onItemDrop, dropEvent]);
15015
15224
  const handleDragLeave = useCallback(() => {
15016
15225
  setIsDragOver(false);
15017
15226
  }, []);
15018
15227
  const handleDrop = useCallback((e) => {
15019
15228
  e.preventDefault();
15020
15229
  setIsDragOver(false);
15021
- if (locked || !onItemDrop) return;
15230
+ if (locked || !onItemDrop && !dropEvent) return;
15022
15231
  const raw = e.dataTransfer.getData(DRAG_MIME);
15023
15232
  if (!raw) return;
15024
15233
  try {
15025
15234
  const item = JSON.parse(raw);
15026
- onItemDrop(item);
15235
+ if (dropEvent) emit(`UI:${dropEvent}`, { slotNumber, itemId: item.id });
15236
+ else onItemDrop?.(item);
15027
15237
  } catch {
15028
15238
  }
15029
- }, [locked, onItemDrop]);
15239
+ }, [locked, onItemDrop, dropEvent, emit, slotNumber]);
15030
15240
  const getTooltipStyle = () => {
15031
15241
  if (!slotRef.current) return {};
15032
15242
  const rect = slotRef.current.getBoundingClientRect();
@@ -15146,7 +15356,7 @@ function TraitSlot({
15146
15356
  }
15147
15357
  var SIZE_CONFIG2, DRAG_MIME;
15148
15358
  var init_TraitSlot = __esm({
15149
- "components/game/2d/organisms/TraitSlot.tsx"() {
15359
+ "components/game/2d/molecules/TraitSlot.tsx"() {
15150
15360
  "use client";
15151
15361
  init_cn();
15152
15362
  init_useEventBus();
@@ -15205,7 +15415,7 @@ function ActionTile({
15205
15415
  }
15206
15416
  var DRAG_MIME2, SIZE_CONFIG3;
15207
15417
  var init_ActionTile = __esm({
15208
- "components/game/2d/organisms/ActionTile.tsx"() {
15418
+ "components/game/2d/molecules/ActionTile.tsx"() {
15209
15419
  init_atoms();
15210
15420
  init_cn();
15211
15421
  DRAG_MIME2 = "application/x-almadar-slot-item";
@@ -15242,7 +15452,7 @@ function ActionPalette({
15242
15452
  ] });
15243
15453
  }
15244
15454
  var init_ActionPalette = __esm({
15245
- "components/game/2d/organisms/ActionPalette.tsx"() {
15455
+ "components/game/2d/molecules/ActionPalette.tsx"() {
15246
15456
  init_atoms();
15247
15457
  init_cn();
15248
15458
  init_ActionTile();
@@ -15270,7 +15480,7 @@ function SequenceBar({
15270
15480
  onSlotRemove(index);
15271
15481
  }, [onSlotRemove, playing]);
15272
15482
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
15273
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
15483
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
15274
15484
  i > 0 && /* @__PURE__ */ jsx(
15275
15485
  Typography,
15276
15486
  {
@@ -15618,7 +15828,7 @@ function RuleEditor({
15618
15828
  ] });
15619
15829
  }
15620
15830
  var init_RuleEditor = __esm({
15621
- "components/game/2d/organisms/RuleEditor.tsx"() {
15831
+ "components/game/2d/molecules/RuleEditor.tsx"() {
15622
15832
  init_atoms();
15623
15833
  init_cn();
15624
15834
  RuleEditor.displayName = "RuleEditor";
@@ -15659,7 +15869,7 @@ function EventLog({
15659
15869
  }
15660
15870
  var STATUS_STYLES, STATUS_DOTS;
15661
15871
  var init_EventLog = __esm({
15662
- "components/game/2d/organisms/EventLog.tsx"() {
15872
+ "components/game/2d/molecules/EventLog.tsx"() {
15663
15873
  init_atoms();
15664
15874
  init_cn();
15665
15875
  STATUS_STYLES = {
@@ -15714,10 +15924,12 @@ var init_puzzleObject = __esm({
15714
15924
  function ObjectRulePanel({
15715
15925
  object,
15716
15926
  onRulesChange,
15927
+ rulesChangeEvent,
15717
15928
  disabled = false,
15718
15929
  className
15719
15930
  }) {
15720
15931
  const { t } = useTranslate();
15932
+ const { emit } = useEventBus();
15721
15933
  const id = objId(object);
15722
15934
  const name = objName(object);
15723
15935
  const icon = objIcon(object);
@@ -15728,15 +15940,19 @@ function ObjectRulePanel({
15728
15940
  const rules = objRules(object);
15729
15941
  const maxRules = objMaxRules(object);
15730
15942
  const canAdd = rules.length < maxRules;
15943
+ const emitRules = useCallback((newRules) => {
15944
+ if (rulesChangeEvent) emit(`UI:${rulesChangeEvent}`, { objectId: id, rules: newRules });
15945
+ else onRulesChange?.(id, newRules);
15946
+ }, [rulesChangeEvent, emit, id, onRulesChange]);
15731
15947
  const handleRuleChange = useCallback((index, updatedRule) => {
15732
15948
  const newRules = [...rules];
15733
15949
  newRules[index] = updatedRule;
15734
- onRulesChange(id, newRules);
15735
- }, [id, rules, onRulesChange]);
15950
+ emitRules(newRules);
15951
+ }, [rules, emitRules]);
15736
15952
  const handleRuleRemove = useCallback((index) => {
15737
15953
  const newRules = rules.filter((_, i) => i !== index);
15738
- onRulesChange(id, newRules);
15739
- }, [id, rules, onRulesChange]);
15954
+ emitRules(newRules);
15955
+ }, [rules, emitRules]);
15740
15956
  const handleAddRule = useCallback(() => {
15741
15957
  if (!canAdd || disabled) return;
15742
15958
  const firstEvent = availableEvents[0]?.value || "";
@@ -15746,8 +15962,8 @@ function ObjectRulePanel({
15746
15962
  whenEvent: firstEvent,
15747
15963
  thenAction: firstAction
15748
15964
  };
15749
- onRulesChange(id, [...rules, newRule]);
15750
- }, [canAdd, disabled, id, rules, availableEvents, availableActions, onRulesChange]);
15965
+ emitRules([...rules, newRule]);
15966
+ }, [canAdd, disabled, rules, availableEvents, availableActions, emitRules]);
15751
15967
  const machine = {
15752
15968
  name,
15753
15969
  states,
@@ -15787,9 +16003,10 @@ function ObjectRulePanel({
15787
16003
  }
15788
16004
  var nextRuleId;
15789
16005
  var init_ObjectRulePanel = __esm({
15790
- "components/game/2d/organisms/ObjectRulePanel.tsx"() {
16006
+ "components/game/2d/molecules/ObjectRulePanel.tsx"() {
15791
16007
  init_atoms();
15792
16008
  init_cn();
16009
+ init_useEventBus();
15793
16010
  init_TraitStateViewer();
15794
16011
  init_RuleEditor();
15795
16012
  init_puzzleObject();
@@ -16011,130 +16228,6 @@ var init_EventHandlerBoard = __esm({
16011
16228
  EventHandlerBoard.displayName = "EventHandlerBoard";
16012
16229
  }
16013
16230
  });
16014
- function StateNode({
16015
- name,
16016
- isCurrent = false,
16017
- isSelected = false,
16018
- isInitial = false,
16019
- position,
16020
- onClick,
16021
- className
16022
- }) {
16023
- return /* @__PURE__ */ jsx(
16024
- Box,
16025
- {
16026
- position: "absolute",
16027
- display: "flex",
16028
- className: cn(
16029
- "items-center justify-center rounded-pill border-3 transition-all cursor-pointer select-none",
16030
- "min-w-[80px] h-[80px] px-3",
16031
- isCurrent && "bg-primary/20 border-primary shadow-lg shadow-primary/30 scale-110",
16032
- isSelected && !isCurrent && "bg-accent/20 border-accent ring-2 ring-accent/50",
16033
- !isCurrent && !isSelected && "bg-card border-border hover:border-muted-foreground hover:scale-105",
16034
- className
16035
- ),
16036
- style: {
16037
- left: position.x,
16038
- top: position.y,
16039
- transform: "translate(-50%, -50%)"
16040
- },
16041
- onClick,
16042
- children: /* @__PURE__ */ jsxs(Box, { className: "text-center", children: [
16043
- isInitial && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground text-xs block", children: "\u25B6 start" }),
16044
- /* @__PURE__ */ jsx(
16045
- Typography,
16046
- {
16047
- variant: "body2",
16048
- className: cn(
16049
- "font-bold whitespace-nowrap",
16050
- isCurrent ? "text-primary" : "text-foreground"
16051
- ),
16052
- children: name
16053
- }
16054
- )
16055
- ] })
16056
- }
16057
- );
16058
- }
16059
- var init_StateNode = __esm({
16060
- "components/game/2d/organisms/StateNode.tsx"() {
16061
- init_atoms();
16062
- init_cn();
16063
- StateNode.displayName = "StateNode";
16064
- }
16065
- });
16066
- function TransitionArrow({
16067
- from,
16068
- to,
16069
- eventLabel,
16070
- guardHint,
16071
- isActive = false,
16072
- onClick,
16073
- className
16074
- }) {
16075
- const dx = to.x - from.x;
16076
- const dy = to.y - from.y;
16077
- const dist = Math.sqrt(dx * dx + dy * dy);
16078
- if (dist === 0) return /* @__PURE__ */ jsx(Fragment, {});
16079
- const nx = dx / dist;
16080
- const ny = dy / dist;
16081
- const startX = from.x + nx * NODE_RADIUS;
16082
- const startY = from.y + ny * NODE_RADIUS;
16083
- const endX = to.x - nx * NODE_RADIUS;
16084
- const endY = to.y - ny * NODE_RADIUS;
16085
- const midX = (startX + endX) / 2;
16086
- const midY = (startY + endY) / 2;
16087
- const perpX = -ny * 20;
16088
- const perpY = nx * 20;
16089
- const ctrlX = midX + perpX;
16090
- const ctrlY = midY + perpY;
16091
- const path = `M ${startX} ${startY} Q ${ctrlX} ${ctrlY} ${endX} ${endY}`;
16092
- return /* @__PURE__ */ jsxs("g", { className: cn("cursor-pointer", className), onClick, children: [
16093
- /* @__PURE__ */ jsx(
16094
- "path",
16095
- {
16096
- d: path,
16097
- fill: "none",
16098
- stroke: isActive ? "var(--color-primary)" : "var(--color-border)",
16099
- strokeWidth: isActive ? 3 : 2,
16100
- markerEnd: isActive ? "url(#arrowhead-active)" : "url(#arrowhead)"
16101
- }
16102
- ),
16103
- /* @__PURE__ */ jsx(
16104
- "text",
16105
- {
16106
- x: ctrlX,
16107
- y: ctrlY - 8,
16108
- textAnchor: "middle",
16109
- fill: isActive ? "var(--color-primary)" : "var(--color-foreground)",
16110
- fontSize: 12,
16111
- fontWeight: isActive ? "bold" : "normal",
16112
- className: "select-none",
16113
- children: eventLabel
16114
- }
16115
- ),
16116
- guardHint && /* @__PURE__ */ jsx(
16117
- "text",
16118
- {
16119
- x: ctrlX,
16120
- y: ctrlY + 6,
16121
- textAnchor: "middle",
16122
- fill: "var(--color-warning)",
16123
- fontSize: 10,
16124
- className: "select-none",
16125
- children: "\u26A0 " + guardHint
16126
- }
16127
- )
16128
- ] });
16129
- }
16130
- var NODE_RADIUS;
16131
- var init_TransitionArrow = __esm({
16132
- "components/game/2d/organisms/TransitionArrow.tsx"() {
16133
- init_cn();
16134
- NODE_RADIUS = 40;
16135
- TransitionArrow.displayName = "TransitionArrow";
16136
- }
16137
- });
16138
16231
  function VariablePanel({
16139
16232
  entityName,
16140
16233
  variables,
@@ -16143,61 +16236,35 @@ function VariablePanel({
16143
16236
  const { t } = useTranslate();
16144
16237
  return /* @__PURE__ */ jsxs(VStack, { className: cn("p-3 rounded-lg bg-card border border-border", className), gap: "sm", children: [
16145
16238
  /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-muted-foreground font-medium", children: t("stateArchitect.variables", { name: entityName }) }),
16146
- variables.map((v) => {
16147
- const name = v.name == null ? "" : String(v.name);
16148
- const value = numField(v.value);
16149
- const max = numField(v.max, 100);
16150
- const min = numField(v.min, 0);
16151
- const unit = v.unit == null ? "" : String(v.unit);
16152
- const pct = Math.round((value - min) / (max - min) * 100);
16153
- const isHigh = pct > 80;
16154
- const isLow = pct < 20;
16155
- return /* @__PURE__ */ jsxs(VStack, { gap: "none", children: [
16156
- /* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between", children: [
16157
- /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-foreground font-medium", children: name }),
16158
- /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: cn(
16159
- isHigh ? "text-error" : isLow ? "text-warning" : "text-foreground"
16160
- ), children: [
16161
- value,
16162
- unit,
16163
- " / ",
16164
- max,
16165
- unit
16166
- ] })
16167
- ] }),
16168
- /* @__PURE__ */ jsx(
16169
- ProgressBar,
16170
- {
16171
- value: pct,
16172
- color: isHigh ? "danger" : isLow ? "warning" : "primary",
16173
- size: "sm"
16174
- }
16175
- )
16176
- ] }, name);
16177
- })
16239
+ (variables ?? []).map((v) => /* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between", children: [
16240
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-foreground font-medium", children: v.name }),
16241
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-accent font-mono", children: v.value })
16242
+ ] }, v.name))
16178
16243
  ] });
16179
16244
  }
16180
- var numField;
16181
16245
  var init_VariablePanel = __esm({
16182
- "components/game/2d/organisms/VariablePanel.tsx"() {
16246
+ "components/game/2d/molecules/VariablePanel.tsx"() {
16183
16247
  init_atoms();
16184
16248
  init_cn();
16185
- numField = (v, fallback = 0) => {
16186
- const n = Number(v);
16187
- return Number.isFinite(n) ? n : fallback;
16188
- };
16189
16249
  VariablePanel.displayName = "VariablePanel";
16190
16250
  }
16191
16251
  });
16192
16252
  function StateJsonView({
16193
- data,
16253
+ name,
16254
+ initialState,
16255
+ states,
16256
+ transitions,
16194
16257
  label,
16195
16258
  defaultExpanded = false,
16196
16259
  className
16197
16260
  }) {
16198
16261
  const { t } = useTranslate();
16199
16262
  const [expanded, setExpanded] = useState(defaultExpanded);
16200
- const jsonString = JSON.stringify(data, null, 2);
16263
+ const jsonString = JSON.stringify(
16264
+ { name, initialState, states: states ?? [], transitions: transitions ?? [] },
16265
+ null,
16266
+ 2
16267
+ );
16201
16268
  return /* @__PURE__ */ jsxs(VStack, { className: cn("rounded-lg border border-border overflow-hidden", className), gap: "none", children: [
16202
16269
  /* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between p-2 bg-muted", gap: "sm", children: [
16203
16270
  /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground font-medium", children: label ?? t("stateArchitect.viewCode") }),
@@ -16214,13 +16281,13 @@ function StateJsonView({
16214
16281
  ] });
16215
16282
  }
16216
16283
  var init_StateJsonView = __esm({
16217
- "components/game/2d/organisms/StateJsonView.tsx"() {
16284
+ "components/game/2d/molecules/StateJsonView.tsx"() {
16218
16285
  init_atoms();
16219
16286
  init_cn();
16220
16287
  StateJsonView.displayName = "StateJsonView";
16221
16288
  }
16222
16289
  });
16223
- function layoutStates(states, width, height) {
16290
+ function layoutStates2(states, width, height) {
16224
16291
  const cx = width / 2;
16225
16292
  const cy = height / 2;
16226
16293
  const radius = Math.min(cx, cy) - 60;
@@ -16288,7 +16355,7 @@ function StateArchitectBoard({
16288
16355
  }, []);
16289
16356
  const GRAPH_W = 500;
16290
16357
  const GRAPH_H = 400;
16291
- const positions = useMemo(() => layoutStates(entityStates, GRAPH_W, GRAPH_H), [entityStates]);
16358
+ const positions = useMemo(() => layoutStates2(entityStates, GRAPH_W, GRAPH_H), [entityStates]);
16292
16359
  const handleStateClick = useCallback((state) => {
16293
16360
  if (isTesting) return;
16294
16361
  if (addingFrom) {
@@ -16383,7 +16450,7 @@ function StateArchitectBoard({
16383
16450
  setAddingFrom(null);
16384
16451
  if (playAgainEvent) emit(`UI:${playAgainEvent}`, {});
16385
16452
  }, [initialState, entityVariables, playAgainEvent, emit]);
16386
- const codeData = useMemo(() => ({
16453
+ useMemo(() => ({
16387
16454
  name: entityName,
16388
16455
  states: entityStates,
16389
16456
  initialState,
@@ -16518,7 +16585,7 @@ function StateArchitectBoard({
16518
16585
  VariablePanel,
16519
16586
  {
16520
16587
  entityName,
16521
- variables
16588
+ variables: variables.map((v) => ({ name: String(v.name ?? ""), value: String(v.value ?? "") }))
16522
16589
  }
16523
16590
  ),
16524
16591
  testResults.length > 0 && /* @__PURE__ */ jsxs(VStack, { className: "p-3 rounded-container bg-card border border-border", gap: "xs", children: [
@@ -16529,7 +16596,16 @@ function StateArchitectBoard({
16529
16596
  !r2.passed && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-error", children: t("stateArchitect.gotState", { state: r2.actualState }) })
16530
16597
  ] }, i))
16531
16598
  ] }),
16532
- resolved.showCodeView !== false && /* @__PURE__ */ jsx(StateJsonView, { data: codeData, label: "View Code" })
16599
+ resolved.showCodeView !== false && /* @__PURE__ */ jsx(
16600
+ StateJsonView,
16601
+ {
16602
+ name: entityName,
16603
+ initialState,
16604
+ states: entityStates,
16605
+ transitions: transitions.map((tr) => ({ from: tr.from, to: tr.to, event: tr.event })),
16606
+ label: "View Code"
16607
+ }
16608
+ )
16533
16609
  ] })
16534
16610
  ] }),
16535
16611
  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") }) }),
@@ -18270,7 +18346,7 @@ var init_ErrorBoundary = __esm({
18270
18346
  }
18271
18347
  );
18272
18348
  };
18273
- ErrorBoundary = class extends React104__default.Component {
18349
+ ErrorBoundary = class extends React105__default.Component {
18274
18350
  constructor(props) {
18275
18351
  super(props);
18276
18352
  __publicField(this, "reset", () => {
@@ -18552,7 +18628,7 @@ var init_Container = __esm({
18552
18628
  as: Component = "div"
18553
18629
  }) => {
18554
18630
  const resolvedSize = maxWidth ?? size ?? "lg";
18555
- return React104__default.createElement(
18631
+ return React105__default.createElement(
18556
18632
  Component,
18557
18633
  {
18558
18634
  className: cn(
@@ -20393,7 +20469,7 @@ var init_CodeBlock = __esm({
20393
20469
  DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
20394
20470
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
20395
20471
  HIDDEN_LINE_NUMBERS = { display: "none" };
20396
- CodeBlock = React104__default.memo(
20472
+ CodeBlock = React105__default.memo(
20397
20473
  ({
20398
20474
  code: rawCode,
20399
20475
  language = "text",
@@ -20980,7 +21056,7 @@ var init_MarkdownContent = __esm({
20980
21056
  init_Box();
20981
21057
  init_CodeBlock();
20982
21058
  init_cn();
20983
- MarkdownContent = React104__default.memo(
21059
+ MarkdownContent = React105__default.memo(
20984
21060
  ({ content, direction = "ltr", className }) => {
20985
21061
  const { t: _t } = useTranslate();
20986
21062
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -22307,7 +22383,7 @@ var init_StateMachineView = __esm({
22307
22383
  style: { top: title ? 30 : 0 },
22308
22384
  children: [
22309
22385
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
22310
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React104__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
22386
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React105__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
22311
22387
  StateNode2,
22312
22388
  {
22313
22389
  state,
@@ -27945,8 +28021,8 @@ var init_Menu = __esm({
27945
28021
  "bottom-end": "bottom-start"
27946
28022
  };
27947
28023
  const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
27948
- const triggerChild = React104__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
27949
- const triggerElement = React104__default.cloneElement(
28024
+ const triggerChild = React105__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
28025
+ const triggerElement = React105__default.cloneElement(
27950
28026
  triggerChild,
27951
28027
  {
27952
28028
  ref: triggerRef,
@@ -28041,14 +28117,14 @@ function useDataDnd(args) {
28041
28117
  const isZone = Boolean(dragGroup || accepts || sortable);
28042
28118
  const enabled = isZone || Boolean(dndRoot);
28043
28119
  const eventBus = useEventBus();
28044
- const parentRoot = React104__default.useContext(RootCtx);
28120
+ const parentRoot = React105__default.useContext(RootCtx);
28045
28121
  const isRoot = enabled && parentRoot === null;
28046
- const zoneId = React104__default.useId();
28122
+ const zoneId = React105__default.useId();
28047
28123
  const ownGroup = dragGroup ?? accepts ?? zoneId;
28048
- const [optimisticOrders, setOptimisticOrders] = React104__default.useState(() => /* @__PURE__ */ new Map());
28049
- const optimisticOrdersRef = React104__default.useRef(optimisticOrders);
28124
+ const [optimisticOrders, setOptimisticOrders] = React105__default.useState(() => /* @__PURE__ */ new Map());
28125
+ const optimisticOrdersRef = React105__default.useRef(optimisticOrders);
28050
28126
  optimisticOrdersRef.current = optimisticOrders;
28051
- const clearOptimisticOrder = React104__default.useCallback((group) => {
28127
+ const clearOptimisticOrder = React105__default.useCallback((group) => {
28052
28128
  setOptimisticOrders((prev) => {
28053
28129
  if (!prev.has(group)) return prev;
28054
28130
  const next = new Map(prev);
@@ -28073,7 +28149,7 @@ function useDataDnd(args) {
28073
28149
  const raw = it[dndItemIdField];
28074
28150
  return raw != null ? String(raw) : `__idx_${idx}`;
28075
28151
  }).join("|");
28076
- const itemIds = React104__default.useMemo(
28152
+ const itemIds = React105__default.useMemo(
28077
28153
  () => orderedItems.map((it, idx) => {
28078
28154
  const raw = it[dndItemIdField];
28079
28155
  return raw != null ? String(raw) : `__idx_${idx}`;
@@ -28084,7 +28160,7 @@ function useDataDnd(args) {
28084
28160
  const raw = it[dndItemIdField];
28085
28161
  return raw != null ? String(raw) : `__${idx}`;
28086
28162
  }).join("|");
28087
- React104__default.useEffect(() => {
28163
+ React105__default.useEffect(() => {
28088
28164
  const root = isRoot ? null : parentRoot;
28089
28165
  if (root) {
28090
28166
  root.clearOptimisticOrder(ownGroup);
@@ -28092,20 +28168,20 @@ function useDataDnd(args) {
28092
28168
  clearOptimisticOrder(ownGroup);
28093
28169
  }
28094
28170
  }, [itemsContentSig, ownGroup]);
28095
- const zonesRef = React104__default.useRef(/* @__PURE__ */ new Map());
28096
- const registerZone = React104__default.useCallback((zoneId2, meta2) => {
28171
+ const zonesRef = React105__default.useRef(/* @__PURE__ */ new Map());
28172
+ const registerZone = React105__default.useCallback((zoneId2, meta2) => {
28097
28173
  zonesRef.current.set(zoneId2, meta2);
28098
28174
  }, []);
28099
- const unregisterZone = React104__default.useCallback((zoneId2) => {
28175
+ const unregisterZone = React105__default.useCallback((zoneId2) => {
28100
28176
  zonesRef.current.delete(zoneId2);
28101
28177
  }, []);
28102
- const [activeDrag, setActiveDrag] = React104__default.useState(null);
28103
- const [overZoneGroup, setOverZoneGroup] = React104__default.useState(null);
28104
- const meta = React104__default.useMemo(
28178
+ const [activeDrag, setActiveDrag] = React105__default.useState(null);
28179
+ const [overZoneGroup, setOverZoneGroup] = React105__default.useState(null);
28180
+ const meta = React105__default.useMemo(
28105
28181
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
28106
28182
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
28107
28183
  );
28108
- React104__default.useEffect(() => {
28184
+ React105__default.useEffect(() => {
28109
28185
  const target = isRoot ? null : parentRoot;
28110
28186
  if (!target) {
28111
28187
  zonesRef.current.set(zoneId, meta);
@@ -28124,7 +28200,7 @@ function useDataDnd(args) {
28124
28200
  }, [parentRoot, isRoot, zoneId, meta]);
28125
28201
  const sensors = useAlmadarDndSensors(true);
28126
28202
  const collisionDetection = almadarDndCollisionDetection;
28127
- const findZoneByItem = React104__default.useCallback(
28203
+ const findZoneByItem = React105__default.useCallback(
28128
28204
  (id) => {
28129
28205
  for (const z of zonesRef.current.values()) {
28130
28206
  if (z.itemIds.includes(id)) return z;
@@ -28133,7 +28209,7 @@ function useDataDnd(args) {
28133
28209
  },
28134
28210
  []
28135
28211
  );
28136
- React104__default.useCallback(
28212
+ React105__default.useCallback(
28137
28213
  (group) => {
28138
28214
  for (const z of zonesRef.current.values()) {
28139
28215
  if (z.group === group) return z;
@@ -28142,7 +28218,7 @@ function useDataDnd(args) {
28142
28218
  },
28143
28219
  []
28144
28220
  );
28145
- const handleDragEnd = React104__default.useCallback(
28221
+ const handleDragEnd = React105__default.useCallback(
28146
28222
  (event) => {
28147
28223
  const { active, over } = event;
28148
28224
  const activeIdStr = String(active.id);
@@ -28233,8 +28309,8 @@ function useDataDnd(args) {
28233
28309
  },
28234
28310
  [eventBus]
28235
28311
  );
28236
- const sortableData = React104__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
28237
- const SortableItem = React104__default.useCallback(
28312
+ const sortableData = React105__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
28313
+ const SortableItem = React105__default.useCallback(
28238
28314
  ({ id, children }) => {
28239
28315
  const {
28240
28316
  attributes,
@@ -28274,7 +28350,7 @@ function useDataDnd(args) {
28274
28350
  id: droppableId,
28275
28351
  data: sortableData
28276
28352
  });
28277
- const ctx = React104__default.useContext(RootCtx);
28353
+ const ctx = React105__default.useContext(RootCtx);
28278
28354
  const activeDrag2 = ctx?.activeDrag ?? null;
28279
28355
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
28280
28356
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -28289,7 +28365,7 @@ function useDataDnd(args) {
28289
28365
  showForeignPlaceholder,
28290
28366
  ctxAvailable: ctx != null
28291
28367
  });
28292
- React104__default.useEffect(() => {
28368
+ React105__default.useEffect(() => {
28293
28369
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
28294
28370
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
28295
28371
  return /* @__PURE__ */ jsx(
@@ -28303,11 +28379,11 @@ function useDataDnd(args) {
28303
28379
  }
28304
28380
  );
28305
28381
  };
28306
- const rootContextValue = React104__default.useMemo(
28382
+ const rootContextValue = React105__default.useMemo(
28307
28383
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
28308
28384
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
28309
28385
  );
28310
- const handleDragStart = React104__default.useCallback((event) => {
28386
+ const handleDragStart = React105__default.useCallback((event) => {
28311
28387
  const sourceZone = findZoneByItem(event.active.id);
28312
28388
  const rect = event.active.rect.current.initial;
28313
28389
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -28326,7 +28402,7 @@ function useDataDnd(args) {
28326
28402
  isRoot
28327
28403
  });
28328
28404
  }, [findZoneByItem, isRoot, zoneId]);
28329
- const handleDragOver = React104__default.useCallback((event) => {
28405
+ const handleDragOver = React105__default.useCallback((event) => {
28330
28406
  const { active, over } = event;
28331
28407
  const overData = over?.data?.current;
28332
28408
  const overGroup = overData?.dndGroup ?? null;
@@ -28396,7 +28472,7 @@ function useDataDnd(args) {
28396
28472
  return next;
28397
28473
  });
28398
28474
  }, []);
28399
- const handleDragCancel = React104__default.useCallback((event) => {
28475
+ const handleDragCancel = React105__default.useCallback((event) => {
28400
28476
  setActiveDrag(null);
28401
28477
  setOverZoneGroup(null);
28402
28478
  dndLog.warn("dragCancel", {
@@ -28404,12 +28480,12 @@ function useDataDnd(args) {
28404
28480
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
28405
28481
  });
28406
28482
  }, []);
28407
- const handleDragEndWithCleanup = React104__default.useCallback((event) => {
28483
+ const handleDragEndWithCleanup = React105__default.useCallback((event) => {
28408
28484
  handleDragEnd(event);
28409
28485
  setActiveDrag(null);
28410
28486
  setOverZoneGroup(null);
28411
28487
  }, [handleDragEnd]);
28412
- const wrapContainer = React104__default.useCallback(
28488
+ const wrapContainer = React105__default.useCallback(
28413
28489
  (children) => {
28414
28490
  if (!enabled) return children;
28415
28491
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -28463,7 +28539,7 @@ var init_useDataDnd = __esm({
28463
28539
  init_useAlmadarDndCollision();
28464
28540
  init_Box();
28465
28541
  dndLog = createLogger("almadar:ui:dnd");
28466
- RootCtx = React104__default.createContext(null);
28542
+ RootCtx = React105__default.createContext(null);
28467
28543
  }
28468
28544
  });
28469
28545
  function renderIconInput(icon, props) {
@@ -28989,7 +29065,7 @@ function DataList({
28989
29065
  }) {
28990
29066
  const eventBus = useEventBus();
28991
29067
  const { t } = useTranslate();
28992
- const [visibleCount, setVisibleCount] = React104__default.useState(pageSize || Infinity);
29068
+ const [visibleCount, setVisibleCount] = React105__default.useState(pageSize || Infinity);
28993
29069
  const fieldDefs = fields ?? columns ?? [];
28994
29070
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
28995
29071
  const dnd = useDataDnd({
@@ -29008,7 +29084,7 @@ function DataList({
29008
29084
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
29009
29085
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
29010
29086
  const hasRenderProp = typeof children === "function";
29011
- React104__default.useEffect(() => {
29087
+ React105__default.useEffect(() => {
29012
29088
  const renderItemTypeOf = typeof schemaRenderItem;
29013
29089
  const childrenTypeOf = typeof children;
29014
29090
  if (data.length > 0 && !hasRenderProp) {
@@ -29112,7 +29188,7 @@ function DataList({
29112
29188
  const items2 = [...data];
29113
29189
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
29114
29190
  const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
29115
- return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
29191
+ return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
29116
29192
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
29117
29193
  group.items.map((itemData, index) => {
29118
29194
  const id = itemData.id || `${gi}-${index}`;
@@ -29253,7 +29329,7 @@ function DataList({
29253
29329
  className
29254
29330
  ),
29255
29331
  children: [
29256
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
29332
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
29257
29333
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
29258
29334
  group.items.map(
29259
29335
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -29338,7 +29414,7 @@ var init_FormSection = __esm({
29338
29414
  columns = 1,
29339
29415
  className
29340
29416
  }) => {
29341
- const [collapsed, setCollapsed] = React104__default.useState(defaultCollapsed);
29417
+ const [collapsed, setCollapsed] = React105__default.useState(defaultCollapsed);
29342
29418
  const { t } = useTranslate();
29343
29419
  const eventBus = useEventBus();
29344
29420
  const gridClass = {
@@ -29346,7 +29422,7 @@ var init_FormSection = __esm({
29346
29422
  2: "grid-cols-1 md:grid-cols-2",
29347
29423
  3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
29348
29424
  }[columns];
29349
- React104__default.useCallback(() => {
29425
+ React105__default.useCallback(() => {
29350
29426
  if (collapsible) {
29351
29427
  setCollapsed((prev) => !prev);
29352
29428
  eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
@@ -30296,7 +30372,7 @@ var init_Flex = __esm({
30296
30372
  flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
30297
30373
  }
30298
30374
  }
30299
- return React104__default.createElement(Component, {
30375
+ return React105__default.createElement(Component, {
30300
30376
  className: cn(
30301
30377
  inline ? "inline-flex" : "flex",
30302
30378
  directionStyles[direction],
@@ -30415,7 +30491,7 @@ var init_Grid = __esm({
30415
30491
  as: Component = "div"
30416
30492
  }) => {
30417
30493
  const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
30418
- return React104__default.createElement(
30494
+ return React105__default.createElement(
30419
30495
  Component,
30420
30496
  {
30421
30497
  className: cn(
@@ -30611,9 +30687,9 @@ var init_Popover = __esm({
30611
30687
  onMouseLeave: handleClose,
30612
30688
  onPointerDown: tapTriggerProps.onPointerDown
30613
30689
  };
30614
- const childElement = React104__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
30690
+ const childElement = React105__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
30615
30691
  const childPointerDown = childElement.props.onPointerDown;
30616
- const triggerElement = React104__default.cloneElement(
30692
+ const triggerElement = React105__default.cloneElement(
30617
30693
  childElement,
30618
30694
  {
30619
30695
  ref: triggerRef,
@@ -31215,9 +31291,9 @@ var init_Tooltip = __esm({
31215
31291
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
31216
31292
  };
31217
31293
  }, []);
31218
- const triggerElement = React104__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
31294
+ const triggerElement = React105__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
31219
31295
  const childPointerDown = triggerElement.props.onPointerDown;
31220
- const trigger = React104__default.cloneElement(triggerElement, {
31296
+ const trigger = React105__default.cloneElement(triggerElement, {
31221
31297
  ref: triggerRef,
31222
31298
  onMouseEnter: handleMouseEnter,
31223
31299
  onMouseLeave: handleMouseLeave,
@@ -31307,7 +31383,7 @@ var init_WizardProgress = __esm({
31307
31383
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
31308
31384
  const isActive = index === currentStep;
31309
31385
  const isCompleted = index < currentStep;
31310
- return /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
31386
+ return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
31311
31387
  /* @__PURE__ */ jsx(
31312
31388
  "button",
31313
31389
  {
@@ -32867,7 +32943,7 @@ var init_MapView = __esm({
32867
32943
  shadowSize: [41, 41]
32868
32944
  });
32869
32945
  L.Marker.prototype.options.icon = defaultIcon;
32870
- const { useEffect: useEffect71, useRef: useRef67, useCallback: useCallback105, useState: useState105 } = React104__default;
32946
+ const { useEffect: useEffect71, useRef: useRef67, useCallback: useCallback105, useState: useState105 } = React105__default;
32871
32947
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
32872
32948
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
32873
32949
  function MapUpdater({ centerLat, centerLng, zoom }) {
@@ -33782,8 +33858,8 @@ function TableView({
33782
33858
  }) {
33783
33859
  const eventBus = useEventBus();
33784
33860
  const { t } = useTranslate();
33785
- const [visibleCount, setVisibleCount] = React104__default.useState(pageSize > 0 ? pageSize : Infinity);
33786
- const [localSelected, setLocalSelected] = React104__default.useState(/* @__PURE__ */ new Set());
33861
+ const [visibleCount, setVisibleCount] = React105__default.useState(pageSize > 0 ? pageSize : Infinity);
33862
+ const [localSelected, setLocalSelected] = React105__default.useState(/* @__PURE__ */ new Set());
33787
33863
  const colDefs = columns ?? fields ?? [];
33788
33864
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
33789
33865
  const dnd = useDataDnd({
@@ -33978,12 +34054,12 @@ function TableView({
33978
34054
  ]
33979
34055
  }
33980
34056
  );
33981
- return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React104__default.Fragment, { children: rowInner }, id);
34057
+ return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React105__default.Fragment, { children: rowInner }, id);
33982
34058
  };
33983
34059
  const items = Array.from(data);
33984
34060
  const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
33985
34061
  let runningIndex = 0;
33986
- const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
34062
+ const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
33987
34063
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
33988
34064
  group.items.map((row) => renderRow(row, runningIndex++))
33989
34065
  ] }, gi)) });
@@ -35340,7 +35416,7 @@ var init_StepFlow = __esm({
35340
35416
  className
35341
35417
  }) => {
35342
35418
  if (orientation === "vertical") {
35343
- return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React104__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
35419
+ return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React105__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
35344
35420
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
35345
35421
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
35346
35422
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -35351,7 +35427,7 @@ var init_StepFlow = __esm({
35351
35427
  ] })
35352
35428
  ] }) }, index)) });
35353
35429
  }
35354
- 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(React104__default.Fragment, { children: [
35430
+ 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(React105__default.Fragment, { children: [
35355
35431
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
35356
35432
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
35357
35433
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -36336,7 +36412,7 @@ var init_LikertScale = __esm({
36336
36412
  md: "text-base",
36337
36413
  lg: "text-lg"
36338
36414
  };
36339
- LikertScale = React104__default.forwardRef(
36415
+ LikertScale = React105__default.forwardRef(
36340
36416
  ({
36341
36417
  question,
36342
36418
  options = DEFAULT_LIKERT_OPTIONS,
@@ -36348,7 +36424,7 @@ var init_LikertScale = __esm({
36348
36424
  variant = "radios",
36349
36425
  className
36350
36426
  }, ref) => {
36351
- const groupId = React104__default.useId();
36427
+ const groupId = React105__default.useId();
36352
36428
  const eventBus = useEventBus();
36353
36429
  const handleSelect = useCallback(
36354
36430
  (next) => {
@@ -38630,7 +38706,7 @@ var init_DocBreadcrumb = __esm({
38630
38706
  "aria-label": t("aria.breadcrumb"),
38631
38707
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
38632
38708
  const isLast = idx === items.length - 1;
38633
- return /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
38709
+ return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
38634
38710
  idx > 0 && /* @__PURE__ */ jsx(
38635
38711
  Icon,
38636
38712
  {
@@ -39294,7 +39370,7 @@ var init_PageHeader = __esm({
39294
39370
  info: "bg-info/10 text-info"
39295
39371
  };
39296
39372
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
39297
- 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(React104__default.Fragment, { children: [
39373
+ 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(React105__default.Fragment, { children: [
39298
39374
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
39299
39375
  crumb.href ? /* @__PURE__ */ jsx(
39300
39376
  "a",
@@ -39652,7 +39728,7 @@ var init_Section = __esm({
39652
39728
  as: Component = "section"
39653
39729
  }) => {
39654
39730
  const hasHeader = title || description || action;
39655
- return React104__default.createElement(
39731
+ return React105__default.createElement(
39656
39732
  Component,
39657
39733
  {
39658
39734
  className: cn(
@@ -40026,7 +40102,7 @@ var init_WizardContainer = __esm({
40026
40102
  const isCompleted = index < currentStep;
40027
40103
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
40028
40104
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
40029
- return /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
40105
+ return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
40030
40106
  /* @__PURE__ */ jsx(
40031
40107
  Button,
40032
40108
  {
@@ -42459,7 +42535,7 @@ var init_DetailPanel = __esm({
42459
42535
  }
42460
42536
  });
42461
42537
  function extractTitle(children) {
42462
- if (!React104__default.isValidElement(children)) return void 0;
42538
+ if (!React105__default.isValidElement(children)) return void 0;
42463
42539
  const props = children.props;
42464
42540
  if (typeof props.title === "string") {
42465
42541
  return props.title;
@@ -42809,12 +42885,12 @@ var init_Form = __esm({
42809
42885
  const isSchemaEntity = isOrbitalEntitySchema(entity);
42810
42886
  const resolvedEntity = isSchemaEntity ? entity : void 0;
42811
42887
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
42812
- const normalizedInitialData = React104__default.useMemo(() => {
42888
+ const normalizedInitialData = React105__default.useMemo(() => {
42813
42889
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
42814
42890
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
42815
42891
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
42816
42892
  }, [entity, initialData]);
42817
- const entityDerivedFields = React104__default.useMemo(() => {
42893
+ const entityDerivedFields = React105__default.useMemo(() => {
42818
42894
  if (fields && fields.length > 0) return void 0;
42819
42895
  if (!resolvedEntity) return void 0;
42820
42896
  return resolvedEntity.fields.map(
@@ -42835,16 +42911,16 @@ var init_Form = __esm({
42835
42911
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
42836
42912
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
42837
42913
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
42838
- const [formData, setFormData] = React104__default.useState(
42914
+ const [formData, setFormData] = React105__default.useState(
42839
42915
  normalizedInitialData
42840
42916
  );
42841
- const [collapsedSections, setCollapsedSections] = React104__default.useState(
42917
+ const [collapsedSections, setCollapsedSections] = React105__default.useState(
42842
42918
  /* @__PURE__ */ new Set()
42843
42919
  );
42844
- const [submitError, setSubmitError] = React104__default.useState(null);
42845
- const formRef = React104__default.useRef(null);
42920
+ const [submitError, setSubmitError] = React105__default.useState(null);
42921
+ const formRef = React105__default.useRef(null);
42846
42922
  const formMode = props.mode;
42847
- const mountedRef = React104__default.useRef(false);
42923
+ const mountedRef = React105__default.useRef(false);
42848
42924
  if (!mountedRef.current) {
42849
42925
  mountedRef.current = true;
42850
42926
  debug("forms", "mount", {
@@ -42857,7 +42933,7 @@ var init_Form = __esm({
42857
42933
  });
42858
42934
  }
42859
42935
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
42860
- const evalContext = React104__default.useMemo(
42936
+ const evalContext = React105__default.useMemo(
42861
42937
  () => ({
42862
42938
  formValues: formData,
42863
42939
  globalVariables: externalContext?.globalVariables ?? {},
@@ -42866,7 +42942,7 @@ var init_Form = __esm({
42866
42942
  }),
42867
42943
  [formData, externalContext]
42868
42944
  );
42869
- React104__default.useEffect(() => {
42945
+ React105__default.useEffect(() => {
42870
42946
  debug("forms", "initialData-sync", {
42871
42947
  mode: formMode,
42872
42948
  normalizedInitialData,
@@ -42877,7 +42953,7 @@ var init_Form = __esm({
42877
42953
  setFormData(normalizedInitialData);
42878
42954
  }
42879
42955
  }, [normalizedInitialData]);
42880
- const processCalculations = React104__default.useCallback(
42956
+ const processCalculations = React105__default.useCallback(
42881
42957
  (changedFieldId, newFormData) => {
42882
42958
  if (!hiddenCalculations.length) return;
42883
42959
  const context = {
@@ -42902,7 +42978,7 @@ var init_Form = __esm({
42902
42978
  },
42903
42979
  [hiddenCalculations, externalContext, eventBus]
42904
42980
  );
42905
- const checkViolations = React104__default.useCallback(
42981
+ const checkViolations = React105__default.useCallback(
42906
42982
  (changedFieldId, newFormData) => {
42907
42983
  if (!violationTriggers.length) return;
42908
42984
  const context = {
@@ -42940,7 +43016,7 @@ var init_Form = __esm({
42940
43016
  processCalculations(name, newFormData);
42941
43017
  checkViolations(name, newFormData);
42942
43018
  };
42943
- const isFieldVisible = React104__default.useCallback(
43019
+ const isFieldVisible = React105__default.useCallback(
42944
43020
  (fieldName) => {
42945
43021
  const condition = conditionalFields[fieldName];
42946
43022
  if (!condition) return true;
@@ -42948,7 +43024,7 @@ var init_Form = __esm({
42948
43024
  },
42949
43025
  [conditionalFields, evalContext]
42950
43026
  );
42951
- const isSectionVisible = React104__default.useCallback(
43027
+ const isSectionVisible = React105__default.useCallback(
42952
43028
  (section) => {
42953
43029
  if (!section.condition) return true;
42954
43030
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -43024,7 +43100,7 @@ var init_Form = __esm({
43024
43100
  eventBus.emit(`UI:${onCancel}`);
43025
43101
  }
43026
43102
  };
43027
- const renderField = React104__default.useCallback(
43103
+ const renderField = React105__default.useCallback(
43028
43104
  (field) => {
43029
43105
  const fieldName = field.name || field.field;
43030
43106
  if (!fieldName) return null;
@@ -43045,7 +43121,7 @@ var init_Form = __esm({
43045
43121
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
43046
43122
  );
43047
43123
  const effectiveFields = entityDerivedFields ?? fields;
43048
- const normalizedFields = React104__default.useMemo(() => {
43124
+ const normalizedFields = React105__default.useMemo(() => {
43049
43125
  if (!effectiveFields || effectiveFields.length === 0) return [];
43050
43126
  return effectiveFields.map((field) => {
43051
43127
  if (typeof field === "string") {
@@ -43069,7 +43145,7 @@ var init_Form = __esm({
43069
43145
  return field;
43070
43146
  });
43071
43147
  }, [effectiveFields, resolvedEntity]);
43072
- const schemaFields = React104__default.useMemo(() => {
43148
+ const schemaFields = React105__default.useMemo(() => {
43073
43149
  if (normalizedFields.length === 0) return null;
43074
43150
  if (isDebugEnabled()) {
43075
43151
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -43079,7 +43155,7 @@ var init_Form = __esm({
43079
43155
  }
43080
43156
  return normalizedFields.map(renderField).filter(Boolean);
43081
43157
  }, [normalizedFields, renderField, entityName, conditionalFields]);
43082
- const sectionElements = React104__default.useMemo(() => {
43158
+ const sectionElements = React105__default.useMemo(() => {
43083
43159
  if (!sections || sections.length === 0) return null;
43084
43160
  return sections.map((section) => {
43085
43161
  if (!isSectionVisible(section)) {
@@ -43804,7 +43880,7 @@ var init_List = __esm({
43804
43880
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
43805
43881
  return [];
43806
43882
  }, [entity]);
43807
- const getItemActions = React104__default.useCallback(
43883
+ const getItemActions = React105__default.useCallback(
43808
43884
  (item) => {
43809
43885
  if (!itemActions) return [];
43810
43886
  if (typeof itemActions === "function") {
@@ -44279,7 +44355,7 @@ var init_MediaGallery = __esm({
44279
44355
  [selectable, selectedItems, selectionEvent, eventBus]
44280
44356
  );
44281
44357
  const entityData = Array.isArray(entity) ? entity : [];
44282
- const items = React104__default.useMemo(() => {
44358
+ const items = React105__default.useMemo(() => {
44283
44359
  if (propItems) return propItems;
44284
44360
  if (entityData.length === 0) return [];
44285
44361
  return entityData.map((record, idx) => {
@@ -44442,7 +44518,7 @@ var init_MediaGallery = __esm({
44442
44518
  }
44443
44519
  });
44444
44520
  function extractTitle2(children) {
44445
- if (!React104__default.isValidElement(children)) return void 0;
44521
+ if (!React105__default.isValidElement(children)) return void 0;
44446
44522
  const props = children.props;
44447
44523
  if (typeof props.title === "string") {
44448
44524
  return props.title;
@@ -44716,7 +44792,7 @@ var init_debugRegistry = __esm({
44716
44792
  }
44717
44793
  });
44718
44794
  function useDebugData() {
44719
- const [data, setData] = React104.useState(() => ({
44795
+ const [data, setData] = React105.useState(() => ({
44720
44796
  traits: [],
44721
44797
  ticks: [],
44722
44798
  guards: [],
@@ -44730,7 +44806,7 @@ function useDebugData() {
44730
44806
  },
44731
44807
  lastUpdate: Date.now()
44732
44808
  }));
44733
- React104.useEffect(() => {
44809
+ React105.useEffect(() => {
44734
44810
  const updateData = () => {
44735
44811
  setData({
44736
44812
  traits: getAllTraits(),
@@ -44839,12 +44915,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
44839
44915
  return positions;
44840
44916
  }
44841
44917
  function WalkMinimap() {
44842
- const [walkStep, setWalkStep] = React104.useState(null);
44843
- const [traits2, setTraits] = React104.useState([]);
44844
- const [coveredEdges, setCoveredEdges] = React104.useState([]);
44845
- const [completedTraits, setCompletedTraits] = React104.useState(/* @__PURE__ */ new Set());
44846
- const prevTraitRef = React104.useRef(null);
44847
- React104.useEffect(() => {
44918
+ const [walkStep, setWalkStep] = React105.useState(null);
44919
+ const [traits2, setTraits] = React105.useState([]);
44920
+ const [coveredEdges, setCoveredEdges] = React105.useState([]);
44921
+ const [completedTraits, setCompletedTraits] = React105.useState(/* @__PURE__ */ new Set());
44922
+ const prevTraitRef = React105.useRef(null);
44923
+ React105.useEffect(() => {
44848
44924
  const interval = setInterval(() => {
44849
44925
  const w = window;
44850
44926
  const step = w.__orbitalWalkStep;
@@ -45280,15 +45356,15 @@ var init_EntitiesTab = __esm({
45280
45356
  });
45281
45357
  function EventFlowTab({ events: events2 }) {
45282
45358
  const { t } = useTranslate();
45283
- const [filter, setFilter] = React104.useState("all");
45284
- const containerRef = React104.useRef(null);
45285
- const [autoScroll, setAutoScroll] = React104.useState(true);
45286
- React104.useEffect(() => {
45359
+ const [filter, setFilter] = React105.useState("all");
45360
+ const containerRef = React105.useRef(null);
45361
+ const [autoScroll, setAutoScroll] = React105.useState(true);
45362
+ React105.useEffect(() => {
45287
45363
  if (autoScroll && containerRef.current) {
45288
45364
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
45289
45365
  }
45290
45366
  }, [events2.length, autoScroll]);
45291
- const filteredEvents = React104.useMemo(() => {
45367
+ const filteredEvents = React105.useMemo(() => {
45292
45368
  if (filter === "all") return events2;
45293
45369
  return events2.filter((e) => e.type === filter);
45294
45370
  }, [events2, filter]);
@@ -45404,7 +45480,7 @@ var init_EventFlowTab = __esm({
45404
45480
  });
45405
45481
  function GuardsPanel({ guards }) {
45406
45482
  const { t } = useTranslate();
45407
- const [filter, setFilter] = React104.useState("all");
45483
+ const [filter, setFilter] = React105.useState("all");
45408
45484
  if (guards.length === 0) {
45409
45485
  return /* @__PURE__ */ jsx(
45410
45486
  EmptyState,
@@ -45417,7 +45493,7 @@ function GuardsPanel({ guards }) {
45417
45493
  }
45418
45494
  const passedCount = guards.filter((g) => g.result).length;
45419
45495
  const failedCount = guards.length - passedCount;
45420
- const filteredGuards = React104.useMemo(() => {
45496
+ const filteredGuards = React105.useMemo(() => {
45421
45497
  if (filter === "all") return guards;
45422
45498
  if (filter === "passed") return guards.filter((g) => g.result);
45423
45499
  return guards.filter((g) => !g.result);
@@ -45580,10 +45656,10 @@ function EffectBadge({ effect }) {
45580
45656
  }
45581
45657
  function TransitionTimeline({ transitions }) {
45582
45658
  const { t } = useTranslate();
45583
- const containerRef = React104.useRef(null);
45584
- const [autoScroll, setAutoScroll] = React104.useState(true);
45585
- const [expandedId, setExpandedId] = React104.useState(null);
45586
- React104.useEffect(() => {
45659
+ const containerRef = React105.useRef(null);
45660
+ const [autoScroll, setAutoScroll] = React105.useState(true);
45661
+ const [expandedId, setExpandedId] = React105.useState(null);
45662
+ React105.useEffect(() => {
45587
45663
  if (autoScroll && containerRef.current) {
45588
45664
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
45589
45665
  }
@@ -45863,9 +45939,9 @@ function getAllEvents(traits2) {
45863
45939
  function EventDispatcherTab({ traits: traits2, schema }) {
45864
45940
  const eventBus = useEventBus();
45865
45941
  const { t } = useTranslate();
45866
- const [log11, setLog] = React104.useState([]);
45867
- const prevStatesRef = React104.useRef(/* @__PURE__ */ new Map());
45868
- React104.useEffect(() => {
45942
+ const [log11, setLog] = React105.useState([]);
45943
+ const prevStatesRef = React105.useRef(/* @__PURE__ */ new Map());
45944
+ React105.useEffect(() => {
45869
45945
  for (const trait of traits2) {
45870
45946
  const prev = prevStatesRef.current.get(trait.id);
45871
45947
  if (prev && prev !== trait.currentState) {
@@ -46034,10 +46110,10 @@ function VerifyModePanel({
46034
46110
  localCount
46035
46111
  }) {
46036
46112
  const { t } = useTranslate();
46037
- const [expanded, setExpanded] = React104.useState(true);
46038
- const scrollRef = React104.useRef(null);
46039
- const prevCountRef = React104.useRef(0);
46040
- React104.useEffect(() => {
46113
+ const [expanded, setExpanded] = React105.useState(true);
46114
+ const scrollRef = React105.useRef(null);
46115
+ const prevCountRef = React105.useRef(0);
46116
+ React105.useEffect(() => {
46041
46117
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
46042
46118
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
46043
46119
  }
@@ -46094,10 +46170,10 @@ function RuntimeDebugger({
46094
46170
  schema
46095
46171
  }) {
46096
46172
  const { t } = useTranslate();
46097
- const [isCollapsed, setIsCollapsed] = React104.useState(mode === "verify" ? true : defaultCollapsed);
46098
- const [isVisible, setIsVisible] = React104.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
46173
+ const [isCollapsed, setIsCollapsed] = React105.useState(mode === "verify" ? true : defaultCollapsed);
46174
+ const [isVisible, setIsVisible] = React105.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
46099
46175
  const debugData = useDebugData();
46100
- React104.useEffect(() => {
46176
+ React105.useEffect(() => {
46101
46177
  if (mode === "inline") return;
46102
46178
  return onDebugToggle((enabled) => {
46103
46179
  setIsVisible(enabled);
@@ -46106,7 +46182,7 @@ function RuntimeDebugger({
46106
46182
  }
46107
46183
  });
46108
46184
  }, [mode]);
46109
- React104.useEffect(() => {
46185
+ React105.useEffect(() => {
46110
46186
  if (mode === "inline") return;
46111
46187
  const handleKeyDown = (e) => {
46112
46188
  if (e.key === "`" && isVisible) {
@@ -46626,7 +46702,7 @@ var init_StatCard = __esm({
46626
46702
  const labelToUse = propLabel ?? propTitle;
46627
46703
  const eventBus = useEventBus();
46628
46704
  const { t } = useTranslate();
46629
- const handleActionClick = React104__default.useCallback(() => {
46705
+ const handleActionClick = React105__default.useCallback(() => {
46630
46706
  if (action?.event) {
46631
46707
  eventBus.emit(`UI:${action.event}`, {});
46632
46708
  }
@@ -46637,7 +46713,7 @@ var init_StatCard = __esm({
46637
46713
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
46638
46714
  const isLoading = externalLoading ?? false;
46639
46715
  const error = externalError;
46640
- const computeMetricValue = React104__default.useCallback(
46716
+ const computeMetricValue = React105__default.useCallback(
46641
46717
  (metric, items) => {
46642
46718
  if (metric.value !== void 0) {
46643
46719
  return metric.value;
@@ -46676,7 +46752,7 @@ var init_StatCard = __esm({
46676
46752
  },
46677
46753
  []
46678
46754
  );
46679
- const schemaStats = React104__default.useMemo(() => {
46755
+ const schemaStats = React105__default.useMemo(() => {
46680
46756
  if (!metrics || metrics.length === 0) return null;
46681
46757
  return metrics.map((metric) => ({
46682
46758
  label: metric.label,
@@ -46684,7 +46760,7 @@ var init_StatCard = __esm({
46684
46760
  format: metric.format
46685
46761
  }));
46686
46762
  }, [metrics, data, computeMetricValue]);
46687
- const calculatedTrend = React104__default.useMemo(() => {
46763
+ const calculatedTrend = React105__default.useMemo(() => {
46688
46764
  if (manualTrend !== void 0) return manualTrend;
46689
46765
  if (previousValue === void 0 || currentValue === void 0)
46690
46766
  return void 0;
@@ -47324,8 +47400,8 @@ var init_SubagentTracePanel = __esm({
47324
47400
  ] });
47325
47401
  };
47326
47402
  InlineActivityStream = ({ activities, autoScroll = true, className }) => {
47327
- const endRef = React104__default.useRef(null);
47328
- React104__default.useEffect(() => {
47403
+ const endRef = React105__default.useRef(null);
47404
+ React105__default.useEffect(() => {
47329
47405
  if (!autoScroll) return;
47330
47406
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
47331
47407
  }, [activities.length, autoScroll]);
@@ -47419,7 +47495,7 @@ var init_SubagentTracePanel = __esm({
47419
47495
  };
47420
47496
  SubagentRichCard = ({ subagent }) => {
47421
47497
  const { t } = useTranslate();
47422
- const activities = React104__default.useMemo(
47498
+ const activities = React105__default.useMemo(
47423
47499
  () => subagentMessagesToActivities(subagent.messages),
47424
47500
  [subagent.messages]
47425
47501
  );
@@ -47496,8 +47572,8 @@ var init_SubagentTracePanel = __esm({
47496
47572
  ] });
47497
47573
  };
47498
47574
  CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
47499
- const endRef = React104__default.useRef(null);
47500
- React104__default.useEffect(() => {
47575
+ const endRef = React105__default.useRef(null);
47576
+ React105__default.useEffect(() => {
47501
47577
  if (!autoScroll) return;
47502
47578
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
47503
47579
  }, [messages.length, autoScroll]);
@@ -47927,7 +48003,7 @@ var init_Timeline = __esm({
47927
48003
  }) => {
47928
48004
  const { t } = useTranslate();
47929
48005
  const entityData = entity ?? [];
47930
- const items = React104__default.useMemo(() => {
48006
+ const items = React105__default.useMemo(() => {
47931
48007
  if (propItems) return propItems;
47932
48008
  if (entityData.length === 0) return [];
47933
48009
  return entityData.map((record, idx) => {
@@ -48029,7 +48105,7 @@ var init_Timeline = __esm({
48029
48105
  }
48030
48106
  });
48031
48107
  function extractToastProps(children) {
48032
- if (!React104__default.isValidElement(children)) {
48108
+ if (!React105__default.isValidElement(children)) {
48033
48109
  if (typeof children === "string") {
48034
48110
  return { message: children };
48035
48111
  }
@@ -48071,7 +48147,7 @@ var init_ToastSlot = __esm({
48071
48147
  eventBus.emit(`${prefix}CLOSE`);
48072
48148
  };
48073
48149
  if (!isVisible) return null;
48074
- const isCustomContent = React104__default.isValidElement(children) && !message;
48150
+ const isCustomContent = React105__default.isValidElement(children) && !message;
48075
48151
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
48076
48152
  Toast,
48077
48153
  {
@@ -48088,7 +48164,7 @@ var init_ToastSlot = __esm({
48088
48164
  }
48089
48165
  });
48090
48166
  function lazyThree(name, loader) {
48091
- const Lazy = React104__default.lazy(
48167
+ const Lazy = React105__default.lazy(
48092
48168
  () => loader().then((m) => {
48093
48169
  const Resolved = m[name];
48094
48170
  if (!Resolved) {
@@ -48100,13 +48176,13 @@ function lazyThree(name, loader) {
48100
48176
  })
48101
48177
  );
48102
48178
  function ThreeWrapper(props) {
48103
- return React104__default.createElement(
48179
+ return React105__default.createElement(
48104
48180
  ThreeBoundary,
48105
48181
  { name },
48106
- React104__default.createElement(
48107
- React104__default.Suspense,
48182
+ React105__default.createElement(
48183
+ React105__default.Suspense,
48108
48184
  { fallback: null },
48109
- React104__default.createElement(Lazy, props)
48185
+ React105__default.createElement(Lazy, props)
48110
48186
  )
48111
48187
  );
48112
48188
  }
@@ -48267,6 +48343,7 @@ var init_component_registry_generated = __esm({
48267
48343
  init_Navigation();
48268
48344
  init_NegotiatorBoard();
48269
48345
  init_NumberStepper();
48346
+ init_ObjectRulePanel();
48270
48347
  init_OptionConstraintGroup();
48271
48348
  init_OrbitalVisualization();
48272
48349
  init_Overlay();
@@ -48328,7 +48405,9 @@ var init_component_registry_generated = __esm({
48328
48405
  init_StatCard();
48329
48406
  init_StatDisplay();
48330
48407
  init_StateArchitectBoard();
48408
+ init_StateGraph();
48331
48409
  init_StateIndicator();
48410
+ init_StateJsonView();
48332
48411
  init_StateMachineView();
48333
48412
  init_StatsGrid();
48334
48413
  init_StatsOrganism();
@@ -48375,6 +48454,7 @@ var init_component_registry_generated = __esm({
48375
48454
  init_Typography();
48376
48455
  init_UISlotRenderer();
48377
48456
  init_UploadDropZone();
48457
+ init_VariablePanel();
48378
48458
  init_VersionDiff();
48379
48459
  init_ViolationAlert();
48380
48460
  init_VoteStack();
@@ -48382,7 +48462,7 @@ var init_component_registry_generated = __esm({
48382
48462
  init_WizardContainer();
48383
48463
  init_WizardNavigation();
48384
48464
  init_WizardProgress();
48385
- ThreeBoundary = class extends React104__default.Component {
48465
+ ThreeBoundary = class extends React105__default.Component {
48386
48466
  constructor() {
48387
48467
  super(...arguments);
48388
48468
  __publicField(this, "state", { failed: false });
@@ -48392,7 +48472,7 @@ var init_component_registry_generated = __esm({
48392
48472
  }
48393
48473
  render() {
48394
48474
  if (this.state.failed) {
48395
- return React104__default.createElement(
48475
+ return React105__default.createElement(
48396
48476
  "div",
48397
48477
  {
48398
48478
  "data-testid": "three-unavailable",
@@ -48575,6 +48655,7 @@ var init_component_registry_generated = __esm({
48575
48655
  "Navigation": Navigation,
48576
48656
  "NegotiatorBoard": NegotiatorBoard,
48577
48657
  "NumberStepper": NumberStepper,
48658
+ "ObjectRulePanel": ObjectRulePanel,
48578
48659
  "OptionConstraintGroup": OptionConstraintGroup,
48579
48660
  "OrbitalVisualization": OrbitalVisualization,
48580
48661
  "Overlay": Overlay,
@@ -48639,7 +48720,9 @@ var init_component_registry_generated = __esm({
48639
48720
  "StatCard": StatCard,
48640
48721
  "StatDisplay": StatDisplay,
48641
48722
  "StateArchitectBoard": StateArchitectBoard,
48723
+ "StateGraph": StateGraph,
48642
48724
  "StateIndicator": StateIndicator,
48725
+ "StateJsonView": StateJsonView,
48643
48726
  "StateMachineView": StateMachineView,
48644
48727
  "StatsGrid": StatsGrid,
48645
48728
  "StatsOrganism": StatsOrganism,
@@ -48687,6 +48770,7 @@ var init_component_registry_generated = __esm({
48687
48770
  "UISlotRenderer": UISlotRenderer,
48688
48771
  "UploadDropZone": UploadDropZone,
48689
48772
  "VStack": VStack,
48773
+ "VariablePanel": VariablePanel,
48690
48774
  "VersionDiff": VersionDiff,
48691
48775
  "ViolationAlert": ViolationAlert,
48692
48776
  "VoteStack": VoteStack,
@@ -48712,7 +48796,7 @@ function SuspenseConfigProvider({
48712
48796
  config,
48713
48797
  children
48714
48798
  }) {
48715
- return React104__default.createElement(
48799
+ return React105__default.createElement(
48716
48800
  SuspenseConfigContext.Provider,
48717
48801
  { value: config },
48718
48802
  children
@@ -48754,7 +48838,7 @@ function enrichFormFields(fields, entityDef) {
48754
48838
  }
48755
48839
  return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
48756
48840
  }
48757
- if (field && typeof field === "object" && !Array.isArray(field) && !React104__default.isValidElement(field) && !(field instanceof Date)) {
48841
+ if (field && typeof field === "object" && !Array.isArray(field) && !React105__default.isValidElement(field) && !(field instanceof Date)) {
48758
48842
  const obj = field;
48759
48843
  const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
48760
48844
  if (!fieldName) return field;
@@ -49207,7 +49291,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
49207
49291
  const key = `${parentId}-${index}-trait:${traitName}`;
49208
49292
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
49209
49293
  }
49210
- return /* @__PURE__ */ jsx(React104__default.Fragment, { children: child }, `${parentId}-${index}`);
49294
+ return /* @__PURE__ */ jsx(React105__default.Fragment, { children: child }, `${parentId}-${index}`);
49211
49295
  }
49212
49296
  if (!child || typeof child !== "object") return null;
49213
49297
  const childId = `${parentId}-${index}`;
@@ -49247,14 +49331,14 @@ function isPatternConfig(value) {
49247
49331
  if (value === null || value === void 0) return false;
49248
49332
  if (typeof value !== "object") return false;
49249
49333
  if (Array.isArray(value)) return false;
49250
- if (React104__default.isValidElement(value)) return false;
49334
+ if (React105__default.isValidElement(value)) return false;
49251
49335
  if (value instanceof Date) return false;
49252
49336
  if (typeof value === "function") return false;
49253
49337
  const record = value;
49254
49338
  return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
49255
49339
  }
49256
49340
  function isPlainConfigObject(value) {
49257
- if (React104__default.isValidElement(value)) return false;
49341
+ if (React105__default.isValidElement(value)) return false;
49258
49342
  if (value instanceof Date) return false;
49259
49343
  const proto = Object.getPrototypeOf(value);
49260
49344
  return proto === Object.prototype || proto === null;
@@ -49380,7 +49464,7 @@ function SlotContentRenderer({
49380
49464
  for (const slotKey of CONTENT_NODE_SLOTS) {
49381
49465
  const slotVal = restProps[slotKey];
49382
49466
  if (slotVal === void 0 || slotVal === null) continue;
49383
- if (React104__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
49467
+ if (React105__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
49384
49468
  if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
49385
49469
  nodeSlotOverrides[slotKey] = renderPatternChildren(
49386
49470
  slotVal,
@@ -49429,7 +49513,7 @@ function SlotContentRenderer({
49429
49513
  const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
49430
49514
  if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
49431
49515
  const sample = resolvedItems[0];
49432
- if (sample && typeof sample === "object" && !Array.isArray(sample) && !React104__default.isValidElement(sample) && !(sample instanceof Date)) {
49516
+ if (sample && typeof sample === "object" && !Array.isArray(sample) && !React105__default.isValidElement(sample) && !(sample instanceof Date)) {
49433
49517
  const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
49434
49518
  finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
49435
49519
  }
@@ -49792,7 +49876,7 @@ var AvlTransition = ({
49792
49876
  opacity = 1,
49793
49877
  className
49794
49878
  }) => {
49795
- const ids = React104__default.useMemo(() => {
49879
+ const ids = React105__default.useMemo(() => {
49796
49880
  avlTransitionId += 1;
49797
49881
  return { arrow: `avl-tr-${avlTransitionId}-arrow` };
49798
49882
  }, []);
@@ -50353,7 +50437,7 @@ var AvlStateMachine = ({
50353
50437
  color = "var(--color-primary)",
50354
50438
  animated = false
50355
50439
  }) => {
50356
- const ids = React104__default.useMemo(() => {
50440
+ const ids = React105__default.useMemo(() => {
50357
50441
  avlSmId += 1;
50358
50442
  const base = `avl-sm-${avlSmId}`;
50359
50443
  return { glow: `${base}-glow`, grad: `${base}-grad` };
@@ -50552,7 +50636,7 @@ var AvlOrbitalUnit = ({
50552
50636
  color = "var(--color-primary)",
50553
50637
  animated = false
50554
50638
  }) => {
50555
- const ids = React104__default.useMemo(() => {
50639
+ const ids = React105__default.useMemo(() => {
50556
50640
  avlOuId += 1;
50557
50641
  const base = `avl-ou-${avlOuId}`;
50558
50642
  return { glow: `${base}-glow`, grad: `${base}-grad` };
@@ -50648,7 +50732,7 @@ var AvlClosedCircuit = ({
50648
50732
  color = "var(--color-primary)",
50649
50733
  animated = false
50650
50734
  }) => {
50651
- const ids = React104__default.useMemo(() => {
50735
+ const ids = React105__default.useMemo(() => {
50652
50736
  avlCcId += 1;
50653
50737
  const base = `avl-cc-${avlCcId}`;
50654
50738
  return { glow: `${base}-glow`, grad: `${base}-grad`, arrow: `${base}-arrow` };
@@ -50803,7 +50887,7 @@ var AvlEmitListen = ({
50803
50887
  color = "var(--color-primary)",
50804
50888
  animated = false
50805
50889
  }) => {
50806
- const ids = React104__default.useMemo(() => {
50890
+ const ids = React105__default.useMemo(() => {
50807
50891
  avlElId += 1;
50808
50892
  const base = `avl-el-${avlElId}`;
50809
50893
  return { arrow: `${base}-arrow`, grad: `${base}-grad` };
@@ -51077,7 +51161,7 @@ function renderNode(node, color, glowId) {
51077
51161
  const baseR = node.type === "operator" ? 20 : 16;
51078
51162
  const r2 = Math.max(baseR, labelLen * 3.5 + 6);
51079
51163
  const nc = nodeColor(node.type, color);
51080
- return /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
51164
+ return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
51081
51165
  node.children.map((child, i) => {
51082
51166
  const childR = Math.max(
51083
51167
  child.type === "operator" ? 20 : 16,
@@ -51134,7 +51218,7 @@ var AvlExprTree = ({
51134
51218
  className,
51135
51219
  color = "var(--color-primary)"
51136
51220
  }) => {
51137
- const ids = React104__default.useMemo(() => {
51221
+ const ids = React105__default.useMemo(() => {
51138
51222
  avlEtId += 1;
51139
51223
  return { glow: `avl-et-${avlEtId}-glow` };
51140
51224
  }, []);
@@ -51969,7 +52053,7 @@ var SystemNode = ({ data }) => {
51969
52053
  stateChain.length > 0 && /* @__PURE__ */ jsx("svg", { width: stateChain.length * 14 + 2, height: 10, viewBox: `0 0 ${stateChain.length * 14 + 2} 10`, children: stateChain.map((s, i) => {
51970
52054
  const tc = transitionCounts[s.name] ?? 0;
51971
52055
  const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
51972
- return /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
52056
+ return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
51973
52057
  /* @__PURE__ */ jsx(AvlState, { x: i * 14 + 1, y: 1, width: 10, height: 8, name: "", role, isInitial: s.isInitial ?? void 0, isTerminal: s.isTerminal ?? void 0 }),
51974
52058
  i < stateChain.length - 1 && /* @__PURE__ */ jsx("line", { x1: i * 14 + 12, y1: 5, x2: i * 14 + 15, y2: 5, stroke: "var(--color-border)", strokeWidth: 0.5 })
51975
52059
  ] }, s.name);
@@ -53114,7 +53198,7 @@ function resolveLambdaBindings(body, params, item, index) {
53114
53198
  if (Array.isArray(body)) {
53115
53199
  return body.map((b) => recur(b));
53116
53200
  }
53117
- if (body !== null && typeof body === "object" && !React104__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
53201
+ if (body !== null && typeof body === "object" && !React105__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
53118
53202
  const out = {};
53119
53203
  for (const [k, v] of Object.entries(body)) {
53120
53204
  out[k] = recur(v);
@@ -53133,7 +53217,7 @@ function getSlotContentRenderer2() {
53133
53217
  function makeLambdaFn(params, lambdaBody, callerKey) {
53134
53218
  return (item, index) => {
53135
53219
  const resolvedBody = resolveLambdaBindings(lambdaBody, params, item, index);
53136
- if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React104__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
53220
+ if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React105__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
53137
53221
  return null;
53138
53222
  }
53139
53223
  const record = resolvedBody;
@@ -53152,7 +53236,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
53152
53236
  props: childProps,
53153
53237
  priority: 0
53154
53238
  };
53155
- return React104__default.createElement(SlotContentRenderer2, { content: childContent });
53239
+ return React105__default.createElement(SlotContentRenderer2, { content: childContent });
53156
53240
  };
53157
53241
  }
53158
53242
  function convertNode(node, callerKey) {
@@ -53171,7 +53255,7 @@ function convertNode(node, callerKey) {
53171
53255
  });
53172
53256
  return anyChanged ? mapped : node;
53173
53257
  }
53174
- if (typeof node === "object" && !React104__default.isValidElement(node) && !(node instanceof Date)) {
53258
+ if (typeof node === "object" && !React105__default.isValidElement(node) && !(node instanceof Date)) {
53175
53259
  return convertObjectProps(node);
53176
53260
  }
53177
53261
  return node;
@@ -54834,8 +54918,8 @@ function CanvasDndProvider({
54834
54918
  }) {
54835
54919
  const eventBus = useEventBus();
54836
54920
  const sensors = useAlmadarDndSensors(false);
54837
- const [activePayload, setActivePayload] = React104__default.useState(null);
54838
- const handleDragStart = React104__default.useCallback((e) => {
54921
+ const [activePayload, setActivePayload] = React105__default.useState(null);
54922
+ const handleDragStart = React105__default.useCallback((e) => {
54839
54923
  const data = e.active.data.current;
54840
54924
  const payload = data?.payload;
54841
54925
  if (payload) {
@@ -54846,7 +54930,7 @@ function CanvasDndProvider({
54846
54930
  log9.warn("dragStart:missing-payload", { id: e.active.id });
54847
54931
  }
54848
54932
  }, [eventBus]);
54849
- const handleDragEnd = React104__default.useCallback((e) => {
54933
+ const handleDragEnd = React105__default.useCallback((e) => {
54850
54934
  setActivePayload(null);
54851
54935
  const activeData = e.active.data.current;
54852
54936
  const payload = activeData?.payload;
@@ -54875,7 +54959,7 @@ function CanvasDndProvider({
54875
54959
  const suppressed = onDrop ? onDrop(drop) === true : false;
54876
54960
  if (!suppressed) defaultEmit(eventBus, drop);
54877
54961
  }, [eventBus, onDrop]);
54878
- const handleDragCancel = React104__default.useCallback(() => {
54962
+ const handleDragCancel = React105__default.useCallback(() => {
54879
54963
  setActivePayload(null);
54880
54964
  log9.info("dragCancel");
54881
54965
  }, []);
@@ -55633,7 +55717,7 @@ var OrbPreviewNodeInner = (props) => {
55633
55717
  }
55634
55718
  );
55635
55719
  };
55636
- var OrbPreviewNode = React104__default.memo(OrbPreviewNodeInner);
55720
+ var OrbPreviewNode = React105__default.memo(OrbPreviewNodeInner);
55637
55721
  OrbPreviewNode.displayName = "OrbPreviewNode";
55638
55722
  orbPreviewLog.debug("export-resolved", () => ({
55639
55723
  type: typeof OrbPreviewNode,
@@ -55738,7 +55822,7 @@ var EventFlowEdgeInner = (props) => {
55738
55822
  ) })
55739
55823
  ] });
55740
55824
  };
55741
- var EventFlowEdge = React104__default.memo(EventFlowEdgeInner);
55825
+ var EventFlowEdge = React105__default.memo(EventFlowEdgeInner);
55742
55826
  EventFlowEdge.displayName = "EventFlowEdge";
55743
55827
 
55744
55828
  // components/avl/molecules/BehaviorComposeNode.tsx
@@ -55885,7 +55969,7 @@ var BehaviorComposeNodeInner = (props) => {
55885
55969
  }
55886
55970
  );
55887
55971
  };
55888
- var BehaviorComposeNode = React104__default.memo(BehaviorComposeNodeInner);
55972
+ var BehaviorComposeNode = React105__default.memo(BehaviorComposeNodeInner);
55889
55973
  BehaviorComposeNode.displayName = "BehaviorComposeNode";
55890
55974
 
55891
55975
  // components/avl/lib/avl-behavior-compose-converter.ts
@@ -56911,7 +56995,7 @@ var TraitCardNodeInner = (props) => {
56911
56995
  }
56912
56996
  );
56913
56997
  };
56914
- var TraitCardNode = React104__default.memo(TraitCardNodeInner);
56998
+ var TraitCardNode = React105__default.memo(TraitCardNodeInner);
56915
56999
  TraitCardNode.displayName = "TraitCardNode";
56916
57000
 
56917
57001
  // components/avl/organisms/FlowCanvas.tsx
@@ -56984,7 +57068,7 @@ function FlowCanvasInner({
56984
57068
  initialOrbital
56985
57069
  );
56986
57070
  const [expandedBehaviorAlias, setExpandedBehaviorAlias] = useState(void 0);
56987
- const screenSizeUserOverrideRef = React104__default.useRef(false);
57071
+ const screenSizeUserOverrideRef = React105__default.useRef(false);
56988
57072
  const [screenSize, setScreenSize] = useState(
56989
57073
  () => typeof window === "undefined" ? "laptop" : detectScreenSize(window.innerWidth)
56990
57074
  );
@@ -57368,7 +57452,7 @@ var ZoomBreadcrumb = ({
57368
57452
  if (eventName && band === "detail") {
57369
57453
  segments.push({ icon: "\u26A1", label: eventName });
57370
57454
  }
57371
- return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-xs text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
57455
+ return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-xs text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
57372
57456
  i > 0 && /* @__PURE__ */ jsx("span", { className: "opacity-40", children: ">" }),
57373
57457
  /* @__PURE__ */ jsx("span", { className: "opacity-60", children: seg.icon }),
57374
57458
  /* @__PURE__ */ jsx("span", { children: seg.label })
@@ -57709,7 +57793,7 @@ var EventWireOverlay = ({
57709
57793
  containerW,
57710
57794
  containerH
57711
57795
  }) => {
57712
- const ids = React104__default.useMemo(() => {
57796
+ const ids = React105__default.useMemo(() => {
57713
57797
  avlOczWireId += 1;
57714
57798
  return { arrow: `avl-ocz-wire-${avlOczWireId}-arrow` };
57715
57799
  }, []);
@@ -58076,7 +58160,7 @@ var AvlOrbitalsCosmicZoom = ({
58076
58160
  borderRadius: 6,
58077
58161
  border: `1px solid ${color}`
58078
58162
  },
58079
- children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
58163
+ children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
58080
58164
  i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", style: { opacity: 0.5, color }, children: "/" }),
58081
58165
  i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
58082
58166
  Box,