@almadar/ui 5.91.0 → 5.94.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import * as React96 from 'react';
2
- import React96__default, { useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, createContext, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
1
+ import * as React95 from 'react';
2
+ import React95__default, { useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, createContext, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
3
3
  import { EventBusContext, useTraitScope, useEntitySchemaOptional, useEntitySchema, getAllPages, OrbitalProvider, TraitScopeProvider, ServerBridgeProvider, useCurrentPagePath, VerificationProvider, EntitySchemaProvider, OrbitalThemeProvider, useServerBridge } from '@almadar/ui/providers';
4
4
  export { EntitySchemaProvider, ServerBridgeProvider, TraitContext, TraitProvider, useEntitySchema, useEntitySchemaOptional, useServerBridge, useTrait, useTraitContext } from '@almadar/ui/providers';
5
5
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
@@ -43,7 +43,7 @@ import { useSortable, arrayMove, sortableKeyboardCoordinates, SortableContext, r
43
43
  import { CSS } from '@dnd-kit/utilities';
44
44
  import { useNodeId, ReactFlowProvider, Handle, Position } from '@xyflow/react';
45
45
  import { getPatternDefinition, getComponentForPattern as getComponentForPattern$1 } from '@almadar/patterns';
46
- import { StateMachineManager, collectDeclaredConfigDefaults, createServerEffectHandlers, EffectExecutor, createContextFromBindings, InMemoryPersistence } from '@almadar/runtime';
46
+ import { StateMachineManager, collectDeclaredConfigDefaults, createServerEffectHandlers, EffectExecutor, createContextFromBindings, createTickScheduler, InMemoryPersistence } from '@almadar/runtime';
47
47
  import { OrbitalServerRuntime } from '@almadar/runtime/OrbitalServerRuntime';
48
48
 
49
49
  var __defProp = Object.defineProperty;
@@ -937,7 +937,7 @@ var init_Box = __esm({
937
937
  fixed: "fixed",
938
938
  sticky: "sticky"
939
939
  };
940
- Box = React96__default.forwardRef(
940
+ Box = React95__default.forwardRef(
941
941
  ({
942
942
  padding,
943
943
  paddingX,
@@ -1002,7 +1002,7 @@ var init_Box = __esm({
1002
1002
  onPointerDown?.(e);
1003
1003
  }, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
1004
1004
  const isClickable = action || onClick;
1005
- return React96__default.createElement(
1005
+ return React95__default.createElement(
1006
1006
  Component,
1007
1007
  {
1008
1008
  ref,
@@ -1098,7 +1098,7 @@ function loadLib(key, importer) {
1098
1098
  return p;
1099
1099
  }
1100
1100
  function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
1101
- const Lazy = React96__default.lazy(async () => {
1101
+ const Lazy = React95__default.lazy(async () => {
1102
1102
  const lib = await loadLib(libKey, importer);
1103
1103
  const Comp = pick(lib);
1104
1104
  if (!Comp) {
@@ -1108,7 +1108,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
1108
1108
  return { default: Comp };
1109
1109
  });
1110
1110
  const Wrapped = (props) => /* @__PURE__ */ jsx(
1111
- React96__default.Suspense,
1111
+ React95__default.Suspense,
1112
1112
  {
1113
1113
  fallback: /* @__PURE__ */ jsx(
1114
1114
  "span",
@@ -1839,7 +1839,7 @@ var init_Icon = __esm({
1839
1839
  const directIcon = typeof icon === "string" ? void 0 : icon;
1840
1840
  const effectiveName = typeof icon === "string" ? icon : name;
1841
1841
  const family = useIconFamily();
1842
- const RenderedComponent = React96__default.useMemo(() => {
1842
+ const RenderedComponent = React95__default.useMemo(() => {
1843
1843
  if (directIcon) return null;
1844
1844
  return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
1845
1845
  }, [directIcon, effectiveName, family]);
@@ -1901,7 +1901,7 @@ function resolveIconProp(value, sizeClass) {
1901
1901
  const IconComp = value;
1902
1902
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
1903
1903
  }
1904
- if (React96__default.isValidElement(value)) {
1904
+ if (React95__default.isValidElement(value)) {
1905
1905
  return value;
1906
1906
  }
1907
1907
  if (typeof value === "object" && value !== null && isIconLike(value)) {
@@ -1977,7 +1977,7 @@ var init_Button = __esm({
1977
1977
  md: "h-icon-default w-icon-default",
1978
1978
  lg: "h-icon-default w-icon-default"
1979
1979
  };
1980
- Button = React96__default.forwardRef(
1980
+ Button = React95__default.forwardRef(
1981
1981
  ({
1982
1982
  className,
1983
1983
  variant = "primary",
@@ -2045,7 +2045,7 @@ var Dialog;
2045
2045
  var init_Dialog = __esm({
2046
2046
  "components/core/atoms/Dialog.tsx"() {
2047
2047
  init_cn();
2048
- Dialog = React96__default.forwardRef(
2048
+ Dialog = React95__default.forwardRef(
2049
2049
  ({
2050
2050
  role = "dialog",
2051
2051
  "aria-modal": ariaModal = true,
@@ -2163,7 +2163,7 @@ var init_Typography = __esm({
2163
2163
  }) => {
2164
2164
  const variant = variantProp ?? (level ? `h${level}` : "body1");
2165
2165
  const Component = as || defaultElements[variant];
2166
- return React96__default.createElement(
2166
+ return React95__default.createElement(
2167
2167
  Component,
2168
2168
  {
2169
2169
  id,
@@ -2658,7 +2658,7 @@ var init_Badge = __esm({
2658
2658
  md: "px-2.5 py-1 text-sm",
2659
2659
  lg: "px-3 py-1.5 text-base"
2660
2660
  };
2661
- Badge = React96__default.forwardRef(
2661
+ Badge = React95__default.forwardRef(
2662
2662
  ({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
2663
2663
  const iconSizes3 = {
2664
2664
  sm: "h-icon-default w-icon-default",
@@ -2995,7 +2995,7 @@ var init_SvgFlow = __esm({
2995
2995
  width = 100,
2996
2996
  height = 100
2997
2997
  }) => {
2998
- const markerId = React96__default.useMemo(() => {
2998
+ const markerId = React95__default.useMemo(() => {
2999
2999
  flowIdCounter += 1;
3000
3000
  return `almadar-flow-arrow-${flowIdCounter}`;
3001
3001
  }, []);
@@ -3588,7 +3588,7 @@ var init_SvgRing = __esm({
3588
3588
  width = 100,
3589
3589
  height = 100
3590
3590
  }) => {
3591
- const gradientId = React96__default.useMemo(() => {
3591
+ const gradientId = React95__default.useMemo(() => {
3592
3592
  ringIdCounter += 1;
3593
3593
  return `almadar-ring-glow-${ringIdCounter}`;
3594
3594
  }, []);
@@ -3769,7 +3769,7 @@ var init_Input = __esm({
3769
3769
  init_cn();
3770
3770
  init_Icon();
3771
3771
  init_useEventBus();
3772
- Input = React96__default.forwardRef(
3772
+ Input = React95__default.forwardRef(
3773
3773
  ({
3774
3774
  className,
3775
3775
  inputType,
@@ -3929,7 +3929,7 @@ var Label;
3929
3929
  var init_Label = __esm({
3930
3930
  "components/core/atoms/Label.tsx"() {
3931
3931
  init_cn();
3932
- Label = React96__default.forwardRef(
3932
+ Label = React95__default.forwardRef(
3933
3933
  ({ className, required, children, ...props }, ref) => {
3934
3934
  return /* @__PURE__ */ jsxs(
3935
3935
  "label",
@@ -3956,7 +3956,7 @@ var init_Textarea = __esm({
3956
3956
  "components/core/atoms/Textarea.tsx"() {
3957
3957
  init_cn();
3958
3958
  init_useEventBus();
3959
- Textarea = React96__default.forwardRef(
3959
+ Textarea = React95__default.forwardRef(
3960
3960
  ({ className, error, onChange, ...props }, ref) => {
3961
3961
  const eventBus = useEventBus();
3962
3962
  const handleChange = (e) => {
@@ -4195,7 +4195,7 @@ var init_Select = __esm({
4195
4195
  init_cn();
4196
4196
  init_Icon();
4197
4197
  init_useEventBus();
4198
- Select = React96__default.forwardRef(
4198
+ Select = React95__default.forwardRef(
4199
4199
  (props, _ref) => {
4200
4200
  const { multiple, searchable, clearable } = props;
4201
4201
  if (multiple || searchable || clearable) {
@@ -4212,7 +4212,7 @@ var init_Checkbox = __esm({
4212
4212
  "components/core/atoms/Checkbox.tsx"() {
4213
4213
  init_cn();
4214
4214
  init_useEventBus();
4215
- Checkbox = React96__default.forwardRef(
4215
+ Checkbox = React95__default.forwardRef(
4216
4216
  ({ className, label, id, onChange, ...props }, ref) => {
4217
4217
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
4218
4218
  const eventBus = useEventBus();
@@ -4266,7 +4266,7 @@ var init_Spinner = __esm({
4266
4266
  md: "h-6 w-6",
4267
4267
  lg: "h-8 w-8"
4268
4268
  };
4269
- Spinner = React96__default.forwardRef(
4269
+ Spinner = React95__default.forwardRef(
4270
4270
  ({ className, size = "md", overlay, ...props }, ref) => {
4271
4271
  if (overlay) {
4272
4272
  return /* @__PURE__ */ jsx(
@@ -4356,7 +4356,7 @@ var init_Card = __esm({
4356
4356
  chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
4357
4357
  "tile-image-first": "p-0 overflow-hidden"
4358
4358
  };
4359
- Card = React96__default.forwardRef(
4359
+ Card = React95__default.forwardRef(
4360
4360
  ({
4361
4361
  className,
4362
4362
  variant = "bordered",
@@ -4404,9 +4404,9 @@ var init_Card = __esm({
4404
4404
  }
4405
4405
  );
4406
4406
  Card.displayName = "Card";
4407
- CardHeader = React96__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
4407
+ CardHeader = React95__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
4408
4408
  CardHeader.displayName = "CardHeader";
4409
- CardTitle = React96__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
4409
+ CardTitle = React95__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
4410
4410
  "h3",
4411
4411
  {
4412
4412
  ref,
@@ -4419,11 +4419,11 @@ var init_Card = __esm({
4419
4419
  }
4420
4420
  ));
4421
4421
  CardTitle.displayName = "CardTitle";
4422
- CardContent = React96__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
4422
+ CardContent = React95__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
4423
4423
  CardContent.displayName = "CardContent";
4424
4424
  CardBody = CardContent;
4425
4425
  CardBody.displayName = "CardBody";
4426
- CardFooter = React96__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
4426
+ CardFooter = React95__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
4427
4427
  "div",
4428
4428
  {
4429
4429
  ref,
@@ -4478,7 +4478,7 @@ var init_FilterPill = __esm({
4478
4478
  md: "w-3.5 h-3.5",
4479
4479
  lg: "w-4 h-4"
4480
4480
  };
4481
- FilterPill = React96__default.forwardRef(
4481
+ FilterPill = React95__default.forwardRef(
4482
4482
  ({
4483
4483
  className,
4484
4484
  variant = "default",
@@ -4607,8 +4607,8 @@ var init_Avatar = __esm({
4607
4607
  actionPayload
4608
4608
  }) => {
4609
4609
  const eventBus = useEventBus();
4610
- const [imgFailed, setImgFailed] = React96__default.useState(false);
4611
- React96__default.useEffect(() => {
4610
+ const [imgFailed, setImgFailed] = React95__default.useState(false);
4611
+ React95__default.useEffect(() => {
4612
4612
  setImgFailed(false);
4613
4613
  }, [src]);
4614
4614
  const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
@@ -4721,7 +4721,7 @@ var init_Center = __esm({
4721
4721
  as: Component = "div"
4722
4722
  }) => {
4723
4723
  const mergedStyle = minHeight ? { minHeight, ...style } : style;
4724
- return React96__default.createElement(Component, {
4724
+ return React95__default.createElement(Component, {
4725
4725
  className: cn(
4726
4726
  inline ? "inline-flex" : "flex",
4727
4727
  horizontal && "justify-center",
@@ -4989,7 +4989,7 @@ var init_Radio = __esm({
4989
4989
  md: "w-2.5 h-2.5",
4990
4990
  lg: "w-3 h-3"
4991
4991
  };
4992
- Radio = React96__default.forwardRef(
4992
+ Radio = React95__default.forwardRef(
4993
4993
  ({
4994
4994
  label,
4995
4995
  helperText,
@@ -5006,12 +5006,12 @@ var init_Radio = __esm({
5006
5006
  onChange,
5007
5007
  ...props
5008
5008
  }, ref) => {
5009
- const reactId = React96__default.useId();
5009
+ const reactId = React95__default.useId();
5010
5010
  const baseId = id || `radio-${reactId}`;
5011
5011
  const hasError = !!error;
5012
5012
  const eventBus = useEventBus();
5013
- const [selected, setSelected] = React96__default.useState(value);
5014
- React96__default.useEffect(() => {
5013
+ const [selected, setSelected] = React95__default.useState(value);
5014
+ React95__default.useEffect(() => {
5015
5015
  if (value !== void 0) setSelected(value);
5016
5016
  }, [value]);
5017
5017
  const pick = (next, e) => {
@@ -5193,7 +5193,7 @@ var init_Switch = __esm({
5193
5193
  "components/core/atoms/Switch.tsx"() {
5194
5194
  "use client";
5195
5195
  init_cn();
5196
- Switch = React96.forwardRef(
5196
+ Switch = React95.forwardRef(
5197
5197
  ({
5198
5198
  checked,
5199
5199
  defaultChecked = false,
@@ -5204,10 +5204,10 @@ var init_Switch = __esm({
5204
5204
  name,
5205
5205
  className
5206
5206
  }, ref) => {
5207
- const [isChecked, setIsChecked] = React96.useState(
5207
+ const [isChecked, setIsChecked] = React95.useState(
5208
5208
  checked !== void 0 ? checked : defaultChecked
5209
5209
  );
5210
- React96.useEffect(() => {
5210
+ React95.useEffect(() => {
5211
5211
  if (checked !== void 0) {
5212
5212
  setIsChecked(checked);
5213
5213
  }
@@ -5370,7 +5370,7 @@ var init_Stack = __esm({
5370
5370
  };
5371
5371
  const isHorizontal = direction === "horizontal";
5372
5372
  const directionClass = responsive && isHorizontal ? reverse ? "flex-col-reverse md:flex-row-reverse" : "flex-col md:flex-row" : isHorizontal ? reverse ? "flex-row-reverse" : "flex-row" : reverse ? "flex-col-reverse" : "flex-col";
5373
- return React96__default.createElement(
5373
+ return React95__default.createElement(
5374
5374
  Component,
5375
5375
  {
5376
5376
  className: cn(
@@ -5570,7 +5570,7 @@ var Aside;
5570
5570
  var init_Aside = __esm({
5571
5571
  "components/core/atoms/Aside.tsx"() {
5572
5572
  init_cn();
5573
- Aside = React96__default.forwardRef(
5573
+ Aside = React95__default.forwardRef(
5574
5574
  ({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
5575
5575
  );
5576
5576
  Aside.displayName = "Aside";
@@ -5649,9 +5649,9 @@ var init_LawReferenceTooltip = __esm({
5649
5649
  className
5650
5650
  }) => {
5651
5651
  const { t } = useTranslate();
5652
- const [isVisible, setIsVisible] = React96__default.useState(false);
5653
- const timeoutRef = React96__default.useRef(null);
5654
- const triggerRef = React96__default.useRef(null);
5652
+ const [isVisible, setIsVisible] = React95__default.useState(false);
5653
+ const timeoutRef = React95__default.useRef(null);
5654
+ const triggerRef = React95__default.useRef(null);
5655
5655
  const handleMouseEnter = () => {
5656
5656
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
5657
5657
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -5662,7 +5662,7 @@ var init_LawReferenceTooltip = __esm({
5662
5662
  };
5663
5663
  const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
5664
5664
  const open = isVisible || revealed;
5665
- React96__default.useEffect(() => {
5665
+ React95__default.useEffect(() => {
5666
5666
  return () => {
5667
5667
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
5668
5668
  };
@@ -5872,7 +5872,7 @@ var init_StatusDot = __esm({
5872
5872
  md: "w-2.5 h-2.5",
5873
5873
  lg: "w-3 h-3"
5874
5874
  };
5875
- StatusDot = React96__default.forwardRef(
5875
+ StatusDot = React95__default.forwardRef(
5876
5876
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
5877
5877
  return /* @__PURE__ */ jsx(
5878
5878
  "span",
@@ -5926,7 +5926,7 @@ var init_TrendIndicator = __esm({
5926
5926
  down: "trending-down",
5927
5927
  flat: "arrow-right"
5928
5928
  };
5929
- TrendIndicator = React96__default.forwardRef(
5929
+ TrendIndicator = React95__default.forwardRef(
5930
5930
  ({
5931
5931
  className,
5932
5932
  value,
@@ -5993,7 +5993,7 @@ var init_RangeSlider = __esm({
5993
5993
  md: "w-4 h-4",
5994
5994
  lg: "w-5 h-5"
5995
5995
  };
5996
- RangeSlider = React96__default.forwardRef(
5996
+ RangeSlider = React95__default.forwardRef(
5997
5997
  ({
5998
5998
  className,
5999
5999
  min = 0,
@@ -6552,7 +6552,7 @@ var init_ContentSection = __esm({
6552
6552
  md: "py-16",
6553
6553
  lg: "py-24"
6554
6554
  };
6555
- ContentSection = React96__default.forwardRef(
6555
+ ContentSection = React95__default.forwardRef(
6556
6556
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
6557
6557
  return /* @__PURE__ */ jsx(
6558
6558
  Box,
@@ -7086,7 +7086,7 @@ var init_AnimatedReveal = __esm({
7086
7086
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
7087
7087
  "none": {}
7088
7088
  };
7089
- AnimatedReveal = React96__default.forwardRef(
7089
+ AnimatedReveal = React95__default.forwardRef(
7090
7090
  ({
7091
7091
  trigger = "scroll",
7092
7092
  animation = "fade-up",
@@ -7246,7 +7246,7 @@ var init_AnimatedGraphic = __esm({
7246
7246
  "components/marketing/atoms/AnimatedGraphic.tsx"() {
7247
7247
  "use client";
7248
7248
  init_cn();
7249
- AnimatedGraphic = React96__default.forwardRef(
7249
+ AnimatedGraphic = React95__default.forwardRef(
7250
7250
  ({
7251
7251
  src,
7252
7252
  svgContent,
@@ -7269,7 +7269,7 @@ var init_AnimatedGraphic = __esm({
7269
7269
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
7270
7270
  const resolvedSvg = svgContent ?? fetchedSvg;
7271
7271
  const prevAnimateRef = useRef(animate);
7272
- const setRef = React96__default.useCallback(
7272
+ const setRef = React95__default.useCallback(
7273
7273
  (node) => {
7274
7274
  containerRef.current = node;
7275
7275
  if (typeof ref === "function") ref(node);
@@ -7871,12 +7871,13 @@ function GameCard({
7871
7871
  selected = false,
7872
7872
  disabled = false,
7873
7873
  size = "md",
7874
+ animState = "idle",
7874
7875
  onClick,
7875
7876
  clickEvent,
7876
7877
  className
7877
7878
  }) {
7878
7879
  const eventBus = useEventBus();
7879
- const handleClick = React96.useCallback(() => {
7880
+ const handleClick = React95.useCallback(() => {
7880
7881
  if (disabled) return;
7881
7882
  onClick?.(id);
7882
7883
  if (clickEvent) eventBus.emit(`UI:${clickEvent}`, { cardId: id });
@@ -7898,6 +7899,7 @@ function GameCard({
7898
7899
  cardSizeMap[size],
7899
7900
  disabled ? "border-border opacity-50 cursor-not-allowed" : "border-accent hover:brightness-125 hover:-translate-y-1 cursor-pointer",
7900
7901
  selected && "ring-2 ring-foreground ring-offset-1 ring-offset-background -translate-y-1",
7902
+ ANIM_STATE_CLASS[animState],
7901
7903
  className
7902
7904
  ),
7903
7905
  children: [
@@ -7930,7 +7932,7 @@ function GameCard({
7930
7932
  }
7931
7933
  );
7932
7934
  }
7933
- var cardSizeMap, artPxMap;
7935
+ var cardSizeMap, artPxMap, ANIM_STATE_CLASS;
7934
7936
  var init_GameCard = __esm({
7935
7937
  "components/game/2d/atoms/GameCard.tsx"() {
7936
7938
  "use client";
@@ -7946,6 +7948,12 @@ var init_GameCard = __esm({
7946
7948
  lg: "w-24 h-36"
7947
7949
  };
7948
7950
  artPxMap = { sm: 40, md: 52, lg: 64 };
7951
+ ANIM_STATE_CLASS = {
7952
+ idle: "",
7953
+ drawn: "scale-105",
7954
+ played: "-translate-y-2 opacity-80",
7955
+ flipped: "scale-x-0"
7956
+ };
7949
7957
  GameCard.displayName = "GameCard";
7950
7958
  }
7951
7959
  });
@@ -8158,9 +8166,9 @@ function ControlButton({
8158
8166
  className
8159
8167
  }) {
8160
8168
  const eventBus = useEventBus();
8161
- const [isPressed, setIsPressed] = React96.useState(false);
8169
+ const [isPressed, setIsPressed] = React95.useState(false);
8162
8170
  const actualPressed = pressed ?? isPressed;
8163
- const handlePointerDown = React96.useCallback(
8171
+ const handlePointerDown = React95.useCallback(
8164
8172
  (e) => {
8165
8173
  e.preventDefault();
8166
8174
  if (disabled) return;
@@ -8170,7 +8178,7 @@ function ControlButton({
8170
8178
  },
8171
8179
  [disabled, pressEvent, eventBus, onPress]
8172
8180
  );
8173
- const handlePointerUp = React96.useCallback(
8181
+ const handlePointerUp = React95.useCallback(
8174
8182
  (e) => {
8175
8183
  e.preventDefault();
8176
8184
  if (disabled) return;
@@ -8180,7 +8188,7 @@ function ControlButton({
8180
8188
  },
8181
8189
  [disabled, releaseEvent, eventBus, onRelease]
8182
8190
  );
8183
- const handlePointerLeave = React96.useCallback(
8191
+ const handlePointerLeave = React95.useCallback(
8184
8192
  (e) => {
8185
8193
  if (isPressed) {
8186
8194
  setIsPressed(false);
@@ -8986,8 +8994,11 @@ function DialogueBubble({
8986
8994
  text = "The dungeon awaits. Choose your path wisely.",
8987
8995
  portrait = DEFAULT_PORTRAIT,
8988
8996
  position = "bottom",
8997
+ mood = "neutral",
8998
+ revealedChars,
8989
8999
  className
8990
9000
  }) {
9001
+ const visibleText = revealedChars === void 0 ? text : text.slice(0, revealedChars);
8991
9002
  return /* @__PURE__ */ jsxs(
8992
9003
  Box,
8993
9004
  {
@@ -8997,16 +9008,16 @@ function DialogueBubble({
8997
9008
  className
8998
9009
  ),
8999
9010
  children: [
9000
- portrait && /* @__PURE__ */ jsx(Box, { className: "flex-shrink-0 w-12 h-12 rounded-full overflow-hidden border-2 border-warning/60", children: /* @__PURE__ */ jsx(GameIcon, { assetUrl: portrait, icon: "image", size: 48, alt: speaker ?? "speaker", className: "w-full h-full object-cover" }) }),
9011
+ portrait && /* @__PURE__ */ jsx(Box, { className: cn("flex-shrink-0 w-12 h-12 rounded-full overflow-hidden border-2 transition-colors duration-300", MOOD_RING_CLASS[mood]), children: /* @__PURE__ */ jsx(GameIcon, { assetUrl: portrait, icon: "image", size: 48, alt: speaker ?? "speaker", className: "w-full h-full object-cover" }) }),
9001
9012
  /* @__PURE__ */ jsxs(Box, { className: "flex flex-col gap-1 min-w-0", children: [
9002
9013
  speaker && /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-sm font-bold text-warning", children: speaker }),
9003
- /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-sm text-foreground leading-relaxed", children: text })
9014
+ /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-sm text-foreground leading-relaxed", children: visibleText })
9004
9015
  ] })
9005
9016
  ]
9006
9017
  }
9007
9018
  );
9008
9019
  }
9009
- var DEFAULT_PORTRAIT;
9020
+ var DEFAULT_PORTRAIT, MOOD_RING_CLASS;
9010
9021
  var init_DialogueBubble = __esm({
9011
9022
  "components/game/2d/atoms/DialogueBubble.tsx"() {
9012
9023
  init_cn();
@@ -9018,6 +9029,12 @@ var init_DialogueBubble = __esm({
9018
9029
  role: "effect",
9019
9030
  category: "character"
9020
9031
  };
9032
+ MOOD_RING_CLASS = {
9033
+ neutral: "border-warning/60",
9034
+ happy: "border-success/70",
9035
+ concerned: "border-info/70",
9036
+ angry: "border-error/70"
9037
+ };
9021
9038
  DialogueBubble.displayName = "DialogueBubble";
9022
9039
  }
9023
9040
  });
@@ -9199,8 +9216,8 @@ function MiniMap({
9199
9216
  tileAssets,
9200
9217
  unitAssets
9201
9218
  }) {
9202
- const canvasRef = React96.useRef(null);
9203
- const imgCacheRef = React96.useRef(/* @__PURE__ */ new Map());
9219
+ const canvasRef = React95.useRef(null);
9220
+ const imgCacheRef = React95.useRef(/* @__PURE__ */ new Map());
9204
9221
  function loadImg(url) {
9205
9222
  const cached = imgCacheRef.current.get(url);
9206
9223
  if (cached) return cached.complete ? cached : null;
@@ -9215,7 +9232,7 @@ function MiniMap({
9215
9232
  imgCacheRef.current.set(url, img);
9216
9233
  return null;
9217
9234
  }
9218
- React96.useEffect(() => {
9235
+ React95.useEffect(() => {
9219
9236
  const canvas = canvasRef.current;
9220
9237
  if (!canvas) return;
9221
9238
  const ctx = canvas.getContext("2d");
@@ -9350,8 +9367,8 @@ function ControlGrid({
9350
9367
  className
9351
9368
  }) {
9352
9369
  const eventBus = useEventBus();
9353
- const [active, setActive] = React96.useState(/* @__PURE__ */ new Set());
9354
- const handlePress = React96.useCallback(
9370
+ const [active, setActive] = React95.useState(/* @__PURE__ */ new Set());
9371
+ const handlePress = React95.useCallback(
9355
9372
  (id) => {
9356
9373
  setActive((prev) => new Set(prev).add(id));
9357
9374
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -9365,7 +9382,7 @@ function ControlGrid({
9365
9382
  },
9366
9383
  [kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
9367
9384
  );
9368
- const handleRelease = React96.useCallback(
9385
+ const handleRelease = React95.useCallback(
9369
9386
  (id) => {
9370
9387
  setActive((prev) => {
9371
9388
  const next = new Set(prev);
@@ -9623,7 +9640,7 @@ function InventoryGrid({
9623
9640
  const eventBus = useEventBus();
9624
9641
  const slotCount = totalSlots ?? items.length;
9625
9642
  const emptySlotCount = Math.max(0, slotCount - items.length);
9626
- const handleSelect = React96.useCallback(
9643
+ const handleSelect = React95.useCallback(
9627
9644
  (id) => {
9628
9645
  onSelect?.(id);
9629
9646
  if (selectEvent) {
@@ -9840,7 +9857,7 @@ function GameMenu({
9840
9857
  }) {
9841
9858
  const resolvedOptions = options ?? menuItems ?? DEFAULT_MENU_OPTIONS;
9842
9859
  const eventBus = useEventBus();
9843
- const handleOptionClick = React96.useCallback(
9860
+ const handleOptionClick = React95.useCallback(
9844
9861
  (option) => {
9845
9862
  if (option.event) {
9846
9863
  eventBus.emit(`UI:${option.event}`, { option });
@@ -10066,7 +10083,7 @@ function StateGraph({
10066
10083
  }) {
10067
10084
  const eventBus = useEventBus();
10068
10085
  const nodes = states ?? [];
10069
- const positions = React96.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
10086
+ const positions = React95.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
10070
10087
  return /* @__PURE__ */ jsxs(
10071
10088
  Box,
10072
10089
  {
@@ -10653,6 +10670,7 @@ function Canvas2D({
10653
10670
  unitScale = 1,
10654
10671
  showMinimap = true,
10655
10672
  animate,
10673
+ interpolateUnits = false,
10656
10674
  // Tuning
10657
10675
  debug: debug2 = false,
10658
10676
  spriteHeightRatio = 1.5,
@@ -10687,6 +10705,8 @@ function Canvas2D({
10687
10705
  const containerRef = useRef(null);
10688
10706
  const lerpRafRef = useRef(0);
10689
10707
  const animRafRef = useRef(0);
10708
+ const unitInterp = useRenderInterpolation();
10709
+ const interpolatedUnitPositionsRef = useRef(/* @__PURE__ */ new Map());
10690
10710
  const [viewportSize, setViewportSize] = useState({ width: 800, height: 600 });
10691
10711
  useEffect(() => {
10692
10712
  const el = containerRef.current;
@@ -11001,7 +11021,8 @@ function Canvas2D({
11001
11021
  return depthA !== depthB ? depthA - depthB : a.position.y - b.position.y;
11002
11022
  });
11003
11023
  for (const unit of sortedUnits) {
11004
- const pos = project(unit.position.x, unit.position.y, baseOffsetX);
11024
+ const interpolated = interpolateUnits ? interpolatedUnitPositionsRef.current.get(unit.id) : void 0;
11025
+ const pos = project(interpolated?.x ?? unit.position.x, interpolated?.y ?? unit.position.y, baseOffsetX);
11005
11026
  if (pos.x + scaledTileWidth < visLeft || pos.x > visRight || pos.y + scaledTileHeight < visTop || pos.y > visBottom) {
11006
11027
  continue;
11007
11028
  }
@@ -11153,7 +11174,8 @@ function Canvas2D({
11153
11174
  unitScale,
11154
11175
  assetManifest,
11155
11176
  spriteHeightRatio,
11156
- spriteMaxWidthRatio
11177
+ spriteMaxWidthRatio,
11178
+ interpolateUnits
11157
11179
  ]);
11158
11180
  useEffect(() => {
11159
11181
  if (camera === "fixed") return;
@@ -11168,6 +11190,19 @@ function Canvas2D({
11168
11190
  y: centerY - viewportSize.height / 2
11169
11191
  };
11170
11192
  }, [camera, selectedUnitId, units, project, baseOffsetX, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, viewportSize, targetCameraRef]);
11193
+ useEffect(() => {
11194
+ if (isSide || !interpolateUnits) return;
11195
+ unitInterp.onSnapshot(
11196
+ units.filter((u) => !!u.position).map((u) => ({ id: u.id, x: u.position.x, y: u.position.y }))
11197
+ );
11198
+ }, [isSide, interpolateUnits, units, unitInterp]);
11199
+ useEffect(() => {
11200
+ if (isSide || !interpolateUnits) return;
11201
+ return unitInterp.startLoop((positions) => {
11202
+ interpolatedUnitPositionsRef.current = positions;
11203
+ draw();
11204
+ });
11205
+ }, [isSide, interpolateUnits, unitInterp, draw]);
11171
11206
  useEffect(() => {
11172
11207
  if (isSide) return;
11173
11208
  draw();
@@ -11543,7 +11578,7 @@ function LinearView({
11543
11578
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
11544
11579
  const isDone = i < currentIdx;
11545
11580
  const isCurrent = i === currentIdx;
11546
- return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
11581
+ return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
11547
11582
  i > 0 && /* @__PURE__ */ jsx(
11548
11583
  Typography,
11549
11584
  {
@@ -12057,6 +12092,8 @@ function SequenceBar({
12057
12092
  maxSlots,
12058
12093
  onSlotDrop,
12059
12094
  onSlotRemove,
12095
+ slotDropEvent,
12096
+ slotRemoveEvent,
12060
12097
  playing = false,
12061
12098
  currentStep = -1,
12062
12099
  categoryColors,
@@ -12064,16 +12101,19 @@ function SequenceBar({
12064
12101
  size = "lg",
12065
12102
  className
12066
12103
  }) {
12104
+ const { emit } = useEventBus();
12067
12105
  const handleDrop = useCallback((index) => (item) => {
12068
12106
  if (playing) return;
12069
- onSlotDrop(index, item);
12070
- }, [onSlotDrop, playing]);
12107
+ if (slotDropEvent) emit(`UI:${slotDropEvent}`, { slotNumber: index, itemId: item.id });
12108
+ else onSlotDrop?.(index, item);
12109
+ }, [emit, slotDropEvent, onSlotDrop, playing]);
12071
12110
  const handleRemove = useCallback((index) => () => {
12072
12111
  if (playing) return;
12073
- onSlotRemove(index);
12074
- }, [onSlotRemove, playing]);
12112
+ if (slotRemoveEvent) emit(`UI:${slotRemoveEvent}`, { slotNumber: index });
12113
+ else onSlotRemove?.(index);
12114
+ }, [emit, slotRemoveEvent, onSlotRemove, playing]);
12075
12115
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
12076
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
12116
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
12077
12117
  i > 0 && /* @__PURE__ */ jsx(
12078
12118
  Typography,
12079
12119
  {
@@ -12103,9 +12143,10 @@ function SequenceBar({
12103
12143
  ] }, i)) });
12104
12144
  }
12105
12145
  var init_SequenceBar = __esm({
12106
- "components/game/2d/organisms/SequenceBar.tsx"() {
12146
+ "components/game/2d/molecules/SequenceBar.tsx"() {
12107
12147
  init_atoms();
12108
12148
  init_cn();
12149
+ init_useEventBus();
12109
12150
  init_TraitSlot();
12110
12151
  SequenceBar.displayName = "SequenceBar";
12111
12152
  }
@@ -14110,227 +14151,6 @@ var init_NegotiatorBoard = __esm({
14110
14151
  NegotiatorBoard.displayName = "NegotiatorBoard";
14111
14152
  }
14112
14153
  });
14113
-
14114
- // components/game/shared/lib/mechanics.ts
14115
- var projectileMotion, pendulum, springOscillator;
14116
- var init_mechanics = __esm({
14117
- "components/game/shared/lib/mechanics.ts"() {
14118
- projectileMotion = {
14119
- id: "mechanics-projectile",
14120
- name: "Projectile Motion",
14121
- description: "Launch a ball and observe parabolic trajectory under gravity.",
14122
- domain: "natural",
14123
- gravity: { x: 0, y: 9.81 },
14124
- bodies: [
14125
- { id: "ball", x: 50, y: 350, vx: 80, vy: -120, mass: 1, radius: 10, color: "#e94560", fixed: false },
14126
- { id: "ground", x: 300, y: 390, vx: 0, vy: 0, mass: 1e3, radius: 400, color: "#333", fixed: true }
14127
- ],
14128
- showVelocity: true,
14129
- parameters: {
14130
- angle: { value: 45, min: 0, max: 90, step: 1, label: "Launch angle (deg)" },
14131
- velocity: { value: 100, min: 10, max: 200, step: 5, label: "Initial velocity (m/s)" },
14132
- gravity: { value: 9.81, min: 0, max: 20, step: 0.1, label: "Gravity (m/s\xB2)" }
14133
- }
14134
- };
14135
- pendulum = {
14136
- id: "mechanics-pendulum",
14137
- name: "Simple Pendulum",
14138
- description: "A mass on a string swinging under gravity.",
14139
- domain: "natural",
14140
- gravity: { x: 0, y: 9.81 },
14141
- bodies: [
14142
- { id: "pivot", x: 300, y: 50, vx: 0, vy: 0, mass: 1e3, radius: 5, color: "#888", fixed: true },
14143
- { id: "bob", x: 400, y: 200, vx: 0, vy: 0, mass: 5, radius: 15, color: "#e94560", fixed: false }
14144
- ],
14145
- constraints: [{ bodyA: 0, bodyB: 1, length: 180, stiffness: 1 }],
14146
- parameters: {
14147
- length: { value: 180, min: 50, max: 300, step: 10, label: "String length (px)" },
14148
- mass: { value: 5, min: 1, max: 20, step: 0.5, label: "Mass (kg)" },
14149
- gravity: { value: 9.81, min: 0, max: 20, step: 0.1, label: "Gravity (m/s\xB2)" }
14150
- }
14151
- };
14152
- springOscillator = {
14153
- id: "mechanics-spring",
14154
- name: "Spring Oscillator",
14155
- description: "A mass bouncing on a spring \u2014 simple harmonic motion.",
14156
- domain: "natural",
14157
- gravity: { x: 0, y: 0 },
14158
- bodies: [
14159
- { id: "anchor", x: 300, y: 50, vx: 0, vy: 0, mass: 1e3, radius: 8, color: "#888", fixed: true },
14160
- { id: "mass", x: 300, y: 250, vx: 0, vy: 0, mass: 2, radius: 20, color: "#0f3460", fixed: false }
14161
- ],
14162
- constraints: [{ bodyA: 0, bodyB: 1, length: 150, stiffness: 0.5 }],
14163
- parameters: {
14164
- stiffness: { value: 0.5, min: 0.1, max: 2, step: 0.05, label: "Spring stiffness (k)" },
14165
- mass: { value: 2, min: 0.5, max: 10, step: 0.5, label: "Mass (kg)" },
14166
- damping: { value: 0, min: 0, max: 0.5, step: 0.01, label: "Damping" }
14167
- }
14168
- };
14169
- }
14170
- });
14171
-
14172
- // components/game/shared/lib/physicsPresets.ts
14173
- var init_physicsPresets = __esm({
14174
- "components/game/shared/lib/physicsPresets.ts"() {
14175
- init_mechanics();
14176
- }
14177
- });
14178
- function resolvePreset(preset) {
14179
- if (typeof preset !== "string") return preset;
14180
- return PRESET_BY_ID[preset] ?? projectileMotion;
14181
- }
14182
- function SimulationCanvas({
14183
- preset: presetProp,
14184
- width = 600,
14185
- height = 400,
14186
- bodies: externalBodies,
14187
- className
14188
- }) {
14189
- const preset = useMemo(() => resolvePreset(presetProp), [presetProp]);
14190
- const canvasRef = useRef(null);
14191
- const bodiesRef = useRef(structuredClone(preset.bodies));
14192
- const interp = useRenderInterpolation();
14193
- useEffect(() => {
14194
- bodiesRef.current = structuredClone(preset.bodies);
14195
- }, [preset]);
14196
- const draw = useCallback(() => {
14197
- const canvas = canvasRef.current;
14198
- if (!canvas) return;
14199
- const ctx = canvas.getContext("2d");
14200
- if (!ctx) return;
14201
- const bodies = bodiesRef.current;
14202
- ctx.clearRect(0, 0, width, height);
14203
- ctx.fillStyle = preset.backgroundColor ?? "#1a1a2e";
14204
- ctx.fillRect(0, 0, width, height);
14205
- if (preset.constraints) {
14206
- for (const c of preset.constraints) {
14207
- const a = bodies[c.bodyA];
14208
- const b = bodies[c.bodyB];
14209
- if (a && b) {
14210
- ctx.beginPath();
14211
- ctx.moveTo(a.x, a.y);
14212
- ctx.lineTo(b.x, b.y);
14213
- ctx.strokeStyle = "#533483";
14214
- ctx.lineWidth = 1;
14215
- ctx.setLineDash([4, 4]);
14216
- ctx.stroke();
14217
- ctx.setLineDash([]);
14218
- }
14219
- }
14220
- }
14221
- for (const body of bodies) {
14222
- ctx.beginPath();
14223
- ctx.arc(body.x, body.y, body.radius, 0, Math.PI * 2);
14224
- ctx.fillStyle = body.color ?? "#e94560";
14225
- ctx.fill();
14226
- if (preset.showVelocity) {
14227
- ctx.beginPath();
14228
- ctx.moveTo(body.x, body.y);
14229
- ctx.lineTo(body.x + body.vx * 0.1, body.y + body.vy * 0.1);
14230
- ctx.strokeStyle = "#16213e";
14231
- ctx.lineWidth = 2;
14232
- ctx.stroke();
14233
- }
14234
- }
14235
- }, [width, height, preset]);
14236
- useEffect(() => {
14237
- if (!externalBodies) return;
14238
- interp.onSnapshot(externalBodies.map((b) => ({ id: b.id, x: b.x, y: b.y })));
14239
- }, [externalBodies]);
14240
- const presetRef = useRef(preset);
14241
- presetRef.current = preset;
14242
- const widthRef = useRef(width);
14243
- widthRef.current = width;
14244
- const heightRef = useRef(height);
14245
- heightRef.current = height;
14246
- useEffect(() => {
14247
- if (!externalBodies) return;
14248
- const drawInterpolated = (positions) => {
14249
- const canvas = canvasRef.current;
14250
- if (!canvas) return;
14251
- const ctx = canvas.getContext("2d");
14252
- if (!ctx) return;
14253
- const bodies = bodiesRef.current;
14254
- const p = presetRef.current;
14255
- const w = widthRef.current;
14256
- const h = heightRef.current;
14257
- ctx.clearRect(0, 0, w, h);
14258
- ctx.fillStyle = p.backgroundColor ?? "#1a1a2e";
14259
- ctx.fillRect(0, 0, w, h);
14260
- if (p.constraints) {
14261
- for (const c of p.constraints) {
14262
- const a = bodies[c.bodyA];
14263
- const b = bodies[c.bodyB];
14264
- if (a && b) {
14265
- const aPos = positions.get(a.id) ?? a;
14266
- const bPos = positions.get(b.id) ?? b;
14267
- ctx.beginPath();
14268
- ctx.moveTo(aPos.x, aPos.y);
14269
- ctx.lineTo(bPos.x, bPos.y);
14270
- ctx.strokeStyle = "#533483";
14271
- ctx.lineWidth = 1;
14272
- ctx.setLineDash([4, 4]);
14273
- ctx.stroke();
14274
- ctx.setLineDash([]);
14275
- }
14276
- }
14277
- }
14278
- for (const body of bodies) {
14279
- const pos = positions.get(body.id) ?? body;
14280
- ctx.beginPath();
14281
- ctx.arc(pos.x, pos.y, body.radius, 0, Math.PI * 2);
14282
- ctx.fillStyle = body.color ?? "#e94560";
14283
- ctx.fill();
14284
- if (p.showVelocity) {
14285
- ctx.beginPath();
14286
- ctx.moveTo(pos.x, pos.y);
14287
- ctx.lineTo(pos.x + body.vx * 0.1, pos.y + body.vy * 0.1);
14288
- ctx.strokeStyle = "#16213e";
14289
- ctx.lineWidth = 2;
14290
- ctx.stroke();
14291
- }
14292
- }
14293
- };
14294
- return interp.startLoop(drawInterpolated);
14295
- }, [externalBodies !== void 0, interp.startLoop]);
14296
- useEffect(() => {
14297
- draw();
14298
- }, [draw]);
14299
- useEffect(() => {
14300
- if (typeof window === "undefined") return;
14301
- const canvas = canvasRef.current;
14302
- if (!canvas) return;
14303
- bindCanvasCapture(() => canvas.toDataURL("image/png"));
14304
- return () => {
14305
- bindCanvasCapture(() => null);
14306
- };
14307
- }, []);
14308
- return /* @__PURE__ */ jsx(Box, { className: cn("flex justify-center", className), children: /* @__PURE__ */ jsx(
14309
- "canvas",
14310
- {
14311
- ref: canvasRef,
14312
- width,
14313
- height,
14314
- className: "rounded-container block max-w-full h-auto"
14315
- }
14316
- ) });
14317
- }
14318
- var PRESET_BY_ID;
14319
- var init_SimulationCanvas = __esm({
14320
- "components/game/2d/organisms/SimulationCanvas.tsx"() {
14321
- init_cn();
14322
- init_atoms();
14323
- init_verificationRegistry();
14324
- init_physicsPresets();
14325
- init_useRenderInterpolation();
14326
- PRESET_BY_ID = {
14327
- "mechanics-projectile": projectileMotion,
14328
- "mechanics-pendulum": pendulum,
14329
- "mechanics-spring": springOscillator
14330
- };
14331
- SimulationCanvas.displayName = "SimulationCanvas";
14332
- }
14333
- });
14334
14154
  var GameTemplate;
14335
14155
  var init_GameTemplate = __esm({
14336
14156
  "components/game/2d/templates/GameTemplate.tsx"() {
@@ -14939,7 +14759,7 @@ var init_ErrorBoundary = __esm({
14939
14759
  }
14940
14760
  );
14941
14761
  };
14942
- ErrorBoundary = class extends React96__default.Component {
14762
+ ErrorBoundary = class extends React95__default.Component {
14943
14763
  constructor(props) {
14944
14764
  super(props);
14945
14765
  __publicField(this, "reset", () => {
@@ -15221,7 +15041,7 @@ var init_Container = __esm({
15221
15041
  as: Component = "div"
15222
15042
  }) => {
15223
15043
  const resolvedSize = maxWidth ?? size ?? "lg";
15224
- return React96__default.createElement(
15044
+ return React95__default.createElement(
15225
15045
  Component,
15226
15046
  {
15227
15047
  className: cn(
@@ -17889,7 +17709,7 @@ var init_CodeBlock = __esm({
17889
17709
  DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
17890
17710
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
17891
17711
  HIDDEN_LINE_NUMBERS = { display: "none" };
17892
- CodeBlock = React96__default.memo(
17712
+ CodeBlock = React95__default.memo(
17893
17713
  ({
17894
17714
  code: rawCode,
17895
17715
  language = "text",
@@ -18476,7 +18296,7 @@ var init_MarkdownContent = __esm({
18476
18296
  init_Box();
18477
18297
  init_CodeBlock();
18478
18298
  init_cn();
18479
- MarkdownContent = React96__default.memo(
18299
+ MarkdownContent = React95__default.memo(
18480
18300
  ({ content, direction = "ltr", className }) => {
18481
18301
  const { t: _t } = useTranslate();
18482
18302
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -19753,7 +19573,7 @@ var init_StateMachineView = __esm({
19753
19573
  style: { top: title ? 30 : 0 },
19754
19574
  children: [
19755
19575
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
19756
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React96__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
19576
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React95__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
19757
19577
  StateNode2,
19758
19578
  {
19759
19579
  state,
@@ -25310,8 +25130,8 @@ var init_Menu = __esm({
25310
25130
  "bottom-end": "bottom-start"
25311
25131
  };
25312
25132
  const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
25313
- const triggerChild = React96__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
25314
- const triggerElement = React96__default.cloneElement(
25133
+ const triggerChild = React95__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
25134
+ const triggerElement = React95__default.cloneElement(
25315
25135
  triggerChild,
25316
25136
  {
25317
25137
  ref: triggerRef,
@@ -25406,14 +25226,14 @@ function useDataDnd(args) {
25406
25226
  const isZone = Boolean(dragGroup || accepts || sortable);
25407
25227
  const enabled = isZone || Boolean(dndRoot);
25408
25228
  const eventBus = useEventBus();
25409
- const parentRoot = React96__default.useContext(RootCtx);
25229
+ const parentRoot = React95__default.useContext(RootCtx);
25410
25230
  const isRoot = enabled && parentRoot === null;
25411
- const zoneId = React96__default.useId();
25231
+ const zoneId = React95__default.useId();
25412
25232
  const ownGroup = dragGroup ?? accepts ?? zoneId;
25413
- const [optimisticOrders, setOptimisticOrders] = React96__default.useState(() => /* @__PURE__ */ new Map());
25414
- const optimisticOrdersRef = React96__default.useRef(optimisticOrders);
25233
+ const [optimisticOrders, setOptimisticOrders] = React95__default.useState(() => /* @__PURE__ */ new Map());
25234
+ const optimisticOrdersRef = React95__default.useRef(optimisticOrders);
25415
25235
  optimisticOrdersRef.current = optimisticOrders;
25416
- const clearOptimisticOrder = React96__default.useCallback((group) => {
25236
+ const clearOptimisticOrder = React95__default.useCallback((group) => {
25417
25237
  setOptimisticOrders((prev) => {
25418
25238
  if (!prev.has(group)) return prev;
25419
25239
  const next = new Map(prev);
@@ -25438,7 +25258,7 @@ function useDataDnd(args) {
25438
25258
  const raw = it[dndItemIdField];
25439
25259
  return raw != null ? String(raw) : `__idx_${idx}`;
25440
25260
  }).join("|");
25441
- const itemIds = React96__default.useMemo(
25261
+ const itemIds = React95__default.useMemo(
25442
25262
  () => orderedItems.map((it, idx) => {
25443
25263
  const raw = it[dndItemIdField];
25444
25264
  return raw != null ? String(raw) : `__idx_${idx}`;
@@ -25449,7 +25269,7 @@ function useDataDnd(args) {
25449
25269
  const raw = it[dndItemIdField];
25450
25270
  return raw != null ? String(raw) : `__${idx}`;
25451
25271
  }).join("|");
25452
- React96__default.useEffect(() => {
25272
+ React95__default.useEffect(() => {
25453
25273
  const root = isRoot ? null : parentRoot;
25454
25274
  if (root) {
25455
25275
  root.clearOptimisticOrder(ownGroup);
@@ -25457,20 +25277,20 @@ function useDataDnd(args) {
25457
25277
  clearOptimisticOrder(ownGroup);
25458
25278
  }
25459
25279
  }, [itemsContentSig, ownGroup]);
25460
- const zonesRef = React96__default.useRef(/* @__PURE__ */ new Map());
25461
- const registerZone = React96__default.useCallback((zoneId2, meta2) => {
25280
+ const zonesRef = React95__default.useRef(/* @__PURE__ */ new Map());
25281
+ const registerZone = React95__default.useCallback((zoneId2, meta2) => {
25462
25282
  zonesRef.current.set(zoneId2, meta2);
25463
25283
  }, []);
25464
- const unregisterZone = React96__default.useCallback((zoneId2) => {
25284
+ const unregisterZone = React95__default.useCallback((zoneId2) => {
25465
25285
  zonesRef.current.delete(zoneId2);
25466
25286
  }, []);
25467
- const [activeDrag, setActiveDrag] = React96__default.useState(null);
25468
- const [overZoneGroup, setOverZoneGroup] = React96__default.useState(null);
25469
- const meta = React96__default.useMemo(
25287
+ const [activeDrag, setActiveDrag] = React95__default.useState(null);
25288
+ const [overZoneGroup, setOverZoneGroup] = React95__default.useState(null);
25289
+ const meta = React95__default.useMemo(
25470
25290
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
25471
25291
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
25472
25292
  );
25473
- React96__default.useEffect(() => {
25293
+ React95__default.useEffect(() => {
25474
25294
  const target = isRoot ? null : parentRoot;
25475
25295
  if (!target) {
25476
25296
  zonesRef.current.set(zoneId, meta);
@@ -25489,7 +25309,7 @@ function useDataDnd(args) {
25489
25309
  }, [parentRoot, isRoot, zoneId, meta]);
25490
25310
  const sensors = useAlmadarDndSensors(true);
25491
25311
  const collisionDetection = almadarDndCollisionDetection;
25492
- const findZoneByItem = React96__default.useCallback(
25312
+ const findZoneByItem = React95__default.useCallback(
25493
25313
  (id) => {
25494
25314
  for (const z of zonesRef.current.values()) {
25495
25315
  if (z.itemIds.includes(id)) return z;
@@ -25498,7 +25318,7 @@ function useDataDnd(args) {
25498
25318
  },
25499
25319
  []
25500
25320
  );
25501
- React96__default.useCallback(
25321
+ React95__default.useCallback(
25502
25322
  (group) => {
25503
25323
  for (const z of zonesRef.current.values()) {
25504
25324
  if (z.group === group) return z;
@@ -25507,7 +25327,7 @@ function useDataDnd(args) {
25507
25327
  },
25508
25328
  []
25509
25329
  );
25510
- const handleDragEnd = React96__default.useCallback(
25330
+ const handleDragEnd = React95__default.useCallback(
25511
25331
  (event) => {
25512
25332
  const { active, over } = event;
25513
25333
  const activeIdStr = String(active.id);
@@ -25598,8 +25418,8 @@ function useDataDnd(args) {
25598
25418
  },
25599
25419
  [eventBus]
25600
25420
  );
25601
- const sortableData = React96__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
25602
- const SortableItem = React96__default.useCallback(
25421
+ const sortableData = React95__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
25422
+ const SortableItem = React95__default.useCallback(
25603
25423
  ({ id, children }) => {
25604
25424
  const {
25605
25425
  attributes,
@@ -25639,7 +25459,7 @@ function useDataDnd(args) {
25639
25459
  id: droppableId,
25640
25460
  data: sortableData
25641
25461
  });
25642
- const ctx = React96__default.useContext(RootCtx);
25462
+ const ctx = React95__default.useContext(RootCtx);
25643
25463
  const activeDrag2 = ctx?.activeDrag ?? null;
25644
25464
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
25645
25465
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -25654,7 +25474,7 @@ function useDataDnd(args) {
25654
25474
  showForeignPlaceholder,
25655
25475
  ctxAvailable: ctx != null
25656
25476
  });
25657
- React96__default.useEffect(() => {
25477
+ React95__default.useEffect(() => {
25658
25478
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
25659
25479
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
25660
25480
  return /* @__PURE__ */ jsx(
@@ -25668,11 +25488,11 @@ function useDataDnd(args) {
25668
25488
  }
25669
25489
  );
25670
25490
  };
25671
- const rootContextValue = React96__default.useMemo(
25491
+ const rootContextValue = React95__default.useMemo(
25672
25492
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
25673
25493
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
25674
25494
  );
25675
- const handleDragStart = React96__default.useCallback((event) => {
25495
+ const handleDragStart = React95__default.useCallback((event) => {
25676
25496
  const sourceZone = findZoneByItem(event.active.id);
25677
25497
  const rect = event.active.rect.current.initial;
25678
25498
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -25691,7 +25511,7 @@ function useDataDnd(args) {
25691
25511
  isRoot
25692
25512
  });
25693
25513
  }, [findZoneByItem, isRoot, zoneId]);
25694
- const handleDragOver = React96__default.useCallback((event) => {
25514
+ const handleDragOver = React95__default.useCallback((event) => {
25695
25515
  const { active, over } = event;
25696
25516
  const overData = over?.data?.current;
25697
25517
  const overGroup = overData?.dndGroup ?? null;
@@ -25761,7 +25581,7 @@ function useDataDnd(args) {
25761
25581
  return next;
25762
25582
  });
25763
25583
  }, []);
25764
- const handleDragCancel = React96__default.useCallback((event) => {
25584
+ const handleDragCancel = React95__default.useCallback((event) => {
25765
25585
  setActiveDrag(null);
25766
25586
  setOverZoneGroup(null);
25767
25587
  dndLog.warn("dragCancel", {
@@ -25769,12 +25589,12 @@ function useDataDnd(args) {
25769
25589
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
25770
25590
  });
25771
25591
  }, []);
25772
- const handleDragEndWithCleanup = React96__default.useCallback((event) => {
25592
+ const handleDragEndWithCleanup = React95__default.useCallback((event) => {
25773
25593
  handleDragEnd(event);
25774
25594
  setActiveDrag(null);
25775
25595
  setOverZoneGroup(null);
25776
25596
  }, [handleDragEnd]);
25777
- const wrapContainer = React96__default.useCallback(
25597
+ const wrapContainer = React95__default.useCallback(
25778
25598
  (children) => {
25779
25599
  if (!enabled) return children;
25780
25600
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -25828,7 +25648,7 @@ var init_useDataDnd = __esm({
25828
25648
  init_useAlmadarDndCollision();
25829
25649
  init_Box();
25830
25650
  dndLog = createLogger("almadar:ui:dnd");
25831
- RootCtx = React96__default.createContext(null);
25651
+ RootCtx = React95__default.createContext(null);
25832
25652
  }
25833
25653
  });
25834
25654
  function renderIconInput(icon, props) {
@@ -26354,7 +26174,7 @@ function DataList({
26354
26174
  }) {
26355
26175
  const eventBus = useEventBus();
26356
26176
  const { t } = useTranslate();
26357
- const [visibleCount, setVisibleCount] = React96__default.useState(pageSize || Infinity);
26177
+ const [visibleCount, setVisibleCount] = React95__default.useState(pageSize || Infinity);
26358
26178
  const fieldDefs = fields ?? columns ?? [];
26359
26179
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
26360
26180
  const dnd = useDataDnd({
@@ -26373,7 +26193,7 @@ function DataList({
26373
26193
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
26374
26194
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
26375
26195
  const hasRenderProp = typeof children === "function";
26376
- React96__default.useEffect(() => {
26196
+ React95__default.useEffect(() => {
26377
26197
  const renderItemTypeOf = typeof schemaRenderItem;
26378
26198
  const childrenTypeOf = typeof children;
26379
26199
  if (data.length > 0 && !hasRenderProp) {
@@ -26477,7 +26297,7 @@ function DataList({
26477
26297
  const items2 = [...data];
26478
26298
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
26479
26299
  const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
26480
- return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
26300
+ return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
26481
26301
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
26482
26302
  group.items.map((itemData, index) => {
26483
26303
  const id = itemData.id || `${gi}-${index}`;
@@ -26618,7 +26438,7 @@ function DataList({
26618
26438
  className
26619
26439
  ),
26620
26440
  children: [
26621
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
26441
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
26622
26442
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
26623
26443
  group.items.map(
26624
26444
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -26703,7 +26523,7 @@ var init_FormSection = __esm({
26703
26523
  columns = 1,
26704
26524
  className
26705
26525
  }) => {
26706
- const [collapsed, setCollapsed] = React96__default.useState(defaultCollapsed);
26526
+ const [collapsed, setCollapsed] = React95__default.useState(defaultCollapsed);
26707
26527
  const { t } = useTranslate();
26708
26528
  const eventBus = useEventBus();
26709
26529
  const gridClass = {
@@ -26711,7 +26531,7 @@ var init_FormSection = __esm({
26711
26531
  2: "grid-cols-1 md:grid-cols-2",
26712
26532
  3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
26713
26533
  }[columns];
26714
- React96__default.useCallback(() => {
26534
+ React95__default.useCallback(() => {
26715
26535
  if (collapsible) {
26716
26536
  setCollapsed((prev) => !prev);
26717
26537
  eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
@@ -27597,7 +27417,7 @@ var init_Flex = __esm({
27597
27417
  flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
27598
27418
  }
27599
27419
  }
27600
- return React96__default.createElement(Component, {
27420
+ return React95__default.createElement(Component, {
27601
27421
  className: cn(
27602
27422
  inline ? "inline-flex" : "flex",
27603
27423
  directionStyles[direction],
@@ -27716,7 +27536,7 @@ var init_Grid = __esm({
27716
27536
  as: Component = "div"
27717
27537
  }) => {
27718
27538
  const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
27719
- return React96__default.createElement(
27539
+ return React95__default.createElement(
27720
27540
  Component,
27721
27541
  {
27722
27542
  className: cn(
@@ -27912,9 +27732,9 @@ var init_Popover = __esm({
27912
27732
  onMouseLeave: handleClose,
27913
27733
  onPointerDown: tapTriggerProps.onPointerDown
27914
27734
  };
27915
- const childElement = React96__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
27735
+ const childElement = React95__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
27916
27736
  const childPointerDown = childElement.props.onPointerDown;
27917
- const triggerElement = React96__default.cloneElement(
27737
+ const triggerElement = React95__default.cloneElement(
27918
27738
  childElement,
27919
27739
  {
27920
27740
  ref: triggerRef,
@@ -28516,9 +28336,9 @@ var init_Tooltip = __esm({
28516
28336
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
28517
28337
  };
28518
28338
  }, []);
28519
- const triggerElement = React96__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
28339
+ const triggerElement = React95__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
28520
28340
  const childPointerDown = triggerElement.props.onPointerDown;
28521
- const trigger = React96__default.cloneElement(triggerElement, {
28341
+ const trigger = React95__default.cloneElement(triggerElement, {
28522
28342
  ref: triggerRef,
28523
28343
  onMouseEnter: handleMouseEnter,
28524
28344
  onMouseLeave: handleMouseLeave,
@@ -28608,7 +28428,7 @@ var init_WizardProgress = __esm({
28608
28428
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
28609
28429
  const isActive = index === currentStep;
28610
28430
  const isCompleted = index < currentStep;
28611
- return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
28431
+ return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
28612
28432
  /* @__PURE__ */ jsx(
28613
28433
  "button",
28614
28434
  {
@@ -30168,13 +29988,13 @@ var init_MapView = __esm({
30168
29988
  shadowSize: [41, 41]
30169
29989
  });
30170
29990
  L.Marker.prototype.options.icon = defaultIcon;
30171
- const { useEffect: useEffect67, useRef: useRef65, useCallback: useCallback99, useState: useState97 } = React96__default;
29991
+ const { useEffect: useEffect66, useRef: useRef64, useCallback: useCallback98, useState: useState97 } = React95__default;
30172
29992
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
30173
29993
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
30174
29994
  function MapUpdater({ centerLat, centerLng, zoom }) {
30175
29995
  const map = useMap();
30176
- const prevRef = useRef65({ centerLat, centerLng, zoom });
30177
- useEffect67(() => {
29996
+ const prevRef = useRef64({ centerLat, centerLng, zoom });
29997
+ useEffect66(() => {
30178
29998
  const prev = prevRef.current;
30179
29999
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
30180
30000
  map.setView([centerLat, centerLng], zoom);
@@ -30185,7 +30005,7 @@ var init_MapView = __esm({
30185
30005
  }
30186
30006
  function MapClickHandler({ onMapClick }) {
30187
30007
  const map = useMap();
30188
- useEffect67(() => {
30008
+ useEffect66(() => {
30189
30009
  if (!onMapClick) return;
30190
30010
  const handler = (e) => {
30191
30011
  onMapClick(e.latlng.lat, e.latlng.lng);
@@ -30214,7 +30034,7 @@ var init_MapView = __esm({
30214
30034
  }) {
30215
30035
  const eventBus = useEventBus2();
30216
30036
  const [clickedPosition, setClickedPosition] = useState97(null);
30217
- const handleMapClick = useCallback99((lat, lng) => {
30037
+ const handleMapClick = useCallback98((lat, lng) => {
30218
30038
  if (showClickedPin) {
30219
30039
  setClickedPosition({ lat, lng });
30220
30040
  }
@@ -30223,7 +30043,7 @@ var init_MapView = __esm({
30223
30043
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
30224
30044
  }
30225
30045
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
30226
- const handleMarkerClick = useCallback99((marker) => {
30046
+ const handleMarkerClick = useCallback98((marker) => {
30227
30047
  onMarkerClick?.(marker);
30228
30048
  if (markerClickEvent) {
30229
30049
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -31083,8 +30903,8 @@ function TableView({
31083
30903
  }) {
31084
30904
  const eventBus = useEventBus();
31085
30905
  const { t } = useTranslate();
31086
- const [visibleCount, setVisibleCount] = React96__default.useState(pageSize > 0 ? pageSize : Infinity);
31087
- const [localSelected, setLocalSelected] = React96__default.useState(/* @__PURE__ */ new Set());
30906
+ const [visibleCount, setVisibleCount] = React95__default.useState(pageSize > 0 ? pageSize : Infinity);
30907
+ const [localSelected, setLocalSelected] = React95__default.useState(/* @__PURE__ */ new Set());
31088
30908
  const colDefs = columns ?? fields ?? [];
31089
30909
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
31090
30910
  const dnd = useDataDnd({
@@ -31279,12 +31099,12 @@ function TableView({
31279
31099
  ]
31280
31100
  }
31281
31101
  );
31282
- return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React96__default.Fragment, { children: rowInner }, id);
31102
+ return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React95__default.Fragment, { children: rowInner }, id);
31283
31103
  };
31284
31104
  const items = Array.from(data);
31285
31105
  const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
31286
31106
  let runningIndex = 0;
31287
- const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
31107
+ const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
31288
31108
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
31289
31109
  group.items.map((row) => renderRow(row, runningIndex++))
31290
31110
  ] }, gi)) });
@@ -32503,7 +32323,7 @@ var init_StepFlow = __esm({
32503
32323
  className
32504
32324
  }) => {
32505
32325
  if (orientation === "vertical") {
32506
- return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React96__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
32326
+ return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React95__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
32507
32327
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
32508
32328
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
32509
32329
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -32514,7 +32334,7 @@ var init_StepFlow = __esm({
32514
32334
  ] })
32515
32335
  ] }) }, index)) });
32516
32336
  }
32517
- return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
32337
+ return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
32518
32338
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
32519
32339
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
32520
32340
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -33499,7 +33319,7 @@ var init_LikertScale = __esm({
33499
33319
  md: "text-base",
33500
33320
  lg: "text-lg"
33501
33321
  };
33502
- LikertScale = React96__default.forwardRef(
33322
+ LikertScale = React95__default.forwardRef(
33503
33323
  ({
33504
33324
  question,
33505
33325
  options = DEFAULT_LIKERT_OPTIONS,
@@ -33511,7 +33331,7 @@ var init_LikertScale = __esm({
33511
33331
  variant = "radios",
33512
33332
  className
33513
33333
  }, ref) => {
33514
- const groupId = React96__default.useId();
33334
+ const groupId = React95__default.useId();
33515
33335
  const eventBus = useEventBus();
33516
33336
  const handleSelect = useCallback(
33517
33337
  (next) => {
@@ -35793,7 +35613,7 @@ var init_DocBreadcrumb = __esm({
35793
35613
  "aria-label": t("aria.breadcrumb"),
35794
35614
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
35795
35615
  const isLast = idx === items.length - 1;
35796
- return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
35616
+ return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
35797
35617
  idx > 0 && /* @__PURE__ */ jsx(
35798
35618
  Icon,
35799
35619
  {
@@ -36662,7 +36482,7 @@ var init_MiniStateMachine = __esm({
36662
36482
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
36663
36483
  const tc = transitionCounts[s.name] ?? 0;
36664
36484
  const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
36665
- return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
36485
+ return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
36666
36486
  /* @__PURE__ */ jsx(
36667
36487
  AvlState,
36668
36488
  {
@@ -36866,7 +36686,7 @@ var init_PageHeader = __esm({
36866
36686
  info: "bg-info/10 text-info"
36867
36687
  };
36868
36688
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
36869
- breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
36689
+ breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
36870
36690
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
36871
36691
  crumb.href ? /* @__PURE__ */ jsx(
36872
36692
  "a",
@@ -37224,7 +37044,7 @@ var init_Section = __esm({
37224
37044
  as: Component = "section"
37225
37045
  }) => {
37226
37046
  const hasHeader = title || description || action;
37227
- return React96__default.createElement(
37047
+ return React95__default.createElement(
37228
37048
  Component,
37229
37049
  {
37230
37050
  className: cn(
@@ -37598,7 +37418,7 @@ var init_WizardContainer = __esm({
37598
37418
  const isCompleted = index < currentStep;
37599
37419
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
37600
37420
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
37601
- return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
37421
+ return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
37602
37422
  /* @__PURE__ */ jsx(
37603
37423
  Button,
37604
37424
  {
@@ -40031,7 +39851,7 @@ var init_DetailPanel = __esm({
40031
39851
  }
40032
39852
  });
40033
39853
  function extractTitle(children) {
40034
- if (!React96__default.isValidElement(children)) return void 0;
39854
+ if (!React95__default.isValidElement(children)) return void 0;
40035
39855
  const props = children.props;
40036
39856
  if (typeof props.title === "string") {
40037
39857
  return props.title;
@@ -40381,12 +40201,12 @@ var init_Form = __esm({
40381
40201
  const isSchemaEntity = isOrbitalEntitySchema(entity);
40382
40202
  const resolvedEntity = isSchemaEntity ? entity : void 0;
40383
40203
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
40384
- const normalizedInitialData = React96__default.useMemo(() => {
40204
+ const normalizedInitialData = React95__default.useMemo(() => {
40385
40205
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
40386
40206
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
40387
40207
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
40388
40208
  }, [entity, initialData]);
40389
- const entityDerivedFields = React96__default.useMemo(() => {
40209
+ const entityDerivedFields = React95__default.useMemo(() => {
40390
40210
  if (fields && fields.length > 0) return void 0;
40391
40211
  if (!resolvedEntity) return void 0;
40392
40212
  return resolvedEntity.fields.map(
@@ -40407,16 +40227,16 @@ var init_Form = __esm({
40407
40227
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
40408
40228
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
40409
40229
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
40410
- const [formData, setFormData] = React96__default.useState(
40230
+ const [formData, setFormData] = React95__default.useState(
40411
40231
  normalizedInitialData
40412
40232
  );
40413
- const [collapsedSections, setCollapsedSections] = React96__default.useState(
40233
+ const [collapsedSections, setCollapsedSections] = React95__default.useState(
40414
40234
  /* @__PURE__ */ new Set()
40415
40235
  );
40416
- const [submitError, setSubmitError] = React96__default.useState(null);
40417
- const formRef = React96__default.useRef(null);
40236
+ const [submitError, setSubmitError] = React95__default.useState(null);
40237
+ const formRef = React95__default.useRef(null);
40418
40238
  const formMode = props.mode;
40419
- const mountedRef = React96__default.useRef(false);
40239
+ const mountedRef = React95__default.useRef(false);
40420
40240
  if (!mountedRef.current) {
40421
40241
  mountedRef.current = true;
40422
40242
  debug("forms", "mount", {
@@ -40429,7 +40249,7 @@ var init_Form = __esm({
40429
40249
  });
40430
40250
  }
40431
40251
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
40432
- const evalContext = React96__default.useMemo(
40252
+ const evalContext = React95__default.useMemo(
40433
40253
  () => ({
40434
40254
  formValues: formData,
40435
40255
  globalVariables: externalContext?.globalVariables ?? {},
@@ -40438,7 +40258,7 @@ var init_Form = __esm({
40438
40258
  }),
40439
40259
  [formData, externalContext]
40440
40260
  );
40441
- React96__default.useEffect(() => {
40261
+ React95__default.useEffect(() => {
40442
40262
  debug("forms", "initialData-sync", {
40443
40263
  mode: formMode,
40444
40264
  normalizedInitialData,
@@ -40449,7 +40269,7 @@ var init_Form = __esm({
40449
40269
  setFormData(normalizedInitialData);
40450
40270
  }
40451
40271
  }, [normalizedInitialData]);
40452
- const processCalculations = React96__default.useCallback(
40272
+ const processCalculations = React95__default.useCallback(
40453
40273
  (changedFieldId, newFormData) => {
40454
40274
  if (!hiddenCalculations.length) return;
40455
40275
  const context = {
@@ -40474,7 +40294,7 @@ var init_Form = __esm({
40474
40294
  },
40475
40295
  [hiddenCalculations, externalContext, eventBus]
40476
40296
  );
40477
- const checkViolations = React96__default.useCallback(
40297
+ const checkViolations = React95__default.useCallback(
40478
40298
  (changedFieldId, newFormData) => {
40479
40299
  if (!violationTriggers.length) return;
40480
40300
  const context = {
@@ -40512,7 +40332,7 @@ var init_Form = __esm({
40512
40332
  processCalculations(name, newFormData);
40513
40333
  checkViolations(name, newFormData);
40514
40334
  };
40515
- const isFieldVisible = React96__default.useCallback(
40335
+ const isFieldVisible = React95__default.useCallback(
40516
40336
  (fieldName) => {
40517
40337
  const condition = conditionalFields[fieldName];
40518
40338
  if (!condition) return true;
@@ -40520,7 +40340,7 @@ var init_Form = __esm({
40520
40340
  },
40521
40341
  [conditionalFields, evalContext]
40522
40342
  );
40523
- const isSectionVisible = React96__default.useCallback(
40343
+ const isSectionVisible = React95__default.useCallback(
40524
40344
  (section) => {
40525
40345
  if (!section.condition) return true;
40526
40346
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -40596,7 +40416,7 @@ var init_Form = __esm({
40596
40416
  eventBus.emit(`UI:${onCancel}`);
40597
40417
  }
40598
40418
  };
40599
- const renderField = React96__default.useCallback(
40419
+ const renderField = React95__default.useCallback(
40600
40420
  (field) => {
40601
40421
  const fieldName = field.name || field.field;
40602
40422
  if (!fieldName) return null;
@@ -40617,7 +40437,7 @@ var init_Form = __esm({
40617
40437
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
40618
40438
  );
40619
40439
  const effectiveFields = entityDerivedFields ?? fields;
40620
- const normalizedFields = React96__default.useMemo(() => {
40440
+ const normalizedFields = React95__default.useMemo(() => {
40621
40441
  if (!effectiveFields || effectiveFields.length === 0) return [];
40622
40442
  return effectiveFields.map((field) => {
40623
40443
  if (typeof field === "string") {
@@ -40641,7 +40461,7 @@ var init_Form = __esm({
40641
40461
  return field;
40642
40462
  });
40643
40463
  }, [effectiveFields, resolvedEntity]);
40644
- const schemaFields = React96__default.useMemo(() => {
40464
+ const schemaFields = React95__default.useMemo(() => {
40645
40465
  if (normalizedFields.length === 0) return null;
40646
40466
  if (isDebugEnabled()) {
40647
40467
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -40651,7 +40471,7 @@ var init_Form = __esm({
40651
40471
  }
40652
40472
  return normalizedFields.map(renderField).filter(Boolean);
40653
40473
  }, [normalizedFields, renderField, entityName, conditionalFields]);
40654
- const sectionElements = React96__default.useMemo(() => {
40474
+ const sectionElements = React95__default.useMemo(() => {
40655
40475
  if (!sections || sections.length === 0) return null;
40656
40476
  return sections.map((section) => {
40657
40477
  if (!isSectionVisible(section)) {
@@ -41376,7 +41196,7 @@ var init_List = __esm({
41376
41196
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
41377
41197
  return [];
41378
41198
  }, [entity]);
41379
- const getItemActions = React96__default.useCallback(
41199
+ const getItemActions = React95__default.useCallback(
41380
41200
  (item) => {
41381
41201
  if (!itemActions) return [];
41382
41202
  if (typeof itemActions === "function") {
@@ -41851,7 +41671,7 @@ var init_MediaGallery = __esm({
41851
41671
  [selectable, selectedItems, selectionEvent, eventBus]
41852
41672
  );
41853
41673
  const entityData = Array.isArray(entity) ? entity : [];
41854
- const items = React96__default.useMemo(() => {
41674
+ const items = React95__default.useMemo(() => {
41855
41675
  if (propItems) return propItems;
41856
41676
  if (entityData.length === 0) return [];
41857
41677
  return entityData.map((record, idx) => {
@@ -42014,7 +41834,7 @@ var init_MediaGallery = __esm({
42014
41834
  }
42015
41835
  });
42016
41836
  function extractTitle2(children) {
42017
- if (!React96__default.isValidElement(children)) return void 0;
41837
+ if (!React95__default.isValidElement(children)) return void 0;
42018
41838
  const props = children.props;
42019
41839
  if (typeof props.title === "string") {
42020
41840
  return props.title;
@@ -42288,7 +42108,7 @@ var init_debugRegistry = __esm({
42288
42108
  }
42289
42109
  });
42290
42110
  function useDebugData() {
42291
- const [data, setData] = React96.useState(() => ({
42111
+ const [data, setData] = React95.useState(() => ({
42292
42112
  traits: [],
42293
42113
  ticks: [],
42294
42114
  guards: [],
@@ -42302,7 +42122,7 @@ function useDebugData() {
42302
42122
  },
42303
42123
  lastUpdate: Date.now()
42304
42124
  }));
42305
- React96.useEffect(() => {
42125
+ React95.useEffect(() => {
42306
42126
  const updateData = () => {
42307
42127
  setData({
42308
42128
  traits: getAllTraits(),
@@ -42411,12 +42231,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
42411
42231
  return positions;
42412
42232
  }
42413
42233
  function WalkMinimap() {
42414
- const [walkStep, setWalkStep] = React96.useState(null);
42415
- const [traits2, setTraits] = React96.useState([]);
42416
- const [coveredEdges, setCoveredEdges] = React96.useState([]);
42417
- const [completedTraits, setCompletedTraits] = React96.useState(/* @__PURE__ */ new Set());
42418
- const prevTraitRef = React96.useRef(null);
42419
- React96.useEffect(() => {
42234
+ const [walkStep, setWalkStep] = React95.useState(null);
42235
+ const [traits2, setTraits] = React95.useState([]);
42236
+ const [coveredEdges, setCoveredEdges] = React95.useState([]);
42237
+ const [completedTraits, setCompletedTraits] = React95.useState(/* @__PURE__ */ new Set());
42238
+ const prevTraitRef = React95.useRef(null);
42239
+ React95.useEffect(() => {
42420
42240
  const interval = setInterval(() => {
42421
42241
  const w = window;
42422
42242
  const step = w.__orbitalWalkStep;
@@ -42852,15 +42672,15 @@ var init_EntitiesTab = __esm({
42852
42672
  });
42853
42673
  function EventFlowTab({ events: events2 }) {
42854
42674
  const { t } = useTranslate();
42855
- const [filter, setFilter] = React96.useState("all");
42856
- const containerRef = React96.useRef(null);
42857
- const [autoScroll, setAutoScroll] = React96.useState(true);
42858
- React96.useEffect(() => {
42675
+ const [filter, setFilter] = React95.useState("all");
42676
+ const containerRef = React95.useRef(null);
42677
+ const [autoScroll, setAutoScroll] = React95.useState(true);
42678
+ React95.useEffect(() => {
42859
42679
  if (autoScroll && containerRef.current) {
42860
42680
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
42861
42681
  }
42862
42682
  }, [events2.length, autoScroll]);
42863
- const filteredEvents = React96.useMemo(() => {
42683
+ const filteredEvents = React95.useMemo(() => {
42864
42684
  if (filter === "all") return events2;
42865
42685
  return events2.filter((e) => e.type === filter);
42866
42686
  }, [events2, filter]);
@@ -42976,7 +42796,7 @@ var init_EventFlowTab = __esm({
42976
42796
  });
42977
42797
  function GuardsPanel({ guards }) {
42978
42798
  const { t } = useTranslate();
42979
- const [filter, setFilter] = React96.useState("all");
42799
+ const [filter, setFilter] = React95.useState("all");
42980
42800
  if (guards.length === 0) {
42981
42801
  return /* @__PURE__ */ jsx(
42982
42802
  EmptyState,
@@ -42989,7 +42809,7 @@ function GuardsPanel({ guards }) {
42989
42809
  }
42990
42810
  const passedCount = guards.filter((g) => g.result).length;
42991
42811
  const failedCount = guards.length - passedCount;
42992
- const filteredGuards = React96.useMemo(() => {
42812
+ const filteredGuards = React95.useMemo(() => {
42993
42813
  if (filter === "all") return guards;
42994
42814
  if (filter === "passed") return guards.filter((g) => g.result);
42995
42815
  return guards.filter((g) => !g.result);
@@ -43152,10 +42972,10 @@ function EffectBadge({ effect }) {
43152
42972
  }
43153
42973
  function TransitionTimeline({ transitions }) {
43154
42974
  const { t } = useTranslate();
43155
- const containerRef = React96.useRef(null);
43156
- const [autoScroll, setAutoScroll] = React96.useState(true);
43157
- const [expandedId, setExpandedId] = React96.useState(null);
43158
- React96.useEffect(() => {
42975
+ const containerRef = React95.useRef(null);
42976
+ const [autoScroll, setAutoScroll] = React95.useState(true);
42977
+ const [expandedId, setExpandedId] = React95.useState(null);
42978
+ React95.useEffect(() => {
43159
42979
  if (autoScroll && containerRef.current) {
43160
42980
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
43161
42981
  }
@@ -43435,9 +43255,9 @@ function getAllEvents(traits2) {
43435
43255
  function EventDispatcherTab({ traits: traits2, schema }) {
43436
43256
  const eventBus = useEventBus();
43437
43257
  const { t } = useTranslate();
43438
- const [log9, setLog] = React96.useState([]);
43439
- const prevStatesRef = React96.useRef(/* @__PURE__ */ new Map());
43440
- React96.useEffect(() => {
43258
+ const [log9, setLog] = React95.useState([]);
43259
+ const prevStatesRef = React95.useRef(/* @__PURE__ */ new Map());
43260
+ React95.useEffect(() => {
43441
43261
  for (const trait of traits2) {
43442
43262
  const prev = prevStatesRef.current.get(trait.id);
43443
43263
  if (prev && prev !== trait.currentState) {
@@ -43606,10 +43426,10 @@ function VerifyModePanel({
43606
43426
  localCount
43607
43427
  }) {
43608
43428
  const { t } = useTranslate();
43609
- const [expanded, setExpanded] = React96.useState(true);
43610
- const scrollRef = React96.useRef(null);
43611
- const prevCountRef = React96.useRef(0);
43612
- React96.useEffect(() => {
43429
+ const [expanded, setExpanded] = React95.useState(true);
43430
+ const scrollRef = React95.useRef(null);
43431
+ const prevCountRef = React95.useRef(0);
43432
+ React95.useEffect(() => {
43613
43433
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
43614
43434
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
43615
43435
  }
@@ -43666,10 +43486,10 @@ function RuntimeDebugger({
43666
43486
  schema
43667
43487
  }) {
43668
43488
  const { t } = useTranslate();
43669
- const [isCollapsed, setIsCollapsed] = React96.useState(mode === "verify" ? true : defaultCollapsed);
43670
- const [isVisible, setIsVisible] = React96.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
43489
+ const [isCollapsed, setIsCollapsed] = React95.useState(mode === "verify" ? true : defaultCollapsed);
43490
+ const [isVisible, setIsVisible] = React95.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
43671
43491
  const debugData = useDebugData();
43672
- React96.useEffect(() => {
43492
+ React95.useEffect(() => {
43673
43493
  if (mode === "inline") return;
43674
43494
  return onDebugToggle((enabled) => {
43675
43495
  setIsVisible(enabled);
@@ -43678,7 +43498,7 @@ function RuntimeDebugger({
43678
43498
  }
43679
43499
  });
43680
43500
  }, [mode]);
43681
- React96.useEffect(() => {
43501
+ React95.useEffect(() => {
43682
43502
  if (mode === "inline") return;
43683
43503
  const handleKeyDown = (e) => {
43684
43504
  if (e.key === "`" && isVisible) {
@@ -44198,7 +44018,7 @@ var init_StatCard = __esm({
44198
44018
  const labelToUse = propLabel ?? propTitle;
44199
44019
  const eventBus = useEventBus();
44200
44020
  const { t } = useTranslate();
44201
- const handleActionClick = React96__default.useCallback(() => {
44021
+ const handleActionClick = React95__default.useCallback(() => {
44202
44022
  if (action?.event) {
44203
44023
  eventBus.emit(`UI:${action.event}`, {});
44204
44024
  }
@@ -44209,7 +44029,7 @@ var init_StatCard = __esm({
44209
44029
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
44210
44030
  const isLoading = externalLoading ?? false;
44211
44031
  const error = externalError;
44212
- const computeMetricValue = React96__default.useCallback(
44032
+ const computeMetricValue = React95__default.useCallback(
44213
44033
  (metric, items) => {
44214
44034
  if (metric.value !== void 0) {
44215
44035
  return metric.value;
@@ -44248,7 +44068,7 @@ var init_StatCard = __esm({
44248
44068
  },
44249
44069
  []
44250
44070
  );
44251
- const schemaStats = React96__default.useMemo(() => {
44071
+ const schemaStats = React95__default.useMemo(() => {
44252
44072
  if (!metrics || metrics.length === 0) return null;
44253
44073
  return metrics.map((metric) => ({
44254
44074
  label: metric.label,
@@ -44256,7 +44076,7 @@ var init_StatCard = __esm({
44256
44076
  format: metric.format
44257
44077
  }));
44258
44078
  }, [metrics, data, computeMetricValue]);
44259
- const calculatedTrend = React96__default.useMemo(() => {
44079
+ const calculatedTrend = React95__default.useMemo(() => {
44260
44080
  if (manualTrend !== void 0) return manualTrend;
44261
44081
  if (previousValue === void 0 || currentValue === void 0)
44262
44082
  return void 0;
@@ -44896,8 +44716,8 @@ var init_SubagentTracePanel = __esm({
44896
44716
  ] });
44897
44717
  };
44898
44718
  InlineActivityStream = ({ activities, autoScroll = true, className }) => {
44899
- const endRef = React96__default.useRef(null);
44900
- React96__default.useEffect(() => {
44719
+ const endRef = React95__default.useRef(null);
44720
+ React95__default.useEffect(() => {
44901
44721
  if (!autoScroll) return;
44902
44722
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
44903
44723
  }, [activities.length, autoScroll]);
@@ -44991,7 +44811,7 @@ var init_SubagentTracePanel = __esm({
44991
44811
  };
44992
44812
  SubagentRichCard = ({ subagent }) => {
44993
44813
  const { t } = useTranslate();
44994
- const activities = React96__default.useMemo(
44814
+ const activities = React95__default.useMemo(
44995
44815
  () => subagentMessagesToActivities(subagent.messages),
44996
44816
  [subagent.messages]
44997
44817
  );
@@ -45068,8 +44888,8 @@ var init_SubagentTracePanel = __esm({
45068
44888
  ] });
45069
44889
  };
45070
44890
  CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
45071
- const endRef = React96__default.useRef(null);
45072
- React96__default.useEffect(() => {
44891
+ const endRef = React95__default.useRef(null);
44892
+ React95__default.useEffect(() => {
45073
44893
  if (!autoScroll) return;
45074
44894
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
45075
44895
  }, [messages.length, autoScroll]);
@@ -45499,7 +45319,7 @@ var init_Timeline = __esm({
45499
45319
  }) => {
45500
45320
  const { t } = useTranslate();
45501
45321
  const entityData = entity ?? [];
45502
- const items = React96__default.useMemo(() => {
45322
+ const items = React95__default.useMemo(() => {
45503
45323
  if (propItems) return propItems;
45504
45324
  if (entityData.length === 0) return [];
45505
45325
  return entityData.map((record, idx) => {
@@ -45601,7 +45421,7 @@ var init_Timeline = __esm({
45601
45421
  }
45602
45422
  });
45603
45423
  function extractToastProps(children) {
45604
- if (!React96__default.isValidElement(children)) {
45424
+ if (!React95__default.isValidElement(children)) {
45605
45425
  if (typeof children === "string") {
45606
45426
  return { message: children };
45607
45427
  }
@@ -45643,7 +45463,7 @@ var init_ToastSlot = __esm({
45643
45463
  eventBus.emit(`${prefix}CLOSE`);
45644
45464
  };
45645
45465
  if (!isVisible) return null;
45646
- const isCustomContent = React96__default.isValidElement(children) && !message;
45466
+ const isCustomContent = React95__default.isValidElement(children) && !message;
45647
45467
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
45648
45468
  Toast,
45649
45469
  {
@@ -45660,7 +45480,7 @@ var init_ToastSlot = __esm({
45660
45480
  }
45661
45481
  });
45662
45482
  function lazyThree(name, loader) {
45663
- const Lazy = React96__default.lazy(
45483
+ const Lazy = React95__default.lazy(
45664
45484
  () => loader().then((m) => {
45665
45485
  const Resolved = m[name];
45666
45486
  if (!Resolved) {
@@ -45672,13 +45492,13 @@ function lazyThree(name, loader) {
45672
45492
  })
45673
45493
  );
45674
45494
  function ThreeWrapper(props) {
45675
- return React96__default.createElement(
45495
+ return React95__default.createElement(
45676
45496
  ThreeBoundary,
45677
45497
  { name },
45678
- React96__default.createElement(
45679
- React96__default.Suspense,
45498
+ React95__default.createElement(
45499
+ React95__default.Suspense,
45680
45500
  { fallback: null },
45681
- React96__default.createElement(Lazy, props)
45501
+ React95__default.createElement(Lazy, props)
45682
45502
  )
45683
45503
  );
45684
45504
  }
@@ -45885,7 +45705,6 @@ var init_component_registry_generated = __esm({
45885
45705
  init_Sidebar();
45886
45706
  init_SignaturePad();
45887
45707
  init_SimpleGrid();
45888
- init_SimulationCanvas();
45889
45708
  init_SimulatorBoard();
45890
45709
  init_Skeleton();
45891
45710
  init_SocialProof();
@@ -45958,7 +45777,7 @@ var init_component_registry_generated = __esm({
45958
45777
  init_WizardContainer();
45959
45778
  init_WizardNavigation();
45960
45779
  init_WizardProgress();
45961
- ThreeBoundary = class extends React96__default.Component {
45780
+ ThreeBoundary = class extends React95__default.Component {
45962
45781
  constructor() {
45963
45782
  super(...arguments);
45964
45783
  __publicField(this, "state", { failed: false });
@@ -45968,7 +45787,7 @@ var init_component_registry_generated = __esm({
45968
45787
  }
45969
45788
  render() {
45970
45789
  if (this.state.failed) {
45971
- return React96__default.createElement(
45790
+ return React95__default.createElement(
45972
45791
  "div",
45973
45792
  {
45974
45793
  "data-testid": "three-unavailable",
@@ -46197,7 +46016,6 @@ var init_component_registry_generated = __esm({
46197
46016
  "Sidebar": Sidebar,
46198
46017
  "SignaturePad": SignaturePad,
46199
46018
  "SimpleGrid": SimpleGrid,
46200
- "SimulationCanvas": SimulationCanvas,
46201
46019
  "SimulatorBoard": SimulatorBoard,
46202
46020
  "Skeleton": Skeleton,
46203
46021
  "SocialProof": SocialProof,
@@ -46292,7 +46110,7 @@ function SuspenseConfigProvider({
46292
46110
  config,
46293
46111
  children
46294
46112
  }) {
46295
- return React96__default.createElement(
46113
+ return React95__default.createElement(
46296
46114
  SuspenseConfigContext.Provider,
46297
46115
  { value: config },
46298
46116
  children
@@ -46334,7 +46152,7 @@ function enrichFormFields(fields, entityDef) {
46334
46152
  }
46335
46153
  return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
46336
46154
  }
46337
- if (field && typeof field === "object" && !Array.isArray(field) && !React96__default.isValidElement(field) && !(field instanceof Date)) {
46155
+ if (field && typeof field === "object" && !Array.isArray(field) && !React95__default.isValidElement(field) && !(field instanceof Date)) {
46338
46156
  const obj = field;
46339
46157
  const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
46340
46158
  if (!fieldName) return field;
@@ -46787,7 +46605,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
46787
46605
  const key = `${parentId}-${index}-trait:${traitName}`;
46788
46606
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
46789
46607
  }
46790
- return /* @__PURE__ */ jsx(React96__default.Fragment, { children: child }, `${parentId}-${index}`);
46608
+ return /* @__PURE__ */ jsx(React95__default.Fragment, { children: child }, `${parentId}-${index}`);
46791
46609
  }
46792
46610
  if (!child || typeof child !== "object") return null;
46793
46611
  const childId = `${parentId}-${index}`;
@@ -46827,14 +46645,14 @@ function isPatternConfig(value) {
46827
46645
  if (value === null || value === void 0) return false;
46828
46646
  if (typeof value !== "object") return false;
46829
46647
  if (Array.isArray(value)) return false;
46830
- if (React96__default.isValidElement(value)) return false;
46648
+ if (React95__default.isValidElement(value)) return false;
46831
46649
  if (value instanceof Date) return false;
46832
46650
  if (typeof value === "function") return false;
46833
46651
  const record = value;
46834
46652
  return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
46835
46653
  }
46836
46654
  function isPlainConfigObject(value) {
46837
- if (React96__default.isValidElement(value)) return false;
46655
+ if (React95__default.isValidElement(value)) return false;
46838
46656
  if (value instanceof Date) return false;
46839
46657
  const proto = Object.getPrototypeOf(value);
46840
46658
  return proto === Object.prototype || proto === null;
@@ -46960,7 +46778,7 @@ function SlotContentRenderer({
46960
46778
  for (const slotKey of CONTENT_NODE_SLOTS) {
46961
46779
  const slotVal = restProps[slotKey];
46962
46780
  if (slotVal === void 0 || slotVal === null) continue;
46963
- if (React96__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
46781
+ if (React95__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
46964
46782
  if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
46965
46783
  nodeSlotOverrides[slotKey] = renderPatternChildren(
46966
46784
  slotVal,
@@ -47009,7 +46827,7 @@ function SlotContentRenderer({
47009
46827
  const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
47010
46828
  if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
47011
46829
  const sample = resolvedItems[0];
47012
- if (sample && typeof sample === "object" && !Array.isArray(sample) && !React96__default.isValidElement(sample) && !(sample instanceof Date)) {
46830
+ if (sample && typeof sample === "object" && !Array.isArray(sample) && !React95__default.isValidElement(sample) && !(sample instanceof Date)) {
47013
46831
  const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
47014
46832
  finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
47015
46833
  }
@@ -47301,7 +47119,7 @@ function resolveLambdaBindings(body, params, item, index) {
47301
47119
  if (Array.isArray(body)) {
47302
47120
  return body.map((b) => recur(b));
47303
47121
  }
47304
- if (body !== null && typeof body === "object" && !React96__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
47122
+ if (body !== null && typeof body === "object" && !React95__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
47305
47123
  const out = {};
47306
47124
  for (const [k, v] of Object.entries(body)) {
47307
47125
  out[k] = recur(v);
@@ -47320,7 +47138,7 @@ function getSlotContentRenderer2() {
47320
47138
  function makeLambdaFn(params, lambdaBody, callerKey) {
47321
47139
  return (item, index) => {
47322
47140
  const resolvedBody = resolveLambdaBindings(lambdaBody, params, item, index);
47323
- if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React96__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
47141
+ if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React95__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
47324
47142
  return null;
47325
47143
  }
47326
47144
  const record = resolvedBody;
@@ -47339,7 +47157,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
47339
47157
  props: childProps,
47340
47158
  priority: 0
47341
47159
  };
47342
- return React96__default.createElement(SlotContentRenderer2, { content: childContent });
47160
+ return React95__default.createElement(SlotContentRenderer2, { content: childContent });
47343
47161
  };
47344
47162
  }
47345
47163
  function convertNode(node, callerKey) {
@@ -47358,7 +47176,7 @@ function convertNode(node, callerKey) {
47358
47176
  });
47359
47177
  return anyChanged ? mapped : node;
47360
47178
  }
47361
- if (typeof node === "object" && !React96__default.isValidElement(node) && !(node instanceof Date)) {
47179
+ if (typeof node === "object" && !React95__default.isValidElement(node) && !(node instanceof Date)) {
47362
47180
  return convertObjectProps(node);
47363
47181
  }
47364
47182
  return node;
@@ -47809,42 +47627,14 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
47809
47627
  });
47810
47628
  }, [executeTransitionEffects]);
47811
47629
  useEffect(() => {
47812
- const hasFrameTicks = traitBindingsRef.current.some(
47813
- (b) => b.trait.ticks?.some((t) => t.interval === "frame")
47814
- );
47815
- if (!hasFrameTicks) return;
47816
- let running = true;
47817
- let rafId = 0;
47818
- const frame = () => {
47819
- if (!running) return;
47820
- for (const binding of traitBindingsRef.current) {
47821
- for (const tick of binding.trait.ticks ?? []) {
47822
- if (tick.interval !== "frame") continue;
47823
- runTickEffects(tick, binding);
47824
- }
47825
- }
47826
- rafId = requestAnimationFrame(frame);
47827
- };
47828
- rafId = requestAnimationFrame(frame);
47829
- return () => {
47830
- running = false;
47831
- cancelAnimationFrame(rafId);
47832
- };
47833
- }, [traitBindings, runTickEffects]);
47834
- useEffect(() => {
47835
- const intervals = [];
47630
+ const scheduler = createTickScheduler();
47836
47631
  for (const binding of traitBindings) {
47837
47632
  for (const tick of binding.trait.ticks ?? []) {
47838
- if (tick.interval === "frame") continue;
47839
- const ms = tick.interval;
47840
- intervals.push(setInterval(() => {
47841
- runTickEffects(tick, binding);
47842
- }, ms));
47633
+ const intervalMs = tick.interval === "frame" ? 0 : tick.interval;
47634
+ scheduler.add(intervalMs, () => runTickEffects(tick, binding));
47843
47635
  }
47844
47636
  }
47845
- return () => {
47846
- for (const id of intervals) clearInterval(id);
47847
- };
47637
+ return () => scheduler.stopAll();
47848
47638
  }, [traitBindings, runTickEffects]);
47849
47639
  const processEventQueued = useCallback(async (eventKey, payload) => {
47850
47640
  const normalizedEvent = normalizeEventKey(eventKey);