@almadar/ui 5.121.4 → 5.122.1

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 React83 from 'react';
2
- import React83__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, lazy, useLayoutEffect, useId, useSyncExternalStore } from 'react';
1
+ import * as React84 from 'react';
2
+ import React84__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, lazy, useLayoutEffect, useId, useSyncExternalStore } from 'react';
3
3
  import { EventBusContext, useTraitScopeChain, useEntitySchemaOptional, TraitScopeProvider, useCurrentPagePath, useGameAudioContextOptional } from '@almadar/ui/providers';
4
4
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
5
5
  import { clsx } from 'clsx';
@@ -399,7 +399,7 @@ var init_Box = __esm({
399
399
  fixed: "fixed",
400
400
  sticky: "sticky"
401
401
  };
402
- Box = React83__default.forwardRef(
402
+ Box = React84__default.forwardRef(
403
403
  ({
404
404
  padding,
405
405
  paddingX,
@@ -464,7 +464,7 @@ var init_Box = __esm({
464
464
  onPointerDown?.(e);
465
465
  }, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
466
466
  const isClickable = action || onClick;
467
- return React83__default.createElement(
467
+ return React84__default.createElement(
468
468
  Component,
469
469
  {
470
470
  ref,
@@ -681,7 +681,7 @@ var init_Icon = __esm({
681
681
  const effectiveName = typeof icon === "string" && icon !== "" ? icon : name;
682
682
  const effectiveStrokeWidth = strokeWidth != null && strokeWidth > 0 ? strokeWidth : void 0;
683
683
  const family = useIconFamily();
684
- const RenderedComponent = React83__default.useMemo(() => {
684
+ const RenderedComponent = React84__default.useMemo(() => {
685
685
  if (directIcon) return null;
686
686
  return effectiveName ? resolveIconForFamily(effectiveName) : null;
687
687
  }, [directIcon, effectiveName, family]);
@@ -801,7 +801,7 @@ var init_atlasSlice = __esm({
801
801
  }
802
802
  });
803
803
  function useAtlasSliceDataUrl(asset) {
804
- const [, bump] = React83.useReducer((x) => x + 1, 0);
804
+ const [, bump] = React84.useReducer((x) => x + 1, 0);
805
805
  if (!isAtlasAsset(asset)) return void 0;
806
806
  const key = `${asset.atlas}#${asset.sprite}`;
807
807
  const cached = sliceDataUrlCache.get(key);
@@ -864,13 +864,13 @@ function AtlasImage({
864
864
  style,
865
865
  "aria-hidden": ariaHidden
866
866
  }) {
867
- const [, bump] = React83.useReducer((x) => x + 1, 0);
868
- const canvasRef = React83.useRef(null);
867
+ const [, bump] = React84.useReducer((x) => x + 1, 0);
868
+ const canvasRef = React84.useRef(null);
869
869
  const sliced = isAtlasAsset(asset);
870
870
  const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
871
871
  const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
872
872
  const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
873
- React83.useEffect(() => {
873
+ React84.useEffect(() => {
874
874
  const canvas = canvasRef.current;
875
875
  if (!canvas || !img || !rect) return;
876
876
  canvas.width = rect.sw;
@@ -946,7 +946,7 @@ function resolveIconProp(value, sizeClass) {
946
946
  const IconComp = value;
947
947
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
948
948
  }
949
- if (React83__default.isValidElement(value)) {
949
+ if (React84__default.isValidElement(value)) {
950
950
  return value;
951
951
  }
952
952
  if (typeof value === "object" && value !== null && isIconLike(value)) {
@@ -1023,7 +1023,7 @@ var init_Button = __esm({
1023
1023
  md: "h-icon-default w-icon-default",
1024
1024
  lg: "h-icon-default w-icon-default"
1025
1025
  };
1026
- Button = React83__default.forwardRef(
1026
+ Button = React84__default.forwardRef(
1027
1027
  ({
1028
1028
  className,
1029
1029
  variant = "primary",
@@ -1065,7 +1065,8 @@ var init_Button = __esm({
1065
1065
  "font-medium",
1066
1066
  "rounded-sm",
1067
1067
  "cursor-pointer",
1068
- "transition-all duration-[var(--transition-normal)]",
1068
+ "chrome-button",
1069
+ "transition-all duration-normal",
1069
1070
  "focus:outline-none focus:ring-[length:var(--focus-ring-width)] focus:ring-ring focus:ring-offset-[length:var(--focus-ring-offset)]",
1070
1071
  "disabled:opacity-50 disabled:cursor-not-allowed",
1071
1072
  variantStyles[variant],
@@ -1091,7 +1092,7 @@ var Dialog;
1091
1092
  var init_Dialog = __esm({
1092
1093
  "components/core/atoms/Dialog.tsx"() {
1093
1094
  init_cn();
1094
- Dialog = React83__default.forwardRef(
1095
+ Dialog = React84__default.forwardRef(
1095
1096
  ({
1096
1097
  role = "dialog",
1097
1098
  "aria-modal": ariaModal = true,
@@ -1209,7 +1210,7 @@ var init_Typography = __esm({
1209
1210
  }) => {
1210
1211
  const variant = variantProp ?? (level ? `h${level}` : "body1");
1211
1212
  const Component = as || defaultElements[variant];
1212
- return React83__default.createElement(
1213
+ return React84__default.createElement(
1213
1214
  Component,
1214
1215
  {
1215
1216
  id,
@@ -1265,6 +1266,7 @@ var init_Modal = __esm({
1265
1266
  isOpen = true,
1266
1267
  onClose = () => {
1267
1268
  },
1269
+ onExited,
1268
1270
  title,
1269
1271
  children = null,
1270
1272
  footer,
@@ -1291,7 +1293,10 @@ var init_Modal = __esm({
1291
1293
  wasOpenRef.current = isOpen;
1292
1294
  }, [isOpen]);
1293
1295
  const handleAnimEnd = (e) => {
1294
- if (closing && e.target === e.currentTarget) setClosing(false);
1296
+ if (closing && e.target === e.currentTarget) {
1297
+ setClosing(false);
1298
+ onExited?.();
1299
+ }
1295
1300
  };
1296
1301
  useEffect(() => {
1297
1302
  if (isOpen) {
@@ -1461,12 +1466,84 @@ var init_Modal = __esm({
1461
1466
  Modal.displayName = "Modal";
1462
1467
  }
1463
1468
  });
1469
+ function isMotionEnabled() {
1470
+ if (typeof document === "undefined") return true;
1471
+ if (motionEnabledCache !== null) return motionEnabledCache;
1472
+ const v = getComputedStyle(document.documentElement).getPropertyValue("--motion-enable").trim().toLowerCase();
1473
+ motionEnabledCache = v !== "off";
1474
+ return motionEnabledCache;
1475
+ }
1476
+ function usePresence(show, opts) {
1477
+ const { animation, animate = true, onExited } = opts;
1478
+ const [mounted, setMounted] = useState(show);
1479
+ const [exiting, setExiting] = useState(false);
1480
+ const prev = useRef(show);
1481
+ const onExitedRef = useRef(onExited);
1482
+ onExitedRef.current = onExited;
1483
+ const safeTimer = useRef(null);
1484
+ const clearSafe = useCallback(() => {
1485
+ if (safeTimer.current) {
1486
+ clearTimeout(safeTimer.current);
1487
+ safeTimer.current = null;
1488
+ }
1489
+ }, []);
1490
+ const finishExit = useCallback(() => {
1491
+ clearSafe();
1492
+ setExiting(false);
1493
+ setMounted(false);
1494
+ onExitedRef.current?.();
1495
+ }, [clearSafe]);
1496
+ useEffect(() => {
1497
+ const moving = animate && isMotionEnabled();
1498
+ if (show && !prev.current) {
1499
+ setExiting(false);
1500
+ setMounted(true);
1501
+ } else if (!show && prev.current) {
1502
+ if (moving) {
1503
+ setExiting(true);
1504
+ clearSafe();
1505
+ safeTimer.current = setTimeout(finishExit, SAFE_EXIT_MS);
1506
+ } else {
1507
+ setMounted(false);
1508
+ setExiting(false);
1509
+ }
1510
+ }
1511
+ prev.current = show;
1512
+ }, [show, animate, clearSafe, finishExit]);
1513
+ useEffect(() => () => clearSafe(), [clearSafe]);
1514
+ const disabled = !animate || !isMotionEnabled();
1515
+ const className = disabled ? "" : exiting ? `animate-${animation}-out` : `animate-${animation}-in`;
1516
+ const onAnimationEnd = useCallback(
1517
+ (e) => {
1518
+ if (e.target !== e.currentTarget) return;
1519
+ if (exiting) finishExit();
1520
+ },
1521
+ [exiting, finishExit]
1522
+ );
1523
+ return { mounted, exiting, className, onAnimationEnd };
1524
+ }
1525
+ var SAFE_EXIT_MS, motionEnabledCache, Presence;
1526
+ var init_Presence = __esm({
1527
+ "components/core/atoms/Presence.tsx"() {
1528
+ "use client";
1529
+ init_cn();
1530
+ SAFE_EXIT_MS = 1e3;
1531
+ motionEnabledCache = null;
1532
+ Presence = ({ show, className, children, ...opts }) => {
1533
+ const { mounted, className: animClass, onAnimationEnd } = usePresence(show, opts);
1534
+ if (!mounted) return null;
1535
+ return /* @__PURE__ */ jsx("div", { className: cn(animClass, className), onAnimationEnd, children });
1536
+ };
1537
+ Presence.displayName = "Presence";
1538
+ }
1539
+ });
1464
1540
  var Overlay;
1465
1541
  var init_Overlay = __esm({
1466
1542
  "components/core/atoms/Overlay.tsx"() {
1467
1543
  "use client";
1468
1544
  init_cn();
1469
1545
  init_useEventBus();
1546
+ init_Presence();
1470
1547
  Overlay = ({
1471
1548
  isVisible = true,
1472
1549
  onClick,
@@ -1475,7 +1552,8 @@ var init_Overlay = __esm({
1475
1552
  action
1476
1553
  }) => {
1477
1554
  const eventBus = useEventBus();
1478
- if (!isVisible) return null;
1555
+ const { mounted, className: animClass, onAnimationEnd } = usePresence(isVisible, { animation: "overlay" });
1556
+ if (!mounted) return null;
1479
1557
  const handleClick = (e) => {
1480
1558
  if (action) {
1481
1559
  eventBus.emit(`UI:${action}`, {});
@@ -1488,11 +1566,12 @@ var init_Overlay = __esm({
1488
1566
  className: cn(
1489
1567
  "fixed inset-0 z-40",
1490
1568
  blur && "backdrop-blur-sm",
1491
- "animate-overlay-in",
1569
+ animClass,
1492
1570
  className
1493
1571
  ),
1494
1572
  style: { backgroundColor: "rgba(0, 0, 0, 0.6)" },
1495
1573
  onClick: action || onClick ? handleClick : void 0,
1574
+ onAnimationEnd,
1496
1575
  "aria-hidden": "true"
1497
1576
  }
1498
1577
  );
@@ -1507,6 +1586,7 @@ var init_Drawer = __esm({
1507
1586
  init_Button();
1508
1587
  init_Typography();
1509
1588
  init_Overlay();
1589
+ init_Presence();
1510
1590
  init_cn();
1511
1591
  init_useEventBus();
1512
1592
  sizeWidths = {
@@ -1560,6 +1640,7 @@ var init_Drawer = __esm({
1560
1640
  document.addEventListener("keydown", handleEscape);
1561
1641
  return () => document.removeEventListener("keydown", handleEscape);
1562
1642
  }, [isOpen, closeOnEscape, onClose, closeEvent, eventBus]);
1643
+ const { mounted, className: drawerAnim, onAnimationEnd } = usePresence(isOpen, { animation: "drawer" });
1563
1644
  useEffect(() => {
1564
1645
  if (isOpen) {
1565
1646
  document.body.style.overflow = "hidden";
@@ -1570,7 +1651,7 @@ var init_Drawer = __esm({
1570
1651
  document.body.style.overflow = "";
1571
1652
  };
1572
1653
  }, [isOpen]);
1573
- if (!isOpen) return null;
1654
+ if (!mounted) return null;
1574
1655
  const handleClose = () => {
1575
1656
  if (closeEvent) eventBus.emit(`UI:${closeEvent}`, {});
1576
1657
  onClose();
@@ -1583,7 +1664,7 @@ var init_Drawer = __esm({
1583
1664
  const widthClass = width in sizeWidths ? sizeWidths[width] : "";
1584
1665
  const widthStyle = width in sizeWidths ? void 0 : { width };
1585
1666
  const positionClasses = position === "right" ? "right-0 border-l" : "left-0 border-r";
1586
- const animationClasses2 = position === "right" ? "animate-slide-in-right" : "animate-slide-in-left";
1667
+ const drawerSign = position === "right" ? 1 : -1;
1587
1668
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1588
1669
  /* @__PURE__ */ jsx(
1589
1670
  Overlay,
@@ -1605,12 +1686,13 @@ var init_Drawer = __esm({
1605
1686
  "flex flex-col max-h-screen",
1606
1687
  positionClasses,
1607
1688
  widthClass,
1608
- animationClasses2,
1689
+ drawerAnim,
1609
1690
  className
1610
1691
  ),
1611
- style: widthStyle,
1692
+ style: { ...widthStyle, "--motion-drawer-sign": drawerSign },
1612
1693
  role: "dialog",
1613
1694
  "aria-modal": "true",
1695
+ onAnimationEnd,
1614
1696
  ...title && { "aria-labelledby": "drawer-title" },
1615
1697
  children: [
1616
1698
  (title || showCloseButton) && /* @__PURE__ */ jsxs(
@@ -1649,31 +1731,7 @@ var init_Drawer = __esm({
1649
1731
  )
1650
1732
  ]
1651
1733
  }
1652
- ),
1653
- /* @__PURE__ */ jsx("style", { children: `
1654
- @keyframes slide-in-right {
1655
- from {
1656
- transform: translateX(100%);
1657
- }
1658
- to {
1659
- transform: translateX(0);
1660
- }
1661
- }
1662
- @keyframes slide-in-left {
1663
- from {
1664
- transform: translateX(-100%);
1665
- }
1666
- to {
1667
- transform: translateX(0);
1668
- }
1669
- }
1670
- .animate-slide-in-right {
1671
- animation: slide-in-right 0.3s ease-out;
1672
- }
1673
- .animate-slide-in-left {
1674
- animation: slide-in-left 0.3s ease-out;
1675
- }
1676
- ` })
1734
+ )
1677
1735
  ] });
1678
1736
  };
1679
1737
  Drawer.displayName = "Drawer";
@@ -1722,7 +1780,7 @@ var init_Badge = __esm({
1722
1780
  md: "px-2.5 py-1 text-sm",
1723
1781
  lg: "px-3 py-1.5 text-base"
1724
1782
  };
1725
- Badge = React83__default.forwardRef(
1783
+ Badge = React84__default.forwardRef(
1726
1784
  ({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
1727
1785
  const iconSizes3 = {
1728
1786
  sm: "h-icon-default w-icon-default",
@@ -1817,14 +1875,23 @@ var init_Toast = __esm({
1817
1875
  }) => {
1818
1876
  const eventBus = useEventBus();
1819
1877
  const { t } = useTranslate();
1820
- const handleDismiss = () => {
1878
+ const [leaving, setLeaving] = useState(false);
1879
+ const doRealDismiss = () => {
1821
1880
  if (dismissEvent) eventBus.emit(`UI:${dismissEvent}`, {});
1822
1881
  onDismiss?.();
1823
1882
  };
1883
+ const handleDismiss = () => {
1884
+ if (leaving) return;
1885
+ setLeaving(true);
1886
+ };
1824
1887
  const handleAction = () => {
1825
1888
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, {});
1826
1889
  onAction?.();
1827
1890
  };
1891
+ const handleAnimEnd = (e) => {
1892
+ if (e.target !== e.currentTarget) return;
1893
+ if (leaving) doRealDismiss();
1894
+ };
1828
1895
  useEffect(() => {
1829
1896
  if (duration <= 0 || !onDismiss && !dismissEvent) {
1830
1897
  return;
@@ -1843,10 +1910,12 @@ var init_Toast = __esm({
1843
1910
  // edge. `max-w-[calc(100vw-2rem)]` clamps to viewport too.
1844
1911
  "border-l-4 p-4 shadow-elevation-toast min-w-0 sm:min-w-[300px] max-w-md max-w-[calc(100vw-2rem)]",
1845
1912
  "rounded-sm",
1913
+ leaving ? "animate-toast-out" : "animate-toast-in",
1846
1914
  variantClasses[variant],
1847
1915
  className
1848
1916
  ),
1849
1917
  role: "alert",
1918
+ onAnimationEnd: handleAnimEnd,
1850
1919
  children: /* @__PURE__ */ jsxs(Box, { className: "flex items-start gap-3", children: [
1851
1920
  /* @__PURE__ */ jsx(Box, { className: "flex-shrink-0 mt-0.5", children: /* @__PURE__ */ jsx(
1852
1921
  Icon,
@@ -2059,7 +2128,7 @@ var init_SvgFlow = __esm({
2059
2128
  width = 100,
2060
2129
  height = 100
2061
2130
  }) => {
2062
- const markerId = React83__default.useMemo(() => {
2131
+ const markerId = React84__default.useMemo(() => {
2063
2132
  flowIdCounter += 1;
2064
2133
  return `almadar-flow-arrow-${flowIdCounter}`;
2065
2134
  }, []);
@@ -2652,7 +2721,7 @@ var init_SvgRing = __esm({
2652
2721
  width = 100,
2653
2722
  height = 100
2654
2723
  }) => {
2655
- const gradientId = React83__default.useMemo(() => {
2724
+ const gradientId = React84__default.useMemo(() => {
2656
2725
  ringIdCounter += 1;
2657
2726
  return `almadar-ring-glow-${ringIdCounter}`;
2658
2727
  }, []);
@@ -2833,7 +2902,7 @@ var init_Input = __esm({
2833
2902
  init_cn();
2834
2903
  init_Icon();
2835
2904
  init_useEventBus();
2836
- Input = React83__default.forwardRef(
2905
+ Input = React84__default.forwardRef(
2837
2906
  ({
2838
2907
  className,
2839
2908
  inputType,
@@ -2868,7 +2937,7 @@ var init_Input = __esm({
2868
2937
  const showClearButton = clearable && value && String(value).length > 0;
2869
2938
  const isMultiline = type === "textarea";
2870
2939
  const baseClassName = cn(
2871
- "block w-full rounded-sm transition-all duration-[var(--transition-fast)]",
2940
+ "block w-full rounded-sm transition-all duration-fast",
2872
2941
  "border-[length:var(--border-width-thin)] border-border",
2873
2942
  isMultiline ? "px-3 py-2 text-sm" : "h-input-md px-3 text-sm",
2874
2943
  "bg-card hover:bg-muted focus:bg-card",
@@ -3001,7 +3070,7 @@ var Label;
3001
3070
  var init_Label = __esm({
3002
3071
  "components/core/atoms/Label.tsx"() {
3003
3072
  init_cn();
3004
- Label = React83__default.forwardRef(
3073
+ Label = React84__default.forwardRef(
3005
3074
  ({ className, required, children, ...props }, ref) => {
3006
3075
  return /* @__PURE__ */ jsxs(
3007
3076
  "label",
@@ -3028,7 +3097,7 @@ var init_Textarea = __esm({
3028
3097
  "components/core/atoms/Textarea.tsx"() {
3029
3098
  init_cn();
3030
3099
  init_useEventBus();
3031
- Textarea = React83__default.forwardRef(
3100
+ Textarea = React84__default.forwardRef(
3032
3101
  ({ className, error, onChange, ...props }, ref) => {
3033
3102
  const eventBus = useEventBus();
3034
3103
  const handleChange = (e) => {
@@ -3267,7 +3336,7 @@ var init_Select = __esm({
3267
3336
  init_cn();
3268
3337
  init_Icon();
3269
3338
  init_useEventBus();
3270
- Select = React83__default.forwardRef(
3339
+ Select = React84__default.forwardRef(
3271
3340
  (props, _ref) => {
3272
3341
  const { multiple, searchable, clearable } = props;
3273
3342
  if (multiple || searchable || clearable) {
@@ -3284,7 +3353,7 @@ var init_Checkbox = __esm({
3284
3353
  "components/core/atoms/Checkbox.tsx"() {
3285
3354
  init_cn();
3286
3355
  init_useEventBus();
3287
- Checkbox = React83__default.forwardRef(
3356
+ Checkbox = React84__default.forwardRef(
3288
3357
  ({ className, label, id, onChange, ...props }, ref) => {
3289
3358
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
3290
3359
  const eventBus = useEventBus();
@@ -3338,7 +3407,7 @@ var init_Spinner = __esm({
3338
3407
  md: "h-6 w-6",
3339
3408
  lg: "h-8 w-8"
3340
3409
  };
3341
- Spinner = React83__default.forwardRef(
3410
+ Spinner = React84__default.forwardRef(
3342
3411
  ({ className, size = "md", overlay, ...props }, ref) => {
3343
3412
  if (overlay) {
3344
3413
  return /* @__PURE__ */ jsx(
@@ -3380,21 +3449,21 @@ var init_Card = __esm({
3380
3449
  "bg-card",
3381
3450
  "border-[length:var(--border-width)] border-border",
3382
3451
  "shadow-elevation-card",
3383
- "transition-all duration-[var(--transition-normal)]",
3452
+ "transition-all duration-normal",
3384
3453
  "hover:shadow-elevation-dialog hover:translate-y-[var(--hover-translate-y)]"
3385
3454
  ].join(" "),
3386
3455
  bordered: [
3387
3456
  "bg-card",
3388
3457
  "border-[length:var(--border-width)] border-border",
3389
3458
  "shadow-elevation-card",
3390
- "transition-all duration-[var(--transition-normal)]",
3459
+ "transition-all duration-normal",
3391
3460
  "hover:shadow-elevation-dialog hover:translate-y-[var(--hover-translate-y)]"
3392
3461
  ].join(" "),
3393
3462
  elevated: [
3394
3463
  "bg-card",
3395
3464
  "border-[length:var(--border-width)] border-border",
3396
3465
  "shadow",
3397
- "transition-all duration-[var(--transition-normal)]",
3466
+ "transition-all duration-normal",
3398
3467
  "hover:shadow-elevation-dialog hover:translate-y-[var(--hover-translate-y)]"
3399
3468
  ].join(" "),
3400
3469
  // Interactive variant with theme-specific hover effects
@@ -3403,7 +3472,7 @@ var init_Card = __esm({
3403
3472
  "border-[length:var(--border-width)] border-border",
3404
3473
  "shadow",
3405
3474
  "cursor-pointer",
3406
- "transition-all duration-[var(--transition-normal)]",
3475
+ "transition-all duration-normal",
3407
3476
  "hover:shadow-elevation-dialog"
3408
3477
  ].join(" ")
3409
3478
  };
@@ -3428,7 +3497,7 @@ var init_Card = __esm({
3428
3497
  chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
3429
3498
  "tile-image-first": "p-0 overflow-hidden"
3430
3499
  };
3431
- Card = React83__default.forwardRef(
3500
+ Card = React84__default.forwardRef(
3432
3501
  ({
3433
3502
  className,
3434
3503
  variant = "bordered",
@@ -3454,7 +3523,8 @@ var init_Card = __esm({
3454
3523
  ref,
3455
3524
  className: cn(
3456
3525
  "rounded-container relative",
3457
- "transition-all duration-[var(--transition-normal)]",
3526
+ "transition-all duration-normal",
3527
+ "chrome-panel",
3458
3528
  variantStyles4[variant],
3459
3529
  paddingStyles2[padding],
3460
3530
  lookStyles2[look],
@@ -3476,9 +3546,9 @@ var init_Card = __esm({
3476
3546
  }
3477
3547
  );
3478
3548
  Card.displayName = "Card";
3479
- CardHeader = React83__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
3549
+ CardHeader = React84__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
3480
3550
  CardHeader.displayName = "CardHeader";
3481
- CardTitle = React83__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3551
+ CardTitle = React84__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3482
3552
  "h3",
3483
3553
  {
3484
3554
  ref,
@@ -3491,11 +3561,11 @@ var init_Card = __esm({
3491
3561
  }
3492
3562
  ));
3493
3563
  CardTitle.displayName = "CardTitle";
3494
- CardContent = React83__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
3564
+ CardContent = React84__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
3495
3565
  CardContent.displayName = "CardContent";
3496
3566
  CardBody = CardContent;
3497
3567
  CardBody.displayName = "CardBody";
3498
- CardFooter = React83__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3568
+ CardFooter = React84__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3499
3569
  "div",
3500
3570
  {
3501
3571
  ref,
@@ -3582,7 +3652,7 @@ var init_FilterPill = __esm({
3582
3652
  md: "w-3.5 h-3.5",
3583
3653
  lg: "w-4 h-4"
3584
3654
  };
3585
- FilterPill = React83__default.forwardRef(
3655
+ FilterPill = React84__default.forwardRef(
3586
3656
  ({
3587
3657
  className,
3588
3658
  variant = "default",
@@ -3711,8 +3781,8 @@ var init_Avatar = __esm({
3711
3781
  actionPayload
3712
3782
  }) => {
3713
3783
  const eventBus = useEventBus();
3714
- const [imgFailed, setImgFailed] = React83__default.useState(false);
3715
- React83__default.useEffect(() => {
3784
+ const [imgFailed, setImgFailed] = React84__default.useState(false);
3785
+ React84__default.useEffect(() => {
3716
3786
  setImgFailed(false);
3717
3787
  }, [src]);
3718
3788
  const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
@@ -3825,7 +3895,7 @@ var init_Center = __esm({
3825
3895
  as: Component = "div"
3826
3896
  }) => {
3827
3897
  const mergedStyle = minHeight ? { minHeight, ...style } : style;
3828
- return React83__default.createElement(Component, {
3898
+ return React84__default.createElement(Component, {
3829
3899
  className: cn(
3830
3900
  inline ? "inline-flex" : "flex",
3831
3901
  horizontal && "justify-center",
@@ -4093,7 +4163,7 @@ var init_Radio = __esm({
4093
4163
  md: "w-2.5 h-2.5",
4094
4164
  lg: "w-3 h-3"
4095
4165
  };
4096
- Radio = React83__default.forwardRef(
4166
+ Radio = React84__default.forwardRef(
4097
4167
  ({
4098
4168
  label,
4099
4169
  helperText,
@@ -4110,12 +4180,12 @@ var init_Radio = __esm({
4110
4180
  onChange,
4111
4181
  ...props
4112
4182
  }, ref) => {
4113
- const reactId = React83__default.useId();
4183
+ const reactId = React84__default.useId();
4114
4184
  const baseId = id || `radio-${reactId}`;
4115
4185
  const hasError = !!error;
4116
4186
  const eventBus = useEventBus();
4117
- const [selected, setSelected] = React83__default.useState(value);
4118
- React83__default.useEffect(() => {
4187
+ const [selected, setSelected] = React84__default.useState(value);
4188
+ React84__default.useEffect(() => {
4119
4189
  if (value !== void 0) setSelected(value);
4120
4190
  }, [value]);
4121
4191
  const pick = (next, e) => {
@@ -4297,7 +4367,7 @@ var init_Switch = __esm({
4297
4367
  "components/core/atoms/Switch.tsx"() {
4298
4368
  "use client";
4299
4369
  init_cn();
4300
- Switch = React83.forwardRef(
4370
+ Switch = React84.forwardRef(
4301
4371
  ({
4302
4372
  checked,
4303
4373
  defaultChecked = false,
@@ -4308,10 +4378,10 @@ var init_Switch = __esm({
4308
4378
  name,
4309
4379
  className
4310
4380
  }, ref) => {
4311
- const [isChecked, setIsChecked] = React83.useState(
4381
+ const [isChecked, setIsChecked] = React84.useState(
4312
4382
  checked !== void 0 ? checked : defaultChecked
4313
4383
  );
4314
- React83.useEffect(() => {
4384
+ React84.useEffect(() => {
4315
4385
  if (checked !== void 0) {
4316
4386
  setIsChecked(checked);
4317
4387
  }
@@ -4342,7 +4412,7 @@ var init_Switch = __esm({
4342
4412
  // redefine --space-11 to 68px, which makes w-11 enormous and leaves
4343
4413
  // the thumb stuck near the left edge. The switch geometry must stay
4344
4414
  // proportional regardless of a theme's density scale.
4345
- "relative inline-flex h-[1.5rem] w-[2.75rem] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors",
4415
+ "relative inline-flex h-[1.5rem] w-[2.75rem] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors duration-fast",
4346
4416
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
4347
4417
  isChecked ? "bg-primary" : "bg-muted",
4348
4418
  disabled && "cursor-not-allowed opacity-50"
@@ -4351,7 +4421,7 @@ var init_Switch = __esm({
4351
4421
  "span",
4352
4422
  {
4353
4423
  className: cn(
4354
- "pointer-events-none block h-[1.25rem] w-[1.25rem] rounded-full bg-background shadow-lg ring-0 transition-transform",
4424
+ "pointer-events-none block h-[1.25rem] w-[1.25rem] rounded-full bg-background shadow-lg ring-0 transition-transform duration-fast",
4355
4425
  isChecked ? "translate-x-[1.25rem]" : "translate-x-0"
4356
4426
  )
4357
4427
  }
@@ -4474,7 +4544,7 @@ var init_Stack = __esm({
4474
4544
  };
4475
4545
  const isHorizontal = direction === "horizontal";
4476
4546
  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";
4477
- return React83__default.createElement(
4547
+ return React84__default.createElement(
4478
4548
  Component,
4479
4549
  {
4480
4550
  className: cn(
@@ -4519,7 +4589,7 @@ var init_TextHighlight = __esm({
4519
4589
  hoverEvent
4520
4590
  }) => {
4521
4591
  const eventBus = useEventBus();
4522
- const baseStyles = "cursor-pointer transition-all duration-150";
4592
+ const baseStyles = "cursor-pointer transition-all duration-fast";
4523
4593
  const typeStyles = {
4524
4594
  question: cn(
4525
4595
  // Blue border for questions
@@ -4674,7 +4744,7 @@ var Aside;
4674
4744
  var init_Aside = __esm({
4675
4745
  "components/core/atoms/Aside.tsx"() {
4676
4746
  init_cn();
4677
- Aside = React83__default.forwardRef(
4747
+ Aside = React84__default.forwardRef(
4678
4748
  ({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
4679
4749
  );
4680
4750
  Aside.displayName = "Aside";
@@ -4753,9 +4823,9 @@ var init_LawReferenceTooltip = __esm({
4753
4823
  className
4754
4824
  }) => {
4755
4825
  const { t } = useTranslate();
4756
- const [isVisible, setIsVisible] = React83__default.useState(false);
4757
- const timeoutRef = React83__default.useRef(null);
4758
- const triggerRef = React83__default.useRef(null);
4826
+ const [isVisible, setIsVisible] = React84__default.useState(false);
4827
+ const timeoutRef = React84__default.useRef(null);
4828
+ const triggerRef = React84__default.useRef(null);
4759
4829
  const handleMouseEnter = () => {
4760
4830
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
4761
4831
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -4766,7 +4836,7 @@ var init_LawReferenceTooltip = __esm({
4766
4836
  };
4767
4837
  const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
4768
4838
  const open = isVisible || revealed;
4769
- React83__default.useEffect(() => {
4839
+ React84__default.useEffect(() => {
4770
4840
  return () => {
4771
4841
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
4772
4842
  };
@@ -4976,7 +5046,7 @@ var init_StatusDot = __esm({
4976
5046
  md: "w-2.5 h-2.5",
4977
5047
  lg: "w-3 h-3"
4978
5048
  };
4979
- StatusDot = React83__default.forwardRef(
5049
+ StatusDot = React84__default.forwardRef(
4980
5050
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
4981
5051
  return /* @__PURE__ */ jsx(
4982
5052
  "span",
@@ -5030,7 +5100,7 @@ var init_TrendIndicator = __esm({
5030
5100
  down: "trending-down",
5031
5101
  flat: "arrow-right"
5032
5102
  };
5033
- TrendIndicator = React83__default.forwardRef(
5103
+ TrendIndicator = React84__default.forwardRef(
5034
5104
  ({
5035
5105
  className,
5036
5106
  value,
@@ -5097,7 +5167,7 @@ var init_RangeSlider = __esm({
5097
5167
  md: "w-4 h-4",
5098
5168
  lg: "w-5 h-5"
5099
5169
  };
5100
- RangeSlider = React83__default.forwardRef(
5170
+ RangeSlider = React84__default.forwardRef(
5101
5171
  ({
5102
5172
  className,
5103
5173
  min = 0,
@@ -5240,7 +5310,7 @@ var init_RangeSlider = __esm({
5240
5310
  "border-2 border-primary",
5241
5311
  "shadow-sm",
5242
5312
  "pointer-events-none",
5243
- "transition-transform duration-100",
5313
+ "transition-transform duration-instant",
5244
5314
  isDragging && "scale-[var(--hover-scale)]",
5245
5315
  thumbSizes[size]
5246
5316
  ),
@@ -5708,7 +5778,7 @@ var init_ContentSection = __esm({
5708
5778
  md: "py-16",
5709
5779
  lg: "py-24"
5710
5780
  };
5711
- ContentSection = React83__default.forwardRef(
5781
+ ContentSection = React84__default.forwardRef(
5712
5782
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
5713
5783
  return /* @__PURE__ */ jsx(
5714
5784
  Box,
@@ -6242,7 +6312,7 @@ var init_AnimatedReveal = __esm({
6242
6312
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
6243
6313
  "none": {}
6244
6314
  };
6245
- AnimatedReveal = React83__default.forwardRef(
6315
+ AnimatedReveal = React84__default.forwardRef(
6246
6316
  ({
6247
6317
  trigger = "scroll",
6248
6318
  animation = "fade-up",
@@ -6402,7 +6472,7 @@ var init_AnimatedGraphic = __esm({
6402
6472
  "components/marketing/atoms/AnimatedGraphic.tsx"() {
6403
6473
  "use client";
6404
6474
  init_cn();
6405
- AnimatedGraphic = React83__default.forwardRef(
6475
+ AnimatedGraphic = React84__default.forwardRef(
6406
6476
  ({
6407
6477
  src,
6408
6478
  svgContent,
@@ -6425,7 +6495,7 @@ var init_AnimatedGraphic = __esm({
6425
6495
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
6426
6496
  const resolvedSvg = svgContent ?? fetchedSvg;
6427
6497
  const prevAnimateRef = useRef(animate);
6428
- const setRef = React83__default.useCallback(
6498
+ const setRef = React84__default.useCallback(
6429
6499
  (node) => {
6430
6500
  containerRef.current = node;
6431
6501
  if (typeof ref === "function") ref(node);
@@ -7154,9 +7224,9 @@ function ControlButton({
7154
7224
  className
7155
7225
  }) {
7156
7226
  const eventBus = useEventBus();
7157
- const [isPressed, setIsPressed] = React83.useState(false);
7227
+ const [isPressed, setIsPressed] = React84.useState(false);
7158
7228
  const actualPressed = pressed ?? isPressed;
7159
- const handlePointerDown = React83.useCallback(
7229
+ const handlePointerDown = React84.useCallback(
7160
7230
  (e) => {
7161
7231
  e.preventDefault();
7162
7232
  if (disabled) return;
@@ -7166,7 +7236,7 @@ function ControlButton({
7166
7236
  },
7167
7237
  [disabled, pressEvent, eventBus, onPress]
7168
7238
  );
7169
- const handlePointerUp = React83.useCallback(
7239
+ const handlePointerUp = React84.useCallback(
7170
7240
  (e) => {
7171
7241
  e.preventDefault();
7172
7242
  if (disabled) return;
@@ -7176,7 +7246,7 @@ function ControlButton({
7176
7246
  },
7177
7247
  [disabled, releaseEvent, eventBus, onRelease]
7178
7248
  );
7179
- const handlePointerLeave = React83.useCallback(
7249
+ const handlePointerLeave = React84.useCallback(
7180
7250
  (e) => {
7181
7251
  if (isPressed) {
7182
7252
  setIsPressed(false);
@@ -7434,8 +7504,8 @@ function ControlGrid({
7434
7504
  className
7435
7505
  }) {
7436
7506
  const eventBus = useEventBus();
7437
- const [active, setActive] = React83.useState(/* @__PURE__ */ new Set());
7438
- const handlePress = React83.useCallback(
7507
+ const [active, setActive] = React84.useState(/* @__PURE__ */ new Set());
7508
+ const handlePress = React84.useCallback(
7439
7509
  (id) => {
7440
7510
  setActive((prev) => new Set(prev).add(id));
7441
7511
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -7449,7 +7519,7 @@ function ControlGrid({
7449
7519
  },
7450
7520
  [kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
7451
7521
  );
7452
- const handleRelease = React83.useCallback(
7522
+ const handleRelease = React84.useCallback(
7453
7523
  (id) => {
7454
7524
  setActive((prev) => {
7455
7525
  const next = new Set(prev);
@@ -7742,17 +7812,18 @@ function GameHud({
7742
7812
  const mid = Math.ceil(stats.length / 2);
7743
7813
  const leftStats = stats.slice(0, mid);
7744
7814
  const rightStats = stats.slice(mid);
7745
- const isTop = position === "top";
7746
7815
  return /* @__PURE__ */ jsxs(
7747
- Box,
7816
+ Card,
7748
7817
  {
7818
+ variant: "bordered",
7819
+ padding: "none",
7749
7820
  className: cn(
7750
- "flex items-center justify-between w-full",
7821
+ "flex items-center justify-between w-full rounded-none bg-card",
7751
7822
  "px-4 py-2 gap-4",
7752
- !transparent && (isTop ? "border-b border-border/40 bg-surface/90 backdrop-blur-sm" : "border-t border-border/40 bg-surface/90 backdrop-blur-sm"),
7753
- transparent && (isTop ? "border-b border-white/10 bg-black/40 backdrop-blur-sm" : "border-t border-white/10 bg-black/40 backdrop-blur-sm"),
7823
+ transparent && "backdrop-blur-sm",
7754
7824
  className
7755
7825
  ),
7826
+ style: transparent ? { backgroundColor: "color-mix(in srgb, var(--color-card) 40%, transparent)" } : void 0,
7756
7827
  children: [
7757
7828
  /* @__PURE__ */ jsx(Box, { className: "flex items-center gap-3 flex-shrink-0", children: leftStats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i)) }),
7758
7829
  rightStats.length > 0 && /* @__PURE__ */ jsx(Box, { className: "flex items-center gap-3 flex-shrink-0", children: rightStats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i)) })
@@ -7761,14 +7832,16 @@ function GameHud({
7761
7832
  );
7762
7833
  }
7763
7834
  return /* @__PURE__ */ jsx(
7764
- Box,
7835
+ Card,
7765
7836
  {
7766
- position: "relative",
7837
+ variant: "bordered",
7838
+ padding: "sm",
7767
7839
  className: cn(
7768
- "z-10 flex items-center gap-4 px-4 py-2",
7769
- transparent ? "bg-black/30 backdrop-blur-sm" : "bg-surface/90 backdrop-blur-sm",
7840
+ "z-10 relative flex items-center gap-4 bg-card",
7841
+ transparent && "backdrop-blur-sm",
7770
7842
  className
7771
7843
  ),
7844
+ style: transparent ? { backgroundColor: "color-mix(in srgb, var(--color-card) 30%, transparent)" } : void 0,
7772
7845
  children: stats.map((stat, i) => /* @__PURE__ */ jsx(StatBadge, { ...stat, size }, i))
7773
7846
  }
7774
7847
  );
@@ -7778,6 +7851,7 @@ var init_GameHud = __esm({
7778
7851
  "components/game/molecules/GameHud.tsx"() {
7779
7852
  init_cn();
7780
7853
  init_Box();
7854
+ init_Card();
7781
7855
  init_StatBadge();
7782
7856
  positionMap = {
7783
7857
  corners: "inset-0 pointer-events-none"
@@ -7803,7 +7877,7 @@ function GameMenu({
7803
7877
  }) {
7804
7878
  const resolvedOptions = (options?.length ? options : void 0) ?? (menuItems?.length ? menuItems : void 0) ?? DEFAULT_MENU_OPTIONS;
7805
7879
  const eventBus = useEventBus();
7806
- const handleOptionClick = React83.useCallback(
7880
+ const handleOptionClick = React84.useCallback(
7807
7881
  (option) => {
7808
7882
  if (option.event) {
7809
7883
  eventBus.emit(`UI:${option.event}`, { option });
@@ -7822,39 +7896,48 @@ function GameMenu({
7822
7896
  {
7823
7897
  className: cn(
7824
7898
  "min-h-screen w-full flex flex-col items-center justify-center p-8",
7899
+ !background && "bg-background",
7825
7900
  className
7826
7901
  ),
7827
- style: {
7828
- background: background ?? "linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0e17 100%)"
7829
- },
7902
+ style: background ? { background } : void 0,
7830
7903
  children: [
7831
- /* @__PURE__ */ jsxs(Box, { className: "text-center mb-12 animate-fade-in", children: [
7832
- logo && /* @__PURE__ */ jsx(GameIcon, { assetUrl: logo, icon: "image", size: 96, alt: title, className: "h-24 w-auto mx-auto mb-6 drop-shadow-2xl" }),
7833
- /* @__PURE__ */ jsx(
7834
- Typography,
7835
- {
7836
- variant: "h1",
7837
- className: "text-5xl md:text-7xl font-bold text-[var(--color-foreground)] tracking-tight",
7838
- style: {
7839
- textShadow: "0 4px 12px rgba(0,0,0,0.5)"
7840
- },
7841
- children: title
7842
- }
7843
- ),
7844
- subtitle && /* @__PURE__ */ jsx(Typography, { variant: "body", className: "mt-2 text-lg text-muted-foreground tracking-widest uppercase", children: subtitle })
7845
- ] }),
7846
- /* @__PURE__ */ jsx(Box, { className: "flex flex-col gap-4 w-full max-w-md", children: resolvedOptions.map((option, index) => /* @__PURE__ */ jsx(
7847
- ChoiceButton,
7904
+ /* @__PURE__ */ jsxs(
7905
+ Card,
7848
7906
  {
7849
- text: option.label,
7850
- index: index + 1,
7851
- disabled: option.disabled,
7852
- onClick: () => handleOptionClick(option),
7853
- className: "text-lg py-4 px-8"
7854
- },
7855
- index
7856
- )) }),
7857
- /* @__PURE__ */ jsxs(Box, { position: "absolute", className: "inset-0 pointer-events-none overflow-hidden", children: [
7907
+ variant: "bordered",
7908
+ padding: "lg",
7909
+ className: "bg-card flex flex-col items-center max-w-md w-full",
7910
+ children: [
7911
+ /* @__PURE__ */ jsxs(Box, { className: "text-center mb-8 animate-fade-in", children: [
7912
+ logo && /* @__PURE__ */ jsx(GameIcon, { assetUrl: logo, icon: "image", size: 96, alt: title, className: "h-24 w-auto mx-auto mb-6 drop-shadow-2xl" }),
7913
+ /* @__PURE__ */ jsx(
7914
+ Typography,
7915
+ {
7916
+ variant: "h1",
7917
+ className: "text-4xl md:text-5xl font-bold text-foreground tracking-tight",
7918
+ style: {
7919
+ textShadow: "0 4px 12px rgba(0,0,0,0.5)"
7920
+ },
7921
+ children: title
7922
+ }
7923
+ ),
7924
+ subtitle && /* @__PURE__ */ jsx(Typography, { variant: "body", className: "mt-2 text-lg text-muted-foreground tracking-widest uppercase", children: subtitle })
7925
+ ] }),
7926
+ /* @__PURE__ */ jsx(Box, { className: "flex flex-col gap-4 w-full", children: resolvedOptions.map((option, index) => /* @__PURE__ */ jsx(
7927
+ ChoiceButton,
7928
+ {
7929
+ text: option.label,
7930
+ index: index + 1,
7931
+ disabled: option.disabled,
7932
+ onClick: () => handleOptionClick(option),
7933
+ className: "text-lg py-4 px-8"
7934
+ },
7935
+ index
7936
+ )) })
7937
+ ]
7938
+ }
7939
+ ),
7940
+ /* @__PURE__ */ jsxs(Box, { position: "absolute", className: "inset-0 pointer-events-none overflow-hidden -z-10", children: [
7858
7941
  /* @__PURE__ */ jsx(Box, { position: "absolute", className: "top-1/4 left-1/4 w-64 h-64 bg-info/10 rounded-container blur-3xl" }),
7859
7942
  /* @__PURE__ */ jsx(Box, { position: "absolute", className: "bottom-1/4 right-1/4 w-96 h-96 bg-accent/10 rounded-container blur-3xl" })
7860
7943
  ] })
@@ -7869,6 +7952,7 @@ var init_GameMenu = __esm({
7869
7952
  init_cn();
7870
7953
  init_useEventBus();
7871
7954
  init_Box();
7955
+ init_Card();
7872
7956
  init_Typography();
7873
7957
  init_GameIcon();
7874
7958
  init_ChoiceButton();
@@ -8029,7 +8113,7 @@ function StateGraph({
8029
8113
  }) {
8030
8114
  const eventBus = useEventBus();
8031
8115
  const nodes = states ?? [];
8032
- const positions = React83.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
8116
+ const positions = React84.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
8033
8117
  return /* @__PURE__ */ jsxs(
8034
8118
  Box,
8035
8119
  {
@@ -8100,8 +8184,8 @@ function MiniMap({
8100
8184
  tileAssets,
8101
8185
  unitAssets
8102
8186
  }) {
8103
- const canvasRef = React83.useRef(null);
8104
- const imgCacheRef = React83.useRef(/* @__PURE__ */ new Map());
8187
+ const canvasRef = React84.useRef(null);
8188
+ const imgCacheRef = React84.useRef(/* @__PURE__ */ new Map());
8105
8189
  function loadImg(url) {
8106
8190
  const cached = imgCacheRef.current.get(url);
8107
8191
  if (cached) return cached.complete ? cached : null;
@@ -8116,7 +8200,7 @@ function MiniMap({
8116
8200
  imgCacheRef.current.set(url, img);
8117
8201
  return null;
8118
8202
  }
8119
- React83.useEffect(() => {
8203
+ React84.useEffect(() => {
8120
8204
  const canvas = canvasRef.current;
8121
8205
  if (!canvas) return;
8122
8206
  const ctx = canvas.getContext("2d");
@@ -9805,7 +9889,7 @@ function LinearView({
9805
9889
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
9806
9890
  const isDone = i < currentIdx;
9807
9891
  const isCurrent = i === currentIdx;
9808
- return /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
9892
+ return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
9809
9893
  i > 0 && /* @__PURE__ */ jsx(
9810
9894
  Typography,
9811
9895
  {
@@ -10340,7 +10424,7 @@ function SequenceBar({
10340
10424
  else onSlotRemove?.(index);
10341
10425
  }, [emit, slotRemoveEvent, onSlotRemove, playing]);
10342
10426
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
10343
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
10427
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
10344
10428
  i > 0 && /* @__PURE__ */ jsx(
10345
10429
  Typography,
10346
10430
  {
@@ -10427,6 +10511,7 @@ var init_GameShell = __esm({
10427
10511
  "components/game/templates/GameShell.tsx"() {
10428
10512
  init_cn();
10429
10513
  init_Box();
10514
+ init_Card();
10430
10515
  init_Typography();
10431
10516
  init_AtlasImage();
10432
10517
  FONT_BASE = "https://almadar-kflow-assets.web.app/shared/_shared/kenney-fonts/fonts";
@@ -10455,13 +10540,14 @@ var init_GameShell = __esm({
10455
10540
  showTopBar = true,
10456
10541
  children,
10457
10542
  backgroundAsset,
10458
- hudBackgroundAsset,
10459
- fontFamily = "future"
10543
+ fontFamily = "future",
10544
+ "data-theme": dataTheme
10460
10545
  }) => {
10461
10546
  const font = GAME_FONTS[fontFamily] ?? fontFamily;
10462
10547
  return /* @__PURE__ */ jsxs(
10463
10548
  Box,
10464
10549
  {
10550
+ "data-theme": dataTheme || void 0,
10465
10551
  className: cn("game-shell", className),
10466
10552
  style: {
10467
10553
  position: "relative",
@@ -10469,7 +10555,7 @@ var init_GameShell = __esm({
10469
10555
  height: "100vh",
10470
10556
  overflow: "hidden",
10471
10557
  background: "var(--color-background, #0a0a0f)",
10472
- color: "var(--color-text, #e0e0e0)",
10558
+ color: "var(--color-foreground, #e0e0e0)",
10473
10559
  fontFamily: `'${font}', system-ui, sans-serif`
10474
10560
  },
10475
10561
  children: [
@@ -10501,19 +10587,12 @@ var init_GameShell = __esm({
10501
10587
  },
10502
10588
  children: [
10503
10589
  showTopBar && /* @__PURE__ */ jsx(
10504
- AtlasPanel,
10590
+ Card,
10505
10591
  {
10506
- asset: hudBackgroundAsset,
10507
- borderSlice: 12,
10508
- borderWidth: 10,
10509
- className: "game-shell__title pointer-events-auto",
10510
- style: {
10511
- padding: "6px 16px",
10512
- background: hudBackgroundAsset ? void 0 : "rgba(18, 18, 31, 0.85)",
10513
- borderRadius: hudBackgroundAsset ? void 0 : 10,
10514
- boxShadow: "0 4px 14px rgba(0,0,0,0.45)",
10515
- flexShrink: 0
10516
- },
10592
+ variant: "bordered",
10593
+ padding: "none",
10594
+ className: "game-shell__title bg-card pointer-events-auto",
10595
+ style: { padding: "6px 16px", flexShrink: 0 },
10517
10596
  children: /* @__PURE__ */ jsx(
10518
10597
  Typography,
10519
10598
  {
@@ -10994,7 +11073,7 @@ var init_ErrorBoundary = __esm({
10994
11073
  }
10995
11074
  );
10996
11075
  };
10997
- ErrorBoundary = class extends React83__default.Component {
11076
+ ErrorBoundary = class extends React84__default.Component {
10998
11077
  constructor(props) {
10999
11078
  super(props);
11000
11079
  __publicField(this, "reset", () => {
@@ -11644,7 +11723,7 @@ var init_Container = __esm({
11644
11723
  as: Component = "div"
11645
11724
  }) => {
11646
11725
  const resolvedSize = maxWidth ?? size ?? "lg";
11647
- return React83__default.createElement(
11726
+ return React84__default.createElement(
11648
11727
  Component,
11649
11728
  {
11650
11729
  className: cn(
@@ -14471,7 +14550,7 @@ var init_CodeBlock = __esm({
14471
14550
  DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
14472
14551
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
14473
14552
  HIDDEN_LINE_NUMBERS = { display: "none" };
14474
- CodeBlock = React83__default.memo(
14553
+ CodeBlock = React84__default.memo(
14475
14554
  ({
14476
14555
  code: rawCode,
14477
14556
  language = "text",
@@ -15058,7 +15137,7 @@ var init_MarkdownContent = __esm({
15058
15137
  init_Box();
15059
15138
  init_CodeBlock();
15060
15139
  init_cn();
15061
- MarkdownContent = React83__default.memo(
15140
+ MarkdownContent = React84__default.memo(
15062
15141
  ({ content, direction = "ltr", className }) => {
15063
15142
  const { t: _t } = useTranslate();
15064
15143
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -16021,7 +16100,7 @@ var init_StateMachineView = __esm({
16021
16100
  Box,
16022
16101
  {
16023
16102
  className: cn(
16024
- "fixed z-50 animate-in fade-in-0 zoom-in-95 duration-150",
16103
+ "fixed z-50 animate-in fade-in-0 zoom-in-95 duration-fast",
16025
16104
  tooltip.pinned ? "pointer-events-auto" : "pointer-events-none"
16026
16105
  ),
16027
16106
  style: {
@@ -16385,7 +16464,7 @@ var init_StateMachineView = __esm({
16385
16464
  style: { top: title ? 30 : 0 },
16386
16465
  children: [
16387
16466
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
16388
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React83__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
16467
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React84__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
16389
16468
  StateNode2,
16390
16469
  {
16391
16470
  state,
@@ -18424,6 +18503,129 @@ var init_Breadcrumb = __esm({
18424
18503
  Breadcrumb.displayName = "Breadcrumb";
18425
18504
  }
18426
18505
  });
18506
+ function useSafeEventBus2() {
18507
+ try {
18508
+ return useEventBus();
18509
+ } catch {
18510
+ return { emit: () => {
18511
+ }, on: () => () => {
18512
+ }, once: () => {
18513
+ } };
18514
+ }
18515
+ }
18516
+ var log8, lookStyles4, ButtonGroup;
18517
+ var init_ButtonGroup = __esm({
18518
+ "components/core/molecules/ButtonGroup.tsx"() {
18519
+ "use client";
18520
+ init_cn();
18521
+ init_atoms();
18522
+ init_useEventBus();
18523
+ log8 = createLogger("almadar:ui:button-group");
18524
+ lookStyles4 = {
18525
+ "right-aligned-buttons": "",
18526
+ "floating-bar": "fixed bottom-section left-1/2 -translate-x-1/2 shadow-elevation-toast bg-card p-card-sm rounded-container",
18527
+ "inline-row": "gap-2 inline-flex",
18528
+ "dropdown-menu": "[&>button:not(:first-child)]:hidden",
18529
+ "command-palette-trigger": "[&>button:not(:first-child)]:hidden"
18530
+ };
18531
+ ButtonGroup = ({
18532
+ children,
18533
+ primary,
18534
+ secondary,
18535
+ variant = "default",
18536
+ orientation = "horizontal",
18537
+ className,
18538
+ // Filter-group pattern props (entity and filters are used for schema-driven filtering)
18539
+ entity: _entity,
18540
+ filters,
18541
+ look = "right-aligned-buttons"
18542
+ }) => {
18543
+ const eventBus = useSafeEventBus2();
18544
+ const variantClasses2 = {
18545
+ default: "gap-0",
18546
+ segmented: "gap-0 [&>button]:rounded-none [&>button:first-child]:rounded-l-lg [&>button:last-child]:rounded-r-lg [&>button:not(:first-child)]:border-l-0",
18547
+ toggle: "gap-0 [&>button]:rounded-none [&>button:first-child]:rounded-l-lg [&>button:last-child]:rounded-r-lg [&>button:not(:first-child)]:border-l-0"
18548
+ };
18549
+ const orientationClasses = {
18550
+ horizontal: "flex-row",
18551
+ vertical: "flex-col [&>button:first-child]:rounded-t-lg [&>button:last-child]:rounded-b-lg [&>button:not(:first-child)]:border-t-0 [&>button:not(:first-child)]:border-l"
18552
+ };
18553
+ const handleActionClick = (action) => {
18554
+ if (action.event) {
18555
+ eventBus.emit("UI:DISPATCH", { event: action.event });
18556
+ }
18557
+ if (action.navigatesTo) {
18558
+ eventBus.emit("UI:NAVIGATE", { url: action.navigatesTo });
18559
+ }
18560
+ };
18561
+ const renderFormActions = () => {
18562
+ const buttons = [];
18563
+ if (secondary) {
18564
+ secondary.forEach((action, index) => {
18565
+ buttons.push(
18566
+ /* @__PURE__ */ jsx(
18567
+ Button,
18568
+ {
18569
+ type: action.actionType === "submit" ? "submit" : "button",
18570
+ variant: action.variant || "ghost",
18571
+ onClick: () => handleActionClick(action),
18572
+ children: action.label
18573
+ },
18574
+ `secondary-${index}`
18575
+ )
18576
+ );
18577
+ });
18578
+ }
18579
+ if (primary) {
18580
+ const isSubmit = primary.actionType === "submit";
18581
+ buttons.push(
18582
+ /* @__PURE__ */ jsx(
18583
+ Button,
18584
+ {
18585
+ type: isSubmit ? "submit" : "button",
18586
+ variant: primary.variant || "primary",
18587
+ onClick: () => handleActionClick(primary),
18588
+ "data-testid": isSubmit ? "form-submit" : void 0,
18589
+ children: primary.label
18590
+ },
18591
+ "primary"
18592
+ )
18593
+ );
18594
+ }
18595
+ return buttons;
18596
+ };
18597
+ const renderFilters = () => {
18598
+ if (!filters || filters.length === 0) return null;
18599
+ return filters.map((filter, index) => /* @__PURE__ */ jsx(
18600
+ Button,
18601
+ {
18602
+ variant: "ghost",
18603
+ onClick: () => {
18604
+ log8.debug("Filter clicked", { field: filter.field });
18605
+ },
18606
+ children: filter.label
18607
+ },
18608
+ `filter-${filter.field}-${index}`
18609
+ ));
18610
+ };
18611
+ return /* @__PURE__ */ jsx(
18612
+ "div",
18613
+ {
18614
+ className: cn(
18615
+ "inline-flex gap-2",
18616
+ variantClasses2[variant],
18617
+ orientationClasses[orientation],
18618
+ lookStyles4[look],
18619
+ className
18620
+ ),
18621
+ role: "group",
18622
+ children: children || renderFilters() || renderFormActions()
18623
+ }
18624
+ );
18625
+ };
18626
+ ButtonGroup.displayName = "ButtonGroup";
18627
+ }
18628
+ });
18427
18629
  function useSwipeGesture(callbacks, options = {}) {
18428
18630
  const { threshold = 50, velocityThreshold = 0.3, preventDefault = false } = options;
18429
18631
  const startX = useRef(0);
@@ -19233,7 +19435,7 @@ var init_CardGrid = __esm({
19233
19435
  CardGrid.displayName = "CardGrid";
19234
19436
  }
19235
19437
  });
19236
- function useSafeEventBus2() {
19438
+ function useSafeEventBus3() {
19237
19439
  try {
19238
19440
  return useEventBus();
19239
19441
  } catch {
@@ -19269,7 +19471,7 @@ var init_Carousel = __esm({
19269
19471
  const [activeIndex, setActiveIndex] = useState(0);
19270
19472
  const scrollRef = useRef(null);
19271
19473
  const autoPlayRef = useRef(null);
19272
- const eventBus = useSafeEventBus2();
19474
+ const eventBus = useSafeEventBus3();
19273
19475
  const { t } = useTranslate();
19274
19476
  const safeItems = items ?? [];
19275
19477
  const totalSlides = safeItems.length;
@@ -19631,7 +19833,7 @@ var init_Chart = __esm({
19631
19833
  return /* @__PURE__ */ jsx(
19632
19834
  Box,
19633
19835
  {
19634
- className: "h-full rounded-r-sm transition-all duration-500 ease-out min-w-[2px] cursor-pointer hover:opacity-80",
19836
+ className: "h-full rounded-r-sm transition-all duration-slow ease-standard min-w-[2px] cursor-pointer hover:opacity-80",
19635
19837
  style: {
19636
19838
  width: `${ratio}%`,
19637
19839
  backgroundColor: color
@@ -19687,7 +19889,7 @@ var init_Chart = __esm({
19687
19889
  Box,
19688
19890
  {
19689
19891
  className: cn(
19690
- "rounded-t-sm transition-all duration-500 ease-out min-h-[4px] cursor-pointer hover:opacity-80",
19892
+ "rounded-t-sm transition-all duration-slow ease-standard min-h-[4px] cursor-pointer hover:opacity-80",
19691
19893
  histogram ? "flex-1 mx-0" : "flex-1"
19692
19894
  ),
19693
19895
  style: {
@@ -19737,7 +19939,7 @@ var init_Chart = __esm({
19737
19939
  return /* @__PURE__ */ jsx(
19738
19940
  Box,
19739
19941
  {
19740
- className: "w-full transition-all duration-500 ease-out cursor-pointer hover:opacity-80",
19942
+ className: "w-full transition-all duration-slow ease-standard cursor-pointer hover:opacity-80",
19741
19943
  style: {
19742
19944
  height: `${ratio}%`,
19743
19945
  backgroundColor: color
@@ -19827,7 +20029,7 @@ var init_Chart = __esm({
19827
20029
  fill: seg.color,
19828
20030
  stroke: "var(--color-card)",
19829
20031
  strokeWidth: "2",
19830
- className: "transition-opacity duration-200 hover:opacity-80 cursor-pointer",
20032
+ className: "transition-opacity duration-fast hover:opacity-80 cursor-pointer",
19831
20033
  onClick: () => onPointClick?.(
19832
20034
  { label: seg.label, value: seg.value, color: seg.color },
19833
20035
  "default"
@@ -22040,8 +22242,8 @@ var init_Menu = __esm({
22040
22242
  "bottom-end": "bottom-start"
22041
22243
  };
22042
22244
  const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
22043
- const triggerChild = React83__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
22044
- const triggerElement = React83__default.cloneElement(
22245
+ const triggerChild = React84__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
22246
+ const triggerElement = React84__default.cloneElement(
22045
22247
  triggerChild,
22046
22248
  {
22047
22249
  ref: triggerRef,
@@ -22136,14 +22338,14 @@ function useDataDnd(args) {
22136
22338
  const isZone = Boolean(dragGroup || accepts || sortable);
22137
22339
  const enabled = isZone || Boolean(dndRoot);
22138
22340
  const eventBus = useEventBus();
22139
- const parentRoot = React83__default.useContext(RootCtx);
22341
+ const parentRoot = React84__default.useContext(RootCtx);
22140
22342
  const isRoot = enabled && parentRoot === null;
22141
- const zoneId = React83__default.useId();
22343
+ const zoneId = React84__default.useId();
22142
22344
  const ownGroup = dragGroup ?? accepts ?? zoneId;
22143
- const [optimisticOrders, setOptimisticOrders] = React83__default.useState(() => /* @__PURE__ */ new Map());
22144
- const optimisticOrdersRef = React83__default.useRef(optimisticOrders);
22345
+ const [optimisticOrders, setOptimisticOrders] = React84__default.useState(() => /* @__PURE__ */ new Map());
22346
+ const optimisticOrdersRef = React84__default.useRef(optimisticOrders);
22145
22347
  optimisticOrdersRef.current = optimisticOrders;
22146
- const clearOptimisticOrder = React83__default.useCallback((group) => {
22348
+ const clearOptimisticOrder = React84__default.useCallback((group) => {
22147
22349
  setOptimisticOrders((prev) => {
22148
22350
  if (!prev.has(group)) return prev;
22149
22351
  const next = new Map(prev);
@@ -22168,7 +22370,7 @@ function useDataDnd(args) {
22168
22370
  const raw = it[dndItemIdField];
22169
22371
  return raw != null ? String(raw) : `__idx_${idx}`;
22170
22372
  }).join("|");
22171
- const itemIds = React83__default.useMemo(
22373
+ const itemIds = React84__default.useMemo(
22172
22374
  () => orderedItems.map((it, idx) => {
22173
22375
  const raw = it[dndItemIdField];
22174
22376
  return raw != null ? String(raw) : `__idx_${idx}`;
@@ -22179,7 +22381,7 @@ function useDataDnd(args) {
22179
22381
  const raw = it[dndItemIdField];
22180
22382
  return raw != null ? String(raw) : `__${idx}`;
22181
22383
  }).join("|");
22182
- React83__default.useEffect(() => {
22384
+ React84__default.useEffect(() => {
22183
22385
  const root = isRoot ? null : parentRoot;
22184
22386
  if (root) {
22185
22387
  root.clearOptimisticOrder(ownGroup);
@@ -22187,20 +22389,20 @@ function useDataDnd(args) {
22187
22389
  clearOptimisticOrder(ownGroup);
22188
22390
  }
22189
22391
  }, [itemsContentSig, ownGroup]);
22190
- const zonesRef = React83__default.useRef(/* @__PURE__ */ new Map());
22191
- const registerZone = React83__default.useCallback((zoneId2, meta2) => {
22392
+ const zonesRef = React84__default.useRef(/* @__PURE__ */ new Map());
22393
+ const registerZone = React84__default.useCallback((zoneId2, meta2) => {
22192
22394
  zonesRef.current.set(zoneId2, meta2);
22193
22395
  }, []);
22194
- const unregisterZone = React83__default.useCallback((zoneId2) => {
22396
+ const unregisterZone = React84__default.useCallback((zoneId2) => {
22195
22397
  zonesRef.current.delete(zoneId2);
22196
22398
  }, []);
22197
- const [activeDrag, setActiveDrag] = React83__default.useState(null);
22198
- const [overZoneGroup, setOverZoneGroup] = React83__default.useState(null);
22199
- const meta = React83__default.useMemo(
22399
+ const [activeDrag, setActiveDrag] = React84__default.useState(null);
22400
+ const [overZoneGroup, setOverZoneGroup] = React84__default.useState(null);
22401
+ const meta = React84__default.useMemo(
22200
22402
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
22201
22403
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
22202
22404
  );
22203
- React83__default.useEffect(() => {
22405
+ React84__default.useEffect(() => {
22204
22406
  const target = isRoot ? null : parentRoot;
22205
22407
  if (!target) {
22206
22408
  zonesRef.current.set(zoneId, meta);
@@ -22219,7 +22421,7 @@ function useDataDnd(args) {
22219
22421
  }, [parentRoot, isRoot, zoneId, meta]);
22220
22422
  const sensors = useAlmadarDndSensors(true);
22221
22423
  const collisionDetection = almadarDndCollisionDetection;
22222
- const findZoneByItem = React83__default.useCallback(
22424
+ const findZoneByItem = React84__default.useCallback(
22223
22425
  (id) => {
22224
22426
  for (const z of zonesRef.current.values()) {
22225
22427
  if (z.itemIds.includes(id)) return z;
@@ -22228,7 +22430,7 @@ function useDataDnd(args) {
22228
22430
  },
22229
22431
  []
22230
22432
  );
22231
- React83__default.useCallback(
22433
+ React84__default.useCallback(
22232
22434
  (group) => {
22233
22435
  for (const z of zonesRef.current.values()) {
22234
22436
  if (z.group === group) return z;
@@ -22237,7 +22439,7 @@ function useDataDnd(args) {
22237
22439
  },
22238
22440
  []
22239
22441
  );
22240
- const handleDragEnd = React83__default.useCallback(
22442
+ const handleDragEnd = React84__default.useCallback(
22241
22443
  (event) => {
22242
22444
  const { active, over } = event;
22243
22445
  const activeIdStr = String(active.id);
@@ -22328,8 +22530,8 @@ function useDataDnd(args) {
22328
22530
  },
22329
22531
  [eventBus]
22330
22532
  );
22331
- const sortableData = React83__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
22332
- const SortableItem = React83__default.useCallback(
22533
+ const sortableData = React84__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
22534
+ const SortableItem = React84__default.useCallback(
22333
22535
  ({ id, children }) => {
22334
22536
  const {
22335
22537
  attributes,
@@ -22369,7 +22571,7 @@ function useDataDnd(args) {
22369
22571
  id: droppableId,
22370
22572
  data: sortableData
22371
22573
  });
22372
- const ctx = React83__default.useContext(RootCtx);
22574
+ const ctx = React84__default.useContext(RootCtx);
22373
22575
  const activeDrag2 = ctx?.activeDrag ?? null;
22374
22576
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
22375
22577
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -22384,7 +22586,7 @@ function useDataDnd(args) {
22384
22586
  showForeignPlaceholder,
22385
22587
  ctxAvailable: ctx != null
22386
22588
  });
22387
- React83__default.useEffect(() => {
22589
+ React84__default.useEffect(() => {
22388
22590
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
22389
22591
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
22390
22592
  return /* @__PURE__ */ jsx(
@@ -22398,11 +22600,11 @@ function useDataDnd(args) {
22398
22600
  }
22399
22601
  );
22400
22602
  };
22401
- const rootContextValue = React83__default.useMemo(
22603
+ const rootContextValue = React84__default.useMemo(
22402
22604
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
22403
22605
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
22404
22606
  );
22405
- const handleDragStart = React83__default.useCallback((event) => {
22607
+ const handleDragStart = React84__default.useCallback((event) => {
22406
22608
  const sourceZone = findZoneByItem(event.active.id);
22407
22609
  const rect = event.active.rect.current.initial;
22408
22610
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -22421,7 +22623,7 @@ function useDataDnd(args) {
22421
22623
  isRoot
22422
22624
  });
22423
22625
  }, [findZoneByItem, isRoot, zoneId]);
22424
- const handleDragOver = React83__default.useCallback((event) => {
22626
+ const handleDragOver = React84__default.useCallback((event) => {
22425
22627
  const { active, over } = event;
22426
22628
  const overData = over?.data?.current;
22427
22629
  const overGroup = overData?.dndGroup ?? null;
@@ -22491,7 +22693,7 @@ function useDataDnd(args) {
22491
22693
  return next;
22492
22694
  });
22493
22695
  }, []);
22494
- const handleDragCancel = React83__default.useCallback((event) => {
22696
+ const handleDragCancel = React84__default.useCallback((event) => {
22495
22697
  setActiveDrag(null);
22496
22698
  setOverZoneGroup(null);
22497
22699
  dndLog.warn("dragCancel", {
@@ -22499,12 +22701,12 @@ function useDataDnd(args) {
22499
22701
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
22500
22702
  });
22501
22703
  }, []);
22502
- const handleDragEndWithCleanup = React83__default.useCallback((event) => {
22704
+ const handleDragEndWithCleanup = React84__default.useCallback((event) => {
22503
22705
  handleDragEnd(event);
22504
22706
  setActiveDrag(null);
22505
22707
  setOverZoneGroup(null);
22506
22708
  }, [handleDragEnd]);
22507
- const wrapContainer = React83__default.useCallback(
22709
+ const wrapContainer = React84__default.useCallback(
22508
22710
  (children) => {
22509
22711
  if (!enabled) return children;
22510
22712
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -22558,7 +22760,7 @@ var init_useDataDnd = __esm({
22558
22760
  init_useAlmadarDndCollision();
22559
22761
  init_Box();
22560
22762
  dndLog = createLogger("almadar:ui:dnd");
22561
- RootCtx = React83__default.createContext(null);
22763
+ RootCtx = React84__default.createContext(null);
22562
22764
  }
22563
22765
  });
22564
22766
  function renderIconInput(icon, props) {
@@ -22755,7 +22957,7 @@ function DataGrid({
22755
22957
  /* @__PURE__ */ jsx(
22756
22958
  Box,
22757
22959
  {
22758
- className: cn("grid", gapStyles5[gap], scrollX ? "grid-flow-col overflow-x-auto" : colsClass, lookStyles4[look], className),
22960
+ className: cn("grid", gapStyles5[gap], scrollX ? "grid-flow-col overflow-x-auto" : colsClass, lookStyles5[look], className),
22759
22961
  style: scrollX ? { gridAutoFlow: "column", gridAutoColumns: `minmax(${minCardWidth}px, 1fr)` } : gridTemplateColumns ? { gridTemplateColumns } : void 0,
22760
22962
  children: data.map((item, index) => {
22761
22963
  const itemData = item;
@@ -22950,7 +23152,7 @@ function DataGrid({
22950
23152
  ] })
22951
23153
  );
22952
23154
  }
22953
- var dataGridLog, BADGE_VARIANTS, gapStyles5, lookStyles4;
23155
+ var dataGridLog, BADGE_VARIANTS, gapStyles5, lookStyles5;
22954
23156
  var init_DataGrid = __esm({
22955
23157
  "components/core/molecules/DataGrid.tsx"() {
22956
23158
  "use client";
@@ -22985,7 +23187,7 @@ var init_DataGrid = __esm({
22985
23187
  lg: "gap-6",
22986
23188
  xl: "gap-8"
22987
23189
  };
22988
- lookStyles4 = {
23190
+ lookStyles5 = {
22989
23191
  dense: "gap-2 [&>*]:p-card-sm",
22990
23192
  spacious: "gap-8 [&>*]:p-card-lg",
22991
23193
  striped: "[&>*:nth-child(even)]:bg-muted/30",
@@ -23085,7 +23287,7 @@ function DataList({
23085
23287
  }) {
23086
23288
  const eventBus = useEventBus();
23087
23289
  const { t } = useTranslate();
23088
- const [visibleCount, setVisibleCount] = React83__default.useState(pageSize || Infinity);
23290
+ const [visibleCount, setVisibleCount] = React84__default.useState(pageSize || Infinity);
23089
23291
  const fieldDefs = fields ?? columns ?? [];
23090
23292
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
23091
23293
  const dnd = useDataDnd({
@@ -23104,7 +23306,7 @@ function DataList({
23104
23306
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
23105
23307
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
23106
23308
  const hasRenderProp = typeof children === "function";
23107
- React83__default.useEffect(() => {
23309
+ React84__default.useEffect(() => {
23108
23310
  const renderItemTypeOf = typeof schemaRenderItem;
23109
23311
  const childrenTypeOf = typeof children;
23110
23312
  if (data.length > 0 && !hasRenderProp) {
@@ -23208,7 +23410,7 @@ function DataList({
23208
23410
  const items2 = [...data];
23209
23411
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
23210
23412
  const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
23211
- return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
23413
+ return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
23212
23414
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
23213
23415
  group.items.map((itemData, index) => {
23214
23416
  const id = itemData.id || `${gi}-${index}`;
@@ -23349,7 +23551,7 @@ function DataList({
23349
23551
  className
23350
23552
  ),
23351
23553
  children: [
23352
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
23554
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
23353
23555
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
23354
23556
  group.items.map(
23355
23557
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -23434,7 +23636,7 @@ var init_FormSection = __esm({
23434
23636
  columns = 1,
23435
23637
  className
23436
23638
  }) => {
23437
- const [collapsed, setCollapsed] = React83__default.useState(defaultCollapsed);
23639
+ const [collapsed, setCollapsed] = React84__default.useState(defaultCollapsed);
23438
23640
  const { t } = useTranslate();
23439
23641
  const eventBus = useEventBus();
23440
23642
  const gridClass = {
@@ -23442,7 +23644,7 @@ var init_FormSection = __esm({
23442
23644
  2: "grid-cols-1 md:grid-cols-2",
23443
23645
  3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
23444
23646
  }[columns];
23445
- React83__default.useCallback(() => {
23647
+ React84__default.useCallback(() => {
23446
23648
  if (collapsible) {
23447
23649
  setCollapsed((prev) => !prev);
23448
23650
  eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
@@ -23700,129 +23902,6 @@ var init_FormField = __esm({
23700
23902
  FormField.displayName = "FormField";
23701
23903
  }
23702
23904
  });
23703
- function useSafeEventBus3() {
23704
- try {
23705
- return useEventBus();
23706
- } catch {
23707
- return { emit: () => {
23708
- }, on: () => () => {
23709
- }, once: () => {
23710
- } };
23711
- }
23712
- }
23713
- var log8, lookStyles5, ButtonGroup;
23714
- var init_ButtonGroup = __esm({
23715
- "components/core/molecules/ButtonGroup.tsx"() {
23716
- "use client";
23717
- init_cn();
23718
- init_atoms();
23719
- init_useEventBus();
23720
- log8 = createLogger("almadar:ui:button-group");
23721
- lookStyles5 = {
23722
- "right-aligned-buttons": "",
23723
- "floating-bar": "fixed bottom-section left-1/2 -translate-x-1/2 shadow-elevation-toast bg-card p-card-sm rounded-container",
23724
- "inline-row": "gap-2 inline-flex",
23725
- "dropdown-menu": "[&>button:not(:first-child)]:hidden",
23726
- "command-palette-trigger": "[&>button:not(:first-child)]:hidden"
23727
- };
23728
- ButtonGroup = ({
23729
- children,
23730
- primary,
23731
- secondary,
23732
- variant = "default",
23733
- orientation = "horizontal",
23734
- className,
23735
- // Filter-group pattern props (entity and filters are used for schema-driven filtering)
23736
- entity: _entity,
23737
- filters,
23738
- look = "right-aligned-buttons"
23739
- }) => {
23740
- const eventBus = useSafeEventBus3();
23741
- const variantClasses2 = {
23742
- default: "gap-0",
23743
- segmented: "gap-0 [&>button]:rounded-none [&>button:first-child]:rounded-l-lg [&>button:last-child]:rounded-r-lg [&>button:not(:first-child)]:border-l-0",
23744
- toggle: "gap-0 [&>button]:rounded-none [&>button:first-child]:rounded-l-lg [&>button:last-child]:rounded-r-lg [&>button:not(:first-child)]:border-l-0"
23745
- };
23746
- const orientationClasses = {
23747
- horizontal: "flex-row",
23748
- vertical: "flex-col [&>button:first-child]:rounded-t-lg [&>button:last-child]:rounded-b-lg [&>button:not(:first-child)]:border-t-0 [&>button:not(:first-child)]:border-l"
23749
- };
23750
- const handleActionClick = (action) => {
23751
- if (action.event) {
23752
- eventBus.emit("UI:DISPATCH", { event: action.event });
23753
- }
23754
- if (action.navigatesTo) {
23755
- eventBus.emit("UI:NAVIGATE", { url: action.navigatesTo });
23756
- }
23757
- };
23758
- const renderFormActions = () => {
23759
- const buttons = [];
23760
- if (secondary) {
23761
- secondary.forEach((action, index) => {
23762
- buttons.push(
23763
- /* @__PURE__ */ jsx(
23764
- Button,
23765
- {
23766
- type: action.actionType === "submit" ? "submit" : "button",
23767
- variant: action.variant || "ghost",
23768
- onClick: () => handleActionClick(action),
23769
- children: action.label
23770
- },
23771
- `secondary-${index}`
23772
- )
23773
- );
23774
- });
23775
- }
23776
- if (primary) {
23777
- const isSubmit = primary.actionType === "submit";
23778
- buttons.push(
23779
- /* @__PURE__ */ jsx(
23780
- Button,
23781
- {
23782
- type: isSubmit ? "submit" : "button",
23783
- variant: primary.variant || "primary",
23784
- onClick: () => handleActionClick(primary),
23785
- "data-testid": isSubmit ? "form-submit" : void 0,
23786
- children: primary.label
23787
- },
23788
- "primary"
23789
- )
23790
- );
23791
- }
23792
- return buttons;
23793
- };
23794
- const renderFilters = () => {
23795
- if (!filters || filters.length === 0) return null;
23796
- return filters.map((filter, index) => /* @__PURE__ */ jsx(
23797
- Button,
23798
- {
23799
- variant: "ghost",
23800
- onClick: () => {
23801
- log8.debug("Filter clicked", { field: filter.field });
23802
- },
23803
- children: filter.label
23804
- },
23805
- `filter-${filter.field}-${index}`
23806
- ));
23807
- };
23808
- return /* @__PURE__ */ jsx(
23809
- "div",
23810
- {
23811
- className: cn(
23812
- "inline-flex gap-2",
23813
- variantClasses2[variant],
23814
- orientationClasses[orientation],
23815
- lookStyles5[look],
23816
- className
23817
- ),
23818
- role: "group",
23819
- children: children || renderFilters() || renderFormActions()
23820
- }
23821
- );
23822
- };
23823
- ButtonGroup.displayName = "ButtonGroup";
23824
- }
23825
- });
23826
23905
  function getOrCreateStore(query) {
23827
23906
  if (!queryStores.has(query)) {
23828
23907
  queryStores.set(query, {
@@ -23999,7 +24078,7 @@ var init_FilterGroup = __esm({
23999
24078
  type: "button",
24000
24079
  onClick: () => handleFilterSelect(filter.field, null),
24001
24080
  className: cn(
24002
- "px-3 py-1.5 text-sm font-medium transition-all duration-[var(--transition-fast)]",
24081
+ "px-3 py-1.5 text-sm font-medium transition-all duration-fast",
24003
24082
  !selectedValues[filter.field] ? "bg-primary text-primary-foreground" : "bg-card text-muted-foreground hover:bg-muted"
24004
24083
  ),
24005
24084
  children: t("filterGroup.all")
@@ -24011,7 +24090,7 @@ var init_FilterGroup = __esm({
24011
24090
  type: "button",
24012
24091
  onClick: () => handleFilterSelect(filter.field, option),
24013
24092
  className: cn(
24014
- "px-3 py-1.5 text-sm font-medium transition-all duration-[var(--transition-fast)]",
24093
+ "px-3 py-1.5 text-sm font-medium transition-all duration-fast",
24015
24094
  "border-l-[length:var(--border-width)] border-border",
24016
24095
  selectedValues[filter.field] === option ? "bg-primary text-primary-foreground" : "bg-card text-muted-foreground hover:bg-muted"
24017
24096
  ),
@@ -24392,7 +24471,7 @@ var init_Flex = __esm({
24392
24471
  flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
24393
24472
  }
24394
24473
  }
24395
- return React83__default.createElement(Component, {
24474
+ return React84__default.createElement(Component, {
24396
24475
  className: cn(
24397
24476
  inline ? "inline-flex" : "flex",
24398
24477
  directionStyles[direction],
@@ -24511,7 +24590,7 @@ var init_Grid = __esm({
24511
24590
  as: Component = "div"
24512
24591
  }) => {
24513
24592
  const mergedStyle = rows ? { gridTemplateRows: `repeat(${rows}, minmax(0, 1fr))`, ...style } : style;
24514
- return React83__default.createElement(
24593
+ return React84__default.createElement(
24515
24594
  Component,
24516
24595
  {
24517
24596
  className: cn(
@@ -24622,6 +24701,7 @@ var init_Popover = __esm({
24622
24701
  "components/core/molecules/Popover.tsx"() {
24623
24702
  "use client";
24624
24703
  init_Typography();
24704
+ init_Presence();
24625
24705
  init_cn();
24626
24706
  init_useTapReveal();
24627
24707
  arrowClasses = {
@@ -24645,6 +24725,7 @@ var init_Popover = __esm({
24645
24725
  const [popoverWidth, setPopoverWidth] = useState(0);
24646
24726
  const triggerRef = useRef(null);
24647
24727
  const popoverRef = useRef(null);
24728
+ const { mounted, className: panelAnim, onAnimationEnd } = usePresence(isOpen, { animation: "popover" });
24648
24729
  const updatePosition = () => {
24649
24730
  if (triggerRef.current) {
24650
24731
  setTriggerRect(triggerRef.current.getBoundingClientRect());
@@ -24670,10 +24751,11 @@ var init_Popover = __esm({
24670
24751
  useEffect(() => {
24671
24752
  if (isOpen) {
24672
24753
  updatePosition();
24673
- } else {
24674
- setPopoverWidth(0);
24675
24754
  }
24676
24755
  }, [isOpen]);
24756
+ useEffect(() => {
24757
+ if (!mounted) setPopoverWidth(0);
24758
+ }, [mounted]);
24677
24759
  useLayoutEffect(() => {
24678
24760
  if (isOpen && popoverRef.current) {
24679
24761
  const measured = popoverRef.current.offsetWidth;
@@ -24707,9 +24789,9 @@ var init_Popover = __esm({
24707
24789
  onMouseLeave: handleClose,
24708
24790
  onPointerDown: tapTriggerProps.onPointerDown
24709
24791
  };
24710
- const childElement = React83__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
24792
+ const childElement = React84__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
24711
24793
  const childPointerDown = childElement.props.onPointerDown;
24712
- const triggerElement = React83__default.cloneElement(
24794
+ const triggerElement = React84__default.cloneElement(
24713
24795
  childElement,
24714
24796
  {
24715
24797
  ref: triggerRef,
@@ -24722,13 +24804,14 @@ var init_Popover = __esm({
24722
24804
  } : void 0
24723
24805
  }
24724
24806
  );
24725
- const panel = isOpen && triggerRect ? /* @__PURE__ */ jsxs(
24807
+ const panel = mounted && triggerRect ? /* @__PURE__ */ jsxs(
24726
24808
  "div",
24727
24809
  {
24728
24810
  ref: popoverRef,
24729
24811
  className: cn(
24730
24812
  "fixed z-50 p-4",
24731
24813
  "bg-card border-2 border-border shadow-elevation-popover",
24814
+ panelAnim,
24732
24815
  className
24733
24816
  ),
24734
24817
  style: {
@@ -24736,6 +24819,7 @@ var init_Popover = __esm({
24736
24819
  ...popoverWidth === 0 ? { visibility: "hidden" } : void 0
24737
24820
  },
24738
24821
  role: "dialog",
24822
+ onAnimationEnd,
24739
24823
  onMouseEnter: trigger === "hover" ? handleOpen : void 0,
24740
24824
  onMouseLeave: trigger === "hover" ? handleClose : void 0,
24741
24825
  children: [
@@ -25149,6 +25233,7 @@ var init_SidePanel = __esm({
25149
25233
  init_Box();
25150
25234
  init_Button();
25151
25235
  init_Typography();
25236
+ init_Presence();
25152
25237
  init_cn();
25153
25238
  init_useEventBus();
25154
25239
  SidePanel = ({
@@ -25168,15 +25253,17 @@ var init_SidePanel = __esm({
25168
25253
  if (closeEvent) eventBus.emit(`UI:${closeEvent}`, {});
25169
25254
  onClose();
25170
25255
  };
25171
- if (!isOpen) return null;
25256
+ const { mounted, className: panelAnim, onAnimationEnd } = usePresence(isOpen, { animation: "drawer" });
25257
+ const drawerSign = position === "right" ? 1 : -1;
25258
+ if (!mounted) return null;
25172
25259
  return /* @__PURE__ */ jsxs(Fragment, { children: [
25173
- showOverlay && /* @__PURE__ */ jsx(
25260
+ showOverlay && /* @__PURE__ */ jsx(Presence, { show: isOpen, animation: "overlay", children: /* @__PURE__ */ jsx(
25174
25261
  Box,
25175
25262
  {
25176
25263
  className: "fixed inset-0 bg-white/80 backdrop-blur-sm z-40 lg:hidden",
25177
25264
  onClick: handleClose
25178
25265
  }
25179
- ),
25266
+ ) }),
25180
25267
  /* @__PURE__ */ jsxs(
25181
25268
  Aside,
25182
25269
  {
@@ -25186,11 +25273,13 @@ var init_SidePanel = __esm({
25186
25273
  "border-l-2 border-border",
25187
25274
  position === "left" && "border-l-0 border-r-2",
25188
25275
  "flex flex-col",
25189
- "transition-transform duration-normal ease-standard",
25276
+ panelAnim,
25190
25277
  width,
25191
25278
  position === "right" ? "right-0" : "left-0",
25192
25279
  className
25193
25280
  ),
25281
+ style: { "--motion-drawer-sign": drawerSign },
25282
+ onAnimationEnd,
25194
25283
  children: [
25195
25284
  /* @__PURE__ */ jsxs(Box, { className: "flex items-center justify-between p-4 border-b-2 border-border sticky top-0 bg-card z-10", children: [
25196
25285
  /* @__PURE__ */ jsx(Typography, { variant: "h6", children: title }),
@@ -25311,9 +25400,9 @@ var init_Tooltip = __esm({
25311
25400
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
25312
25401
  };
25313
25402
  }, []);
25314
- const triggerElement = React83__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
25403
+ const triggerElement = React84__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
25315
25404
  const childPointerDown = triggerElement.props.onPointerDown;
25316
- const trigger = React83__default.cloneElement(triggerElement, {
25405
+ const trigger = React84__default.cloneElement(triggerElement, {
25317
25406
  ref: triggerRef,
25318
25407
  onMouseEnter: handleMouseEnter,
25319
25408
  onMouseLeave: handleMouseLeave,
@@ -25403,7 +25492,7 @@ var init_WizardProgress = __esm({
25403
25492
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
25404
25493
  const isActive = index === currentStep;
25405
25494
  const isCompleted = index < currentStep;
25406
- return /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
25495
+ return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
25407
25496
  /* @__PURE__ */ jsx(
25408
25497
  "button",
25409
25498
  {
@@ -25954,7 +26043,7 @@ var init_FormSectionHeader = __esm({
25954
26043
  name: "chevron-down",
25955
26044
  size: "sm",
25956
26045
  className: cn(
25957
- "text-muted-foreground transition-transform duration-200 shrink-0",
26046
+ "text-muted-foreground transition-transform duration-fast shrink-0",
25958
26047
  isCollapsed && "-rotate-90"
25959
26048
  )
25960
26049
  }
@@ -26964,13 +27053,13 @@ var init_MapView = __esm({
26964
27053
  shadowSize: [41, 41]
26965
27054
  });
26966
27055
  L.Marker.prototype.options.icon = defaultIcon;
26967
- const { useEffect: useEffect61, useRef: useRef58, useCallback: useCallback92, useState: useState89 } = React83__default;
27056
+ const { useEffect: useEffect62, useRef: useRef59, useCallback: useCallback93, useState: useState91 } = React84__default;
26968
27057
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
26969
27058
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
26970
27059
  function MapUpdater({ centerLat, centerLng, zoom }) {
26971
27060
  const map = useMap();
26972
- const prevRef = useRef58({ centerLat, centerLng, zoom });
26973
- useEffect61(() => {
27061
+ const prevRef = useRef59({ centerLat, centerLng, zoom });
27062
+ useEffect62(() => {
26974
27063
  const prev = prevRef.current;
26975
27064
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
26976
27065
  map.setView([centerLat, centerLng], zoom);
@@ -26981,7 +27070,7 @@ var init_MapView = __esm({
26981
27070
  }
26982
27071
  function MapClickHandler({ onMapClick }) {
26983
27072
  const map = useMap();
26984
- useEffect61(() => {
27073
+ useEffect62(() => {
26985
27074
  if (!onMapClick) return;
26986
27075
  const handler = (e) => {
26987
27076
  onMapClick(e.latlng.lat, e.latlng.lng);
@@ -27009,8 +27098,8 @@ var init_MapView = __esm({
27009
27098
  showAttribution = true
27010
27099
  }) {
27011
27100
  const eventBus = useEventBus2();
27012
- const [clickedPosition, setClickedPosition] = useState89(null);
27013
- const handleMapClick = useCallback92((lat, lng) => {
27101
+ const [clickedPosition, setClickedPosition] = useState91(null);
27102
+ const handleMapClick = useCallback93((lat, lng) => {
27014
27103
  if (showClickedPin) {
27015
27104
  setClickedPosition({ lat, lng });
27016
27105
  }
@@ -27019,7 +27108,7 @@ var init_MapView = __esm({
27019
27108
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
27020
27109
  }
27021
27110
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
27022
- const handleMarkerClick = useCallback92((marker) => {
27111
+ const handleMarkerClick = useCallback93((marker) => {
27023
27112
  onMarkerClick?.(marker);
27024
27113
  if (markerClickEvent) {
27025
27114
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -27219,7 +27308,7 @@ var init_NumberStepper = __esm({
27219
27308
  "text-foreground",
27220
27309
  "hover:bg-muted",
27221
27310
  "active:bg-muted",
27222
- "transition-colors duration-100",
27311
+ "transition-colors duration-instant",
27223
27312
  "disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent",
27224
27313
  "focus:outline-none focus:ring-[length:var(--focus-ring-width)] focus:ring-ring focus:ring-inset",
27225
27314
  styles.button
@@ -27260,7 +27349,7 @@ var init_NumberStepper = __esm({
27260
27349
  "text-foreground",
27261
27350
  "hover:bg-muted",
27262
27351
  "active:bg-muted",
27263
- "transition-colors duration-100",
27352
+ "transition-colors duration-instant",
27264
27353
  "disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent",
27265
27354
  "focus:outline-none focus:ring-[length:var(--focus-ring-width)] focus:ring-ring focus:ring-inset",
27266
27355
  styles.button
@@ -27384,7 +27473,7 @@ var init_StarRating = __esm({
27384
27473
  className: cn(
27385
27474
  styles.star,
27386
27475
  "text-foreground/30",
27387
- "transition-colors duration-100"
27476
+ "transition-colors duration-instant"
27388
27477
  ),
27389
27478
  strokeWidth: 1.5
27390
27479
  }
@@ -27397,7 +27486,7 @@ var init_StarRating = __esm({
27397
27486
  styles.star,
27398
27487
  "absolute inset-0",
27399
27488
  "text-warning fill-warning",
27400
- "transition-colors duration-100"
27489
+ "transition-colors duration-instant"
27401
27490
  ),
27402
27491
  strokeWidth: 1.5,
27403
27492
  style: isHalf ? { clipPath: "inset(0 50% 0 0)" } : void 0
@@ -27552,7 +27641,7 @@ var init_UploadDropZone = __esm({
27552
27641
  "relative flex flex-col items-center justify-center",
27553
27642
  "p-8 rounded-sm",
27554
27643
  "border-2 border-dashed",
27555
- "transition-colors duration-150",
27644
+ "transition-colors duration-fast",
27556
27645
  "cursor-pointer",
27557
27646
  isDragOver ? "border-primary bg-primary bg-opacity-5" : "border-border bg-surface",
27558
27647
  error && "border-error",
@@ -27879,8 +27968,8 @@ function TableView({
27879
27968
  }) {
27880
27969
  const eventBus = useEventBus();
27881
27970
  const { t } = useTranslate();
27882
- const [visibleCount, setVisibleCount] = React83__default.useState(pageSize > 0 ? pageSize : Infinity);
27883
- const [localSelected, setLocalSelected] = React83__default.useState(/* @__PURE__ */ new Set());
27971
+ const [visibleCount, setVisibleCount] = React84__default.useState(pageSize > 0 ? pageSize : Infinity);
27972
+ const [localSelected, setLocalSelected] = React84__default.useState(/* @__PURE__ */ new Set());
27884
27973
  const colDefs = columns ?? fields ?? [];
27885
27974
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
27886
27975
  const dnd = useDataDnd({
@@ -27960,7 +28049,7 @@ function TableView({
27960
28049
  className: cn(
27961
28050
  "grid items-center gap-3 sticky top-0 z-10",
27962
28051
  "bg-[var(--color-surface-subtle)] border-b border-[var(--color-border)]",
27963
- "text-[var(--color-text-muted)] uppercase text-xs font-semibold tracking-wide",
28052
+ "text-muted-foreground uppercase text-xs font-semibold tracking-wide",
27964
28053
  lk.headPad
27965
28054
  ),
27966
28055
  children: [
@@ -28075,12 +28164,12 @@ function TableView({
28075
28164
  ]
28076
28165
  }
28077
28166
  );
28078
- return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React83__default.Fragment, { children: rowInner }, id);
28167
+ return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React84__default.Fragment, { children: rowInner }, id);
28079
28168
  };
28080
28169
  const items = Array.from(data);
28081
28170
  const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
28082
28171
  let runningIndex = 0;
28083
- const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
28172
+ const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
28084
28173
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
28085
28174
  group.items.map((row) => renderRow(row, runningIndex++))
28086
28175
  ] }, gi)) });
@@ -28816,7 +28905,7 @@ function SortableListInner({
28816
28905
  "flex items-center justify-center",
28817
28906
  "text-muted-foreground",
28818
28907
  "hover:text-foreground",
28819
- "transition-colors duration-100",
28908
+ "transition-colors duration-instant",
28820
28909
  "px-1"
28821
28910
  ),
28822
28911
  "aria-grabbed": ariaGrabbed,
@@ -28843,7 +28932,7 @@ function SortableListInner({
28843
28932
  gap: "sm",
28844
28933
  align: "center",
28845
28934
  className: cn(
28846
- "transition-opacity duration-150",
28935
+ "transition-opacity duration-fast",
28847
28936
  isBeingDragged && "opacity-50"
28848
28937
  ),
28849
28938
  children: [
@@ -29015,7 +29104,7 @@ var init_PullToRefresh = __esm({
29015
29104
  children: /* @__PURE__ */ jsx(
29016
29105
  Box,
29017
29106
  {
29018
- className: "transition-transform duration-150",
29107
+ className: "transition-transform duration-fast",
29019
29108
  style: {
29020
29109
  transform: `scale(${isRefreshing ? 1 : pullProgress})`,
29021
29110
  opacity: isRefreshing ? 1 : pullProgress
@@ -29437,7 +29526,7 @@ var init_StepFlow = __esm({
29437
29526
  className
29438
29527
  }) => {
29439
29528
  if (orientation === "vertical") {
29440
- return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React83__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
29529
+ return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React84__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
29441
29530
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
29442
29531
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
29443
29532
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -29448,7 +29537,7 @@ var init_StepFlow = __esm({
29448
29537
  ] })
29449
29538
  ] }) }, index)) });
29450
29539
  }
29451
- 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(React83__default.Fragment, { children: [
29540
+ 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(React84__default.Fragment, { children: [
29452
29541
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
29453
29542
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
29454
29543
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -30354,7 +30443,7 @@ var init_VoteStack = __esm({
30354
30443
  isUp ? "text-primary" : "text-muted-foreground",
30355
30444
  "hover:bg-muted",
30356
30445
  "active:bg-muted",
30357
- "transition-colors duration-100",
30446
+ "transition-colors duration-instant",
30358
30447
  "disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent",
30359
30448
  "focus:outline-none focus:ring-[length:var(--focus-ring-width)] focus:ring-ring focus:ring-inset",
30360
30449
  styles.button
@@ -30391,7 +30480,7 @@ var init_VoteStack = __esm({
30391
30480
  isDown ? "text-primary" : "text-muted-foreground",
30392
30481
  "hover:bg-muted",
30393
30482
  "active:bg-muted",
30394
- "transition-colors duration-100",
30483
+ "transition-colors duration-instant",
30395
30484
  "disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent",
30396
30485
  "focus:outline-none focus:ring-[length:var(--focus-ring-width)] focus:ring-ring focus:ring-inset",
30397
30486
  styles.button
@@ -30438,7 +30527,7 @@ var init_LikertScale = __esm({
30438
30527
  md: "text-base",
30439
30528
  lg: "text-lg"
30440
30529
  };
30441
- LikertScale = React83__default.forwardRef(
30530
+ LikertScale = React84__default.forwardRef(
30442
30531
  ({
30443
30532
  question,
30444
30533
  options = DEFAULT_LIKERT_OPTIONS,
@@ -30450,7 +30539,7 @@ var init_LikertScale = __esm({
30450
30539
  variant = "radios",
30451
30540
  className
30452
30541
  }, ref) => {
30453
- const groupId = React83__default.useId();
30542
+ const groupId = React84__default.useId();
30454
30543
  const eventBus = useEventBus();
30455
30544
  const handleSelect = useCallback(
30456
30545
  (next) => {
@@ -30503,7 +30592,7 @@ var init_LikertScale = __esm({
30503
30592
  disabled,
30504
30593
  onClick: () => handleSelect(opt.value),
30505
30594
  className: cn(
30506
- "flex-1 text-center font-medium transition-colors duration-100",
30595
+ "flex-1 text-center font-medium transition-colors duration-instant",
30507
30596
  "focus:outline-none focus:ring-[length:var(--focus-ring-width)] focus:ring-ring focus:ring-inset",
30508
30597
  "disabled:cursor-not-allowed",
30509
30598
  "rounded-none gap-0 shadow-none border-none",
@@ -32732,7 +32821,7 @@ var init_DocBreadcrumb = __esm({
32732
32821
  "aria-label": t("aria.breadcrumb"),
32733
32822
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
32734
32823
  const isLast = idx === items.length - 1;
32735
- return /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
32824
+ return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
32736
32825
  idx > 0 && /* @__PURE__ */ jsx(
32737
32826
  Icon,
32738
32827
  {
@@ -33601,7 +33690,7 @@ var init_MiniStateMachine = __esm({
33601
33690
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
33602
33691
  const tc = transitionCounts[s.name] ?? 0;
33603
33692
  const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
33604
- return /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
33693
+ return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
33605
33694
  /* @__PURE__ */ jsx(
33606
33695
  AvlState,
33607
33696
  {
@@ -33805,7 +33894,7 @@ var init_PageHeader = __esm({
33805
33894
  info: "bg-info/10 text-info"
33806
33895
  };
33807
33896
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
33808
- 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(React83__default.Fragment, { children: [
33897
+ 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(React84__default.Fragment, { children: [
33809
33898
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
33810
33899
  crumb.href ? /* @__PURE__ */ jsx(
33811
33900
  "a",
@@ -34163,7 +34252,7 @@ var init_Section = __esm({
34163
34252
  as: Component = "section"
34164
34253
  }) => {
34165
34254
  const hasHeader = title || description || action;
34166
- return React83__default.createElement(
34255
+ return React84__default.createElement(
34167
34256
  Component,
34168
34257
  {
34169
34258
  className: cn(
@@ -34230,7 +34319,7 @@ var init_Sidebar = __esm({
34230
34319
  variant: "ghost",
34231
34320
  onClick: item.onClick,
34232
34321
  className: cn(
34233
- "w-full flex items-center gap-3 px-3 py-2.5 transition-all duration-[var(--transition-fast)] group relative",
34322
+ "w-full flex items-center gap-3 px-3 py-2.5 transition-all duration-fast group relative",
34234
34323
  "rounded-sm border-[length:var(--border-width-thin)] border-transparent",
34235
34324
  isActive ? [
34236
34325
  "bg-primary text-primary-foreground",
@@ -34304,7 +34393,7 @@ var init_Sidebar = __esm({
34304
34393
  className: cn(
34305
34394
  "flex flex-col h-full",
34306
34395
  "bg-card border-e border-border",
34307
- "transition-all duration-300 ease-in-out",
34396
+ "transition-all duration-normal ease-standard",
34308
34397
  collapsed ? "w-20" : "w-64",
34309
34398
  className
34310
34399
  ),
@@ -34537,7 +34626,7 @@ var init_WizardContainer = __esm({
34537
34626
  const isCompleted = index < currentStep;
34538
34627
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
34539
34628
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
34540
- return /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
34629
+ return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
34541
34630
  /* @__PURE__ */ jsx(
34542
34631
  Button,
34543
34632
  {
@@ -37140,7 +37229,7 @@ var init_DetailPanel = __esm({
37140
37229
  }
37141
37230
  });
37142
37231
  function extractTitle(children) {
37143
- if (!React83__default.isValidElement(children)) return void 0;
37232
+ if (!React84__default.isValidElement(children)) return void 0;
37144
37233
  const props = children.props;
37145
37234
  if (typeof props.title === "string") {
37146
37235
  return props.title;
@@ -37490,12 +37579,12 @@ var init_Form = __esm({
37490
37579
  const isSchemaEntity = isOrbitalEntitySchema(entity);
37491
37580
  const resolvedEntity = isSchemaEntity ? entity : void 0;
37492
37581
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
37493
- const normalizedInitialData = React83__default.useMemo(() => {
37582
+ const normalizedInitialData = React84__default.useMemo(() => {
37494
37583
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
37495
37584
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
37496
37585
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
37497
37586
  }, [entity, initialData]);
37498
- const entityDerivedFields = React83__default.useMemo(() => {
37587
+ const entityDerivedFields = React84__default.useMemo(() => {
37499
37588
  if (fields && fields.length > 0) return void 0;
37500
37589
  if (!resolvedEntity) return void 0;
37501
37590
  return resolvedEntity.fields.map(
@@ -37516,16 +37605,16 @@ var init_Form = __esm({
37516
37605
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
37517
37606
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
37518
37607
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
37519
- const [formData, setFormData] = React83__default.useState(
37608
+ const [formData, setFormData] = React84__default.useState(
37520
37609
  normalizedInitialData
37521
37610
  );
37522
- const [collapsedSections, setCollapsedSections] = React83__default.useState(
37611
+ const [collapsedSections, setCollapsedSections] = React84__default.useState(
37523
37612
  /* @__PURE__ */ new Set()
37524
37613
  );
37525
- const [submitError, setSubmitError] = React83__default.useState(null);
37526
- const formRef = React83__default.useRef(null);
37614
+ const [submitError, setSubmitError] = React84__default.useState(null);
37615
+ const formRef = React84__default.useRef(null);
37527
37616
  const formMode = props.mode;
37528
- const mountedRef = React83__default.useRef(false);
37617
+ const mountedRef = React84__default.useRef(false);
37529
37618
  if (!mountedRef.current) {
37530
37619
  mountedRef.current = true;
37531
37620
  debug("forms", "mount", {
@@ -37538,7 +37627,7 @@ var init_Form = __esm({
37538
37627
  });
37539
37628
  }
37540
37629
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
37541
- const evalContext = React83__default.useMemo(
37630
+ const evalContext = React84__default.useMemo(
37542
37631
  () => ({
37543
37632
  formValues: formData,
37544
37633
  globalVariables: externalContext?.globalVariables ?? {},
@@ -37547,7 +37636,7 @@ var init_Form = __esm({
37547
37636
  }),
37548
37637
  [formData, externalContext]
37549
37638
  );
37550
- React83__default.useEffect(() => {
37639
+ React84__default.useEffect(() => {
37551
37640
  debug("forms", "initialData-sync", {
37552
37641
  mode: formMode,
37553
37642
  normalizedInitialData,
@@ -37558,7 +37647,7 @@ var init_Form = __esm({
37558
37647
  setFormData(normalizedInitialData);
37559
37648
  }
37560
37649
  }, [normalizedInitialData]);
37561
- const processCalculations = React83__default.useCallback(
37650
+ const processCalculations = React84__default.useCallback(
37562
37651
  (changedFieldId, newFormData) => {
37563
37652
  if (!hiddenCalculations.length) return;
37564
37653
  const context = {
@@ -37583,7 +37672,7 @@ var init_Form = __esm({
37583
37672
  },
37584
37673
  [hiddenCalculations, externalContext, eventBus]
37585
37674
  );
37586
- const checkViolations = React83__default.useCallback(
37675
+ const checkViolations = React84__default.useCallback(
37587
37676
  (changedFieldId, newFormData) => {
37588
37677
  if (!violationTriggers.length) return;
37589
37678
  const context = {
@@ -37621,7 +37710,7 @@ var init_Form = __esm({
37621
37710
  processCalculations(name, newFormData);
37622
37711
  checkViolations(name, newFormData);
37623
37712
  };
37624
- const isFieldVisible = React83__default.useCallback(
37713
+ const isFieldVisible = React84__default.useCallback(
37625
37714
  (fieldName) => {
37626
37715
  const condition = conditionalFields[fieldName];
37627
37716
  if (!condition) return true;
@@ -37629,7 +37718,7 @@ var init_Form = __esm({
37629
37718
  },
37630
37719
  [conditionalFields, evalContext]
37631
37720
  );
37632
- const isSectionVisible = React83__default.useCallback(
37721
+ const isSectionVisible = React84__default.useCallback(
37633
37722
  (section) => {
37634
37723
  if (!section.condition) return true;
37635
37724
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -37705,7 +37794,7 @@ var init_Form = __esm({
37705
37794
  eventBus.emit(`UI:${onCancel}`);
37706
37795
  }
37707
37796
  };
37708
- const renderField = React83__default.useCallback(
37797
+ const renderField = React84__default.useCallback(
37709
37798
  (field) => {
37710
37799
  const fieldName = field.name || field.field;
37711
37800
  if (!fieldName) return null;
@@ -37726,7 +37815,7 @@ var init_Form = __esm({
37726
37815
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
37727
37816
  );
37728
37817
  const effectiveFields = entityDerivedFields ?? fields;
37729
- const normalizedFields = React83__default.useMemo(() => {
37818
+ const normalizedFields = React84__default.useMemo(() => {
37730
37819
  if (!effectiveFields || effectiveFields.length === 0) return [];
37731
37820
  return effectiveFields.map((field) => {
37732
37821
  if (typeof field === "string") {
@@ -37750,7 +37839,7 @@ var init_Form = __esm({
37750
37839
  return field;
37751
37840
  });
37752
37841
  }, [effectiveFields, resolvedEntity]);
37753
- const schemaFields = React83__default.useMemo(() => {
37842
+ const schemaFields = React84__default.useMemo(() => {
37754
37843
  if (normalizedFields.length === 0) return null;
37755
37844
  if (isDebugEnabled()) {
37756
37845
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -37760,7 +37849,7 @@ var init_Form = __esm({
37760
37849
  }
37761
37850
  return normalizedFields.map(renderField).filter(Boolean);
37762
37851
  }, [normalizedFields, renderField, entityName, conditionalFields]);
37763
- const sectionElements = React83__default.useMemo(() => {
37852
+ const sectionElements = React84__default.useMemo(() => {
37764
37853
  if (!sections || sections.length === 0) return null;
37765
37854
  return sections.map((section) => {
37766
37855
  if (!isSectionVisible(section)) {
@@ -38443,7 +38532,7 @@ var init_List = __esm({
38443
38532
  Box,
38444
38533
  {
38445
38534
  className: cn(
38446
- "h-full rounded-full transition-all duration-500",
38535
+ "h-full rounded-full transition-all duration-slow",
38447
38536
  clampedValue >= 100 ? "bg-success" : clampedValue >= 70 ? "bg-info" : clampedValue >= 40 ? "bg-warning" : "bg-muted-foreground"
38448
38537
  ),
38449
38538
  style: { width: `${clampedValue}%` }
@@ -38485,7 +38574,7 @@ var init_List = __esm({
38485
38574
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
38486
38575
  return [];
38487
38576
  }, [entity]);
38488
- const getItemActions = React83__default.useCallback(
38577
+ const getItemActions = React84__default.useCallback(
38489
38578
  (item) => {
38490
38579
  if (!itemActions) return [];
38491
38580
  if (typeof itemActions === "function") {
@@ -38612,7 +38701,7 @@ var init_List = __esm({
38612
38701
  {
38613
38702
  className: cn(
38614
38703
  "group flex items-center gap-5 px-6 py-5",
38615
- "transition-all duration-300 ease-out",
38704
+ "transition-all duration-normal ease-standard",
38616
38705
  hasExplicitClick && "cursor-pointer",
38617
38706
  // Hover state
38618
38707
  "hover:bg-muted/80",
@@ -38719,7 +38808,7 @@ var init_List = __esm({
38719
38808
  variant: "ghost",
38720
38809
  action: editAction.event,
38721
38810
  className: cn(
38722
- "p-2 rounded-lg transition-all duration-200",
38811
+ "p-2 rounded-lg transition-all duration-fast",
38723
38812
  "hover:bg-primary/10 hover:text-primary",
38724
38813
  "text-muted-foreground",
38725
38814
  "active:scale-95"
@@ -38735,7 +38824,7 @@ var init_List = __esm({
38735
38824
  variant: "ghost",
38736
38825
  action: viewAction.event,
38737
38826
  className: cn(
38738
- "p-2 rounded-lg transition-all duration-200",
38827
+ "p-2 rounded-lg transition-all duration-fast",
38739
38828
  "hover:bg-muted hover:text-foreground",
38740
38829
  "text-muted-foreground",
38741
38830
  "active:scale-95"
@@ -38757,7 +38846,7 @@ var init_List = __esm({
38757
38846
  {
38758
38847
  variant: "ghost",
38759
38848
  className: cn(
38760
- "p-2 rounded-lg transition-all duration-200",
38849
+ "p-2 rounded-lg transition-all duration-fast",
38761
38850
  "hover:bg-muted hover:shadow-sm",
38762
38851
  "text-muted-foreground hover:text-foreground",
38763
38852
  "active:scale-95"
@@ -38969,7 +39058,7 @@ var init_MediaGallery = __esm({
38969
39058
  [selectable, selectedItems, selectionEvent, eventBus]
38970
39059
  );
38971
39060
  const entityData = Array.isArray(entity) ? entity : [];
38972
- const items = React83__default.useMemo(() => {
39061
+ const items = React84__default.useMemo(() => {
38973
39062
  if (propItems && propItems.length > 0) return propItems;
38974
39063
  if (entityData.length === 0) return [];
38975
39064
  return entityData.map((record, idx) => {
@@ -39047,7 +39136,7 @@ var init_MediaGallery = __esm({
39047
39136
  {
39048
39137
  className: cn(
39049
39138
  "group relative overflow-hidden rounded-md cursor-pointer",
39050
- "border-2 transition-all duration-200",
39139
+ "border-2 transition-all duration-fast",
39051
39140
  isSelected ? "border-primary ring-2 ring-primary/30" : "border-transparent hover:border-border",
39052
39141
  ASPECT_CLASSES[aspectRatio]
39053
39142
  ),
@@ -39068,14 +39157,14 @@ var init_MediaGallery = __esm({
39068
39157
  {
39069
39158
  className: cn(
39070
39159
  "absolute inset-0 bg-foreground/0 group-hover:bg-foreground/20",
39071
- "transition-colors duration-200 flex items-center justify-center"
39160
+ "transition-colors duration-fast flex items-center justify-center"
39072
39161
  ),
39073
39162
  children: /* @__PURE__ */ jsx(
39074
39163
  Icon,
39075
39164
  {
39076
39165
  icon: ZoomIn,
39077
39166
  size: "md",
39078
- className: "text-white opacity-0 group-hover:opacity-100 transition-opacity duration-200"
39167
+ className: "text-white opacity-0 group-hover:opacity-100 transition-opacity duration-fast"
39079
39168
  }
39080
39169
  )
39081
39170
  }
@@ -39133,7 +39222,7 @@ var init_MediaGallery = __esm({
39133
39222
  }
39134
39223
  });
39135
39224
  function extractTitle2(children) {
39136
- if (!React83__default.isValidElement(children)) return void 0;
39225
+ if (!React84__default.isValidElement(children)) return void 0;
39137
39226
  const props = children.props;
39138
39227
  if (typeof props.title === "string") {
39139
39228
  return props.title;
@@ -39388,7 +39477,7 @@ var init_debugRegistry = __esm({
39388
39477
  }
39389
39478
  });
39390
39479
  function useDebugData() {
39391
- const [data, setData] = React83.useState(() => ({
39480
+ const [data, setData] = React84.useState(() => ({
39392
39481
  traits: [],
39393
39482
  ticks: [],
39394
39483
  guards: [],
@@ -39402,7 +39491,7 @@ function useDebugData() {
39402
39491
  },
39403
39492
  lastUpdate: Date.now()
39404
39493
  }));
39405
- React83.useEffect(() => {
39494
+ React84.useEffect(() => {
39406
39495
  const updateData = () => {
39407
39496
  setData({
39408
39497
  traits: getAllTraits(),
@@ -39511,12 +39600,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
39511
39600
  return positions;
39512
39601
  }
39513
39602
  function WalkMinimap() {
39514
- const [walkStep, setWalkStep] = React83.useState(null);
39515
- const [traits2, setTraits] = React83.useState([]);
39516
- const [coveredEdges, setCoveredEdges] = React83.useState([]);
39517
- const [completedTraits, setCompletedTraits] = React83.useState(/* @__PURE__ */ new Set());
39518
- const prevTraitRef = React83.useRef(null);
39519
- React83.useEffect(() => {
39603
+ const [walkStep, setWalkStep] = React84.useState(null);
39604
+ const [traits2, setTraits] = React84.useState([]);
39605
+ const [coveredEdges, setCoveredEdges] = React84.useState([]);
39606
+ const [completedTraits, setCompletedTraits] = React84.useState(/* @__PURE__ */ new Set());
39607
+ const prevTraitRef = React84.useRef(null);
39608
+ React84.useEffect(() => {
39520
39609
  const interval = setInterval(() => {
39521
39610
  const w = window;
39522
39611
  const step = w.__orbitalWalkStep;
@@ -39952,15 +40041,15 @@ var init_EntitiesTab = __esm({
39952
40041
  });
39953
40042
  function EventFlowTab({ events: events2 }) {
39954
40043
  const { t } = useTranslate();
39955
- const [filter, setFilter] = React83.useState("all");
39956
- const containerRef = React83.useRef(null);
39957
- const [autoScroll, setAutoScroll] = React83.useState(true);
39958
- React83.useEffect(() => {
40044
+ const [filter, setFilter] = React84.useState("all");
40045
+ const containerRef = React84.useRef(null);
40046
+ const [autoScroll, setAutoScroll] = React84.useState(true);
40047
+ React84.useEffect(() => {
39959
40048
  if (autoScroll && containerRef.current) {
39960
40049
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
39961
40050
  }
39962
40051
  }, [events2.length, autoScroll]);
39963
- const filteredEvents = React83.useMemo(() => {
40052
+ const filteredEvents = React84.useMemo(() => {
39964
40053
  if (filter === "all") return events2;
39965
40054
  return events2.filter((e) => e.type === filter);
39966
40055
  }, [events2, filter]);
@@ -40076,7 +40165,7 @@ var init_EventFlowTab = __esm({
40076
40165
  });
40077
40166
  function GuardsPanel({ guards }) {
40078
40167
  const { t } = useTranslate();
40079
- const [filter, setFilter] = React83.useState("all");
40168
+ const [filter, setFilter] = React84.useState("all");
40080
40169
  if (guards.length === 0) {
40081
40170
  return /* @__PURE__ */ jsx(
40082
40171
  EmptyState,
@@ -40089,7 +40178,7 @@ function GuardsPanel({ guards }) {
40089
40178
  }
40090
40179
  const passedCount = guards.filter((g) => g.result).length;
40091
40180
  const failedCount = guards.length - passedCount;
40092
- const filteredGuards = React83.useMemo(() => {
40181
+ const filteredGuards = React84.useMemo(() => {
40093
40182
  if (filter === "all") return guards;
40094
40183
  if (filter === "passed") return guards.filter((g) => g.result);
40095
40184
  return guards.filter((g) => !g.result);
@@ -40252,10 +40341,10 @@ function EffectBadge({ effect }) {
40252
40341
  }
40253
40342
  function TransitionTimeline({ transitions }) {
40254
40343
  const { t } = useTranslate();
40255
- const containerRef = React83.useRef(null);
40256
- const [autoScroll, setAutoScroll] = React83.useState(true);
40257
- const [expandedId, setExpandedId] = React83.useState(null);
40258
- React83.useEffect(() => {
40344
+ const containerRef = React84.useRef(null);
40345
+ const [autoScroll, setAutoScroll] = React84.useState(true);
40346
+ const [expandedId, setExpandedId] = React84.useState(null);
40347
+ React84.useEffect(() => {
40259
40348
  if (autoScroll && containerRef.current) {
40260
40349
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
40261
40350
  }
@@ -40535,9 +40624,9 @@ function getAllEvents(traits2) {
40535
40624
  function EventDispatcherTab({ traits: traits2, schema }) {
40536
40625
  const eventBus = useEventBus();
40537
40626
  const { t } = useTranslate();
40538
- const [log13, setLog] = React83.useState([]);
40539
- const prevStatesRef = React83.useRef(/* @__PURE__ */ new Map());
40540
- React83.useEffect(() => {
40627
+ const [log13, setLog] = React84.useState([]);
40628
+ const prevStatesRef = React84.useRef(/* @__PURE__ */ new Map());
40629
+ React84.useEffect(() => {
40541
40630
  for (const trait of traits2) {
40542
40631
  const prev = prevStatesRef.current.get(trait.id);
40543
40632
  if (prev && prev !== trait.currentState) {
@@ -40706,10 +40795,10 @@ function VerifyModePanel({
40706
40795
  localCount
40707
40796
  }) {
40708
40797
  const { t } = useTranslate();
40709
- const [expanded, setExpanded] = React83.useState(true);
40710
- const scrollRef = React83.useRef(null);
40711
- const prevCountRef = React83.useRef(0);
40712
- React83.useEffect(() => {
40798
+ const [expanded, setExpanded] = React84.useState(true);
40799
+ const scrollRef = React84.useRef(null);
40800
+ const prevCountRef = React84.useRef(0);
40801
+ React84.useEffect(() => {
40713
40802
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
40714
40803
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
40715
40804
  }
@@ -40766,10 +40855,10 @@ function RuntimeDebugger({
40766
40855
  schema
40767
40856
  }) {
40768
40857
  const { t } = useTranslate();
40769
- const [isCollapsed, setIsCollapsed] = React83.useState(mode === "verify" ? true : defaultCollapsed);
40770
- const [isVisible, setIsVisible] = React83.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
40858
+ const [isCollapsed, setIsCollapsed] = React84.useState(mode === "verify" ? true : defaultCollapsed);
40859
+ const [isVisible, setIsVisible] = React84.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
40771
40860
  const debugData = useDebugData();
40772
- React83.useEffect(() => {
40861
+ React84.useEffect(() => {
40773
40862
  if (mode === "inline") return;
40774
40863
  return onDebugToggle((enabled) => {
40775
40864
  setIsVisible(enabled);
@@ -40778,7 +40867,7 @@ function RuntimeDebugger({
40778
40867
  }
40779
40868
  });
40780
40869
  }, [mode]);
40781
- React83.useEffect(() => {
40870
+ React84.useEffect(() => {
40782
40871
  if (mode === "inline") return;
40783
40872
  const handleKeyDown = (e) => {
40784
40873
  if (e.key === "`" && isVisible) {
@@ -41298,7 +41387,7 @@ var init_StatCard = __esm({
41298
41387
  const labelToUse = propLabel ?? propTitle;
41299
41388
  const eventBus = useEventBus();
41300
41389
  const { t } = useTranslate();
41301
- const handleActionClick = React83__default.useCallback(() => {
41390
+ const handleActionClick = React84__default.useCallback(() => {
41302
41391
  if (action?.event) {
41303
41392
  eventBus.emit(`UI:${action.event}`, {});
41304
41393
  }
@@ -41309,7 +41398,7 @@ var init_StatCard = __esm({
41309
41398
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
41310
41399
  const isLoading = externalLoading ?? false;
41311
41400
  const error = externalError;
41312
- const computeMetricValue = React83__default.useCallback(
41401
+ const computeMetricValue = React84__default.useCallback(
41313
41402
  (metric, items) => {
41314
41403
  if (metric.value !== void 0) {
41315
41404
  return metric.value;
@@ -41348,7 +41437,7 @@ var init_StatCard = __esm({
41348
41437
  },
41349
41438
  []
41350
41439
  );
41351
- const schemaStats = React83__default.useMemo(() => {
41440
+ const schemaStats = React84__default.useMemo(() => {
41352
41441
  if (!metrics || metrics.length === 0) return null;
41353
41442
  return metrics.map((metric) => ({
41354
41443
  label: metric.label,
@@ -41356,7 +41445,7 @@ var init_StatCard = __esm({
41356
41445
  format: metric.format
41357
41446
  }));
41358
41447
  }, [metrics, data, computeMetricValue]);
41359
- const calculatedTrend = React83__default.useMemo(() => {
41448
+ const calculatedTrend = React84__default.useMemo(() => {
41360
41449
  if (manualTrend !== void 0) return manualTrend;
41361
41450
  if (previousValue === void 0 || currentValue === void 0)
41362
41451
  return void 0;
@@ -41996,8 +42085,8 @@ var init_SubagentTracePanel = __esm({
41996
42085
  ] });
41997
42086
  };
41998
42087
  InlineActivityStream = ({ activities, autoScroll = true, className }) => {
41999
- const endRef = React83__default.useRef(null);
42000
- React83__default.useEffect(() => {
42088
+ const endRef = React84__default.useRef(null);
42089
+ React84__default.useEffect(() => {
42001
42090
  if (!autoScroll) return;
42002
42091
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
42003
42092
  }, [activities.length, autoScroll]);
@@ -42091,7 +42180,7 @@ var init_SubagentTracePanel = __esm({
42091
42180
  };
42092
42181
  SubagentRichCard = ({ subagent }) => {
42093
42182
  const { t } = useTranslate();
42094
- const activities = React83__default.useMemo(
42183
+ const activities = React84__default.useMemo(
42095
42184
  () => subagentMessagesToActivities(subagent.messages),
42096
42185
  [subagent.messages]
42097
42186
  );
@@ -42168,8 +42257,8 @@ var init_SubagentTracePanel = __esm({
42168
42257
  ] });
42169
42258
  };
42170
42259
  CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
42171
- const endRef = React83__default.useRef(null);
42172
- React83__default.useEffect(() => {
42260
+ const endRef = React84__default.useRef(null);
42261
+ React84__default.useEffect(() => {
42173
42262
  if (!autoScroll) return;
42174
42263
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
42175
42264
  }, [messages.length, autoScroll]);
@@ -42604,7 +42693,7 @@ var init_Timeline = __esm({
42604
42693
  }) => {
42605
42694
  const { t } = useTranslate();
42606
42695
  const entityData = entity ?? [];
42607
- const items = React83__default.useMemo(() => {
42696
+ const items = React84__default.useMemo(() => {
42608
42697
  if (propItems) return propItems;
42609
42698
  if (entityData.length === 0) return [];
42610
42699
  return entityData.map((record, idx) => {
@@ -42706,7 +42795,7 @@ var init_Timeline = __esm({
42706
42795
  }
42707
42796
  });
42708
42797
  function extractToastProps(children) {
42709
- if (!React83__default.isValidElement(children)) {
42798
+ if (!React84__default.isValidElement(children)) {
42710
42799
  if (typeof children === "string") {
42711
42800
  return { message: children };
42712
42801
  }
@@ -42748,7 +42837,7 @@ var init_ToastSlot = __esm({
42748
42837
  eventBus.emit(`${prefix}CLOSE`);
42749
42838
  };
42750
42839
  if (!isVisible) return null;
42751
- const isCustomContent = React83__default.isValidElement(children) && !message;
42840
+ const isCustomContent = React84__default.isValidElement(children) && !message;
42752
42841
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
42753
42842
  Toast,
42754
42843
  {
@@ -42796,6 +42885,7 @@ var init_component_registry_generated = __esm({
42796
42885
  init_LayoutPatterns();
42797
42886
  init_BranchingLogicBuilder();
42798
42887
  init_Breadcrumb();
42888
+ init_ButtonGroup();
42799
42889
  init_CTABanner();
42800
42890
  init_CalendarGrid();
42801
42891
  init_Canvas();
@@ -42866,8 +42956,8 @@ var init_component_registry_generated = __esm({
42866
42956
  init_FlipContainer();
42867
42957
  init_FloatingActionButton();
42868
42958
  init_Form();
42869
- init_FormSection();
42870
42959
  init_FormField();
42960
+ init_FormSection();
42871
42961
  init_FormSectionHeader();
42872
42962
  init_GameAudioToggle();
42873
42963
  init_GameHud();
@@ -43053,6 +43143,7 @@ var init_component_registry_generated = __esm({
43053
43143
  "BranchingLogicBuilder": BranchingLogicBuilder,
43054
43144
  "Breadcrumb": Breadcrumb,
43055
43145
  "Button": ButtonPattern,
43146
+ "ButtonGroup": ButtonGroup,
43056
43147
  "ButtonPattern": ButtonPattern,
43057
43148
  "CTABanner": CTABanner,
43058
43149
  "CalendarGrid": CalendarGrid,
@@ -43126,7 +43217,6 @@ var init_component_registry_generated = __esm({
43126
43217
  "FlipContainer": FlipContainer,
43127
43218
  "FloatingActionButton": FloatingActionButton,
43128
43219
  "Form": Form,
43129
- "FormActions": FormActions,
43130
43220
  "FormField": FormField,
43131
43221
  "FormLayout": FormLayout,
43132
43222
  "FormSectionHeader": FormSectionHeader,
@@ -43306,7 +43396,7 @@ function SuspenseConfigProvider({
43306
43396
  config,
43307
43397
  children
43308
43398
  }) {
43309
- return React83__default.createElement(
43399
+ return React84__default.createElement(
43310
43400
  SuspenseConfigContext.Provider,
43311
43401
  { value: config },
43312
43402
  children
@@ -43348,7 +43438,7 @@ function enrichFormFields(fields, entityDef) {
43348
43438
  }
43349
43439
  return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
43350
43440
  }
43351
- if (field && typeof field === "object" && !Array.isArray(field) && !React83__default.isValidElement(field) && !(field instanceof Date)) {
43441
+ if (field && typeof field === "object" && !Array.isArray(field) && !React84__default.isValidElement(field) && !(field instanceof Date)) {
43352
43442
  const obj = field;
43353
43443
  const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
43354
43444
  if (!fieldName) return field;
@@ -43801,7 +43891,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
43801
43891
  const key = `${parentId}-${index}-trait:${traitName}`;
43802
43892
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
43803
43893
  }
43804
- return /* @__PURE__ */ jsx(React83__default.Fragment, { children: child }, `${parentId}-${index}`);
43894
+ return /* @__PURE__ */ jsx(React84__default.Fragment, { children: child }, `${parentId}-${index}`);
43805
43895
  }
43806
43896
  if (!child || typeof child !== "object") return null;
43807
43897
  const childId = `${parentId}-${index}`;
@@ -43854,14 +43944,14 @@ function isPatternConfig(value) {
43854
43944
  if (value === null || value === void 0) return false;
43855
43945
  if (typeof value !== "object") return false;
43856
43946
  if (Array.isArray(value)) return false;
43857
- if (React83__default.isValidElement(value)) return false;
43947
+ if (React84__default.isValidElement(value)) return false;
43858
43948
  if (value instanceof Date) return false;
43859
43949
  if (typeof value === "function") return false;
43860
43950
  const record = value;
43861
43951
  return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
43862
43952
  }
43863
43953
  function isPlainConfigObject(value) {
43864
- if (React83__default.isValidElement(value)) return false;
43954
+ if (React84__default.isValidElement(value)) return false;
43865
43955
  if (value instanceof Date) return false;
43866
43956
  const proto = Object.getPrototypeOf(value);
43867
43957
  return proto === Object.prototype || proto === null;
@@ -43989,7 +44079,7 @@ function SlotContentRenderer({
43989
44079
  for (const slotKey of CONTENT_NODE_SLOTS) {
43990
44080
  const slotVal = restProps[slotKey];
43991
44081
  if (slotVal === void 0 || slotVal === null) continue;
43992
- if (React83__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
44082
+ if (React84__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
43993
44083
  if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
43994
44084
  nodeSlotOverrides[slotKey] = renderPatternChildren(
43995
44085
  slotVal,
@@ -44042,7 +44132,7 @@ function SlotContentRenderer({
44042
44132
  const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
44043
44133
  if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
44044
44134
  const sample = resolvedItems[0];
44045
- if (sample && typeof sample === "object" && !Array.isArray(sample) && !React83__default.isValidElement(sample) && !(sample instanceof Date)) {
44135
+ if (sample && typeof sample === "object" && !Array.isArray(sample) && !React84__default.isValidElement(sample) && !(sample instanceof Date)) {
44046
44136
  const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
44047
44137
  finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
44048
44138
  }