@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,6 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import * as React77 from 'react';
3
- import React77__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, useState, useLayoutEffect, useId, Suspense, lazy, useSyncExternalStore } from 'react';
2
+ import * as React79 from 'react';
3
+ import React79__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, useState, useLayoutEffect, useId, Suspense, lazy, useSyncExternalStore } from 'react';
4
4
  import { clsx } from 'clsx';
5
5
  import { twMerge } from 'tailwind-merge';
6
6
  import { EventBusContext, useTraitScopeChain, useCurrentPagePath, useGameAudioContextOptional, useRenderSlot, useNavStack, useEntitySchemaOptional, RenderSlotProvider, useEntityBindingSnapshot, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
@@ -262,7 +262,7 @@ var init_SvgFlow = __esm({
262
262
  width = 100,
263
263
  height = 100
264
264
  }) => {
265
- const markerId = React77__default.useMemo(() => {
265
+ const markerId = React79__default.useMemo(() => {
266
266
  flowIdCounter += 1;
267
267
  return `almadar-flow-arrow-${flowIdCounter}`;
268
268
  }, []);
@@ -855,7 +855,7 @@ var init_SvgRing = __esm({
855
855
  width = 100,
856
856
  height = 100
857
857
  }) => {
858
- const gradientId = React77__default.useMemo(() => {
858
+ const gradientId = React79__default.useMemo(() => {
859
859
  ringIdCounter += 1;
860
860
  return `almadar-ring-glow-${ringIdCounter}`;
861
861
  }, []);
@@ -1397,7 +1397,7 @@ var init_Icon = __esm({
1397
1397
  const effectiveName = typeof icon === "string" && icon !== "" ? icon : name;
1398
1398
  const effectiveStrokeWidth = strokeWidth != null && strokeWidth > 0 ? strokeWidth : void 0;
1399
1399
  const family = useIconFamily();
1400
- const RenderedComponent = React77__default.useMemo(() => {
1400
+ const RenderedComponent = React79__default.useMemo(() => {
1401
1401
  if (directIcon) return null;
1402
1402
  return effectiveName ? resolveIconForFamily(effectiveName) : null;
1403
1403
  }, [directIcon, effectiveName, family]);
@@ -1526,7 +1526,7 @@ var init_atlasSlice = __esm({
1526
1526
  }
1527
1527
  });
1528
1528
  function useAtlasSliceDataUrl(asset) {
1529
- const [, bump] = React77.useReducer((x) => x + 1, 0);
1529
+ const [, bump] = React79.useReducer((x) => x + 1, 0);
1530
1530
  if (!isAtlasAsset(asset)) return void 0;
1531
1531
  const key = `${asset.atlas}#${asset.sprite}`;
1532
1532
  const cached = sliceDataUrlCache.get(key);
@@ -1589,13 +1589,13 @@ function AtlasImage({
1589
1589
  style,
1590
1590
  "aria-hidden": ariaHidden
1591
1591
  }) {
1592
- const [, bump] = React77.useReducer((x) => x + 1, 0);
1593
- const canvasRef = React77.useRef(null);
1592
+ const [, bump] = React79.useReducer((x) => x + 1, 0);
1593
+ const canvasRef = React79.useRef(null);
1594
1594
  const sliced = isAtlasAsset(asset);
1595
1595
  const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
1596
1596
  const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
1597
1597
  const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
1598
- React77.useEffect(() => {
1598
+ React79.useEffect(() => {
1599
1599
  const canvas = canvasRef.current;
1600
1600
  if (!canvas || !img || !rect) return;
1601
1601
  canvas.width = rect.sw;
@@ -1671,7 +1671,7 @@ function resolveIconProp(value, sizeClass) {
1671
1671
  const IconComp = value;
1672
1672
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
1673
1673
  }
1674
- if (React77__default.isValidElement(value)) {
1674
+ if (React79__default.isValidElement(value)) {
1675
1675
  return value;
1676
1676
  }
1677
1677
  if (typeof value === "object" && value !== null && isIconLike(value)) {
@@ -1748,7 +1748,7 @@ var init_Button = __esm({
1748
1748
  md: "h-icon-default w-icon-default",
1749
1749
  lg: "h-icon-default w-icon-default"
1750
1750
  };
1751
- Button = React77__default.forwardRef(
1751
+ Button = React79__default.forwardRef(
1752
1752
  ({
1753
1753
  className,
1754
1754
  variant = "primary",
@@ -1820,7 +1820,7 @@ var init_Input = __esm({
1820
1820
  init_cn();
1821
1821
  init_Icon();
1822
1822
  init_useEventBus();
1823
- Input = React77__default.forwardRef(
1823
+ Input = React79__default.forwardRef(
1824
1824
  ({
1825
1825
  className,
1826
1826
  inputType,
@@ -1844,9 +1844,9 @@ var init_Input = __esm({
1844
1844
  const eventBus = useEventBus();
1845
1845
  const type = inputType || htmlType || "text";
1846
1846
  const isDeclarative = typeof onChange === "string";
1847
- const [localValue, setLocalValue] = React77__default.useState(value);
1848
- const pendingEchoRef = React77__default.useRef(/* @__PURE__ */ new Set());
1849
- React77__default.useEffect(() => {
1847
+ const [localValue, setLocalValue] = React79__default.useState(value);
1848
+ const pendingEchoRef = React79__default.useRef(/* @__PURE__ */ new Set());
1849
+ React79__default.useEffect(() => {
1850
1850
  if (!isDeclarative) return;
1851
1851
  const incoming = value == null ? "" : String(value);
1852
1852
  if (pendingEchoRef.current.has(incoming)) {
@@ -2013,7 +2013,7 @@ var Label;
2013
2013
  var init_Label = __esm({
2014
2014
  "components/core/atoms/Label.tsx"() {
2015
2015
  init_cn();
2016
- Label = React77__default.forwardRef(
2016
+ Label = React79__default.forwardRef(
2017
2017
  ({ className, required, children, ...props }, ref) => {
2018
2018
  return /* @__PURE__ */ jsxs(
2019
2019
  "label",
@@ -2040,7 +2040,7 @@ var init_Textarea = __esm({
2040
2040
  "components/core/atoms/Textarea.tsx"() {
2041
2041
  init_cn();
2042
2042
  init_useEventBus();
2043
- Textarea = React77__default.forwardRef(
2043
+ Textarea = React79__default.forwardRef(
2044
2044
  ({ className, error, onChange, ...props }, ref) => {
2045
2045
  const eventBus = useEventBus();
2046
2046
  const handleChange = (e) => {
@@ -2290,7 +2290,7 @@ var init_Select = __esm({
2290
2290
  init_cn();
2291
2291
  init_Icon();
2292
2292
  init_useEventBus();
2293
- Select = React77__default.forwardRef(
2293
+ Select = React79__default.forwardRef(
2294
2294
  (props, _ref) => {
2295
2295
  const { multiple, searchable, clearable } = props;
2296
2296
  if (multiple || searchable || clearable) {
@@ -2307,7 +2307,7 @@ var init_Checkbox = __esm({
2307
2307
  "components/core/atoms/Checkbox.tsx"() {
2308
2308
  init_cn();
2309
2309
  init_useEventBus();
2310
- Checkbox = React77__default.forwardRef(
2310
+ Checkbox = React79__default.forwardRef(
2311
2311
  ({ className, label, id, onChange, ...props }, ref) => {
2312
2312
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
2313
2313
  const eventBus = useEventBus();
@@ -2361,7 +2361,7 @@ var init_Spinner = __esm({
2361
2361
  md: "h-6 w-6",
2362
2362
  lg: "h-8 w-8"
2363
2363
  };
2364
- Spinner = React77__default.forwardRef(
2364
+ Spinner = React79__default.forwardRef(
2365
2365
  ({ className, size = "md", overlay, ...props }, ref) => {
2366
2366
  if (overlay) {
2367
2367
  return /* @__PURE__ */ jsx(
@@ -2451,7 +2451,7 @@ var init_Card = __esm({
2451
2451
  chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
2452
2452
  "tile-image-first": "p-0 overflow-hidden"
2453
2453
  };
2454
- Card = React77__default.forwardRef(
2454
+ Card = React79__default.forwardRef(
2455
2455
  ({
2456
2456
  className,
2457
2457
  variant = "bordered",
@@ -2500,9 +2500,9 @@ var init_Card = __esm({
2500
2500
  }
2501
2501
  );
2502
2502
  Card.displayName = "Card";
2503
- CardHeader = React77__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
2503
+ CardHeader = React79__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
2504
2504
  CardHeader.displayName = "CardHeader";
2505
- CardTitle = React77__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2505
+ CardTitle = React79__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2506
2506
  "h3",
2507
2507
  {
2508
2508
  ref,
@@ -2515,11 +2515,11 @@ var init_Card = __esm({
2515
2515
  }
2516
2516
  ));
2517
2517
  CardTitle.displayName = "CardTitle";
2518
- CardContent = React77__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
2518
+ CardContent = React79__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
2519
2519
  CardContent.displayName = "CardContent";
2520
2520
  CardBody = CardContent;
2521
2521
  CardBody.displayName = "CardBody";
2522
- CardFooter = React77__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2522
+ CardFooter = React79__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2523
2523
  "div",
2524
2524
  {
2525
2525
  ref,
@@ -2573,7 +2573,7 @@ var init_Badge = __esm({
2573
2573
  md: "px-2.5 py-1 text-sm",
2574
2574
  lg: "px-3 py-1.5 text-base"
2575
2575
  };
2576
- Badge = React77__default.forwardRef(
2576
+ Badge = React79__default.forwardRef(
2577
2577
  ({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
2578
2578
  const iconSizes3 = {
2579
2579
  sm: "h-icon-default w-icon-default",
@@ -2701,7 +2701,7 @@ var init_FilterPill = __esm({
2701
2701
  md: "w-3.5 h-3.5",
2702
2702
  lg: "w-4 h-4"
2703
2703
  };
2704
- FilterPill = React77__default.forwardRef(
2704
+ FilterPill = React79__default.forwardRef(
2705
2705
  ({
2706
2706
  className,
2707
2707
  variant = "default",
@@ -2830,8 +2830,8 @@ var init_Avatar = __esm({
2830
2830
  actionPayload
2831
2831
  }) => {
2832
2832
  const eventBus = useEventBus();
2833
- const [imgFailed, setImgFailed] = React77__default.useState(false);
2834
- React77__default.useEffect(() => {
2833
+ const [imgFailed, setImgFailed] = React79__default.useState(false);
2834
+ React79__default.useEffect(() => {
2835
2835
  setImgFailed(false);
2836
2836
  }, [src]);
2837
2837
  const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
@@ -3083,7 +3083,7 @@ var init_Box = __esm({
3083
3083
  fixed: "fixed",
3084
3084
  sticky: "sticky"
3085
3085
  };
3086
- Box = React77__default.forwardRef(
3086
+ Box = React79__default.forwardRef(
3087
3087
  ({
3088
3088
  padding,
3089
3089
  paddingX,
@@ -3148,7 +3148,7 @@ var init_Box = __esm({
3148
3148
  onPointerDown?.(e);
3149
3149
  }, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
3150
3150
  const isClickable = action || onClick;
3151
- return React77__default.createElement(
3151
+ return React79__default.createElement(
3152
3152
  Component,
3153
3153
  {
3154
3154
  ref,
@@ -3202,7 +3202,7 @@ var init_Center = __esm({
3202
3202
  as: Component = "div"
3203
3203
  }) => {
3204
3204
  const mergedStyle = minHeight ? { minHeight, ...style } : style;
3205
- return React77__default.createElement(Component, {
3205
+ return React79__default.createElement(Component, {
3206
3206
  className: cn(
3207
3207
  inline ? "inline-flex" : "flex",
3208
3208
  horizontal && "justify-center",
@@ -3470,7 +3470,7 @@ var init_Radio = __esm({
3470
3470
  md: "w-2.5 h-2.5",
3471
3471
  lg: "w-3 h-3"
3472
3472
  };
3473
- Radio = React77__default.forwardRef(
3473
+ Radio = React79__default.forwardRef(
3474
3474
  ({
3475
3475
  label,
3476
3476
  helperText,
@@ -3487,12 +3487,12 @@ var init_Radio = __esm({
3487
3487
  onChange,
3488
3488
  ...props
3489
3489
  }, ref) => {
3490
- const reactId = React77__default.useId();
3490
+ const reactId = React79__default.useId();
3491
3491
  const baseId = id || `radio-${reactId}`;
3492
3492
  const hasError = !!error;
3493
3493
  const eventBus = useEventBus();
3494
- const [selected, setSelected] = React77__default.useState(value);
3495
- React77__default.useEffect(() => {
3494
+ const [selected, setSelected] = React79__default.useState(value);
3495
+ React79__default.useEffect(() => {
3496
3496
  if (value !== void 0) setSelected(value);
3497
3497
  }, [value]);
3498
3498
  const pick = (next, e) => {
@@ -3674,7 +3674,7 @@ var init_Switch = __esm({
3674
3674
  "components/core/atoms/Switch.tsx"() {
3675
3675
  "use client";
3676
3676
  init_cn();
3677
- Switch = React77.forwardRef(
3677
+ Switch = React79.forwardRef(
3678
3678
  ({
3679
3679
  checked,
3680
3680
  defaultChecked = false,
@@ -3685,10 +3685,10 @@ var init_Switch = __esm({
3685
3685
  name,
3686
3686
  className
3687
3687
  }, ref) => {
3688
- const [isChecked, setIsChecked] = React77.useState(
3688
+ const [isChecked, setIsChecked] = React79.useState(
3689
3689
  checked !== void 0 ? checked : defaultChecked
3690
3690
  );
3691
- React77.useEffect(() => {
3691
+ React79.useEffect(() => {
3692
3692
  if (checked !== void 0) {
3693
3693
  setIsChecked(checked);
3694
3694
  }
@@ -3851,7 +3851,7 @@ var init_Stack = __esm({
3851
3851
  };
3852
3852
  const isHorizontal = direction === "horizontal";
3853
3853
  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";
3854
- return React77__default.createElement(
3854
+ return React79__default.createElement(
3855
3855
  Component,
3856
3856
  {
3857
3857
  className: cn(
@@ -4140,7 +4140,7 @@ var init_Typography = __esm({
4140
4140
  if (format !== void 0 && format !== "none" && (typeof body === "string" || typeof body === "number" || body instanceof Date)) {
4141
4141
  body = formatValue(body, format);
4142
4142
  }
4143
- return React77__default.createElement(
4143
+ return React79__default.createElement(
4144
4144
  Component,
4145
4145
  {
4146
4146
  id,
@@ -4374,7 +4374,7 @@ var Dialog;
4374
4374
  var init_Dialog = __esm({
4375
4375
  "components/core/atoms/Dialog.tsx"() {
4376
4376
  init_cn();
4377
- Dialog = React77__default.forwardRef(
4377
+ Dialog = React79__default.forwardRef(
4378
4378
  ({
4379
4379
  role = "dialog",
4380
4380
  "aria-modal": ariaModal = true,
@@ -4400,7 +4400,7 @@ var Aside;
4400
4400
  var init_Aside = __esm({
4401
4401
  "components/core/atoms/Aside.tsx"() {
4402
4402
  init_cn();
4403
- Aside = React77__default.forwardRef(
4403
+ Aside = React79__default.forwardRef(
4404
4404
  ({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
4405
4405
  );
4406
4406
  Aside.displayName = "Aside";
@@ -4479,9 +4479,9 @@ var init_LawReferenceTooltip = __esm({
4479
4479
  className
4480
4480
  }) => {
4481
4481
  const { t } = useTranslate();
4482
- const [isVisible, setIsVisible] = React77__default.useState(false);
4483
- const timeoutRef = React77__default.useRef(null);
4484
- const triggerRef = React77__default.useRef(null);
4482
+ const [isVisible, setIsVisible] = React79__default.useState(false);
4483
+ const timeoutRef = React79__default.useRef(null);
4484
+ const triggerRef = React79__default.useRef(null);
4485
4485
  const handleMouseEnter = () => {
4486
4486
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
4487
4487
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -4492,7 +4492,7 @@ var init_LawReferenceTooltip = __esm({
4492
4492
  };
4493
4493
  const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
4494
4494
  const open = isVisible || revealed;
4495
- React77__default.useEffect(() => {
4495
+ React79__default.useEffect(() => {
4496
4496
  return () => {
4497
4497
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
4498
4498
  };
@@ -4702,7 +4702,7 @@ var init_StatusDot = __esm({
4702
4702
  md: "w-2.5 h-2.5",
4703
4703
  lg: "w-3 h-3"
4704
4704
  };
4705
- StatusDot = React77__default.forwardRef(
4705
+ StatusDot = React79__default.forwardRef(
4706
4706
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
4707
4707
  return /* @__PURE__ */ jsx(
4708
4708
  "span",
@@ -4756,7 +4756,7 @@ var init_TrendIndicator = __esm({
4756
4756
  down: "trending-down",
4757
4757
  flat: "arrow-right"
4758
4758
  };
4759
- TrendIndicator = React77__default.forwardRef(
4759
+ TrendIndicator = React79__default.forwardRef(
4760
4760
  ({
4761
4761
  className,
4762
4762
  value,
@@ -4825,7 +4825,7 @@ var init_RangeSlider = __esm({
4825
4825
  md: "w-4 h-4",
4826
4826
  lg: "w-5 h-5"
4827
4827
  };
4828
- RangeSlider = React77__default.forwardRef(
4828
+ RangeSlider = React79__default.forwardRef(
4829
4829
  ({
4830
4830
  className,
4831
4831
  min = 0,
@@ -5482,7 +5482,7 @@ var init_ContentSection = __esm({
5482
5482
  md: "py-16",
5483
5483
  lg: "py-24"
5484
5484
  };
5485
- ContentSection = React77__default.forwardRef(
5485
+ ContentSection = React79__default.forwardRef(
5486
5486
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
5487
5487
  return /* @__PURE__ */ jsx(
5488
5488
  Box,
@@ -6016,7 +6016,7 @@ var init_AnimatedReveal = __esm({
6016
6016
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
6017
6017
  "none": {}
6018
6018
  };
6019
- AnimatedReveal = React77__default.forwardRef(
6019
+ AnimatedReveal = React79__default.forwardRef(
6020
6020
  ({
6021
6021
  trigger = "scroll",
6022
6022
  animation = "fade-up",
@@ -6176,7 +6176,7 @@ var init_AnimatedGraphic = __esm({
6176
6176
  "components/marketing/atoms/AnimatedGraphic.tsx"() {
6177
6177
  "use client";
6178
6178
  init_cn();
6179
- AnimatedGraphic = React77__default.forwardRef(
6179
+ AnimatedGraphic = React79__default.forwardRef(
6180
6180
  ({
6181
6181
  src,
6182
6182
  svgContent,
@@ -6199,7 +6199,7 @@ var init_AnimatedGraphic = __esm({
6199
6199
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
6200
6200
  const resolvedSvg = svgContent ?? fetchedSvg;
6201
6201
  const prevAnimateRef = useRef(animate);
6202
- const setRef = React77__default.useCallback(
6202
+ const setRef = React79__default.useCallback(
6203
6203
  (node) => {
6204
6204
  containerRef.current = node;
6205
6205
  if (typeof ref === "function") ref(node);
@@ -6300,7 +6300,7 @@ function resolveMarkerExpression(expression, entity, config, state) {
6300
6300
  function isPlainObject(value) {
6301
6301
  if (value === null || value === void 0 || typeof value !== "object") return false;
6302
6302
  if (Array.isArray(value)) return false;
6303
- if (React77__default.isValidElement(value)) return false;
6303
+ if (React79__default.isValidElement(value)) return false;
6304
6304
  if (value instanceof Date) return false;
6305
6305
  if (typeof value === "function") return false;
6306
6306
  return true;
@@ -6309,7 +6309,7 @@ function isEvaluatorResolvedData(value) {
6309
6309
  return evaluatorResolvedData.has(value);
6310
6310
  }
6311
6311
  function brandResolved(value) {
6312
- if (value !== null && typeof value === "object" && !React77__default.isValidElement(value) && !(value instanceof Date)) {
6312
+ if (value !== null && typeof value === "object" && !React79__default.isValidElement(value) && !(value instanceof Date)) {
6313
6313
  resolvedMarkerFree.add(value);
6314
6314
  }
6315
6315
  }
@@ -6342,7 +6342,7 @@ function walkValue(value, scopeTrait, entity, config, state) {
6342
6342
  }
6343
6343
  const resolved = resolveMarkerExpression(value.expression, entity, config, state);
6344
6344
  markerResolutionCache.set(value, { entity, config, state, resolved });
6345
- if (resolved !== null && typeof resolved === "object" && !React77__default.isValidElement(resolved) && !(resolved instanceof Date)) {
6345
+ if (resolved !== null && typeof resolved === "object" && !React79__default.isValidElement(resolved) && !(resolved instanceof Date)) {
6346
6346
  resolvedMarkerFree.add(resolved);
6347
6347
  evaluatorResolvedData.add(resolved);
6348
6348
  }
@@ -6530,7 +6530,6 @@ var init_Modal = __esm({
6530
6530
  ),
6531
6531
  style: { backgroundColor: "rgba(0, 0, 0, 0.6)" },
6532
6532
  onClick: handleOverlayClick,
6533
- "aria-hidden": "true",
6534
6533
  children: /* @__PURE__ */ jsxs(
6535
6534
  Dialog,
6536
6535
  {
@@ -6724,7 +6723,7 @@ var init_Drawer = __esm({
6724
6723
  };
6725
6724
  const widthClass = width in sizeWidths ? sizeWidths[width] : "";
6726
6725
  const widthStyle = width in sizeWidths ? void 0 : { width };
6727
- const positionClasses = position === "right" ? "right-0 border-l" : "left-0 border-r";
6726
+ const positionClasses2 = position === "right" ? "right-0 border-l" : "left-0 border-r";
6728
6727
  const drawerSign = position === "right" ? 1 : -1;
6729
6728
  const slideTransform = position === "right" ? "translateX(100%)" : "translateX(-100%)";
6730
6729
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -6746,7 +6745,7 @@ var init_Drawer = __esm({
6746
6745
  className: cn(
6747
6746
  "fixed top-0 bottom-0 z-50",
6748
6747
  "flex flex-col max-h-screen",
6749
- positionClasses,
6748
+ positionClasses2,
6750
6749
  widthClass,
6751
6750
  drawerAnim,
6752
6751
  className
@@ -7000,7 +6999,7 @@ var init_ErrorBoundary = __esm({
7000
6999
  }
7001
7000
  );
7002
7001
  };
7003
- ErrorBoundary = class extends React77__default.Component {
7002
+ ErrorBoundary = class extends React79__default.Component {
7004
7003
  constructor(props) {
7005
7004
  super(props);
7006
7005
  __publicField(this, "reset", () => {
@@ -7283,7 +7282,7 @@ var init_Container = __esm({
7283
7282
  as: Component = "div"
7284
7283
  }) => {
7285
7284
  const resolvedSize = maxWidth ?? size ?? "lg";
7286
- return React77__default.createElement(
7285
+ return React79__default.createElement(
7287
7286
  Component,
7288
7287
  {
7289
7288
  className: cn(
@@ -8307,7 +8306,7 @@ var init_FloatingActionButton = __esm({
8307
8306
  document.addEventListener("mousedown", handleClickOutside);
8308
8307
  return () => document.removeEventListener("mousedown", handleClickOutside);
8309
8308
  }, [isExpanded, actions]);
8310
- const positionClasses = {
8309
+ const positionClasses2 = {
8311
8310
  "bottom-right": "bottom-6 right-6",
8312
8311
  "bottom-left": "bottom-6 left-6",
8313
8312
  "bottom-center": "bottom-6 left-1/2 -translate-x-1/2",
@@ -8316,7 +8315,7 @@ var init_FloatingActionButton = __esm({
8316
8315
  "top-center": "top-6 left-1/2 -translate-x-1/2"
8317
8316
  };
8318
8317
  if (resolvedAction && (!actions || actions.length === 0)) {
8319
- return /* @__PURE__ */ jsx(Box, { className: cn("fixed z-50", positionClasses[position], className), children: /* @__PURE__ */ jsx(
8318
+ return /* @__PURE__ */ jsx(Box, { className: cn("fixed z-50", positionClasses2[position], className), children: /* @__PURE__ */ jsx(
8320
8319
  Button,
8321
8320
  {
8322
8321
  variant: resolvedAction.variant || "primary",
@@ -8344,7 +8343,7 @@ var init_FloatingActionButton = __esm({
8344
8343
  ref: fabRef,
8345
8344
  className: cn(
8346
8345
  "fixed z-50 flex flex-col items-end gap-3",
8347
- positionClasses[position],
8346
+ positionClasses2[position],
8348
8347
  position.includes("left") && "items-start",
8349
8348
  className
8350
8349
  ),
@@ -9621,7 +9620,7 @@ function proceduralShapes(view, pos, fade, progress) {
9621
9620
  }
9622
9621
  }
9623
9622
  }
9624
- function expandFxItem(view, node, epochNowMs, dim, projector) {
9623
+ function expandFxItem(view, node, epochNowMs, dim, projector, fontFamily) {
9625
9624
  if (view.space === "screen") return [];
9626
9625
  const tickMs = node.tickMs ?? DEFAULT_TICK_MS;
9627
9626
  const { ageMs, progress, fade } = fxLifecycle(view, epochNowMs, tickMs);
@@ -9658,6 +9657,7 @@ function expandFxItem(view, node, epochNowMs, dim, projector) {
9658
9657
  }
9659
9658
  if (view.message) {
9660
9659
  const pxSize = projector && view.size !== void 0 ? Math.max(10, Math.round(view.size * projector.tileWidth)) : void 0;
9660
+ const family = fontFamily ?? "system-ui, sans-serif";
9661
9661
  const text = {
9662
9662
  type: "draw-text",
9663
9663
  text: view.message,
@@ -9665,18 +9665,18 @@ function expandFxItem(view, node, epochNowMs, dim, projector) {
9665
9665
  offsetY: -(0.15 + 0.55 * progress),
9666
9666
  color: view.color ?? node.textColor ?? DEFAULT_TEXT_COLOR,
9667
9667
  opacity: fade,
9668
- ...pxSize ? { font: `bold ${pxSize}px system-ui, sans-serif` } : {}
9668
+ font: `bold ${pxSize ?? 14}px ${family}`
9669
9669
  };
9670
9670
  out.push(text);
9671
9671
  }
9672
9672
  return out;
9673
9673
  }
9674
- function expandFxLayer(node, epochNowMs, dim, projector) {
9674
+ function expandFxLayer(node, epochNowMs, dim, projector, fontFamily) {
9675
9675
  if (!Array.isArray(node.items)) return [];
9676
9676
  const out = [];
9677
9677
  for (const item of node.items) {
9678
9678
  if (!item || typeof item.id !== "string") continue;
9679
- out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim, projector));
9679
+ out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim, projector, fontFamily));
9680
9680
  }
9681
9681
  return out;
9682
9682
  }
@@ -9743,7 +9743,7 @@ function paintDrawable(painter, node, dctx) {
9743
9743
  break;
9744
9744
  case "draw-fx-layer": {
9745
9745
  const epochNow = dctx.time > 0 && typeof performance !== "undefined" ? performance.timeOrigin + dctx.time : 0;
9746
- for (const child of expandFxLayer(node, epochNow, "2d", dctx.projector)) paintDrawable(painter, child, dctx);
9746
+ for (const child of expandFxLayer(node, epochNow, "2d", dctx.projector, dctx.fontFamily)) paintDrawable(painter, child, dctx);
9747
9747
  break;
9748
9748
  }
9749
9749
  }
@@ -10204,7 +10204,7 @@ var init_LearningCanvas = __esm({
10204
10204
  if (drawables?.length && projector) {
10205
10205
  const painter = createWebPainter(ctx, invalidateRef.current);
10206
10206
  const timeMs = needsAnim && typeof performance !== "undefined" ? performance.now() : 0;
10207
- const dctx = { projector, time: timeMs, invalidate: invalidateRef.current };
10207
+ const dctx = { projector, time: timeMs, invalidate: invalidateRef.current, fontFamily: themeBodyFont(canvas) };
10208
10208
  for (const node of drawables) {
10209
10209
  paintDrawable(painter, node, dctx);
10210
10210
  }
@@ -13063,9 +13063,11 @@ var init_Tabs = __esm({
13063
13063
  }
13064
13064
  };
13065
13065
  const handleKeyDown = (e, index) => {
13066
- if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
13066
+ const prevKey = orientation === "vertical" ? "ArrowUp" : "ArrowLeft";
13067
+ const nextKey = orientation === "vertical" ? "ArrowDown" : "ArrowRight";
13068
+ if (e.key === prevKey || e.key === nextKey) {
13067
13069
  e.preventDefault();
13068
- const direction = e.key === "ArrowLeft" ? -1 : 1;
13070
+ const direction = e.key === prevKey ? -1 : 1;
13069
13071
  const nextIndex = (index + direction + safeItems.length) % safeItems.length;
13070
13072
  const nextTab = safeItems[nextIndex];
13071
13073
  if (nextTab && !nextTab.disabled) {
@@ -13407,7 +13409,7 @@ function useLanguageReady(language) {
13407
13409
  }, [language]);
13408
13410
  return ready;
13409
13411
  }
13410
- var dynamicallyLoaded, codeLanguageLoader, orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log5, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
13412
+ var dynamicallyLoaded, codeLanguageLoader, orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log5, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, HIGHLIGHT_CAPACITY_BYTES, CodeBlock;
13411
13413
  var init_CodeBlock = __esm({
13412
13414
  "components/core/molecules/markdown/CodeBlock.tsx"() {
13413
13415
  init_cn();
@@ -13640,7 +13642,8 @@ var init_CodeBlock = __esm({
13640
13642
  DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
13641
13643
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
13642
13644
  HIDDEN_LINE_NUMBERS = { display: "none" };
13643
- CodeBlock = React77__default.memo(
13645
+ HIGHLIGHT_CAPACITY_BYTES = 512 * 1024;
13646
+ CodeBlock = React79__default.memo(
13644
13647
  ({
13645
13648
  code: rawCode,
13646
13649
  language = "text",
@@ -13670,6 +13673,8 @@ var init_CodeBlock = __esm({
13670
13673
  const isOrb = language === "orb";
13671
13674
  const isLolo = language === "lolo";
13672
13675
  const activeStyle = isOrb ? orbStyle : isLolo ? loloStyle : dark;
13676
+ const overCapacity = code.length > HIGHLIGHT_CAPACITY_BYTES;
13677
+ const plainCodeColor = activeStyle['code[class*="language-"]']?.color ?? "#d4d4d4";
13673
13678
  const languageReady = useLanguageReady(language);
13674
13679
  const eventBus = useEventBus();
13675
13680
  const { t } = useTranslate();
@@ -13736,8 +13741,8 @@ var init_CodeBlock = __esm({
13736
13741
  const isFoldable = foldableProp ?? true;
13737
13742
  const [collapsed, setCollapsed] = useState(() => /* @__PURE__ */ new Set());
13738
13743
  const foldRegions = useMemo(
13739
- () => isFoldable ? computeFoldRegions(code) : [],
13740
- [code, isFoldable]
13744
+ () => isFoldable && !overCapacity ? computeFoldRegions(code) : [],
13745
+ [code, isFoldable, overCapacity]
13741
13746
  );
13742
13747
  const foldStartMap = useMemo(() => {
13743
13748
  const m = /* @__PURE__ */ new Map();
@@ -13771,8 +13776,67 @@ var init_CodeBlock = __esm({
13771
13776
  useEffect(() => {
13772
13777
  setCollapsed(/* @__PURE__ */ new Set());
13773
13778
  }, [code]);
13779
+ const editableOverCapacity = editableValue.length > HIGHLIGHT_CAPACITY_BYTES;
13780
+ const editableHighlightedElement = useMemo(
13781
+ () => editableOverCapacity ? /* @__PURE__ */ jsx(
13782
+ "div",
13783
+ {
13784
+ style: {
13785
+ padding: "1rem",
13786
+ margin: 0,
13787
+ whiteSpace: "pre",
13788
+ minWidth: "100%",
13789
+ color: plainCodeColor,
13790
+ fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
13791
+ fontSize: "13px",
13792
+ lineHeight: "1.5"
13793
+ },
13794
+ children: editableValue || " "
13795
+ }
13796
+ ) : /* @__PURE__ */ jsx(
13797
+ SyntaxHighlighter,
13798
+ {
13799
+ PreTag: "div",
13800
+ language,
13801
+ style: activeStyle,
13802
+ wrapLines: errorLines && errorLines.size > 0,
13803
+ lineProps: errorLineProps,
13804
+ customStyle: {
13805
+ backgroundColor: "transparent",
13806
+ borderRadius: 0,
13807
+ padding: "1rem",
13808
+ margin: 0,
13809
+ whiteSpace: "pre",
13810
+ minWidth: "100%",
13811
+ fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
13812
+ fontSize: "13px",
13813
+ lineHeight: "1.5"
13814
+ },
13815
+ codeTagProps: {
13816
+ style: {
13817
+ fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
13818
+ fontSize: "13px",
13819
+ lineHeight: "1.5"
13820
+ }
13821
+ },
13822
+ children: editableValue || " "
13823
+ }
13824
+ ),
13825
+ [editableValue, editableOverCapacity, plainCodeColor, language, activeStyle, errorLines, errorLineProps, languageReady]
13826
+ );
13774
13827
  const highlightedElement = useMemo(
13775
- () => /* @__PURE__ */ jsx(
13828
+ () => overCapacity ? /* @__PURE__ */ jsx(
13829
+ "div",
13830
+ {
13831
+ style: {
13832
+ margin: 0,
13833
+ whiteSpace: "pre",
13834
+ minWidth: "100%",
13835
+ color: plainCodeColor
13836
+ },
13837
+ children: code
13838
+ }
13839
+ ) : /* @__PURE__ */ jsx(
13776
13840
  SyntaxHighlighter,
13777
13841
  {
13778
13842
  PreTag: "div",
@@ -13794,7 +13858,7 @@ var init_CodeBlock = __esm({
13794
13858
  children: code
13795
13859
  }
13796
13860
  ),
13797
- [code, language, activeStyle, languageReady]
13861
+ [code, overCapacity, plainCodeColor, language, activeStyle, languageReady]
13798
13862
  );
13799
13863
  useLayoutEffect(() => {
13800
13864
  const container = codeRef.current;
@@ -14123,35 +14187,7 @@ var init_CodeBlock = __esm({
14123
14187
  overflow: "hidden",
14124
14188
  pointerEvents: "none"
14125
14189
  },
14126
- children: /* @__PURE__ */ jsx(
14127
- SyntaxHighlighter,
14128
- {
14129
- PreTag: "div",
14130
- language,
14131
- style: activeStyle,
14132
- wrapLines: errorLines && errorLines.size > 0,
14133
- lineProps: errorLineProps,
14134
- customStyle: {
14135
- backgroundColor: "transparent",
14136
- borderRadius: 0,
14137
- padding: "1rem",
14138
- margin: 0,
14139
- whiteSpace: "pre",
14140
- minWidth: "100%",
14141
- fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
14142
- fontSize: "13px",
14143
- lineHeight: "1.5"
14144
- },
14145
- codeTagProps: {
14146
- style: {
14147
- fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, "Cascadia Mono", "Courier New", monospace',
14148
- fontSize: "13px",
14149
- lineHeight: "1.5"
14150
- }
14151
- },
14152
- children: editableValue || " "
14153
- }
14154
- )
14190
+ children: editableHighlightedElement
14155
14191
  }
14156
14192
  ),
14157
14193
  /* @__PURE__ */ jsx(
@@ -14223,14 +14259,77 @@ var init_CodeBlock = __esm({
14223
14259
  CodeBlock.displayName = "CodeBlock";
14224
14260
  }
14225
14261
  });
14262
+ function loadMermaid() {
14263
+ mermaidModule ?? (mermaidModule = import('mermaid').then((m) => m.default));
14264
+ return mermaidModule;
14265
+ }
14266
+ var mermaidModule, MermaidDiagram;
14267
+ var init_MermaidDiagram = __esm({
14268
+ "components/core/molecules/markdown/MermaidDiagram.tsx"() {
14269
+ init_Box();
14270
+ init_Typography();
14271
+ init_CodeBlock();
14272
+ init_cn();
14273
+ mermaidModule = null;
14274
+ MermaidDiagram = React79__default.memo(
14275
+ ({ code, className }) => {
14276
+ const { resolvedMode } = useTheme();
14277
+ const containerRef = useRef(null);
14278
+ const [error, setError] = useState(null);
14279
+ const reactId = useId();
14280
+ useEffect(() => {
14281
+ let active = true;
14282
+ void (async () => {
14283
+ try {
14284
+ const mermaid = await loadMermaid();
14285
+ mermaid.initialize({
14286
+ startOnLoad: false,
14287
+ securityLevel: "strict",
14288
+ theme: resolvedMode === "dark" ? "dark" : "default"
14289
+ });
14290
+ const domId = `mermaid-${reactId.replace(/[^a-zA-Z0-9]/g, "")}`;
14291
+ const { svg } = await mermaid.render(domId, code);
14292
+ if (!active || !containerRef.current) return;
14293
+ containerRef.current.innerHTML = svg;
14294
+ setError(null);
14295
+ } catch (err) {
14296
+ if (active) setError(err instanceof Error ? err.message : String(err));
14297
+ }
14298
+ })();
14299
+ return () => {
14300
+ active = false;
14301
+ };
14302
+ }, [code, resolvedMode, reactId]);
14303
+ return /* @__PURE__ */ jsxs(Box, { className: cn("not-prose my-4", className), children: [
14304
+ error !== null && /* @__PURE__ */ jsxs(Box, { className: "space-y-2 mb-2", children: [
14305
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-error whitespace-pre-wrap", children: error }),
14306
+ /* @__PURE__ */ jsx(CodeBlock, { code, language: "mermaid" })
14307
+ ] }),
14308
+ /* @__PURE__ */ jsx(
14309
+ Box,
14310
+ {
14311
+ ref: containerRef,
14312
+ "data-testid": "mermaid-diagram",
14313
+ className: "overflow-x-auto",
14314
+ style: error !== null ? { display: "none" } : void 0
14315
+ }
14316
+ )
14317
+ ] });
14318
+ },
14319
+ (prev, next) => prev.code === next.code && prev.className === next.className
14320
+ );
14321
+ MermaidDiagram.displayName = "MermaidDiagram";
14322
+ }
14323
+ });
14226
14324
  var MarkdownContent;
14227
14325
  var init_MarkdownContent = __esm({
14228
14326
  "components/core/molecules/markdown/MarkdownContent.tsx"() {
14229
14327
  init_katex_min();
14230
14328
  init_Box();
14231
14329
  init_CodeBlock();
14330
+ init_MermaidDiagram();
14232
14331
  init_cn();
14233
- MarkdownContent = React77__default.memo(
14332
+ MarkdownContent = React79__default.memo(
14234
14333
  ({ content, direction = "ltr", className }) => {
14235
14334
  const { t: _t } = useTranslate();
14236
14335
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -14275,6 +14374,9 @@ var init_MarkdownContent = __esm({
14275
14374
  if (!inline) {
14276
14375
  const match = /language-(\w+)/.exec(codeClassName ?? "");
14277
14376
  const code = String(children).replace(/\n$/, "");
14377
+ if (match?.[1] === "mermaid") {
14378
+ return /* @__PURE__ */ jsx(MermaidDiagram, { code });
14379
+ }
14278
14380
  if (match) {
14279
14381
  return /* @__PURE__ */ jsx(
14280
14382
  CodeBlock,
@@ -15557,7 +15659,7 @@ var init_StateMachineView = __esm({
15557
15659
  style: { top: title ? 30 : 0 },
15558
15660
  children: [
15559
15661
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
15560
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React77__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
15662
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React79__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
15561
15663
  StateNode,
15562
15664
  {
15563
15665
  state,
@@ -18198,8 +18300,8 @@ function MiniMap({
18198
18300
  tileAssets,
18199
18301
  unitAssets
18200
18302
  }) {
18201
- const canvasRef = React77.useRef(null);
18202
- const imgCacheRef = React77.useRef(/* @__PURE__ */ new Map());
18303
+ const canvasRef = React79.useRef(null);
18304
+ const imgCacheRef = React79.useRef(/* @__PURE__ */ new Map());
18203
18305
  function loadImg(url) {
18204
18306
  const cached = imgCacheRef.current.get(url);
18205
18307
  if (cached) return cached.complete ? cached : null;
@@ -18215,7 +18317,7 @@ function MiniMap({
18215
18317
  imgCacheRef.current.set(url, img);
18216
18318
  return null;
18217
18319
  }
18218
- React77.useEffect(() => {
18320
+ React79.useEffect(() => {
18219
18321
  const canvas = canvasRef.current;
18220
18322
  if (!canvas) return;
18221
18323
  const ctx = canvas.getContext("2d");
@@ -18796,7 +18898,7 @@ function Canvas2D({
18796
18898
  const registerChildDrawable = useCallback((node) => {
18797
18899
  childDrawablesRef.current.push(node);
18798
18900
  }, []);
18799
- const hasJsxChildren = React77.Children.count(children) > 0;
18901
+ const hasJsxChildren = React79.Children.count(children) > 0;
18800
18902
  function isDrawableLayer(node) {
18801
18903
  return node.type === "draw-sprite-layer" || node.type === "draw-shape-layer" || node.type === "draw-text-layer";
18802
18904
  }
@@ -19354,7 +19456,7 @@ function Canvas({
19354
19456
  if (mode !== "3d") return;
19355
19457
  const next = childDrawablesRef.current;
19356
19458
  canvasLog.debug("children:adopt", { registered: next.length, adopted: childDrawables.length });
19357
- if (next.length === 0 && React77.Children.count(children) > 0) return;
19459
+ if (next.length === 0 && React79.Children.count(children) > 0) return;
19358
19460
  setChildDrawables(
19359
19461
  (prev) => prev.length === next.length && JSON.stringify(prev) === JSON.stringify(next) ? prev : [...next]
19360
19462
  );
@@ -19392,7 +19494,7 @@ function Canvas({
19392
19494
  };
19393
19495
  return /* @__PURE__ */ jsxs(Fragment, { children: [
19394
19496
  /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(Canvas3DHost2, { ...props3d }) }),
19395
- React77.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 }) })
19497
+ React79.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 }) })
19396
19498
  ] });
19397
19499
  }
19398
19500
  return /* @__PURE__ */ jsx(
@@ -21784,6 +21886,183 @@ var init_CodeRunnerPanel = __esm({
21784
21886
  CodeRunnerPanel.displayName = "CodeRunnerPanel";
21785
21887
  }
21786
21888
  });
21889
+ function matchesQuery(query, text) {
21890
+ if (!query) return true;
21891
+ let qi = 0;
21892
+ const q = query.toLowerCase();
21893
+ const t = text.toLowerCase();
21894
+ for (let ti = 0; ti < t.length && qi < q.length; ti++) {
21895
+ if (t[ti] === q[qi]) qi++;
21896
+ }
21897
+ return qi === q.length;
21898
+ }
21899
+ function commandMatches(command, query) {
21900
+ if (!query) return true;
21901
+ if (matchesQuery(query, command.label)) return true;
21902
+ return (command.keywords ?? []).some((keyword) => matchesQuery(query, keyword));
21903
+ }
21904
+ var UNGROUPED, CommandPalette;
21905
+ var init_CommandPalette = __esm({
21906
+ "components/core/molecules/CommandPalette.tsx"() {
21907
+ "use client";
21908
+ init_Box();
21909
+ init_Stack();
21910
+ init_Typography();
21911
+ init_Icon();
21912
+ init_Input();
21913
+ init_Badge();
21914
+ init_cn();
21915
+ init_useEventBus();
21916
+ init_Modal();
21917
+ UNGROUPED = /* @__PURE__ */ Symbol("command-palette-ungrouped");
21918
+ CommandPalette = ({
21919
+ open,
21920
+ onOpenChange,
21921
+ commands,
21922
+ onSelect,
21923
+ placeholder = "Type a command...",
21924
+ emptyLabel = "No matching commands",
21925
+ className
21926
+ }) => {
21927
+ const eventBus = useEventBus();
21928
+ const [query, setQuery] = useState("");
21929
+ const [highlightIndex, setHighlightIndex] = useState(0);
21930
+ const filtered = useMemo(
21931
+ () => commands.filter((command) => commandMatches(command, query)),
21932
+ [commands, query]
21933
+ );
21934
+ const groups = useMemo(() => {
21935
+ const order = [];
21936
+ const byGroup = /* @__PURE__ */ new Map();
21937
+ for (const command of filtered) {
21938
+ const key = command.group ?? UNGROUPED;
21939
+ if (!byGroup.has(key)) {
21940
+ byGroup.set(key, []);
21941
+ order.push(key);
21942
+ }
21943
+ byGroup.get(key).push(command);
21944
+ }
21945
+ return order.map((key) => ({ group: key === UNGROUPED ? void 0 : key, items: byGroup.get(key) }));
21946
+ }, [filtered]);
21947
+ const resetQuery = useCallback(() => {
21948
+ setQuery("");
21949
+ setHighlightIndex(0);
21950
+ }, []);
21951
+ const handleClose = useCallback(() => {
21952
+ resetQuery();
21953
+ onOpenChange(false);
21954
+ }, [onOpenChange, resetQuery]);
21955
+ const handleSelect = useCallback(
21956
+ (command) => {
21957
+ if (command.disabled) return;
21958
+ if (command.event) eventBus.emit(`UI:${command.event}`, { commandId: command.id });
21959
+ if (command.action) eventBus.emit(`UI:${command.action}`, command.actionPayload ?? {});
21960
+ onSelect?.(command);
21961
+ handleClose();
21962
+ },
21963
+ [eventBus, onSelect, handleClose]
21964
+ );
21965
+ const handleQueryChange = useCallback((e) => {
21966
+ setQuery(e.target.value);
21967
+ setHighlightIndex(0);
21968
+ }, []);
21969
+ const handleKeyDown = useCallback(
21970
+ (e) => {
21971
+ if (filtered.length === 0) return;
21972
+ if (e.key === "ArrowDown") {
21973
+ e.preventDefault();
21974
+ setHighlightIndex((prev) => prev < filtered.length - 1 ? prev + 1 : 0);
21975
+ } else if (e.key === "ArrowUp") {
21976
+ e.preventDefault();
21977
+ setHighlightIndex((prev) => prev > 0 ? prev - 1 : filtered.length - 1);
21978
+ } else if (e.key === "Enter") {
21979
+ e.preventDefault();
21980
+ const command = filtered[highlightIndex];
21981
+ if (command) handleSelect(command);
21982
+ }
21983
+ },
21984
+ [filtered, highlightIndex, handleSelect]
21985
+ );
21986
+ return /* @__PURE__ */ jsx(
21987
+ Modal,
21988
+ {
21989
+ isOpen: open,
21990
+ onClose: handleClose,
21991
+ onExited: resetQuery,
21992
+ showCloseButton: false,
21993
+ size: "md",
21994
+ className,
21995
+ children: /* @__PURE__ */ jsx(Box, { "data-testid": "command-palette", children: /* @__PURE__ */ jsxs(VStack, { gap: "sm", children: [
21996
+ /* @__PURE__ */ jsx(
21997
+ Input,
21998
+ {
21999
+ inputType: "search",
22000
+ placeholder,
22001
+ value: query,
22002
+ onChange: handleQueryChange,
22003
+ onKeyDown: handleKeyDown,
22004
+ leftIcon: "search",
22005
+ clearable: query.length > 0,
22006
+ onClear: resetQuery,
22007
+ autoFocus: true,
22008
+ "data-testid": "command-palette-input"
22009
+ }
22010
+ ),
22011
+ 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(
22012
+ Box,
22013
+ {
22014
+ className: "max-h-80 overflow-y-auto",
22015
+ role: "listbox",
22016
+ "aria-label": placeholder,
22017
+ children: /* @__PURE__ */ jsx(VStack, { gap: "none", children: groups.map(({ group, items }) => /* @__PURE__ */ jsxs(Box, { children: [
22018
+ group ? /* @__PURE__ */ jsx(
22019
+ Typography,
22020
+ {
22021
+ variant: "caption",
22022
+ color: "muted",
22023
+ className: "px-3 pt-2 pb-1 block",
22024
+ children: group
22025
+ }
22026
+ ) : null,
22027
+ items.map((command) => {
22028
+ const index = filtered.indexOf(command);
22029
+ const isHighlighted = index === highlightIndex;
22030
+ return /* @__PURE__ */ jsxs(
22031
+ Box,
22032
+ {
22033
+ as: "button",
22034
+ role: "option",
22035
+ "aria-selected": isHighlighted,
22036
+ "aria-disabled": command.disabled || void 0,
22037
+ "data-testid": `command-palette-item-${command.id}`,
22038
+ onMouseEnter: () => !command.disabled && setHighlightIndex(index),
22039
+ onClick: () => handleSelect(command),
22040
+ className: cn(
22041
+ "w-full flex items-center gap-3 px-3 py-2 text-start rounded-sm",
22042
+ "text-sm transition-colors",
22043
+ "focus:outline-none",
22044
+ isHighlighted && "bg-muted",
22045
+ command.disabled && "opacity-50 cursor-not-allowed"
22046
+ ),
22047
+ children: [
22048
+ command.icon ? /* @__PURE__ */ jsx(Icon, { icon: command.icon, size: "sm", className: "flex-shrink-0" }) : null,
22049
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "flex-1 truncate", children: command.label }),
22050
+ command.shortcut ? /* @__PURE__ */ jsx(Badge, { variant: "neutral", size: "sm", children: command.shortcut }) : null
22051
+ ]
22052
+ },
22053
+ command.id
22054
+ );
22055
+ })
22056
+ ] }, String(group ?? "__ungrouped__"))) })
22057
+ }
22058
+ )
22059
+ ] }) })
22060
+ }
22061
+ );
22062
+ };
22063
+ CommandPalette.displayName = "CommandPalette";
22064
+ }
22065
+ });
21787
22066
  function formatCount(count) {
21788
22067
  if (count >= 1e3) {
21789
22068
  return `${(count / 1e3).toFixed(1)}k`;
@@ -21987,9 +22266,9 @@ function ControlButton({
21987
22266
  className
21988
22267
  }) {
21989
22268
  const eventBus = useEventBus();
21990
- const [isPressed, setIsPressed] = React77.useState(false);
22269
+ const [isPressed, setIsPressed] = React79.useState(false);
21991
22270
  const actualPressed = pressed ?? isPressed;
21992
- const handlePointerDown = React77.useCallback(
22271
+ const handlePointerDown = React79.useCallback(
21993
22272
  (e) => {
21994
22273
  e.preventDefault();
21995
22274
  if (disabled) return;
@@ -21999,7 +22278,7 @@ function ControlButton({
21999
22278
  },
22000
22279
  [disabled, pressEvent, eventBus, onPress]
22001
22280
  );
22002
- const handlePointerUp = React77.useCallback(
22281
+ const handlePointerUp = React79.useCallback(
22003
22282
  (e) => {
22004
22283
  e.preventDefault();
22005
22284
  if (disabled) return;
@@ -22009,7 +22288,7 @@ function ControlButton({
22009
22288
  },
22010
22289
  [disabled, releaseEvent, eventBus, onRelease]
22011
22290
  );
22012
- const handlePointerLeave = React77.useCallback(
22291
+ const handlePointerLeave = React79.useCallback(
22013
22292
  (e) => {
22014
22293
  if (isPressed) {
22015
22294
  setIsPressed(false);
@@ -22098,18 +22377,18 @@ function ControlGrid({
22098
22377
  className
22099
22378
  }) {
22100
22379
  const eventBus = useEventBus();
22101
- const [active, setActive] = React77.useState(/* @__PURE__ */ new Set());
22102
- const [coarse, setCoarse] = React77.useState(
22380
+ const [active, setActive] = React79.useState(/* @__PURE__ */ new Set());
22381
+ const [coarse, setCoarse] = React79.useState(
22103
22382
  () => typeof window !== "undefined" && window.matchMedia("(pointer: coarse)").matches
22104
22383
  );
22105
- React77.useEffect(() => {
22384
+ React79.useEffect(() => {
22106
22385
  if (visibility !== "auto" || typeof window === "undefined") return;
22107
22386
  const mq = window.matchMedia("(pointer: coarse)");
22108
22387
  const onChange = (e) => setCoarse(e.matches);
22109
22388
  mq.addEventListener("change", onChange);
22110
22389
  return () => mq.removeEventListener("change", onChange);
22111
22390
  }, [visibility]);
22112
- const handlePress = React77.useCallback(
22391
+ const handlePress = React79.useCallback(
22113
22392
  (id) => {
22114
22393
  setActive((prev) => new Set(prev).add(id));
22115
22394
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -22123,7 +22402,7 @@ function ControlGrid({
22123
22402
  },
22124
22403
  [kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
22125
22404
  );
22126
- const handleRelease = React77.useCallback(
22405
+ const handleRelease = React79.useCallback(
22127
22406
  (id) => {
22128
22407
  setActive((prev) => {
22129
22408
  const next = new Set(prev);
@@ -23379,7 +23658,7 @@ var init_Menu = __esm({
23379
23658
  "bottom-end": "bottom-start"
23380
23659
  };
23381
23660
  const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
23382
- const triggerElement = React77__default.isValidElement(trigger) ? React77__default.cloneElement(trigger, {
23661
+ const triggerElement = React79__default.isValidElement(trigger) ? React79__default.cloneElement(trigger, {
23383
23662
  ref: triggerRef,
23384
23663
  onClick: handleToggle
23385
23664
  }) : /* @__PURE__ */ jsx(
@@ -23482,14 +23761,14 @@ function useDataDnd(args) {
23482
23761
  const isZone = Boolean(dragGroup || accepts || sortable);
23483
23762
  const enabled = isZone || Boolean(dndRoot);
23484
23763
  const eventBus = useEventBus();
23485
- const parentRoot = React77__default.useContext(RootCtx);
23764
+ const parentRoot = React79__default.useContext(RootCtx);
23486
23765
  const isRoot = enabled && parentRoot === null;
23487
- const zoneId = React77__default.useId();
23766
+ const zoneId = React79__default.useId();
23488
23767
  const ownGroup = dragGroup ?? accepts ?? zoneId;
23489
- const [optimisticOrders, setOptimisticOrders] = React77__default.useState(() => /* @__PURE__ */ new Map());
23490
- const optimisticOrdersRef = React77__default.useRef(optimisticOrders);
23768
+ const [optimisticOrders, setOptimisticOrders] = React79__default.useState(() => /* @__PURE__ */ new Map());
23769
+ const optimisticOrdersRef = React79__default.useRef(optimisticOrders);
23491
23770
  optimisticOrdersRef.current = optimisticOrders;
23492
- const clearOptimisticOrder = React77__default.useCallback((group) => {
23771
+ const clearOptimisticOrder = React79__default.useCallback((group) => {
23493
23772
  setOptimisticOrders((prev) => {
23494
23773
  if (!prev.has(group)) return prev;
23495
23774
  const next = new Map(prev);
@@ -23514,7 +23793,7 @@ function useDataDnd(args) {
23514
23793
  const raw = it[dndItemIdField];
23515
23794
  return raw != null ? String(raw) : `__idx_${idx}`;
23516
23795
  }).join("|");
23517
- const itemIds = React77__default.useMemo(
23796
+ const itemIds = React79__default.useMemo(
23518
23797
  () => orderedItems.map((it, idx) => {
23519
23798
  const raw = it[dndItemIdField];
23520
23799
  return raw != null ? String(raw) : `__idx_${idx}`;
@@ -23525,7 +23804,7 @@ function useDataDnd(args) {
23525
23804
  const raw = it[dndItemIdField];
23526
23805
  return raw != null ? String(raw) : `__${idx}`;
23527
23806
  }).join("|");
23528
- React77__default.useEffect(() => {
23807
+ React79__default.useEffect(() => {
23529
23808
  const root = isRoot ? null : parentRoot;
23530
23809
  if (root) {
23531
23810
  root.clearOptimisticOrder(ownGroup);
@@ -23533,20 +23812,20 @@ function useDataDnd(args) {
23533
23812
  clearOptimisticOrder(ownGroup);
23534
23813
  }
23535
23814
  }, [itemsContentSig, ownGroup]);
23536
- const zonesRef = React77__default.useRef(/* @__PURE__ */ new Map());
23537
- const registerZone = React77__default.useCallback((zoneId2, meta2) => {
23815
+ const zonesRef = React79__default.useRef(/* @__PURE__ */ new Map());
23816
+ const registerZone = React79__default.useCallback((zoneId2, meta2) => {
23538
23817
  zonesRef.current.set(zoneId2, meta2);
23539
23818
  }, []);
23540
- const unregisterZone = React77__default.useCallback((zoneId2) => {
23819
+ const unregisterZone = React79__default.useCallback((zoneId2) => {
23541
23820
  zonesRef.current.delete(zoneId2);
23542
23821
  }, []);
23543
- const [activeDrag, setActiveDrag] = React77__default.useState(null);
23544
- const [overZoneGroup, setOverZoneGroup] = React77__default.useState(null);
23545
- const meta = React77__default.useMemo(
23822
+ const [activeDrag, setActiveDrag] = React79__default.useState(null);
23823
+ const [overZoneGroup, setOverZoneGroup] = React79__default.useState(null);
23824
+ const meta = React79__default.useMemo(
23546
23825
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
23547
23826
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
23548
23827
  );
23549
- React77__default.useEffect(() => {
23828
+ React79__default.useEffect(() => {
23550
23829
  const target = isRoot ? null : parentRoot;
23551
23830
  if (!target) {
23552
23831
  zonesRef.current.set(zoneId, meta);
@@ -23565,7 +23844,7 @@ function useDataDnd(args) {
23565
23844
  }, [parentRoot, isRoot, zoneId, meta]);
23566
23845
  const sensors = useAlmadarDndSensors(true);
23567
23846
  const collisionDetection = almadarDndCollisionDetection;
23568
- const findZoneByItem = React77__default.useCallback(
23847
+ const findZoneByItem = React79__default.useCallback(
23569
23848
  (id) => {
23570
23849
  for (const z of zonesRef.current.values()) {
23571
23850
  if (z.itemIds.includes(id)) return z;
@@ -23574,7 +23853,7 @@ function useDataDnd(args) {
23574
23853
  },
23575
23854
  []
23576
23855
  );
23577
- React77__default.useCallback(
23856
+ React79__default.useCallback(
23578
23857
  (group) => {
23579
23858
  for (const z of zonesRef.current.values()) {
23580
23859
  if (z.group === group) return z;
@@ -23583,7 +23862,7 @@ function useDataDnd(args) {
23583
23862
  },
23584
23863
  []
23585
23864
  );
23586
- const handleDragEnd = React77__default.useCallback(
23865
+ const handleDragEnd = React79__default.useCallback(
23587
23866
  (event) => {
23588
23867
  const { active, over } = event;
23589
23868
  const activeIdStr = String(active.id);
@@ -23674,8 +23953,8 @@ function useDataDnd(args) {
23674
23953
  },
23675
23954
  [eventBus]
23676
23955
  );
23677
- const sortableData = React77__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
23678
- const SortableItem = React77__default.useCallback(
23956
+ const sortableData = React79__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
23957
+ const SortableItem = React79__default.useCallback(
23679
23958
  ({ id, children }) => {
23680
23959
  const {
23681
23960
  attributes,
@@ -23715,7 +23994,7 @@ function useDataDnd(args) {
23715
23994
  id: droppableId,
23716
23995
  data: sortableData
23717
23996
  });
23718
- const ctx = React77__default.useContext(RootCtx);
23997
+ const ctx = React79__default.useContext(RootCtx);
23719
23998
  const activeDrag2 = ctx?.activeDrag ?? null;
23720
23999
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
23721
24000
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -23730,7 +24009,7 @@ function useDataDnd(args) {
23730
24009
  showForeignPlaceholder,
23731
24010
  ctxAvailable: ctx != null
23732
24011
  });
23733
- React77__default.useEffect(() => {
24012
+ React79__default.useEffect(() => {
23734
24013
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
23735
24014
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
23736
24015
  return /* @__PURE__ */ jsx(
@@ -23744,11 +24023,11 @@ function useDataDnd(args) {
23744
24023
  }
23745
24024
  );
23746
24025
  };
23747
- const rootContextValue = React77__default.useMemo(
24026
+ const rootContextValue = React79__default.useMemo(
23748
24027
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
23749
24028
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
23750
24029
  );
23751
- const handleDragStart = React77__default.useCallback((event) => {
24030
+ const handleDragStart = React79__default.useCallback((event) => {
23752
24031
  const sourceZone = findZoneByItem(event.active.id);
23753
24032
  const rect = event.active.rect.current.initial;
23754
24033
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -23767,7 +24046,7 @@ function useDataDnd(args) {
23767
24046
  isRoot
23768
24047
  });
23769
24048
  }, [findZoneByItem, isRoot, zoneId]);
23770
- const handleDragOver = React77__default.useCallback((event) => {
24049
+ const handleDragOver = React79__default.useCallback((event) => {
23771
24050
  const { active, over } = event;
23772
24051
  const overData = over?.data?.current;
23773
24052
  const overGroup = overData?.dndGroup ?? null;
@@ -23837,7 +24116,7 @@ function useDataDnd(args) {
23837
24116
  return next;
23838
24117
  });
23839
24118
  }, []);
23840
- const handleDragCancel = React77__default.useCallback((event) => {
24119
+ const handleDragCancel = React79__default.useCallback((event) => {
23841
24120
  setActiveDrag(null);
23842
24121
  setOverZoneGroup(null);
23843
24122
  dndLog.warn("dragCancel", {
@@ -23845,12 +24124,12 @@ function useDataDnd(args) {
23845
24124
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
23846
24125
  });
23847
24126
  }, []);
23848
- const handleDragEndWithCleanup = React77__default.useCallback((event) => {
24127
+ const handleDragEndWithCleanup = React79__default.useCallback((event) => {
23849
24128
  handleDragEnd(event);
23850
24129
  setActiveDrag(null);
23851
24130
  setOverZoneGroup(null);
23852
24131
  }, [handleDragEnd]);
23853
- const wrapContainer = React77__default.useCallback(
24132
+ const wrapContainer = React79__default.useCallback(
23854
24133
  (children) => {
23855
24134
  if (!enabled) return children;
23856
24135
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -23904,7 +24183,7 @@ var init_useDataDnd = __esm({
23904
24183
  init_useAlmadarDndCollision();
23905
24184
  init_Box();
23906
24185
  dndLog = createLogger("almadar:ui:dnd");
23907
- RootCtx = React77__default.createContext(null);
24186
+ RootCtx = React79__default.createContext(null);
23908
24187
  }
23909
24188
  });
23910
24189
  function renderIconInput(icon, props) {
@@ -24419,7 +24698,7 @@ function DataList({
24419
24698
  }) {
24420
24699
  const eventBus = useEventBus();
24421
24700
  const { t } = useTranslate();
24422
- const [visibleCount, setVisibleCount] = React77__default.useState(pageSize || Infinity);
24701
+ const [visibleCount, setVisibleCount] = React79__default.useState(pageSize || Infinity);
24423
24702
  const fieldDefs = fields ?? columns ?? [];
24424
24703
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
24425
24704
  const dnd = useDataDnd({
@@ -24435,14 +24714,14 @@ function DataList({
24435
24714
  dndRoot
24436
24715
  });
24437
24716
  const orderedData = dnd.orderedItems;
24438
- const allData = React77__default.useMemo(
24717
+ const allData = React79__default.useMemo(
24439
24718
  () => sortRows(orderedData, sortBy, sortDirection),
24440
24719
  [orderedData, sortBy, sortDirection]
24441
24720
  );
24442
24721
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
24443
24722
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
24444
24723
  const hasRenderProp = typeof children === "function";
24445
- React77__default.useEffect(() => {
24724
+ React79__default.useEffect(() => {
24446
24725
  const renderItemTypeOf = typeof schemaRenderItem;
24447
24726
  const childrenTypeOf = typeof children;
24448
24727
  if (data.length > 0 && !hasRenderProp) {
@@ -24562,7 +24841,7 @@ function DataList({
24562
24841
  return v === void 0 || v === null || v === "" ? raw : String(v);
24563
24842
  };
24564
24843
  return /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: cn("py-2", className), children: [
24565
- groups2.map((group, gi) => /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
24844
+ groups2.map((group, gi) => /* @__PURE__ */ jsxs(React79__default.Fragment, { children: [
24566
24845
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
24567
24846
  group.items.map((itemData, index) => {
24568
24847
  const id = itemData.id || `${gi}-${index}`;
@@ -24778,7 +25057,7 @@ function DataList({
24778
25057
  className
24779
25058
  ),
24780
25059
  children: [
24781
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
25060
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React79__default.Fragment, { children: [
24782
25061
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
24783
25062
  group.items.map(
24784
25063
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -24887,8 +25166,8 @@ function ScalarControl({
24887
25166
  }
24888
25167
  const numeric = typeof value === "number";
24889
25168
  const initial = value === null ? "" : String(value);
24890
- const [draft, setDraft] = React77__default.useState(initial);
24891
- React77__default.useEffect(() => setDraft(initial), [initial]);
25169
+ const [draft, setDraft] = React79__default.useState(initial);
25170
+ React79__default.useEffect(() => setDraft(initial), [initial]);
24892
25171
  const commit = () => {
24893
25172
  if (numeric) {
24894
25173
  const n = draft.trim() === "" ? 0 : Number(draft);
@@ -24956,8 +25235,8 @@ function Row({
24956
25235
  onRemove,
24957
25236
  readonly
24958
25237
  }) {
24959
- const [keyDraft, setKeyDraft] = React77__default.useState(rowKey);
24960
- React77__default.useEffect(() => setKeyDraft(rowKey), [rowKey]);
25238
+ const [keyDraft, setKeyDraft] = React79__default.useState(rowKey);
25239
+ React79__default.useEffect(() => setKeyDraft(rowKey), [rowKey]);
24961
25240
  const container = isObj(value) || isArr(value);
24962
25241
  return /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "group w-max min-w-full", children: [
24963
25242
  /* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", className: "py-0.5 w-max", children: [
@@ -25000,7 +25279,7 @@ function ContainerNode({
25000
25279
  depth,
25001
25280
  readonly
25002
25281
  }) {
25003
- const [open, setOpen] = React77__default.useState(depth < 2);
25282
+ const [open, setOpen] = React79__default.useState(depth < 2);
25004
25283
  const array = isArr(value);
25005
25284
  const entries = array ? value.map((v, i) => [String(i), v]) : Object.entries(value);
25006
25285
  const setObjValue = (key, next) => {
@@ -25142,7 +25421,7 @@ var init_FormSection = __esm({
25142
25421
  columns = 1,
25143
25422
  className
25144
25423
  }) => {
25145
- const [collapsed, setCollapsed] = React77__default.useState(defaultCollapsed);
25424
+ const [collapsed, setCollapsed] = React79__default.useState(defaultCollapsed);
25146
25425
  const { t } = useTranslate();
25147
25426
  const eventBus = useEventBus();
25148
25427
  const gridClass = {
@@ -25150,7 +25429,7 @@ var init_FormSection = __esm({
25150
25429
  2: "grid-cols-1 md:grid-cols-2",
25151
25430
  3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
25152
25431
  }[columns];
25153
- React77__default.useCallback(() => {
25432
+ React79__default.useCallback(() => {
25154
25433
  if (collapsible) {
25155
25434
  setCollapsed((prev) => !prev);
25156
25435
  eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
@@ -25559,8 +25838,8 @@ function TextLikeControl({
25559
25838
  onCommit
25560
25839
  }) {
25561
25840
  const initial = value === void 0 || value === null ? "" : String(value);
25562
- const [draft, setDraft] = React77__default.useState(initial);
25563
- React77__default.useEffect(() => setDraft(initial), [initial]);
25841
+ const [draft, setDraft] = React79__default.useState(initial);
25842
+ React79__default.useEffect(() => setDraft(initial), [initial]);
25564
25843
  const commit = () => {
25565
25844
  if (numeric) {
25566
25845
  const n = draft.trim() === "" ? 0 : Number(draft);
@@ -25749,14 +26028,14 @@ var init_NodeSlotEditor = __esm({
25749
26028
  isObj2 = (v) => v !== null && v !== void 0 && typeof v === "object" && !Array.isArray(v);
25750
26029
  NodeSlotEditor = ({ value, onChange, className }) => {
25751
26030
  const { type, props, wasArray } = normalize(value);
25752
- const patterns = React77__default.useMemo(() => {
26031
+ const patterns = React79__default.useMemo(() => {
25753
26032
  try {
25754
26033
  return [...getKnownPatterns()].sort();
25755
26034
  } catch {
25756
26035
  return [];
25757
26036
  }
25758
26037
  }, []);
25759
- const options = React77__default.useMemo(
26038
+ const options = React79__default.useMemo(
25760
26039
  () => [{ value: "", label: "\u2014 none \u2014" }, ...patterns.map((p) => ({ value: p, label: p }))],
25761
26040
  [patterns]
25762
26041
  );
@@ -25768,7 +26047,7 @@ var init_NodeSlotEditor = __esm({
25768
26047
  const pattern = { type: nextType, ...nextProps };
25769
26048
  onChange(wasArray || value === void 0 ? [pattern] : pattern);
25770
26049
  };
25771
- const schemaEntries = React77__default.useMemo(() => {
26050
+ const schemaEntries = React79__default.useMemo(() => {
25772
26051
  if (!type) return [];
25773
26052
  const def = getPatternDefinition(type);
25774
26053
  if (!def?.propsSchema) return [];
@@ -25809,6 +26088,112 @@ var init_NodeSlotEditor = __esm({
25809
26088
  };
25810
26089
  }
25811
26090
  });
26091
+ function useDraggable({ payload, disabled = false }) {
26092
+ const [isDragging, setIsDragging] = useState(false);
26093
+ const eventBus = useEventBus();
26094
+ const handleDragStart = useCallback(
26095
+ (e) => {
26096
+ if (disabled) {
26097
+ e.preventDefault();
26098
+ return;
26099
+ }
26100
+ e.dataTransfer.setData(ALMADAR_DND_MIME, JSON.stringify(payload));
26101
+ e.dataTransfer.effectAllowed = "copy";
26102
+ setIsDragging(true);
26103
+ eventBus.emit("UI:DRAG_START", { kind: payload.kind, data: payload.data });
26104
+ },
26105
+ [disabled, payload, eventBus]
26106
+ );
26107
+ const handleDragEnd = useCallback(
26108
+ (e) => {
26109
+ setIsDragging(false);
26110
+ eventBus.emit("UI:DRAG_END", { kind: payload.kind, data: payload.data });
26111
+ },
26112
+ [payload, eventBus]
26113
+ );
26114
+ const dragProps = useMemo(
26115
+ () => ({
26116
+ draggable: !disabled,
26117
+ onDragStart: handleDragStart,
26118
+ onDragEnd: handleDragEnd,
26119
+ "aria-grabbed": isDragging
26120
+ }),
26121
+ [disabled, handleDragStart, handleDragEnd, isDragging]
26122
+ );
26123
+ return { dragProps, isDragging };
26124
+ }
26125
+ var ALMADAR_DND_MIME;
26126
+ var init_useDraggable = __esm({
26127
+ "hooks/useDraggable.ts"() {
26128
+ "use client";
26129
+ init_useEventBus();
26130
+ ALMADAR_DND_MIME = "application/x-almadar-dnd";
26131
+ }
26132
+ });
26133
+ function parsePayload(e) {
26134
+ try {
26135
+ const raw = e.dataTransfer.getData(ALMADAR_DND_MIME);
26136
+ if (!raw) return null;
26137
+ const parsed = JSON.parse(raw);
26138
+ if (typeof parsed.kind !== "string" || !parsed.data) return null;
26139
+ return parsed;
26140
+ } catch {
26141
+ return null;
26142
+ }
26143
+ }
26144
+ function hasAlmadarPayload(e) {
26145
+ return e.dataTransfer.types.includes(ALMADAR_DND_MIME);
26146
+ }
26147
+ function useDropZone({ accepts, onDrop, disabled = false }) {
26148
+ const [isOver, setIsOver] = useState(false);
26149
+ const eventBus = useEventBus();
26150
+ const handleDragOver = useCallback(
26151
+ (e) => {
26152
+ if (disabled) return;
26153
+ if (!hasAlmadarPayload(e)) return;
26154
+ e.preventDefault();
26155
+ e.dataTransfer.dropEffect = "copy";
26156
+ setIsOver(true);
26157
+ },
26158
+ [disabled]
26159
+ );
26160
+ const handleDragLeave = useCallback(
26161
+ (e) => {
26162
+ setIsOver(false);
26163
+ },
26164
+ []
26165
+ );
26166
+ const handleDrop = useCallback(
26167
+ (e) => {
26168
+ e.preventDefault();
26169
+ setIsOver(false);
26170
+ if (disabled) return;
26171
+ const payload = parsePayload(e);
26172
+ if (!payload) return;
26173
+ if (!accepts.includes(payload.kind)) return;
26174
+ const position = { x: e.clientX, y: e.clientY };
26175
+ onDrop(payload, position);
26176
+ eventBus.emit("UI:DROP", { kind: payload.kind, data: payload.data, ...position });
26177
+ },
26178
+ [disabled, accepts, onDrop, eventBus]
26179
+ );
26180
+ const dropProps = useMemo(
26181
+ () => ({
26182
+ onDragOver: handleDragOver,
26183
+ onDragLeave: handleDragLeave,
26184
+ onDrop: handleDrop
26185
+ }),
26186
+ [handleDragOver, handleDragLeave, handleDrop]
26187
+ );
26188
+ return { dropProps, isOver };
26189
+ }
26190
+ var init_useDropZone = __esm({
26191
+ "hooks/useDropZone.ts"() {
26192
+ "use client";
26193
+ init_useEventBus();
26194
+ init_useDraggable();
26195
+ }
26196
+ });
25812
26197
  function fileIcon(name) {
25813
26198
  const ext = name.split(".").pop()?.toLowerCase() ?? "";
25814
26199
  switch (ext) {
@@ -25834,6 +26219,13 @@ function fileIcon(name) {
25834
26219
  return "file";
25835
26220
  }
25836
26221
  }
26222
+ function siblingsOf(target, roots, childrenByParent) {
26223
+ if (target.parentId) {
26224
+ const parentSiblings = childrenByParent.get(target.parentId);
26225
+ if (parentSiblings?.some((sibling) => sibling.id === target.id)) return parentSiblings;
26226
+ }
26227
+ return roots;
26228
+ }
25837
26229
  function ancestorsOf(id, byId) {
25838
26230
  const out = /* @__PURE__ */ new Set();
25839
26231
  if (!id) return out;
@@ -25851,6 +26243,8 @@ var init_FileTree = __esm({
25851
26243
  init_Box();
25852
26244
  init_Typography();
25853
26245
  init_Icon();
26246
+ init_useDraggable();
26247
+ init_useDropZone();
25854
26248
  TreeNodeItem = ({
25855
26249
  node,
25856
26250
  depth,
@@ -25934,10 +26328,12 @@ var init_FileTree = __esm({
25934
26328
  depth,
25935
26329
  indent,
25936
26330
  childrenByParent,
26331
+ roots,
25937
26332
  onNodeSelect,
25938
26333
  onNodeAction,
25939
26334
  nodeActionIcon,
25940
26335
  nodeActionLabel,
26336
+ onNodeReorder,
25941
26337
  selectedId,
25942
26338
  look,
25943
26339
  isExpanded,
@@ -25948,6 +26344,7 @@ var init_FileTree = __esm({
25948
26344
  const expanded = hasChildren && isExpanded(item.id, depth);
25949
26345
  const isSelected = selectedId !== void 0 && selectedId !== "" && item.id === selectedId;
25950
26346
  const nav = look === "nav";
26347
+ const rowRef = useRef(null);
25951
26348
  const handleClick = useCallback(() => {
25952
26349
  if (hasChildren && !onNodeSelect) onToggle(item.id, expanded);
25953
26350
  onNodeSelect?.(item.id);
@@ -25960,16 +26357,50 @@ var init_FileTree = __esm({
25960
26357
  e.stopPropagation();
25961
26358
  onNodeAction?.(item.id);
25962
26359
  }, [item.id, onNodeAction]);
26360
+ const { dragProps } = useDraggable({
26361
+ payload: { kind: "tree-node", data: { id: item.id } },
26362
+ disabled: !onNodeReorder
26363
+ });
26364
+ const handleRowDrop = useCallback(
26365
+ (payload, position) => {
26366
+ if (!onNodeReorder) return;
26367
+ const draggedId = typeof payload.data.id === "string" ? payload.data.id : void 0;
26368
+ if (!draggedId || draggedId === item.id) return;
26369
+ const rect = rowRef.current?.getBoundingClientRect();
26370
+ if (!rect || rect.height === 0) return;
26371
+ const relY = position.y - rect.top;
26372
+ const third = rect.height / 3;
26373
+ if (relY >= third && relY <= third * 2) {
26374
+ const existingChildren = childrenByParent.get(item.id);
26375
+ onNodeReorder(draggedId, item.id, existingChildren ? existingChildren.length : 0);
26376
+ return;
26377
+ }
26378
+ const siblings = siblingsOf(item, roots, childrenByParent);
26379
+ const newParentId = siblings === roots ? null : item.parentId ?? null;
26380
+ const targetIndex = siblings.findIndex((sibling) => sibling.id === item.id);
26381
+ const index = relY < third ? targetIndex < 0 ? 0 : targetIndex : targetIndex < 0 ? siblings.length : targetIndex + 1;
26382
+ onNodeReorder(draggedId, newParentId, index);
26383
+ },
26384
+ [onNodeReorder, item, roots, childrenByParent]
26385
+ );
26386
+ const { dropProps } = useDropZone({
26387
+ accepts: ["tree-node"],
26388
+ onDrop: handleRowDrop,
26389
+ disabled: !onNodeReorder
26390
+ });
25963
26391
  return /* @__PURE__ */ jsxs(Fragment, { children: [
25964
26392
  /* @__PURE__ */ jsxs(
25965
26393
  Box,
25966
26394
  {
26395
+ ref: rowRef,
25967
26396
  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"}`,
25968
26397
  style: { paddingLeft: depth * indent + 8 },
25969
26398
  onClick: handleClick,
25970
26399
  role: "treeitem",
25971
26400
  "aria-selected": isSelected,
25972
26401
  "aria-expanded": hasChildren ? expanded : void 0,
26402
+ ...dragProps,
26403
+ ...dropProps,
25973
26404
  children: [
25974
26405
  hasChildren ? /* @__PURE__ */ jsx(Box, { onClick: handleChevron, className: "flex items-center flex-shrink-0", role: "button", "aria-label": expanded ? "Collapse" : "Expand", children: /* @__PURE__ */ jsx(
25975
26406
  Icon,
@@ -26016,10 +26447,12 @@ var init_FileTree = __esm({
26016
26447
  depth: depth + 1,
26017
26448
  indent,
26018
26449
  childrenByParent,
26450
+ roots,
26019
26451
  onNodeSelect,
26020
26452
  onNodeAction,
26021
26453
  nodeActionIcon,
26022
26454
  nodeActionLabel,
26455
+ onNodeReorder,
26023
26456
  selectedId,
26024
26457
  look,
26025
26458
  isExpanded,
@@ -26037,14 +26470,15 @@ var init_FileTree = __esm({
26037
26470
  onNodeAction,
26038
26471
  nodeActionIcon,
26039
26472
  nodeActionLabel,
26473
+ onNodeReorder,
26040
26474
  className,
26041
26475
  indent = 16
26042
26476
  }) => {
26043
26477
  const [overrides, setOverrides] = useState(() => /* @__PURE__ */ new Map());
26044
- const byId = React77__default.useMemo(() => new Map(items.map((node) => [node.id, node])), [items]);
26045
- const selectedAncestors = React77__default.useMemo(() => ancestorsOf(selectedId, byId), [selectedId, byId]);
26046
- const lastSelectedRef = React77__default.useRef(selectedId);
26047
- React77__default.useEffect(() => {
26478
+ const byId = React79__default.useMemo(() => new Map(items.map((node) => [node.id, node])), [items]);
26479
+ const selectedAncestors = React79__default.useMemo(() => ancestorsOf(selectedId, byId), [selectedId, byId]);
26480
+ const lastSelectedRef = React79__default.useRef(selectedId);
26481
+ React79__default.useEffect(() => {
26048
26482
  if (selectedId === lastSelectedRef.current) return;
26049
26483
  lastSelectedRef.current = selectedId;
26050
26484
  setOverrides((prev) => {
@@ -26085,10 +26519,12 @@ var init_FileTree = __esm({
26085
26519
  depth: 0,
26086
26520
  indent,
26087
26521
  childrenByParent,
26522
+ roots,
26088
26523
  onNodeSelect,
26089
26524
  onNodeAction,
26090
26525
  nodeActionIcon,
26091
26526
  nodeActionLabel,
26527
+ onNodeReorder,
26092
26528
  selectedId,
26093
26529
  look,
26094
26530
  isExpanded,
@@ -26108,6 +26544,7 @@ var init_FileTree = __esm({
26108
26544
  onNodeAction,
26109
26545
  nodeActionIcon,
26110
26546
  nodeActionLabel,
26547
+ onNodeReorder,
26111
26548
  className,
26112
26549
  indent = 16
26113
26550
  }) => {
@@ -26122,6 +26559,7 @@ var init_FileTree = __esm({
26122
26559
  onNodeAction,
26123
26560
  nodeActionIcon,
26124
26561
  nodeActionLabel,
26562
+ onNodeReorder,
26125
26563
  className,
26126
26564
  indent
26127
26565
  }
@@ -26882,7 +27320,7 @@ var init_Flex = __esm({
26882
27320
  flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
26883
27321
  }
26884
27322
  }
26885
- return React77__default.createElement(Component, {
27323
+ return React79__default.createElement(Component, {
26886
27324
  className: cn(
26887
27325
  inline ? "inline-flex" : "flex",
26888
27326
  directionStyles[direction],
@@ -27001,7 +27439,7 @@ var init_Grid = __esm({
27001
27439
  as: Component = "div"
27002
27440
  }) => {
27003
27441
  const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
27004
- return React77__default.createElement(
27442
+ return React79__default.createElement(
27005
27443
  Component,
27006
27444
  {
27007
27445
  className: cn(
@@ -27423,9 +27861,9 @@ var init_Popover = __esm({
27423
27861
  onMouseLeave: handleClose,
27424
27862
  onPointerDown: tapTriggerProps.onPointerDown
27425
27863
  };
27426
- const childElement = React77__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
27864
+ const childElement = React79__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
27427
27865
  const childPointerDown = childElement.props.onPointerDown;
27428
- const triggerElement = React77__default.cloneElement(
27866
+ const triggerElement = React79__default.cloneElement(
27429
27867
  childElement,
27430
27868
  {
27431
27869
  ref: triggerRef,
@@ -28289,9 +28727,9 @@ var init_Tooltip = __esm({
28289
28727
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
28290
28728
  };
28291
28729
  }, []);
28292
- const triggerElement = React77__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
28730
+ const triggerElement = React79__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
28293
28731
  const childPointerDown = triggerElement.props.onPointerDown;
28294
- const trigger = React77__default.cloneElement(triggerElement, {
28732
+ const trigger = React79__default.cloneElement(triggerElement, {
28295
28733
  ref: triggerRef,
28296
28734
  onMouseEnter: handleMouseEnter,
28297
28735
  onMouseLeave: handleMouseLeave,
@@ -28381,7 +28819,7 @@ var init_WizardProgress = __esm({
28381
28819
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
28382
28820
  const isActive = index === currentStep;
28383
28821
  const isCompleted = index < currentStep;
28384
- return /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
28822
+ return /* @__PURE__ */ jsxs(React79__default.Fragment, { children: [
28385
28823
  /* @__PURE__ */ jsx(
28386
28824
  "button",
28387
28825
  {
@@ -30065,7 +30503,7 @@ function GameMenu({
30065
30503
  }) {
30066
30504
  const resolvedOptions = (options?.length ? options : void 0) ?? (menuItems?.length ? menuItems : void 0) ?? DEFAULT_MENU_OPTIONS;
30067
30505
  const eventBus = useEventBus();
30068
- const handleOptionClick = React77.useCallback(
30506
+ const handleOptionClick = React79.useCallback(
30069
30507
  (option) => {
30070
30508
  if (option.event) {
30071
30509
  eventBus.emit(`UI:${option.event}`, { option });
@@ -30301,7 +30739,7 @@ function StateGraph({
30301
30739
  }) {
30302
30740
  const eventBus = useEventBus();
30303
30741
  const nodes = states ?? [];
30304
- const positions = React77.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
30742
+ const positions = React79.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
30305
30743
  return /* @__PURE__ */ jsxs(
30306
30744
  Box,
30307
30745
  {
@@ -30838,7 +31276,7 @@ function LinearView({
30838
31276
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
30839
31277
  const isDone = i < currentIdx;
30840
31278
  const isCurrent = i === currentIdx;
30841
- return /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
31279
+ return /* @__PURE__ */ jsxs(React79__default.Fragment, { children: [
30842
31280
  i > 0 && /* @__PURE__ */ jsx(
30843
31281
  Typography,
30844
31282
  {
@@ -31471,7 +31909,7 @@ function SequenceBar({
31471
31909
  else onSlotRemove?.(index);
31472
31910
  }, [emit, slotRemoveEvent, onSlotRemove, playing]);
31473
31911
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
31474
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
31912
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React79__default.Fragment, { children: [
31475
31913
  i > 0 && /* @__PURE__ */ jsx(
31476
31914
  Typography,
31477
31915
  {
@@ -31879,6 +32317,8 @@ var init_MathCanvas = __esm({
31879
32317
  gridColor = "var(--color-border, #9ca3af)",
31880
32318
  axisColor = "var(--color-muted-foreground, #374151)",
31881
32319
  showTickLabels = false,
32320
+ tickLabelFontSize = 10,
32321
+ labelFontSize = 12,
31882
32322
  showCurveLabels = false,
31883
32323
  curves = [],
31884
32324
  points = [],
@@ -31950,18 +32390,18 @@ var init_MathCanvas = __esm({
31950
32390
  let kx = 0;
31951
32391
  for (let x = Math.ceil(xMin / gridStep) * gridStep; x <= xMax; x += gridStep, kx++) {
31952
32392
  if (kx % labelEveryX === 0 && x !== 0) {
31953
- out.push({ type: "text", x: mapX(x), y: xAxisY + 12, text: formatTick(x), color: "#6b7280", fontSize: 10, align: "center" });
32393
+ out.push({ type: "text", x: mapX(x), y: xAxisY + 12, text: formatTick(x), color: "#6b7280", fontSize: tickLabelFontSize, align: "center" });
31954
32394
  }
31955
32395
  }
31956
32396
  const labelEveryY = Math.max(1, Math.ceil((yMax - yMin) / gridStep / Math.floor(plotH / 28)));
31957
32397
  let ky = 0;
31958
32398
  for (let y = Math.ceil(yMin / gridStep) * gridStep; y <= yMax; y += gridStep, ky++) {
31959
32399
  if (ky % labelEveryY === 0 && y !== 0) {
31960
- out.push({ type: "text", x: yAxisX - 6, y: mapY(y), text: formatTick(y), color: "#6b7280", fontSize: 10, align: "right" });
32400
+ out.push({ type: "text", x: yAxisX - 6, y: mapY(y), text: formatTick(y), color: "#6b7280", fontSize: tickLabelFontSize, align: "right" });
31961
32401
  }
31962
32402
  }
31963
32403
  if (xMin <= 0 && xMax >= 0 && yMin <= 0 && yMax >= 0) {
31964
- out.push({ type: "text", x: yAxisX - 6, y: xAxisY + 12, text: "0", color: "#6b7280", fontSize: 10, align: "right" });
32404
+ out.push({ type: "text", x: yAxisX - 6, y: xAxisY + 12, text: "0", color: "#6b7280", fontSize: tickLabelFontSize, align: "right" });
31965
32405
  }
31966
32406
  }
31967
32407
  for (const region of regions) {
@@ -31992,7 +32432,7 @@ var init_MathCanvas = __esm({
31992
32432
  y: (mapY(region.samples[mid].y) + mapY(baseline)) / 2,
31993
32433
  text: region.label,
31994
32434
  color,
31995
- fontSize: 11
32435
+ fontSize: labelFontSize
31996
32436
  });
31997
32437
  }
31998
32438
  }
@@ -32031,7 +32471,7 @@ var init_MathCanvas = __esm({
32031
32471
  const py = mapY(guide.at);
32032
32472
  out.push({ type: "line", x1: margin, y1: py, x2: width - margin, y2: py, color, dash });
32033
32473
  if (guide.label) {
32034
- out.push({ type: "text", x: width - margin - 4, y: py - 8, text: guide.label, color, fontSize: 11, align: "right" });
32474
+ out.push({ type: "text", x: width - margin - 4, y: py - 8, text: guide.label, color, fontSize: labelFontSize, align: "right" });
32035
32475
  }
32036
32476
  }
32037
32477
  }
@@ -32074,7 +32514,7 @@ var init_MathCanvas = __esm({
32074
32514
  y: mapY(lastInRange.y) - 6,
32075
32515
  text: curve.label,
32076
32516
  color: curve.color ?? "#2563eb",
32077
- fontSize: 11
32517
+ fontSize: labelFontSize
32078
32518
  });
32079
32519
  }
32080
32520
  }
@@ -32111,7 +32551,7 @@ var init_MathCanvas = __esm({
32111
32551
  y: xAxisY - peak - 8,
32112
32552
  text: hop.label,
32113
32553
  color,
32114
- fontSize: 10,
32554
+ fontSize: labelFontSize,
32115
32555
  align: "center"
32116
32556
  });
32117
32557
  }
@@ -32138,7 +32578,7 @@ var init_MathCanvas = __esm({
32138
32578
  y: mapY(angle.y + 1.35 * radius * Math.sin(rad)),
32139
32579
  text: angle.label,
32140
32580
  color,
32141
- fontSize: 11,
32581
+ fontSize: labelFontSize,
32142
32582
  align: "center"
32143
32583
  });
32144
32584
  }
@@ -32155,7 +32595,7 @@ var init_MathCanvas = __esm({
32155
32595
  fill: isOpen ? "#ffffff" : p.color ?? "#dc2626"
32156
32596
  });
32157
32597
  if (p.label) {
32158
- out.push({ type: "text", x: mapX(p.x) + 8, y: mapY(p.y) - 8, text: p.label, color: p.color ?? "#111827", fontSize: 12 });
32598
+ out.push({ type: "text", x: mapX(p.x) + 8, y: mapY(p.y) - 8, text: p.label, color: p.color ?? "#111827", fontSize: labelFontSize });
32159
32599
  }
32160
32600
  }
32161
32601
  for (const v of vectors) {
@@ -32166,7 +32606,7 @@ var init_MathCanvas = __esm({
32166
32606
  const y2 = mapY(v.y + v.vy);
32167
32607
  out.push({ type: "arrow", x1, y1, x2, y2, color: v.color ?? "#7c3aed", lineWidth: 2 });
32168
32608
  if (v.label) {
32169
- out.push({ type: "text", x: x2 + 6, y: y2 - 6, text: v.label, color: v.color ?? "#7c3aed", fontSize: 12 });
32609
+ out.push({ type: "text", x: x2 + 6, y: y2 - 6, text: v.label, color: v.color ?? "#7c3aed", fontSize: labelFontSize });
32170
32610
  }
32171
32611
  }
32172
32612
  out.push(...shapes);
@@ -32185,6 +32625,8 @@ var init_MathCanvas = __esm({
32185
32625
  gridColor,
32186
32626
  axisColor,
32187
32627
  showTickLabels,
32628
+ tickLabelFontSize,
32629
+ labelFontSize,
32188
32630
  showCurveLabels,
32189
32631
  curves,
32190
32632
  points,
@@ -33472,13 +33914,13 @@ var init_MapView = __esm({
33472
33914
  shadowSize: [41, 41]
33473
33915
  });
33474
33916
  L.Marker.prototype.options.icon = defaultIcon;
33475
- const { useEffect: useEffect69, useRef: useRef65, useCallback: useCallback108, useState: useState107 } = React77__default;
33917
+ const { useEffect: useEffect70, useRef: useRef67, useCallback: useCallback109, useState: useState109 } = React79__default;
33476
33918
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
33477
33919
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
33478
33920
  function MapUpdater({ centerLat, centerLng, zoom }) {
33479
33921
  const map = useMap();
33480
- const prevRef = useRef65({ centerLat, centerLng, zoom });
33481
- useEffect69(() => {
33922
+ const prevRef = useRef67({ centerLat, centerLng, zoom });
33923
+ useEffect70(() => {
33482
33924
  const prev = prevRef.current;
33483
33925
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
33484
33926
  map.setView([centerLat, centerLng], zoom);
@@ -33489,7 +33931,7 @@ var init_MapView = __esm({
33489
33931
  }
33490
33932
  function MapClickHandler({ onMapClick }) {
33491
33933
  const map = useMap();
33492
- useEffect69(() => {
33934
+ useEffect70(() => {
33493
33935
  if (!onMapClick) return;
33494
33936
  const handler = (e) => {
33495
33937
  onMapClick(e.latlng.lat, e.latlng.lng);
@@ -33517,8 +33959,8 @@ var init_MapView = __esm({
33517
33959
  showAttribution = true
33518
33960
  }) {
33519
33961
  const eventBus = useEventBus2();
33520
- const [clickedPosition, setClickedPosition] = useState107(null);
33521
- const handleMapClick = useCallback108((lat, lng) => {
33962
+ const [clickedPosition, setClickedPosition] = useState109(null);
33963
+ const handleMapClick = useCallback109((lat, lng) => {
33522
33964
  if (showClickedPin) {
33523
33965
  setClickedPosition({ lat, lng });
33524
33966
  }
@@ -33527,7 +33969,7 @@ var init_MapView = __esm({
33527
33969
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
33528
33970
  }
33529
33971
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
33530
- const handleMarkerClick = useCallback108((marker) => {
33972
+ const handleMarkerClick = useCallback109((marker) => {
33531
33973
  onMarkerClick?.(marker);
33532
33974
  if (markerClickEvent) {
33533
33975
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -34417,8 +34859,8 @@ function TableView({
34417
34859
  }) {
34418
34860
  const eventBus = useEventBus();
34419
34861
  const { t } = useTranslate();
34420
- const [visibleCount, setVisibleCount] = React77__default.useState(pageSize > 0 ? pageSize : Infinity);
34421
- const [localSelected, setLocalSelected] = React77__default.useState(/* @__PURE__ */ new Set());
34862
+ const [visibleCount, setVisibleCount] = React79__default.useState(pageSize > 0 ? pageSize : Infinity);
34863
+ const [localSelected, setLocalSelected] = React79__default.useState(/* @__PURE__ */ new Set());
34422
34864
  const colDefs = (Array.isArray(columns) ? columns : void 0) ?? (Array.isArray(fields) ? fields : void 0) ?? [];
34423
34865
  const actionDefs = Array.isArray(itemActions) ? itemActions : [];
34424
34866
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
@@ -34439,7 +34881,7 @@ function TableView({
34439
34881
  const hasMore = pageSize > 0 && visibleCount < ordered2.length;
34440
34882
  const hasRenderProp = typeof children === "function";
34441
34883
  const idField = dndItemIdField ?? "id";
34442
- React77__default.useEffect(() => {
34884
+ React79__default.useEffect(() => {
34443
34885
  tableViewLog.debug("render", {
34444
34886
  rowCount: data.length,
34445
34887
  colCount: colDefs.length,
@@ -34489,7 +34931,7 @@ function TableView({
34489
34931
  };
34490
34932
  eventBus.emit(`UI:${rowClickEvent}`, payload);
34491
34933
  };
34492
- const colFloors = React77__default.useMemo(
34934
+ const colFloors = React79__default.useMemo(
34493
34935
  () => colDefs.map((col) => {
34494
34936
  const longest = data.reduce((widest, row) => {
34495
34937
  const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
@@ -34632,12 +35074,12 @@ function TableView({
34632
35074
  ]
34633
35075
  }
34634
35076
  );
34635
- return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React77__default.Fragment, { children: rowInner }, id);
35077
+ return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React79__default.Fragment, { children: rowInner }, id);
34636
35078
  };
34637
35079
  const items = Array.from(data);
34638
35080
  const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
34639
35081
  let runningIndex = 0;
34640
- const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
35082
+ const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React79__default.Fragment, { children: [
34641
35083
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
34642
35084
  group.items.map((row) => renderRow(row, runningIndex++))
34643
35085
  ] }, gi)) });
@@ -36006,7 +36448,7 @@ var init_StepFlow = __esm({
36006
36448
  className
36007
36449
  }) => {
36008
36450
  if (orientation === "vertical") {
36009
- return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React77__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
36451
+ return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React79__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
36010
36452
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
36011
36453
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
36012
36454
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -36017,7 +36459,7 @@ var init_StepFlow = __esm({
36017
36459
  ] })
36018
36460
  ] }) }, index)) });
36019
36461
  }
36020
- 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(React77__default.Fragment, { children: [
36462
+ 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(React79__default.Fragment, { children: [
36021
36463
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
36022
36464
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
36023
36465
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -37007,7 +37449,7 @@ var init_LikertScale = __esm({
37007
37449
  md: "text-base",
37008
37450
  lg: "text-lg"
37009
37451
  };
37010
- LikertScale = React77__default.forwardRef(
37452
+ LikertScale = React79__default.forwardRef(
37011
37453
  ({
37012
37454
  question,
37013
37455
  options = DEFAULT_LIKERT_OPTIONS,
@@ -37019,7 +37461,7 @@ var init_LikertScale = __esm({
37019
37461
  variant = "radios",
37020
37462
  className
37021
37463
  }, ref) => {
37022
- const groupId = React77__default.useId();
37464
+ const groupId = React79__default.useId();
37023
37465
  const eventBus = useEventBus();
37024
37466
  const handleSelect = useCallback(
37025
37467
  (next) => {
@@ -39442,7 +39884,7 @@ var init_DocBreadcrumb = __esm({
39442
39884
  "aria-label": t("aria.breadcrumb"),
39443
39885
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
39444
39886
  const isLast = idx === items.length - 1;
39445
- return /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
39887
+ return /* @__PURE__ */ jsxs(React79__default.Fragment, { children: [
39446
39888
  idx > 0 && /* @__PURE__ */ jsx(
39447
39889
  Icon,
39448
39890
  {
@@ -40311,7 +40753,7 @@ var init_MiniStateMachine = __esm({
40311
40753
  const x = 2 + i * (NODE_W + GAP2 + ARROW_W + GAP2);
40312
40754
  const tc = transitionCounts[s.name] ?? 0;
40313
40755
  const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
40314
- return /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
40756
+ return /* @__PURE__ */ jsxs(React79__default.Fragment, { children: [
40315
40757
  /* @__PURE__ */ jsx(
40316
40758
  AvlState,
40317
40759
  {
@@ -40516,7 +40958,7 @@ var init_PageHeader = __esm({
40516
40958
  info: "bg-info/10 text-info"
40517
40959
  };
40518
40960
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
40519
- 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(React77__default.Fragment, { children: [
40961
+ 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(React79__default.Fragment, { children: [
40520
40962
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
40521
40963
  crumb.href ? /* @__PURE__ */ jsx(
40522
40964
  "a",
@@ -40874,7 +41316,7 @@ var init_Section = __esm({
40874
41316
  as: Component = "section"
40875
41317
  }) => {
40876
41318
  const hasHeader = title || description || action;
40877
- return React77__default.createElement(
41319
+ return React79__default.createElement(
40878
41320
  Component,
40879
41321
  {
40880
41322
  className: cn(
@@ -41248,7 +41690,7 @@ var init_WizardContainer = __esm({
41248
41690
  const isCompleted = index < currentStep;
41249
41691
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
41250
41692
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
41251
- return /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
41693
+ return /* @__PURE__ */ jsxs(React79__default.Fragment, { children: [
41252
41694
  /* @__PURE__ */ jsx(
41253
41695
  Button,
41254
41696
  {
@@ -43035,7 +43477,7 @@ var init_ImportPreviewTree = __esm({
43035
43477
  const renderUnit = (unit, childrenByParent, depth) => {
43036
43478
  const summary = fieldSummary(unit);
43037
43479
  const children = childrenByParent.get(unit.ref) ?? [];
43038
- return /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
43480
+ return /* @__PURE__ */ jsxs(React79__default.Fragment, { children: [
43039
43481
  /* @__PURE__ */ jsxs(
43040
43482
  Box,
43041
43483
  {
@@ -43132,7 +43574,7 @@ var init_ImportProgress = __esm({
43132
43574
  PIPELINE.map((key, index) => {
43133
43575
  const isComplete = index < currentIndex;
43134
43576
  const isActive = index === currentIndex;
43135
- return /* @__PURE__ */ jsxs(React77__default.Fragment, { children: [
43577
+ return /* @__PURE__ */ jsxs(React79__default.Fragment, { children: [
43136
43578
  index > 0 ? /* @__PURE__ */ jsx(Box, { className: "h-px w-4 bg-border" }) : null,
43137
43579
  /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", "data-testid": `import-progress-step-${key}`, children: [
43138
43580
  /* @__PURE__ */ jsx(
@@ -43345,6 +43787,69 @@ var init_parseLessonSegments = __esm({
43345
43787
  init_lessonSegmentUtils();
43346
43788
  }
43347
43789
  });
43790
+ var positionClasses, FloatingToolbar;
43791
+ var init_FloatingToolbar = __esm({
43792
+ "components/core/molecules/FloatingToolbar.tsx"() {
43793
+ "use client";
43794
+ init_Button();
43795
+ init_Box();
43796
+ init_Divider();
43797
+ init_Typography();
43798
+ init_ButtonGroup();
43799
+ init_cn();
43800
+ init_useEventBus();
43801
+ positionClasses = {
43802
+ "bottom-center": "bottom-6 left-1/2 -translate-x-1/2",
43803
+ "bottom-left": "bottom-6 left-6",
43804
+ "bottom-right": "bottom-6 right-6"
43805
+ };
43806
+ FloatingToolbar = ({
43807
+ items,
43808
+ position = "bottom-center",
43809
+ children,
43810
+ className
43811
+ }) => {
43812
+ const eventBus = useEventBus();
43813
+ return /* @__PURE__ */ jsx(Box, { className: cn("fixed z-50", positionClasses[position]), children: /* @__PURE__ */ jsxs(
43814
+ ButtonGroup,
43815
+ {
43816
+ variant: "default",
43817
+ orientation: "horizontal",
43818
+ className: cn(
43819
+ "items-center gap-1 rounded-full border border-border",
43820
+ "bg-card/95 backdrop-blur-sm shadow-elevation-popover p-1",
43821
+ className
43822
+ ),
43823
+ children: [
43824
+ items.map((item) => /* @__PURE__ */ jsx(
43825
+ Button,
43826
+ {
43827
+ variant: item.active ? "primary" : "ghost",
43828
+ size: "sm",
43829
+ icon: item.icon,
43830
+ action: item.action,
43831
+ actionPayload: item.actionPayload,
43832
+ disabled: item.disabled,
43833
+ "aria-pressed": item.active,
43834
+ "aria-label": item.label,
43835
+ className: "rounded-full",
43836
+ "data-testid": item.testId ?? `floating-toolbar-item-${item.id}`,
43837
+ onClick: () => {
43838
+ if (item.event) eventBus.emit(`UI:${item.event}`, { actionId: item.id });
43839
+ },
43840
+ children: /* @__PURE__ */ jsx(Typography, { as: "span", className: "sr-only", children: item.label })
43841
+ },
43842
+ item.id
43843
+ )),
43844
+ children && items.length > 0 && /* @__PURE__ */ jsx(Divider, { orientation: "vertical", className: "h-6 mx-1" }),
43845
+ children
43846
+ ]
43847
+ }
43848
+ ) });
43849
+ };
43850
+ FloatingToolbar.displayName = "FloatingToolbar";
43851
+ }
43852
+ });
43348
43853
 
43349
43854
  // components/core/molecules/index.ts
43350
43855
  var init_molecules2 = __esm({
@@ -43362,6 +43867,7 @@ var init_molecules2 = __esm({
43362
43867
  init_Alert();
43363
43868
  init_Breadcrumb();
43364
43869
  init_ButtonGroup();
43870
+ init_CommandPalette();
43365
43871
  init_FilterGroup();
43366
43872
  init_Card2();
43367
43873
  init_Container();
@@ -43495,6 +44001,7 @@ var init_molecules2 = __esm({
43495
44001
  init_BloomQuizBlock();
43496
44002
  init_parseLessonSegments();
43497
44003
  init_lessonSegmentUtils();
44004
+ init_FloatingToolbar();
43498
44005
  }
43499
44006
  });
43500
44007
 
@@ -44237,7 +44744,7 @@ var init_DetailPanel = __esm({
44237
44744
  }) => {
44238
44745
  const eventBus = useEventBus();
44239
44746
  const { t } = useTranslate();
44240
- const [titleDraft, setTitleDraft] = React77__default.useState(null);
44747
+ const [titleDraft, setTitleDraft] = React79__default.useState(null);
44241
44748
  const isFieldDefArray = (arr) => {
44242
44749
  if (!arr || arr.length === 0) return false;
44243
44750
  const first = arr[0];
@@ -44630,8 +45137,224 @@ var init_DetailPanel = __esm({
44630
45137
  DetailPanel.displayName = "DetailPanel";
44631
45138
  }
44632
45139
  });
45140
+ var SplitPane;
45141
+ var init_SplitPane = __esm({
45142
+ "components/core/organisms/layout/SplitPane.tsx"() {
45143
+ "use client";
45144
+ init_cn();
45145
+ SplitPane = ({
45146
+ direction = "horizontal",
45147
+ ratio: ratioProp = 50,
45148
+ minSize = 100,
45149
+ resizable = true,
45150
+ left,
45151
+ right,
45152
+ className,
45153
+ leftClassName,
45154
+ rightClassName,
45155
+ onRatioChange
45156
+ }) => {
45157
+ const [uncontrolledRatio, setUncontrolledRatio] = useState(ratioProp);
45158
+ const ratio = onRatioChange ? ratioProp : uncontrolledRatio;
45159
+ const containerRef = useRef(null);
45160
+ const isDragging = useRef(false);
45161
+ const handlePointerDown = useCallback(
45162
+ (e) => {
45163
+ if (!resizable) return;
45164
+ e.preventDefault();
45165
+ isDragging.current = true;
45166
+ e.currentTarget.setPointerCapture(e.pointerId);
45167
+ const handlePointerMove = (ev) => {
45168
+ if (!isDragging.current || !containerRef.current) return;
45169
+ const rect = containerRef.current.getBoundingClientRect();
45170
+ let newRatio;
45171
+ if (direction === "horizontal") {
45172
+ const x = ev.clientX - rect.left;
45173
+ newRatio = x / rect.width * 100;
45174
+ } else {
45175
+ const y = ev.clientY - rect.top;
45176
+ newRatio = y / rect.height * 100;
45177
+ }
45178
+ const minRatio = minSize / (direction === "horizontal" ? rect.width : rect.height) * 100;
45179
+ const maxRatio = 100 - minRatio;
45180
+ newRatio = Math.max(minRatio, Math.min(maxRatio, newRatio));
45181
+ if (onRatioChange) {
45182
+ onRatioChange(newRatio);
45183
+ } else {
45184
+ setUncontrolledRatio(newRatio);
45185
+ }
45186
+ };
45187
+ const handlePointerUp = () => {
45188
+ isDragging.current = false;
45189
+ document.removeEventListener("pointermove", handlePointerMove);
45190
+ document.removeEventListener("pointerup", handlePointerUp);
45191
+ document.removeEventListener("pointercancel", handlePointerUp);
45192
+ };
45193
+ document.addEventListener("pointermove", handlePointerMove);
45194
+ document.addEventListener("pointerup", handlePointerUp);
45195
+ document.addEventListener("pointercancel", handlePointerUp);
45196
+ },
45197
+ [direction, minSize, resizable, onRatioChange]
45198
+ );
45199
+ const isHorizontal = direction === "horizontal";
45200
+ return /* @__PURE__ */ jsxs(
45201
+ "div",
45202
+ {
45203
+ ref: containerRef,
45204
+ className: cn(
45205
+ "flex w-full h-full",
45206
+ isHorizontal ? "flex-row" : "flex-col",
45207
+ className
45208
+ ),
45209
+ children: [
45210
+ /* @__PURE__ */ jsx(
45211
+ "div",
45212
+ {
45213
+ className: cn("flex flex-col overflow-auto", leftClassName),
45214
+ style: {
45215
+ [isHorizontal ? "width" : "height"]: `${ratio}%`,
45216
+ flexShrink: 0
45217
+ },
45218
+ children: left
45219
+ }
45220
+ ),
45221
+ resizable && /* @__PURE__ */ jsx(
45222
+ "div",
45223
+ {
45224
+ onPointerDown: handlePointerDown,
45225
+ className: cn(
45226
+ "flex-shrink-0 bg-border transition-colors touch-none",
45227
+ 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"
45228
+ )
45229
+ }
45230
+ ),
45231
+ /* @__PURE__ */ jsx("div", { className: cn("flex flex-col flex-1 min-h-0 min-w-0 overflow-auto", rightClassName), children: right })
45232
+ ]
45233
+ }
45234
+ );
45235
+ };
45236
+ SplitPane.displayName = "SplitPane";
45237
+ }
45238
+ });
45239
+ var DockLayout;
45240
+ var init_DockLayout = __esm({
45241
+ "components/core/organisms/layout/DockLayout.tsx"() {
45242
+ "use client";
45243
+ init_Box();
45244
+ init_Stack();
45245
+ init_cn();
45246
+ init_SplitPane();
45247
+ DockLayout = ({
45248
+ rail,
45249
+ sidebar,
45250
+ main,
45251
+ bottomPanel,
45252
+ statusBar,
45253
+ secondarySidebar,
45254
+ railWidth = 56,
45255
+ secondarySidebarWidth = 280,
45256
+ sidebarCollapsed = false,
45257
+ sidebarWidth = 20,
45258
+ onSidebarWidthChange,
45259
+ sidebarMinSize = 160,
45260
+ bottomPanelCollapsed = false,
45261
+ bottomPanelHeight = 30,
45262
+ onBottomPanelHeightChange,
45263
+ bottomPanelMinSize = 120,
45264
+ secondarySidebarCollapsed = false,
45265
+ className,
45266
+ railClassName,
45267
+ sidebarClassName,
45268
+ mainClassName,
45269
+ bottomPanelClassName,
45270
+ statusBarClassName,
45271
+ secondarySidebarClassName
45272
+ }) => {
45273
+ const showSidebar = Boolean(sidebar) && !sidebarCollapsed;
45274
+ const showBottomPanel = Boolean(bottomPanel) && !bottomPanelCollapsed;
45275
+ const showSecondarySidebar = Boolean(secondarySidebar) && !secondarySidebarCollapsed;
45276
+ const centerRow = /* @__PURE__ */ jsxs(HStack, { gap: "none", className: "flex-1 min-h-0 min-w-0", children: [
45277
+ /* @__PURE__ */ jsx(Box, { className: cn("flex-1 min-w-0 min-h-0 overflow-auto", mainClassName), children: main }),
45278
+ showSecondarySidebar && /* @__PURE__ */ jsx(
45279
+ Box,
45280
+ {
45281
+ className: cn(
45282
+ "flex-shrink-0 h-full overflow-auto border-l border-border",
45283
+ secondarySidebarClassName
45284
+ ),
45285
+ style: { width: secondarySidebarWidth },
45286
+ children: secondarySidebar
45287
+ }
45288
+ )
45289
+ ] });
45290
+ const sidebarAndCenter = showSidebar ? /* @__PURE__ */ jsx(
45291
+ SplitPane,
45292
+ {
45293
+ direction: "horizontal",
45294
+ ratio: sidebarWidth,
45295
+ onRatioChange: onSidebarWidthChange,
45296
+ minSize: sidebarMinSize,
45297
+ resizable: true,
45298
+ left: /* @__PURE__ */ jsx(Box, { className: cn("h-full overflow-auto", sidebarClassName), children: sidebar }),
45299
+ right: centerRow,
45300
+ className: "flex-1 min-h-0 min-w-0"
45301
+ }
45302
+ ) : centerRow;
45303
+ const body = /* @__PURE__ */ jsxs(HStack, { gap: "none", className: "flex-1 min-h-0 min-w-0", children: [
45304
+ rail && /* @__PURE__ */ jsx(
45305
+ Box,
45306
+ {
45307
+ className: cn(
45308
+ "flex-shrink-0 min-h-0 overflow-auto border-r border-border",
45309
+ railClassName
45310
+ ),
45311
+ style: { width: railWidth },
45312
+ children: rail
45313
+ }
45314
+ ),
45315
+ sidebarAndCenter
45316
+ ] });
45317
+ const bodyPlusBottom = showBottomPanel ? /* @__PURE__ */ jsx(
45318
+ SplitPane,
45319
+ {
45320
+ direction: "vertical",
45321
+ ratio: 100 - bottomPanelHeight,
45322
+ onRatioChange: (topRatio) => onBottomPanelHeightChange?.(100 - topRatio),
45323
+ minSize: bottomPanelMinSize,
45324
+ resizable: true,
45325
+ left: body,
45326
+ right: /* @__PURE__ */ jsx(
45327
+ Box,
45328
+ {
45329
+ className: cn(
45330
+ "h-full overflow-auto border-t border-border",
45331
+ bottomPanelClassName
45332
+ ),
45333
+ children: bottomPanel
45334
+ }
45335
+ ),
45336
+ className: "flex-1 min-h-0"
45337
+ }
45338
+ ) : body;
45339
+ return /* @__PURE__ */ jsxs(VStack, { gap: "none", className: cn("w-full h-full overflow-hidden", className), children: [
45340
+ bodyPlusBottom,
45341
+ statusBar && /* @__PURE__ */ jsx(
45342
+ Box,
45343
+ {
45344
+ className: cn(
45345
+ "flex-shrink-0 border-t border-border bg-background",
45346
+ statusBarClassName
45347
+ ),
45348
+ children: statusBar
45349
+ }
45350
+ )
45351
+ ] });
45352
+ };
45353
+ DockLayout.displayName = "DockLayout";
45354
+ }
45355
+ });
44633
45356
  function extractTitle(children) {
44634
- if (!React77__default.isValidElement(children)) return void 0;
45357
+ if (!React79__default.isValidElement(children)) return void 0;
44635
45358
  const props = children.props;
44636
45359
  if (typeof props.title === "string") {
44637
45360
  return props.title;
@@ -44993,7 +45716,7 @@ var init_Form = __esm({
44993
45716
  const isSchemaEntity = isOrbitalEntitySchema(entity);
44994
45717
  const resolvedEntity = isSchemaEntity ? entity : void 0;
44995
45718
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
44996
- const normalizedInitialData = React77__default.useMemo(() => {
45719
+ const normalizedInitialData = React79__default.useMemo(() => {
44997
45720
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
44998
45721
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
44999
45722
  const merged = entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
@@ -45012,7 +45735,7 @@ var init_Form = __esm({
45012
45735
  }
45013
45736
  return normalized;
45014
45737
  }, [entity, initialData]);
45015
- const entityDerivedFields = React77__default.useMemo(() => {
45738
+ const entityDerivedFields = React79__default.useMemo(() => {
45016
45739
  if (fields && fields.length > 0) return void 0;
45017
45740
  if (!resolvedEntity) return void 0;
45018
45741
  return resolvedEntity.fields.map(
@@ -45033,16 +45756,16 @@ var init_Form = __esm({
45033
45756
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
45034
45757
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
45035
45758
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
45036
- const [formData, setFormData] = React77__default.useState(
45759
+ const [formData, setFormData] = React79__default.useState(
45037
45760
  normalizedInitialData
45038
45761
  );
45039
- const [collapsedSections, setCollapsedSections] = React77__default.useState(
45762
+ const [collapsedSections, setCollapsedSections] = React79__default.useState(
45040
45763
  /* @__PURE__ */ new Set()
45041
45764
  );
45042
- const [submitError, setSubmitError] = React77__default.useState(null);
45043
- const formRef = React77__default.useRef(null);
45765
+ const [submitError, setSubmitError] = React79__default.useState(null);
45766
+ const formRef = React79__default.useRef(null);
45044
45767
  const formMode = props.mode;
45045
- const mountedRef = React77__default.useRef(false);
45768
+ const mountedRef = React79__default.useRef(false);
45046
45769
  if (!mountedRef.current) {
45047
45770
  mountedRef.current = true;
45048
45771
  debug("forms", "mount", {
@@ -45055,7 +45778,7 @@ var init_Form = __esm({
45055
45778
  });
45056
45779
  }
45057
45780
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
45058
- const evalContext = React77__default.useMemo(
45781
+ const evalContext = React79__default.useMemo(
45059
45782
  () => ({
45060
45783
  formValues: formData,
45061
45784
  globalVariables: externalContext?.globalVariables ?? {},
@@ -45064,7 +45787,7 @@ var init_Form = __esm({
45064
45787
  }),
45065
45788
  [formData, externalContext]
45066
45789
  );
45067
- React77__default.useEffect(() => {
45790
+ React79__default.useEffect(() => {
45068
45791
  debug("forms", "initialData-sync", {
45069
45792
  mode: formMode,
45070
45793
  normalizedInitialData,
@@ -45075,7 +45798,7 @@ var init_Form = __esm({
45075
45798
  setFormData(normalizedInitialData);
45076
45799
  }
45077
45800
  }, [normalizedInitialData]);
45078
- const processCalculations = React77__default.useCallback(
45801
+ const processCalculations = React79__default.useCallback(
45079
45802
  (changedFieldId, newFormData) => {
45080
45803
  if (!hiddenCalculations.length) return;
45081
45804
  const context = {
@@ -45100,7 +45823,7 @@ var init_Form = __esm({
45100
45823
  },
45101
45824
  [hiddenCalculations, externalContext, eventBus]
45102
45825
  );
45103
- const checkViolations = React77__default.useCallback(
45826
+ const checkViolations = React79__default.useCallback(
45104
45827
  (changedFieldId, newFormData) => {
45105
45828
  if (!violationTriggers.length) return;
45106
45829
  const context = {
@@ -45138,7 +45861,7 @@ var init_Form = __esm({
45138
45861
  processCalculations(name, newFormData);
45139
45862
  checkViolations(name, newFormData);
45140
45863
  };
45141
- const isFieldVisible = React77__default.useCallback(
45864
+ const isFieldVisible = React79__default.useCallback(
45142
45865
  (fieldName2) => {
45143
45866
  const condition = conditionalFields[fieldName2];
45144
45867
  if (!condition) return true;
@@ -45146,7 +45869,7 @@ var init_Form = __esm({
45146
45869
  },
45147
45870
  [conditionalFields, evalContext]
45148
45871
  );
45149
- const isSectionVisible = React77__default.useCallback(
45872
+ const isSectionVisible = React79__default.useCallback(
45150
45873
  (section) => {
45151
45874
  if (!section.condition) return true;
45152
45875
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -45222,7 +45945,7 @@ var init_Form = __esm({
45222
45945
  eventBus.emit(`UI:${onCancel}`);
45223
45946
  }
45224
45947
  };
45225
- const renderField = React77__default.useCallback(
45948
+ const renderField = React79__default.useCallback(
45226
45949
  (field) => {
45227
45950
  const fieldName2 = field.name || field.field;
45228
45951
  if (!fieldName2) return null;
@@ -45244,7 +45967,7 @@ var init_Form = __esm({
45244
45967
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
45245
45968
  );
45246
45969
  const effectiveFields = entityDerivedFields ?? fields;
45247
- const normalizedFields = React77__default.useMemo(() => {
45970
+ const normalizedFields = React79__default.useMemo(() => {
45248
45971
  if (!effectiveFields || effectiveFields.length === 0) return [];
45249
45972
  return effectiveFields.map((field) => {
45250
45973
  if (typeof field === "string") {
@@ -45279,7 +46002,7 @@ var init_Form = __esm({
45279
46002
  };
45280
46003
  });
45281
46004
  }, [effectiveFields, resolvedEntity, fieldOverrides]);
45282
- const schemaFields = React77__default.useMemo(() => {
46005
+ const schemaFields = React79__default.useMemo(() => {
45283
46006
  if (normalizedFields.length === 0) return null;
45284
46007
  if (isDebugEnabled()) {
45285
46008
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -45289,7 +46012,7 @@ var init_Form = __esm({
45289
46012
  }
45290
46013
  return normalizedFields.map(renderField).filter(Boolean);
45291
46014
  }, [normalizedFields, renderField, entityName, conditionalFields]);
45292
- const sectionElements = React77__default.useMemo(() => {
46015
+ const sectionElements = React79__default.useMemo(() => {
45293
46016
  if (!sections || sections.length === 0) return null;
45294
46017
  return sections.map((section) => {
45295
46018
  if (!isSectionVisible(section)) {
@@ -46125,7 +46848,7 @@ var init_List = __esm({
46125
46848
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
46126
46849
  return [];
46127
46850
  }, [entity]);
46128
- const getItemActions = React77__default.useCallback(
46851
+ const getItemActions = React79__default.useCallback(
46129
46852
  (item) => {
46130
46853
  if (!itemActions) return [];
46131
46854
  if (typeof itemActions === "function") {
@@ -46607,7 +47330,7 @@ var init_MediaGallery = __esm({
46607
47330
  [selectable, selectedItems, selectionEvent, eventBus]
46608
47331
  );
46609
47332
  const entityData = Array.isArray(entity) ? entity : [];
46610
- const items = React77__default.useMemo(() => {
47333
+ const items = React79__default.useMemo(() => {
46611
47334
  if (propItems && propItems.length > 0) return propItems;
46612
47335
  if (entityData.length === 0) return [];
46613
47336
  return entityData.map((record, idx) => {
@@ -46772,7 +47495,7 @@ var init_MediaGallery = __esm({
46772
47495
  }
46773
47496
  });
46774
47497
  function extractTitle2(children) {
46775
- if (!React77__default.isValidElement(children)) return void 0;
47498
+ if (!React79__default.isValidElement(children)) return void 0;
46776
47499
  const props = children.props;
46777
47500
  if (typeof props.title === "string") {
46778
47501
  return props.title;
@@ -47027,7 +47750,7 @@ var init_debugRegistry = __esm({
47027
47750
  }
47028
47751
  });
47029
47752
  function useDebugData() {
47030
- const [data, setData] = React77.useState(() => ({
47753
+ const [data, setData] = React79.useState(() => ({
47031
47754
  traits: [],
47032
47755
  ticks: [],
47033
47756
  guards: [],
@@ -47041,7 +47764,7 @@ function useDebugData() {
47041
47764
  },
47042
47765
  lastUpdate: Date.now()
47043
47766
  }));
47044
- React77.useEffect(() => {
47767
+ React79.useEffect(() => {
47045
47768
  const updateData = () => {
47046
47769
  setData({
47047
47770
  traits: getAllTraits(),
@@ -47150,12 +47873,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
47150
47873
  return positions;
47151
47874
  }
47152
47875
  function WalkMinimap() {
47153
- const [walkStep, setWalkStep] = React77.useState(null);
47154
- const [traits2, setTraits] = React77.useState([]);
47155
- const [coveredEdges, setCoveredEdges] = React77.useState([]);
47156
- const [completedTraits, setCompletedTraits] = React77.useState(/* @__PURE__ */ new Set());
47157
- const prevTraitRef = React77.useRef(null);
47158
- React77.useEffect(() => {
47876
+ const [walkStep, setWalkStep] = React79.useState(null);
47877
+ const [traits2, setTraits] = React79.useState([]);
47878
+ const [coveredEdges, setCoveredEdges] = React79.useState([]);
47879
+ const [completedTraits, setCompletedTraits] = React79.useState(/* @__PURE__ */ new Set());
47880
+ const prevTraitRef = React79.useRef(null);
47881
+ React79.useEffect(() => {
47159
47882
  const interval = setInterval(() => {
47160
47883
  const w = window;
47161
47884
  const step = w.__orbitalWalkStep;
@@ -47591,15 +48314,15 @@ var init_EntitiesTab = __esm({
47591
48314
  });
47592
48315
  function EventFlowTab({ events: events2 }) {
47593
48316
  const { t } = useTranslate();
47594
- const [filter, setFilter] = React77.useState("all");
47595
- const containerRef = React77.useRef(null);
47596
- const [autoScroll, setAutoScroll] = React77.useState(true);
47597
- React77.useEffect(() => {
48317
+ const [filter, setFilter] = React79.useState("all");
48318
+ const containerRef = React79.useRef(null);
48319
+ const [autoScroll, setAutoScroll] = React79.useState(true);
48320
+ React79.useEffect(() => {
47598
48321
  if (autoScroll && containerRef.current) {
47599
48322
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
47600
48323
  }
47601
48324
  }, [events2.length, autoScroll]);
47602
- const filteredEvents = React77.useMemo(() => {
48325
+ const filteredEvents = React79.useMemo(() => {
47603
48326
  if (filter === "all") return events2;
47604
48327
  return events2.filter((e) => e.type === filter);
47605
48328
  }, [events2, filter]);
@@ -47715,7 +48438,7 @@ var init_EventFlowTab = __esm({
47715
48438
  });
47716
48439
  function GuardsPanel({ guards }) {
47717
48440
  const { t } = useTranslate();
47718
- const [filter, setFilter] = React77.useState("all");
48441
+ const [filter, setFilter] = React79.useState("all");
47719
48442
  if (guards.length === 0) {
47720
48443
  return /* @__PURE__ */ jsx(
47721
48444
  EmptyState,
@@ -47728,7 +48451,7 @@ function GuardsPanel({ guards }) {
47728
48451
  }
47729
48452
  const passedCount = guards.filter((g) => g.result).length;
47730
48453
  const failedCount = guards.length - passedCount;
47731
- const filteredGuards = React77.useMemo(() => {
48454
+ const filteredGuards = React79.useMemo(() => {
47732
48455
  if (filter === "all") return guards;
47733
48456
  if (filter === "passed") return guards.filter((g) => g.result);
47734
48457
  return guards.filter((g) => !g.result);
@@ -47891,10 +48614,10 @@ function EffectBadge({ effect }) {
47891
48614
  }
47892
48615
  function TransitionTimeline({ transitions }) {
47893
48616
  const { t } = useTranslate();
47894
- const containerRef = React77.useRef(null);
47895
- const [autoScroll, setAutoScroll] = React77.useState(true);
47896
- const [expandedId, setExpandedId] = React77.useState(null);
47897
- React77.useEffect(() => {
48617
+ const containerRef = React79.useRef(null);
48618
+ const [autoScroll, setAutoScroll] = React79.useState(true);
48619
+ const [expandedId, setExpandedId] = React79.useState(null);
48620
+ React79.useEffect(() => {
47898
48621
  if (autoScroll && containerRef.current) {
47899
48622
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
47900
48623
  }
@@ -48174,9 +48897,9 @@ function getAllEvents(traits2) {
48174
48897
  function EventDispatcherTab({ traits: traits2, schema }) {
48175
48898
  const eventBus = useEventBus();
48176
48899
  const { t } = useTranslate();
48177
- const [log19, setLog] = React77.useState([]);
48178
- const prevStatesRef = React77.useRef(/* @__PURE__ */ new Map());
48179
- React77.useEffect(() => {
48900
+ const [log19, setLog] = React79.useState([]);
48901
+ const prevStatesRef = React79.useRef(/* @__PURE__ */ new Map());
48902
+ React79.useEffect(() => {
48180
48903
  for (const trait of traits2) {
48181
48904
  const prev = prevStatesRef.current.get(trait.id);
48182
48905
  if (prev && prev !== trait.currentState) {
@@ -48345,10 +49068,10 @@ function VerifyModePanel({
48345
49068
  localCount
48346
49069
  }) {
48347
49070
  const { t } = useTranslate();
48348
- const [expanded, setExpanded] = React77.useState(true);
48349
- const scrollRef = React77.useRef(null);
48350
- const prevCountRef = React77.useRef(0);
48351
- React77.useEffect(() => {
49071
+ const [expanded, setExpanded] = React79.useState(true);
49072
+ const scrollRef = React79.useRef(null);
49073
+ const prevCountRef = React79.useRef(0);
49074
+ React79.useEffect(() => {
48352
49075
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
48353
49076
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
48354
49077
  }
@@ -48405,10 +49128,10 @@ function RuntimeDebugger({
48405
49128
  schema
48406
49129
  }) {
48407
49130
  const { t } = useTranslate();
48408
- const [isCollapsed, setIsCollapsed] = React77.useState(mode === "verify" ? true : defaultCollapsed);
48409
- const [isVisible, setIsVisible] = React77.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
49131
+ const [isCollapsed, setIsCollapsed] = React79.useState(mode === "verify" ? true : defaultCollapsed);
49132
+ const [isVisible, setIsVisible] = React79.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
48410
49133
  const debugData = useDebugData();
48411
- React77.useEffect(() => {
49134
+ React79.useEffect(() => {
48412
49135
  if (mode === "inline") return;
48413
49136
  return onDebugToggle((enabled) => {
48414
49137
  setIsVisible(enabled);
@@ -48417,7 +49140,7 @@ function RuntimeDebugger({
48417
49140
  }
48418
49141
  });
48419
49142
  }, [mode]);
48420
- React77.useEffect(() => {
49143
+ React79.useEffect(() => {
48421
49144
  if (mode === "inline") return;
48422
49145
  const handleKeyDown = (e) => {
48423
49146
  if (e.key === "`" && isVisible) {
@@ -48432,7 +49155,7 @@ function RuntimeDebugger({
48432
49155
  if (!isVisible) {
48433
49156
  return null;
48434
49157
  }
48435
- const positionClasses = {
49158
+ const positionClasses2 = {
48436
49159
  "bottom-right": "bottom-4 right-4",
48437
49160
  "bottom-left": "bottom-4 left-4",
48438
49161
  "top-right": "top-4 right-4",
@@ -48561,7 +49284,7 @@ function RuntimeDebugger({
48561
49284
  className: cn(
48562
49285
  "runtime-debugger",
48563
49286
  "fixed",
48564
- positionClasses[position],
49287
+ positionClasses2[position],
48565
49288
  isCollapsed ? "runtime-debugger--collapsed" : "runtime-debugger--expanded",
48566
49289
  className
48567
49290
  ),
@@ -48643,6 +49366,7 @@ var init_SegmentRenderer = __esm({
48643
49366
  "use client";
48644
49367
  init_MarkdownContent();
48645
49368
  init_CodeBlock();
49369
+ init_MermaidDiagram();
48646
49370
  init_QuizBlock();
48647
49371
  init_ActivationBlock();
48648
49372
  init_ConnectionBlock();
@@ -48674,6 +49398,9 @@ var init_SegmentRenderer = __esm({
48674
49398
  return /* @__PURE__ */ jsx(MarkdownContent, { content: segment.content }, `md-${index}`);
48675
49399
  }
48676
49400
  if (segment.type === "code") {
49401
+ if (segment.language === "mermaid") {
49402
+ return /* @__PURE__ */ jsx(MermaidDiagram, { code: segment.content }, `code-${index}`);
49403
+ }
48677
49404
  if (segment.runnable && onRunCodeSimulation) {
48678
49405
  return /* @__PURE__ */ jsx(
48679
49406
  CodeRunnerPanel,
@@ -48806,99 +49533,6 @@ var init_ShowcaseOrganism = __esm({
48806
49533
  ShowcaseOrganism.displayName = "ShowcaseOrganism";
48807
49534
  }
48808
49535
  });
48809
- var SplitPane;
48810
- var init_SplitPane = __esm({
48811
- "components/core/organisms/layout/SplitPane.tsx"() {
48812
- "use client";
48813
- init_cn();
48814
- SplitPane = ({
48815
- direction = "horizontal",
48816
- ratio: initialRatio = 50,
48817
- minSize = 100,
48818
- resizable = true,
48819
- left,
48820
- right,
48821
- className,
48822
- leftClassName,
48823
- rightClassName
48824
- }) => {
48825
- const [ratio, setRatio] = useState(initialRatio);
48826
- const containerRef = useRef(null);
48827
- const isDragging = useRef(false);
48828
- const handlePointerDown = useCallback(
48829
- (e) => {
48830
- if (!resizable) return;
48831
- e.preventDefault();
48832
- isDragging.current = true;
48833
- e.currentTarget.setPointerCapture(e.pointerId);
48834
- const handlePointerMove = (ev) => {
48835
- if (!isDragging.current || !containerRef.current) return;
48836
- const rect = containerRef.current.getBoundingClientRect();
48837
- let newRatio;
48838
- if (direction === "horizontal") {
48839
- const x = ev.clientX - rect.left;
48840
- newRatio = x / rect.width * 100;
48841
- } else {
48842
- const y = ev.clientY - rect.top;
48843
- newRatio = y / rect.height * 100;
48844
- }
48845
- const minRatio = minSize / (direction === "horizontal" ? rect.width : rect.height) * 100;
48846
- const maxRatio = 100 - minRatio;
48847
- newRatio = Math.max(minRatio, Math.min(maxRatio, newRatio));
48848
- setRatio(newRatio);
48849
- };
48850
- const handlePointerUp = () => {
48851
- isDragging.current = false;
48852
- document.removeEventListener("pointermove", handlePointerMove);
48853
- document.removeEventListener("pointerup", handlePointerUp);
48854
- document.removeEventListener("pointercancel", handlePointerUp);
48855
- };
48856
- document.addEventListener("pointermove", handlePointerMove);
48857
- document.addEventListener("pointerup", handlePointerUp);
48858
- document.addEventListener("pointercancel", handlePointerUp);
48859
- },
48860
- [direction, minSize, resizable]
48861
- );
48862
- const isHorizontal = direction === "horizontal";
48863
- return /* @__PURE__ */ jsxs(
48864
- "div",
48865
- {
48866
- ref: containerRef,
48867
- className: cn(
48868
- "flex w-full h-full",
48869
- isHorizontal ? "flex-row" : "flex-col",
48870
- className
48871
- ),
48872
- children: [
48873
- /* @__PURE__ */ jsx(
48874
- "div",
48875
- {
48876
- className: cn("overflow-auto", leftClassName),
48877
- style: {
48878
- [isHorizontal ? "width" : "height"]: `${ratio}%`,
48879
- flexShrink: 0
48880
- },
48881
- children: left
48882
- }
48883
- ),
48884
- resizable && /* @__PURE__ */ jsx(
48885
- "div",
48886
- {
48887
- onPointerDown: handlePointerDown,
48888
- className: cn(
48889
- "flex-shrink-0 bg-border transition-colors touch-none",
48890
- 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"
48891
- )
48892
- }
48893
- ),
48894
- /* @__PURE__ */ jsx("div", { className: cn("flex-1 overflow-auto", rightClassName), children: right })
48895
- ]
48896
- }
48897
- );
48898
- };
48899
- SplitPane.displayName = "SplitPane";
48900
- }
48901
- });
48902
49536
  var StatCard;
48903
49537
  var init_StatCard = __esm({
48904
49538
  "components/core/organisms/StatCard.tsx"() {
@@ -48937,7 +49571,7 @@ var init_StatCard = __esm({
48937
49571
  const labelToUse = propLabel ?? propTitle;
48938
49572
  const eventBus = useEventBus();
48939
49573
  const { t } = useTranslate();
48940
- const handleActionClick = React77__default.useCallback(() => {
49574
+ const handleActionClick = React79__default.useCallback(() => {
48941
49575
  if (action?.event) {
48942
49576
  eventBus.emit(`UI:${action.event}`, {});
48943
49577
  }
@@ -48948,7 +49582,7 @@ var init_StatCard = __esm({
48948
49582
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
48949
49583
  const isLoading = externalLoading ?? false;
48950
49584
  const error = externalError;
48951
- const computeMetricValue = React77__default.useCallback(
49585
+ const computeMetricValue = React79__default.useCallback(
48952
49586
  (metric, items) => {
48953
49587
  if (metric.value !== void 0) {
48954
49588
  return metric.value;
@@ -48987,7 +49621,7 @@ var init_StatCard = __esm({
48987
49621
  },
48988
49622
  []
48989
49623
  );
48990
- const schemaStats = React77__default.useMemo(() => {
49624
+ const schemaStats = React79__default.useMemo(() => {
48991
49625
  if (!metrics || metrics.length === 0) return null;
48992
49626
  return metrics.map((metric) => ({
48993
49627
  label: metric.label,
@@ -48995,7 +49629,7 @@ var init_StatCard = __esm({
48995
49629
  format: metric.format
48996
49630
  }));
48997
49631
  }, [metrics, data, computeMetricValue]);
48998
- const calculatedTrend = React77__default.useMemo(() => {
49632
+ const calculatedTrend = React79__default.useMemo(() => {
48999
49633
  if (manualTrend !== void 0) return manualTrend;
49000
49634
  if (previousValue === void 0 || currentValue2 === void 0)
49001
49635
  return void 0;
@@ -49635,8 +50269,8 @@ var init_SubagentTracePanel = __esm({
49635
50269
  ] });
49636
50270
  };
49637
50271
  InlineActivityStream = ({ activities, autoScroll = true, className }) => {
49638
- const endRef = React77__default.useRef(null);
49639
- React77__default.useEffect(() => {
50272
+ const endRef = React79__default.useRef(null);
50273
+ React79__default.useEffect(() => {
49640
50274
  if (!autoScroll) return;
49641
50275
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
49642
50276
  }, [activities.length, autoScroll]);
@@ -49730,7 +50364,7 @@ var init_SubagentTracePanel = __esm({
49730
50364
  };
49731
50365
  SubagentRichCard = ({ subagent }) => {
49732
50366
  const { t } = useTranslate();
49733
- const activities = React77__default.useMemo(
50367
+ const activities = React79__default.useMemo(
49734
50368
  () => subagentMessagesToActivities(subagent.messages),
49735
50369
  [subagent.messages]
49736
50370
  );
@@ -49807,8 +50441,8 @@ var init_SubagentTracePanel = __esm({
49807
50441
  ] });
49808
50442
  };
49809
50443
  CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
49810
- const endRef = React77__default.useRef(null);
49811
- React77__default.useEffect(() => {
50444
+ const endRef = React79__default.useRef(null);
50445
+ React79__default.useEffect(() => {
49812
50446
  if (!autoScroll) return;
49813
50447
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
49814
50448
  }, [messages.length, autoScroll]);
@@ -50243,7 +50877,7 @@ var init_Timeline = __esm({
50243
50877
  }) => {
50244
50878
  const { t } = useTranslate();
50245
50879
  const entityData = entity ?? [];
50246
- const items = React77__default.useMemo(() => {
50880
+ const items = React79__default.useMemo(() => {
50247
50881
  if (propItems) return propItems;
50248
50882
  if (entityData.length === 0) return [];
50249
50883
  return entityData.map((record, idx) => {
@@ -50345,7 +50979,7 @@ var init_Timeline = __esm({
50345
50979
  }
50346
50980
  });
50347
50981
  function extractToastProps(children) {
50348
- if (!React77__default.isValidElement(children)) {
50982
+ if (!React79__default.isValidElement(children)) {
50349
50983
  if (typeof children === "string") {
50350
50984
  return { message: children };
50351
50985
  }
@@ -50387,7 +51021,7 @@ var init_ToastSlot = __esm({
50387
51021
  eventBus.emit(`${prefix}CLOSE`);
50388
51022
  };
50389
51023
  if (!isVisible) return null;
50390
- const isCustomContent = React77__default.isValidElement(children) && !message;
51024
+ const isCustomContent = React79__default.isValidElement(children) && !message;
50391
51025
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
50392
51026
  Toast,
50393
51027
  {
@@ -50455,6 +51089,7 @@ var init_component_registry_generated = __esm({
50455
51089
  init_ChoiceButton();
50456
51090
  init_CodeBlock();
50457
51091
  init_CodeRunnerPanel();
51092
+ init_CommandPalette();
50458
51093
  init_CommunityLinks();
50459
51094
  init_ConditionalWrapper();
50460
51095
  init_ConfettiEffect();
@@ -50482,6 +51117,7 @@ var init_component_registry_generated = __esm({
50482
51117
  init_DocSearch();
50483
51118
  init_DocSidebar();
50484
51119
  init_DocTOC();
51120
+ init_DockLayout();
50485
51121
  init_DocumentDetails();
50486
51122
  init_DocumentPanel();
50487
51123
  init_DocumentViewer();
@@ -50512,6 +51148,7 @@ var init_component_registry_generated = __esm({
50512
51148
  init_FlipCard();
50513
51149
  init_FlipContainer();
50514
51150
  init_FloatingActionButton();
51151
+ init_FloatingToolbar();
50515
51152
  init_Form();
50516
51153
  init_FormField();
50517
51154
  init_FormSection();
@@ -50727,6 +51364,7 @@ var init_component_registry_generated = __esm({
50727
51364
  "ChoiceButton": ChoiceButton,
50728
51365
  "CodeBlock": CodeBlock,
50729
51366
  "CodeRunnerPanel": CodeRunnerPanel,
51367
+ "CommandPalette": CommandPalette,
50730
51368
  "CommunityLinks": CommunityLinks,
50731
51369
  "ConditionalWrapper": ConditionalWrapper,
50732
51370
  "ConfettiEffect": ConfettiEffect,
@@ -50756,6 +51394,7 @@ var init_component_registry_generated = __esm({
50756
51394
  "DocSearch": DocSearch,
50757
51395
  "DocSidebar": DocSidebar,
50758
51396
  "DocTOC": DocTOC,
51397
+ "DockLayout": DockLayout,
50759
51398
  "DocumentDetails": DocumentDetails,
50760
51399
  "DocumentPanel": DocumentPanel,
50761
51400
  "DocumentViewer": DocumentViewer,
@@ -50786,6 +51425,7 @@ var init_component_registry_generated = __esm({
50786
51425
  "FlipCard": FlipCard,
50787
51426
  "FlipContainer": FlipContainer,
50788
51427
  "FloatingActionButton": FloatingActionButton,
51428
+ "FloatingToolbar": FloatingToolbar,
50789
51429
  "Form": Form,
50790
51430
  "FormField": FormField,
50791
51431
  "FormLayout": FormLayout,
@@ -50973,7 +51613,7 @@ function SuspenseConfigProvider({
50973
51613
  config,
50974
51614
  children
50975
51615
  }) {
50976
- return React77__default.createElement(
51616
+ return React79__default.createElement(
50977
51617
  SuspenseConfigContext.Provider,
50978
51618
  { value: config },
50979
51619
  children
@@ -51021,7 +51661,7 @@ function enrichFormFields(fields, entityDef) {
51021
51661
  }
51022
51662
  return { name: field, label: humanizeFieldName(field) };
51023
51663
  }
51024
- if (field && typeof field === "object" && !Array.isArray(field) && !React77__default.isValidElement(field) && !(field instanceof Date)) {
51664
+ if (field && typeof field === "object" && !Array.isArray(field) && !React79__default.isValidElement(field) && !(field instanceof Date)) {
51025
51665
  const obj = field;
51026
51666
  const fieldName2 = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
51027
51667
  if (!fieldName2) return field;
@@ -51074,7 +51714,7 @@ function enrichDetailFields(fields, entityDef) {
51074
51714
  const meta = metaFor(field);
51075
51715
  return meta ? { key: field, ...meta } : field;
51076
51716
  }
51077
- if (field && typeof field === "object" && !Array.isArray(field) && !React77__default.isValidElement(field) && !(field instanceof Date)) {
51717
+ if (field && typeof field === "object" && !Array.isArray(field) && !React79__default.isValidElement(field) && !(field instanceof Date)) {
51078
51718
  const obj = field;
51079
51719
  const fieldName2 = typeof obj.key === "string" ? obj.key : typeof obj.name === "string" ? obj.name : void 0;
51080
51720
  if (!fieldName2 || obj.type) return field;
@@ -51533,7 +52173,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
51533
52173
  const key = `${parentId}-${index}-trait:${traitName}`;
51534
52174
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
51535
52175
  }
51536
- return /* @__PURE__ */ jsx(React77__default.Fragment, { children: child }, `${parentId}-${index}`);
52176
+ return /* @__PURE__ */ jsx(React79__default.Fragment, { children: child }, `${parentId}-${index}`);
51537
52177
  }
51538
52178
  if (!child || typeof child !== "object") return null;
51539
52179
  const childId = `${parentId}-${index}`;
@@ -51590,7 +52230,7 @@ function isPatternConfig(value) {
51590
52230
  if (value === null || value === void 0) return false;
51591
52231
  if (typeof value !== "object") return false;
51592
52232
  if (Array.isArray(value)) return false;
51593
- if (React77__default.isValidElement(value)) return false;
52233
+ if (React79__default.isValidElement(value)) return false;
51594
52234
  if (value instanceof Date) return false;
51595
52235
  if (typeof value === "function") return false;
51596
52236
  const record = value;
@@ -51603,9 +52243,9 @@ function renderPatternValue(value) {
51603
52243
  if (typeof value === "string") return renderPatternChildren(value, () => {
51604
52244
  });
51605
52245
  if (value instanceof Date) return value.toLocaleString();
51606
- if (React77__default.isValidElement(value)) return value;
52246
+ if (React79__default.isValidElement(value)) return value;
51607
52247
  if (Array.isArray(value)) {
51608
- return value.map((item, index) => /* @__PURE__ */ jsx(React77__default.Fragment, { children: renderPatternValue(item) }, index));
52248
+ return value.map((item, index) => /* @__PURE__ */ jsx(React79__default.Fragment, { children: renderPatternValue(item) }, index));
51609
52249
  }
51610
52250
  if (isPatternConfig(value)) {
51611
52251
  const { type, ...props } = value;
@@ -51615,7 +52255,7 @@ function renderPatternValue(value) {
51615
52255
  return null;
51616
52256
  }
51617
52257
  function isPlainConfigObject(value) {
51618
- if (React77__default.isValidElement(value)) return false;
52258
+ if (React79__default.isValidElement(value)) return false;
51619
52259
  if (value instanceof Date) return false;
51620
52260
  const proto = Object.getPrototypeOf(value);
51621
52261
  return proto === Object.prototype || proto === null;
@@ -51789,7 +52429,7 @@ function SlotContentRenderer({
51789
52429
  for (const slotKey of CONTENT_NODE_SLOTS) {
51790
52430
  const slotVal = restProps[slotKey];
51791
52431
  if (slotVal === void 0 || slotVal === null) continue;
51792
- if (React77__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
52432
+ if (React79__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
51793
52433
  const typelessChildren = !Array.isArray(slotVal) && typeof slotVal === "object" && !("type" in slotVal) && Array.isArray(slotVal.children) ? slotVal.children : void 0;
51794
52434
  if (typelessChildren !== void 0 || Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
51795
52435
  nodeSlotOverrides[slotKey] = renderPatternChildren(
@@ -51843,7 +52483,7 @@ function SlotContentRenderer({
51843
52483
  const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
51844
52484
  if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
51845
52485
  const sample = resolvedItems[0];
51846
- if (sample && typeof sample === "object" && !Array.isArray(sample) && !React77__default.isValidElement(sample) && !(sample instanceof Date)) {
52486
+ if (sample && typeof sample === "object" && !Array.isArray(sample) && !React79__default.isValidElement(sample) && !(sample instanceof Date)) {
51847
52487
  const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
51848
52488
  finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
51849
52489
  }
@@ -52176,6 +52816,7 @@ init_SplitPane();
52176
52816
  init_MasterDetailLayout();
52177
52817
  init_DashboardGrid();
52178
52818
  init_TabbedContainer();
52819
+ init_DockLayout();
52179
52820
 
52180
52821
  // components/core/organisms/index.ts
52181
52822
  init_molecules();
@@ -53176,7 +53817,7 @@ function expressionEqual(a, b) {
53176
53817
  function isPlainSlotObject(value) {
53177
53818
  if (value === null || value === void 0 || typeof value !== "object") return false;
53178
53819
  if (Array.isArray(value)) return false;
53179
- if (React77__default.isValidElement(value)) return false;
53820
+ if (React79__default.isValidElement(value)) return false;
53180
53821
  if (value instanceof Date) return false;
53181
53822
  if (isRenderBindingMarker(value)) return false;
53182
53823
  return true;
@@ -53195,7 +53836,7 @@ function shareValue(prev, next) {
53195
53836
  return prev instanceof Date && next instanceof Date && prev.getTime() === next.getTime() ? { value: prev, equal: true } : { value: next, equal: false };
53196
53837
  }
53197
53838
  if (typeof prev === "function" || typeof next === "function") return { value: next, equal: false };
53198
- if (React77__default.isValidElement(prev) || React77__default.isValidElement(next)) return { value: next, equal: false };
53839
+ if (React79__default.isValidElement(prev) || React79__default.isValidElement(next)) return { value: next, equal: false };
53199
53840
  if (Array.isArray(prev) && Array.isArray(next)) {
53200
53841
  let equal = prev.length === next.length;
53201
53842
  const out = new Array(next.length);
@@ -54104,6 +54745,8 @@ var en_default = {
54104
54745
  "orbInspector.tokenGroup.shadows": "Shadows",
54105
54746
  "orbInspector.tab.inspector": "Inspector",
54106
54747
  "orbInspector.tab.styles": "Styles",
54748
+ "orbInspector.tab.design": "Design",
54749
+ "orbInspector.tab.prototype": "Prototype",
54107
54750
  "orbInspector.tab.code": "Code",
54108
54751
  "canvas.goBackToOverview": "Go back to overview",
54109
54752
  "canvas.overview": "Overview",
@@ -54343,104 +54986,8 @@ init_useInfiniteScroll();
54343
54986
  init_usePullToRefresh();
54344
54987
  init_useCanvasGestures();
54345
54988
  init_useTapReveal();
54346
-
54347
- // hooks/useDraggable.ts
54348
- init_useEventBus();
54349
- var ALMADAR_DND_MIME = "application/x-almadar-dnd";
54350
- function useDraggable({ payload, disabled = false }) {
54351
- const [isDragging, setIsDragging] = useState(false);
54352
- const eventBus = useEventBus();
54353
- const handleDragStart = useCallback(
54354
- (e) => {
54355
- if (disabled) {
54356
- e.preventDefault();
54357
- return;
54358
- }
54359
- e.dataTransfer.setData(ALMADAR_DND_MIME, JSON.stringify(payload));
54360
- e.dataTransfer.effectAllowed = "copy";
54361
- setIsDragging(true);
54362
- eventBus.emit("UI:DRAG_START", { kind: payload.kind, data: payload.data });
54363
- },
54364
- [disabled, payload, eventBus]
54365
- );
54366
- const handleDragEnd = useCallback(
54367
- (e) => {
54368
- setIsDragging(false);
54369
- eventBus.emit("UI:DRAG_END", { kind: payload.kind, data: payload.data });
54370
- },
54371
- [payload, eventBus]
54372
- );
54373
- const dragProps = useMemo(
54374
- () => ({
54375
- draggable: !disabled,
54376
- onDragStart: handleDragStart,
54377
- onDragEnd: handleDragEnd,
54378
- "aria-grabbed": isDragging
54379
- }),
54380
- [disabled, handleDragStart, handleDragEnd, isDragging]
54381
- );
54382
- return { dragProps, isDragging };
54383
- }
54384
-
54385
- // hooks/useDropZone.ts
54386
- init_useEventBus();
54387
- function parsePayload(e) {
54388
- try {
54389
- const raw = e.dataTransfer.getData(ALMADAR_DND_MIME);
54390
- if (!raw) return null;
54391
- const parsed = JSON.parse(raw);
54392
- if (typeof parsed.kind !== "string" || !parsed.data) return null;
54393
- return parsed;
54394
- } catch {
54395
- return null;
54396
- }
54397
- }
54398
- function hasAlmadarPayload(e) {
54399
- return e.dataTransfer.types.includes(ALMADAR_DND_MIME);
54400
- }
54401
- function useDropZone({ accepts, onDrop, disabled = false }) {
54402
- const [isOver, setIsOver] = useState(false);
54403
- const eventBus = useEventBus();
54404
- const handleDragOver = useCallback(
54405
- (e) => {
54406
- if (disabled) return;
54407
- if (!hasAlmadarPayload(e)) return;
54408
- e.preventDefault();
54409
- e.dataTransfer.dropEffect = "copy";
54410
- setIsOver(true);
54411
- },
54412
- [disabled]
54413
- );
54414
- const handleDragLeave = useCallback(
54415
- (e) => {
54416
- setIsOver(false);
54417
- },
54418
- []
54419
- );
54420
- const handleDrop = useCallback(
54421
- (e) => {
54422
- e.preventDefault();
54423
- setIsOver(false);
54424
- if (disabled) return;
54425
- const payload = parsePayload(e);
54426
- if (!payload) return;
54427
- if (!accepts.includes(payload.kind)) return;
54428
- const position = { x: e.clientX, y: e.clientY };
54429
- onDrop(payload, position);
54430
- eventBus.emit("UI:DROP", { kind: payload.kind, data: payload.data, ...position });
54431
- },
54432
- [disabled, accepts, onDrop, eventBus]
54433
- );
54434
- const dropProps = useMemo(
54435
- () => ({
54436
- onDragOver: handleDragOver,
54437
- onDragLeave: handleDragLeave,
54438
- onDrop: handleDrop
54439
- }),
54440
- [handleDragOver, handleDragLeave, handleDrop]
54441
- );
54442
- return { dropProps, isOver };
54443
- }
54989
+ init_useDraggable();
54990
+ init_useDropZone();
54444
54991
  function useRenderInterpolation(options = {}) {
54445
54992
  const tickIntervalMs = options.tickIntervalMs ?? 1e3 / 30;
54446
54993
  const prevRef = useRef(null);
@@ -54584,4 +55131,4 @@ function useGitHubBranches(owner, repo, enabled = true) {
54584
55131
  });
54585
55132
  }
54586
55133
 
54587
- export { ALL_PRESETS, ALMADAR_DND_MIME, AR_BOOK_FIELDS, AboutPageTemplate, Accordion, Card2 as ActionCard, ActionPalette, ActionTile, ActivationBlock, Alert, AlgoGraphCanvas, AlgorithmCanvas, AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, Aside, AssetPicker, AtlasImage, AtlasPanel, AuthLayout, Avatar, Badge, BehaviorView, BiologyCanvas, BloomQuizBlock, BookChapterView, BookCoverPage, BookNavBar, BookTableOfContents, BookViewer, Box, BranchingLogicBuilder, Breadcrumb, Button, ButtonGroup, CTABanner, CalendarGrid, Canvas, Canvas2D, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CaseStudyCard, CaseStudyOrganism, Center, Chart, ChartLegend, ChatBar, Checkbox, ChemistryCanvas, ChoiceButton, Coachmark, CodeBlock, CodeRunnerPanel, CollapsibleSection, CommunityLinks, ConditionalWrapper, ConfettiEffect, ConfirmDialog, ConnectionBlock, Container, ContentRenderer, ContentSection, ControlButton, ControlGrid, CounterTemplate, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DEFAULT_SLOTS, DIAMOND_TOP_Y, DashboardGrid, DashboardLayout, DataGrid, DataList, DataTable, DateRangePicker, DateRangeSelector, DayCell, DetailPanel, Dialog, DialogueBubble, Divider, DocBreadcrumb, DocPagination, DocSearch, DocSidebar, DocTOC, DocumentDetails, DocumentPanel, DocumentViewer, StateMachineView as DomStateMachineVisualizer, Drawer, DrawerSlot, ELEMENT_SELECTED_EVENT, EdgeDecoration, EditorCheckbox, EditorSelect, EditorSlider, EditorTextInput, EditorToolbar, EmojiPicker, EmptyState, EntityDisplayEvents, ErrorBoundary, ErrorState, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FeatureCard, FeatureDetailPageTemplate, FeatureGrid, FeatureGridOrganism, FileTree, FilterGroup, FilterPill, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormActions, FormField, FormLayout, FormSection, FormSectionHeader, FxOverlay, GameAudioToggle, GameHud, GameIcon, GameMenu, GameShell, GenericAppTemplate, GeometricPattern, GradientDivider, GraphCanvas, GraphView, Grid, GridPicker, HStack, Header, HealthBar, HeroOrganism, HeroSection, I18nProvider, IDENTITY_BOOK_FIELDS, Icon, IconPicker, ImportPreviewTree, ImportProgress, ImportSourcePicker, InfiniteScrollSentinel, Input, InputGroup, InstallBox, JazariStateMachine, JsonTreeEditor, Label, LandingPageTemplate, LawReferenceTooltip, LearningCanvas, LearningScene3D, Lightbox, LikertScale, LineChart2 as LineChart, List3 as List, LoadingState, MapView, MarkdownContent, MarketingFooter, MarketingStatCard, MasterDetail, MasterDetailLayout, MathCanvas, MatrixQuestion, MediaGallery, Menu, Meter, Modal, ModalSlot, ModuleCard, Navigation, NodeSlotEditor, NotifyListener, NumberStepper, OnboardingSpotlight, OptionConstraintGroup, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, Overlay, PageHeader, PageTransition, Pagination, PatternTile, PhysicsCanvas, Popover, PositionedCanvas, Presence, PricingCard, PricingGrid, PricingOrganism, PricingPageTemplate, ProgressBar, ProgressDots, PropertyInspector, PullQuote, PullToRefresh, QrScanner, QuizBlock, Radio, RangeSlider, ReflectionBlock, RelationSelect, RepeatableFormSection, ReplyTree, RichTextEditor, RuntimeDebugger, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, ScoreDisplay, SearchInput, Section, SectionHeader, SegmentRenderer, Select, SequenceBar, ServiceCatalog, SharedEntityStoreContext, ShowcaseCard, ShowcaseOrganism, SidePanel, Sidebar, SignaturePad, SimpleGrid, Skeleton, SlotContentRenderer, SocialProof, SortableList, Spacer, Sparkline, Spinner, Split, SplitPane, SplitSection, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateGraph, StateJsonView, StateMachineView, StateNode2 as StateNode, StatsGrid, StatsOrganism, StatusBar, StatusDot, StepFlow, StepFlowOrganism, SubagentTracePanel, SvgBranch, SvgConnection, SvgFlow, SvgGrid, SvgLobe, SvgMesh, SvgMorph, SvgNode, SvgPulse, SvgRing, SvgShield, SvgStack, SwipeableRow, Switch, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, TabbedContainer, TableView, Tabs, TagCloud, TagInput, TeamCard, TeamOrganism, TerrainPalette, TextHighlight, Textarea, ThemeToggle, TimeSlotCell, Timeline, TimerDisplay, Toast, ToastSlot, Tooltip, TraitFrame, TraitSlot, TraitStateViewer, TransitionArrow, TrendIndicator, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UploadDropZone, VStack, VersionDiff, ViolationAlert, VoteStack, WizardContainer, WizardNavigation, WizardProgress, arrowBetween, billboardLabel, boardEntity, bool, calculateAttackTargets, calculateValidMoves, cn, createInitialGameState, createSharedEntityStore, createTranslate, createUnitAnimationState, cylinderBetween, get3DClickPayload, getCurrentFrame, getTileDimensions, inferDirection, isoToScreen, makeAsset, makeAssetMap, mapBookData, meshSphere, num, objAvailableActions, objAvailableEvents, objCurrentState, objIcon, objId, objMaxRules, objName, objRules, objStates, parseEditFocus, parseLessonSegments, parseMarkdownWithCodeBlocks, parseQueryBinding, pendulum, projectileMotion, registerCodeLanguageLoader, renderPatternValue, resolveFieldMap, resolveFrame, resolveSheetDirection, rows, runTickFrame, sanitizeRichHtml, screenToIso, springOscillator, str, tickAnimationState, toCodeLanguage, transitionAnimation, unitHealth, unitPosition, unitTeam, useAgentChat, useAnchorRect, useAtlasSliceDataUrl, useAuthContext, useCamera, useCanvasGestures, useCompile, useConnectGitHub, useDeepAgentGeneration, useDisconnectGitHub, useDragReorder, useDraggable, useDropZone, useEmitEvent, useEventBus, useEventListener, useExtensions, useFileEditor, useFileSystem, useGameAudio, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useImageCache, useInfiniteScroll, useLongPress, useMediaQuery, useOrbitalHistory, usePresence, usePreview, usePullToRefresh, useQuerySingleton, useRenderInterpolation, useSharedEntitySnapshot, useSharedEntityStore, useSharedEntityStoreContext, useSwipeGesture, useTapReveal, useTraitListens, useTranslate116 as useTranslate, useUIEvents, useUISlotManager, useUnitSpriteAtlas, useValidation, vec2 };
55134
+ export { ALL_PRESETS, ALMADAR_DND_MIME, AR_BOOK_FIELDS, AboutPageTemplate, Accordion, Card2 as ActionCard, ActionPalette, ActionTile, ActivationBlock, Alert, AlgoGraphCanvas, AlgorithmCanvas, AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, Aside, AssetPicker, AtlasImage, AtlasPanel, AuthLayout, Avatar, Badge, BehaviorView, BiologyCanvas, BloomQuizBlock, BookChapterView, BookCoverPage, BookNavBar, BookTableOfContents, BookViewer, Box, BranchingLogicBuilder, Breadcrumb, Button, ButtonGroup, CTABanner, CalendarGrid, Canvas, Canvas2D, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CaseStudyCard, CaseStudyOrganism, Center, Chart, ChartLegend, ChatBar, Checkbox, ChemistryCanvas, ChoiceButton, Coachmark, CodeBlock, CodeRunnerPanel, CollapsibleSection, CommandPalette, CommunityLinks, ConditionalWrapper, ConfettiEffect, ConfirmDialog, ConnectionBlock, Container, ContentRenderer, ContentSection, ControlButton, ControlGrid, CounterTemplate, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DEFAULT_SLOTS, DIAMOND_TOP_Y, DashboardGrid, DashboardLayout, DataGrid, DataList, DataTable, DateRangePicker, DateRangeSelector, DayCell, DetailPanel, Dialog, DialogueBubble, Divider, DocBreadcrumb, DocPagination, DocSearch, DocSidebar, DocTOC, DockLayout, DocumentDetails, DocumentPanel, DocumentViewer, StateMachineView as DomStateMachineVisualizer, Drawer, DrawerSlot, ELEMENT_SELECTED_EVENT, EdgeDecoration, EditorCheckbox, EditorSelect, EditorSlider, EditorTextInput, EditorToolbar, EmojiPicker, EmptyState, EntityDisplayEvents, ErrorBoundary, ErrorState, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FeatureCard, FeatureDetailPageTemplate, FeatureGrid, FeatureGridOrganism, FileTree, FilterGroup, FilterPill, Flex, FlipCard, FlipContainer, FloatingActionButton, FloatingToolbar, Form, FormActions, FormField, FormLayout, FormSection, FormSectionHeader, FxOverlay, GameAudioToggle, GameHud, GameIcon, GameMenu, GameShell, GenericAppTemplate, GeometricPattern, GradientDivider, GraphCanvas, GraphView, Grid, GridPicker, HStack, Header, HealthBar, HeroOrganism, HeroSection, I18nProvider, IDENTITY_BOOK_FIELDS, Icon, IconPicker, ImportPreviewTree, ImportProgress, ImportSourcePicker, InfiniteScrollSentinel, Input, InputGroup, InstallBox, JazariStateMachine, JsonTreeEditor, Label, LandingPageTemplate, LawReferenceTooltip, LearningCanvas, LearningScene3D, Lightbox, LikertScale, LineChart2 as LineChart, List3 as List, LoadingState, MapView, MarkdownContent, MarketingFooter, MarketingStatCard, MasterDetail, MasterDetailLayout, MathCanvas, MatrixQuestion, MediaGallery, Menu, Meter, Modal, ModalSlot, ModuleCard, Navigation, NodeSlotEditor, NotifyListener, NumberStepper, OnboardingSpotlight, OptionConstraintGroup, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, Overlay, PageHeader, PageTransition, Pagination, PatternTile, PhysicsCanvas, Popover, PositionedCanvas, Presence, PricingCard, PricingGrid, PricingOrganism, PricingPageTemplate, ProgressBar, ProgressDots, PropertyInspector, PullQuote, PullToRefresh, QrScanner, QuizBlock, Radio, RangeSlider, ReflectionBlock, RelationSelect, RepeatableFormSection, ReplyTree, RichTextEditor, RuntimeDebugger, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, ScoreDisplay, SearchInput, Section, SectionHeader, SegmentRenderer, Select, SequenceBar, ServiceCatalog, SharedEntityStoreContext, ShowcaseCard, ShowcaseOrganism, SidePanel, Sidebar, SignaturePad, SimpleGrid, Skeleton, SlotContentRenderer, SocialProof, SortableList, Spacer, Sparkline, Spinner, Split, SplitPane, SplitSection, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateGraph, StateJsonView, StateMachineView, StateNode2 as StateNode, StatsGrid, StatsOrganism, StatusBar, StatusDot, StepFlow, StepFlowOrganism, SubagentTracePanel, SvgBranch, SvgConnection, SvgFlow, SvgGrid, SvgLobe, SvgMesh, SvgMorph, SvgNode, SvgPulse, SvgRing, SvgShield, SvgStack, SwipeableRow, Switch, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, TabbedContainer, TableView, Tabs, TagCloud, TagInput, TeamCard, TeamOrganism, TerrainPalette, TextHighlight, Textarea, ThemeToggle, TimeSlotCell, Timeline, TimerDisplay, Toast, ToastSlot, Tooltip, TraitFrame, TraitSlot, TraitStateViewer, TransitionArrow, TrendIndicator, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UploadDropZone, VStack, VersionDiff, ViolationAlert, VoteStack, WizardContainer, WizardNavigation, WizardProgress, arrowBetween, billboardLabel, boardEntity, bool, calculateAttackTargets, calculateValidMoves, cn, createInitialGameState, createSharedEntityStore, createTranslate, createUnitAnimationState, cylinderBetween, get3DClickPayload, getCurrentFrame, getTileDimensions, inferDirection, isoToScreen, makeAsset, makeAssetMap, mapBookData, meshSphere, num, objAvailableActions, objAvailableEvents, objCurrentState, objIcon, objId, objMaxRules, objName, objRules, objStates, parseEditFocus, parseLessonSegments, parseMarkdownWithCodeBlocks, parseQueryBinding, pendulum, projectileMotion, registerCodeLanguageLoader, renderPatternValue, resolveFieldMap, resolveFrame, resolveSheetDirection, rows, runTickFrame, sanitizeRichHtml, screenToIso, springOscillator, str, tickAnimationState, toCodeLanguage, transitionAnimation, unitHealth, unitPosition, unitTeam, useAgentChat, useAnchorRect, useAtlasSliceDataUrl, useAuthContext, useCamera, useCanvasGestures, useCompile, useConnectGitHub, useDeepAgentGeneration, useDisconnectGitHub, useDragReorder, useDraggable, useDropZone, useEmitEvent, useEventBus, useEventListener, useExtensions, useFileEditor, useFileSystem, useGameAudio, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useImageCache, useInfiniteScroll, useLongPress, useMediaQuery, useOrbitalHistory, usePresence, usePreview, usePullToRefresh, useQuerySingleton, useRenderInterpolation, useSharedEntitySnapshot, useSharedEntityStore, useSharedEntityStoreContext, useSwipeGesture, useTapReveal, useTraitListens, useTranslate116 as useTranslate, useUIEvents, useUISlotManager, useUnitSpriteAtlas, useValidation, vec2 };