@almadar/ui 4.34.0 → 4.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/avl/index.cjs +1537 -1479
  2. package/dist/avl/index.js +457 -399
  3. package/dist/components/atoms/FilterPill.d.ts +18 -0
  4. package/dist/components/atoms/index.d.ts +1 -0
  5. package/dist/components/index.cjs +4382 -1512
  6. package/dist/components/index.js +3490 -620
  7. package/dist/components/molecules/BranchingLogicBuilder.d.ts +23 -0
  8. package/dist/components/molecules/LikertScale.d.ts +29 -0
  9. package/dist/components/molecules/MapView.d.ts +22 -0
  10. package/dist/components/molecules/MatrixQuestion.d.ts +29 -0
  11. package/dist/components/molecules/OptionConstraintGroup.d.ts +38 -0
  12. package/dist/components/molecules/PositionedCanvas.d.ts +32 -0
  13. package/dist/components/molecules/QrScanner.d.ts +17 -0
  14. package/dist/components/molecules/ReplyTree.d.ts +29 -0
  15. package/dist/components/molecules/RichBlockEditor.d.ts +27 -0
  16. package/dist/components/molecules/VersionDiff.d.ts +44 -0
  17. package/dist/components/molecules/VoteStack.d.ts +23 -0
  18. package/dist/components/molecules/index.d.ts +11 -1
  19. package/dist/components/organisms/MediaGallery.d.ts +1 -1
  20. package/dist/components/templates/DashboardLayout.d.ts +7 -0
  21. package/dist/context/CurrentPagePathContext.d.ts +9 -0
  22. package/dist/context/index.cjs +10 -0
  23. package/dist/context/index.d.ts +1 -0
  24. package/dist/context/index.js +8 -1
  25. package/dist/providers/index.cjs +1146 -1104
  26. package/dist/providers/index.js +414 -372
  27. package/dist/runtime/createClientEffectHandlers.d.ts +9 -1
  28. package/dist/runtime/index.cjs +1203 -1145
  29. package/dist/runtime/index.js +439 -381
  30. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import * as React104 from 'react';
2
- import React104__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId } from 'react';
1
+ import * as React105 from 'react';
2
+ import React105__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId } from 'react';
3
3
  import { EventBusContext, useTraitScope, OrbitalProvider, TraitScopeProvider, VerificationProvider } from '@almadar/ui/providers';
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
  import { clsx } from 'clsx';
