@almadar/ui 2.26.0 → 2.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var React110 = require('react');
3
+ var React112 = require('react');
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
  var providers = require('@almadar/ui/providers');
6
6
  require('react-dom');
@@ -41,7 +41,7 @@ function _interopNamespace(e) {
41
41
  return Object.freeze(n);
42
42
  }
43
43
 
44
- var React110__namespace = /*#__PURE__*/_interopNamespace(React110);
44
+ var React112__namespace = /*#__PURE__*/_interopNamespace(React112);
45
45
  var LucideIcons__namespace = /*#__PURE__*/_interopNamespace(LucideIcons);
46
46
  var L__default = /*#__PURE__*/_interopDefault(L);
47
47
  var ReactMarkdown__default = /*#__PURE__*/_interopDefault(ReactMarkdown);
@@ -153,7 +153,7 @@ var BUILT_IN_THEMES = [
153
153
  hasDarkMode: true
154
154
  }
155
155
  ];
156
- var ThemeContext = React110.createContext(void 0);
156
+ var ThemeContext = React112.createContext(void 0);
157
157
  var THEME_STORAGE_KEY = "theme";
158
158
  var MODE_STORAGE_KEY = "theme-mode";
159
159
  function getSystemMode() {
@@ -173,14 +173,14 @@ var ThemeProvider = ({
173
173
  defaultMode = "system",
174
174
  targetRef
175
175
  }) => {
176
- const availableThemes = React110.useMemo(() => {
176
+ const availableThemes = React112.useMemo(() => {
177
177
  const themeMap = /* @__PURE__ */ new Map();
178
178
  BUILT_IN_THEMES.forEach((t) => themeMap.set(t.name, t));
179
179
  themes.forEach((t) => themeMap.set(t.name, t));
180
180
  return Array.from(themeMap.values());
181
181
  }, [themes]);
182
182
  const isScoped = !!targetRef;
183
- const [theme, setThemeState] = React110.useState(() => {
183
+ const [theme, setThemeState] = React112.useState(() => {
184
184
  if (isScoped || typeof window === "undefined") return defaultTheme;
185
185
  const stored = localStorage.getItem(THEME_STORAGE_KEY);
186
186
  const validThemes = [
@@ -192,7 +192,7 @@ var ThemeProvider = ({
192
192
  }
193
193
  return defaultTheme;
194
194
  });
195
- const [mode, setModeState] = React110.useState(() => {
195
+ const [mode, setModeState] = React112.useState(() => {
196
196
  if (isScoped || typeof window === "undefined") return defaultMode;
197
197
  const stored = localStorage.getItem(MODE_STORAGE_KEY);
198
198
  if (stored === "light" || stored === "dark" || stored === "system") {
@@ -200,14 +200,14 @@ var ThemeProvider = ({
200
200
  }
201
201
  return defaultMode;
202
202
  });
203
- const [resolvedMode, setResolvedMode] = React110.useState(
203
+ const [resolvedMode, setResolvedMode] = React112.useState(
204
204
  () => resolveMode(mode)
205
205
  );
206
- const appliedTheme = React110.useMemo(
206
+ const appliedTheme = React112.useMemo(
207
207
  () => `${theme}-${resolvedMode}`,
208
208
  [theme, resolvedMode]
209
209
  );
210
- React110.useEffect(() => {
210
+ React112.useEffect(() => {
211
211
  const updateResolved = () => {
212
212
  setResolvedMode(resolveMode(mode));
213
213
  };
@@ -220,7 +220,7 @@ var ThemeProvider = ({
220
220
  }
221
221
  return void 0;
222
222
  }, [mode]);
223
- React110.useEffect(() => {
223
+ React112.useEffect(() => {
224
224
  if (isScoped) {
225
225
  if (targetRef?.current) {
226
226
  targetRef.current.setAttribute("data-theme", appliedTheme);
@@ -234,7 +234,7 @@ var ThemeProvider = ({
234
234
  root.classList.remove("light", "dark");
235
235
  root.classList.add(resolvedMode);
236
236
  }, [appliedTheme, resolvedMode, targetRef, isScoped]);
237
- const setTheme = React110.useCallback(
237
+ const setTheme = React112.useCallback(
238
238
  (newTheme) => {
239
239
  const validTheme = availableThemes.find((t) => t.name === newTheme);
240
240
  if (validTheme) {
@@ -250,17 +250,17 @@ var ThemeProvider = ({
250
250
  },
251
251
  [availableThemes]
252
252
  );
253
- const setMode = React110.useCallback((newMode) => {
253
+ const setMode = React112.useCallback((newMode) => {
254
254
  setModeState(newMode);
255
255
  if (!isScoped && typeof window !== "undefined") {
256
256
  localStorage.setItem(MODE_STORAGE_KEY, newMode);
257
257
  }
258
258
  }, []);
259
- const toggleMode = React110.useCallback(() => {
259
+ const toggleMode = React112.useCallback(() => {
260
260
  const newMode = resolvedMode === "dark" ? "light" : "dark";
261
261
  setMode(newMode);
262
262
  }, [resolvedMode, setMode]);
263
- const contextValue = React110.useMemo(
263
+ const contextValue = React112.useMemo(
264
264
  () => ({
265
265
  theme,
266
266
  mode,
@@ -356,15 +356,15 @@ var fallbackEventBus = {
356
356
  }
357
357
  };
358
358
  function useEventBus() {
359
- const context = React110.useContext(providers.EventBusContext);
359
+ const context = React112.useContext(providers.EventBusContext);
360
360
  return context ?? getGlobalEventBus() ?? fallbackEventBus;
361
361
  }
362
- var EventBusContext2 = React110.createContext(null);
362
+ var EventBusContext2 = React112.createContext(null);
363
363
  function EventBusProvider({ children, debug: debug2 = false }) {
364
- const listenersRef = React110.useRef(/* @__PURE__ */ new Map());
365
- const anyListenersRef = React110.useRef(/* @__PURE__ */ new Set());
366
- const deprecationWarningShown = React110.useRef(false);
367
- const getSelectedEntity = React110.useCallback(() => {
364
+ const listenersRef = React112.useRef(/* @__PURE__ */ new Map());
365
+ const anyListenersRef = React112.useRef(/* @__PURE__ */ new Set());
366
+ const deprecationWarningShown = React112.useRef(false);
367
+ const getSelectedEntity = React112.useCallback(() => {
368
368
  if (!deprecationWarningShown.current) {
369
369
  console.warn(
370
370
  "[EventBus] getSelectedEntity is deprecated. Use SelectionProvider and useSelection hook instead. See SelectionProvider.tsx for migration guide."
@@ -373,7 +373,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
373
373
  }
374
374
  return null;
375
375
  }, []);
376
- const clearSelectedEntity = React110.useCallback(() => {
376
+ const clearSelectedEntity = React112.useCallback(() => {
377
377
  if (!deprecationWarningShown.current) {
378
378
  console.warn(
379
379
  "[EventBus] clearSelectedEntity is deprecated. Use SelectionProvider and useSelection hook instead. See SelectionProvider.tsx for migration guide."
@@ -381,14 +381,14 @@ function EventBusProvider({ children, debug: debug2 = false }) {
381
381
  deprecationWarningShown.current = true;
382
382
  }
383
383
  }, []);
384
- const emit = React110.useCallback((type, payload) => {
384
+ const emit = React112.useCallback((type, payload) => {
385
385
  const event = {
386
386
  type,
387
387
  payload,
388
388
  timestamp: Date.now()
389
389
  };
390
- const listeners7 = listenersRef.current.get(type);
391
- const listenerCount = listeners7?.size ?? 0;
390
+ const listeners6 = listenersRef.current.get(type);
391
+ const listenerCount = listeners6?.size ?? 0;
392
392
  if (debug2) {
393
393
  if (listenerCount > 0) {
394
394
  console.log(`[EventBus] Emit: ${type} \u2192 ${listenerCount} listener(s)`, payload);
@@ -396,8 +396,8 @@ function EventBusProvider({ children, debug: debug2 = false }) {
396
396
  console.warn(`[EventBus] Emit: ${type} (NO LISTENERS - event may be lost!)`, payload);
397
397
  }
398
398
  }
399
- if (listeners7) {
400
- const listenersCopy = Array.from(listeners7);
399
+ if (listeners6) {
400
+ const listenersCopy = Array.from(listeners6);
401
401
  for (const listener of listenersCopy) {
402
402
  try {
403
403
  listener(event);
@@ -415,37 +415,37 @@ function EventBusProvider({ children, debug: debug2 = false }) {
415
415
  }
416
416
  }
417
417
  }, [debug2]);
418
- const on = React110.useCallback((type, listener) => {
418
+ const on = React112.useCallback((type, listener) => {
419
419
  if (!listenersRef.current.has(type)) {
420
420
  listenersRef.current.set(type, /* @__PURE__ */ new Set());
421
421
  }
422
- const listeners7 = listenersRef.current.get(type);
423
- listeners7.add(listener);
422
+ const listeners6 = listenersRef.current.get(type);
423
+ listeners6.add(listener);
424
424
  if (debug2) {
425
- console.log(`[EventBus] Subscribed to '${type}', total: ${listeners7.size}`);
425
+ console.log(`[EventBus] Subscribed to '${type}', total: ${listeners6.size}`);
426
426
  }
427
427
  return () => {
428
- listeners7.delete(listener);
428
+ listeners6.delete(listener);
429
429
  if (debug2) {
430
- console.log(`[EventBus] Unsubscribed from '${type}', remaining: ${listeners7.size}`);
430
+ console.log(`[EventBus] Unsubscribed from '${type}', remaining: ${listeners6.size}`);
431
431
  }
432
- if (listeners7.size === 0) {
432
+ if (listeners6.size === 0) {
433
433
  listenersRef.current.delete(type);
434
434
  }
435
435
  };
436
436
  }, [debug2]);
437
- const once = React110.useCallback((type, listener) => {
437
+ const once = React112.useCallback((type, listener) => {
438
438
  const wrappedListener = (event) => {
439
439
  listenersRef.current.get(type)?.delete(wrappedListener);
440
440
  listener(event);
441
441
  };
442
442
  return on(type, wrappedListener);
443
443
  }, [on]);
444
- const hasListeners = React110.useCallback((type) => {
445
- const listeners7 = listenersRef.current.get(type);
446
- return listeners7 !== void 0 && listeners7.size > 0;
444
+ const hasListeners = React112.useCallback((type) => {
445
+ const listeners6 = listenersRef.current.get(type);
446
+ return listeners6 !== void 0 && listeners6.size > 0;
447
447
  }, []);
448
- const onAny = React110.useCallback((listener) => {
448
+ const onAny = React112.useCallback((listener) => {
449
449
  anyListenersRef.current.add(listener);
450
450
  if (debug2) {
451
451
  console.log(`[EventBus] onAny subscribed, total: ${anyListenersRef.current.size}`);
@@ -457,7 +457,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
457
457
  }
458
458
  };
459
459
  }, [debug2]);
460
- const contextValue = React110.useMemo(
460
+ const contextValue = React112.useMemo(
461
461
  () => ({
462
462
  emit,
463
463
  on,
@@ -469,7 +469,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
469
469
  }),
470
470
  [emit, on, once, hasListeners, onAny, getSelectedEntity, clearSelectedEntity]
471
471
  );
472
- React110.useEffect(() => {
472
+ React112.useEffect(() => {
473
473
  setGlobalEventBus(contextValue);
474
474
  return () => {
475
475
  setGlobalEventBus(null);
@@ -477,7 +477,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
477
477
  }, [contextValue]);
478
478
  return /* @__PURE__ */ jsxRuntime.jsx(EventBusContext2.Provider, { value: contextValue, children });
479
479
  }
480
- var SelectionContext = React110.createContext(null);
480
+ var SelectionContext = React112.createContext(null);
481
481
  var defaultCompareEntities = (a, b) => {
482
482
  if (a === b) return true;
483
483
  if (!a || !b) return false;
@@ -494,8 +494,8 @@ function SelectionProvider({
494
494
  compareEntities = defaultCompareEntities
495
495
  }) {
496
496
  const eventBus = useEventBus();
497
- const [selected, setSelectedState] = React110.useState(null);
498
- const setSelected = React110.useCallback(
497
+ const [selected, setSelectedState] = React112.useState(null);
498
+ const setSelected = React112.useCallback(
499
499
  (entity) => {
500
500
  setSelectedState(entity);
501
501
  if (debug2) {
@@ -504,19 +504,19 @@ function SelectionProvider({
504
504
  },
505
505
  [debug2]
506
506
  );
507
- const clearSelection = React110.useCallback(() => {
507
+ const clearSelection = React112.useCallback(() => {
508
508
  setSelectedState(null);
509
509
  if (debug2) {
510
510
  console.log("[SelectionProvider] Selection cleared");
511
511
  }
512
512
  }, [debug2]);
513
- const isSelected = React110.useCallback(
513
+ const isSelected = React112.useCallback(
514
514
  (entity) => {
515
515
  return compareEntities(selected, entity);
516
516
  },
517
517
  [selected, compareEntities]
518
518
  );
519
- React110.useEffect(() => {
519
+ React112.useEffect(() => {
520
520
  const handleSelect = (event) => {
521
521
  const row = event.payload?.row;
522
522
  if (row) {
@@ -554,14 +554,14 @@ function SelectionProvider({
554
554
  return /* @__PURE__ */ jsxRuntime.jsx(SelectionContext.Provider, { value: contextValue, children });
555
555
  }
556
556
  function useSelection() {
557
- const context = React110.useContext(SelectionContext);
557
+ const context = React112.useContext(SelectionContext);
558
558
  if (!context) {
559
559
  throw new Error("useSelection must be used within a SelectionProvider");
560
560
  }
561
561
  return context;
562
562
  }
563
563
  function useSelectionOptional() {
564
- const context = React110.useContext(SelectionContext);
564
+ const context = React112.useContext(SelectionContext);
565
565
  return context;
566
566
  }
567
567
  function cn(...inputs) {
@@ -704,7 +704,7 @@ var positionStyles = {
704
704
  fixed: "fixed",
705
705
  sticky: "sticky"
706
706
  };
707
- var Box = React110__namespace.default.forwardRef(
707
+ var Box = React112__namespace.default.forwardRef(
708
708
  ({
709
709
  padding,
710
710
  paddingX,
@@ -733,20 +733,20 @@ var Box = React110__namespace.default.forwardRef(
733
733
  ...rest
734
734
  }, ref) => {
735
735
  const eventBus = useEventBus();
736
- const handleClick = React110.useCallback((e) => {
736
+ const handleClick = React112.useCallback((e) => {
737
737
  if (action) {
738
738
  e.stopPropagation();
739
739
  eventBus.emit(`UI:${action}`, actionPayload ?? {});
740
740
  }
741
741
  onClick?.(e);
742
742
  }, [action, actionPayload, eventBus, onClick]);
743
- const handleMouseEnter = React110.useCallback((e) => {
743
+ const handleMouseEnter = React112.useCallback((e) => {
744
744
  if (hoverEvent) {
745
745
  eventBus.emit(`UI:${hoverEvent}`, { hovered: true });
746
746
  }
747
747
  onMouseEnter?.(e);
748
748
  }, [hoverEvent, eventBus, onMouseEnter]);
749
- const handleMouseLeave = React110.useCallback((e) => {
749
+ const handleMouseLeave = React112.useCallback((e) => {
750
750
  if (hoverEvent) {
751
751
  eventBus.emit(`UI:${hoverEvent}`, { hovered: false });
752
752
  }
@@ -974,7 +974,7 @@ function resolveIconProp(value, sizeClass) {
974
974
  const IconComp = value;
975
975
  return /* @__PURE__ */ jsxRuntime.jsx(IconComp, { className: sizeClass });
976
976
  }
977
- if (React110__namespace.default.isValidElement(value)) {
977
+ if (React112__namespace.default.isValidElement(value)) {
978
978
  return value;
979
979
  }
980
980
  if (typeof value === "object" && value !== null && "render" in value) {
@@ -983,7 +983,7 @@ function resolveIconProp(value, sizeClass) {
983
983
  }
984
984
  return value;
985
985
  }
986
- var Button = React110__namespace.default.forwardRef(
986
+ var Button = React112__namespace.default.forwardRef(
987
987
  ({
988
988
  className,
989
989
  variant = "primary",
@@ -1079,7 +1079,7 @@ var sizeStyles3 = {
1079
1079
  md: "px-2.5 py-1 text-sm",
1080
1080
  lg: "px-3 py-1.5 text-base"
1081
1081
  };
1082
- var Badge = React110__namespace.default.forwardRef(
1082
+ var Badge = React112__namespace.default.forwardRef(
1083
1083
  ({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
1084
1084
  const iconSizes2 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
1085
1085
  const resolvedIcon = typeof icon === "string" ? (() => {
@@ -1106,7 +1106,7 @@ var Badge = React110__namespace.default.forwardRef(
1106
1106
  }
1107
1107
  );
1108
1108
  Badge.displayName = "Badge";
1109
- var Input = React110__namespace.default.forwardRef(
1109
+ var Input = React112__namespace.default.forwardRef(
1110
1110
  ({
1111
1111
  className,
1112
1112
  inputType,
@@ -1218,7 +1218,7 @@ var Input = React110__namespace.default.forwardRef(
1218
1218
  }
1219
1219
  );
1220
1220
  Input.displayName = "Input";
1221
- var Label = React110__namespace.default.forwardRef(
1221
+ var Label = React112__namespace.default.forwardRef(
1222
1222
  ({ className, required, children, ...props }, ref) => {
1223
1223
  return /* @__PURE__ */ jsxRuntime.jsxs(
1224
1224
  "label",
@@ -1238,7 +1238,7 @@ var Label = React110__namespace.default.forwardRef(
1238
1238
  }
1239
1239
  );
1240
1240
  Label.displayName = "Label";
1241
- var Textarea = React110__namespace.default.forwardRef(
1241
+ var Textarea = React112__namespace.default.forwardRef(
1242
1242
  ({ className, error, ...props }, ref) => {
1243
1243
  return /* @__PURE__ */ jsxRuntime.jsx(
1244
1244
  "textarea",
@@ -1261,7 +1261,7 @@ var Textarea = React110__namespace.default.forwardRef(
1261
1261
  }
1262
1262
  );
1263
1263
  Textarea.displayName = "Textarea";
1264
- var Select = React110__namespace.default.forwardRef(
1264
+ var Select = React112__namespace.default.forwardRef(
1265
1265
  ({ className, options, placeholder, error, ...props }, ref) => {
1266
1266
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
1267
1267
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -1297,7 +1297,7 @@ var Select = React110__namespace.default.forwardRef(
1297
1297
  }
1298
1298
  );
1299
1299
  Select.displayName = "Select";
1300
- var Checkbox = React110__namespace.default.forwardRef(
1300
+ var Checkbox = React112__namespace.default.forwardRef(
1301
1301
  ({ className, label, id, ...props }, ref) => {
1302
1302
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
1303
1303
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center", children: [
@@ -1373,7 +1373,7 @@ var shadowStyles2 = {
1373
1373
  md: "shadow",
1374
1374
  lg: "shadow-lg"
1375
1375
  };
1376
- var Card = React110__namespace.default.forwardRef(
1376
+ var Card = React112__namespace.default.forwardRef(
1377
1377
  ({
1378
1378
  className,
1379
1379
  variant = "bordered",
@@ -1409,9 +1409,9 @@ var Card = React110__namespace.default.forwardRef(
1409
1409
  }
1410
1410
  );
1411
1411
  Card.displayName = "Card";
1412
- var CardHeader = React110__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("mb-4", className), ...props }));
1412
+ var CardHeader = React112__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("mb-4", className), ...props }));
1413
1413
  CardHeader.displayName = "CardHeader";
1414
- var CardTitle = React110__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1414
+ var CardTitle = React112__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1415
1415
  "h3",
1416
1416
  {
1417
1417
  ref,
@@ -1424,11 +1424,11 @@ var CardTitle = React110__namespace.default.forwardRef(({ className, ...props },
1424
1424
  }
1425
1425
  ));
1426
1426
  CardTitle.displayName = "CardTitle";
1427
- var CardContent = React110__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("", className), ...props }));
1427
+ var CardContent = React112__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("", className), ...props }));
1428
1428
  CardContent.displayName = "CardContent";
1429
1429
  var CardBody = CardContent;
1430
1430
  CardBody.displayName = "CardBody";
1431
- var CardFooter = React110__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1431
+ var CardFooter = React112__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1432
1432
  "div",
1433
1433
  {
1434
1434
  ref,
@@ -1443,7 +1443,7 @@ var sizeStyles4 = {
1443
1443
  md: "h-6 w-6",
1444
1444
  lg: "h-8 w-8"
1445
1445
  };
1446
- var Spinner = React110__namespace.default.forwardRef(
1446
+ var Spinner = React112__namespace.default.forwardRef(
1447
1447
  ({ className, size = "md", ...props }, ref) => {
1448
1448
  return /* @__PURE__ */ jsxRuntime.jsx(
1449
1449
  "div",
@@ -1457,7 +1457,7 @@ var Spinner = React110__namespace.default.forwardRef(
1457
1457
  }
1458
1458
  );
1459
1459
  Spinner.displayName = "Spinner";
1460
- var Radio = React110__namespace.default.forwardRef(
1460
+ var Radio = React112__namespace.default.forwardRef(
1461
1461
  ({
1462
1462
  label,
1463
1463
  helperText,
@@ -1561,7 +1561,7 @@ var Radio = React110__namespace.default.forwardRef(
1561
1561
  }
1562
1562
  );
1563
1563
  Radio.displayName = "Radio";
1564
- var Switch = React110__namespace.forwardRef(
1564
+ var Switch = React112__namespace.forwardRef(
1565
1565
  ({
1566
1566
  checked,
1567
1567
  defaultChecked = false,
@@ -1572,10 +1572,10 @@ var Switch = React110__namespace.forwardRef(
1572
1572
  name,
1573
1573
  className
1574
1574
  }, ref) => {
1575
- const [isChecked, setIsChecked] = React110__namespace.useState(
1575
+ const [isChecked, setIsChecked] = React112__namespace.useState(
1576
1576
  checked !== void 0 ? checked : defaultChecked
1577
1577
  );
1578
- React110__namespace.useEffect(() => {
1578
+ React112__namespace.useEffect(() => {
1579
1579
  if (checked !== void 0) {
1580
1580
  setIsChecked(checked);
1581
1581
  }
@@ -1733,7 +1733,7 @@ var sizeStyles5 = {
1733
1733
  md: "w-2.5 h-2.5",
1734
1734
  lg: "w-3 h-3"
1735
1735
  };
1736
- var StatusDot = React110__namespace.default.forwardRef(
1736
+ var StatusDot = React112__namespace.default.forwardRef(
1737
1737
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
1738
1738
  return /* @__PURE__ */ jsxRuntime.jsx(
1739
1739
  "span",
@@ -1780,7 +1780,7 @@ var iconMap2 = {
1780
1780
  down: LucideIcons.TrendingDown,
1781
1781
  flat: LucideIcons.ArrowRight
1782
1782
  };
1783
- var TrendIndicator = React110__namespace.default.forwardRef(
1783
+ var TrendIndicator = React112__namespace.default.forwardRef(
1784
1784
  ({
1785
1785
  className,
1786
1786
  value,
@@ -1839,7 +1839,7 @@ var thumbSizes = {
1839
1839
  md: "w-4 h-4",
1840
1840
  lg: "w-5 h-5"
1841
1841
  };
1842
- var RangeSlider = React110__namespace.default.forwardRef(
1842
+ var RangeSlider = React112__namespace.default.forwardRef(
1843
1843
  ({
1844
1844
  className,
1845
1845
  min = 0,
@@ -1857,14 +1857,14 @@ var RangeSlider = React110__namespace.default.forwardRef(
1857
1857
  formatValue: formatValue5,
1858
1858
  ...props
1859
1859
  }, ref) => {
1860
- const [isDragging, setIsDragging] = React110.useState(false);
1861
- const [showTip, setShowTip] = React110.useState(false);
1862
- const inputRef = React110.useRef(null);
1860
+ const [isDragging, setIsDragging] = React112.useState(false);
1861
+ const [showTip, setShowTip] = React112.useState(false);
1862
+ const inputRef = React112.useRef(null);
1863
1863
  const eventBus = useSafeEventBus();
1864
1864
  const percentage = max !== min ? (value - min) / (max - min) * 100 : 0;
1865
1865
  const bufferedPercentage = buffered !== void 0 ? Math.min(buffered, 100) : void 0;
1866
1866
  const displayValue = formatValue5 ? formatValue5(value) : String(value);
1867
- const handleChange = React110.useCallback(
1867
+ const handleChange = React112.useCallback(
1868
1868
  (e) => {
1869
1869
  const newValue = Number(e.target.value);
1870
1870
  onChange?.(newValue);
@@ -2042,7 +2042,7 @@ var paddingClasses = {
2042
2042
  md: "py-16",
2043
2043
  lg: "py-24"
2044
2044
  };
2045
- var ContentSection = React110__namespace.default.forwardRef(
2045
+ var ContentSection = React112__namespace.default.forwardRef(
2046
2046
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
2047
2047
  return /* @__PURE__ */ jsxRuntime.jsx(
2048
2048
  Box,
@@ -2061,6 +2061,289 @@ var ContentSection = React110__namespace.default.forwardRef(
2061
2061
  }
2062
2062
  );
2063
2063
  ContentSection.displayName = "ContentSection";
2064
+ var initialStyles = {
2065
+ "fade-up": { opacity: 0, transform: "translateY(24px)" },
2066
+ "fade-down": { opacity: 0, transform: "translateY(-24px)" },
2067
+ "fade-in": { opacity: 0 },
2068
+ "fade-left": { opacity: 0, transform: "translateX(24px)" },
2069
+ "fade-right": { opacity: 0, transform: "translateX(-24px)" },
2070
+ "scale": { opacity: 0, transform: "scale(0.92)" },
2071
+ "scale-up": { opacity: 0, transform: "scale(0.92) translateY(16px)" },
2072
+ "none": {}
2073
+ };
2074
+ var animatedStyles = {
2075
+ "fade-up": { opacity: 1, transform: "translateY(0)" },
2076
+ "fade-down": { opacity: 1, transform: "translateY(0)" },
2077
+ "fade-in": { opacity: 1 },
2078
+ "fade-left": { opacity: 1, transform: "translateX(0)" },
2079
+ "fade-right": { opacity: 1, transform: "translateX(0)" },
2080
+ "scale": { opacity: 1, transform: "scale(1)" },
2081
+ "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
2082
+ "none": {}
2083
+ };
2084
+ var AnimatedReveal = React112__namespace.default.forwardRef(
2085
+ ({
2086
+ trigger = "scroll",
2087
+ animation = "fade-up",
2088
+ duration = 600,
2089
+ delay = 0,
2090
+ threshold = 0.15,
2091
+ once = true,
2092
+ animate: manualAnimate,
2093
+ easing = "cubic-bezier(0.16, 1, 0.3, 1)",
2094
+ children,
2095
+ className,
2096
+ style,
2097
+ ...props
2098
+ }, forwardedRef) => {
2099
+ const [isAnimated, setIsAnimated] = React112.useState(false);
2100
+ const internalRef = React112.useRef(null);
2101
+ const hasAnimated = React112.useRef(false);
2102
+ const setRef = React112.useCallback(
2103
+ (node) => {
2104
+ internalRef.current = node;
2105
+ if (typeof forwardedRef === "function") forwardedRef(node);
2106
+ else if (forwardedRef) forwardedRef.current = node;
2107
+ },
2108
+ [forwardedRef]
2109
+ );
2110
+ React112.useEffect(() => {
2111
+ if (trigger !== "scroll") return;
2112
+ const el = internalRef.current;
2113
+ if (!el) return;
2114
+ const observer = new IntersectionObserver(
2115
+ ([entry]) => {
2116
+ if (entry.isIntersecting) {
2117
+ if (once && hasAnimated.current) return;
2118
+ hasAnimated.current = true;
2119
+ setIsAnimated(true);
2120
+ } else if (!once) {
2121
+ setIsAnimated(false);
2122
+ }
2123
+ },
2124
+ { threshold }
2125
+ );
2126
+ observer.observe(el);
2127
+ return () => observer.disconnect();
2128
+ }, [trigger, threshold, once]);
2129
+ const handleMouseEnter = trigger === "hover" ? () => setIsAnimated(true) : void 0;
2130
+ const handleMouseLeave = trigger === "hover" ? () => {
2131
+ if (!once || !hasAnimated.current) {
2132
+ hasAnimated.current = true;
2133
+ setIsAnimated(false);
2134
+ }
2135
+ } : void 0;
2136
+ React112.useEffect(() => {
2137
+ if (trigger === "manual" && manualAnimate !== void 0) {
2138
+ setIsAnimated(manualAnimate);
2139
+ }
2140
+ }, [trigger, manualAnimate]);
2141
+ const active = isAnimated;
2142
+ const currentStyle = active ? animatedStyles[animation] : initialStyles[animation];
2143
+ return /* @__PURE__ */ jsxRuntime.jsx(
2144
+ "div",
2145
+ {
2146
+ ref: setRef,
2147
+ className: cn("will-change-[opacity,transform]", className),
2148
+ style: {
2149
+ ...currentStyle,
2150
+ transitionProperty: "opacity, transform",
2151
+ transitionDuration: `${duration}ms`,
2152
+ transitionDelay: `${delay}ms`,
2153
+ transitionTimingFunction: easing,
2154
+ ...style
2155
+ },
2156
+ onMouseEnter: handleMouseEnter,
2157
+ onMouseLeave: handleMouseLeave,
2158
+ ...props,
2159
+ children: typeof children === "function" ? children(active) : children
2160
+ }
2161
+ );
2162
+ }
2163
+ );
2164
+ AnimatedReveal.displayName = "AnimatedReveal";
2165
+ function useFetchedSvg(src) {
2166
+ const [svg, setSvg] = React112.useState(null);
2167
+ const cache = React112.useRef({});
2168
+ React112.useEffect(() => {
2169
+ if (!src) {
2170
+ setSvg(null);
2171
+ return;
2172
+ }
2173
+ if (cache.current[src]) {
2174
+ setSvg(cache.current[src]);
2175
+ return;
2176
+ }
2177
+ let cancelled = false;
2178
+ fetch(src).then((res) => {
2179
+ if (!res.ok) throw new Error(`Failed to fetch SVG: ${res.status}`);
2180
+ return res.text();
2181
+ }).then((text) => {
2182
+ if (cancelled) return;
2183
+ cache.current[src] = text;
2184
+ setSvg(text);
2185
+ }).catch(() => {
2186
+ if (!cancelled) setSvg(null);
2187
+ });
2188
+ return () => {
2189
+ cancelled = true;
2190
+ };
2191
+ }, [src]);
2192
+ return svg;
2193
+ }
2194
+ function applyDrawAnimation(container, animate, duration, delay, easing) {
2195
+ const paths = container.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
2196
+ paths.forEach((el) => {
2197
+ if ("getTotalLength" in el && typeof el.getTotalLength === "function") {
2198
+ const len = el.getTotalLength();
2199
+ el.style.strokeDasharray = `${len}`;
2200
+ el.style.strokeDashoffset = animate ? "0" : `${len}`;
2201
+ el.style.transition = `stroke-dashoffset ${duration}ms ${easing} ${delay}ms`;
2202
+ }
2203
+ });
2204
+ }
2205
+ function applyFillAnimation(container, animate, duration, delay, easing, fillColor) {
2206
+ const paths = container.querySelectorAll("path, circle, ellipse, rect, polygon");
2207
+ paths.forEach((el) => {
2208
+ if ("getTotalLength" in el && typeof el.getTotalLength === "function") {
2209
+ const geom = el;
2210
+ const len = geom.getTotalLength();
2211
+ geom.style.strokeDasharray = `${len}`;
2212
+ geom.style.strokeDashoffset = animate ? "0" : `${len}`;
2213
+ geom.style.transition = `stroke-dashoffset ${duration * 0.6}ms ${easing} ${delay}ms, fill-opacity ${duration * 0.4}ms ${easing} ${delay + duration * 0.6}ms`;
2214
+ }
2215
+ if (fillColor) el.style.fill = fillColor;
2216
+ el.style.fillOpacity = animate ? "1" : "0";
2217
+ });
2218
+ }
2219
+ function applyPulseAnimation(container, animate, duration) {
2220
+ const svg = container.querySelector("svg");
2221
+ if (!svg) return;
2222
+ if (animate) {
2223
+ svg.style.animation = `ag-pulse ${duration}ms ease-in-out infinite`;
2224
+ } else {
2225
+ svg.style.animation = "none";
2226
+ }
2227
+ }
2228
+ function applyMorphAnimation(container, animate, duration, delay, easing) {
2229
+ const paths = container.querySelectorAll("path, circle, ellipse, rect, polygon");
2230
+ paths.forEach((el) => {
2231
+ el.style.transition = `all ${duration}ms ${easing} ${delay}ms`;
2232
+ el.style.transform = animate ? "scale(1)" : "scale(0)";
2233
+ el.style.transformOrigin = "center";
2234
+ el.style.opacity = animate ? "1" : "0";
2235
+ });
2236
+ }
2237
+ var AnimatedGraphic = React112__namespace.default.forwardRef(
2238
+ ({
2239
+ src,
2240
+ svgContent,
2241
+ animation = "draw",
2242
+ animate = false,
2243
+ duration = 1200,
2244
+ delay = 0,
2245
+ easing = "cubic-bezier(0.16, 1, 0.3, 1)",
2246
+ width,
2247
+ height,
2248
+ strokeColor,
2249
+ fillColor,
2250
+ alt,
2251
+ className,
2252
+ style,
2253
+ children,
2254
+ ...props
2255
+ }, ref) => {
2256
+ const containerRef = React112.useRef(null);
2257
+ const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
2258
+ const resolvedSvg = svgContent ?? fetchedSvg;
2259
+ const prevAnimateRef = React112.useRef(animate);
2260
+ const setRef = React112__namespace.default.useCallback(
2261
+ (node) => {
2262
+ containerRef.current = node;
2263
+ if (typeof ref === "function") ref(node);
2264
+ else if (ref) ref.current = node;
2265
+ },
2266
+ [ref]
2267
+ );
2268
+ React112.useEffect(() => {
2269
+ const el = containerRef.current;
2270
+ if (!el || !strokeColor) return;
2271
+ const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
2272
+ paths.forEach((p2) => {
2273
+ p2.style.stroke = strokeColor;
2274
+ });
2275
+ }, [resolvedSvg, strokeColor]);
2276
+ React112.useEffect(() => {
2277
+ const el = containerRef.current;
2278
+ if (!el || !resolvedSvg) return;
2279
+ if (animation === "draw" || animation === "fill") {
2280
+ const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
2281
+ paths.forEach((p2) => {
2282
+ if ("getTotalLength" in p2 && typeof p2.getTotalLength === "function") {
2283
+ const len = p2.getTotalLength();
2284
+ p2.style.strokeDasharray = `${len}`;
2285
+ p2.style.strokeDashoffset = `${len}`;
2286
+ }
2287
+ if (animation === "fill") {
2288
+ p2.style.fillOpacity = "0";
2289
+ }
2290
+ });
2291
+ }
2292
+ if (animation === "morph") {
2293
+ const paths = el.querySelectorAll("path, circle, ellipse, rect, polygon");
2294
+ paths.forEach((p2) => {
2295
+ p2.style.transform = "scale(0)";
2296
+ p2.style.transformOrigin = "center";
2297
+ p2.style.opacity = "0";
2298
+ });
2299
+ }
2300
+ }, [resolvedSvg, animation]);
2301
+ React112.useEffect(() => {
2302
+ const el = containerRef.current;
2303
+ if (!el) return;
2304
+ const id = requestAnimationFrame(() => {
2305
+ switch (animation) {
2306
+ case "draw":
2307
+ applyDrawAnimation(el, animate, duration, delay, easing);
2308
+ break;
2309
+ case "fill":
2310
+ applyFillAnimation(el, animate, duration, delay, easing, fillColor);
2311
+ break;
2312
+ case "pulse":
2313
+ applyPulseAnimation(el, animate, duration);
2314
+ break;
2315
+ case "morph":
2316
+ applyMorphAnimation(el, animate, duration, delay, easing);
2317
+ break;
2318
+ }
2319
+ });
2320
+ prevAnimateRef.current = animate;
2321
+ return () => cancelAnimationFrame(id);
2322
+ }, [animate, animation, duration, delay, easing, fillColor, resolvedSvg]);
2323
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2324
+ /* @__PURE__ */ jsxRuntime.jsx("style", { children: `@keyframes ag-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.04); opacity: 0.85; } }` }),
2325
+ /* @__PURE__ */ jsxRuntime.jsx(
2326
+ "div",
2327
+ {
2328
+ ref: setRef,
2329
+ className: cn("inline-flex items-center justify-center", className),
2330
+ style: { width, height, ...style },
2331
+ role: alt ? "img" : void 0,
2332
+ "aria-label": alt,
2333
+ ...props,
2334
+ children: resolvedSvg ? /* @__PURE__ */ jsxRuntime.jsx(
2335
+ "div",
2336
+ {
2337
+ className: "w-full h-full [&>svg]:w-full [&>svg]:h-full",
2338
+ dangerouslySetInnerHTML: { __html: resolvedSvg }
2339
+ }
2340
+ ) : children
2341
+ }
2342
+ )
2343
+ ] });
2344
+ }
2345
+ );
2346
+ AnimatedGraphic.displayName = "AnimatedGraphic";
2064
2347
 
2065
2348
  // locales/en.json
2066
2349
  var en_default = {
@@ -2171,7 +2454,7 @@ var en_default = {
2171
2454
  // hooks/useTranslate.ts
2172
2455
  var { $meta: _meta, ...coreMessages } = en_default;
2173
2456
  var coreLocale = coreMessages;
2174
- var I18nContext = React110.createContext({
2457
+ var I18nContext = React112.createContext({
2175
2458
  locale: "en",
2176
2459
  direction: "ltr",
2177
2460
  t: (key) => coreLocale[key] ?? key
@@ -2180,7 +2463,7 @@ var I18nContext = React110.createContext({
2180
2463
  I18nContext.displayName = "I18nContext";
2181
2464
  I18nContext.Provider;
2182
2465
  function useTranslate() {
2183
- return React110.useContext(I18nContext);
2466
+ return React112.useContext(I18nContext);
2184
2467
  }
2185
2468
  var ErrorState = ({
2186
2469
  title,
@@ -2216,7 +2499,7 @@ var ErrorState = ({
2216
2499
  );
2217
2500
  };
2218
2501
  ErrorState.displayName = "ErrorState";
2219
- var ErrorBoundary = class extends React110__namespace.default.Component {
2502
+ var ErrorBoundary = class extends React112__namespace.default.Component {
2220
2503
  constructor(props) {
2221
2504
  super(props);
2222
2505
  __publicField(this, "reset", () => {
@@ -2315,7 +2598,7 @@ function executeNotify(message, options, config) {
2315
2598
  function executeEmit(event, payload, config) {
2316
2599
  config.eventBus.emit(event, payload);
2317
2600
  }
2318
- var ClientEffectConfigContext = React110.createContext(null);
2601
+ var ClientEffectConfigContext = React112.createContext(null);
2319
2602
  ClientEffectConfigContext.Provider;
2320
2603
  var effectIdCounter = 0;
2321
2604
  function generateEffectId() {
@@ -2554,14 +2837,14 @@ var OfflineExecutor = class {
2554
2837
  }
2555
2838
  };
2556
2839
  function useOfflineExecutor(options) {
2557
- const executorRef = React110.useRef(null);
2558
- const [state, setState] = React110.useState({
2840
+ const executorRef = React112.useRef(null);
2841
+ const [state, setState] = React112.useState({
2559
2842
  isOffline: false,
2560
2843
  syncQueue: [],
2561
2844
  localEffectsProcessed: 0,
2562
2845
  effectsSynced: 0
2563
2846
  });
2564
- React110.useEffect(() => {
2847
+ React112.useEffect(() => {
2565
2848
  const executor = new OfflineExecutor({
2566
2849
  ...options,
2567
2850
  onQueueChange: (queue) => {
@@ -2576,7 +2859,7 @@ function useOfflineExecutor(options) {
2576
2859
  executorRef.current = null;
2577
2860
  };
2578
2861
  }, []);
2579
- React110.useEffect(() => {
2862
+ React112.useEffect(() => {
2580
2863
  if (!options.autoSync || !options.serverUrl) return;
2581
2864
  const handleOnline = async () => {
2582
2865
  if (executorRef.current) {
@@ -2590,13 +2873,13 @@ function useOfflineExecutor(options) {
2590
2873
  window.addEventListener("online", handleOnline);
2591
2874
  return () => window.removeEventListener("online", handleOnline);
2592
2875
  }, [options.autoSync, options.serverUrl, options.authToken]);
2593
- const executeEffects = React110.useCallback((effects) => {
2876
+ const executeEffects = React112.useCallback((effects) => {
2594
2877
  executorRef.current?.executeClientEffects(effects);
2595
2878
  if (executorRef.current) {
2596
2879
  setState(executorRef.current.getState());
2597
2880
  }
2598
2881
  }, []);
2599
- const processEventOffline = React110.useCallback(
2882
+ const processEventOffline = React112.useCallback(
2600
2883
  (event, payload, effects) => {
2601
2884
  const result = executorRef.current?.processEventOffline(event, payload, effects);
2602
2885
  if (executorRef.current) {
@@ -2606,7 +2889,7 @@ function useOfflineExecutor(options) {
2606
2889
  },
2607
2890
  []
2608
2891
  );
2609
- const sync = React110.useCallback(async () => {
2892
+ const sync = React112.useCallback(async () => {
2610
2893
  if (!executorRef.current || !options.serverUrl) return 0;
2611
2894
  const count = await executorRef.current.syncPendingEffects(
2612
2895
  options.serverUrl,
@@ -2615,7 +2898,7 @@ function useOfflineExecutor(options) {
2615
2898
  setState(executorRef.current.getState());
2616
2899
  return count;
2617
2900
  }, [options.serverUrl, options.authToken]);
2618
- const clearQueue = React110.useCallback(() => {
2901
+ const clearQueue = React112.useCallback(() => {
2619
2902
  executorRef.current?.clearQueue();
2620
2903
  if (executorRef.current) {
2621
2904
  setState(executorRef.current.getState());
@@ -2631,7 +2914,7 @@ function useOfflineExecutor(options) {
2631
2914
  clearQueue
2632
2915
  };
2633
2916
  }
2634
- React110.createContext(null);
2917
+ React112.createContext(null);
2635
2918
  var defaultIcon = L__default.default.icon({
2636
2919
  iconUrl: "https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png",
2637
2920
  iconRetinaUrl: "https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon-2x.png",
@@ -2644,29 +2927,41 @@ var defaultIcon = L__default.default.icon({
2644
2927
  L__default.default.Marker.prototype.options.icon = defaultIcon;
2645
2928
 
2646
2929
  // lib/verificationRegistry.ts
2647
- var checks = /* @__PURE__ */ new Map();
2648
- var transitions = [];
2649
2930
  var MAX_TRANSITIONS = 500;
2650
- var listeners = /* @__PURE__ */ new Set();
2931
+ function getState() {
2932
+ if (typeof window !== "undefined") {
2933
+ const w = window;
2934
+ if (!w.__verificationRegistryState) {
2935
+ w.__verificationRegistryState = {
2936
+ checks: /* @__PURE__ */ new Map(),
2937
+ transitions: [],
2938
+ bridgeHealth: null,
2939
+ listeners: /* @__PURE__ */ new Set()
2940
+ };
2941
+ }
2942
+ return w.__verificationRegistryState;
2943
+ }
2944
+ return { checks: /* @__PURE__ */ new Map(), transitions: [], bridgeHealth: null, listeners: /* @__PURE__ */ new Set() };
2945
+ }
2651
2946
  function notifyListeners() {
2652
- listeners.forEach((l) => l());
2947
+ getState().listeners.forEach((l) => l());
2653
2948
  exposeOnWindow();
2654
2949
  }
2655
2950
  function registerCheck(id, label, status = "pending", details) {
2656
- checks.set(id, { id, label, status, details, updatedAt: Date.now() });
2951
+ getState().checks.set(id, { id, label, status, details, updatedAt: Date.now() });
2657
2952
  notifyListeners();
2658
2953
  }
2659
2954
  function getAllChecks() {
2660
- return Array.from(checks.values());
2955
+ return Array.from(getState().checks.values());
2661
2956
  }
2662
2957
  function recordTransition(trace) {
2663
2958
  const entry = {
2664
2959
  ...trace,
2665
2960
  id: `t-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`
2666
2961
  };
2667
- transitions.push(entry);
2668
- if (transitions.length > MAX_TRANSITIONS) {
2669
- transitions.shift();
2962
+ getState().transitions.push(entry);
2963
+ if (getState().transitions.length > MAX_TRANSITIONS) {
2964
+ getState().transitions.shift();
2670
2965
  }
2671
2966
  if (entry.event === "INIT") {
2672
2967
  const hasFetch = entry.effects.some((e) => e.type === "fetch");
@@ -2701,10 +2996,11 @@ function recordTransition(trace) {
2701
2996
  notifyListeners();
2702
2997
  }
2703
2998
  function getTransitions() {
2704
- return [...transitions];
2999
+ return [...getState().transitions];
2705
3000
  }
2706
3001
  function getBridgeHealth() {
2707
- return null;
3002
+ const bh = getState().bridgeHealth;
3003
+ return bh ? { ...bh } : null;
2708
3004
  }
2709
3005
  function getSummary() {
2710
3006
  const allChecks = getAllChecks();
@@ -2725,8 +3021,8 @@ function getSnapshot() {
2725
3021
  };
2726
3022
  }
2727
3023
  function subscribeToVerification(listener) {
2728
- listeners.add(listener);
2729
- return () => listeners.delete(listener);
3024
+ getState().listeners.add(listener);
3025
+ return () => getState().listeners.delete(listener);
2730
3026
  }
2731
3027
  function exposeOnWindow() {
2732
3028
  if (typeof window === "undefined") return;
@@ -2743,7 +3039,7 @@ function exposeOnWindow() {
2743
3039
  }
2744
3040
  function waitForTransition(event, timeoutMs = 1e4) {
2745
3041
  return new Promise((resolve) => {
2746
- const existing = transitions.find((t) => t.event === event);
3042
+ const existing = getState().transitions.find((t) => t.event === event);
2747
3043
  if (existing) {
2748
3044
  resolve(existing);
2749
3045
  return;
@@ -2753,7 +3049,7 @@ function waitForTransition(event, timeoutMs = 1e4) {
2753
3049
  resolve(null);
2754
3050
  }, timeoutMs);
2755
3051
  const unsub = subscribeToVerification(() => {
2756
- const found = transitions.find((t) => t.event === event);
3052
+ const found = getState().transitions.find((t) => t.event === event);
2757
3053
  if (found) {
2758
3054
  clearTimeout(timeout);
2759
3055
  unsub();
@@ -2796,7 +3092,7 @@ function bindTraitStateGetter(getter) {
2796
3092
  }
2797
3093
  }
2798
3094
  exposeOnWindow();
2799
- var MarkdownContent = React110__namespace.default.memo(
3095
+ var MarkdownContent = React112__namespace.default.memo(
2800
3096
  ({ content, direction, className }) => {
2801
3097
  const { t: _t } = useTranslate();
2802
3098
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -2898,7 +3194,7 @@ var MarkdownContent = React110__namespace.default.memo(
2898
3194
  (prev, next) => prev.content === next.content && prev.className === next.className && prev.direction === next.direction
2899
3195
  );
2900
3196
  MarkdownContent.displayName = "MarkdownContent";
2901
- var CodeBlock = React110__namespace.default.memo(
3197
+ var CodeBlock = React112__namespace.default.memo(
2902
3198
  ({
2903
3199
  code: rawCode,
2904
3200
  language = "text",
@@ -2910,20 +3206,20 @@ var CodeBlock = React110__namespace.default.memo(
2910
3206
  const code = typeof rawCode === "string" ? rawCode : String(rawCode ?? "");
2911
3207
  const eventBus = useEventBus();
2912
3208
  const { t: _t } = useTranslate();
2913
- const scrollRef = React110.useRef(null);
2914
- const savedScrollLeftRef = React110.useRef(0);
2915
- const [copied, setCopied] = React110.useState(false);
2916
- React110.useLayoutEffect(() => {
3209
+ const scrollRef = React112.useRef(null);
3210
+ const savedScrollLeftRef = React112.useRef(0);
3211
+ const [copied, setCopied] = React112.useState(false);
3212
+ React112.useLayoutEffect(() => {
2917
3213
  const el = scrollRef.current;
2918
3214
  return () => {
2919
3215
  if (el) savedScrollLeftRef.current = el.scrollLeft;
2920
3216
  };
2921
3217
  }, [language, code]);
2922
- React110.useLayoutEffect(() => {
3218
+ React112.useLayoutEffect(() => {
2923
3219
  const el = scrollRef.current;
2924
3220
  if (el) el.scrollLeft = savedScrollLeftRef.current;
2925
3221
  }, [language, code]);
2926
- React110.useEffect(() => {
3222
+ React112.useEffect(() => {
2927
3223
  const el = scrollRef.current;
2928
3224
  if (!el) return;
2929
3225
  const handle = () => {
@@ -3009,18 +3305,18 @@ CodeBlock.displayName = "CodeBlock";
3009
3305
 
3010
3306
  // lib/debug.ts
3011
3307
  typeof window !== "undefined" && (localStorage.getItem("debug") === "true" || process.env.NODE_ENV === "development");
3012
- React110.lazy(() => import('react-markdown'));
3013
- var GameAudioContext = React110.createContext(null);
3308
+ React112.lazy(() => import('react-markdown'));
3309
+ var GameAudioContext = React112.createContext(null);
3014
3310
  GameAudioContext.displayName = "GameAudioContext";
3015
3311
 
3016
3312
  // components/organisms/component-registry.generated.ts
3017
3313
  function lazyThree(name, loader) {
3018
- const Lazy = React110__namespace.default.lazy(() => loader().then((m) => ({ default: m[name] })));
3314
+ const Lazy = React112__namespace.default.lazy(() => loader().then((m) => ({ default: m[name] })));
3019
3315
  function ThreeWrapper(props) {
3020
- return React110__namespace.default.createElement(
3021
- React110__namespace.default.Suspense,
3316
+ return React112__namespace.default.createElement(
3317
+ React112__namespace.default.Suspense,
3022
3318
  { fallback: null },
3023
- React110__namespace.default.createElement(Lazy, props)
3319
+ React112__namespace.default.createElement(Lazy, props)
3024
3320
  );
3025
3321
  }
3026
3322
  ThreeWrapper.displayName = `Lazy(${name})`;
@@ -3041,13 +3337,13 @@ lazyThree("PhysicsObject3D", () => import('@almadar/ui/components/organisms/game
3041
3337
  lazyThree("Scene3D", () => import('@almadar/ui/components/organisms/game/three'));
3042
3338
  lazyThree("TileRenderer", () => import('@almadar/ui/components/organisms/game/three'));
3043
3339
  lazyThree("UnitRenderer", () => import('@almadar/ui/components/organisms/game/three'));
3044
- var SuspenseConfigContext = React110.createContext({ enabled: false });
3045
- React110.createContext(false);
3340
+ var SuspenseConfigContext = React112.createContext({ enabled: false });
3341
+ React112.createContext(false);
3046
3342
  function SuspenseConfigProvider({
3047
3343
  config,
3048
3344
  children
3049
3345
  }) {
3050
- return React110__namespace.default.createElement(
3346
+ return React112__namespace.default.createElement(
3051
3347
  SuspenseConfigContext.Provider,
3052
3348
  { value: config },
3053
3349
  children
@@ -3092,8 +3388,8 @@ function VerificationProvider({
3092
3388
  }) {
3093
3389
  const isEnabled = enabled ?? (typeof process !== "undefined" && process.env?.NODE_ENV !== "production");
3094
3390
  const eventBus = useEventBus();
3095
- const pendingRef = React110.useRef(/* @__PURE__ */ new Map());
3096
- React110.useEffect(() => {
3391
+ const pendingRef = React112.useRef(/* @__PURE__ */ new Map());
3392
+ React112.useEffect(() => {
3097
3393
  if (!isEnabled) return;
3098
3394
  if (!eventBus.onAny) return;
3099
3395
  const unsub = eventBus.onAny((evt) => {
@@ -3120,7 +3416,7 @@ function VerificationProvider({
3120
3416
  })) : [];
3121
3417
  recordTransition({
3122
3418
  traitName: parsed.traitName,
3123
- from: pending?.from ?? "unknown",
3419
+ from: pending?.from ?? (parsed.event === "INIT" ? "init" : "unknown"),
3124
3420
  to: newState,
3125
3421
  event: parsed.event,
3126
3422
  effects,
@@ -3154,7 +3450,7 @@ function VerificationProvider({
3154
3450
  );
3155
3451
  return unsub;
3156
3452
  }, [isEnabled, eventBus]);
3157
- React110.useEffect(() => {
3453
+ React112.useEffect(() => {
3158
3454
  if (!isEnabled) return;
3159
3455
  if (!runtimeManager) return;
3160
3456
  runtimeManager.setObserver({
@@ -3176,11 +3472,11 @@ function VerificationProvider({
3176
3472
  "pass"
3177
3473
  );
3178
3474
  }, [isEnabled, runtimeManager]);
3179
- React110.useEffect(() => {
3475
+ React112.useEffect(() => {
3180
3476
  if (!isEnabled) return;
3181
3477
  bindEventBus(eventBus);
3182
3478
  }, [isEnabled, eventBus]);
3183
- React110.useEffect(() => {
3479
+ React112.useEffect(() => {
3184
3480
  if (!isEnabled) return;
3185
3481
  if (traitStateGetter) {
3186
3482
  bindTraitStateGetter(traitStateGetter);
@@ -3204,7 +3500,7 @@ function OrbitalProvider({
3204
3500
  suspense = false,
3205
3501
  verification
3206
3502
  }) {
3207
- const suspenseConfig = React110.useMemo(
3503
+ const suspenseConfig = React112.useMemo(
3208
3504
  () => ({ enabled: suspense }),
3209
3505
  [suspense]
3210
3506
  );
@@ -3224,43 +3520,43 @@ function OrbitalProvider({
3224
3520
  );
3225
3521
  }
3226
3522
  OrbitalProvider.displayName = "OrbitalProvider";
3227
- var FetchedDataContext = React110.createContext(null);
3523
+ var FetchedDataContext = React112.createContext(null);
3228
3524
  function FetchedDataProvider({
3229
3525
  initialData,
3230
3526
  children
3231
3527
  }) {
3232
- const [state, setState] = React110.useState(() => ({
3528
+ const [state, setState] = React112.useState(() => ({
3233
3529
  data: initialData || {},
3234
3530
  fetchedAt: {},
3235
3531
  loading: false,
3236
3532
  error: null
3237
3533
  }));
3238
- const getData = React110.useCallback(
3534
+ const getData = React112.useCallback(
3239
3535
  (entityName) => {
3240
3536
  return state.data[entityName] || [];
3241
3537
  },
3242
3538
  [state.data]
3243
3539
  );
3244
- const getById = React110.useCallback(
3540
+ const getById = React112.useCallback(
3245
3541
  (entityName, id) => {
3246
3542
  const records = state.data[entityName];
3247
3543
  return records?.find((r) => r.id === id);
3248
3544
  },
3249
3545
  [state.data]
3250
3546
  );
3251
- const hasData = React110.useCallback(
3547
+ const hasData = React112.useCallback(
3252
3548
  (entityName) => {
3253
3549
  return entityName in state.data && state.data[entityName].length > 0;
3254
3550
  },
3255
3551
  [state.data]
3256
3552
  );
3257
- const getFetchedAt = React110.useCallback(
3553
+ const getFetchedAt = React112.useCallback(
3258
3554
  (entityName) => {
3259
3555
  return state.fetchedAt[entityName];
3260
3556
  },
3261
3557
  [state.fetchedAt]
3262
3558
  );
3263
- const setData = React110.useCallback((data) => {
3559
+ const setData = React112.useCallback((data) => {
3264
3560
  const now = Date.now();
3265
3561
  setState((prev) => ({
3266
3562
  ...prev,
@@ -3279,14 +3575,14 @@ function FetchedDataProvider({
3279
3575
  error: null
3280
3576
  }));
3281
3577
  }, []);
3282
- const clearData = React110.useCallback(() => {
3578
+ const clearData = React112.useCallback(() => {
3283
3579
  setState((prev) => ({
3284
3580
  ...prev,
3285
3581
  data: {},
3286
3582
  fetchedAt: {}
3287
3583
  }));
3288
3584
  }, []);
3289
- const clearEntity = React110.useCallback((entityName) => {
3585
+ const clearEntity = React112.useCallback((entityName) => {
3290
3586
  setState((prev) => {
3291
3587
  const newData = { ...prev.data };
3292
3588
  const newFetchedAt = { ...prev.fetchedAt };
@@ -3299,13 +3595,13 @@ function FetchedDataProvider({
3299
3595
  };
3300
3596
  });
3301
3597
  }, []);
3302
- const setLoading = React110.useCallback((loading) => {
3598
+ const setLoading = React112.useCallback((loading) => {
3303
3599
  setState((prev) => ({ ...prev, loading }));
3304
3600
  }, []);
3305
- const setError = React110.useCallback((error) => {
3601
+ const setError = React112.useCallback((error) => {
3306
3602
  setState((prev) => ({ ...prev, error, loading: false }));
3307
3603
  }, []);
3308
- const contextValue = React110.useMemo(
3604
+ const contextValue = React112.useMemo(
3309
3605
  () => ({
3310
3606
  getData,
3311
3607
  getById,
@@ -3336,10 +3632,10 @@ function FetchedDataProvider({
3336
3632
  return /* @__PURE__ */ jsxRuntime.jsx(FetchedDataContext.Provider, { value: contextValue, children });
3337
3633
  }
3338
3634
  function useFetchedDataContext() {
3339
- return React110.useContext(FetchedDataContext);
3635
+ return React112.useContext(FetchedDataContext);
3340
3636
  }
3341
3637
  function useFetchedData() {
3342
- const context = React110.useContext(FetchedDataContext);
3638
+ const context = React112.useContext(FetchedDataContext);
3343
3639
  if (!context) {
3344
3640
  return {
3345
3641
  getData: () => [],
@@ -3379,15 +3675,15 @@ function useFetchedEntity(entityName) {
3379
3675
  error: context.error
3380
3676
  };
3381
3677
  }
3382
- var OfflineModeContext = React110.createContext(null);
3678
+ var OfflineModeContext = React112.createContext(null);
3383
3679
  function OfflineModeProvider({
3384
3680
  children,
3385
3681
  ...executorOptions
3386
3682
  }) {
3387
- const [forceOffline, setForceOffline] = React110.useState(false);
3683
+ const [forceOffline, setForceOffline] = React112.useState(false);
3388
3684
  const executor = useOfflineExecutor(executorOptions);
3389
3685
  const effectivelyOffline = executor.isOffline || forceOffline;
3390
- const contextValue = React110.useMemo(
3686
+ const contextValue = React112.useMemo(
3391
3687
  () => ({
3392
3688
  ...executor,
3393
3689
  forceOffline,
@@ -3399,14 +3695,14 @@ function OfflineModeProvider({
3399
3695
  return /* @__PURE__ */ jsxRuntime.jsx(OfflineModeContext.Provider, { value: contextValue, children });
3400
3696
  }
3401
3697
  function useOfflineMode() {
3402
- const context = React110.useContext(OfflineModeContext);
3698
+ const context = React112.useContext(OfflineModeContext);
3403
3699
  if (!context) {
3404
3700
  throw new Error("useOfflineMode must be used within OfflineModeProvider");
3405
3701
  }
3406
3702
  return context;
3407
3703
  }
3408
3704
  function useOptionalOfflineMode() {
3409
- return React110.useContext(OfflineModeContext);
3705
+ return React112.useContext(OfflineModeContext);
3410
3706
  }
3411
3707
 
3412
3708
  exports.EventBusContext = EventBusContext2;