@almadar/ui 6.3.0 → 6.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import * as React87 from 'react';
2
- import React87__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
1
+ import * as React89 from 'react';
2
+ import React89__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
3
3
  import { EventBusContext, useTraitScopeChain, RenderSlotProvider, useEntitySchemaOptional, useEntityBindingSnapshot, useTraitScope, TraitScopeProvider, useNavStack, useCurrentPagePath, useRenderSlot, useGameAudioContextOptional, matchPathAmong } from '@almadar/ui/providers';
4
4
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
5
5
  import { createContextFromBindings, interpolateValue } from '@almadar/runtime';
@@ -281,7 +281,7 @@ function resolveMarkerExpression(expression, entity, config, state) {
281
281
  function isPlainObject(value) {
282
282
  if (value === null || value === void 0 || typeof value !== "object") return false;
283
283
  if (Array.isArray(value)) return false;
284
- if (React87__default.isValidElement(value)) return false;
284
+ if (React89__default.isValidElement(value)) return false;
285
285
  if (value instanceof Date) return false;
286
286
  if (typeof value === "function") return false;
287
287
  return true;
@@ -290,7 +290,7 @@ function isEvaluatorResolvedData(value) {
290
290
  return evaluatorResolvedData.has(value);
291
291
  }
292
292
  function brandResolved(value) {
293
- if (value !== null && typeof value === "object" && !React87__default.isValidElement(value) && !(value instanceof Date)) {
293
+ if (value !== null && typeof value === "object" && !React89__default.isValidElement(value) && !(value instanceof Date)) {
294
294
  resolvedMarkerFree.add(value);
295
295
  }
296
296
  }
@@ -323,7 +323,7 @@ function walkValue(value, scopeTrait, entity, config, state) {
323
323
  }
324
324
  const resolved = resolveMarkerExpression(value.expression, entity, config, state);
325
325
  markerResolutionCache.set(value, { entity, config, state, resolved });
326
- if (resolved !== null && typeof resolved === "object" && !React87__default.isValidElement(resolved) && !(resolved instanceof Date)) {
326
+ if (resolved !== null && typeof resolved === "object" && !React89__default.isValidElement(resolved) && !(resolved instanceof Date)) {
327
327
  resolvedMarkerFree.add(resolved);
328
328
  evaluatorResolvedData.add(resolved);
329
329
  }
@@ -557,7 +557,7 @@ var init_Box = __esm({
557
557
  fixed: "fixed",
558
558
  sticky: "sticky"
559
559
  };
560
- Box = React87__default.forwardRef(
560
+ Box = React89__default.forwardRef(
561
561
  ({
562
562
  padding,
563
563
  paddingX,
@@ -622,7 +622,7 @@ var init_Box = __esm({
622
622
  onPointerDown?.(e);
623
623
  }, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
624
624
  const isClickable = action || onClick;
625
- return React87__default.createElement(
625
+ return React89__default.createElement(
626
626
  Component,
627
627
  {
628
628
  ref,
@@ -839,7 +839,7 @@ var init_Icon = __esm({
839
839
  const effectiveName = typeof icon === "string" && icon !== "" ? icon : name;
840
840
  const effectiveStrokeWidth = strokeWidth != null && strokeWidth > 0 ? strokeWidth : void 0;
841
841
  const family = useIconFamily();
842
- const RenderedComponent = React87__default.useMemo(() => {
842
+ const RenderedComponent = React89__default.useMemo(() => {
843
843
  if (directIcon) return null;
844
844
  return effectiveName ? resolveIconForFamily(effectiveName) : null;
845
845
  }, [directIcon, effectiveName, family]);
@@ -968,7 +968,7 @@ var init_atlasSlice = __esm({
968
968
  }
969
969
  });
970
970
  function useAtlasSliceDataUrl(asset) {
971
- const [, bump] = React87.useReducer((x) => x + 1, 0);
971
+ const [, bump] = React89.useReducer((x) => x + 1, 0);
972
972
  if (!isAtlasAsset(asset)) return void 0;
973
973
  const key = `${asset.atlas}#${asset.sprite}`;
974
974
  const cached = sliceDataUrlCache.get(key);
@@ -1031,13 +1031,13 @@ function AtlasImage({
1031
1031
  style,
1032
1032
  "aria-hidden": ariaHidden
1033
1033
  }) {
1034
- const [, bump] = React87.useReducer((x) => x + 1, 0);
1035
- const canvasRef = React87.useRef(null);
1034
+ const [, bump] = React89.useReducer((x) => x + 1, 0);
1035
+ const canvasRef = React89.useRef(null);
1036
1036
  const sliced = isAtlasAsset(asset);
1037
1037
  const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
1038
1038
  const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
1039
1039
  const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
1040
- React87.useEffect(() => {
1040
+ React89.useEffect(() => {
1041
1041
  const canvas = canvasRef.current;
1042
1042
  if (!canvas || !img || !rect) return;
1043
1043
  canvas.width = rect.sw;
@@ -1113,7 +1113,7 @@ function resolveIconProp(value, sizeClass) {
1113
1113
  const IconComp = value;
1114
1114
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
1115
1115
  }
1116
- if (React87__default.isValidElement(value)) {
1116
+ if (React89__default.isValidElement(value)) {
1117
1117
  return value;
1118
1118
  }
1119
1119
  if (typeof value === "object" && value !== null && isIconLike(value)) {
@@ -1190,7 +1190,7 @@ var init_Button = __esm({
1190
1190
  md: "h-icon-default w-icon-default",
1191
1191
  lg: "h-icon-default w-icon-default"
1192
1192
  };
1193
- Button = React87__default.forwardRef(
1193
+ Button = React89__default.forwardRef(
1194
1194
  ({
1195
1195
  className,
1196
1196
  variant = "primary",
@@ -1260,7 +1260,7 @@ var Dialog;
1260
1260
  var init_Dialog = __esm({
1261
1261
  "components/core/atoms/Dialog.tsx"() {
1262
1262
  init_cn();
1263
- Dialog = React87__default.forwardRef(
1263
+ Dialog = React89__default.forwardRef(
1264
1264
  ({
1265
1265
  role = "dialog",
1266
1266
  "aria-modal": ariaModal = true,
@@ -1471,7 +1471,7 @@ var init_Typography = __esm({
1471
1471
  if (format !== void 0 && format !== "none" && (typeof body === "string" || typeof body === "number" || body instanceof Date)) {
1472
1472
  body = formatValue(body, format);
1473
1473
  }
1474
- return React87__default.createElement(
1474
+ return React89__default.createElement(
1475
1475
  Component,
1476
1476
  {
1477
1477
  id,
@@ -1681,7 +1681,6 @@ var init_Modal = __esm({
1681
1681
  ),
1682
1682
  style: { backgroundColor: "rgba(0, 0, 0, 0.6)" },
1683
1683
  onClick: handleOverlayClick,
1684
- "aria-hidden": "true",
1685
1684
  children: /* @__PURE__ */ jsxs(
1686
1685
  Dialog,
1687
1686
  {
@@ -1916,7 +1915,7 @@ var init_Drawer = __esm({
1916
1915
  };
1917
1916
  const widthClass = width in sizeWidths ? sizeWidths[width] : "";
1918
1917
  const widthStyle = width in sizeWidths ? void 0 : { width };
1919
- const positionClasses = position === "right" ? "right-0 border-l" : "left-0 border-r";
1918
+ const positionClasses2 = position === "right" ? "right-0 border-l" : "left-0 border-r";
1920
1919
  const drawerSign = position === "right" ? 1 : -1;
1921
1920
  const slideTransform = position === "right" ? "translateX(100%)" : "translateX(-100%)";
1922
1921
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -1938,7 +1937,7 @@ var init_Drawer = __esm({
1938
1937
  className: cn(
1939
1938
  "fixed top-0 bottom-0 z-50",
1940
1939
  "flex flex-col max-h-screen",
1941
- positionClasses,
1940
+ positionClasses2,
1942
1941
  widthClass,
1943
1942
  drawerAnim,
1944
1943
  className
@@ -2034,7 +2033,7 @@ var init_Badge = __esm({
2034
2033
  md: "px-2.5 py-1 text-sm",
2035
2034
  lg: "px-3 py-1.5 text-base"
2036
2035
  };
2037
- Badge = React87__default.forwardRef(
2036
+ Badge = React89__default.forwardRef(
2038
2037
  ({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
2039
2038
  const iconSizes3 = {
2040
2039
  sm: "h-icon-default w-icon-default",
@@ -2384,7 +2383,7 @@ var init_SvgFlow = __esm({
2384
2383
  width = 100,
2385
2384
  height = 100
2386
2385
  }) => {
2387
- const markerId = React87__default.useMemo(() => {
2386
+ const markerId = React89__default.useMemo(() => {
2388
2387
  flowIdCounter += 1;
2389
2388
  return `almadar-flow-arrow-${flowIdCounter}`;
2390
2389
  }, []);
@@ -2977,7 +2976,7 @@ var init_SvgRing = __esm({
2977
2976
  width = 100,
2978
2977
  height = 100
2979
2978
  }) => {
2980
- const gradientId = React87__default.useMemo(() => {
2979
+ const gradientId = React89__default.useMemo(() => {
2981
2980
  ringIdCounter += 1;
2982
2981
  return `almadar-ring-glow-${ringIdCounter}`;
2983
2982
  }, []);
@@ -3158,7 +3157,7 @@ var init_Input = __esm({
3158
3157
  init_cn();
3159
3158
  init_Icon();
3160
3159
  init_useEventBus();
3161
- Input = React87__default.forwardRef(
3160
+ Input = React89__default.forwardRef(
3162
3161
  ({
3163
3162
  className,
3164
3163
  inputType,
@@ -3182,9 +3181,9 @@ var init_Input = __esm({
3182
3181
  const eventBus = useEventBus();
3183
3182
  const type = inputType || htmlType || "text";
3184
3183
  const isDeclarative = typeof onChange === "string";
3185
- const [localValue, setLocalValue] = React87__default.useState(value);
3186
- const pendingEchoRef = React87__default.useRef(/* @__PURE__ */ new Set());
3187
- React87__default.useEffect(() => {
3184
+ const [localValue, setLocalValue] = React89__default.useState(value);
3185
+ const pendingEchoRef = React89__default.useRef(/* @__PURE__ */ new Set());
3186
+ React89__default.useEffect(() => {
3188
3187
  if (!isDeclarative) return;
3189
3188
  const incoming = value == null ? "" : String(value);
3190
3189
  if (pendingEchoRef.current.has(incoming)) {
@@ -3351,7 +3350,7 @@ var Label;
3351
3350
  var init_Label = __esm({
3352
3351
  "components/core/atoms/Label.tsx"() {
3353
3352
  init_cn();
3354
- Label = React87__default.forwardRef(
3353
+ Label = React89__default.forwardRef(
3355
3354
  ({ className, required, children, ...props }, ref) => {
3356
3355
  return /* @__PURE__ */ jsxs(
3357
3356
  "label",
@@ -3378,7 +3377,7 @@ var init_Textarea = __esm({
3378
3377
  "components/core/atoms/Textarea.tsx"() {
3379
3378
  init_cn();
3380
3379
  init_useEventBus();
3381
- Textarea = React87__default.forwardRef(
3380
+ Textarea = React89__default.forwardRef(
3382
3381
  ({ className, error, onChange, ...props }, ref) => {
3383
3382
  const eventBus = useEventBus();
3384
3383
  const handleChange = (e) => {
@@ -3628,7 +3627,7 @@ var init_Select = __esm({
3628
3627
  init_cn();
3629
3628
  init_Icon();
3630
3629
  init_useEventBus();
3631
- Select = React87__default.forwardRef(
3630
+ Select = React89__default.forwardRef(
3632
3631
  (props, _ref) => {
3633
3632
  const { multiple, searchable, clearable } = props;
3634
3633
  if (multiple || searchable || clearable) {
@@ -3645,7 +3644,7 @@ var init_Checkbox = __esm({
3645
3644
  "components/core/atoms/Checkbox.tsx"() {
3646
3645
  init_cn();
3647
3646
  init_useEventBus();
3648
- Checkbox = React87__default.forwardRef(
3647
+ Checkbox = React89__default.forwardRef(
3649
3648
  ({ className, label, id, onChange, ...props }, ref) => {
3650
3649
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
3651
3650
  const eventBus = useEventBus();
@@ -3699,7 +3698,7 @@ var init_Spinner = __esm({
3699
3698
  md: "h-6 w-6",
3700
3699
  lg: "h-8 w-8"
3701
3700
  };
3702
- Spinner = React87__default.forwardRef(
3701
+ Spinner = React89__default.forwardRef(
3703
3702
  ({ className, size = "md", overlay, ...props }, ref) => {
3704
3703
  if (overlay) {
3705
3704
  return /* @__PURE__ */ jsx(
@@ -3789,7 +3788,7 @@ var init_Card = __esm({
3789
3788
  chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
3790
3789
  "tile-image-first": "p-0 overflow-hidden"
3791
3790
  };
3792
- Card = React87__default.forwardRef(
3791
+ Card = React89__default.forwardRef(
3793
3792
  ({
3794
3793
  className,
3795
3794
  variant = "bordered",
@@ -3838,9 +3837,9 @@ var init_Card = __esm({
3838
3837
  }
3839
3838
  );
3840
3839
  Card.displayName = "Card";
3841
- CardHeader = React87__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
3840
+ CardHeader = React89__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
3842
3841
  CardHeader.displayName = "CardHeader";
3843
- CardTitle = React87__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3842
+ CardTitle = React89__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3844
3843
  "h3",
3845
3844
  {
3846
3845
  ref,
@@ -3853,11 +3852,11 @@ var init_Card = __esm({
3853
3852
  }
3854
3853
  ));
3855
3854
  CardTitle.displayName = "CardTitle";
3856
- CardContent = React87__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
3855
+ CardContent = React89__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
3857
3856
  CardContent.displayName = "CardContent";
3858
3857
  CardBody = CardContent;
3859
3858
  CardBody.displayName = "CardBody";
3860
- CardFooter = React87__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3859
+ CardFooter = React89__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3861
3860
  "div",
3862
3861
  {
3863
3862
  ref,
@@ -3944,7 +3943,7 @@ var init_FilterPill = __esm({
3944
3943
  md: "w-3.5 h-3.5",
3945
3944
  lg: "w-4 h-4"
3946
3945
  };
3947
- FilterPill = React87__default.forwardRef(
3946
+ FilterPill = React89__default.forwardRef(
3948
3947
  ({
3949
3948
  className,
3950
3949
  variant = "default",
@@ -4073,8 +4072,8 @@ var init_Avatar = __esm({
4073
4072
  actionPayload
4074
4073
  }) => {
4075
4074
  const eventBus = useEventBus();
4076
- const [imgFailed, setImgFailed] = React87__default.useState(false);
4077
- React87__default.useEffect(() => {
4075
+ const [imgFailed, setImgFailed] = React89__default.useState(false);
4076
+ React89__default.useEffect(() => {
4078
4077
  setImgFailed(false);
4079
4078
  }, [src]);
4080
4079
  const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
@@ -4187,7 +4186,7 @@ var init_Center = __esm({
4187
4186
  as: Component = "div"
4188
4187
  }) => {
4189
4188
  const mergedStyle = minHeight ? { minHeight, ...style } : style;
4190
- return React87__default.createElement(Component, {
4189
+ return React89__default.createElement(Component, {
4191
4190
  className: cn(
4192
4191
  inline ? "inline-flex" : "flex",
4193
4192
  horizontal && "justify-center",
@@ -4455,7 +4454,7 @@ var init_Radio = __esm({
4455
4454
  md: "w-2.5 h-2.5",
4456
4455
  lg: "w-3 h-3"
4457
4456
  };
4458
- Radio = React87__default.forwardRef(
4457
+ Radio = React89__default.forwardRef(
4459
4458
  ({
4460
4459
  label,
4461
4460
  helperText,
@@ -4472,12 +4471,12 @@ var init_Radio = __esm({
4472
4471
  onChange,
4473
4472
  ...props
4474
4473
  }, ref) => {
4475
- const reactId = React87__default.useId();
4474
+ const reactId = React89__default.useId();
4476
4475
  const baseId = id || `radio-${reactId}`;
4477
4476
  const hasError = !!error;
4478
4477
  const eventBus = useEventBus();
4479
- const [selected, setSelected] = React87__default.useState(value);
4480
- React87__default.useEffect(() => {
4478
+ const [selected, setSelected] = React89__default.useState(value);
4479
+ React89__default.useEffect(() => {
4481
4480
  if (value !== void 0) setSelected(value);
4482
4481
  }, [value]);
4483
4482
  const pick = (next, e) => {
@@ -4659,7 +4658,7 @@ var init_Switch = __esm({
4659
4658
  "components/core/atoms/Switch.tsx"() {
4660
4659
  "use client";
4661
4660
  init_cn();
4662
- Switch = React87.forwardRef(
4661
+ Switch = React89.forwardRef(
4663
4662
  ({
4664
4663
  checked,
4665
4664
  defaultChecked = false,
@@ -4670,10 +4669,10 @@ var init_Switch = __esm({
4670
4669
  name,
4671
4670
  className
4672
4671
  }, ref) => {
4673
- const [isChecked, setIsChecked] = React87.useState(
4672
+ const [isChecked, setIsChecked] = React89.useState(
4674
4673
  checked !== void 0 ? checked : defaultChecked
4675
4674
  );
4676
- React87.useEffect(() => {
4675
+ React89.useEffect(() => {
4677
4676
  if (checked !== void 0) {
4678
4677
  setIsChecked(checked);
4679
4678
  }
@@ -4836,7 +4835,7 @@ var init_Stack = __esm({
4836
4835
  };
4837
4836
  const isHorizontal = direction === "horizontal";
4838
4837
  const directionClass = responsive && isHorizontal ? reverse ? "flex-col-reverse md:flex-row-reverse" : "flex-col md:flex-row" : isHorizontal ? reverse ? "flex-row-reverse" : "flex-row" : reverse ? "flex-col-reverse" : "flex-col";
4839
- return React87__default.createElement(
4838
+ return React89__default.createElement(
4840
4839
  Component,
4841
4840
  {
4842
4841
  className: cn(
@@ -5036,7 +5035,7 @@ var Aside;
5036
5035
  var init_Aside = __esm({
5037
5036
  "components/core/atoms/Aside.tsx"() {
5038
5037
  init_cn();
5039
- Aside = React87__default.forwardRef(
5038
+ Aside = React89__default.forwardRef(
5040
5039
  ({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
5041
5040
  );
5042
5041
  Aside.displayName = "Aside";
@@ -5115,9 +5114,9 @@ var init_LawReferenceTooltip = __esm({
5115
5114
  className
5116
5115
  }) => {
5117
5116
  const { t } = useTranslate();
5118
- const [isVisible, setIsVisible] = React87__default.useState(false);
5119
- const timeoutRef = React87__default.useRef(null);
5120
- const triggerRef = React87__default.useRef(null);
5117
+ const [isVisible, setIsVisible] = React89__default.useState(false);
5118
+ const timeoutRef = React89__default.useRef(null);
5119
+ const triggerRef = React89__default.useRef(null);
5121
5120
  const handleMouseEnter = () => {
5122
5121
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
5123
5122
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -5128,7 +5127,7 @@ var init_LawReferenceTooltip = __esm({
5128
5127
  };
5129
5128
  const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
5130
5129
  const open = isVisible || revealed;
5131
- React87__default.useEffect(() => {
5130
+ React89__default.useEffect(() => {
5132
5131
  return () => {
5133
5132
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
5134
5133
  };
@@ -5338,7 +5337,7 @@ var init_StatusDot = __esm({
5338
5337
  md: "w-2.5 h-2.5",
5339
5338
  lg: "w-3 h-3"
5340
5339
  };
5341
- StatusDot = React87__default.forwardRef(
5340
+ StatusDot = React89__default.forwardRef(
5342
5341
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
5343
5342
  return /* @__PURE__ */ jsx(
5344
5343
  "span",
@@ -5392,7 +5391,7 @@ var init_TrendIndicator = __esm({
5392
5391
  down: "trending-down",
5393
5392
  flat: "arrow-right"
5394
5393
  };
5395
- TrendIndicator = React87__default.forwardRef(
5394
+ TrendIndicator = React89__default.forwardRef(
5396
5395
  ({
5397
5396
  className,
5398
5397
  value,
@@ -5461,7 +5460,7 @@ var init_RangeSlider = __esm({
5461
5460
  md: "w-4 h-4",
5462
5461
  lg: "w-5 h-5"
5463
5462
  };
5464
- RangeSlider = React87__default.forwardRef(
5463
+ RangeSlider = React89__default.forwardRef(
5465
5464
  ({
5466
5465
  className,
5467
5466
  min = 0,
@@ -6118,7 +6117,7 @@ var init_ContentSection = __esm({
6118
6117
  md: "py-16",
6119
6118
  lg: "py-24"
6120
6119
  };
6121
- ContentSection = React87__default.forwardRef(
6120
+ ContentSection = React89__default.forwardRef(
6122
6121
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
6123
6122
  return /* @__PURE__ */ jsx(
6124
6123
  Box,
@@ -6652,7 +6651,7 @@ var init_AnimatedReveal = __esm({
6652
6651
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
6653
6652
  "none": {}
6654
6653
  };
6655
- AnimatedReveal = React87__default.forwardRef(
6654
+ AnimatedReveal = React89__default.forwardRef(
6656
6655
  ({
6657
6656
  trigger = "scroll",
6658
6657
  animation = "fade-up",
@@ -6812,7 +6811,7 @@ var init_AnimatedGraphic = __esm({
6812
6811
  "components/marketing/atoms/AnimatedGraphic.tsx"() {
6813
6812
  "use client";
6814
6813
  init_cn();
6815
- AnimatedGraphic = React87__default.forwardRef(
6814
+ AnimatedGraphic = React89__default.forwardRef(
6816
6815
  ({
6817
6816
  src,
6818
6817
  svgContent,
@@ -6835,7 +6834,7 @@ var init_AnimatedGraphic = __esm({
6835
6834
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
6836
6835
  const resolvedSvg = svgContent ?? fetchedSvg;
6837
6836
  const prevAnimateRef = useRef(animate);
6838
- const setRef = React87__default.useCallback(
6837
+ const setRef = React89__default.useCallback(
6839
6838
  (node) => {
6840
6839
  containerRef.current = node;
6841
6840
  if (typeof ref === "function") ref(node);
@@ -7588,9 +7587,9 @@ function ControlButton({
7588
7587
  className
7589
7588
  }) {
7590
7589
  const eventBus = useEventBus();
7591
- const [isPressed, setIsPressed] = React87.useState(false);
7590
+ const [isPressed, setIsPressed] = React89.useState(false);
7592
7591
  const actualPressed = pressed ?? isPressed;
7593
- const handlePointerDown = React87.useCallback(
7592
+ const handlePointerDown = React89.useCallback(
7594
7593
  (e) => {
7595
7594
  e.preventDefault();
7596
7595
  if (disabled) return;
@@ -7600,7 +7599,7 @@ function ControlButton({
7600
7599
  },
7601
7600
  [disabled, pressEvent, eventBus, onPress]
7602
7601
  );
7603
- const handlePointerUp = React87.useCallback(
7602
+ const handlePointerUp = React89.useCallback(
7604
7603
  (e) => {
7605
7604
  e.preventDefault();
7606
7605
  if (disabled) return;
@@ -7610,7 +7609,7 @@ function ControlButton({
7610
7609
  },
7611
7610
  [disabled, releaseEvent, eventBus, onRelease]
7612
7611
  );
7613
- const handlePointerLeave = React87.useCallback(
7612
+ const handlePointerLeave = React89.useCallback(
7614
7613
  (e) => {
7615
7614
  if (isPressed) {
7616
7615
  setIsPressed(false);
@@ -7869,18 +7868,18 @@ function ControlGrid({
7869
7868
  className
7870
7869
  }) {
7871
7870
  const eventBus = useEventBus();
7872
- const [active, setActive] = React87.useState(/* @__PURE__ */ new Set());
7873
- const [coarse, setCoarse] = React87.useState(
7871
+ const [active, setActive] = React89.useState(/* @__PURE__ */ new Set());
7872
+ const [coarse, setCoarse] = React89.useState(
7874
7873
  () => typeof window !== "undefined" && window.matchMedia("(pointer: coarse)").matches
7875
7874
  );
7876
- React87.useEffect(() => {
7875
+ React89.useEffect(() => {
7877
7876
  if (visibility !== "auto" || typeof window === "undefined") return;
7878
7877
  const mq = window.matchMedia("(pointer: coarse)");
7879
7878
  const onChange = (e) => setCoarse(e.matches);
7880
7879
  mq.addEventListener("change", onChange);
7881
7880
  return () => mq.removeEventListener("change", onChange);
7882
7881
  }, [visibility]);
7883
- const handlePress = React87.useCallback(
7882
+ const handlePress = React89.useCallback(
7884
7883
  (id) => {
7885
7884
  setActive((prev) => new Set(prev).add(id));
7886
7885
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -7894,7 +7893,7 @@ function ControlGrid({
7894
7893
  },
7895
7894
  [kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
7896
7895
  );
7897
- const handleRelease = React87.useCallback(
7896
+ const handleRelease = React89.useCallback(
7898
7897
  (id) => {
7899
7898
  setActive((prev) => {
7900
7899
  const next = new Set(prev);
@@ -8257,7 +8256,7 @@ function GameMenu({
8257
8256
  }) {
8258
8257
  const resolvedOptions = (options?.length ? options : void 0) ?? (menuItems?.length ? menuItems : void 0) ?? DEFAULT_MENU_OPTIONS;
8259
8258
  const eventBus = useEventBus();
8260
- const handleOptionClick = React87.useCallback(
8259
+ const handleOptionClick = React89.useCallback(
8261
8260
  (option) => {
8262
8261
  if (option.event) {
8263
8262
  eventBus.emit(`UI:${option.event}`, { option });
@@ -8493,7 +8492,7 @@ function StateGraph({
8493
8492
  }) {
8494
8493
  const eventBus = useEventBus();
8495
8494
  const nodes = states ?? [];
8496
- const positions = React87.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
8495
+ const positions = React89.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
8497
8496
  return /* @__PURE__ */ jsxs(
8498
8497
  Box,
8499
8498
  {
@@ -8564,8 +8563,8 @@ function MiniMap({
8564
8563
  tileAssets,
8565
8564
  unitAssets
8566
8565
  }) {
8567
- const canvasRef = React87.useRef(null);
8568
- const imgCacheRef = React87.useRef(/* @__PURE__ */ new Map());
8566
+ const canvasRef = React89.useRef(null);
8567
+ const imgCacheRef = React89.useRef(/* @__PURE__ */ new Map());
8569
8568
  function loadImg(url) {
8570
8569
  const cached = imgCacheRef.current.get(url);
8571
8570
  if (cached) return cached.complete ? cached : null;
@@ -8581,7 +8580,7 @@ function MiniMap({
8581
8580
  imgCacheRef.current.set(url, img);
8582
8581
  return null;
8583
8582
  }
8584
- React87.useEffect(() => {
8583
+ React89.useEffect(() => {
8585
8584
  const canvas = canvasRef.current;
8586
8585
  if (!canvas) return;
8587
8586
  const ctx = canvas.getContext("2d");
@@ -9815,7 +9814,7 @@ function proceduralShapes(view, pos, fade, progress) {
9815
9814
  }
9816
9815
  }
9817
9816
  }
9818
- function expandFxItem(view, node, epochNowMs, dim, projector) {
9817
+ function expandFxItem(view, node, epochNowMs, dim, projector, fontFamily) {
9819
9818
  if (view.space === "screen") return [];
9820
9819
  const tickMs = node.tickMs ?? DEFAULT_TICK_MS;
9821
9820
  const { ageMs, progress, fade } = fxLifecycle(view, epochNowMs, tickMs);
@@ -9852,6 +9851,7 @@ function expandFxItem(view, node, epochNowMs, dim, projector) {
9852
9851
  }
9853
9852
  if (view.message) {
9854
9853
  const pxSize = projector && view.size !== void 0 ? Math.max(10, Math.round(view.size * projector.tileWidth)) : void 0;
9854
+ const family = fontFamily ?? "system-ui, sans-serif";
9855
9855
  const text = {
9856
9856
  type: "draw-text",
9857
9857
  text: view.message,
@@ -9859,18 +9859,18 @@ function expandFxItem(view, node, epochNowMs, dim, projector) {
9859
9859
  offsetY: -(0.15 + 0.55 * progress),
9860
9860
  color: view.color ?? node.textColor ?? DEFAULT_TEXT_COLOR,
9861
9861
  opacity: fade,
9862
- ...pxSize ? { font: `bold ${pxSize}px system-ui, sans-serif` } : {}
9862
+ font: `bold ${pxSize ?? 14}px ${family}`
9863
9863
  };
9864
9864
  out.push(text);
9865
9865
  }
9866
9866
  return out;
9867
9867
  }
9868
- function expandFxLayer(node, epochNowMs, dim, projector) {
9868
+ function expandFxLayer(node, epochNowMs, dim, projector, fontFamily) {
9869
9869
  if (!Array.isArray(node.items)) return [];
9870
9870
  const out = [];
9871
9871
  for (const item of node.items) {
9872
9872
  if (!item || typeof item.id !== "string") continue;
9873
- out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim, projector));
9873
+ out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim, projector, fontFamily));
9874
9874
  }
9875
9875
  return out;
9876
9876
  }
@@ -9937,7 +9937,7 @@ function paintDrawable(painter, node, dctx) {
9937
9937
  break;
9938
9938
  case "draw-fx-layer": {
9939
9939
  const epochNow = dctx.time > 0 && typeof performance !== "undefined" ? performance.timeOrigin + dctx.time : 0;
9940
- for (const child of expandFxLayer(node, epochNow, "2d", dctx.projector)) paintDrawable(painter, child, dctx);
9940
+ for (const child of expandFxLayer(node, epochNow, "2d", dctx.projector, dctx.fontFamily)) paintDrawable(painter, child, dctx);
9941
9941
  break;
9942
9942
  }
9943
9943
  }
@@ -10047,7 +10047,7 @@ function Canvas2D({
10047
10047
  const registerChildDrawable = useCallback((node) => {
10048
10048
  childDrawablesRef.current.push(node);
10049
10049
  }, []);
10050
- const hasJsxChildren = React87.Children.count(children) > 0;
10050
+ const hasJsxChildren = React89.Children.count(children) > 0;
10051
10051
  function isDrawableLayer(node) {
10052
10052
  return node.type === "draw-sprite-layer" || node.type === "draw-shape-layer" || node.type === "draw-text-layer";
10053
10053
  }
@@ -10605,7 +10605,7 @@ function Canvas({
10605
10605
  if (mode !== "3d") return;
10606
10606
  const next = childDrawablesRef.current;
10607
10607
  canvasLog.debug("children:adopt", { registered: next.length, adopted: childDrawables.length });
10608
- if (next.length === 0 && React87.Children.count(children) > 0) return;
10608
+ if (next.length === 0 && React89.Children.count(children) > 0) return;
10609
10609
  setChildDrawables(
10610
10610
  (prev) => prev.length === next.length && JSON.stringify(prev) === JSON.stringify(next) ? prev : [...next]
10611
10611
  );
@@ -10643,7 +10643,7 @@ function Canvas({
10643
10643
  };
10644
10644
  return /* @__PURE__ */ jsxs(Fragment, { children: [
10645
10645
  /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(Canvas3DHost, { ...props3d }) }),
10646
- React87.Children.count(children) > 0 && /* @__PURE__ */ jsx(DrawableRegistryContext.Provider, { value: registerChildDrawable, children: /* @__PURE__ */ jsx("div", { "aria-hidden": "true", style: { position: "absolute", width: 0, height: 0, overflow: "hidden" }, children }) })
10646
+ React89.Children.count(children) > 0 && /* @__PURE__ */ jsx(DrawableRegistryContext.Provider, { value: registerChildDrawable, children: /* @__PURE__ */ jsx("div", { "aria-hidden": "true", style: { position: "absolute", width: 0, height: 0, overflow: "hidden" }, children }) })
10647
10647
  ] });
10648
10648
  }
10649
10649
  return /* @__PURE__ */ jsx(
@@ -11068,7 +11068,7 @@ function LinearView({
11068
11068
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
11069
11069
  const isDone = i < currentIdx;
11070
11070
  const isCurrent = i === currentIdx;
11071
- return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
11071
+ return /* @__PURE__ */ jsxs(React89__default.Fragment, { children: [
11072
11072
  i > 0 && /* @__PURE__ */ jsx(
11073
11073
  Typography,
11074
11074
  {
@@ -11603,7 +11603,7 @@ function SequenceBar({
11603
11603
  else onSlotRemove?.(index);
11604
11604
  }, [emit, slotRemoveEvent, onSlotRemove, playing]);
11605
11605
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
11606
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
11606
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React89__default.Fragment, { children: [
11607
11607
  i > 0 && /* @__PURE__ */ jsx(
11608
11608
  Typography,
11609
11609
  {
@@ -12292,7 +12292,7 @@ var init_LearningCanvas = __esm({
12292
12292
  if (drawables?.length && projector) {
12293
12293
  const painter = createWebPainter(ctx, invalidateRef.current);
12294
12294
  const timeMs = needsAnim && typeof performance !== "undefined" ? performance.now() : 0;
12295
- const dctx = { projector, time: timeMs, invalidate: invalidateRef.current };
12295
+ const dctx = { projector, time: timeMs, invalidate: invalidateRef.current, fontFamily: themeBodyFont(canvas) };
12296
12296
  for (const node of drawables) {
12297
12297
  paintDrawable(painter, node, dctx);
12298
12298
  }
@@ -12454,7 +12454,7 @@ var init_ErrorBoundary = __esm({
12454
12454
  }
12455
12455
  );
12456
12456
  };
12457
- ErrorBoundary = class extends React87__default.Component {
12457
+ ErrorBoundary = class extends React89__default.Component {
12458
12458
  constructor(props) {
12459
12459
  super(props);
12460
12460
  __publicField(this, "reset", () => {
@@ -13106,7 +13106,7 @@ var init_Container = __esm({
13106
13106
  as: Component = "div"
13107
13107
  }) => {
13108
13108
  const resolvedSize = maxWidth ?? size ?? "lg";
13109
- return React87__default.createElement(
13109
+ return React89__default.createElement(
13110
13110
  Component,
13111
13111
  {
13112
13112
  className: cn(
@@ -14043,7 +14043,7 @@ var init_FloatingActionButton = __esm({
14043
14043
  document.addEventListener("mousedown", handleClickOutside);
14044
14044
  return () => document.removeEventListener("mousedown", handleClickOutside);
14045
14045
  }, [isExpanded, actions]);
14046
- const positionClasses = {
14046
+ const positionClasses2 = {
14047
14047
  "bottom-right": "bottom-6 right-6",
14048
14048
  "bottom-left": "bottom-6 left-6",
14049
14049
  "bottom-center": "bottom-6 left-1/2 -translate-x-1/2",
@@ -14052,7 +14052,7 @@ var init_FloatingActionButton = __esm({
14052
14052
  "top-center": "top-6 left-1/2 -translate-x-1/2"
14053
14053
  };
14054
14054
  if (resolvedAction && (!actions || actions.length === 0)) {
14055
- return /* @__PURE__ */ jsx(Box, { className: cn("fixed z-50", positionClasses[position], className), children: /* @__PURE__ */ jsx(
14055
+ return /* @__PURE__ */ jsx(Box, { className: cn("fixed z-50", positionClasses2[position], className), children: /* @__PURE__ */ jsx(
14056
14056
  Button,
14057
14057
  {
14058
14058
  variant: resolvedAction.variant || "primary",
@@ -14080,7 +14080,7 @@ var init_FloatingActionButton = __esm({
14080
14080
  ref: fabRef,
14081
14081
  className: cn(
14082
14082
  "fixed z-50 flex flex-col items-end gap-3",
14083
- positionClasses[position],
14083
+ positionClasses2[position],
14084
14084
  position.includes("left") && "items-start",
14085
14085
  className
14086
14086
  ),
@@ -17016,9 +17016,11 @@ var init_Tabs = __esm({
17016
17016
  }
17017
17017
  };
17018
17018
  const handleKeyDown = (e, index) => {
17019
- if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
17019
+ const prevKey = orientation === "vertical" ? "ArrowUp" : "ArrowLeft";
17020
+ const nextKey = orientation === "vertical" ? "ArrowDown" : "ArrowRight";
17021
+ if (e.key === prevKey || e.key === nextKey) {
17020
17022
  e.preventDefault();
17021
- const direction = e.key === "ArrowLeft" ? -1 : 1;
17023
+ const direction = e.key === prevKey ? -1 : 1;
17022
17024
  const nextIndex = (index + direction + safeItems.length) % safeItems.length;
17023
17025
  const nextTab = safeItems[nextIndex];
17024
17026
  if (nextTab && !nextTab.disabled) {
@@ -17357,7 +17359,7 @@ function useLanguageReady(language) {
17357
17359
  }, [language]);
17358
17360
  return ready;
17359
17361
  }
17360
- var dynamicallyLoaded, codeLanguageLoader, orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log7, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
17362
+ var dynamicallyLoaded, codeLanguageLoader, orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log7, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, HIGHLIGHT_CAPACITY_BYTES, CodeBlock;
17361
17363
  var init_CodeBlock = __esm({
17362
17364
  "components/core/molecules/markdown/CodeBlock.tsx"() {
17363
17365
  init_cn();
@@ -17590,7 +17592,8 @@ var init_CodeBlock = __esm({
17590
17592
  DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
17591
17593
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
17592
17594
  HIDDEN_LINE_NUMBERS = { display: "none" };
17593
- CodeBlock = React87__default.memo(
17595
+ HIGHLIGHT_CAPACITY_BYTES = 512 * 1024;
17596
+ CodeBlock = React89__default.memo(
17594
17597
  ({
17595
17598
  code: rawCode,
17596
17599
  language = "text",
@@ -17620,6 +17623,8 @@ var init_CodeBlock = __esm({
17620
17623
  const isOrb = language === "orb";
17621
17624
  const isLolo = language === "lolo";
17622
17625
  const activeStyle = isOrb ? orbStyle : isLolo ? loloStyle : dark;
17626
+ const overCapacity = code.length > HIGHLIGHT_CAPACITY_BYTES;
17627
+ const plainCodeColor = activeStyle['code[class*="language-"]']?.color ?? "#d4d4d4";
17623
17628
  const languageReady = useLanguageReady(language);
17624
17629
  const eventBus = useEventBus();
17625
17630
  const { t } = useTranslate();
@@ -17686,8 +17691,8 @@ var init_CodeBlock = __esm({
17686
17691
  const isFoldable = foldableProp ?? true;
17687
17692
  const [collapsed, setCollapsed] = useState(() => /* @__PURE__ */ new Set());
17688
17693
  const foldRegions = useMemo(
17689
- () => isFoldable ? computeFoldRegions(code) : [],
17690
- [code, isFoldable]
17694
+ () => isFoldable && !overCapacity ? computeFoldRegions(code) : [],
17695
+ [code, isFoldable, overCapacity]
17691
17696
  );
17692
17697
  const foldStartMap = useMemo(() => {
17693
17698
  const m = /* @__PURE__ */ new Map();
@@ -17721,8 +17726,67 @@ var init_CodeBlock = __esm({
17721
17726
  useEffect(() => {
17722
17727
  setCollapsed(/* @__PURE__ */ new Set());
17723
17728
  }, [code]);
17729
+ const editableOverCapacity = editableValue.length > HIGHLIGHT_CAPACITY_BYTES;
17730
+ const editableHighlightedElement = useMemo(
17731
+ () => editableOverCapacity ? /* @__PURE__ */ jsx(
17732
+ "div",
17733
+ {
17734
+ style: {
17735
+ padding: "1rem",
17736
+ margin: 0,
17737
+ whiteSpace: "pre",
17738
+ minWidth: "100%",
17739
+ color: plainCodeColor,
17740
+ fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
17741
+ fontSize: "13px",
17742
+ lineHeight: "1.5"
17743
+ },
17744
+ children: editableValue || " "
17745
+ }
17746
+ ) : /* @__PURE__ */ jsx(
17747
+ SyntaxHighlighter,
17748
+ {
17749
+ PreTag: "div",
17750
+ language,
17751
+ style: activeStyle,
17752
+ wrapLines: errorLines && errorLines.size > 0,
17753
+ lineProps: errorLineProps,
17754
+ customStyle: {
17755
+ backgroundColor: "transparent",
17756
+ borderRadius: 0,
17757
+ padding: "1rem",
17758
+ margin: 0,
17759
+ whiteSpace: "pre",
17760
+ minWidth: "100%",
17761
+ fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
17762
+ fontSize: "13px",
17763
+ lineHeight: "1.5"
17764
+ },
17765
+ codeTagProps: {
17766
+ style: {
17767
+ fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
17768
+ fontSize: "13px",
17769
+ lineHeight: "1.5"
17770
+ }
17771
+ },
17772
+ children: editableValue || " "
17773
+ }
17774
+ ),
17775
+ [editableValue, editableOverCapacity, plainCodeColor, language, activeStyle, errorLines, errorLineProps, languageReady]
17776
+ );
17724
17777
  const highlightedElement = useMemo(
17725
- () => /* @__PURE__ */ jsx(
17778
+ () => overCapacity ? /* @__PURE__ */ jsx(
17779
+ "div",
17780
+ {
17781
+ style: {
17782
+ margin: 0,
17783
+ whiteSpace: "pre",
17784
+ minWidth: "100%",
17785
+ color: plainCodeColor
17786
+ },
17787
+ children: code
17788
+ }
17789
+ ) : /* @__PURE__ */ jsx(
17726
17790
  SyntaxHighlighter,
17727
17791
  {
17728
17792
  PreTag: "div",
@@ -17744,7 +17808,7 @@ var init_CodeBlock = __esm({
17744
17808
  children: code
17745
17809
  }
17746
17810
  ),
17747
- [code, language, activeStyle, languageReady]
17811
+ [code, overCapacity, plainCodeColor, language, activeStyle, languageReady]
17748
17812
  );
17749
17813
  useLayoutEffect(() => {
17750
17814
  const container = codeRef.current;
@@ -18073,35 +18137,7 @@ var init_CodeBlock = __esm({
18073
18137
  overflow: "hidden",
18074
18138
  pointerEvents: "none"
18075
18139
  },
18076
- children: /* @__PURE__ */ jsx(
18077
- SyntaxHighlighter,
18078
- {
18079
- PreTag: "div",
18080
- language,
18081
- style: activeStyle,
18082
- wrapLines: errorLines && errorLines.size > 0,
18083
- lineProps: errorLineProps,
18084
- customStyle: {
18085
- backgroundColor: "transparent",
18086
- borderRadius: 0,
18087
- padding: "1rem",
18088
- margin: 0,
18089
- whiteSpace: "pre",
18090
- minWidth: "100%",
18091
- fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
18092
- fontSize: "13px",
18093
- lineHeight: "1.5"
18094
- },
18095
- codeTagProps: {
18096
- style: {
18097
- fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
18098
- fontSize: "13px",
18099
- lineHeight: "1.5"
18100
- }
18101
- },
18102
- children: editableValue || " "
18103
- }
18104
- )
18140
+ children: editableHighlightedElement
18105
18141
  }
18106
18142
  ),
18107
18143
  /* @__PURE__ */ jsx(
@@ -18173,14 +18209,77 @@ var init_CodeBlock = __esm({
18173
18209
  CodeBlock.displayName = "CodeBlock";
18174
18210
  }
18175
18211
  });
18212
+ function loadMermaid() {
18213
+ mermaidModule ?? (mermaidModule = import('mermaid').then((m) => m.default));
18214
+ return mermaidModule;
18215
+ }
18216
+ var mermaidModule, MermaidDiagram;
18217
+ var init_MermaidDiagram = __esm({
18218
+ "components/core/molecules/markdown/MermaidDiagram.tsx"() {
18219
+ init_Box();
18220
+ init_Typography();
18221
+ init_CodeBlock();
18222
+ init_cn();
18223
+ mermaidModule = null;
18224
+ MermaidDiagram = React89__default.memo(
18225
+ ({ code, className }) => {
18226
+ const { resolvedMode } = useTheme();
18227
+ const containerRef = useRef(null);
18228
+ const [error, setError] = useState(null);
18229
+ const reactId = useId();
18230
+ useEffect(() => {
18231
+ let active = true;
18232
+ void (async () => {
18233
+ try {
18234
+ const mermaid = await loadMermaid();
18235
+ mermaid.initialize({
18236
+ startOnLoad: false,
18237
+ securityLevel: "strict",
18238
+ theme: resolvedMode === "dark" ? "dark" : "default"
18239
+ });
18240
+ const domId = `mermaid-${reactId.replace(/[^a-zA-Z0-9]/g, "")}`;
18241
+ const { svg } = await mermaid.render(domId, code);
18242
+ if (!active || !containerRef.current) return;
18243
+ containerRef.current.innerHTML = svg;
18244
+ setError(null);
18245
+ } catch (err) {
18246
+ if (active) setError(err instanceof Error ? err.message : String(err));
18247
+ }
18248
+ })();
18249
+ return () => {
18250
+ active = false;
18251
+ };
18252
+ }, [code, resolvedMode, reactId]);
18253
+ return /* @__PURE__ */ jsxs(Box, { className: cn("not-prose my-4", className), children: [
18254
+ error !== null && /* @__PURE__ */ jsxs(Box, { className: "space-y-2 mb-2", children: [
18255
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-error whitespace-pre-wrap", children: error }),
18256
+ /* @__PURE__ */ jsx(CodeBlock, { code, language: "mermaid" })
18257
+ ] }),
18258
+ /* @__PURE__ */ jsx(
18259
+ Box,
18260
+ {
18261
+ ref: containerRef,
18262
+ "data-testid": "mermaid-diagram",
18263
+ className: "overflow-x-auto",
18264
+ style: error !== null ? { display: "none" } : void 0
18265
+ }
18266
+ )
18267
+ ] });
18268
+ },
18269
+ (prev, next) => prev.code === next.code && prev.className === next.className
18270
+ );
18271
+ MermaidDiagram.displayName = "MermaidDiagram";
18272
+ }
18273
+ });
18176
18274
  var MarkdownContent;
18177
18275
  var init_MarkdownContent = __esm({
18178
18276
  "components/core/molecules/markdown/MarkdownContent.tsx"() {
18179
18277
  init_katex_min();
18180
18278
  init_Box();
18181
18279
  init_CodeBlock();
18280
+ init_MermaidDiagram();
18182
18281
  init_cn();
18183
- MarkdownContent = React87__default.memo(
18282
+ MarkdownContent = React89__default.memo(
18184
18283
  ({ content, direction = "ltr", className }) => {
18185
18284
  const { t: _t } = useTranslate();
18186
18285
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -18225,6 +18324,9 @@ var init_MarkdownContent = __esm({
18225
18324
  if (!inline) {
18226
18325
  const match = /language-(\w+)/.exec(codeClassName ?? "");
18227
18326
  const code = String(children).replace(/\n$/, "");
18327
+ if (match?.[1] === "mermaid") {
18328
+ return /* @__PURE__ */ jsx(MermaidDiagram, { code });
18329
+ }
18228
18330
  if (match) {
18229
18331
  return /* @__PURE__ */ jsx(
18230
18332
  CodeBlock,
@@ -19507,7 +19609,7 @@ var init_StateMachineView = __esm({
19507
19609
  style: { top: title ? 30 : 0 },
19508
19610
  children: [
19509
19611
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
19510
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React87__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
19612
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React89__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
19511
19613
  StateNode2,
19512
19614
  {
19513
19615
  state,
@@ -24421,6 +24523,183 @@ var init_CodeRunnerPanel = __esm({
24421
24523
  CodeRunnerPanel.displayName = "CodeRunnerPanel";
24422
24524
  }
24423
24525
  });
24526
+ function matchesQuery(query, text) {
24527
+ if (!query) return true;
24528
+ let qi = 0;
24529
+ const q = query.toLowerCase();
24530
+ const t = text.toLowerCase();
24531
+ for (let ti = 0; ti < t.length && qi < q.length; ti++) {
24532
+ if (t[ti] === q[qi]) qi++;
24533
+ }
24534
+ return qi === q.length;
24535
+ }
24536
+ function commandMatches(command, query) {
24537
+ if (!query) return true;
24538
+ if (matchesQuery(query, command.label)) return true;
24539
+ return (command.keywords ?? []).some((keyword) => matchesQuery(query, keyword));
24540
+ }
24541
+ var UNGROUPED, CommandPalette;
24542
+ var init_CommandPalette = __esm({
24543
+ "components/core/molecules/CommandPalette.tsx"() {
24544
+ "use client";
24545
+ init_Box();
24546
+ init_Stack();
24547
+ init_Typography();
24548
+ init_Icon();
24549
+ init_Input();
24550
+ init_Badge();
24551
+ init_cn();
24552
+ init_useEventBus();
24553
+ init_Modal();
24554
+ UNGROUPED = /* @__PURE__ */ Symbol("command-palette-ungrouped");
24555
+ CommandPalette = ({
24556
+ open,
24557
+ onOpenChange,
24558
+ commands,
24559
+ onSelect,
24560
+ placeholder = "Type a command...",
24561
+ emptyLabel = "No matching commands",
24562
+ className
24563
+ }) => {
24564
+ const eventBus = useEventBus();
24565
+ const [query, setQuery] = useState("");
24566
+ const [highlightIndex, setHighlightIndex] = useState(0);
24567
+ const filtered = useMemo(
24568
+ () => commands.filter((command) => commandMatches(command, query)),
24569
+ [commands, query]
24570
+ );
24571
+ const groups = useMemo(() => {
24572
+ const order = [];
24573
+ const byGroup = /* @__PURE__ */ new Map();
24574
+ for (const command of filtered) {
24575
+ const key = command.group ?? UNGROUPED;
24576
+ if (!byGroup.has(key)) {
24577
+ byGroup.set(key, []);
24578
+ order.push(key);
24579
+ }
24580
+ byGroup.get(key).push(command);
24581
+ }
24582
+ return order.map((key) => ({ group: key === UNGROUPED ? void 0 : key, items: byGroup.get(key) }));
24583
+ }, [filtered]);
24584
+ const resetQuery = useCallback(() => {
24585
+ setQuery("");
24586
+ setHighlightIndex(0);
24587
+ }, []);
24588
+ const handleClose = useCallback(() => {
24589
+ resetQuery();
24590
+ onOpenChange(false);
24591
+ }, [onOpenChange, resetQuery]);
24592
+ const handleSelect = useCallback(
24593
+ (command) => {
24594
+ if (command.disabled) return;
24595
+ if (command.event) eventBus.emit(`UI:${command.event}`, { commandId: command.id });
24596
+ if (command.action) eventBus.emit(`UI:${command.action}`, command.actionPayload ?? {});
24597
+ onSelect?.(command);
24598
+ handleClose();
24599
+ },
24600
+ [eventBus, onSelect, handleClose]
24601
+ );
24602
+ const handleQueryChange = useCallback((e) => {
24603
+ setQuery(e.target.value);
24604
+ setHighlightIndex(0);
24605
+ }, []);
24606
+ const handleKeyDown = useCallback(
24607
+ (e) => {
24608
+ if (filtered.length === 0) return;
24609
+ if (e.key === "ArrowDown") {
24610
+ e.preventDefault();
24611
+ setHighlightIndex((prev) => prev < filtered.length - 1 ? prev + 1 : 0);
24612
+ } else if (e.key === "ArrowUp") {
24613
+ e.preventDefault();
24614
+ setHighlightIndex((prev) => prev > 0 ? prev - 1 : filtered.length - 1);
24615
+ } else if (e.key === "Enter") {
24616
+ e.preventDefault();
24617
+ const command = filtered[highlightIndex];
24618
+ if (command) handleSelect(command);
24619
+ }
24620
+ },
24621
+ [filtered, highlightIndex, handleSelect]
24622
+ );
24623
+ return /* @__PURE__ */ jsx(
24624
+ Modal,
24625
+ {
24626
+ isOpen: open,
24627
+ onClose: handleClose,
24628
+ onExited: resetQuery,
24629
+ showCloseButton: false,
24630
+ size: "md",
24631
+ className,
24632
+ children: /* @__PURE__ */ jsx(Box, { "data-testid": "command-palette", children: /* @__PURE__ */ jsxs(VStack, { gap: "sm", children: [
24633
+ /* @__PURE__ */ jsx(
24634
+ Input,
24635
+ {
24636
+ inputType: "search",
24637
+ placeholder,
24638
+ value: query,
24639
+ onChange: handleQueryChange,
24640
+ onKeyDown: handleKeyDown,
24641
+ leftIcon: "search",
24642
+ clearable: query.length > 0,
24643
+ onClear: resetQuery,
24644
+ autoFocus: true,
24645
+ "data-testid": "command-palette-input"
24646
+ }
24647
+ ),
24648
+ filtered.length === 0 ? /* @__PURE__ */ jsx(Box, { className: "px-2 py-6 text-center", "data-testid": "command-palette-empty", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "muted", children: emptyLabel }) }) : /* @__PURE__ */ jsx(
24649
+ Box,
24650
+ {
24651
+ className: "max-h-80 overflow-y-auto",
24652
+ role: "listbox",
24653
+ "aria-label": placeholder,
24654
+ children: /* @__PURE__ */ jsx(VStack, { gap: "none", children: groups.map(({ group, items }) => /* @__PURE__ */ jsxs(Box, { children: [
24655
+ group ? /* @__PURE__ */ jsx(
24656
+ Typography,
24657
+ {
24658
+ variant: "caption",
24659
+ color: "muted",
24660
+ className: "px-3 pt-2 pb-1 block",
24661
+ children: group
24662
+ }
24663
+ ) : null,
24664
+ items.map((command) => {
24665
+ const index = filtered.indexOf(command);
24666
+ const isHighlighted = index === highlightIndex;
24667
+ return /* @__PURE__ */ jsxs(
24668
+ Box,
24669
+ {
24670
+ as: "button",
24671
+ role: "option",
24672
+ "aria-selected": isHighlighted,
24673
+ "aria-disabled": command.disabled || void 0,
24674
+ "data-testid": `command-palette-item-${command.id}`,
24675
+ onMouseEnter: () => !command.disabled && setHighlightIndex(index),
24676
+ onClick: () => handleSelect(command),
24677
+ className: cn(
24678
+ "w-full flex items-center gap-3 px-3 py-2 text-start rounded-sm",
24679
+ "text-sm transition-colors",
24680
+ "focus:outline-none",
24681
+ isHighlighted && "bg-muted",
24682
+ command.disabled && "opacity-50 cursor-not-allowed"
24683
+ ),
24684
+ children: [
24685
+ command.icon ? /* @__PURE__ */ jsx(Icon, { icon: command.icon, size: "sm", className: "flex-shrink-0" }) : null,
24686
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "flex-1 truncate", children: command.label }),
24687
+ command.shortcut ? /* @__PURE__ */ jsx(Badge, { variant: "neutral", size: "sm", children: command.shortcut }) : null
24688
+ ]
24689
+ },
24690
+ command.id
24691
+ );
24692
+ })
24693
+ ] }, String(group ?? "__ungrouped__"))) })
24694
+ }
24695
+ )
24696
+ ] }) })
24697
+ }
24698
+ );
24699
+ };
24700
+ CommandPalette.displayName = "CommandPalette";
24701
+ }
24702
+ });
24424
24703
  function formatCount(count) {
24425
24704
  if (count >= 1e3) {
24426
24705
  return `${(count / 1e3).toFixed(1)}k`;
@@ -25696,7 +25975,7 @@ var init_Menu = __esm({
25696
25975
  "bottom-end": "bottom-start"
25697
25976
  };
25698
25977
  const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
25699
- const triggerElement = React87__default.isValidElement(trigger) ? React87__default.cloneElement(trigger, {
25978
+ const triggerElement = React89__default.isValidElement(trigger) ? React89__default.cloneElement(trigger, {
25700
25979
  ref: triggerRef,
25701
25980
  onClick: handleToggle
25702
25981
  }) : /* @__PURE__ */ jsx(
@@ -25799,14 +26078,14 @@ function useDataDnd(args) {
25799
26078
  const isZone = Boolean(dragGroup || accepts || sortable);
25800
26079
  const enabled = isZone || Boolean(dndRoot);
25801
26080
  const eventBus = useEventBus();
25802
- const parentRoot = React87__default.useContext(RootCtx);
26081
+ const parentRoot = React89__default.useContext(RootCtx);
25803
26082
  const isRoot = enabled && parentRoot === null;
25804
- const zoneId = React87__default.useId();
26083
+ const zoneId = React89__default.useId();
25805
26084
  const ownGroup = dragGroup ?? accepts ?? zoneId;
25806
- const [optimisticOrders, setOptimisticOrders] = React87__default.useState(() => /* @__PURE__ */ new Map());
25807
- const optimisticOrdersRef = React87__default.useRef(optimisticOrders);
26085
+ const [optimisticOrders, setOptimisticOrders] = React89__default.useState(() => /* @__PURE__ */ new Map());
26086
+ const optimisticOrdersRef = React89__default.useRef(optimisticOrders);
25808
26087
  optimisticOrdersRef.current = optimisticOrders;
25809
- const clearOptimisticOrder = React87__default.useCallback((group) => {
26088
+ const clearOptimisticOrder = React89__default.useCallback((group) => {
25810
26089
  setOptimisticOrders((prev) => {
25811
26090
  if (!prev.has(group)) return prev;
25812
26091
  const next = new Map(prev);
@@ -25831,7 +26110,7 @@ function useDataDnd(args) {
25831
26110
  const raw = it[dndItemIdField];
25832
26111
  return raw != null ? String(raw) : `__idx_${idx}`;
25833
26112
  }).join("|");
25834
- const itemIds = React87__default.useMemo(
26113
+ const itemIds = React89__default.useMemo(
25835
26114
  () => orderedItems.map((it, idx) => {
25836
26115
  const raw = it[dndItemIdField];
25837
26116
  return raw != null ? String(raw) : `__idx_${idx}`;
@@ -25842,7 +26121,7 @@ function useDataDnd(args) {
25842
26121
  const raw = it[dndItemIdField];
25843
26122
  return raw != null ? String(raw) : `__${idx}`;
25844
26123
  }).join("|");
25845
- React87__default.useEffect(() => {
26124
+ React89__default.useEffect(() => {
25846
26125
  const root = isRoot ? null : parentRoot;
25847
26126
  if (root) {
25848
26127
  root.clearOptimisticOrder(ownGroup);
@@ -25850,20 +26129,20 @@ function useDataDnd(args) {
25850
26129
  clearOptimisticOrder(ownGroup);
25851
26130
  }
25852
26131
  }, [itemsContentSig, ownGroup]);
25853
- const zonesRef = React87__default.useRef(/* @__PURE__ */ new Map());
25854
- const registerZone = React87__default.useCallback((zoneId2, meta2) => {
26132
+ const zonesRef = React89__default.useRef(/* @__PURE__ */ new Map());
26133
+ const registerZone = React89__default.useCallback((zoneId2, meta2) => {
25855
26134
  zonesRef.current.set(zoneId2, meta2);
25856
26135
  }, []);
25857
- const unregisterZone = React87__default.useCallback((zoneId2) => {
26136
+ const unregisterZone = React89__default.useCallback((zoneId2) => {
25858
26137
  zonesRef.current.delete(zoneId2);
25859
26138
  }, []);
25860
- const [activeDrag, setActiveDrag] = React87__default.useState(null);
25861
- const [overZoneGroup, setOverZoneGroup] = React87__default.useState(null);
25862
- const meta = React87__default.useMemo(
26139
+ const [activeDrag, setActiveDrag] = React89__default.useState(null);
26140
+ const [overZoneGroup, setOverZoneGroup] = React89__default.useState(null);
26141
+ const meta = React89__default.useMemo(
25863
26142
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
25864
26143
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
25865
26144
  );
25866
- React87__default.useEffect(() => {
26145
+ React89__default.useEffect(() => {
25867
26146
  const target = isRoot ? null : parentRoot;
25868
26147
  if (!target) {
25869
26148
  zonesRef.current.set(zoneId, meta);
@@ -25882,7 +26161,7 @@ function useDataDnd(args) {
25882
26161
  }, [parentRoot, isRoot, zoneId, meta]);
25883
26162
  const sensors = useAlmadarDndSensors(true);
25884
26163
  const collisionDetection = almadarDndCollisionDetection;
25885
- const findZoneByItem = React87__default.useCallback(
26164
+ const findZoneByItem = React89__default.useCallback(
25886
26165
  (id) => {
25887
26166
  for (const z of zonesRef.current.values()) {
25888
26167
  if (z.itemIds.includes(id)) return z;
@@ -25891,7 +26170,7 @@ function useDataDnd(args) {
25891
26170
  },
25892
26171
  []
25893
26172
  );
25894
- React87__default.useCallback(
26173
+ React89__default.useCallback(
25895
26174
  (group) => {
25896
26175
  for (const z of zonesRef.current.values()) {
25897
26176
  if (z.group === group) return z;
@@ -25900,7 +26179,7 @@ function useDataDnd(args) {
25900
26179
  },
25901
26180
  []
25902
26181
  );
25903
- const handleDragEnd = React87__default.useCallback(
26182
+ const handleDragEnd = React89__default.useCallback(
25904
26183
  (event) => {
25905
26184
  const { active, over } = event;
25906
26185
  const activeIdStr = String(active.id);
@@ -25991,8 +26270,8 @@ function useDataDnd(args) {
25991
26270
  },
25992
26271
  [eventBus]
25993
26272
  );
25994
- const sortableData = React87__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
25995
- const SortableItem = React87__default.useCallback(
26273
+ const sortableData = React89__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
26274
+ const SortableItem = React89__default.useCallback(
25996
26275
  ({ id, children }) => {
25997
26276
  const {
25998
26277
  attributes,
@@ -26032,7 +26311,7 @@ function useDataDnd(args) {
26032
26311
  id: droppableId,
26033
26312
  data: sortableData
26034
26313
  });
26035
- const ctx = React87__default.useContext(RootCtx);
26314
+ const ctx = React89__default.useContext(RootCtx);
26036
26315
  const activeDrag2 = ctx?.activeDrag ?? null;
26037
26316
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
26038
26317
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -26047,7 +26326,7 @@ function useDataDnd(args) {
26047
26326
  showForeignPlaceholder,
26048
26327
  ctxAvailable: ctx != null
26049
26328
  });
26050
- React87__default.useEffect(() => {
26329
+ React89__default.useEffect(() => {
26051
26330
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
26052
26331
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
26053
26332
  return /* @__PURE__ */ jsx(
@@ -26061,11 +26340,11 @@ function useDataDnd(args) {
26061
26340
  }
26062
26341
  );
26063
26342
  };
26064
- const rootContextValue = React87__default.useMemo(
26343
+ const rootContextValue = React89__default.useMemo(
26065
26344
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
26066
26345
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
26067
26346
  );
26068
- const handleDragStart = React87__default.useCallback((event) => {
26347
+ const handleDragStart = React89__default.useCallback((event) => {
26069
26348
  const sourceZone = findZoneByItem(event.active.id);
26070
26349
  const rect = event.active.rect.current.initial;
26071
26350
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -26084,7 +26363,7 @@ function useDataDnd(args) {
26084
26363
  isRoot
26085
26364
  });
26086
26365
  }, [findZoneByItem, isRoot, zoneId]);
26087
- const handleDragOver = React87__default.useCallback((event) => {
26366
+ const handleDragOver = React89__default.useCallback((event) => {
26088
26367
  const { active, over } = event;
26089
26368
  const overData = over?.data?.current;
26090
26369
  const overGroup = overData?.dndGroup ?? null;
@@ -26154,7 +26433,7 @@ function useDataDnd(args) {
26154
26433
  return next;
26155
26434
  });
26156
26435
  }, []);
26157
- const handleDragCancel = React87__default.useCallback((event) => {
26436
+ const handleDragCancel = React89__default.useCallback((event) => {
26158
26437
  setActiveDrag(null);
26159
26438
  setOverZoneGroup(null);
26160
26439
  dndLog.warn("dragCancel", {
@@ -26162,12 +26441,12 @@ function useDataDnd(args) {
26162
26441
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
26163
26442
  });
26164
26443
  }, []);
26165
- const handleDragEndWithCleanup = React87__default.useCallback((event) => {
26444
+ const handleDragEndWithCleanup = React89__default.useCallback((event) => {
26166
26445
  handleDragEnd(event);
26167
26446
  setActiveDrag(null);
26168
26447
  setOverZoneGroup(null);
26169
26448
  }, [handleDragEnd]);
26170
- const wrapContainer = React87__default.useCallback(
26449
+ const wrapContainer = React89__default.useCallback(
26171
26450
  (children) => {
26172
26451
  if (!enabled) return children;
26173
26452
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -26221,7 +26500,7 @@ var init_useDataDnd = __esm({
26221
26500
  init_useAlmadarDndCollision();
26222
26501
  init_Box();
26223
26502
  dndLog = createLogger("almadar:ui:dnd");
26224
- RootCtx = React87__default.createContext(null);
26503
+ RootCtx = React89__default.createContext(null);
26225
26504
  }
26226
26505
  });
26227
26506
  function renderIconInput(icon, props) {
@@ -26736,7 +27015,7 @@ function DataList({
26736
27015
  }) {
26737
27016
  const eventBus = useEventBus();
26738
27017
  const { t } = useTranslate();
26739
- const [visibleCount, setVisibleCount] = React87__default.useState(pageSize || Infinity);
27018
+ const [visibleCount, setVisibleCount] = React89__default.useState(pageSize || Infinity);
26740
27019
  const fieldDefs = fields ?? columns ?? [];
26741
27020
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
26742
27021
  const dnd = useDataDnd({
@@ -26752,14 +27031,14 @@ function DataList({
26752
27031
  dndRoot
26753
27032
  });
26754
27033
  const orderedData = dnd.orderedItems;
26755
- const allData = React87__default.useMemo(
27034
+ const allData = React89__default.useMemo(
26756
27035
  () => sortRows(orderedData, sortBy, sortDirection),
26757
27036
  [orderedData, sortBy, sortDirection]
26758
27037
  );
26759
27038
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
26760
27039
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
26761
27040
  const hasRenderProp = typeof children === "function";
26762
- React87__default.useEffect(() => {
27041
+ React89__default.useEffect(() => {
26763
27042
  const renderItemTypeOf = typeof schemaRenderItem;
26764
27043
  const childrenTypeOf = typeof children;
26765
27044
  if (data.length > 0 && !hasRenderProp) {
@@ -26879,7 +27158,7 @@ function DataList({
26879
27158
  return v === void 0 || v === null || v === "" ? raw : String(v);
26880
27159
  };
26881
27160
  return /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: cn("py-2", className), children: [
26882
- groups2.map((group, gi) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
27161
+ groups2.map((group, gi) => /* @__PURE__ */ jsxs(React89__default.Fragment, { children: [
26883
27162
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
26884
27163
  group.items.map((itemData, index) => {
26885
27164
  const id = itemData.id || `${gi}-${index}`;
@@ -27095,7 +27374,7 @@ function DataList({
27095
27374
  className
27096
27375
  ),
27097
27376
  children: [
27098
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
27377
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React89__default.Fragment, { children: [
27099
27378
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
27100
27379
  group.items.map(
27101
27380
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -27182,7 +27461,7 @@ var init_FormSection = __esm({
27182
27461
  columns = 1,
27183
27462
  className
27184
27463
  }) => {
27185
- const [collapsed, setCollapsed] = React87__default.useState(defaultCollapsed);
27464
+ const [collapsed, setCollapsed] = React89__default.useState(defaultCollapsed);
27186
27465
  const { t } = useTranslate();
27187
27466
  const eventBus = useEventBus();
27188
27467
  const gridClass = {
@@ -27190,7 +27469,7 @@ var init_FormSection = __esm({
27190
27469
  2: "grid-cols-1 md:grid-cols-2",
27191
27470
  3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
27192
27471
  }[columns];
27193
- React87__default.useCallback(() => {
27472
+ React89__default.useCallback(() => {
27194
27473
  if (collapsible) {
27195
27474
  setCollapsed((prev) => !prev);
27196
27475
  eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
@@ -27463,6 +27742,112 @@ var init_GridPicker = __esm({
27463
27742
  GridPicker.displayName = "GridPicker";
27464
27743
  }
27465
27744
  });
27745
+ function useDraggable({ payload, disabled = false }) {
27746
+ const [isDragging, setIsDragging] = useState(false);
27747
+ const eventBus = useEventBus();
27748
+ const handleDragStart = useCallback(
27749
+ (e) => {
27750
+ if (disabled) {
27751
+ e.preventDefault();
27752
+ return;
27753
+ }
27754
+ e.dataTransfer.setData(ALMADAR_DND_MIME, JSON.stringify(payload));
27755
+ e.dataTransfer.effectAllowed = "copy";
27756
+ setIsDragging(true);
27757
+ eventBus.emit("UI:DRAG_START", { kind: payload.kind, data: payload.data });
27758
+ },
27759
+ [disabled, payload, eventBus]
27760
+ );
27761
+ const handleDragEnd = useCallback(
27762
+ (e) => {
27763
+ setIsDragging(false);
27764
+ eventBus.emit("UI:DRAG_END", { kind: payload.kind, data: payload.data });
27765
+ },
27766
+ [payload, eventBus]
27767
+ );
27768
+ const dragProps = useMemo(
27769
+ () => ({
27770
+ draggable: !disabled,
27771
+ onDragStart: handleDragStart,
27772
+ onDragEnd: handleDragEnd,
27773
+ "aria-grabbed": isDragging
27774
+ }),
27775
+ [disabled, handleDragStart, handleDragEnd, isDragging]
27776
+ );
27777
+ return { dragProps, isDragging };
27778
+ }
27779
+ var ALMADAR_DND_MIME;
27780
+ var init_useDraggable = __esm({
27781
+ "hooks/useDraggable.ts"() {
27782
+ "use client";
27783
+ init_useEventBus();
27784
+ ALMADAR_DND_MIME = "application/x-almadar-dnd";
27785
+ }
27786
+ });
27787
+ function parsePayload(e) {
27788
+ try {
27789
+ const raw = e.dataTransfer.getData(ALMADAR_DND_MIME);
27790
+ if (!raw) return null;
27791
+ const parsed = JSON.parse(raw);
27792
+ if (typeof parsed.kind !== "string" || !parsed.data) return null;
27793
+ return parsed;
27794
+ } catch {
27795
+ return null;
27796
+ }
27797
+ }
27798
+ function hasAlmadarPayload(e) {
27799
+ return e.dataTransfer.types.includes(ALMADAR_DND_MIME);
27800
+ }
27801
+ function useDropZone({ accepts, onDrop, disabled = false }) {
27802
+ const [isOver, setIsOver] = useState(false);
27803
+ const eventBus = useEventBus();
27804
+ const handleDragOver = useCallback(
27805
+ (e) => {
27806
+ if (disabled) return;
27807
+ if (!hasAlmadarPayload(e)) return;
27808
+ e.preventDefault();
27809
+ e.dataTransfer.dropEffect = "copy";
27810
+ setIsOver(true);
27811
+ },
27812
+ [disabled]
27813
+ );
27814
+ const handleDragLeave = useCallback(
27815
+ (e) => {
27816
+ setIsOver(false);
27817
+ },
27818
+ []
27819
+ );
27820
+ const handleDrop = useCallback(
27821
+ (e) => {
27822
+ e.preventDefault();
27823
+ setIsOver(false);
27824
+ if (disabled) return;
27825
+ const payload = parsePayload(e);
27826
+ if (!payload) return;
27827
+ if (!accepts.includes(payload.kind)) return;
27828
+ const position = { x: e.clientX, y: e.clientY };
27829
+ onDrop(payload, position);
27830
+ eventBus.emit("UI:DROP", { kind: payload.kind, data: payload.data, ...position });
27831
+ },
27832
+ [disabled, accepts, onDrop, eventBus]
27833
+ );
27834
+ const dropProps = useMemo(
27835
+ () => ({
27836
+ onDragOver: handleDragOver,
27837
+ onDragLeave: handleDragLeave,
27838
+ onDrop: handleDrop
27839
+ }),
27840
+ [handleDragOver, handleDragLeave, handleDrop]
27841
+ );
27842
+ return { dropProps, isOver };
27843
+ }
27844
+ var init_useDropZone = __esm({
27845
+ "hooks/useDropZone.ts"() {
27846
+ "use client";
27847
+ init_useEventBus();
27848
+ init_useDraggable();
27849
+ }
27850
+ });
27466
27851
  function fileIcon(name) {
27467
27852
  const ext = name.split(".").pop()?.toLowerCase() ?? "";
27468
27853
  switch (ext) {
@@ -27488,6 +27873,13 @@ function fileIcon(name) {
27488
27873
  return "file";
27489
27874
  }
27490
27875
  }
27876
+ function siblingsOf(target, roots, childrenByParent) {
27877
+ if (target.parentId) {
27878
+ const parentSiblings = childrenByParent.get(target.parentId);
27879
+ if (parentSiblings?.some((sibling) => sibling.id === target.id)) return parentSiblings;
27880
+ }
27881
+ return roots;
27882
+ }
27491
27883
  function ancestorsOf(id, byId) {
27492
27884
  const out = /* @__PURE__ */ new Set();
27493
27885
  if (!id) return out;
@@ -27505,6 +27897,8 @@ var init_FileTree = __esm({
27505
27897
  init_Box();
27506
27898
  init_Typography();
27507
27899
  init_Icon();
27900
+ init_useDraggable();
27901
+ init_useDropZone();
27508
27902
  TreeNodeItem = ({
27509
27903
  node,
27510
27904
  depth,
@@ -27588,10 +27982,12 @@ var init_FileTree = __esm({
27588
27982
  depth,
27589
27983
  indent,
27590
27984
  childrenByParent,
27985
+ roots,
27591
27986
  onNodeSelect,
27592
27987
  onNodeAction,
27593
27988
  nodeActionIcon,
27594
27989
  nodeActionLabel,
27990
+ onNodeReorder,
27595
27991
  selectedId,
27596
27992
  look,
27597
27993
  isExpanded,
@@ -27602,6 +27998,7 @@ var init_FileTree = __esm({
27602
27998
  const expanded = hasChildren && isExpanded(item.id, depth);
27603
27999
  const isSelected = selectedId !== void 0 && selectedId !== "" && item.id === selectedId;
27604
28000
  const nav = look === "nav";
28001
+ const rowRef = useRef(null);
27605
28002
  const handleClick = useCallback(() => {
27606
28003
  if (hasChildren && !onNodeSelect) onToggle(item.id, expanded);
27607
28004
  onNodeSelect?.(item.id);
@@ -27614,16 +28011,50 @@ var init_FileTree = __esm({
27614
28011
  e.stopPropagation();
27615
28012
  onNodeAction?.(item.id);
27616
28013
  }, [item.id, onNodeAction]);
28014
+ const { dragProps } = useDraggable({
28015
+ payload: { kind: "tree-node", data: { id: item.id } },
28016
+ disabled: !onNodeReorder
28017
+ });
28018
+ const handleRowDrop = useCallback(
28019
+ (payload, position) => {
28020
+ if (!onNodeReorder) return;
28021
+ const draggedId = typeof payload.data.id === "string" ? payload.data.id : void 0;
28022
+ if (!draggedId || draggedId === item.id) return;
28023
+ const rect = rowRef.current?.getBoundingClientRect();
28024
+ if (!rect || rect.height === 0) return;
28025
+ const relY = position.y - rect.top;
28026
+ const third = rect.height / 3;
28027
+ if (relY >= third && relY <= third * 2) {
28028
+ const existingChildren = childrenByParent.get(item.id);
28029
+ onNodeReorder(draggedId, item.id, existingChildren ? existingChildren.length : 0);
28030
+ return;
28031
+ }
28032
+ const siblings = siblingsOf(item, roots, childrenByParent);
28033
+ const newParentId = siblings === roots ? null : item.parentId ?? null;
28034
+ const targetIndex = siblings.findIndex((sibling) => sibling.id === item.id);
28035
+ const index = relY < third ? targetIndex < 0 ? 0 : targetIndex : targetIndex < 0 ? siblings.length : targetIndex + 1;
28036
+ onNodeReorder(draggedId, newParentId, index);
28037
+ },
28038
+ [onNodeReorder, item, roots, childrenByParent]
28039
+ );
28040
+ const { dropProps } = useDropZone({
28041
+ accepts: ["tree-node"],
28042
+ onDrop: handleRowDrop,
28043
+ disabled: !onNodeReorder
28044
+ });
27617
28045
  return /* @__PURE__ */ jsxs(Fragment, { children: [
27618
28046
  /* @__PURE__ */ jsxs(
27619
28047
  Box,
27620
28048
  {
28049
+ ref: rowRef,
27621
28050
  className: `group/treerow flex items-center gap-1.5 px-2 cursor-pointer rounded-sm transition-colors ${nav ? "py-1" : "py-0.5"} ${isSelected ? "bg-primary text-primary-foreground" : nav ? "text-foreground hover:bg-muted" : "hover:bg-muted"}`,
27622
28051
  style: { paddingLeft: depth * indent + 8 },
27623
28052
  onClick: handleClick,
27624
28053
  role: "treeitem",
27625
28054
  "aria-selected": isSelected,
27626
28055
  "aria-expanded": hasChildren ? expanded : void 0,
28056
+ ...dragProps,
28057
+ ...dropProps,
27627
28058
  children: [
27628
28059
  hasChildren ? /* @__PURE__ */ jsx(Box, { onClick: handleChevron, className: "flex items-center flex-shrink-0", role: "button", "aria-label": expanded ? "Collapse" : "Expand", children: /* @__PURE__ */ jsx(
27629
28060
  Icon,
@@ -27670,10 +28101,12 @@ var init_FileTree = __esm({
27670
28101
  depth: depth + 1,
27671
28102
  indent,
27672
28103
  childrenByParent,
28104
+ roots,
27673
28105
  onNodeSelect,
27674
28106
  onNodeAction,
27675
28107
  nodeActionIcon,
27676
28108
  nodeActionLabel,
28109
+ onNodeReorder,
27677
28110
  selectedId,
27678
28111
  look,
27679
28112
  isExpanded,
@@ -27691,14 +28124,15 @@ var init_FileTree = __esm({
27691
28124
  onNodeAction,
27692
28125
  nodeActionIcon,
27693
28126
  nodeActionLabel,
28127
+ onNodeReorder,
27694
28128
  className,
27695
28129
  indent = 16
27696
28130
  }) => {
27697
28131
  const [overrides, setOverrides] = useState(() => /* @__PURE__ */ new Map());
27698
- const byId = React87__default.useMemo(() => new Map(items.map((node) => [node.id, node])), [items]);
27699
- const selectedAncestors = React87__default.useMemo(() => ancestorsOf(selectedId, byId), [selectedId, byId]);
27700
- const lastSelectedRef = React87__default.useRef(selectedId);
27701
- React87__default.useEffect(() => {
28132
+ const byId = React89__default.useMemo(() => new Map(items.map((node) => [node.id, node])), [items]);
28133
+ const selectedAncestors = React89__default.useMemo(() => ancestorsOf(selectedId, byId), [selectedId, byId]);
28134
+ const lastSelectedRef = React89__default.useRef(selectedId);
28135
+ React89__default.useEffect(() => {
27702
28136
  if (selectedId === lastSelectedRef.current) return;
27703
28137
  lastSelectedRef.current = selectedId;
27704
28138
  setOverrides((prev) => {
@@ -27739,10 +28173,12 @@ var init_FileTree = __esm({
27739
28173
  depth: 0,
27740
28174
  indent,
27741
28175
  childrenByParent,
28176
+ roots,
27742
28177
  onNodeSelect,
27743
28178
  onNodeAction,
27744
28179
  nodeActionIcon,
27745
28180
  nodeActionLabel,
28181
+ onNodeReorder,
27746
28182
  selectedId,
27747
28183
  look,
27748
28184
  isExpanded,
@@ -27762,6 +28198,7 @@ var init_FileTree = __esm({
27762
28198
  onNodeAction,
27763
28199
  nodeActionIcon,
27764
28200
  nodeActionLabel,
28201
+ onNodeReorder,
27765
28202
  className,
27766
28203
  indent = 16
27767
28204
  }) => {
@@ -27776,6 +28213,7 @@ var init_FileTree = __esm({
27776
28213
  onNodeAction,
27777
28214
  nodeActionIcon,
27778
28215
  nodeActionLabel,
28216
+ onNodeReorder,
27779
28217
  className,
27780
28218
  indent
27781
28219
  }
@@ -28528,7 +28966,7 @@ var init_Flex = __esm({
28528
28966
  flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
28529
28967
  }
28530
28968
  }
28531
- return React87__default.createElement(Component, {
28969
+ return React89__default.createElement(Component, {
28532
28970
  className: cn(
28533
28971
  inline ? "inline-flex" : "flex",
28534
28972
  directionStyles[direction],
@@ -28647,7 +29085,7 @@ var init_Grid = __esm({
28647
29085
  as: Component = "div"
28648
29086
  }) => {
28649
29087
  const mergedStyle = rows ? { gridTemplateRows: `repeat(${rows}, minmax(0, 1fr))`, ...style } : style;
28650
- return React87__default.createElement(
29088
+ return React89__default.createElement(
28651
29089
  Component,
28652
29090
  {
28653
29091
  className: cn(
@@ -29069,9 +29507,9 @@ var init_Popover = __esm({
29069
29507
  onMouseLeave: handleClose,
29070
29508
  onPointerDown: tapTriggerProps.onPointerDown
29071
29509
  };
29072
- const childElement = React87__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
29510
+ const childElement = React89__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
29073
29511
  const childPointerDown = childElement.props.onPointerDown;
29074
- const triggerElement = React87__default.cloneElement(
29512
+ const triggerElement = React89__default.cloneElement(
29075
29513
  childElement,
29076
29514
  {
29077
29515
  ref: triggerRef,
@@ -29685,9 +30123,9 @@ var init_Tooltip = __esm({
29685
30123
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
29686
30124
  };
29687
30125
  }, []);
29688
- const triggerElement = React87__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
30126
+ const triggerElement = React89__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
29689
30127
  const childPointerDown = triggerElement.props.onPointerDown;
29690
- const trigger = React87__default.cloneElement(triggerElement, {
30128
+ const trigger = React89__default.cloneElement(triggerElement, {
29691
30129
  ref: triggerRef,
29692
30130
  onMouseEnter: handleMouseEnter,
29693
30131
  onMouseLeave: handleMouseLeave,
@@ -29777,7 +30215,7 @@ var init_WizardProgress = __esm({
29777
30215
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
29778
30216
  const isActive = index === currentStep;
29779
30217
  const isCompleted = index < currentStep;
29780
- return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
30218
+ return /* @__PURE__ */ jsxs(React89__default.Fragment, { children: [
29781
30219
  /* @__PURE__ */ jsx(
29782
30220
  "button",
29783
30221
  {
@@ -30839,6 +31277,8 @@ var init_MathCanvas = __esm({
30839
31277
  gridColor = "var(--color-border, #9ca3af)",
30840
31278
  axisColor = "var(--color-muted-foreground, #374151)",
30841
31279
  showTickLabels = false,
31280
+ tickLabelFontSize = 10,
31281
+ labelFontSize = 12,
30842
31282
  showCurveLabels = false,
30843
31283
  curves = [],
30844
31284
  points = [],
@@ -30910,18 +31350,18 @@ var init_MathCanvas = __esm({
30910
31350
  let kx = 0;
30911
31351
  for (let x = Math.ceil(xMin / gridStep) * gridStep; x <= xMax; x += gridStep, kx++) {
30912
31352
  if (kx % labelEveryX === 0 && x !== 0) {
30913
- out.push({ type: "text", x: mapX(x), y: xAxisY + 12, text: formatTick(x), color: "#6b7280", fontSize: 10, align: "center" });
31353
+ out.push({ type: "text", x: mapX(x), y: xAxisY + 12, text: formatTick(x), color: "#6b7280", fontSize: tickLabelFontSize, align: "center" });
30914
31354
  }
30915
31355
  }
30916
31356
  const labelEveryY = Math.max(1, Math.ceil((yMax - yMin) / gridStep / Math.floor(plotH / 28)));
30917
31357
  let ky = 0;
30918
31358
  for (let y = Math.ceil(yMin / gridStep) * gridStep; y <= yMax; y += gridStep, ky++) {
30919
31359
  if (ky % labelEveryY === 0 && y !== 0) {
30920
- out.push({ type: "text", x: yAxisX - 6, y: mapY(y), text: formatTick(y), color: "#6b7280", fontSize: 10, align: "right" });
31360
+ out.push({ type: "text", x: yAxisX - 6, y: mapY(y), text: formatTick(y), color: "#6b7280", fontSize: tickLabelFontSize, align: "right" });
30921
31361
  }
30922
31362
  }
30923
31363
  if (xMin <= 0 && xMax >= 0 && yMin <= 0 && yMax >= 0) {
30924
- out.push({ type: "text", x: yAxisX - 6, y: xAxisY + 12, text: "0", color: "#6b7280", fontSize: 10, align: "right" });
31364
+ out.push({ type: "text", x: yAxisX - 6, y: xAxisY + 12, text: "0", color: "#6b7280", fontSize: tickLabelFontSize, align: "right" });
30925
31365
  }
30926
31366
  }
30927
31367
  for (const region of regions) {
@@ -30952,7 +31392,7 @@ var init_MathCanvas = __esm({
30952
31392
  y: (mapY(region.samples[mid].y) + mapY(baseline)) / 2,
30953
31393
  text: region.label,
30954
31394
  color,
30955
- fontSize: 11
31395
+ fontSize: labelFontSize
30956
31396
  });
30957
31397
  }
30958
31398
  }
@@ -30991,7 +31431,7 @@ var init_MathCanvas = __esm({
30991
31431
  const py = mapY(guide.at);
30992
31432
  out.push({ type: "line", x1: margin, y1: py, x2: width - margin, y2: py, color, dash });
30993
31433
  if (guide.label) {
30994
- out.push({ type: "text", x: width - margin - 4, y: py - 8, text: guide.label, color, fontSize: 11, align: "right" });
31434
+ out.push({ type: "text", x: width - margin - 4, y: py - 8, text: guide.label, color, fontSize: labelFontSize, align: "right" });
30995
31435
  }
30996
31436
  }
30997
31437
  }
@@ -31034,7 +31474,7 @@ var init_MathCanvas = __esm({
31034
31474
  y: mapY(lastInRange.y) - 6,
31035
31475
  text: curve.label,
31036
31476
  color: curve.color ?? "#2563eb",
31037
- fontSize: 11
31477
+ fontSize: labelFontSize
31038
31478
  });
31039
31479
  }
31040
31480
  }
@@ -31071,7 +31511,7 @@ var init_MathCanvas = __esm({
31071
31511
  y: xAxisY - peak - 8,
31072
31512
  text: hop.label,
31073
31513
  color,
31074
- fontSize: 10,
31514
+ fontSize: labelFontSize,
31075
31515
  align: "center"
31076
31516
  });
31077
31517
  }
@@ -31098,7 +31538,7 @@ var init_MathCanvas = __esm({
31098
31538
  y: mapY(angle.y + 1.35 * radius * Math.sin(rad)),
31099
31539
  text: angle.label,
31100
31540
  color,
31101
- fontSize: 11,
31541
+ fontSize: labelFontSize,
31102
31542
  align: "center"
31103
31543
  });
31104
31544
  }
@@ -31115,7 +31555,7 @@ var init_MathCanvas = __esm({
31115
31555
  fill: isOpen ? "#ffffff" : p.color ?? "#dc2626"
31116
31556
  });
31117
31557
  if (p.label) {
31118
- out.push({ type: "text", x: mapX(p.x) + 8, y: mapY(p.y) - 8, text: p.label, color: p.color ?? "#111827", fontSize: 12 });
31558
+ out.push({ type: "text", x: mapX(p.x) + 8, y: mapY(p.y) - 8, text: p.label, color: p.color ?? "#111827", fontSize: labelFontSize });
31119
31559
  }
31120
31560
  }
31121
31561
  for (const v of vectors) {
@@ -31126,7 +31566,7 @@ var init_MathCanvas = __esm({
31126
31566
  const y2 = mapY(v.y + v.vy);
31127
31567
  out.push({ type: "arrow", x1, y1, x2, y2, color: v.color ?? "#7c3aed", lineWidth: 2 });
31128
31568
  if (v.label) {
31129
- out.push({ type: "text", x: x2 + 6, y: y2 - 6, text: v.label, color: v.color ?? "#7c3aed", fontSize: 12 });
31569
+ out.push({ type: "text", x: x2 + 6, y: y2 - 6, text: v.label, color: v.color ?? "#7c3aed", fontSize: labelFontSize });
31130
31570
  }
31131
31571
  }
31132
31572
  out.push(...shapes);
@@ -31145,6 +31585,8 @@ var init_MathCanvas = __esm({
31145
31585
  gridColor,
31146
31586
  axisColor,
31147
31587
  showTickLabels,
31588
+ tickLabelFontSize,
31589
+ labelFontSize,
31148
31590
  showCurveLabels,
31149
31591
  curves,
31150
31592
  points,
@@ -32432,13 +32874,13 @@ var init_MapView = __esm({
32432
32874
  shadowSize: [41, 41]
32433
32875
  });
32434
32876
  L.Marker.prototype.options.icon = defaultIcon;
32435
- const { useEffect: useEffect67, useRef: useRef65, useCallback: useCallback97, useState: useState98 } = React87__default;
32877
+ const { useEffect: useEffect68, useRef: useRef67, useCallback: useCallback100, useState: useState102 } = React89__default;
32436
32878
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
32437
32879
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
32438
32880
  function MapUpdater({ centerLat, centerLng, zoom }) {
32439
32881
  const map = useMap();
32440
- const prevRef = useRef65({ centerLat, centerLng, zoom });
32441
- useEffect67(() => {
32882
+ const prevRef = useRef67({ centerLat, centerLng, zoom });
32883
+ useEffect68(() => {
32442
32884
  const prev = prevRef.current;
32443
32885
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
32444
32886
  map.setView([centerLat, centerLng], zoom);
@@ -32449,7 +32891,7 @@ var init_MapView = __esm({
32449
32891
  }
32450
32892
  function MapClickHandler({ onMapClick }) {
32451
32893
  const map = useMap();
32452
- useEffect67(() => {
32894
+ useEffect68(() => {
32453
32895
  if (!onMapClick) return;
32454
32896
  const handler = (e) => {
32455
32897
  onMapClick(e.latlng.lat, e.latlng.lng);
@@ -32477,8 +32919,8 @@ var init_MapView = __esm({
32477
32919
  showAttribution = true
32478
32920
  }) {
32479
32921
  const eventBus = useEventBus2();
32480
- const [clickedPosition, setClickedPosition] = useState98(null);
32481
- const handleMapClick = useCallback97((lat, lng) => {
32922
+ const [clickedPosition, setClickedPosition] = useState102(null);
32923
+ const handleMapClick = useCallback100((lat, lng) => {
32482
32924
  if (showClickedPin) {
32483
32925
  setClickedPosition({ lat, lng });
32484
32926
  }
@@ -32487,7 +32929,7 @@ var init_MapView = __esm({
32487
32929
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
32488
32930
  }
32489
32931
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
32490
- const handleMarkerClick = useCallback97((marker) => {
32932
+ const handleMarkerClick = useCallback100((marker) => {
32491
32933
  onMarkerClick?.(marker);
32492
32934
  if (markerClickEvent) {
32493
32935
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -33377,8 +33819,8 @@ function TableView({
33377
33819
  }) {
33378
33820
  const eventBus = useEventBus();
33379
33821
  const { t } = useTranslate();
33380
- const [visibleCount, setVisibleCount] = React87__default.useState(pageSize > 0 ? pageSize : Infinity);
33381
- const [localSelected, setLocalSelected] = React87__default.useState(/* @__PURE__ */ new Set());
33822
+ const [visibleCount, setVisibleCount] = React89__default.useState(pageSize > 0 ? pageSize : Infinity);
33823
+ const [localSelected, setLocalSelected] = React89__default.useState(/* @__PURE__ */ new Set());
33382
33824
  const colDefs = (Array.isArray(columns) ? columns : void 0) ?? (Array.isArray(fields) ? fields : void 0) ?? [];
33383
33825
  const actionDefs = Array.isArray(itemActions) ? itemActions : [];
33384
33826
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
@@ -33399,7 +33841,7 @@ function TableView({
33399
33841
  const hasMore = pageSize > 0 && visibleCount < ordered2.length;
33400
33842
  const hasRenderProp = typeof children === "function";
33401
33843
  const idField = dndItemIdField ?? "id";
33402
- React87__default.useEffect(() => {
33844
+ React89__default.useEffect(() => {
33403
33845
  tableViewLog.debug("render", {
33404
33846
  rowCount: data.length,
33405
33847
  colCount: colDefs.length,
@@ -33449,7 +33891,7 @@ function TableView({
33449
33891
  };
33450
33892
  eventBus.emit(`UI:${rowClickEvent}`, payload);
33451
33893
  };
33452
- const colFloors = React87__default.useMemo(
33894
+ const colFloors = React89__default.useMemo(
33453
33895
  () => colDefs.map((col) => {
33454
33896
  const longest = data.reduce((widest, row) => {
33455
33897
  const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
@@ -33592,12 +34034,12 @@ function TableView({
33592
34034
  ]
33593
34035
  }
33594
34036
  );
33595
- return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React87__default.Fragment, { children: rowInner }, id);
34037
+ return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React89__default.Fragment, { children: rowInner }, id);
33596
34038
  };
33597
34039
  const items = Array.from(data);
33598
34040
  const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
33599
34041
  let runningIndex = 0;
33600
- const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
34042
+ const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React89__default.Fragment, { children: [
33601
34043
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
33602
34044
  group.items.map((row) => renderRow(row, runningIndex++))
33603
34045
  ] }, gi)) });
@@ -34966,7 +35408,7 @@ var init_StepFlow = __esm({
34966
35408
  className
34967
35409
  }) => {
34968
35410
  if (orientation === "vertical") {
34969
- return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React87__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
35411
+ return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React89__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
34970
35412
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
34971
35413
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
34972
35414
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -34977,7 +35419,7 @@ var init_StepFlow = __esm({
34977
35419
  ] })
34978
35420
  ] }) }, index)) });
34979
35421
  }
34980
- return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
35422
+ return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React89__default.Fragment, { children: [
34981
35423
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
34982
35424
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
34983
35425
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -35967,7 +36409,7 @@ var init_LikertScale = __esm({
35967
36409
  md: "text-base",
35968
36410
  lg: "text-lg"
35969
36411
  };
35970
- LikertScale = React87__default.forwardRef(
36412
+ LikertScale = React89__default.forwardRef(
35971
36413
  ({
35972
36414
  question,
35973
36415
  options = DEFAULT_LIKERT_OPTIONS,
@@ -35979,7 +36421,7 @@ var init_LikertScale = __esm({
35979
36421
  variant = "radios",
35980
36422
  className
35981
36423
  }, ref) => {
35982
- const groupId = React87__default.useId();
36424
+ const groupId = React89__default.useId();
35983
36425
  const eventBus = useEventBus();
35984
36426
  const handleSelect = useCallback(
35985
36427
  (next) => {
@@ -38402,7 +38844,7 @@ var init_DocBreadcrumb = __esm({
38402
38844
  "aria-label": t("aria.breadcrumb"),
38403
38845
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
38404
38846
  const isLast = idx === items.length - 1;
38405
- return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
38847
+ return /* @__PURE__ */ jsxs(React89__default.Fragment, { children: [
38406
38848
  idx > 0 && /* @__PURE__ */ jsx(
38407
38849
  Icon,
38408
38850
  {
@@ -39271,7 +39713,7 @@ var init_MiniStateMachine = __esm({
39271
39713
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
39272
39714
  const tc = transitionCounts[s.name] ?? 0;
39273
39715
  const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
39274
- return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
39716
+ return /* @__PURE__ */ jsxs(React89__default.Fragment, { children: [
39275
39717
  /* @__PURE__ */ jsx(
39276
39718
  AvlState,
39277
39719
  {
@@ -39476,7 +39918,7 @@ var init_PageHeader = __esm({
39476
39918
  info: "bg-info/10 text-info"
39477
39919
  };
39478
39920
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
39479
- 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(React87__default.Fragment, { children: [
39921
+ 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(React89__default.Fragment, { children: [
39480
39922
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
39481
39923
  crumb.href ? /* @__PURE__ */ jsx(
39482
39924
  "a",
@@ -39834,7 +40276,7 @@ var init_Section = __esm({
39834
40276
  as: Component = "section"
39835
40277
  }) => {
39836
40278
  const hasHeader = title || description || action;
39837
- return React87__default.createElement(
40279
+ return React89__default.createElement(
39838
40280
  Component,
39839
40281
  {
39840
40282
  className: cn(
@@ -40208,7 +40650,7 @@ var init_WizardContainer = __esm({
40208
40650
  const isCompleted = index < currentStep;
40209
40651
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
40210
40652
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
40211
- return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
40653
+ return /* @__PURE__ */ jsxs(React89__default.Fragment, { children: [
40212
40654
  /* @__PURE__ */ jsx(
40213
40655
  Button,
40214
40656
  {
@@ -41995,7 +42437,7 @@ var init_ImportPreviewTree = __esm({
41995
42437
  const renderUnit = (unit, childrenByParent, depth) => {
41996
42438
  const summary = fieldSummary(unit);
41997
42439
  const children = childrenByParent.get(unit.ref) ?? [];
41998
- return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
42440
+ return /* @__PURE__ */ jsxs(React89__default.Fragment, { children: [
41999
42441
  /* @__PURE__ */ jsxs(
42000
42442
  Box,
42001
42443
  {
@@ -42092,7 +42534,7 @@ var init_ImportProgress = __esm({
42092
42534
  PIPELINE.map((key, index) => {
42093
42535
  const isComplete = index < currentIndex;
42094
42536
  const isActive = index === currentIndex;
42095
- return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
42537
+ return /* @__PURE__ */ jsxs(React89__default.Fragment, { children: [
42096
42538
  index > 0 ? /* @__PURE__ */ jsx(Box, { className: "h-px w-4 bg-border" }) : null,
42097
42539
  /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", "data-testid": `import-progress-step-${key}`, children: [
42098
42540
  /* @__PURE__ */ jsx(
@@ -42220,6 +42662,69 @@ var init_ReflectionBlock = __esm({
42220
42662
  ReflectionBlock.displayName = "ReflectionBlock";
42221
42663
  }
42222
42664
  });
42665
+ var positionClasses, FloatingToolbar;
42666
+ var init_FloatingToolbar = __esm({
42667
+ "components/core/molecules/FloatingToolbar.tsx"() {
42668
+ "use client";
42669
+ init_Button();
42670
+ init_Box();
42671
+ init_Divider();
42672
+ init_Typography();
42673
+ init_ButtonGroup();
42674
+ init_cn();
42675
+ init_useEventBus();
42676
+ positionClasses = {
42677
+ "bottom-center": "bottom-6 left-1/2 -translate-x-1/2",
42678
+ "bottom-left": "bottom-6 left-6",
42679
+ "bottom-right": "bottom-6 right-6"
42680
+ };
42681
+ FloatingToolbar = ({
42682
+ items,
42683
+ position = "bottom-center",
42684
+ children,
42685
+ className
42686
+ }) => {
42687
+ const eventBus = useEventBus();
42688
+ return /* @__PURE__ */ jsx(Box, { className: cn("fixed z-50", positionClasses[position]), children: /* @__PURE__ */ jsxs(
42689
+ ButtonGroup,
42690
+ {
42691
+ variant: "default",
42692
+ orientation: "horizontal",
42693
+ className: cn(
42694
+ "items-center gap-1 rounded-full border border-border",
42695
+ "bg-card/95 backdrop-blur-sm shadow-elevation-popover p-1",
42696
+ className
42697
+ ),
42698
+ children: [
42699
+ items.map((item) => /* @__PURE__ */ jsx(
42700
+ Button,
42701
+ {
42702
+ variant: item.active ? "primary" : "ghost",
42703
+ size: "sm",
42704
+ icon: item.icon,
42705
+ action: item.action,
42706
+ actionPayload: item.actionPayload,
42707
+ disabled: item.disabled,
42708
+ "aria-pressed": item.active,
42709
+ "aria-label": item.label,
42710
+ className: "rounded-full",
42711
+ "data-testid": item.testId ?? `floating-toolbar-item-${item.id}`,
42712
+ onClick: () => {
42713
+ if (item.event) eventBus.emit(`UI:${item.event}`, { actionId: item.id });
42714
+ },
42715
+ children: /* @__PURE__ */ jsx(Typography, { as: "span", className: "sr-only", children: item.label })
42716
+ },
42717
+ item.id
42718
+ )),
42719
+ children && items.length > 0 && /* @__PURE__ */ jsx(Divider, { orientation: "vertical", className: "h-6 mx-1" }),
42720
+ children
42721
+ ]
42722
+ }
42723
+ ) });
42724
+ };
42725
+ FloatingToolbar.displayName = "FloatingToolbar";
42726
+ }
42727
+ });
42223
42728
 
42224
42729
  // components/core/molecules/index.ts
42225
42730
  var init_molecules2 = __esm({
@@ -42970,7 +43475,7 @@ var init_DetailPanel = __esm({
42970
43475
  }) => {
42971
43476
  const eventBus = useEventBus();
42972
43477
  const { t } = useTranslate();
42973
- const [titleDraft, setTitleDraft] = React87__default.useState(null);
43478
+ const [titleDraft, setTitleDraft] = React89__default.useState(null);
42974
43479
  const isFieldDefArray = (arr) => {
42975
43480
  if (!arr || arr.length === 0) return false;
42976
43481
  const first = arr[0];
@@ -43363,8 +43868,224 @@ var init_DetailPanel = __esm({
43363
43868
  DetailPanel.displayName = "DetailPanel";
43364
43869
  }
43365
43870
  });
43871
+ var SplitPane;
43872
+ var init_SplitPane = __esm({
43873
+ "components/core/organisms/layout/SplitPane.tsx"() {
43874
+ "use client";
43875
+ init_cn();
43876
+ SplitPane = ({
43877
+ direction = "horizontal",
43878
+ ratio: ratioProp = 50,
43879
+ minSize = 100,
43880
+ resizable = true,
43881
+ left,
43882
+ right,
43883
+ className,
43884
+ leftClassName,
43885
+ rightClassName,
43886
+ onRatioChange
43887
+ }) => {
43888
+ const [uncontrolledRatio, setUncontrolledRatio] = useState(ratioProp);
43889
+ const ratio = onRatioChange ? ratioProp : uncontrolledRatio;
43890
+ const containerRef = useRef(null);
43891
+ const isDragging = useRef(false);
43892
+ const handlePointerDown = useCallback(
43893
+ (e) => {
43894
+ if (!resizable) return;
43895
+ e.preventDefault();
43896
+ isDragging.current = true;
43897
+ e.currentTarget.setPointerCapture(e.pointerId);
43898
+ const handlePointerMove = (ev) => {
43899
+ if (!isDragging.current || !containerRef.current) return;
43900
+ const rect = containerRef.current.getBoundingClientRect();
43901
+ let newRatio;
43902
+ if (direction === "horizontal") {
43903
+ const x = ev.clientX - rect.left;
43904
+ newRatio = x / rect.width * 100;
43905
+ } else {
43906
+ const y = ev.clientY - rect.top;
43907
+ newRatio = y / rect.height * 100;
43908
+ }
43909
+ const minRatio = minSize / (direction === "horizontal" ? rect.width : rect.height) * 100;
43910
+ const maxRatio = 100 - minRatio;
43911
+ newRatio = Math.max(minRatio, Math.min(maxRatio, newRatio));
43912
+ if (onRatioChange) {
43913
+ onRatioChange(newRatio);
43914
+ } else {
43915
+ setUncontrolledRatio(newRatio);
43916
+ }
43917
+ };
43918
+ const handlePointerUp = () => {
43919
+ isDragging.current = false;
43920
+ document.removeEventListener("pointermove", handlePointerMove);
43921
+ document.removeEventListener("pointerup", handlePointerUp);
43922
+ document.removeEventListener("pointercancel", handlePointerUp);
43923
+ };
43924
+ document.addEventListener("pointermove", handlePointerMove);
43925
+ document.addEventListener("pointerup", handlePointerUp);
43926
+ document.addEventListener("pointercancel", handlePointerUp);
43927
+ },
43928
+ [direction, minSize, resizable, onRatioChange]
43929
+ );
43930
+ const isHorizontal = direction === "horizontal";
43931
+ return /* @__PURE__ */ jsxs(
43932
+ "div",
43933
+ {
43934
+ ref: containerRef,
43935
+ className: cn(
43936
+ "flex w-full h-full",
43937
+ isHorizontal ? "flex-row" : "flex-col",
43938
+ className
43939
+ ),
43940
+ children: [
43941
+ /* @__PURE__ */ jsx(
43942
+ "div",
43943
+ {
43944
+ className: cn("flex flex-col overflow-auto", leftClassName),
43945
+ style: {
43946
+ [isHorizontal ? "width" : "height"]: `${ratio}%`,
43947
+ flexShrink: 0
43948
+ },
43949
+ children: left
43950
+ }
43951
+ ),
43952
+ resizable && /* @__PURE__ */ jsx(
43953
+ "div",
43954
+ {
43955
+ onPointerDown: handlePointerDown,
43956
+ className: cn(
43957
+ "flex-shrink-0 bg-border transition-colors touch-none",
43958
+ isHorizontal ? "w-1 cursor-col-resize hover:w-1.5 hover:bg-muted-foreground" : "h-1 cursor-row-resize hover:h-1.5 hover:bg-muted-foreground"
43959
+ )
43960
+ }
43961
+ ),
43962
+ /* @__PURE__ */ jsx("div", { className: cn("flex flex-col flex-1 min-h-0 min-w-0 overflow-auto", rightClassName), children: right })
43963
+ ]
43964
+ }
43965
+ );
43966
+ };
43967
+ SplitPane.displayName = "SplitPane";
43968
+ }
43969
+ });
43970
+ var DockLayout;
43971
+ var init_DockLayout = __esm({
43972
+ "components/core/organisms/layout/DockLayout.tsx"() {
43973
+ "use client";
43974
+ init_Box();
43975
+ init_Stack();
43976
+ init_cn();
43977
+ init_SplitPane();
43978
+ DockLayout = ({
43979
+ rail,
43980
+ sidebar,
43981
+ main,
43982
+ bottomPanel,
43983
+ statusBar,
43984
+ secondarySidebar,
43985
+ railWidth = 56,
43986
+ secondarySidebarWidth = 280,
43987
+ sidebarCollapsed = false,
43988
+ sidebarWidth = 20,
43989
+ onSidebarWidthChange,
43990
+ sidebarMinSize = 160,
43991
+ bottomPanelCollapsed = false,
43992
+ bottomPanelHeight = 30,
43993
+ onBottomPanelHeightChange,
43994
+ bottomPanelMinSize = 120,
43995
+ secondarySidebarCollapsed = false,
43996
+ className,
43997
+ railClassName,
43998
+ sidebarClassName,
43999
+ mainClassName,
44000
+ bottomPanelClassName,
44001
+ statusBarClassName,
44002
+ secondarySidebarClassName
44003
+ }) => {
44004
+ const showSidebar = Boolean(sidebar) && !sidebarCollapsed;
44005
+ const showBottomPanel = Boolean(bottomPanel) && !bottomPanelCollapsed;
44006
+ const showSecondarySidebar = Boolean(secondarySidebar) && !secondarySidebarCollapsed;
44007
+ const centerRow = /* @__PURE__ */ jsxs(HStack, { gap: "none", className: "flex-1 min-h-0 min-w-0", children: [
44008
+ /* @__PURE__ */ jsx(Box, { className: cn("flex-1 min-w-0 min-h-0 overflow-auto", mainClassName), children: main }),
44009
+ showSecondarySidebar && /* @__PURE__ */ jsx(
44010
+ Box,
44011
+ {
44012
+ className: cn(
44013
+ "flex-shrink-0 h-full overflow-auto border-l border-border",
44014
+ secondarySidebarClassName
44015
+ ),
44016
+ style: { width: secondarySidebarWidth },
44017
+ children: secondarySidebar
44018
+ }
44019
+ )
44020
+ ] });
44021
+ const sidebarAndCenter = showSidebar ? /* @__PURE__ */ jsx(
44022
+ SplitPane,
44023
+ {
44024
+ direction: "horizontal",
44025
+ ratio: sidebarWidth,
44026
+ onRatioChange: onSidebarWidthChange,
44027
+ minSize: sidebarMinSize,
44028
+ resizable: true,
44029
+ left: /* @__PURE__ */ jsx(Box, { className: cn("h-full overflow-auto", sidebarClassName), children: sidebar }),
44030
+ right: centerRow,
44031
+ className: "flex-1 min-h-0 min-w-0"
44032
+ }
44033
+ ) : centerRow;
44034
+ const body = /* @__PURE__ */ jsxs(HStack, { gap: "none", className: "flex-1 min-h-0 min-w-0", children: [
44035
+ rail && /* @__PURE__ */ jsx(
44036
+ Box,
44037
+ {
44038
+ className: cn(
44039
+ "flex-shrink-0 min-h-0 overflow-auto border-r border-border",
44040
+ railClassName
44041
+ ),
44042
+ style: { width: railWidth },
44043
+ children: rail
44044
+ }
44045
+ ),
44046
+ sidebarAndCenter
44047
+ ] });
44048
+ const bodyPlusBottom = showBottomPanel ? /* @__PURE__ */ jsx(
44049
+ SplitPane,
44050
+ {
44051
+ direction: "vertical",
44052
+ ratio: 100 - bottomPanelHeight,
44053
+ onRatioChange: (topRatio) => onBottomPanelHeightChange?.(100 - topRatio),
44054
+ minSize: bottomPanelMinSize,
44055
+ resizable: true,
44056
+ left: body,
44057
+ right: /* @__PURE__ */ jsx(
44058
+ Box,
44059
+ {
44060
+ className: cn(
44061
+ "h-full overflow-auto border-t border-border",
44062
+ bottomPanelClassName
44063
+ ),
44064
+ children: bottomPanel
44065
+ }
44066
+ ),
44067
+ className: "flex-1 min-h-0"
44068
+ }
44069
+ ) : body;
44070
+ return /* @__PURE__ */ jsxs(VStack, { gap: "none", className: cn("w-full h-full overflow-hidden", className), children: [
44071
+ bodyPlusBottom,
44072
+ statusBar && /* @__PURE__ */ jsx(
44073
+ Box,
44074
+ {
44075
+ className: cn(
44076
+ "flex-shrink-0 border-t border-border bg-background",
44077
+ statusBarClassName
44078
+ ),
44079
+ children: statusBar
44080
+ }
44081
+ )
44082
+ ] });
44083
+ };
44084
+ DockLayout.displayName = "DockLayout";
44085
+ }
44086
+ });
43366
44087
  function extractTitle(children) {
43367
- if (!React87__default.isValidElement(children)) return void 0;
44088
+ if (!React89__default.isValidElement(children)) return void 0;
43368
44089
  const props = children.props;
43369
44090
  if (typeof props.title === "string") {
43370
44091
  return props.title;
@@ -43726,7 +44447,7 @@ var init_Form = __esm({
43726
44447
  const isSchemaEntity = isOrbitalEntitySchema(entity);
43727
44448
  const resolvedEntity = isSchemaEntity ? entity : void 0;
43728
44449
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
43729
- const normalizedInitialData = React87__default.useMemo(() => {
44450
+ const normalizedInitialData = React89__default.useMemo(() => {
43730
44451
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
43731
44452
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
43732
44453
  const merged = entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
@@ -43745,7 +44466,7 @@ var init_Form = __esm({
43745
44466
  }
43746
44467
  return normalized;
43747
44468
  }, [entity, initialData]);
43748
- const entityDerivedFields = React87__default.useMemo(() => {
44469
+ const entityDerivedFields = React89__default.useMemo(() => {
43749
44470
  if (fields && fields.length > 0) return void 0;
43750
44471
  if (!resolvedEntity) return void 0;
43751
44472
  return resolvedEntity.fields.map(
@@ -43766,16 +44487,16 @@ var init_Form = __esm({
43766
44487
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
43767
44488
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
43768
44489
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
43769
- const [formData, setFormData] = React87__default.useState(
44490
+ const [formData, setFormData] = React89__default.useState(
43770
44491
  normalizedInitialData
43771
44492
  );
43772
- const [collapsedSections, setCollapsedSections] = React87__default.useState(
44493
+ const [collapsedSections, setCollapsedSections] = React89__default.useState(
43773
44494
  /* @__PURE__ */ new Set()
43774
44495
  );
43775
- const [submitError, setSubmitError] = React87__default.useState(null);
43776
- const formRef = React87__default.useRef(null);
44496
+ const [submitError, setSubmitError] = React89__default.useState(null);
44497
+ const formRef = React89__default.useRef(null);
43777
44498
  const formMode = props.mode;
43778
- const mountedRef = React87__default.useRef(false);
44499
+ const mountedRef = React89__default.useRef(false);
43779
44500
  if (!mountedRef.current) {
43780
44501
  mountedRef.current = true;
43781
44502
  debug("forms", "mount", {
@@ -43788,7 +44509,7 @@ var init_Form = __esm({
43788
44509
  });
43789
44510
  }
43790
44511
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
43791
- const evalContext = React87__default.useMemo(
44512
+ const evalContext = React89__default.useMemo(
43792
44513
  () => ({
43793
44514
  formValues: formData,
43794
44515
  globalVariables: externalContext?.globalVariables ?? {},
@@ -43797,7 +44518,7 @@ var init_Form = __esm({
43797
44518
  }),
43798
44519
  [formData, externalContext]
43799
44520
  );
43800
- React87__default.useEffect(() => {
44521
+ React89__default.useEffect(() => {
43801
44522
  debug("forms", "initialData-sync", {
43802
44523
  mode: formMode,
43803
44524
  normalizedInitialData,
@@ -43808,7 +44529,7 @@ var init_Form = __esm({
43808
44529
  setFormData(normalizedInitialData);
43809
44530
  }
43810
44531
  }, [normalizedInitialData]);
43811
- const processCalculations = React87__default.useCallback(
44532
+ const processCalculations = React89__default.useCallback(
43812
44533
  (changedFieldId, newFormData) => {
43813
44534
  if (!hiddenCalculations.length) return;
43814
44535
  const context = {
@@ -43833,7 +44554,7 @@ var init_Form = __esm({
43833
44554
  },
43834
44555
  [hiddenCalculations, externalContext, eventBus]
43835
44556
  );
43836
- const checkViolations = React87__default.useCallback(
44557
+ const checkViolations = React89__default.useCallback(
43837
44558
  (changedFieldId, newFormData) => {
43838
44559
  if (!violationTriggers.length) return;
43839
44560
  const context = {
@@ -43871,7 +44592,7 @@ var init_Form = __esm({
43871
44592
  processCalculations(name, newFormData);
43872
44593
  checkViolations(name, newFormData);
43873
44594
  };
43874
- const isFieldVisible = React87__default.useCallback(
44595
+ const isFieldVisible = React89__default.useCallback(
43875
44596
  (fieldName2) => {
43876
44597
  const condition = conditionalFields[fieldName2];
43877
44598
  if (!condition) return true;
@@ -43879,7 +44600,7 @@ var init_Form = __esm({
43879
44600
  },
43880
44601
  [conditionalFields, evalContext]
43881
44602
  );
43882
- const isSectionVisible = React87__default.useCallback(
44603
+ const isSectionVisible = React89__default.useCallback(
43883
44604
  (section) => {
43884
44605
  if (!section.condition) return true;
43885
44606
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -43955,7 +44676,7 @@ var init_Form = __esm({
43955
44676
  eventBus.emit(`UI:${onCancel}`);
43956
44677
  }
43957
44678
  };
43958
- const renderField = React87__default.useCallback(
44679
+ const renderField = React89__default.useCallback(
43959
44680
  (field) => {
43960
44681
  const fieldName2 = field.name || field.field;
43961
44682
  if (!fieldName2) return null;
@@ -43977,7 +44698,7 @@ var init_Form = __esm({
43977
44698
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
43978
44699
  );
43979
44700
  const effectiveFields = entityDerivedFields ?? fields;
43980
- const normalizedFields = React87__default.useMemo(() => {
44701
+ const normalizedFields = React89__default.useMemo(() => {
43981
44702
  if (!effectiveFields || effectiveFields.length === 0) return [];
43982
44703
  return effectiveFields.map((field) => {
43983
44704
  if (typeof field === "string") {
@@ -44012,7 +44733,7 @@ var init_Form = __esm({
44012
44733
  };
44013
44734
  });
44014
44735
  }, [effectiveFields, resolvedEntity, fieldOverrides]);
44015
- const schemaFields = React87__default.useMemo(() => {
44736
+ const schemaFields = React89__default.useMemo(() => {
44016
44737
  if (normalizedFields.length === 0) return null;
44017
44738
  if (isDebugEnabled()) {
44018
44739
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -44022,7 +44743,7 @@ var init_Form = __esm({
44022
44743
  }
44023
44744
  return normalizedFields.map(renderField).filter(Boolean);
44024
44745
  }, [normalizedFields, renderField, entityName, conditionalFields]);
44025
- const sectionElements = React87__default.useMemo(() => {
44746
+ const sectionElements = React89__default.useMemo(() => {
44026
44747
  if (!sections || sections.length === 0) return null;
44027
44748
  return sections.map((section) => {
44028
44749
  if (!isSectionVisible(section)) {
@@ -44858,7 +45579,7 @@ var init_List = __esm({
44858
45579
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
44859
45580
  return [];
44860
45581
  }, [entity]);
44861
- const getItemActions = React87__default.useCallback(
45582
+ const getItemActions = React89__default.useCallback(
44862
45583
  (item) => {
44863
45584
  if (!itemActions) return [];
44864
45585
  if (typeof itemActions === "function") {
@@ -45340,7 +46061,7 @@ var init_MediaGallery = __esm({
45340
46061
  [selectable, selectedItems, selectionEvent, eventBus]
45341
46062
  );
45342
46063
  const entityData = Array.isArray(entity) ? entity : [];
45343
- const items = React87__default.useMemo(() => {
46064
+ const items = React89__default.useMemo(() => {
45344
46065
  if (propItems && propItems.length > 0) return propItems;
45345
46066
  if (entityData.length === 0) return [];
45346
46067
  return entityData.map((record, idx) => {
@@ -45505,7 +46226,7 @@ var init_MediaGallery = __esm({
45505
46226
  }
45506
46227
  });
45507
46228
  function extractTitle2(children) {
45508
- if (!React87__default.isValidElement(children)) return void 0;
46229
+ if (!React89__default.isValidElement(children)) return void 0;
45509
46230
  const props = children.props;
45510
46231
  if (typeof props.title === "string") {
45511
46232
  return props.title;
@@ -45760,7 +46481,7 @@ var init_debugRegistry = __esm({
45760
46481
  }
45761
46482
  });
45762
46483
  function useDebugData() {
45763
- const [data, setData] = React87.useState(() => ({
46484
+ const [data, setData] = React89.useState(() => ({
45764
46485
  traits: [],
45765
46486
  ticks: [],
45766
46487
  guards: [],
@@ -45774,7 +46495,7 @@ function useDebugData() {
45774
46495
  },
45775
46496
  lastUpdate: Date.now()
45776
46497
  }));
45777
- React87.useEffect(() => {
46498
+ React89.useEffect(() => {
45778
46499
  const updateData = () => {
45779
46500
  setData({
45780
46501
  traits: getAllTraits(),
@@ -45883,12 +46604,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
45883
46604
  return positions;
45884
46605
  }
45885
46606
  function WalkMinimap() {
45886
- const [walkStep, setWalkStep] = React87.useState(null);
45887
- const [traits2, setTraits] = React87.useState([]);
45888
- const [coveredEdges, setCoveredEdges] = React87.useState([]);
45889
- const [completedTraits, setCompletedTraits] = React87.useState(/* @__PURE__ */ new Set());
45890
- const prevTraitRef = React87.useRef(null);
45891
- React87.useEffect(() => {
46607
+ const [walkStep, setWalkStep] = React89.useState(null);
46608
+ const [traits2, setTraits] = React89.useState([]);
46609
+ const [coveredEdges, setCoveredEdges] = React89.useState([]);
46610
+ const [completedTraits, setCompletedTraits] = React89.useState(/* @__PURE__ */ new Set());
46611
+ const prevTraitRef = React89.useRef(null);
46612
+ React89.useEffect(() => {
45892
46613
  const interval = setInterval(() => {
45893
46614
  const w = window;
45894
46615
  const step = w.__orbitalWalkStep;
@@ -46324,15 +47045,15 @@ var init_EntitiesTab = __esm({
46324
47045
  });
46325
47046
  function EventFlowTab({ events: events2 }) {
46326
47047
  const { t } = useTranslate();
46327
- const [filter, setFilter] = React87.useState("all");
46328
- const containerRef = React87.useRef(null);
46329
- const [autoScroll, setAutoScroll] = React87.useState(true);
46330
- React87.useEffect(() => {
47048
+ const [filter, setFilter] = React89.useState("all");
47049
+ const containerRef = React89.useRef(null);
47050
+ const [autoScroll, setAutoScroll] = React89.useState(true);
47051
+ React89.useEffect(() => {
46331
47052
  if (autoScroll && containerRef.current) {
46332
47053
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
46333
47054
  }
46334
47055
  }, [events2.length, autoScroll]);
46335
- const filteredEvents = React87.useMemo(() => {
47056
+ const filteredEvents = React89.useMemo(() => {
46336
47057
  if (filter === "all") return events2;
46337
47058
  return events2.filter((e) => e.type === filter);
46338
47059
  }, [events2, filter]);
@@ -46448,7 +47169,7 @@ var init_EventFlowTab = __esm({
46448
47169
  });
46449
47170
  function GuardsPanel({ guards }) {
46450
47171
  const { t } = useTranslate();
46451
- const [filter, setFilter] = React87.useState("all");
47172
+ const [filter, setFilter] = React89.useState("all");
46452
47173
  if (guards.length === 0) {
46453
47174
  return /* @__PURE__ */ jsx(
46454
47175
  EmptyState,
@@ -46461,7 +47182,7 @@ function GuardsPanel({ guards }) {
46461
47182
  }
46462
47183
  const passedCount = guards.filter((g) => g.result).length;
46463
47184
  const failedCount = guards.length - passedCount;
46464
- const filteredGuards = React87.useMemo(() => {
47185
+ const filteredGuards = React89.useMemo(() => {
46465
47186
  if (filter === "all") return guards;
46466
47187
  if (filter === "passed") return guards.filter((g) => g.result);
46467
47188
  return guards.filter((g) => !g.result);
@@ -46624,10 +47345,10 @@ function EffectBadge({ effect }) {
46624
47345
  }
46625
47346
  function TransitionTimeline({ transitions }) {
46626
47347
  const { t } = useTranslate();
46627
- const containerRef = React87.useRef(null);
46628
- const [autoScroll, setAutoScroll] = React87.useState(true);
46629
- const [expandedId, setExpandedId] = React87.useState(null);
46630
- React87.useEffect(() => {
47348
+ const containerRef = React89.useRef(null);
47349
+ const [autoScroll, setAutoScroll] = React89.useState(true);
47350
+ const [expandedId, setExpandedId] = React89.useState(null);
47351
+ React89.useEffect(() => {
46631
47352
  if (autoScroll && containerRef.current) {
46632
47353
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
46633
47354
  }
@@ -46907,9 +47628,9 @@ function getAllEvents(traits2) {
46907
47628
  function EventDispatcherTab({ traits: traits2, schema }) {
46908
47629
  const eventBus = useEventBus();
46909
47630
  const { t } = useTranslate();
46910
- const [log13, setLog] = React87.useState([]);
46911
- const prevStatesRef = React87.useRef(/* @__PURE__ */ new Map());
46912
- React87.useEffect(() => {
47631
+ const [log13, setLog] = React89.useState([]);
47632
+ const prevStatesRef = React89.useRef(/* @__PURE__ */ new Map());
47633
+ React89.useEffect(() => {
46913
47634
  for (const trait of traits2) {
46914
47635
  const prev = prevStatesRef.current.get(trait.id);
46915
47636
  if (prev && prev !== trait.currentState) {
@@ -47078,10 +47799,10 @@ function VerifyModePanel({
47078
47799
  localCount
47079
47800
  }) {
47080
47801
  const { t } = useTranslate();
47081
- const [expanded, setExpanded] = React87.useState(true);
47082
- const scrollRef = React87.useRef(null);
47083
- const prevCountRef = React87.useRef(0);
47084
- React87.useEffect(() => {
47802
+ const [expanded, setExpanded] = React89.useState(true);
47803
+ const scrollRef = React89.useRef(null);
47804
+ const prevCountRef = React89.useRef(0);
47805
+ React89.useEffect(() => {
47085
47806
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
47086
47807
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
47087
47808
  }
@@ -47138,10 +47859,10 @@ function RuntimeDebugger({
47138
47859
  schema
47139
47860
  }) {
47140
47861
  const { t } = useTranslate();
47141
- const [isCollapsed, setIsCollapsed] = React87.useState(mode === "verify" ? true : defaultCollapsed);
47142
- const [isVisible, setIsVisible] = React87.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
47862
+ const [isCollapsed, setIsCollapsed] = React89.useState(mode === "verify" ? true : defaultCollapsed);
47863
+ const [isVisible, setIsVisible] = React89.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
47143
47864
  const debugData = useDebugData();
47144
- React87.useEffect(() => {
47865
+ React89.useEffect(() => {
47145
47866
  if (mode === "inline") return;
47146
47867
  return onDebugToggle((enabled) => {
47147
47868
  setIsVisible(enabled);
@@ -47150,7 +47871,7 @@ function RuntimeDebugger({
47150
47871
  }
47151
47872
  });
47152
47873
  }, [mode]);
47153
- React87.useEffect(() => {
47874
+ React89.useEffect(() => {
47154
47875
  if (mode === "inline") return;
47155
47876
  const handleKeyDown = (e) => {
47156
47877
  if (e.key === "`" && isVisible) {
@@ -47165,7 +47886,7 @@ function RuntimeDebugger({
47165
47886
  if (!isVisible) {
47166
47887
  return null;
47167
47888
  }
47168
- const positionClasses = {
47889
+ const positionClasses2 = {
47169
47890
  "bottom-right": "bottom-4 right-4",
47170
47891
  "bottom-left": "bottom-4 left-4",
47171
47892
  "top-right": "top-4 right-4",
@@ -47294,7 +48015,7 @@ function RuntimeDebugger({
47294
48015
  className: cn(
47295
48016
  "runtime-debugger",
47296
48017
  "fixed",
47297
- positionClasses[position],
48018
+ positionClasses2[position],
47298
48019
  isCollapsed ? "runtime-debugger--collapsed" : "runtime-debugger--expanded",
47299
48020
  className
47300
48021
  ),
@@ -47376,6 +48097,7 @@ var init_SegmentRenderer = __esm({
47376
48097
  "use client";
47377
48098
  init_MarkdownContent();
47378
48099
  init_CodeBlock();
48100
+ init_MermaidDiagram();
47379
48101
  init_QuizBlock();
47380
48102
  init_ActivationBlock();
47381
48103
  init_ConnectionBlock();
@@ -47407,6 +48129,9 @@ var init_SegmentRenderer = __esm({
47407
48129
  return /* @__PURE__ */ jsx(MarkdownContent, { content: segment.content }, `md-${index}`);
47408
48130
  }
47409
48131
  if (segment.type === "code") {
48132
+ if (segment.language === "mermaid") {
48133
+ return /* @__PURE__ */ jsx(MermaidDiagram, { code: segment.content }, `code-${index}`);
48134
+ }
47410
48135
  if (segment.runnable && onRunCodeSimulation) {
47411
48136
  return /* @__PURE__ */ jsx(
47412
48137
  CodeRunnerPanel,
@@ -47539,99 +48264,6 @@ var init_ShowcaseOrganism = __esm({
47539
48264
  ShowcaseOrganism.displayName = "ShowcaseOrganism";
47540
48265
  }
47541
48266
  });
47542
- var SplitPane;
47543
- var init_SplitPane = __esm({
47544
- "components/core/organisms/layout/SplitPane.tsx"() {
47545
- "use client";
47546
- init_cn();
47547
- SplitPane = ({
47548
- direction = "horizontal",
47549
- ratio: initialRatio = 50,
47550
- minSize = 100,
47551
- resizable = true,
47552
- left,
47553
- right,
47554
- className,
47555
- leftClassName,
47556
- rightClassName
47557
- }) => {
47558
- const [ratio, setRatio] = useState(initialRatio);
47559
- const containerRef = useRef(null);
47560
- const isDragging = useRef(false);
47561
- const handlePointerDown = useCallback(
47562
- (e) => {
47563
- if (!resizable) return;
47564
- e.preventDefault();
47565
- isDragging.current = true;
47566
- e.currentTarget.setPointerCapture(e.pointerId);
47567
- const handlePointerMove = (ev) => {
47568
- if (!isDragging.current || !containerRef.current) return;
47569
- const rect = containerRef.current.getBoundingClientRect();
47570
- let newRatio;
47571
- if (direction === "horizontal") {
47572
- const x = ev.clientX - rect.left;
47573
- newRatio = x / rect.width * 100;
47574
- } else {
47575
- const y = ev.clientY - rect.top;
47576
- newRatio = y / rect.height * 100;
47577
- }
47578
- const minRatio = minSize / (direction === "horizontal" ? rect.width : rect.height) * 100;
47579
- const maxRatio = 100 - minRatio;
47580
- newRatio = Math.max(minRatio, Math.min(maxRatio, newRatio));
47581
- setRatio(newRatio);
47582
- };
47583
- const handlePointerUp = () => {
47584
- isDragging.current = false;
47585
- document.removeEventListener("pointermove", handlePointerMove);
47586
- document.removeEventListener("pointerup", handlePointerUp);
47587
- document.removeEventListener("pointercancel", handlePointerUp);
47588
- };
47589
- document.addEventListener("pointermove", handlePointerMove);
47590
- document.addEventListener("pointerup", handlePointerUp);
47591
- document.addEventListener("pointercancel", handlePointerUp);
47592
- },
47593
- [direction, minSize, resizable]
47594
- );
47595
- const isHorizontal = direction === "horizontal";
47596
- return /* @__PURE__ */ jsxs(
47597
- "div",
47598
- {
47599
- ref: containerRef,
47600
- className: cn(
47601
- "flex w-full h-full",
47602
- isHorizontal ? "flex-row" : "flex-col",
47603
- className
47604
- ),
47605
- children: [
47606
- /* @__PURE__ */ jsx(
47607
- "div",
47608
- {
47609
- className: cn("overflow-auto", leftClassName),
47610
- style: {
47611
- [isHorizontal ? "width" : "height"]: `${ratio}%`,
47612
- flexShrink: 0
47613
- },
47614
- children: left
47615
- }
47616
- ),
47617
- resizable && /* @__PURE__ */ jsx(
47618
- "div",
47619
- {
47620
- onPointerDown: handlePointerDown,
47621
- className: cn(
47622
- "flex-shrink-0 bg-border transition-colors touch-none",
47623
- isHorizontal ? "w-1 cursor-col-resize hover:w-1.5 hover:bg-muted-foreground" : "h-1 cursor-row-resize hover:h-1.5 hover:bg-muted-foreground"
47624
- )
47625
- }
47626
- ),
47627
- /* @__PURE__ */ jsx("div", { className: cn("flex-1 overflow-auto", rightClassName), children: right })
47628
- ]
47629
- }
47630
- );
47631
- };
47632
- SplitPane.displayName = "SplitPane";
47633
- }
47634
- });
47635
48267
  var StatCard;
47636
48268
  var init_StatCard = __esm({
47637
48269
  "components/core/organisms/StatCard.tsx"() {
@@ -47670,7 +48302,7 @@ var init_StatCard = __esm({
47670
48302
  const labelToUse = propLabel ?? propTitle;
47671
48303
  const eventBus = useEventBus();
47672
48304
  const { t } = useTranslate();
47673
- const handleActionClick = React87__default.useCallback(() => {
48305
+ const handleActionClick = React89__default.useCallback(() => {
47674
48306
  if (action?.event) {
47675
48307
  eventBus.emit(`UI:${action.event}`, {});
47676
48308
  }
@@ -47681,7 +48313,7 @@ var init_StatCard = __esm({
47681
48313
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
47682
48314
  const isLoading = externalLoading ?? false;
47683
48315
  const error = externalError;
47684
- const computeMetricValue = React87__default.useCallback(
48316
+ const computeMetricValue = React89__default.useCallback(
47685
48317
  (metric, items) => {
47686
48318
  if (metric.value !== void 0) {
47687
48319
  return metric.value;
@@ -47720,7 +48352,7 @@ var init_StatCard = __esm({
47720
48352
  },
47721
48353
  []
47722
48354
  );
47723
- const schemaStats = React87__default.useMemo(() => {
48355
+ const schemaStats = React89__default.useMemo(() => {
47724
48356
  if (!metrics || metrics.length === 0) return null;
47725
48357
  return metrics.map((metric) => ({
47726
48358
  label: metric.label,
@@ -47728,7 +48360,7 @@ var init_StatCard = __esm({
47728
48360
  format: metric.format
47729
48361
  }));
47730
48362
  }, [metrics, data, computeMetricValue]);
47731
- const calculatedTrend = React87__default.useMemo(() => {
48363
+ const calculatedTrend = React89__default.useMemo(() => {
47732
48364
  if (manualTrend !== void 0) return manualTrend;
47733
48365
  if (previousValue === void 0 || currentValue === void 0)
47734
48366
  return void 0;
@@ -48368,8 +49000,8 @@ var init_SubagentTracePanel = __esm({
48368
49000
  ] });
48369
49001
  };
48370
49002
  InlineActivityStream = ({ activities, autoScroll = true, className }) => {
48371
- const endRef = React87__default.useRef(null);
48372
- React87__default.useEffect(() => {
49003
+ const endRef = React89__default.useRef(null);
49004
+ React89__default.useEffect(() => {
48373
49005
  if (!autoScroll) return;
48374
49006
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
48375
49007
  }, [activities.length, autoScroll]);
@@ -48463,7 +49095,7 @@ var init_SubagentTracePanel = __esm({
48463
49095
  };
48464
49096
  SubagentRichCard = ({ subagent }) => {
48465
49097
  const { t } = useTranslate();
48466
- const activities = React87__default.useMemo(
49098
+ const activities = React89__default.useMemo(
48467
49099
  () => subagentMessagesToActivities(subagent.messages),
48468
49100
  [subagent.messages]
48469
49101
  );
@@ -48540,8 +49172,8 @@ var init_SubagentTracePanel = __esm({
48540
49172
  ] });
48541
49173
  };
48542
49174
  CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
48543
- const endRef = React87__default.useRef(null);
48544
- React87__default.useEffect(() => {
49175
+ const endRef = React89__default.useRef(null);
49176
+ React89__default.useEffect(() => {
48545
49177
  if (!autoScroll) return;
48546
49178
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
48547
49179
  }, [messages.length, autoScroll]);
@@ -48976,7 +49608,7 @@ var init_Timeline = __esm({
48976
49608
  }) => {
48977
49609
  const { t } = useTranslate();
48978
49610
  const entityData = entity ?? [];
48979
- const items = React87__default.useMemo(() => {
49611
+ const items = React89__default.useMemo(() => {
48980
49612
  if (propItems) return propItems;
48981
49613
  if (entityData.length === 0) return [];
48982
49614
  return entityData.map((record, idx) => {
@@ -49078,7 +49710,7 @@ var init_Timeline = __esm({
49078
49710
  }
49079
49711
  });
49080
49712
  function extractToastProps(children) {
49081
- if (!React87__default.isValidElement(children)) {
49713
+ if (!React89__default.isValidElement(children)) {
49082
49714
  if (typeof children === "string") {
49083
49715
  return { message: children };
49084
49716
  }
@@ -49120,7 +49752,7 @@ var init_ToastSlot = __esm({
49120
49752
  eventBus.emit(`${prefix}CLOSE`);
49121
49753
  };
49122
49754
  if (!isVisible) return null;
49123
- const isCustomContent = React87__default.isValidElement(children) && !message;
49755
+ const isCustomContent = React89__default.isValidElement(children) && !message;
49124
49756
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
49125
49757
  Toast,
49126
49758
  {
@@ -49188,6 +49820,7 @@ var init_component_registry_generated = __esm({
49188
49820
  init_ChoiceButton();
49189
49821
  init_CodeBlock();
49190
49822
  init_CodeRunnerPanel();
49823
+ init_CommandPalette();
49191
49824
  init_CommunityLinks();
49192
49825
  init_ConditionalWrapper();
49193
49826
  init_ConfettiEffect();
@@ -49215,6 +49848,7 @@ var init_component_registry_generated = __esm({
49215
49848
  init_DocSearch();
49216
49849
  init_DocSidebar();
49217
49850
  init_DocTOC();
49851
+ init_DockLayout();
49218
49852
  init_DocumentDetails();
49219
49853
  init_DocumentPanel();
49220
49854
  init_DocumentViewer();
@@ -49245,6 +49879,7 @@ var init_component_registry_generated = __esm({
49245
49879
  init_FlipCard();
49246
49880
  init_FlipContainer();
49247
49881
  init_FloatingActionButton();
49882
+ init_FloatingToolbar();
49248
49883
  init_Form();
49249
49884
  init_FormField();
49250
49885
  init_FormSection();
@@ -49460,6 +50095,7 @@ var init_component_registry_generated = __esm({
49460
50095
  "ChoiceButton": ChoiceButton,
49461
50096
  "CodeBlock": CodeBlock,
49462
50097
  "CodeRunnerPanel": CodeRunnerPanel,
50098
+ "CommandPalette": CommandPalette,
49463
50099
  "CommunityLinks": CommunityLinks,
49464
50100
  "ConditionalWrapper": ConditionalWrapper,
49465
50101
  "ConfettiEffect": ConfettiEffect,
@@ -49489,6 +50125,7 @@ var init_component_registry_generated = __esm({
49489
50125
  "DocSearch": DocSearch,
49490
50126
  "DocSidebar": DocSidebar,
49491
50127
  "DocTOC": DocTOC,
50128
+ "DockLayout": DockLayout,
49492
50129
  "DocumentDetails": DocumentDetails,
49493
50130
  "DocumentPanel": DocumentPanel,
49494
50131
  "DocumentViewer": DocumentViewer,
@@ -49519,6 +50156,7 @@ var init_component_registry_generated = __esm({
49519
50156
  "FlipCard": FlipCard,
49520
50157
  "FlipContainer": FlipContainer,
49521
50158
  "FloatingActionButton": FloatingActionButton,
50159
+ "FloatingToolbar": FloatingToolbar,
49522
50160
  "Form": Form,
49523
50161
  "FormField": FormField,
49524
50162
  "FormLayout": FormLayout,
@@ -49706,7 +50344,7 @@ function SuspenseConfigProvider({
49706
50344
  config,
49707
50345
  children
49708
50346
  }) {
49709
- return React87__default.createElement(
50347
+ return React89__default.createElement(
49710
50348
  SuspenseConfigContext.Provider,
49711
50349
  { value: config },
49712
50350
  children
@@ -49754,7 +50392,7 @@ function enrichFormFields(fields, entityDef) {
49754
50392
  }
49755
50393
  return { name: field, label: humanizeFieldName(field) };
49756
50394
  }
49757
- if (field && typeof field === "object" && !Array.isArray(field) && !React87__default.isValidElement(field) && !(field instanceof Date)) {
50395
+ if (field && typeof field === "object" && !Array.isArray(field) && !React89__default.isValidElement(field) && !(field instanceof Date)) {
49758
50396
  const obj = field;
49759
50397
  const fieldName2 = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
49760
50398
  if (!fieldName2) return field;
@@ -49807,7 +50445,7 @@ function enrichDetailFields(fields, entityDef) {
49807
50445
  const meta = metaFor(field);
49808
50446
  return meta ? { key: field, ...meta } : field;
49809
50447
  }
49810
- if (field && typeof field === "object" && !Array.isArray(field) && !React87__default.isValidElement(field) && !(field instanceof Date)) {
50448
+ if (field && typeof field === "object" && !Array.isArray(field) && !React89__default.isValidElement(field) && !(field instanceof Date)) {
49811
50449
  const obj = field;
49812
50450
  const fieldName2 = typeof obj.key === "string" ? obj.key : typeof obj.name === "string" ? obj.name : void 0;
49813
50451
  if (!fieldName2 || obj.type) return field;
@@ -50266,7 +50904,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
50266
50904
  const key = `${parentId}-${index}-trait:${traitName}`;
50267
50905
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
50268
50906
  }
50269
- return /* @__PURE__ */ jsx(React87__default.Fragment, { children: child }, `${parentId}-${index}`);
50907
+ return /* @__PURE__ */ jsx(React89__default.Fragment, { children: child }, `${parentId}-${index}`);
50270
50908
  }
50271
50909
  if (!child || typeof child !== "object") return null;
50272
50910
  const childId = `${parentId}-${index}`;
@@ -50323,7 +50961,7 @@ function isPatternConfig(value) {
50323
50961
  if (value === null || value === void 0) return false;
50324
50962
  if (typeof value !== "object") return false;
50325
50963
  if (Array.isArray(value)) return false;
50326
- if (React87__default.isValidElement(value)) return false;
50964
+ if (React89__default.isValidElement(value)) return false;
50327
50965
  if (value instanceof Date) return false;
50328
50966
  if (typeof value === "function") return false;
50329
50967
  const record = value;
@@ -50336,9 +50974,9 @@ function renderPatternValue(value) {
50336
50974
  if (typeof value === "string") return renderPatternChildren(value, () => {
50337
50975
  });
50338
50976
  if (value instanceof Date) return value.toLocaleString();
50339
- if (React87__default.isValidElement(value)) return value;
50977
+ if (React89__default.isValidElement(value)) return value;
50340
50978
  if (Array.isArray(value)) {
50341
- return value.map((item, index) => /* @__PURE__ */ jsx(React87__default.Fragment, { children: renderPatternValue(item) }, index));
50979
+ return value.map((item, index) => /* @__PURE__ */ jsx(React89__default.Fragment, { children: renderPatternValue(item) }, index));
50342
50980
  }
50343
50981
  if (isPatternConfig(value)) {
50344
50982
  const { type, ...props } = value;
@@ -50348,7 +50986,7 @@ function renderPatternValue(value) {
50348
50986
  return null;
50349
50987
  }
50350
50988
  function isPlainConfigObject(value) {
50351
- if (React87__default.isValidElement(value)) return false;
50989
+ if (React89__default.isValidElement(value)) return false;
50352
50990
  if (value instanceof Date) return false;
50353
50991
  const proto = Object.getPrototypeOf(value);
50354
50992
  return proto === Object.prototype || proto === null;
@@ -50522,7 +51160,7 @@ function SlotContentRenderer({
50522
51160
  for (const slotKey of CONTENT_NODE_SLOTS) {
50523
51161
  const slotVal = restProps[slotKey];
50524
51162
  if (slotVal === void 0 || slotVal === null) continue;
50525
- if (React87__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
51163
+ if (React89__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
50526
51164
  const typelessChildren = !Array.isArray(slotVal) && typeof slotVal === "object" && !("type" in slotVal) && Array.isArray(slotVal.children) ? slotVal.children : void 0;
50527
51165
  if (typelessChildren !== void 0 || Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
50528
51166
  nodeSlotOverrides[slotKey] = renderPatternChildren(
@@ -50576,7 +51214,7 @@ function SlotContentRenderer({
50576
51214
  const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
50577
51215
  if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
50578
51216
  const sample = resolvedItems[0];
50579
- if (sample && typeof sample === "object" && !Array.isArray(sample) && !React87__default.isValidElement(sample) && !(sample instanceof Date)) {
51217
+ if (sample && typeof sample === "object" && !Array.isArray(sample) && !React89__default.isValidElement(sample) && !(sample instanceof Date)) {
50580
51218
  const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
50581
51219
  finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
50582
51220
  }
@@ -50776,7 +51414,7 @@ var init_UISlotRenderer = __esm({
50776
51414
  init_useEventBus();
50777
51415
  var busLog = createLogger("almadar:eventbus");
50778
51416
  var subLog2 = createLogger("almadar:eventbus:subscribe");
50779
- var EventBusContext2 = createContext(null);
51417
+ var EventBusContext2 = globalThis.__almadarUiEventBusContext ?? (globalThis.__almadarUiEventBusContext = createContext(null));
50780
51418
  var listenerTags = /* @__PURE__ */ new WeakMap();
50781
51419
  function captureSubscriberTag(listener) {
50782
51420
  const fnName = listener.name;