@@ -1015,7 +1015,7 @@ var init_Box = __esm({
1015
1015
  fixed: "fixed",
1016
1016
  sticky: "sticky"
1017
1017
  };
1018
- Box = React104__default.forwardRef(
1018
+ Box = React105__default.forwardRef(
1019
1019
  ({
1020
1020
  padding,
1021
1021
  paddingX,
@@ -1714,7 +1714,7 @@ function resolveIconProp(value, sizeClass) {
1714
1714
  const IconComp = value;
1715
1715
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
1716
1716
  }
1717
- if (React104__default.isValidElement(value)) {
1717
+ if (React105__default.isValidElement(value)) {
1718
1718
  return value;
1719
1719
  }
1720
1720
  if (typeof value === "object" && value !== null && "render" in value) {
@@ -1790,7 +1790,7 @@ var init_Button = __esm({
1790
1790
  md: "h-4 w-4",
1791
1791
  lg: "h-5 w-5"
1792
1792
  };
1793
- Button = React104__default.forwardRef(
1793
+ Button = React105__default.forwardRef(
1794
1794
  ({
1795
1795
  className,
1796
1796
  variant = "primary",
@@ -1893,7 +1893,7 @@ var init_Badge = __esm({
1893
1893
  md: "px-2.5 py-1 text-sm",
1894
1894
  lg: "px-3 py-1.5 text-base"
1895
1895
  };
1896
- Badge = React104__default.forwardRef(
1896
+ Badge = React105__default.forwardRef(
1897
1897
  ({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
1898
1898
  const iconSizes2 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
1899
1899
  const resolvedIcon = typeof icon === "string" ? (() => {
@@ -2053,7 +2053,7 @@ var Input;
2053
2053
  var init_Input = __esm({
2054
2054
  "components/atoms/Input.tsx"() {
2055
2055
  init_cn();
2056
- Input = React104__default.forwardRef(
2056
+ Input = React105__default.forwardRef(
2057
2057
  ({
2058
2058
  className,
2059
2059
  inputType,
@@ -2171,7 +2171,7 @@ var Label;
2171
2171
  var init_Label = __esm({
2172
2172
  "components/atoms/Label.tsx"() {
2173
2173
  init_cn();
2174
- Label = React104__default.forwardRef(
2174
+ Label = React105__default.forwardRef(
2175
2175
  ({ className, required, children, ...props }, ref) => {
2176
2176
  return /* @__PURE__ */ jsxs(
2177
2177
  "label",
@@ -2197,7 +2197,7 @@ var Textarea;
2197
2197
  var init_Textarea = __esm({
2198
2198
  "components/atoms/Textarea.tsx"() {
2199
2199
  init_cn();
2200
- Textarea = React104__default.forwardRef(
2200
+ Textarea = React105__default.forwardRef(
2201
2201
  ({ className, error, ...props }, ref) => {
2202
2202
  return /* @__PURE__ */ jsx(
2203
2203
  "textarea",
@@ -2226,7 +2226,7 @@ var Select;
2226
2226
  var init_Select = __esm({
2227
2227
  "components/atoms/Select.tsx"() {
2228
2228
  init_cn();
2229
- Select = React104__default.forwardRef(
2229
+ Select = React105__default.forwardRef(
2230
2230
  ({ className, options, placeholder, error, ...props }, ref) => {
2231
2231
  return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
2232
2232
  /* @__PURE__ */ jsxs(
@@ -2268,7 +2268,7 @@ var Checkbox;
2268
2268
  var init_Checkbox = __esm({
2269
2269
  "components/atoms/Checkbox.tsx"() {
2270
2270
  init_cn();
2271
- Checkbox = React104__default.forwardRef(
2271
+ Checkbox = React105__default.forwardRef(
2272
2272
  ({ className, label, id, ...props }, ref) => {
2273
2273
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
2274
2274
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
@@ -2350,7 +2350,7 @@ var init_Card = __esm({
2350
2350
  md: "shadow",
2351
2351
  lg: "shadow-lg"
2352
2352
  };
2353
- Card = React104__default.forwardRef(
2353
+ Card = React105__default.forwardRef(
2354
2354
  ({
2355
2355
  className,
2356
2356
  variant = "bordered",
@@ -2386,9 +2386,9 @@ var init_Card = __esm({
2386
2386
  }
2387
2387
  );
2388
2388
  Card.displayName = "Card";
2389
- CardHeader = React104__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
2389
+ CardHeader = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
2390
2390
  CardHeader.displayName = "CardHeader";
2391
- CardTitle = React104__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2391
+ CardTitle = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2392
2392
  "h3",
2393
2393
  {
2394
2394
  ref,
@@ -2401,11 +2401,11 @@ var init_Card = __esm({
2401
2401
  }
2402
2402
  ));
2403
2403
  CardTitle.displayName = "CardTitle";
2404
- CardContent = React104__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
2404
+ CardContent = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
2405
2405
  CardContent.displayName = "CardContent";
2406
2406
  CardBody = CardContent;
2407
2407
  CardBody.displayName = "CardBody";
2408
- CardFooter = React104__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2408
+ CardFooter = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2409
2409
  "div",
2410
2410
  {
2411
2411
  ref,
@@ -2426,7 +2426,7 @@ var init_Spinner = __esm({
2426
2426
  md: "h-6 w-6",
2427
2427
  lg: "h-8 w-8"
2428
2428
  };
2429
- Spinner = React104__default.forwardRef(
2429
+ Spinner = React105__default.forwardRef(
2430
2430
  ({ className, size = "md", ...props }, ref) => {
2431
2431
  return /* @__PURE__ */ jsx(
2432
2432
  "div",
@@ -2874,7 +2874,7 @@ var Radio;
2874
2874
  var init_Radio = __esm({
2875
2875
  "components/atoms/Radio.tsx"() {
2876
2876
  init_cn();
2877
- Radio = React104__default.forwardRef(
2877
+ Radio = React105__default.forwardRef(
2878
2878
  ({
2879
2879
  label,
2880
2880
  helperText,
@@ -2985,7 +2985,7 @@ var init_Switch = __esm({
2985
2985
  "components/atoms/Switch.tsx"() {
2986
2986
  "use client";
2987
2987
  init_cn();
2988
- Switch = React104.forwardRef(
2988
+ Switch = React105.forwardRef(
2989
2989
  ({
2990
2990
  checked,
2991
2991
  defaultChecked = false,
@@ -2996,10 +2996,10 @@ var init_Switch = __esm({
2996
2996
  name,
2997
2997
  className
2998
2998
  }, ref) => {
2999
- const [isChecked, setIsChecked] = React104.useState(
2999
+ const [isChecked, setIsChecked] = React105.useState(
3000
3000
  checked !== void 0 ? checked : defaultChecked
3001
3001
  );
3002
- React104.useEffect(() => {
3002
+ React105.useEffect(() => {
3003
3003
  if (checked !== void 0) {
3004
3004
  setIsChecked(checked);
3005
3005
  }
@@ -3544,8 +3544,8 @@ var init_LawReferenceTooltip = __esm({
3544
3544
  position = "top",
3545
3545
  className
3546
3546
  }) => {
3547
- const [isVisible, setIsVisible] = React104__default.useState(false);
3548
- const timeoutRef = React104__default.useRef(null);
3547
+ const [isVisible, setIsVisible] = React105__default.useState(false);
3548
+ const timeoutRef = React105__default.useRef(null);
3549
3549
  const handleMouseEnter = () => {
3550
3550
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
3551
3551
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -3554,7 +3554,7 @@ var init_LawReferenceTooltip = __esm({
3554
3554
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
3555
3555
  setIsVisible(false);
3556
3556
  };
3557
- React104__default.useEffect(() => {
3557
+ React105__default.useEffect(() => {
3558
3558
  return () => {
3559
3559
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
3560
3560
  };
@@ -3764,7 +3764,7 @@ var init_StatusDot = __esm({
3764
3764
  md: "w-2.5 h-2.5",
3765
3765
  lg: "w-3 h-3"
3766
3766
  };
3767
- StatusDot = React104__default.forwardRef(
3767
+ StatusDot = React105__default.forwardRef(
3768
3768
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
3769
3769
  return /* @__PURE__ */ jsx(
3770
3770
  "span",
@@ -3817,7 +3817,7 @@ var init_TrendIndicator = __esm({
3817
3817
  down: TrendingDown,
3818
3818
  flat: ArrowRight
3819
3819
  };
3820
- TrendIndicator = React104__default.forwardRef(
3820
+ TrendIndicator = React105__default.forwardRef(
3821
3821
  ({
3822
3822
  className,
3823
3823
  value,
@@ -3884,7 +3884,7 @@ var init_RangeSlider = __esm({
3884
3884
  md: "w-4 h-4",
3885
3885
  lg: "w-5 h-5"
3886
3886
  };
3887
- RangeSlider = React104__default.forwardRef(
3887
+ RangeSlider = React105__default.forwardRef(
3888
3888
  ({
3889
3889
  className,
3890
3890
  min = 0,
@@ -4494,9 +4494,9 @@ function ScoreDisplay({
4494
4494
  ...rest
4495
4495
  }) {
4496
4496
  const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
4497
- const [displayValue, setDisplayValue] = React104.useState(resolvedValue);
4498
- const [isAnimating, setIsAnimating] = React104.useState(false);
4499
- React104.useEffect(() => {
4497
+ const [displayValue, setDisplayValue] = React105.useState(resolvedValue);
4498
+ const [isAnimating, setIsAnimating] = React105.useState(false);
4499
+ React105.useEffect(() => {
4500
4500
  if (!animated || displayValue === resolvedValue) {
4501
4501
  setDisplayValue(resolvedValue);
4502
4502
  return;
@@ -4566,9 +4566,9 @@ function ControlButton({
4566
4566
  className
4567
4567
  }) {
4568
4568
  const eventBus = useEventBus();
4569
- const [isPressed, setIsPressed] = React104.useState(false);
4569
+ const [isPressed, setIsPressed] = React105.useState(false);
4570
4570
  const actualPressed = pressed ?? isPressed;
4571
- const handlePointerDown = React104.useCallback(
4571
+ const handlePointerDown = React105.useCallback(
4572
4572
  (e) => {
4573
4573
  e.preventDefault();
4574
4574
  if (disabled) return;
@@ -4578,7 +4578,7 @@ function ControlButton({
4578
4578
  },
4579
4579
  [disabled, pressEvent, eventBus, onPress]
4580
4580
  );
4581
- const handlePointerUp = React104.useCallback(
4581
+ const handlePointerUp = React105.useCallback(
4582
4582
  (e) => {
4583
4583
  e.preventDefault();
4584
4584
  if (disabled) return;
@@ -4588,7 +4588,7 @@ function ControlButton({
4588
4588
  },
4589
4589
  [disabled, releaseEvent, eventBus, onRelease]
4590
4590
  );
4591
- const handlePointerLeave = React104.useCallback(
4591
+ const handlePointerLeave = React105.useCallback(
4592
4592
  (e) => {
4593
4593
  if (isPressed) {
4594
4594
  setIsPressed(false);
@@ -5486,9 +5486,9 @@ function MiniMap({
5486
5486
  viewportRect,
5487
5487
  className
5488
5488
  }) {
5489
- const canvasRef = React104.useRef(null);
5490
- const frameRef = React104.useRef(0);
5491
- React104.useEffect(() => {
5489
+ const canvasRef = React105.useRef(null);
5490
+ const frameRef = React105.useRef(0);
5491
+ React105.useEffect(() => {
5492
5492
  const canvas = canvasRef.current;
5493
5493
  if (!canvas) return;
5494
5494
  const ctx = canvas.getContext("2d");
@@ -5650,7 +5650,7 @@ var init_ErrorBoundary = __esm({
5650
5650
  "use client";
5651
5651
  init_cn();
5652
5652
  init_ErrorState();
5653
- ErrorBoundary = class extends React104__default.Component {
5653
+ ErrorBoundary = class extends React105__default.Component {
5654
5654
  constructor(props) {
5655
5655
  super(props);
5656
5656
  __publicField(this, "reset", () => {
@@ -6097,8 +6097,8 @@ var init_Tooltip = __esm({
6097
6097
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
6098
6098
  };
6099
6099
  }, []);
6100
- const triggerElement = React104__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
6101
- const trigger = React104__default.cloneElement(triggerElement, {
6100
+ const triggerElement = React105__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
6101
+ const trigger = React105__default.cloneElement(triggerElement, {
6102
6102
  ref: triggerRef,
6103
6103
  onMouseEnter: handleMouseEnter,
6104
6104
  onMouseLeave: handleMouseLeave,
@@ -6219,8 +6219,8 @@ var init_Popover = __esm({
6219
6219
  onMouseEnter: handleOpen,
6220
6220
  onMouseLeave: handleClose
6221
6221
  };
6222
- const childElement = React104__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
6223
- const triggerElement = React104__default.cloneElement(
6222
+ const childElement = React105__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
6223
+ const triggerElement = React105__default.cloneElement(
6224
6224
  childElement,
6225
6225
  {
6226
6226
  ref: triggerRef,
@@ -6337,8 +6337,8 @@ var init_Menu = __esm({
6337
6337
  "bottom-start": "top-full left-0 mt-2",
6338
6338
  "bottom-end": "top-full right-0 mt-2"
6339
6339
  };
6340
- const triggerChild = React104__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
6341
- const triggerElement = React104__default.cloneElement(
6340
+ const triggerChild = React105__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
6341
+ const triggerElement = React105__default.cloneElement(
6342
6342
  triggerChild,
6343
6343
  {
6344
6344
  ref: triggerRef,
@@ -6845,7 +6845,7 @@ var init_MapView = __esm({
6845
6845
  import('leaflet')
6846
6846
  ]);
6847
6847
  await import('leaflet/dist/leaflet.css');
6848
- const { MapContainer, TileLayer, Marker, Popup, useMap } = reactLeaflet;
6848
+ const { MapContainer, TileLayer, Marker, Polyline, Popup, useMap } = reactLeaflet;
6849
6849
  const L = leafletMod.default;
6850
6850
  const defaultIcon = L.icon({
6851
6851
  iconUrl: "https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png",
@@ -6857,7 +6857,7 @@ var init_MapView = __esm({
6857
6857
  shadowSize: [41, 41]
6858
6858
  });
6859
6859
  L.Marker.prototype.options.icon = defaultIcon;
6860
- const { useEffect: useEffect61, useRef: useRef58, useCallback: useCallback88, useState: useState83 } = React104__default;
6860
+ const { useEffect: useEffect61, useRef: useRef58, useCallback: useCallback88, useState: useState83 } = React105__default;
6861
6861
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
6862
6862
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
6863
6863
  function MapUpdater({ centerLat, centerLng, zoom }) {
@@ -6888,6 +6888,7 @@ var init_MapView = __esm({
6888
6888
  }
6889
6889
  function MapViewInner({
6890
6890
  markers = [],
6891
+ routes = [],
6891
6892
  centerLat = 51.505,
6892
6893
  centerLng = -0.09,
6893
6894
  zoom = 13,
@@ -6956,6 +6957,20 @@ var init_MapView = __esm({
6956
6957
  ] }) : null
6957
6958
  },
6958
6959
  marker.id
6960
+ )),
6961
+ routes.map((route) => /* @__PURE__ */ jsx(
6962
+ Polyline,
6963
+ {
6964
+ positions: route.waypoints.map((wp) => [wp.lat, wp.lng]),
6965
+ pathOptions: {
6966
+ color: route.color ?? "var(--primary, #2563eb)",
6967
+ weight: route.weight ?? 4,
6968
+ opacity: route.opacity ?? 0.8,
6969
+ dashArray: route.dashArray
6970
+ },
6971
+ children: route.label ? /* @__PURE__ */ jsx(Popup, { children: /* @__PURE__ */ jsx(Typography2, { variant: "body2", children: route.label }) }) : null
6972
+ },
6973
+ route.id
6959
6974
  ))
6960
6975
  ]
6961
6976
  },
@@ -7088,7 +7103,7 @@ function InputPattern({
7088
7103
  fieldName
7089
7104
  }) {
7090
7105
  const { emit } = useEventBus();
7091
- const [localValue, setLocalValue] = React104__default.useState(value);
7106
+ const [localValue, setLocalValue] = React105__default.useState(value);
7092
7107
  const handleChange = (e) => {
7093
7108
  setLocalValue(e.target.value);
7094
7109
  if (onChange) {
@@ -7126,7 +7141,7 @@ function TextareaPattern({
7126
7141
  fieldName
7127
7142
  }) {
7128
7143
  const { emit } = useEventBus();
7129
- const [localValue, setLocalValue] = React104__default.useState(value);
7144
+ const [localValue, setLocalValue] = React105__default.useState(value);
7130
7145
  const handleChange = (e) => {
7131
7146
  setLocalValue(e.target.value);
7132
7147
  if (onChange) {
@@ -7158,7 +7173,7 @@ function SelectPattern({
7158
7173
  fieldName
7159
7174
  }) {
7160
7175
  const { emit } = useEventBus();
7161
- const [localValue, setLocalValue] = React104__default.useState(value);
7176
+ const [localValue, setLocalValue] = React105__default.useState(value);
7162
7177
  const handleChange = (e) => {
7163
7178
  setLocalValue(e.target.value);
7164
7179
  if (onChange) {
@@ -7187,7 +7202,7 @@ function CheckboxPattern({
7187
7202
  className
7188
7203
  }) {
7189
7204
  const { emit } = useEventBus();
7190
- const [localChecked, setLocalChecked] = React104__default.useState(checked);
7205
+ const [localChecked, setLocalChecked] = React105__default.useState(checked);
7191
7206
  const handleChange = (e) => {
7192
7207
  setLocalChecked(e.target.checked);
7193
7208
  if (onChange) {
@@ -7418,8 +7433,8 @@ function ActionButtons({
7418
7433
  disabled
7419
7434
  }) {
7420
7435
  const eventBus = useEventBus();
7421
- const [activeButtons, setActiveButtons] = React104.useState(/* @__PURE__ */ new Set());
7422
- const handlePress = React104.useCallback(
7436
+ const [activeButtons, setActiveButtons] = React105.useState(/* @__PURE__ */ new Set());
7437
+ const handlePress = React105.useCallback(
7423
7438
  (id) => {
7424
7439
  setActiveButtons((prev) => new Set(prev).add(id));
7425
7440
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -7427,7 +7442,7 @@ function ActionButtons({
7427
7442
  },
7428
7443
  [actionEvent, eventBus, onAction]
7429
7444
  );
7430
- const handleRelease = React104.useCallback(
7445
+ const handleRelease = React105.useCallback(
7431
7446
  (id) => {
7432
7447
  setActiveButtons((prev) => {
7433
7448
  const next = new Set(prev);
@@ -9462,7 +9477,7 @@ var init_MarkdownContent = __esm({
9462
9477
  init_Box();
9463
9478
  init_useTranslate();
9464
9479
  init_cn();
9465
- MarkdownContent = React104__default.memo(
9480
+ MarkdownContent = React105__default.memo(
9466
9481
  ({ content, direction, className }) => {
9467
9482
  const { t: _t } = useTranslate();
9468
9483
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -9679,7 +9694,7 @@ var init_CodeBlock = __esm({
9679
9694
  loloStyle = { ...dark, ...loloStyleOverrides };
9680
9695
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
9681
9696
  HIDDEN_LINE_NUMBERS = { display: "none" };
9682
- CodeBlock = React104__default.memo(
9697
+ CodeBlock = React105__default.memo(
9683
9698
  ({
9684
9699
  code: rawCode,
9685
9700
  language = "text",
@@ -10938,7 +10953,7 @@ var init_StateMachineView = __esm({
10938
10953
  style: { top: title ? 30 : 0 },
10939
10954
  children: [
10940
10955
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
10941
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React104__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
10956
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React105__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
10942
10957
  StateNode,
10943
10958
  {
10944
10959
  state,
@@ -16658,7 +16673,7 @@ function CraftingRecipe({
16658
16673
  className
16659
16674
  }) {
16660
16675
  const eventBus = useEventBus();
16661
- const handleCraft = React104.useCallback(() => {
16676
+ const handleCraft = React105.useCallback(() => {
16662
16677
  onCraft?.();
16663
16678
  if (craftEvent) {
16664
16679
  eventBus.emit(craftEvent, { output: output.label });
@@ -16675,7 +16690,7 @@ function CraftingRecipe({
16675
16690
  children: [
16676
16691
  /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
16677
16692
  const hasSufficient = ingredient.available >= ingredient.required;
16678
- return /* @__PURE__ */ jsxs(React104.Fragment, { children: [
16693
+ return /* @__PURE__ */ jsxs(React105.Fragment, { children: [
16679
16694
  /* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
16680
16695
  ItemSlot,
16681
16696
  {
@@ -16969,8 +16984,8 @@ function DPad({
16969
16984
  }) {
16970
16985
  const eventBus = useEventBus();
16971
16986
  const sizes = sizeMap15[size];
16972
- const [activeDirections, setActiveDirections] = React104.useState(/* @__PURE__ */ new Set());
16973
- const handlePress = React104.useCallback(
16987
+ const [activeDirections, setActiveDirections] = React105.useState(/* @__PURE__ */ new Set());
16988
+ const handlePress = React105.useCallback(
16974
16989
  (direction) => {
16975
16990
  setActiveDirections((prev) => new Set(prev).add(direction));
16976
16991
  if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
@@ -16978,7 +16993,7 @@ function DPad({
16978
16993
  },
16979
16994
  [directionEvent, eventBus, onDirection]
16980
16995
  );
16981
- const handleRelease = React104.useCallback(
16996
+ const handleRelease = React105.useCallback(
16982
16997
  (direction) => {
16983
16998
  setActiveDirections((prev) => {
16984
16999
  const next = new Set(prev);
@@ -17096,6 +17111,19 @@ var init_DashboardGrid = __esm({
17096
17111
  DashboardGrid.displayName = "DashboardGrid";
17097
17112
  }
17098
17113
  });
17114
+ var CurrentPagePathContext, CurrentPagePathProvider, useCurrentPagePath;
17115
+ var init_CurrentPagePathContext = __esm({
17116
+ "context/CurrentPagePathContext.tsx"() {
17117
+ "use client";
17118
+ CurrentPagePathContext = createContext(void 0);
17119
+ CurrentPagePathProvider = ({
17120
+ value,
17121
+ children
17122
+ }) => /* @__PURE__ */ jsx(CurrentPagePathContext.Provider, { value, children });
17123
+ CurrentPagePathProvider.displayName = "CurrentPagePathProvider";
17124
+ useCurrentPagePath = () => useContext(CurrentPagePathContext);
17125
+ }
17126
+ });
17099
17127
  var DashboardLayout, NavLink;
17100
17128
  var init_DashboardLayout = __esm({
17101
17129
  "components/templates/DashboardLayout.tsx"() {
@@ -17109,6 +17137,7 @@ var init_DashboardLayout = __esm({
17109
17137
  init_useAuthContext();
17110
17138
  init_useEventBus();
17111
17139
  init_useTranslate();
17140
+ init_CurrentPagePathContext();
17112
17141
  DashboardLayout = ({
17113
17142
  appName = "{{APP_TITLE}}",
17114
17143
  logo,
@@ -17125,6 +17154,7 @@ var init_DashboardLayout = __esm({
17125
17154
  showThemeToggle = true,
17126
17155
  sidebarFooter,
17127
17156
  onSignOut: onSignOutProp,
17157
+ currentPath,
17128
17158
  children
17129
17159
  }) => {
17130
17160
  const eventBus = useEventBus();
@@ -17145,259 +17175,271 @@ var init_DashboardLayout = __esm({
17145
17175
  const [sidebarOpen, setSidebarOpen] = useState(false);
17146
17176
  const [userMenuOpen, setUserMenuOpen] = useState(false);
17147
17177
  const location = useLocation();
17178
+ const ctxPagePath = useCurrentPagePath();
17179
+ const activePath = currentPath ?? ctxPagePath ?? location.pathname;
17148
17180
  const { signOut: authSignOut } = useAuthContext();
17149
17181
  const user = userProp || (null);
17150
17182
  const { t } = useTranslate();
17151
17183
  const handleSignOut = onSignOutProp || authSignOut;
17152
- return /* @__PURE__ */ jsxs(Box, { className: "min-h-screen bg-background dark:bg-background", children: [
17153
- sidebarOpen && /* @__PURE__ */ jsx(
17154
- Box,
17155
- {
17156
- className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 lg:hidden",
17157
- onClick: () => setSidebarOpen(false)
17158
- }
17159
- ),
17160
- /* @__PURE__ */ jsxs(
17161
- Box,
17162
- {
17163
- as: "aside",
17164
- className: cn(
17165
- "fixed inset-y-0 left-0 z-30 w-64 bg-card dark:bg-card border-r border-border dark:border-border",
17166
- "transform transition-transform duration-200 ease-in-out lg:translate-x-0",
17167
- sidebarOpen ? "translate-x-0" : "-translate-x-full"
17184
+ return /* @__PURE__ */ jsxs(
17185
+ HStack,
17186
+ {
17187
+ gap: "none",
17188
+ className: "min-h-screen w-full bg-background dark:bg-background items-stretch",
17189
+ children: [
17190
+ sidebarOpen && /* @__PURE__ */ jsx(
17191
+ Box,
17192
+ {
17193
+ className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 lg:hidden",
17194
+ onClick: () => setSidebarOpen(false)
17195
+ }
17168
17196
  ),
17169
- children: [
17170
- /* @__PURE__ */ jsxs(
17171
- HStack,
17172
- {
17173
- align: "center",
17174
- justify: "between",
17175
- className: "h-16 px-4 border-b border-border dark:border-border",
17176
- children: [
17177
- /* @__PURE__ */ jsxs(Link, { to: "/", className: "flex items-center gap-2", children: [
17178
- logo || /* @__PURE__ */ jsx(Box, { className: "w-8 h-8 bg-primary-600 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx(
17179
- Typography,
17180
- {
17181
- variant: "small",
17182
- className: "text-white font-bold text-sm",
17183
- as: "span",
17184
- children: appName.charAt(0).toUpperCase()
17185
- }
17186
- ) }),
17187
- /* @__PURE__ */ jsx(
17188
- Typography,
17189
- {
17190
- variant: "label",
17191
- className: "font-semibold text-foreground dark:text-foreground",
17192
- as: "span",
17193
- children: appName
17194
- }
17195
- )
17196
- ] }),
17197
- /* @__PURE__ */ jsx(
17198
- Button,
17199
- {
17200
- variant: "ghost",
17201
- className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
17202
- onClick: () => setSidebarOpen(false),
17203
- children: /* @__PURE__ */ jsx(X, { className: "h-5 w-5" })
17204
- }
17205
- )
17206
- ]
17207
- }
17208
- ),
17209
- /* @__PURE__ */ jsx(
17210
- VStack,
17211
- {
17212
- as: "nav",
17213
- gap: "none",
17214
- className: "flex-1 px-3 py-4 space-y-1 overflow-y-auto",
17215
- children: navItems.map((item) => /* @__PURE__ */ jsx(
17216
- NavLink,
17197
+ /* @__PURE__ */ jsxs(
17198
+ Box,
17199
+ {
17200
+ as: "aside",
17201
+ className: cn(
17202
+ "z-30 w-64 flex-shrink-0 bg-card dark:bg-card border-r border-border dark:border-border",
17203
+ "fixed inset-y-0 left-0 lg:static lg:translate-x-0 lg:h-auto",
17204
+ "transform transition-transform duration-200 ease-in-out",
17205
+ "flex flex-col",
17206
+ sidebarOpen ? "translate-x-0" : "-translate-x-full"
17207
+ ),
17208
+ children: [
17209
+ /* @__PURE__ */ jsxs(
17210
+ HStack,
17217
17211
  {
17218
- item,
17219
- currentPath: location.pathname
17220
- },
17221
- item.href
17222
- ))
17223
- }
17224
- ),
17225
- sidebarFooter && /* @__PURE__ */ jsx(Box, { className: "p-4 border-t border-border dark:border-border", children: sidebarFooter })
17226
- ]
17227
- }
17228
- ),
17229
- /* @__PURE__ */ jsxs(Box, { className: "lg:pl-64", children: [
17230
- /* @__PURE__ */ jsx(
17231
- Box,
17232
- {
17233
- as: "header",
17234
- className: "sticky top-0 z-20 h-16 bg-card dark:bg-card border-b border-border dark:border-border",
17235
- children: /* @__PURE__ */ jsxs(
17236
- HStack,
17237
- {
17238
- align: "center",
17239
- justify: "between",
17240
- className: "h-full px-4 gap-4",
17241
- children: [
17242
- /* @__PURE__ */ jsx(
17243
- Button,
17244
- {
17245
- variant: "ghost",
17246
- className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground touch-manipulation min-h-[44px] min-w-[44px] flex items-center justify-center",
17247
- onClick: () => setSidebarOpen(true),
17248
- "aria-label": "Open sidebar",
17249
- children: /* @__PURE__ */ jsx(Menu$1, { className: "h-5 w-5" })
17250
- }
17251
- ),
17252
- searchEnabled && /* @__PURE__ */ jsx(Box, { className: "hidden sm:block flex-1 max-w-md", children: /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
17253
- /* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground dark:text-muted-foreground" }),
17254
- /* @__PURE__ */ jsx(
17255
- Input,
17256
- {
17257
- type: "search",
17258
- placeholder: t("common.search"),
17259
- className: "pl-10 w-full",
17260
- onKeyDown: (e) => {
17261
- if (e.key === "Enter") {
17262
- handleSearchSubmit(e.target.value);
17212
+ align: "center",
17213
+ justify: "between",
17214
+ className: "h-16 px-4 border-b border-border dark:border-border",
17215
+ children: [
17216
+ /* @__PURE__ */ jsxs(Link, { to: "/", className: "flex items-center gap-2", children: [
17217
+ logo || /* @__PURE__ */ jsx(Box, { className: "w-8 h-8 bg-primary-600 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx(
17218
+ Typography,
17219
+ {
17220
+ variant: "small",
17221
+ className: "text-white font-bold text-sm",
17222
+ as: "span",
17223
+ children: appName.charAt(0).toUpperCase()
17263
17224
  }
17225
+ ) }),
17226
+ /* @__PURE__ */ jsx(
17227
+ Typography,
17228
+ {
17229
+ variant: "label",
17230
+ className: "font-semibold text-foreground dark:text-foreground",
17231
+ as: "span",
17232
+ children: appName
17233
+ }
17234
+ )
17235
+ ] }),
17236
+ /* @__PURE__ */ jsx(
17237
+ Button,
17238
+ {
17239
+ variant: "ghost",
17240
+ className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
17241
+ onClick: () => setSidebarOpen(false),
17242
+ children: /* @__PURE__ */ jsx(X, { className: "h-5 w-5" })
17264
17243
  }
17265
- }
17266
- )
17267
- ] }) }),
17268
- /* @__PURE__ */ jsxs(HStack, { align: "center", gap: "xs", children: [
17269
- headerActions,
17270
- showThemeToggle && /* @__PURE__ */ jsx(ThemeToggle, {}),
17271
- topBarActions.map((action, idx) => /* @__PURE__ */ jsxs(
17272
- Button,
17244
+ )
17245
+ ]
17246
+ }
17247
+ ),
17248
+ /* @__PURE__ */ jsx(
17249
+ VStack,
17250
+ {
17251
+ as: "nav",
17252
+ gap: "none",
17253
+ className: "flex-1 px-3 py-4 space-y-1 overflow-y-auto",
17254
+ children: navItems.map((item) => /* @__PURE__ */ jsx(
17255
+ NavLink,
17273
17256
  {
17274
- variant: "ghost",
17275
- className: "relative p-2 rounded-full hover:bg-muted dark:hover:bg-muted",
17276
- onClick: () => handleTopBarActionClick(action.event),
17277
- "aria-label": action.label ?? action.icon,
17278
- children: [
17279
- /* @__PURE__ */ jsx(Icon, { name: action.icon, className: "h-5 w-5 text-muted-foreground dark:text-muted-foreground" }),
17280
- action.badge !== void 0 && action.badge !== null && action.badge !== 0 && action.badge !== "" && /* @__PURE__ */ jsx(
17281
- Box,
17282
- {
17283
- as: "span",
17284
- className: cn(
17285
- "absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] px-1 rounded-full text-[10px] font-semibold text-white flex items-center justify-center",
17286
- action.variant === "danger" ? "bg-error" : action.variant === "primary" ? "bg-primary" : "bg-foreground"
17287
- ),
17288
- children: action.badge
17289
- }
17290
- )
17291
- ]
17257
+ item,
17258
+ currentPath: activePath
17292
17259
  },
17293
- `${action.event}-${idx}`
17294
- )),
17295
- notificationsEnabled && /* @__PURE__ */ jsxs(
17296
- Button,
17297
- {
17298
- variant: "ghost",
17299
- className: "relative p-2 rounded-full hover:bg-muted dark:hover:bg-muted",
17300
- onClick: handleNotificationClick,
17301
- "aria-label": t("common.notifications"),
17302
- children: [
17303
- /* @__PURE__ */ jsx(Bell, { className: "h-5 w-5 text-muted-foreground dark:text-muted-foreground" }),
17304
- unreadCount > 0 && /* @__PURE__ */ jsx(
17305
- Box,
17306
- {
17307
- as: "span",
17308
- className: "absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] px-1 bg-error rounded-full text-[10px] font-semibold text-white flex items-center justify-center",
17309
- children: unreadCount > 99 ? "99+" : unreadCount
17310
- }
17311
- )
17312
- ]
17313
- }
17314
- ),
17315
- user && /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
17316
- /* @__PURE__ */ jsxs(
17260
+ item.href
17261
+ ))
17262
+ }
17263
+ ),
17264
+ sidebarFooter && /* @__PURE__ */ jsx(Box, { className: "p-4 border-t border-border dark:border-border", children: sidebarFooter })
17265
+ ]
17266
+ }
17267
+ ),
17268
+ /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "flex-1 min-w-0 min-h-screen", children: [
17269
+ /* @__PURE__ */ jsx(
17270
+ Box,
17271
+ {
17272
+ as: "header",
17273
+ className: "sticky top-0 z-20 h-16 bg-card dark:bg-card border-b border-border dark:border-border",
17274
+ children: /* @__PURE__ */ jsxs(
17275
+ HStack,
17276
+ {
17277
+ align: "center",
17278
+ justify: "between",
17279
+ className: "h-full px-3 sm:px-4 gap-2 sm:gap-4",
17280
+ children: [
17281
+ /* @__PURE__ */ jsx(
17317
17282
  Button,
17318
17283
  {
17319
17284
  variant: "ghost",
17320
- className: "flex items-center gap-2 p-2 rounded-lg hover:bg-muted dark:hover:bg-muted",
17321
- onClick: () => setUserMenuOpen(!userMenuOpen),
17322
- children: [
17323
- /* @__PURE__ */ jsx(
17324
- Avatar,
17325
- {
17326
- src: user.avatar,
17327
- alt: user.name,
17328
- initials: user.name.split(" ").map((n) => n[0]).join("").substring(0, 2),
17329
- size: "sm"
17330
- }
17331
- ),
17332
- /* @__PURE__ */ jsx(
17333
- Typography,
17334
- {
17335
- variant: "small",
17336
- className: "hidden sm:block text-sm font-medium text-foreground dark:text-foreground",
17337
- as: "span",
17338
- children: user.name
17339
- }
17340
- ),
17341
- /* @__PURE__ */ jsx(ChevronDown, { className: "hidden sm:block h-4 w-4 text-muted-foreground dark:text-muted-foreground" })
17342
- ]
17285
+ className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground touch-manipulation min-h-[44px] min-w-[44px] flex items-center justify-center",
17286
+ onClick: () => setSidebarOpen(true),
17287
+ "aria-label": "Open sidebar",
17288
+ children: /* @__PURE__ */ jsx(Menu$1, { className: "h-5 w-5" })
17343
17289
  }
17344
17290
  ),
17345
- userMenuOpen && /* @__PURE__ */ jsxs(Fragment, { children: [
17291
+ searchEnabled && /* @__PURE__ */ jsx(Box, { className: "hidden sm:block flex-1 min-w-0 xl:max-w-md", children: /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
17292
+ /* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground dark:text-muted-foreground" }),
17346
17293
  /* @__PURE__ */ jsx(
17347
- Box,
17294
+ Input,
17295
+ {
17296
+ type: "search",
17297
+ placeholder: t("common.search"),
17298
+ className: "pl-10 w-full",
17299
+ onKeyDown: (e) => {
17300
+ if (e.key === "Enter") {
17301
+ handleSearchSubmit(e.target.value);
17302
+ }
17303
+ }
17304
+ }
17305
+ )
17306
+ ] }) }),
17307
+ !searchEnabled && /* @__PURE__ */ jsx(Box, { className: "flex-1" }),
17308
+ /* @__PURE__ */ jsxs(HStack, { align: "center", gap: "xs", children: [
17309
+ headerActions,
17310
+ showThemeToggle && /* @__PURE__ */ jsx(ThemeToggle, {}),
17311
+ topBarActions.map((action, idx) => /* @__PURE__ */ jsxs(
17312
+ Button,
17313
+ {
17314
+ variant: "ghost",
17315
+ className: "relative p-2 rounded-full hover:bg-muted dark:hover:bg-muted",
17316
+ onClick: () => handleTopBarActionClick(action.event),
17317
+ "aria-label": action.label ?? action.icon,
17318
+ children: [
17319
+ /* @__PURE__ */ jsx(Icon, { name: action.icon, className: "h-5 w-5 text-muted-foreground dark:text-muted-foreground" }),
17320
+ action.badge !== void 0 && action.badge !== null && action.badge !== 0 && action.badge !== "" && /* @__PURE__ */ jsx(
17321
+ Box,
17322
+ {
17323
+ as: "span",
17324
+ className: cn(
17325
+ "absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] px-1 rounded-full text-[10px] font-semibold text-white flex items-center justify-center",
17326
+ action.variant === "danger" ? "bg-error" : action.variant === "primary" ? "bg-primary" : "bg-foreground"
17327
+ ),
17328
+ children: action.badge
17329
+ }
17330
+ )
17331
+ ]
17332
+ },
17333
+ `${action.event}-${idx}`
17334
+ )),
17335
+ notificationsEnabled && /* @__PURE__ */ jsxs(
17336
+ Button,
17348
17337
  {
17349
- className: "fixed inset-0 z-20",
17350
- onClick: () => setUserMenuOpen(false)
17338
+ variant: "ghost",
17339
+ className: "relative p-2 rounded-full hover:bg-muted dark:hover:bg-muted",
17340
+ onClick: handleNotificationClick,
17341
+ "aria-label": t("common.notifications"),
17342
+ children: [
17343
+ /* @__PURE__ */ jsx(Bell, { className: "h-5 w-5 text-muted-foreground dark:text-muted-foreground" }),
17344
+ unreadCount > 0 && /* @__PURE__ */ jsx(
17345
+ Box,
17346
+ {
17347
+ as: "span",
17348
+ className: "absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] px-1 bg-error rounded-full text-[10px] font-semibold text-white flex items-center justify-center",
17349
+ children: unreadCount > 99 ? "99+" : unreadCount
17350
+ }
17351
+ )
17352
+ ]
17351
17353
  }
17352
17354
  ),
17353
- /* @__PURE__ */ jsxs(Box, { className: "absolute right-0 mt-2 w-48 bg-card dark:bg-card rounded-lg shadow-lg border border-border dark:border-border py-1 z-30", children: [
17354
- /* @__PURE__ */ jsxs(Box, { className: "px-4 py-2 border-b border-border dark:border-border", children: [
17355
- /* @__PURE__ */ jsx(
17356
- Typography,
17357
- {
17358
- variant: "small",
17359
- className: "text-sm font-medium text-foreground dark:text-foreground",
17360
- as: "p",
17361
- children: user.name
17362
- }
17363
- ),
17364
- /* @__PURE__ */ jsx(
17365
- Typography,
17366
- {
17367
- variant: "caption",
17368
- className: "text-xs text-muted-foreground dark:text-muted-foreground",
17369
- as: "p",
17370
- children: user.email
17371
- }
17372
- )
17373
- ] }),
17355
+ user && /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
17374
17356
  /* @__PURE__ */ jsxs(
17375
17357
  Button,
17376
17358
  {
17377
17359
  variant: "ghost",
17378
- onClick: () => {
17379
- setUserMenuOpen(false);
17380
- handleSignOut?.();
17381
- },
17382
- className: "w-full flex items-center gap-2 px-4 py-2 text-sm text-error dark:text-error hover:bg-error/10 dark:hover:bg-error/20",
17360
+ className: "flex items-center gap-2 p-2 rounded-lg hover:bg-muted dark:hover:bg-muted",
17361
+ onClick: () => setUserMenuOpen(!userMenuOpen),
17383
17362
  children: [
17384
- /* @__PURE__ */ jsx(LogOut, { className: "h-4 w-4" }),
17385
- t("auth.signOut")
17363
+ /* @__PURE__ */ jsx(
17364
+ Avatar,
17365
+ {
17366
+ src: user.avatar,
17367
+ alt: user.name,
17368
+ initials: user.name.split(" ").map((n) => n[0]).join("").substring(0, 2),
17369
+ size: "sm"
17370
+ }
17371
+ ),
17372
+ /* @__PURE__ */ jsx(
17373
+ Typography,
17374
+ {
17375
+ variant: "small",
17376
+ className: "hidden sm:block text-sm font-medium text-foreground dark:text-foreground",
17377
+ as: "span",
17378
+ children: user.name
17379
+ }
17380
+ ),
17381
+ /* @__PURE__ */ jsx(ChevronDown, { className: "hidden sm:block h-4 w-4 text-muted-foreground dark:text-muted-foreground" })
17386
17382
  ]
17387
17383
  }
17388
- )
17384
+ ),
17385
+ userMenuOpen && /* @__PURE__ */ jsxs(Fragment, { children: [
17386
+ /* @__PURE__ */ jsx(
17387
+ Box,
17388
+ {
17389
+ className: "fixed inset-0 z-20",
17390
+ onClick: () => setUserMenuOpen(false)
17391
+ }
17392
+ ),
17393
+ /* @__PURE__ */ jsxs(Box, { className: "absolute right-0 mt-2 w-48 bg-card dark:bg-card rounded-lg shadow-lg border border-border dark:border-border py-1 z-30", children: [
17394
+ /* @__PURE__ */ jsxs(Box, { className: "px-4 py-2 border-b border-border dark:border-border", children: [
17395
+ /* @__PURE__ */ jsx(
17396
+ Typography,
17397
+ {
17398
+ variant: "small",
17399
+ className: "text-sm font-medium text-foreground dark:text-foreground",
17400
+ as: "p",
17401
+ children: user.name
17402
+ }
17403
+ ),
17404
+ /* @__PURE__ */ jsx(
17405
+ Typography,
17406
+ {
17407
+ variant: "caption",
17408
+ className: "text-xs text-muted-foreground dark:text-muted-foreground",
17409
+ as: "p",
17410
+ children: user.email
17411
+ }
17412
+ )
17413
+ ] }),
17414
+ /* @__PURE__ */ jsxs(
17415
+ Button,
17416
+ {
17417
+ variant: "ghost",
17418
+ onClick: () => {
17419
+ setUserMenuOpen(false);
17420
+ handleSignOut?.();
17421
+ },
17422
+ className: "w-full flex items-center gap-2 px-4 py-2 text-sm text-error dark:text-error hover:bg-error/10 dark:hover:bg-error/20",
17423
+ children: [
17424
+ /* @__PURE__ */ jsx(LogOut, { className: "h-4 w-4" }),
17425
+ t("auth.signOut")
17426
+ ]
17427
+ }
17428
+ )
17429
+ ] })
17430
+ ] })
17389
17431
  ] })
17390
17432
  ] })
17391
- ] })
17392
- ] })
17393
- ]
17433
+ ]
17434
+ }
17435
+ )
17394
17436
  }
17395
- )
17396
- }
17397
- ),
17398
- /* @__PURE__ */ jsx(Box, { as: "main", className: "p-4 sm:p-6", children })
17399
- ] })
17400
- ] });
17437
+ ),
17438
+ /* @__PURE__ */ jsx(Box, { as: "main", className: "flex-1 p-3 sm:p-4 md:p-6", children })
17439
+ ] })
17440
+ ]
17441
+ }
17442
+ );
17401
17443
  };
17402
17444
  DashboardLayout.displayName = "DashboardLayout";
17403
17445
  NavLink = ({
@@ -17891,13 +17933,13 @@ function DataList({
17891
17933
  }) {
17892
17934
  const eventBus = useEventBus();
17893
17935
  const { t } = useTranslate();
17894
- const [visibleCount, setVisibleCount] = React104__default.useState(pageSize || Infinity);
17936
+ const [visibleCount, setVisibleCount] = React105__default.useState(pageSize || Infinity);
17895
17937
  const fieldDefs = fields ?? columns ?? [];
17896
17938
  const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
17897
17939
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
17898
17940
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
17899
17941
  const hasRenderProp = typeof children === "function";
17900
- React104__default.useEffect(() => {
17942
+ React105__default.useEffect(() => {
17901
17943
  const renderItemTypeOf = typeof schemaRenderItem;
17902
17944
  const childrenTypeOf = typeof children;
17903
17945
  if (data.length > 0 && !hasRenderProp) {
@@ -17953,7 +17995,7 @@ function DataList({
17953
17995
  const items2 = data.map((item) => item);
17954
17996
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
17955
17997
  const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
17956
- return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
17998
+ return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
17957
17999
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
17958
18000
  group.items.map((itemData, index) => {
17959
18001
  const id = itemData.id || `${gi}-${index}`;
@@ -18144,7 +18186,7 @@ function DataList({
18144
18186
  className
18145
18187
  ),
18146
18188
  children: [
18147
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
18189
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
18148
18190
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
18149
18191
  group.items.map(
18150
18192
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -19227,7 +19269,7 @@ var init_WizardProgress = __esm({
19227
19269
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
19228
19270
  const isActive = index === currentStep;
19229
19271
  const isCompleted = index < currentStep;
19230
- return /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
19272
+ return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
19231
19273
  /* @__PURE__ */ jsx(
19232
19274
  "button",
19233
19275
  {
@@ -20138,7 +20180,7 @@ function InventoryGrid({
20138
20180
  const eventBus = useEventBus();
20139
20181
  const slotCount = totalSlots ?? items.length;
20140
20182
  const emptySlotCount = Math.max(0, slotCount - items.length);
20141
- const handleSelect = React104.useCallback(
20183
+ const handleSelect = React105.useCallback(
20142
20184
  (id) => {
20143
20185
  onSelect?.(id);
20144
20186
  if (selectEvent) {
@@ -20351,15 +20393,15 @@ function GameCanvas2D({
20351
20393
  fps = 60,
20352
20394
  className
20353
20395
  }) {
20354
- const canvasRef = React104.useRef(null);
20355
- const rafRef = React104.useRef(0);
20356
- const frameRef = React104.useRef(0);
20357
- const lastTimeRef = React104.useRef(0);
20358
- const onDrawRef = React104.useRef(onDraw);
20396
+ const canvasRef = React105.useRef(null);
20397
+ const rafRef = React105.useRef(0);
20398
+ const frameRef = React105.useRef(0);
20399
+ const lastTimeRef = React105.useRef(0);
20400
+ const onDrawRef = React105.useRef(onDraw);
20359
20401
  onDrawRef.current = onDraw;
20360
- const onTickRef = React104.useRef(onTick);
20402
+ const onTickRef = React105.useRef(onTick);
20361
20403
  onTickRef.current = onTick;
20362
- React104.useEffect(() => {
20404
+ React105.useEffect(() => {
20363
20405
  const canvas = canvasRef.current;
20364
20406
  if (!canvas) return;
20365
20407
  const ctx = canvas.getContext("2d");
@@ -20648,7 +20690,7 @@ function TurnPanel({
20648
20690
  className
20649
20691
  }) {
20650
20692
  const eventBus = useEventBus();
20651
- const handleAction = React104.useCallback(
20693
+ const handleAction = React105.useCallback(
20652
20694
  (event) => {
20653
20695
  if (event) {
20654
20696
  eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
@@ -20794,7 +20836,7 @@ function UnitCommandBar({
20794
20836
  className
20795
20837
  }) {
20796
20838
  const eventBus = useEventBus();
20797
- const handleCommand = React104.useCallback(
20839
+ const handleCommand = React105.useCallback(
20798
20840
  (event) => {
20799
20841
  if (event) {
20800
20842
  eventBus.emit(event, { unitId: selectedUnitId });
@@ -21279,7 +21321,7 @@ function GameMenu({
21279
21321
  } catch {
21280
21322
  }
21281
21323
  const eventBus = eventBusProp || eventBusFromHook;
21282
- const handleOptionClick = React104.useCallback(
21324
+ const handleOptionClick = React105.useCallback(
21283
21325
  (option) => {
21284
21326
  if (option.event && eventBus) {
21285
21327
  eventBus.emit(`UI:${option.event}`, { option });
@@ -21393,7 +21435,7 @@ function GameOverScreen({
21393
21435
  } catch {
21394
21436
  }
21395
21437
  const eventBus = eventBusProp || eventBusFromHook;
21396
- const handleActionClick = React104.useCallback(
21438
+ const handleActionClick = React105.useCallback(
21397
21439
  (action) => {
21398
21440
  if (action.event && eventBus) {
21399
21441
  eventBus.emit(`UI:${action.event}`, { action });
@@ -24744,7 +24786,7 @@ var init_DocumentViewer = __esm({
24744
24786
  }
24745
24787
  });
24746
24788
  function extractTitle(children) {
24747
- if (!React104__default.isValidElement(children)) return void 0;
24789
+ if (!React105__default.isValidElement(children)) return void 0;
24748
24790
  const props = children.props;
24749
24791
  if (typeof props.title === "string") {
24750
24792
  return props.title;
@@ -24799,7 +24841,7 @@ function LinearView({
24799
24841
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
24800
24842
  const isDone = i < currentIdx;
24801
24843
  const isCurrent = i === currentIdx;
24802
- return /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
24844
+ return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
24803
24845
  i > 0 && /* @__PURE__ */ jsx(
24804
24846
  Typography,
24805
24847
  {
@@ -25583,12 +25625,12 @@ var init_Form = __esm({
25583
25625
  const isSchemaEntity = isOrbitalEntitySchema(entity);
25584
25626
  const resolvedEntity = isSchemaEntity ? entity : void 0;
25585
25627
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
25586
- const normalizedInitialData = React104__default.useMemo(() => {
25628
+ const normalizedInitialData = React105__default.useMemo(() => {
25587
25629
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
25588
25630
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
25589
25631
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
25590
25632
  }, [entity, initialData]);
25591
- const entityDerivedFields = React104__default.useMemo(() => {
25633
+ const entityDerivedFields = React105__default.useMemo(() => {
25592
25634
  if (fields && fields.length > 0) return void 0;
25593
25635
  if (!resolvedEntity) return void 0;
25594
25636
  return resolvedEntity.fields.map(
@@ -25607,16 +25649,16 @@ var init_Form = __esm({
25607
25649
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
25608
25650
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
25609
25651
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
25610
- const [formData, setFormData] = React104__default.useState(
25652
+ const [formData, setFormData] = React105__default.useState(
25611
25653
  normalizedInitialData
25612
25654
  );
25613
- const [collapsedSections, setCollapsedSections] = React104__default.useState(
25655
+ const [collapsedSections, setCollapsedSections] = React105__default.useState(
25614
25656
  /* @__PURE__ */ new Set()
25615
25657
  );
25616
- const [submitError, setSubmitError] = React104__default.useState(null);
25617
- const formRef = React104__default.useRef(null);
25658
+ const [submitError, setSubmitError] = React105__default.useState(null);
25659
+ const formRef = React105__default.useRef(null);
25618
25660
  const formMode = props.mode;
25619
- const mountedRef = React104__default.useRef(false);
25661
+ const mountedRef = React105__default.useRef(false);
25620
25662
  if (!mountedRef.current) {
25621
25663
  mountedRef.current = true;
25622
25664
  debug("forms", "mount", {
@@ -25629,7 +25671,7 @@ var init_Form = __esm({
25629
25671
  });
25630
25672
  }
25631
25673
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
25632
- const evalContext = React104__default.useMemo(
25674
+ const evalContext = React105__default.useMemo(
25633
25675
  () => ({
25634
25676
  formValues: formData,
25635
25677
  globalVariables: externalContext?.globalVariables ?? {},
@@ -25638,7 +25680,7 @@ var init_Form = __esm({
25638
25680
  }),
25639
25681
  [formData, externalContext]
25640
25682
  );
25641
- React104__default.useEffect(() => {
25683
+ React105__default.useEffect(() => {
25642
25684
  debug("forms", "initialData-sync", {
25643
25685
  mode: formMode,
25644
25686
  normalizedInitialData,
@@ -25649,7 +25691,7 @@ var init_Form = __esm({
25649
25691
  setFormData(normalizedInitialData);
25650
25692
  }
25651
25693
  }, [normalizedInitialData]);
25652
- const processCalculations = React104__default.useCallback(
25694
+ const processCalculations = React105__default.useCallback(
25653
25695
  (changedFieldId, newFormData) => {
25654
25696
  if (!hiddenCalculations.length) return;
25655
25697
  const context = {
@@ -25674,7 +25716,7 @@ var init_Form = __esm({
25674
25716
  },
25675
25717
  [hiddenCalculations, externalContext, eventBus]
25676
25718
  );
25677
- const checkViolations = React104__default.useCallback(
25719
+ const checkViolations = React105__default.useCallback(
25678
25720
  (changedFieldId, newFormData) => {
25679
25721
  if (!violationTriggers.length) return;
25680
25722
  const context = {
@@ -25712,7 +25754,7 @@ var init_Form = __esm({
25712
25754
  processCalculations(name, newFormData);
25713
25755
  checkViolations(name, newFormData);
25714
25756
  };
25715
- const isFieldVisible = React104__default.useCallback(
25757
+ const isFieldVisible = React105__default.useCallback(
25716
25758
  (fieldName) => {
25717
25759
  const condition = conditionalFields[fieldName];
25718
25760
  if (!condition) return true;
@@ -25720,7 +25762,7 @@ var init_Form = __esm({
25720
25762
  },
25721
25763
  [conditionalFields, evalContext]
25722
25764
  );
25723
- const isSectionVisible = React104__default.useCallback(
25765
+ const isSectionVisible = React105__default.useCallback(
25724
25766
  (section) => {
25725
25767
  if (!section.condition) return true;
25726
25768
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -25796,7 +25838,7 @@ var init_Form = __esm({
25796
25838
  eventBus.emit(`UI:${onCancel}`);
25797
25839
  }
25798
25840
  };
25799
- const renderField = React104__default.useCallback(
25841
+ const renderField = React105__default.useCallback(
25800
25842
  (field) => {
25801
25843
  const fieldName = field.name || field.field;
25802
25844
  if (!fieldName) return null;
@@ -25817,7 +25859,7 @@ var init_Form = __esm({
25817
25859
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
25818
25860
  );
25819
25861
  const effectiveFields = entityDerivedFields ?? fields;
25820
- const normalizedFields = React104__default.useMemo(() => {
25862
+ const normalizedFields = React105__default.useMemo(() => {
25821
25863
  if (!effectiveFields || effectiveFields.length === 0) return [];
25822
25864
  return effectiveFields.map((field) => {
25823
25865
  if (typeof field === "string") {
@@ -25839,7 +25881,7 @@ var init_Form = __esm({
25839
25881
  return field;
25840
25882
  });
25841
25883
  }, [effectiveFields, resolvedEntity]);
25842
- const schemaFields = React104__default.useMemo(() => {
25884
+ const schemaFields = React105__default.useMemo(() => {
25843
25885
  if (normalizedFields.length === 0) return null;
25844
25886
  if (isDebugEnabled()) {
25845
25887
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -25849,7 +25891,7 @@ var init_Form = __esm({
25849
25891
  }
25850
25892
  return normalizedFields.map(renderField).filter(Boolean);
25851
25893
  }, [normalizedFields, renderField, entityName, conditionalFields]);
25852
- const sectionElements = React104__default.useMemo(() => {
25894
+ const sectionElements = React105__default.useMemo(() => {
25853
25895
  if (!sections || sections.length === 0) return null;
25854
25896
  return sections.map((section) => {
25855
25897
  if (!isSectionVisible(section)) {
@@ -27381,7 +27423,7 @@ var init_List = __esm({
27381
27423
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
27382
27424
  return [];
27383
27425
  }, [entity]);
27384
- const getItemActions = React104__default.useCallback(
27426
+ const getItemActions = React105__default.useCallback(
27385
27427
  (item) => {
27386
27428
  if (!itemActions) return [];
27387
27429
  if (typeof itemActions === "function") {
@@ -27818,7 +27860,7 @@ var init_MediaGallery = __esm({
27818
27860
  [selectable, selectedItems, selectionEvent, eventBus]
27819
27861
  );
27820
27862
  const entityData = Array.isArray(entity) ? entity : [];
27821
- const items = React104__default.useMemo(() => {
27863
+ const items = React105__default.useMemo(() => {
27822
27864
  if (propItems) return propItems;
27823
27865
  if (entityData.length === 0) return [];
27824
27866
  return entityData.map((record, idx) => ({
@@ -27982,7 +28024,7 @@ var init_MediaGallery = __esm({
27982
28024
  }
27983
28025
  });
27984
28026
  function extractTitle2(children) {
27985
- if (!React104__default.isValidElement(children)) return void 0;
28027
+ if (!React105__default.isValidElement(children)) return void 0;
27986
28028
  const props = children.props;
27987
28029
  if (typeof props.title === "string") {
27988
28030
  return props.title;
@@ -28695,7 +28737,7 @@ var init_PageHeader = __esm({
28695
28737
  info: "bg-info/10 text-info"
28696
28738
  };
28697
28739
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
28698
- breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
28740
+ breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
28699
28741
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
28700
28742
  crumb.href ? /* @__PURE__ */ jsx(
28701
28743
  "a",
@@ -28888,7 +28930,7 @@ var init_debugRegistry = __esm({
28888
28930
  }
28889
28931
  });
28890
28932
  function useDebugData() {
28891
- const [data, setData] = React104.useState(() => ({
28933
+ const [data, setData] = React105.useState(() => ({
28892
28934
  traits: [],
28893
28935
  ticks: [],
28894
28936
  guards: [],
@@ -28902,7 +28944,7 @@ function useDebugData() {
28902
28944
  },
28903
28945
  lastUpdate: Date.now()
28904
28946
  }));
28905
- React104.useEffect(() => {
28947
+ React105.useEffect(() => {
28906
28948
  const updateData = () => {
28907
28949
  setData({
28908
28950
  traits: getAllTraits(),
@@ -29011,12 +29053,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
29011
29053
  return positions;
29012
29054
  }
29013
29055
  function WalkMinimap() {
29014
- const [walkStep, setWalkStep] = React104.useState(null);
29015
- const [traits2, setTraits] = React104.useState([]);
29016
- const [coveredEdges, setCoveredEdges] = React104.useState([]);
29017
- const [completedTraits, setCompletedTraits] = React104.useState(/* @__PURE__ */ new Set());
29018
- const prevTraitRef = React104.useRef(null);
29019
- React104.useEffect(() => {
29056
+ const [walkStep, setWalkStep] = React105.useState(null);
29057
+ const [traits2, setTraits] = React105.useState([]);
29058
+ const [coveredEdges, setCoveredEdges] = React105.useState([]);
29059
+ const [completedTraits, setCompletedTraits] = React105.useState(/* @__PURE__ */ new Set());
29060
+ const prevTraitRef = React105.useRef(null);
29061
+ React105.useEffect(() => {
29020
29062
  const interval = setInterval(() => {
29021
29063
  const w = window;
29022
29064
  const step = w.__orbitalWalkStep;
@@ -29463,15 +29505,15 @@ var init_EntitiesTab = __esm({
29463
29505
  }
29464
29506
  });
29465
29507
  function EventFlowTab({ events: events2 }) {
29466
- const [filter, setFilter] = React104.useState("all");
29467
- const containerRef = React104.useRef(null);
29468
- const [autoScroll, setAutoScroll] = React104.useState(true);
29469
- React104.useEffect(() => {
29508
+ const [filter, setFilter] = React105.useState("all");
29509
+ const containerRef = React105.useRef(null);
29510
+ const [autoScroll, setAutoScroll] = React105.useState(true);
29511
+ React105.useEffect(() => {
29470
29512
  if (autoScroll && containerRef.current) {
29471
29513
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
29472
29514
  }
29473
29515
  }, [events2.length, autoScroll]);
29474
- const filteredEvents = React104.useMemo(() => {
29516
+ const filteredEvents = React105.useMemo(() => {
29475
29517
  if (filter === "all") return events2;
29476
29518
  return events2.filter((e) => e.type === filter);
29477
29519
  }, [events2, filter]);
@@ -29590,7 +29632,7 @@ var init_EventFlowTab = __esm({
29590
29632
  }
29591
29633
  });
29592
29634
  function GuardsPanel({ guards }) {
29593
- const [filter, setFilter] = React104.useState("all");
29635
+ const [filter, setFilter] = React105.useState("all");
29594
29636
  if (guards.length === 0) {
29595
29637
  return /* @__PURE__ */ jsx(
29596
29638
  EmptyState,
@@ -29603,7 +29645,7 @@ function GuardsPanel({ guards }) {
29603
29645
  }
29604
29646
  const passedCount = guards.filter((g) => g.result).length;
29605
29647
  const failedCount = guards.length - passedCount;
29606
- const filteredGuards = React104.useMemo(() => {
29648
+ const filteredGuards = React105.useMemo(() => {
29607
29649
  if (filter === "all") return guards;
29608
29650
  if (filter === "passed") return guards.filter((g) => g.result);
29609
29651
  return guards.filter((g) => !g.result);
@@ -29764,10 +29806,10 @@ function EffectBadge({ effect }) {
29764
29806
  ] });
29765
29807
  }
29766
29808
  function TransitionTimeline({ transitions }) {
29767
- const containerRef = React104.useRef(null);
29768
- const [autoScroll, setAutoScroll] = React104.useState(true);
29769
- const [expandedId, setExpandedId] = React104.useState(null);
29770
- React104.useEffect(() => {
29809
+ const containerRef = React105.useRef(null);
29810
+ const [autoScroll, setAutoScroll] = React105.useState(true);
29811
+ const [expandedId, setExpandedId] = React105.useState(null);
29812
+ React105.useEffect(() => {
29771
29813
  if (autoScroll && containerRef.current) {
29772
29814
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
29773
29815
  }
@@ -30053,9 +30095,9 @@ function getAllEvents(traits2) {
30053
30095
  }
30054
30096
  function EventDispatcherTab({ traits: traits2, schema }) {
30055
30097
  const eventBus = useEventBus();
30056
- const [log3, setLog] = React104.useState([]);
30057
- const prevStatesRef = React104.useRef(/* @__PURE__ */ new Map());
30058
- React104.useEffect(() => {
30098
+ const [log3, setLog] = React105.useState([]);
30099
+ const prevStatesRef = React105.useRef(/* @__PURE__ */ new Map());
30100
+ React105.useEffect(() => {
30059
30101
  for (const trait of traits2) {
30060
30102
  const prev = prevStatesRef.current.get(trait.id);
30061
30103
  if (prev && prev !== trait.currentState) {
@@ -30225,10 +30267,10 @@ function VerifyModePanel({
30225
30267
  serverCount,
30226
30268
  localCount
30227
30269
  }) {
30228
- const [expanded, setExpanded] = React104.useState(true);
30229
- const scrollRef = React104.useRef(null);
30230
- const prevCountRef = React104.useRef(0);
30231
- React104.useEffect(() => {
30270
+ const [expanded, setExpanded] = React105.useState(true);
30271
+ const scrollRef = React105.useRef(null);
30272
+ const prevCountRef = React105.useRef(0);
30273
+ React105.useEffect(() => {
30232
30274
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
30233
30275
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
30234
30276
  }
@@ -30294,10 +30336,10 @@ function RuntimeDebugger({
30294
30336
  defaultTab,
30295
30337
  schema
30296
30338
  }) {
30297
- const [isCollapsed, setIsCollapsed] = React104.useState(mode === "verify" ? true : defaultCollapsed);
30298
- const [isVisible, setIsVisible] = React104.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
30339
+ const [isCollapsed, setIsCollapsed] = React105.useState(mode === "verify" ? true : defaultCollapsed);
30340
+ const [isVisible, setIsVisible] = React105.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
30299
30341
  const debugData = useDebugData();
30300
- React104.useEffect(() => {
30342
+ React105.useEffect(() => {
30301
30343
  if (mode === "inline") return;
30302
30344
  return onDebugToggle((enabled) => {
30303
30345
  setIsVisible(enabled);
@@ -30306,7 +30348,7 @@ function RuntimeDebugger({
30306
30348
  }
30307
30349
  });
30308
30350
  }, [mode]);
30309
- React104.useEffect(() => {
30351
+ React105.useEffect(() => {
30310
30352
  if (mode === "inline") return;
30311
30353
  const handleKeyDown = (e) => {
30312
30354
  if (e.key === "`" && isVisible) {
@@ -30855,7 +30897,7 @@ function SequenceBar({
30855
30897
  onSlotRemove(index);
30856
30898
  }, [onSlotRemove, playing]);
30857
30899
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
30858
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
30900
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
30859
30901
  i > 0 && /* @__PURE__ */ jsx(
30860
30902
  Typography,
30861
30903
  {
@@ -32200,7 +32242,7 @@ var init_StatCard = __esm({
32200
32242
  const labelToUse = propLabel ?? propTitle;
32201
32243
  const eventBus = useEventBus();
32202
32244
  const { t } = useTranslate();
32203
- const handleActionClick = React104__default.useCallback(() => {
32245
+ const handleActionClick = React105__default.useCallback(() => {
32204
32246
  if (action?.event) {
32205
32247
  eventBus.emit(`UI:${action.event}`, {});
32206
32248
  }
@@ -32211,7 +32253,7 @@ var init_StatCard = __esm({
32211
32253
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
32212
32254
  const isLoading = externalLoading ?? false;
32213
32255
  const error = externalError;
32214
- const computeMetricValue = React104__default.useCallback(
32256
+ const computeMetricValue = React105__default.useCallback(
32215
32257
  (metric, items) => {
32216
32258
  if (metric.value !== void 0) {
32217
32259
  return metric.value;
@@ -32250,7 +32292,7 @@ var init_StatCard = __esm({
32250
32292
  },
32251
32293
  []
32252
32294
  );
32253
- const schemaStats = React104__default.useMemo(() => {
32295
+ const schemaStats = React105__default.useMemo(() => {
32254
32296
  if (!metrics || metrics.length === 0) return null;
32255
32297
  return metrics.map((metric) => ({
32256
32298
  label: metric.label,
@@ -32258,7 +32300,7 @@ var init_StatCard = __esm({
32258
32300
  format: metric.format
32259
32301
  }));
32260
32302
  }, [metrics, data, computeMetricValue]);
32261
- const calculatedTrend = React104__default.useMemo(() => {
32303
+ const calculatedTrend = React105__default.useMemo(() => {
32262
32304
  if (manualTrend !== void 0) return manualTrend;
32263
32305
  if (previousValue === void 0 || currentValue === void 0)
32264
32306
  return void 0;
@@ -33242,7 +33284,7 @@ var init_Timeline = __esm({
33242
33284
  }) => {
33243
33285
  const { t } = useTranslate();
33244
33286
  const entityData = Array.isArray(entity) ? entity : [];
33245
- const items = React104__default.useMemo(() => {
33287
+ const items = React105__default.useMemo(() => {
33246
33288
  if (propItems) return propItems;
33247
33289
  if (entityData.length === 0) return [];
33248
33290
  return entityData.map((record, idx) => {
@@ -33349,7 +33391,7 @@ var init_Timeline = __esm({
33349
33391
  }
33350
33392
  });
33351
33393
  function extractToastProps(children) {
33352
- if (!React104__default.isValidElement(children)) {
33394
+ if (!React105__default.isValidElement(children)) {
33353
33395
  if (typeof children === "string") {
33354
33396
  return { message: children };
33355
33397
  }
@@ -33387,7 +33429,7 @@ var init_ToastSlot = __esm({
33387
33429
  eventBus.emit("UI:CLOSE");
33388
33430
  };
33389
33431
  if (!isVisible) return null;
33390
- const isCustomContent = React104__default.isValidElement(children) && !message;
33432
+ const isCustomContent = React105__default.isValidElement(children) && !message;
33391
33433
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
33392
33434
  Toast,
33393
33435
  {
@@ -33656,7 +33698,7 @@ var init_WizardContainer = __esm({
33656
33698
  const isCompleted = index < currentStep;
33657
33699
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
33658
33700
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
33659
- return /* @__PURE__ */ jsxs(React104__default.Fragment, { children: [
33701
+ return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
33660
33702
  /* @__PURE__ */ jsx(
33661
33703
  Button,
33662
33704
  {
@@ -34038,12 +34080,12 @@ var init_WorldMapTemplate = __esm({
34038
34080
  }
34039
34081
  });
34040
34082
  function lazyThree(name, loader) {
34041
- const Lazy = React104__default.lazy(() => loader().then((m) => ({ default: m[name] })));
34083
+ const Lazy = React105__default.lazy(() => loader().then((m) => ({ default: m[name] })));
34042
34084
  function ThreeWrapper(props) {
34043
- return React104__default.createElement(
34044
- React104__default.Suspense,
34085
+ return React105__default.createElement(
34086
+ React105__default.Suspense,
34045
34087
  { fallback: null },
34046
- React104__default.createElement(Lazy, props)
34088
+ React105__default.createElement(Lazy, props)
34047
34089
  );
34048
34090
  }
34049
34091
  ThreeWrapper.displayName = `Lazy(${name})`;
@@ -34531,7 +34573,7 @@ function SuspenseConfigProvider({
34531
34573
  config,
34532
34574
  children
34533
34575
  }) {
34534
- return React104__default.createElement(
34576
+ return React105__default.createElement(
34535
34577
  SuspenseConfigContext.Provider,
34536
34578
  { value: config },
34537
34579
  children
@@ -35014,7 +35056,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
35014
35056
  const key = `${parentId}-${index}-trait:${traitName}`;
35015
35057
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
35016
35058
  }
35017
- return /* @__PURE__ */ jsx(React104__default.Fragment, { children: child }, `${parentId}-${index}`);
35059
+ return /* @__PURE__ */ jsx(React105__default.Fragment, { children: child }, `${parentId}-${index}`);
35018
35060
  }
35019
35061
  if (!child || typeof child !== "object") return null;
35020
35062
  const childId = `${parentId}-${index}`;
@@ -35051,14 +35093,14 @@ function isPatternConfig(value) {
35051
35093
  if (value === null || value === void 0) return false;
35052
35094
  if (typeof value !== "object") return false;
35053
35095
  if (Array.isArray(value)) return false;
35054
- if (React104__default.isValidElement(value)) return false;
35096
+ if (React105__default.isValidElement(value)) return false;
35055
35097
  if (value instanceof Date) return false;
35056
35098
  if (typeof value === "function") return false;
35057
35099
  const record = value;
35058
35100
  return "type" in record && typeof record.type === "string";
35059
35101
  }
35060
35102
  function isPlainConfigObject(value) {
35061
- if (React104__default.isValidElement(value)) return false;
35103
+ if (React105__default.isValidElement(value)) return false;
35062
35104
  if (value instanceof Date) return false;
35063
35105
  const proto = Object.getPrototypeOf(value);
35064
35106
  return proto === Object.prototype || proto === null;
@@ -35352,7 +35394,7 @@ init_logger();
35352
35394
 
35353
35395
  // runtime/createClientEffectHandlers.ts
35354
35396
  function createClientEffectHandlers(options) {
35355
- const { eventBus, slotSetter, navigate, notify } = options;
35397
+ const { eventBus, slotSetter, navigate, notify, callService } = options;
35356
35398
  return {
35357
35399
  emit: (event, payload) => {
35358
35400
  const prefixedEvent = event.startsWith("UI:") ? event : `UI:${event}`;
@@ -35364,9 +35406,24 @@ function createClientEffectHandlers(options) {
35364
35406
  set: () => {
35365
35407
  console.warn("[ClientEffectHandlers] set is server-side only, ignored on client");
35366
35408
  },
35367
- callService: async () => {
35368
- console.warn("[ClientEffectHandlers] callService is server-side only, ignored on client");
35369
- return {};
35409
+ callService: async (service, action, params) => {
35410
+ if (callService) return callService(service, action, params);
35411
+ const mockId = `mock_${service}_${action}_${Math.random().toString(36).slice(2, 10)}`;
35412
+ const paramsEcho = {};
35413
+ if (params) {
35414
+ for (const [k, v] of Object.entries(params)) {
35415
+ if (v !== void 0 && (typeof v === "string" || typeof v === "number" || typeof v === "boolean" || v === null || v instanceof Date)) {
35416
+ paramsEcho[k] = v;
35417
+ }
35418
+ }
35419
+ }
35420
+ return {
35421
+ id: mockId,
35422
+ clientSecret: `secret_${mockId}`,
35423
+ success: true,
35424
+ status: "succeeded",
35425
+ ...paramsEcho
35426
+ };
35370
35427
  },
35371
35428
  renderUI: (slot, pattern, props) => {
35372
35429
  if (pattern === null) {
@@ -35412,7 +35469,7 @@ function resolveLambdaBindings(body, argName, arg) {
35412
35469
  if (Array.isArray(body)) {
35413
35470
  return body.map((b) => resolveLambdaBindings(b, argName, arg));
35414
35471
  }
35415
- if (body !== null && typeof body === "object" && !React104__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
35472
+ if (body !== null && typeof body === "object" && !React105__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
35416
35473
  const out = {};
35417
35474
  for (const [k, v] of Object.entries(body)) {
35418
35475
  out[k] = resolveLambdaBindings(v, argName, arg);
@@ -35431,7 +35488,7 @@ function getSlotContentRenderer2() {
35431
35488
  function makeLambdaFn(argName, lambdaBody, callerKey) {
35432
35489
  return (item, index) => {
35433
35490
  const resolvedBody = resolveLambdaBindings(lambdaBody, argName, item);
35434
- if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React104__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
35491
+ if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React105__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
35435
35492
  return null;
35436
35493
  }
35437
35494
  const record = resolvedBody;
@@ -35449,7 +35506,7 @@ function makeLambdaFn(argName, lambdaBody, callerKey) {
35449
35506
  props: childProps,
35450
35507
  priority: 0
35451
35508
  };
35452
- return React104__default.createElement(SlotContentRenderer2, { content: childContent });
35509
+ return React105__default.createElement(SlotContentRenderer2, { content: childContent });
35453
35510
  };
35454
35511
  }
35455
35512
  function convertNode(node, callerKey) {
@@ -35468,7 +35525,7 @@ function convertNode(node, callerKey) {
35468
35525
  });
35469
35526
  return anyChanged ? mapped : node;
35470
35527
  }
35471
- if (typeof node === "object" && !React104__default.isValidElement(node) && !(node instanceof Date)) {
35528
+ if (typeof node === "object" && !React105__default.isValidElement(node) && !(node instanceof Date)) {
35472
35529
  return convertObjectProps(node);
35473
35530
  }
35474
35531
  return node;
@@ -35860,7 +35917,8 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
35860
35917
  }
35861
35918
  },
35862
35919
  navigate: optionsRef.current?.navigate,
35863
- notify: optionsRef.current?.notify
35920
+ notify: optionsRef.current?.notify,
35921
+ callService: optionsRef.current?.callService
35864
35922
  });
35865
35923
  const persistence = optionsRef.current?.persistence;
35866
35924
  let handlers = clientHandlers;