@almadar/ui 5.140.0 → 5.142.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import * as React86 from 'react';
2
- import React86__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
1
+ import * as React87 from 'react';
2
+ import React87__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
3
3
  import { EventBusContext, useTraitScopeChain, useEntitySchemaOptional, useEntityBindingSnapshot, useTraitScope, TraitScopeProvider, useCurrentPagePath, useGameAudioContextOptional } from '@almadar/ui/providers';
4
4
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
5
5
  import { createContextFromBindings, interpolateValue } from '@almadar/runtime';
@@ -281,7 +281,7 @@ function resolveMarkerExpression(expression, entity, config, state) {
281
281
  function isPlainObject(value) {
282
282
  if (value === null || value === void 0 || typeof value !== "object") return false;
283
283
  if (Array.isArray(value)) return false;
284
- if (React86__default.isValidElement(value)) return false;
284
+ if (React87__default.isValidElement(value)) return false;
285
285
  if (value instanceof Date) return false;
286
286
  if (typeof value === "function") return false;
287
287
  return true;
@@ -501,7 +501,7 @@ var init_Box = __esm({
501
501
  fixed: "fixed",
502
502
  sticky: "sticky"
503
503
  };
504
- Box = React86__default.forwardRef(
504
+ Box = React87__default.forwardRef(
505
505
  ({
506
506
  padding,
507
507
  paddingX,
@@ -566,7 +566,7 @@ var init_Box = __esm({
566
566
  onPointerDown?.(e);
567
567
  }, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
568
568
  const isClickable = action || onClick;
569
- return React86__default.createElement(
569
+ return React87__default.createElement(
570
570
  Component,
571
571
  {
572
572
  ref,
@@ -783,7 +783,7 @@ var init_Icon = __esm({
783
783
  const effectiveName = typeof icon === "string" && icon !== "" ? icon : name;
784
784
  const effectiveStrokeWidth = strokeWidth != null && strokeWidth > 0 ? strokeWidth : void 0;
785
785
  const family = useIconFamily();
786
- const RenderedComponent = React86__default.useMemo(() => {
786
+ const RenderedComponent = React87__default.useMemo(() => {
787
787
  if (directIcon) return null;
788
788
  return effectiveName ? resolveIconForFamily(effectiveName) : null;
789
789
  }, [directIcon, effectiveName, family]);
@@ -907,7 +907,7 @@ var init_atlasSlice = __esm({
907
907
  }
908
908
  });
909
909
  function useAtlasSliceDataUrl(asset) {
910
- const [, bump] = React86.useReducer((x) => x + 1, 0);
910
+ const [, bump] = React87.useReducer((x) => x + 1, 0);
911
911
  if (!isAtlasAsset(asset)) return void 0;
912
912
  const key = `${asset.atlas}#${asset.sprite}`;
913
913
  const cached = sliceDataUrlCache.get(key);
@@ -970,13 +970,13 @@ function AtlasImage({
970
970
  style,
971
971
  "aria-hidden": ariaHidden
972
972
  }) {
973
- const [, bump] = React86.useReducer((x) => x + 1, 0);
974
- const canvasRef = React86.useRef(null);
973
+ const [, bump] = React87.useReducer((x) => x + 1, 0);
974
+ const canvasRef = React87.useRef(null);
975
975
  const sliced = isAtlasAsset(asset);
976
976
  const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
977
977
  const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
978
978
  const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
979
- React86.useEffect(() => {
979
+ React87.useEffect(() => {
980
980
  const canvas = canvasRef.current;
981
981
  if (!canvas || !img || !rect) return;
982
982
  canvas.width = rect.sw;
@@ -1052,7 +1052,7 @@ function resolveIconProp(value, sizeClass) {
1052
1052
  const IconComp = value;
1053
1053
  return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
1054
1054
  }
1055
- if (React86__default.isValidElement(value)) {
1055
+ if (React87__default.isValidElement(value)) {
1056
1056
  return value;
1057
1057
  }
1058
1058
  if (typeof value === "object" && value !== null && isIconLike(value)) {
@@ -1129,7 +1129,7 @@ var init_Button = __esm({
1129
1129
  md: "h-icon-default w-icon-default",
1130
1130
  lg: "h-icon-default w-icon-default"
1131
1131
  };
1132
- Button = React86__default.forwardRef(
1132
+ Button = React87__default.forwardRef(
1133
1133
  ({
1134
1134
  className,
1135
1135
  variant = "primary",
@@ -1199,7 +1199,7 @@ var Dialog;
1199
1199
  var init_Dialog = __esm({
1200
1200
  "components/core/atoms/Dialog.tsx"() {
1201
1201
  init_cn();
1202
- Dialog = React86__default.forwardRef(
1202
+ Dialog = React87__default.forwardRef(
1203
1203
  ({
1204
1204
  role = "dialog",
1205
1205
  "aria-modal": ariaModal = true,
@@ -1410,7 +1410,7 @@ var init_Typography = __esm({
1410
1410
  if (format !== void 0 && format !== "none" && (typeof body === "string" || typeof body === "number" || body instanceof Date)) {
1411
1411
  body = formatValue(body, format);
1412
1412
  }
1413
- return React86__default.createElement(
1413
+ return React87__default.createElement(
1414
1414
  Component,
1415
1415
  {
1416
1416
  id,
@@ -1973,7 +1973,7 @@ var init_Badge = __esm({
1973
1973
  md: "px-2.5 py-1 text-sm",
1974
1974
  lg: "px-3 py-1.5 text-base"
1975
1975
  };
1976
- Badge = React86__default.forwardRef(
1976
+ Badge = React87__default.forwardRef(
1977
1977
  ({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
1978
1978
  const iconSizes3 = {
1979
1979
  sm: "h-icon-default w-icon-default",
@@ -2323,7 +2323,7 @@ var init_SvgFlow = __esm({
2323
2323
  width = 100,
2324
2324
  height = 100
2325
2325
  }) => {
2326
- const markerId = React86__default.useMemo(() => {
2326
+ const markerId = React87__default.useMemo(() => {
2327
2327
  flowIdCounter += 1;
2328
2328
  return `almadar-flow-arrow-${flowIdCounter}`;
2329
2329
  }, []);
@@ -2916,7 +2916,7 @@ var init_SvgRing = __esm({
2916
2916
  width = 100,
2917
2917
  height = 100
2918
2918
  }) => {
2919
- const gradientId = React86__default.useMemo(() => {
2919
+ const gradientId = React87__default.useMemo(() => {
2920
2920
  ringIdCounter += 1;
2921
2921
  return `almadar-ring-glow-${ringIdCounter}`;
2922
2922
  }, []);
@@ -3097,7 +3097,7 @@ var init_Input = __esm({
3097
3097
  init_cn();
3098
3098
  init_Icon();
3099
3099
  init_useEventBus();
3100
- Input = React86__default.forwardRef(
3100
+ Input = React87__default.forwardRef(
3101
3101
  ({
3102
3102
  className,
3103
3103
  inputType,
@@ -3121,9 +3121,9 @@ var init_Input = __esm({
3121
3121
  const eventBus = useEventBus();
3122
3122
  const type = inputType || htmlType || "text";
3123
3123
  const isDeclarative = typeof onChange === "string";
3124
- const [localValue, setLocalValue] = React86__default.useState(value);
3125
- const pendingEchoRef = React86__default.useRef(/* @__PURE__ */ new Set());
3126
- React86__default.useEffect(() => {
3124
+ const [localValue, setLocalValue] = React87__default.useState(value);
3125
+ const pendingEchoRef = React87__default.useRef(/* @__PURE__ */ new Set());
3126
+ React87__default.useEffect(() => {
3127
3127
  if (!isDeclarative) return;
3128
3128
  const incoming = value == null ? "" : String(value);
3129
3129
  if (pendingEchoRef.current.has(incoming)) {
@@ -3283,7 +3283,7 @@ var Label;
3283
3283
  var init_Label = __esm({
3284
3284
  "components/core/atoms/Label.tsx"() {
3285
3285
  init_cn();
3286
- Label = React86__default.forwardRef(
3286
+ Label = React87__default.forwardRef(
3287
3287
  ({ className, required, children, ...props }, ref) => {
3288
3288
  return /* @__PURE__ */ jsxs(
3289
3289
  "label",
@@ -3310,7 +3310,7 @@ var init_Textarea = __esm({
3310
3310
  "components/core/atoms/Textarea.tsx"() {
3311
3311
  init_cn();
3312
3312
  init_useEventBus();
3313
- Textarea = React86__default.forwardRef(
3313
+ Textarea = React87__default.forwardRef(
3314
3314
  ({ className, error, onChange, ...props }, ref) => {
3315
3315
  const eventBus = useEventBus();
3316
3316
  const handleChange = (e) => {
@@ -3549,7 +3549,7 @@ var init_Select = __esm({
3549
3549
  init_cn();
3550
3550
  init_Icon();
3551
3551
  init_useEventBus();
3552
- Select = React86__default.forwardRef(
3552
+ Select = React87__default.forwardRef(
3553
3553
  (props, _ref) => {
3554
3554
  const { multiple, searchable, clearable } = props;
3555
3555
  if (multiple || searchable || clearable) {
@@ -3566,7 +3566,7 @@ var init_Checkbox = __esm({
3566
3566
  "components/core/atoms/Checkbox.tsx"() {
3567
3567
  init_cn();
3568
3568
  init_useEventBus();
3569
- Checkbox = React86__default.forwardRef(
3569
+ Checkbox = React87__default.forwardRef(
3570
3570
  ({ className, label, id, onChange, ...props }, ref) => {
3571
3571
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
3572
3572
  const eventBus = useEventBus();
@@ -3620,7 +3620,7 @@ var init_Spinner = __esm({
3620
3620
  md: "h-6 w-6",
3621
3621
  lg: "h-8 w-8"
3622
3622
  };
3623
- Spinner = React86__default.forwardRef(
3623
+ Spinner = React87__default.forwardRef(
3624
3624
  ({ className, size = "md", overlay, ...props }, ref) => {
3625
3625
  if (overlay) {
3626
3626
  return /* @__PURE__ */ jsx(
@@ -3710,7 +3710,7 @@ var init_Card = __esm({
3710
3710
  chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
3711
3711
  "tile-image-first": "p-0 overflow-hidden"
3712
3712
  };
3713
- Card = React86__default.forwardRef(
3713
+ Card = React87__default.forwardRef(
3714
3714
  ({
3715
3715
  className,
3716
3716
  variant = "bordered",
@@ -3759,9 +3759,9 @@ var init_Card = __esm({
3759
3759
  }
3760
3760
  );
3761
3761
  Card.displayName = "Card";
3762
- CardHeader = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
3762
+ CardHeader = React87__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
3763
3763
  CardHeader.displayName = "CardHeader";
3764
- CardTitle = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3764
+ CardTitle = React87__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3765
3765
  "h3",
3766
3766
  {
3767
3767
  ref,
@@ -3774,11 +3774,11 @@ var init_Card = __esm({
3774
3774
  }
3775
3775
  ));
3776
3776
  CardTitle.displayName = "CardTitle";
3777
- CardContent = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
3777
+ CardContent = React87__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
3778
3778
  CardContent.displayName = "CardContent";
3779
3779
  CardBody = CardContent;
3780
3780
  CardBody.displayName = "CardBody";
3781
- CardFooter = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3781
+ CardFooter = React87__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3782
3782
  "div",
3783
3783
  {
3784
3784
  ref,
@@ -3865,7 +3865,7 @@ var init_FilterPill = __esm({
3865
3865
  md: "w-3.5 h-3.5",
3866
3866
  lg: "w-4 h-4"
3867
3867
  };
3868
- FilterPill = React86__default.forwardRef(
3868
+ FilterPill = React87__default.forwardRef(
3869
3869
  ({
3870
3870
  className,
3871
3871
  variant = "default",
@@ -3994,8 +3994,8 @@ var init_Avatar = __esm({
3994
3994
  actionPayload
3995
3995
  }) => {
3996
3996
  const eventBus = useEventBus();
3997
- const [imgFailed, setImgFailed] = React86__default.useState(false);
3998
- React86__default.useEffect(() => {
3997
+ const [imgFailed, setImgFailed] = React87__default.useState(false);
3998
+ React87__default.useEffect(() => {
3999
3999
  setImgFailed(false);
4000
4000
  }, [src]);
4001
4001
  const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
@@ -4108,7 +4108,7 @@ var init_Center = __esm({
4108
4108
  as: Component = "div"
4109
4109
  }) => {
4110
4110
  const mergedStyle = minHeight ? { minHeight, ...style } : style;
4111
- return React86__default.createElement(Component, {
4111
+ return React87__default.createElement(Component, {
4112
4112
  className: cn(
4113
4113
  inline ? "inline-flex" : "flex",
4114
4114
  horizontal && "justify-center",
@@ -4376,7 +4376,7 @@ var init_Radio = __esm({
4376
4376
  md: "w-2.5 h-2.5",
4377
4377
  lg: "w-3 h-3"
4378
4378
  };
4379
- Radio = React86__default.forwardRef(
4379
+ Radio = React87__default.forwardRef(
4380
4380
  ({
4381
4381
  label,
4382
4382
  helperText,
@@ -4393,12 +4393,12 @@ var init_Radio = __esm({
4393
4393
  onChange,
4394
4394
  ...props
4395
4395
  }, ref) => {
4396
- const reactId = React86__default.useId();
4396
+ const reactId = React87__default.useId();
4397
4397
  const baseId = id || `radio-${reactId}`;
4398
4398
  const hasError = !!error;
4399
4399
  const eventBus = useEventBus();
4400
- const [selected, setSelected] = React86__default.useState(value);
4401
- React86__default.useEffect(() => {
4400
+ const [selected, setSelected] = React87__default.useState(value);
4401
+ React87__default.useEffect(() => {
4402
4402
  if (value !== void 0) setSelected(value);
4403
4403
  }, [value]);
4404
4404
  const pick = (next, e) => {
@@ -4580,7 +4580,7 @@ var init_Switch = __esm({
4580
4580
  "components/core/atoms/Switch.tsx"() {
4581
4581
  "use client";
4582
4582
  init_cn();
4583
- Switch = React86.forwardRef(
4583
+ Switch = React87.forwardRef(
4584
4584
  ({
4585
4585
  checked,
4586
4586
  defaultChecked = false,
@@ -4591,10 +4591,10 @@ var init_Switch = __esm({
4591
4591
  name,
4592
4592
  className
4593
4593
  }, ref) => {
4594
- const [isChecked, setIsChecked] = React86.useState(
4594
+ const [isChecked, setIsChecked] = React87.useState(
4595
4595
  checked !== void 0 ? checked : defaultChecked
4596
4596
  );
4597
- React86.useEffect(() => {
4597
+ React87.useEffect(() => {
4598
4598
  if (checked !== void 0) {
4599
4599
  setIsChecked(checked);
4600
4600
  }
@@ -4757,7 +4757,7 @@ var init_Stack = __esm({
4757
4757
  };
4758
4758
  const isHorizontal = direction === "horizontal";
4759
4759
  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";
4760
- return React86__default.createElement(
4760
+ return React87__default.createElement(
4761
4761
  Component,
4762
4762
  {
4763
4763
  className: cn(
@@ -4957,7 +4957,7 @@ var Aside;
4957
4957
  var init_Aside = __esm({
4958
4958
  "components/core/atoms/Aside.tsx"() {
4959
4959
  init_cn();
4960
- Aside = React86__default.forwardRef(
4960
+ Aside = React87__default.forwardRef(
4961
4961
  ({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
4962
4962
  );
4963
4963
  Aside.displayName = "Aside";
@@ -5036,9 +5036,9 @@ var init_LawReferenceTooltip = __esm({
5036
5036
  className
5037
5037
  }) => {
5038
5038
  const { t } = useTranslate();
5039
- const [isVisible, setIsVisible] = React86__default.useState(false);
5040
- const timeoutRef = React86__default.useRef(null);
5041
- const triggerRef = React86__default.useRef(null);
5039
+ const [isVisible, setIsVisible] = React87__default.useState(false);
5040
+ const timeoutRef = React87__default.useRef(null);
5041
+ const triggerRef = React87__default.useRef(null);
5042
5042
  const handleMouseEnter = () => {
5043
5043
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
5044
5044
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -5049,7 +5049,7 @@ var init_LawReferenceTooltip = __esm({
5049
5049
  };
5050
5050
  const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
5051
5051
  const open = isVisible || revealed;
5052
- React86__default.useEffect(() => {
5052
+ React87__default.useEffect(() => {
5053
5053
  return () => {
5054
5054
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
5055
5055
  };
@@ -5259,7 +5259,7 @@ var init_StatusDot = __esm({
5259
5259
  md: "w-2.5 h-2.5",
5260
5260
  lg: "w-3 h-3"
5261
5261
  };
5262
- StatusDot = React86__default.forwardRef(
5262
+ StatusDot = React87__default.forwardRef(
5263
5263
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
5264
5264
  return /* @__PURE__ */ jsx(
5265
5265
  "span",
@@ -5313,7 +5313,7 @@ var init_TrendIndicator = __esm({
5313
5313
  down: "trending-down",
5314
5314
  flat: "arrow-right"
5315
5315
  };
5316
- TrendIndicator = React86__default.forwardRef(
5316
+ TrendIndicator = React87__default.forwardRef(
5317
5317
  ({
5318
5318
  className,
5319
5319
  value,
@@ -5382,7 +5382,7 @@ var init_RangeSlider = __esm({
5382
5382
  md: "w-4 h-4",
5383
5383
  lg: "w-5 h-5"
5384
5384
  };
5385
- RangeSlider = React86__default.forwardRef(
5385
+ RangeSlider = React87__default.forwardRef(
5386
5386
  ({
5387
5387
  className,
5388
5388
  min = 0,
@@ -5993,7 +5993,7 @@ var init_ContentSection = __esm({
5993
5993
  md: "py-16",
5994
5994
  lg: "py-24"
5995
5995
  };
5996
- ContentSection = React86__default.forwardRef(
5996
+ ContentSection = React87__default.forwardRef(
5997
5997
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
5998
5998
  return /* @__PURE__ */ jsx(
5999
5999
  Box,
@@ -6527,7 +6527,7 @@ var init_AnimatedReveal = __esm({
6527
6527
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
6528
6528
  "none": {}
6529
6529
  };
6530
- AnimatedReveal = React86__default.forwardRef(
6530
+ AnimatedReveal = React87__default.forwardRef(
6531
6531
  ({
6532
6532
  trigger = "scroll",
6533
6533
  animation = "fade-up",
@@ -6687,7 +6687,7 @@ var init_AnimatedGraphic = __esm({
6687
6687
  "components/marketing/atoms/AnimatedGraphic.tsx"() {
6688
6688
  "use client";
6689
6689
  init_cn();
6690
- AnimatedGraphic = React86__default.forwardRef(
6690
+ AnimatedGraphic = React87__default.forwardRef(
6691
6691
  ({
6692
6692
  src,
6693
6693
  svgContent,
@@ -6710,7 +6710,7 @@ var init_AnimatedGraphic = __esm({
6710
6710
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
6711
6711
  const resolvedSvg = svgContent ?? fetchedSvg;
6712
6712
  const prevAnimateRef = useRef(animate);
6713
- const setRef = React86__default.useCallback(
6713
+ const setRef = React87__default.useCallback(
6714
6714
  (node) => {
6715
6715
  containerRef.current = node;
6716
6716
  if (typeof ref === "function") ref(node);
@@ -7438,9 +7438,9 @@ function ControlButton({
7438
7438
  className
7439
7439
  }) {
7440
7440
  const eventBus = useEventBus();
7441
- const [isPressed, setIsPressed] = React86.useState(false);
7441
+ const [isPressed, setIsPressed] = React87.useState(false);
7442
7442
  const actualPressed = pressed ?? isPressed;
7443
- const handlePointerDown = React86.useCallback(
7443
+ const handlePointerDown = React87.useCallback(
7444
7444
  (e) => {
7445
7445
  e.preventDefault();
7446
7446
  if (disabled) return;
@@ -7450,7 +7450,7 @@ function ControlButton({
7450
7450
  },
7451
7451
  [disabled, pressEvent, eventBus, onPress]
7452
7452
  );
7453
- const handlePointerUp = React86.useCallback(
7453
+ const handlePointerUp = React87.useCallback(
7454
7454
  (e) => {
7455
7455
  e.preventDefault();
7456
7456
  if (disabled) return;
@@ -7460,7 +7460,7 @@ function ControlButton({
7460
7460
  },
7461
7461
  [disabled, releaseEvent, eventBus, onRelease]
7462
7462
  );
7463
- const handlePointerLeave = React86.useCallback(
7463
+ const handlePointerLeave = React87.useCallback(
7464
7464
  (e) => {
7465
7465
  if (isPressed) {
7466
7466
  setIsPressed(false);
@@ -7718,8 +7718,8 @@ function ControlGrid({
7718
7718
  className
7719
7719
  }) {
7720
7720
  const eventBus = useEventBus();
7721
- const [active, setActive] = React86.useState(/* @__PURE__ */ new Set());
7722
- const handlePress = React86.useCallback(
7721
+ const [active, setActive] = React87.useState(/* @__PURE__ */ new Set());
7722
+ const handlePress = React87.useCallback(
7723
7723
  (id) => {
7724
7724
  setActive((prev) => new Set(prev).add(id));
7725
7725
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -7733,7 +7733,7 @@ function ControlGrid({
7733
7733
  },
7734
7734
  [kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
7735
7735
  );
7736
- const handleRelease = React86.useCallback(
7736
+ const handleRelease = React87.useCallback(
7737
7737
  (id) => {
7738
7738
  setActive((prev) => {
7739
7739
  const next = new Set(prev);
@@ -8091,7 +8091,7 @@ function GameMenu({
8091
8091
  }) {
8092
8092
  const resolvedOptions = (options?.length ? options : void 0) ?? (menuItems?.length ? menuItems : void 0) ?? DEFAULT_MENU_OPTIONS;
8093
8093
  const eventBus = useEventBus();
8094
- const handleOptionClick = React86.useCallback(
8094
+ const handleOptionClick = React87.useCallback(
8095
8095
  (option) => {
8096
8096
  if (option.event) {
8097
8097
  eventBus.emit(`UI:${option.event}`, { option });
@@ -8327,7 +8327,7 @@ function StateGraph({
8327
8327
  }) {
8328
8328
  const eventBus = useEventBus();
8329
8329
  const nodes = states ?? [];
8330
- const positions = React86.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
8330
+ const positions = React87.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
8331
8331
  return /* @__PURE__ */ jsxs(
8332
8332
  Box,
8333
8333
  {
@@ -8398,8 +8398,8 @@ function MiniMap({
8398
8398
  tileAssets,
8399
8399
  unitAssets
8400
8400
  }) {
8401
- const canvasRef = React86.useRef(null);
8402
- const imgCacheRef = React86.useRef(/* @__PURE__ */ new Map());
8401
+ const canvasRef = React87.useRef(null);
8402
+ const imgCacheRef = React87.useRef(/* @__PURE__ */ new Map());
8403
8403
  function loadImg(url) {
8404
8404
  const cached = imgCacheRef.current.get(url);
8405
8405
  if (cached) return cached.complete ? cached : null;
@@ -8415,7 +8415,7 @@ function MiniMap({
8415
8415
  imgCacheRef.current.set(url, img);
8416
8416
  return null;
8417
8417
  }
8418
- React86.useEffect(() => {
8418
+ React87.useEffect(() => {
8419
8419
  const canvas = canvasRef.current;
8420
8420
  if (!canvas) return;
8421
8421
  const ctx = canvas.getContext("2d");
@@ -8813,9 +8813,26 @@ var init_imageCache = __esm({
8813
8813
  });
8814
8814
 
8815
8815
  // lib/webPainter2d.ts
8816
+ function makeNoiseTile(alpha, color) {
8817
+ const tile = document.createElement("canvas");
8818
+ tile.width = NOISE_CELLS;
8819
+ tile.height = NOISE_CELLS;
8820
+ const t = tile.getContext("2d");
8821
+ if (t) {
8822
+ t.fillStyle = color;
8823
+ for (let y = 0; y < NOISE_CELLS; y++) {
8824
+ for (let x = 0; x < NOISE_CELLS; x++) {
8825
+ t.globalAlpha = noiseHash(x, y) * alpha;
8826
+ t.fillRect(x, y, 1, 1);
8827
+ }
8828
+ }
8829
+ }
8830
+ return tile;
8831
+ }
8816
8832
  function createWebPainter(ctx, onAssetLoad) {
8817
8833
  let vw = 0;
8818
8834
  let vh = 0;
8835
+ const patternCache = /* @__PURE__ */ new Map();
8819
8836
  const tracePoly = (points, closed) => {
8820
8837
  if (points.length === 0) return;
8821
8838
  ctx.beginPath();
@@ -8823,9 +8840,28 @@ function createWebPainter(ctx, onAssetLoad) {
8823
8840
  for (let i = 1; i < points.length; i++) ctx.lineTo(points[i].x, points[i].y);
8824
8841
  if (closed) ctx.closePath();
8825
8842
  };
8843
+ const toCanvasPattern = (style) => {
8844
+ const key = JSON.stringify(style);
8845
+ let pattern = patternCache.get(key);
8846
+ if (pattern === void 0) {
8847
+ if (style.kind === "noise") {
8848
+ pattern = ctx.createPattern(makeNoiseTile(style.alpha ?? 0.12, style.color ?? "#000000"), "repeat");
8849
+ } else {
8850
+ const img = getOrLoadImage(style.url, onAssetLoad);
8851
+ if (!img) return "rgba(0,0,0,0)";
8852
+ pattern = ctx.createPattern(img, "repeat");
8853
+ }
8854
+ if (pattern && style.scale !== void 0 && style.scale !== 1) {
8855
+ pattern.setTransform(new DOMMatrix().scale(style.scale));
8856
+ }
8857
+ patternCache.set(key, pattern);
8858
+ }
8859
+ return pattern ?? "rgba(0,0,0,0)";
8860
+ };
8826
8861
  const toCanvasStyle = (style) => {
8827
8862
  if (typeof style === "string") return style;
8828
- const g = style.kind === "linear" ? ctx.createLinearGradient(style.x1, style.y1, style.x2, style.y2) : ctx.createRadialGradient(style.cx, style.cy, 0, style.cx, style.cy, style.r);
8863
+ if (style.kind === "noise" || style.kind === "image") return toCanvasPattern(style);
8864
+ const g = style.kind === "linear" ? ctx.createLinearGradient(style.x1, style.y1, style.x2, style.y2) : style.kind === "conic" ? ctx.createConicGradient(style.angle, style.cx, style.cy) : ctx.createRadialGradient(style.cx, style.cy, 0, style.cx, style.cy, style.r);
8829
8865
  for (const stop of style.stops) g.addColorStop(stop.offset, stop.color);
8830
8866
  return g;
8831
8867
  };
@@ -8860,6 +8896,19 @@ function createWebPainter(ctx, onAssetLoad) {
8860
8896
  ctx.shadowColor = shadow ? shadow.color : "transparent";
8861
8897
  ctx.shadowBlur = shadow ? shadow.blur : 0;
8862
8898
  },
8899
+ setBlend(mode) {
8900
+ ctx.globalCompositeOperation = mode ?? "source-over";
8901
+ },
8902
+ setLineDash(pattern, offset = 0) {
8903
+ ctx.setLineDash(pattern ? [...pattern] : []);
8904
+ ctx.lineDashOffset = offset;
8905
+ },
8906
+ setBlur(px) {
8907
+ ctx.filter = px && px > 0 ? `blur(${px}px)` : "none";
8908
+ },
8909
+ clipPath(d) {
8910
+ ctx.clip(new Path2D(d));
8911
+ },
8863
8912
  resolveTexture(url) {
8864
8913
  const img = getOrLoadImage(url, onAssetLoad);
8865
8914
  if (!img) return null;
@@ -8935,13 +8984,18 @@ function createWebPainter(ctx, onAssetLoad) {
8935
8984
  }
8936
8985
  };
8937
8986
  }
8938
- var handleByImage, imageByHandle;
8987
+ var handleByImage, imageByHandle, noiseHash, NOISE_CELLS;
8939
8988
  var init_webPainter2d = __esm({
8940
8989
  "lib/webPainter2d.ts"() {
8941
8990
  "use client";
8942
8991
  init_imageCache();
8943
8992
  handleByImage = /* @__PURE__ */ new WeakMap();
8944
8993
  imageByHandle = /* @__PURE__ */ new WeakMap();
8994
+ noiseHash = (x, y) => {
8995
+ const s = Math.sin(x * 12.9898 + y * 78.233) * 43758.5453;
8996
+ return s - Math.floor(s);
8997
+ };
8998
+ NOISE_CELLS = 32;
8945
8999
  }
8946
9000
  });
8947
9001
 
@@ -9166,6 +9220,16 @@ function gradientStyle(g, ox, oy, scale) {
9166
9220
  stops: g.stops
9167
9221
  };
9168
9222
  }
9223
+ if (g.kind === "conic") {
9224
+ if (!g.center) return void 0;
9225
+ return {
9226
+ kind: "conic",
9227
+ cx: ox + g.center.x * scale,
9228
+ cy: oy + g.center.y * scale,
9229
+ angle: g.angle ?? 0,
9230
+ stops: g.stops
9231
+ };
9232
+ }
9169
9233
  if (!g.center || g.radius === void 0) return void 0;
9170
9234
  return {
9171
9235
  kind: "radial",
@@ -9175,6 +9239,13 @@ function gradientStyle(g, ox, oy, scale) {
9175
9239
  stops: g.stops
9176
9240
  };
9177
9241
  }
9242
+ function patternStyle(p, unit) {
9243
+ if (p.kind === "image") {
9244
+ if (!p.url) return void 0;
9245
+ return { kind: "image", url: p.url, scale: (p.scale ?? 1) / unit };
9246
+ }
9247
+ return { kind: "noise", scale: (p.scale ?? 2) / unit, alpha: p.alpha, color: p.color };
9248
+ }
9178
9249
  function DrawShape(props) {
9179
9250
  const register = useContext(DrawableRegistryContext);
9180
9251
  if (register) {
@@ -9203,7 +9274,9 @@ var init_DrawShape = __esm({
9203
9274
  "radiusY",
9204
9275
  "width",
9205
9276
  "height",
9206
- "strokeWidth"
9277
+ "strokeWidth",
9278
+ "strokeDashOffset",
9279
+ "blur"
9207
9280
  ];
9208
9281
  lerp = (a, b, k) => a + (b - a) * k;
9209
9282
  paintShape = (painter, rawNode, dctx) => {
@@ -9213,6 +9286,16 @@ var init_DrawShape = __esm({
9213
9286
  if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
9214
9287
  const origin = dctx.projector.project(node.position);
9215
9288
  const tileWidth = dctx.projector.tileWidth;
9289
+ const groupScale = dctx.groupScale ?? 1;
9290
+ const strokePx = (node.strokeWidth ?? 1) / groupScale;
9291
+ if (node.blendMode) painter.setBlend(node.blendMode);
9292
+ if (node.strokeDash && node.strokeDash.length > 0) {
9293
+ painter.setLineDash(
9294
+ node.strokeDash.map((v) => v / groupScale),
9295
+ (node.strokeDashOffset ?? 0) / groupScale
9296
+ );
9297
+ }
9298
+ if (node.blur !== void 0 && node.blur > 0) painter.setBlur(node.blur / groupScale);
9216
9299
  if (node.rotate) {
9217
9300
  const pivot = node.pivot ?? { x: 0.5, y: 0.5 };
9218
9301
  const px = origin.x + pivot.x * tileWidth;
@@ -9221,15 +9304,18 @@ var init_DrawShape = __esm({
9221
9304
  painter.rotate(node.rotate);
9222
9305
  painter.translate(-px, -py);
9223
9306
  }
9224
- if (node.shadow) painter.setShadow({ color: node.shadow.color, blur: node.shadow.blur * tileWidth });
9307
+ if (node.shadow) painter.setShadow({ color: node.shadow.color, blur: node.shadow.blur * tileWidth * groupScale });
9225
9308
  const fill = node.fill === "none" ? void 0 : node.fill;
9226
9309
  const stroke = node.stroke === "none" ? void 0 : node.stroke;
9227
9310
  const pxFill = node.gradient ? gradientStyle(node.gradient, origin.x, origin.y, tileWidth) ?? fill : fill;
9311
+ const pxStroke = node.strokeGradient ? gradientStyle(node.strokeGradient, origin.x, origin.y, tileWidth) ?? stroke : stroke;
9312
+ const patFill = node.fillPattern ? patternStyle(node.fillPattern, groupScale) : void 0;
9228
9313
  switch (node.shape) {
9229
9314
  case "cell": {
9230
9315
  const pts = dctx.projector.cellPath(node.position);
9231
9316
  if (pxFill) painter.fillPoly(pts, pxFill);
9232
- if (stroke) painter.strokePoly(pts, stroke, node.strokeWidth ?? 1, true);
9317
+ if (patFill) painter.fillPoly(pts, patFill);
9318
+ if (pxStroke) painter.strokePoly(pts, pxStroke, strokePx, true);
9233
9319
  break;
9234
9320
  }
9235
9321
  case "rect": {
@@ -9240,7 +9326,8 @@ var init_DrawShape = __esm({
9240
9326
  const w = (node.width ?? 0) * tw;
9241
9327
  const h = (node.height ?? 0) * tw;
9242
9328
  if (pxFill) painter.fillRect(x, y, w, h, pxFill);
9243
- if (stroke) painter.strokeRect(x, y, w, h, stroke, node.strokeWidth ?? 1);
9329
+ if (patFill) painter.fillRect(x, y, w, h, patFill);
9330
+ if (pxStroke) painter.strokeRect(x, y, w, h, pxStroke, strokePx);
9244
9331
  break;
9245
9332
  }
9246
9333
  case "ellipse": {
@@ -9251,7 +9338,8 @@ var init_DrawShape = __esm({
9251
9338
  const rx = (node.radiusX ?? 0) * tw;
9252
9339
  const ry = (node.radiusY ?? rx) * tw;
9253
9340
  if (pxFill) painter.fillEllipse(cx, cy, rx, ry, pxFill);
9254
- if (stroke) painter.strokeEllipse(cx, cy, rx, ry, stroke, node.strokeWidth ?? 1);
9341
+ if (patFill) painter.fillEllipse(cx, cy, rx, ry, patFill);
9342
+ if (pxStroke) painter.strokeEllipse(cx, cy, rx, ry, pxStroke, strokePx);
9255
9343
  break;
9256
9344
  }
9257
9345
  case "poly": {
@@ -9260,16 +9348,27 @@ var init_DrawShape = __esm({
9260
9348
  y: origin.y + ((node.offsetY ?? 0) + pt.y) * tileWidth
9261
9349
  }));
9262
9350
  if (pxFill) painter.fillPoly(pts, pxFill);
9263
- if (stroke) painter.strokePoly(pts, stroke, node.strokeWidth ?? 1, true);
9351
+ if (patFill) painter.fillPoly(pts, patFill);
9352
+ if (pxStroke) painter.strokePoly(pts, pxStroke, strokePx, true);
9264
9353
  break;
9265
9354
  }
9266
9355
  case "path": {
9267
9356
  if (!node.d) break;
9268
9357
  painter.translate(origin.x + (node.offsetX ?? 0) * tileWidth, origin.y + (node.offsetY ?? 0) * tileWidth);
9269
9358
  painter.scale(tileWidth, tileWidth);
9359
+ if (node.strokeDash && node.strokeDash.length > 0) {
9360
+ painter.setLineDash(
9361
+ node.strokeDash.map((v) => v / (groupScale * tileWidth)),
9362
+ (node.strokeDashOffset ?? 0) / (groupScale * tileWidth)
9363
+ );
9364
+ }
9365
+ if (node.blur !== void 0 && node.blur > 0) painter.setBlur(node.blur / (groupScale * tileWidth));
9270
9366
  const localFill = node.gradient ? gradientStyle(node.gradient, 0, 0, 1) ?? fill : fill;
9367
+ const localStroke = node.strokeGradient ? gradientStyle(node.strokeGradient, 0, 0, 1) ?? stroke : stroke;
9368
+ const localPat = node.fillPattern ? patternStyle(node.fillPattern, groupScale * tileWidth) : void 0;
9271
9369
  if (localFill) painter.fillPath(node.d, localFill);
9272
- if (stroke) painter.strokePath(node.d, stroke, (node.strokeWidth ?? 1) / tileWidth);
9370
+ if (localPat) painter.fillPath(node.d, localPat);
9371
+ if (localStroke) painter.strokePath(node.d, localStroke, strokePx / tileWidth);
9273
9372
  break;
9274
9373
  }
9275
9374
  }
@@ -9350,8 +9449,6 @@ var init_DrawTextLayer = __esm({
9350
9449
  };
9351
9450
  }
9352
9451
  });
9353
-
9354
- // lib/drawable/paintDispatch.ts
9355
9452
  function paintDrawable(painter, node, dctx) {
9356
9453
  switch (node.type) {
9357
9454
  case "draw-sprite":
@@ -9372,10 +9469,20 @@ function paintDrawable(painter, node, dctx) {
9372
9469
  if (node.scale !== void 0) painter.scale(node.scale, node.scale);
9373
9470
  if (node.rotate !== void 0) painter.rotate(node.rotate);
9374
9471
  if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
9375
- for (const item of node.items) paintDrawable(painter, item, dctx);
9472
+ if (node.clip) {
9473
+ const tw = dctx.projector.tileWidth;
9474
+ painter.scale(tw, tw);
9475
+ painter.clipPath(node.clip);
9476
+ painter.scale(1 / tw, 1 / tw);
9477
+ }
9478
+ const childCtx = node.scale !== void 0 && node.scale !== 1 ? { ...dctx, groupScale: (dctx.groupScale ?? 1) * node.scale } : dctx;
9479
+ for (const item of node.items) paintDrawable(painter, item, childCtx);
9376
9480
  painter.restore();
9377
9481
  break;
9378
9482
  }
9483
+ case "draw-mesh":
9484
+ warnUnsupported2d("draw-mesh");
9485
+ break;
9379
9486
  case "draw-sprite-layer":
9380
9487
  paintSpriteLayer(painter, node, dctx);
9381
9488
  break;
@@ -9387,6 +9494,7 @@ function paintDrawable(painter, node, dctx) {
9387
9494
  break;
9388
9495
  }
9389
9496
  }
9497
+ var paint2dLog, warnedUnsupported2d, warnUnsupported2d;
9390
9498
  var init_paintDispatch = __esm({
9391
9499
  "lib/drawable/paintDispatch.ts"() {
9392
9500
  init_contract();
@@ -9396,6 +9504,13 @@ var init_paintDispatch = __esm({
9396
9504
  init_DrawSpriteLayer();
9397
9505
  init_DrawShapeLayer();
9398
9506
  init_DrawTextLayer();
9507
+ paint2dLog = createLogger("almadar:ui:drawable-2d");
9508
+ warnedUnsupported2d = /* @__PURE__ */ new Set();
9509
+ warnUnsupported2d = (kind) => {
9510
+ if (warnedUnsupported2d.has(kind)) return;
9511
+ warnedUnsupported2d.add(kind);
9512
+ paint2dLog.warn("unsupported drawable kind on the 2D painter \u2014 skipped", { kind });
9513
+ };
9399
9514
  }
9400
9515
  });
9401
9516
 
@@ -9410,6 +9525,7 @@ function collectDrawnItems(nodes) {
9410
9525
  case "draw-shape":
9411
9526
  case "draw-text":
9412
9527
  case "draw-group":
9528
+ case "draw-mesh":
9413
9529
  if (isValidScenePos(n.position)) out.push({ pos: n.position, id: n.id });
9414
9530
  break;
9415
9531
  case "draw-sprite-layer":
@@ -9480,7 +9596,7 @@ function Canvas2D({
9480
9596
  const registerChildDrawable = useCallback((node) => {
9481
9597
  childDrawablesRef.current.push(node);
9482
9598
  }, []);
9483
- const hasJsxChildren = React86.Children.count(children) > 0;
9599
+ const hasJsxChildren = React87.Children.count(children) > 0;
9484
9600
  function isDrawableLayer(node) {
9485
9601
  return node.type === "draw-sprite-layer" || node.type === "draw-shape-layer" || node.type === "draw-text-layer";
9486
9602
  }
@@ -10009,6 +10125,8 @@ function Canvas({
10009
10125
  showCoordinates,
10010
10126
  showTileInfo,
10011
10127
  fogOfWar,
10128
+ lighting,
10129
+ post,
10012
10130
  tileClickEvent,
10013
10131
  unitClickEvent,
10014
10132
  tileHoverEvent,
@@ -10020,13 +10138,29 @@ function Canvas({
10020
10138
  }) {
10021
10139
  canvasLog.debug("Canvas render", { mode, drawablesCount: drawables?.length, projection, camera: camera ? JSON.stringify(camera) : void 0 });
10022
10140
  const zoom = camera?.zoom;
10141
+ const childDrawablesRef = useRef([]);
10142
+ if (mode === "3d") childDrawablesRef.current = [];
10143
+ const registerChildDrawable = useCallback((node) => {
10144
+ childDrawablesRef.current.push(node);
10145
+ }, []);
10146
+ const [childDrawables, setChildDrawables] = useState([]);
10147
+ useEffect(() => {
10148
+ if (mode !== "3d") return;
10149
+ const next = childDrawablesRef.current;
10150
+ canvasLog.debug("children:adopt", { registered: next.length, adopted: childDrawables.length });
10151
+ if (next.length === 0 && React87.Children.count(children) > 0) return;
10152
+ setChildDrawables(
10153
+ (prev) => prev.length === next.length && JSON.stringify(prev) === JSON.stringify(next) ? prev : [...next]
10154
+ );
10155
+ });
10023
10156
  if (mode === "3d") {
10024
10157
  const props3d = {
10025
10158
  className,
10026
- drawables,
10159
+ drawables: [...drawables ?? [], ...childDrawables],
10027
10160
  isLoading,
10028
10161
  cameraMode: to3DCameraMode(camera?.mode),
10029
10162
  ...zoom !== void 0 ? { scale: zoom } : {},
10163
+ ...camera?.fov !== void 0 ? { fov: camera.fov } : {},
10030
10164
  ...camera?.target !== void 0 ? { followTarget: camera.target } : {},
10031
10165
  unitScale,
10032
10166
  backgroundColor,
@@ -10038,6 +10172,8 @@ function Canvas({
10038
10172
  showCoordinates,
10039
10173
  showTileInfo,
10040
10174
  fogOfWar,
10175
+ lighting,
10176
+ post,
10041
10177
  tileClickEvent,
10042
10178
  unitClickEvent,
10043
10179
  tileHoverEvent,
@@ -10046,7 +10182,10 @@ function Canvas({
10046
10182
  keyMap,
10047
10183
  keyUpMap
10048
10184
  };
10049
- return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(Canvas3DHost, { ...props3d }) });
10185
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
10186
+ /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(Canvas3DHost, { ...props3d }) }),
10187
+ React87.Children.count(children) > 0 && /* @__PURE__ */ jsx(DrawableRegistryContext.Provider, { value: registerChildDrawable, children: /* @__PURE__ */ jsx("div", { "aria-hidden": "true", style: { position: "absolute", width: 0, height: 0, overflow: "hidden" }, children }) })
10188
+ ] });
10050
10189
  }
10051
10190
  return /* @__PURE__ */ jsx(
10052
10191
  Canvas2D,
@@ -10078,6 +10217,7 @@ var Canvas3DHost, canvasLog;
10078
10217
  var init_Canvas = __esm({
10079
10218
  "components/game/molecules/Canvas.tsx"() {
10080
10219
  "use client";
10220
+ init_registry();
10081
10221
  init_Canvas2D();
10082
10222
  Canvas3DHost = lazy(
10083
10223
  () => import('@almadar/ui/components/molecules/game/three').then((m) => ({ default: m.Canvas3DHost }))
@@ -10469,7 +10609,7 @@ function LinearView({
10469
10609
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
10470
10610
  const isDone = i < currentIdx;
10471
10611
  const isCurrent = i === currentIdx;
10472
- return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
10612
+ return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
10473
10613
  i > 0 && /* @__PURE__ */ jsx(
10474
10614
  Typography,
10475
10615
  {
@@ -11004,7 +11144,7 @@ function SequenceBar({
11004
11144
  else onSlotRemove?.(index);
11005
11145
  }, [emit, slotRemoveEvent, onSlotRemove, playing]);
11006
11146
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
11007
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
11147
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
11008
11148
  i > 0 && /* @__PURE__ */ jsx(
11009
11149
  Typography,
11010
11150
  {
@@ -11653,7 +11793,7 @@ var init_ErrorBoundary = __esm({
11653
11793
  }
11654
11794
  );
11655
11795
  };
11656
- ErrorBoundary = class extends React86__default.Component {
11796
+ ErrorBoundary = class extends React87__default.Component {
11657
11797
  constructor(props) {
11658
11798
  super(props);
11659
11799
  __publicField(this, "reset", () => {
@@ -12305,7 +12445,7 @@ var init_Container = __esm({
12305
12445
  as: Component = "div"
12306
12446
  }) => {
12307
12447
  const resolvedSize = maxWidth ?? size ?? "lg";
12308
- return React86__default.createElement(
12448
+ return React87__default.createElement(
12309
12449
  Component,
12310
12450
  {
12311
12451
  className: cn(
@@ -15270,7 +15410,7 @@ var init_CodeBlock = __esm({
15270
15410
  DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
15271
15411
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
15272
15412
  HIDDEN_LINE_NUMBERS = { display: "none" };
15273
- CodeBlock = React86__default.memo(
15413
+ CodeBlock = React87__default.memo(
15274
15414
  ({
15275
15415
  code: rawCode,
15276
15416
  language = "text",
@@ -15858,7 +15998,7 @@ var init_MarkdownContent = __esm({
15858
15998
  init_Box();
15859
15999
  init_CodeBlock();
15860
16000
  init_cn();
15861
- MarkdownContent = React86__default.memo(
16001
+ MarkdownContent = React87__default.memo(
15862
16002
  ({ content, direction = "ltr", className }) => {
15863
16003
  const { t: _t } = useTranslate();
15864
16004
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -17185,7 +17325,7 @@ var init_StateMachineView = __esm({
17185
17325
  style: { top: title ? 30 : 0 },
17186
17326
  children: [
17187
17327
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
17188
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React86__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
17328
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React87__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
17189
17329
  StateNode2,
17190
17330
  {
17191
17331
  state,
@@ -23007,8 +23147,8 @@ var init_Menu = __esm({
23007
23147
  "bottom-end": "bottom-start"
23008
23148
  };
23009
23149
  const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
23010
- const triggerChild = React86__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
23011
- const triggerElement = React86__default.cloneElement(
23150
+ const triggerChild = React87__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
23151
+ const triggerElement = React87__default.cloneElement(
23012
23152
  triggerChild,
23013
23153
  {
23014
23154
  ref: triggerRef,
@@ -23103,14 +23243,14 @@ function useDataDnd(args) {
23103
23243
  const isZone = Boolean(dragGroup || accepts || sortable);
23104
23244
  const enabled = isZone || Boolean(dndRoot);
23105
23245
  const eventBus = useEventBus();
23106
- const parentRoot = React86__default.useContext(RootCtx);
23246
+ const parentRoot = React87__default.useContext(RootCtx);
23107
23247
  const isRoot = enabled && parentRoot === null;
23108
- const zoneId = React86__default.useId();
23248
+ const zoneId = React87__default.useId();
23109
23249
  const ownGroup = dragGroup ?? accepts ?? zoneId;
23110
- const [optimisticOrders, setOptimisticOrders] = React86__default.useState(() => /* @__PURE__ */ new Map());
23111
- const optimisticOrdersRef = React86__default.useRef(optimisticOrders);
23250
+ const [optimisticOrders, setOptimisticOrders] = React87__default.useState(() => /* @__PURE__ */ new Map());
23251
+ const optimisticOrdersRef = React87__default.useRef(optimisticOrders);
23112
23252
  optimisticOrdersRef.current = optimisticOrders;
23113
- const clearOptimisticOrder = React86__default.useCallback((group) => {
23253
+ const clearOptimisticOrder = React87__default.useCallback((group) => {
23114
23254
  setOptimisticOrders((prev) => {
23115
23255
  if (!prev.has(group)) return prev;
23116
23256
  const next = new Map(prev);
@@ -23135,7 +23275,7 @@ function useDataDnd(args) {
23135
23275
  const raw = it[dndItemIdField];
23136
23276
  return raw != null ? String(raw) : `__idx_${idx}`;
23137
23277
  }).join("|");
23138
- const itemIds = React86__default.useMemo(
23278
+ const itemIds = React87__default.useMemo(
23139
23279
  () => orderedItems.map((it, idx) => {
23140
23280
  const raw = it[dndItemIdField];
23141
23281
  return raw != null ? String(raw) : `__idx_${idx}`;
@@ -23146,7 +23286,7 @@ function useDataDnd(args) {
23146
23286
  const raw = it[dndItemIdField];
23147
23287
  return raw != null ? String(raw) : `__${idx}`;
23148
23288
  }).join("|");
23149
- React86__default.useEffect(() => {
23289
+ React87__default.useEffect(() => {
23150
23290
  const root = isRoot ? null : parentRoot;
23151
23291
  if (root) {
23152
23292
  root.clearOptimisticOrder(ownGroup);
@@ -23154,20 +23294,20 @@ function useDataDnd(args) {
23154
23294
  clearOptimisticOrder(ownGroup);
23155
23295
  }
23156
23296
  }, [itemsContentSig, ownGroup]);
23157
- const zonesRef = React86__default.useRef(/* @__PURE__ */ new Map());
23158
- const registerZone = React86__default.useCallback((zoneId2, meta2) => {
23297
+ const zonesRef = React87__default.useRef(/* @__PURE__ */ new Map());
23298
+ const registerZone = React87__default.useCallback((zoneId2, meta2) => {
23159
23299
  zonesRef.current.set(zoneId2, meta2);
23160
23300
  }, []);
23161
- const unregisterZone = React86__default.useCallback((zoneId2) => {
23301
+ const unregisterZone = React87__default.useCallback((zoneId2) => {
23162
23302
  zonesRef.current.delete(zoneId2);
23163
23303
  }, []);
23164
- const [activeDrag, setActiveDrag] = React86__default.useState(null);
23165
- const [overZoneGroup, setOverZoneGroup] = React86__default.useState(null);
23166
- const meta = React86__default.useMemo(
23304
+ const [activeDrag, setActiveDrag] = React87__default.useState(null);
23305
+ const [overZoneGroup, setOverZoneGroup] = React87__default.useState(null);
23306
+ const meta = React87__default.useMemo(
23167
23307
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
23168
23308
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
23169
23309
  );
23170
- React86__default.useEffect(() => {
23310
+ React87__default.useEffect(() => {
23171
23311
  const target = isRoot ? null : parentRoot;
23172
23312
  if (!target) {
23173
23313
  zonesRef.current.set(zoneId, meta);
@@ -23186,7 +23326,7 @@ function useDataDnd(args) {
23186
23326
  }, [parentRoot, isRoot, zoneId, meta]);
23187
23327
  const sensors = useAlmadarDndSensors(true);
23188
23328
  const collisionDetection = almadarDndCollisionDetection;
23189
- const findZoneByItem = React86__default.useCallback(
23329
+ const findZoneByItem = React87__default.useCallback(
23190
23330
  (id) => {
23191
23331
  for (const z of zonesRef.current.values()) {
23192
23332
  if (z.itemIds.includes(id)) return z;
@@ -23195,7 +23335,7 @@ function useDataDnd(args) {
23195
23335
  },
23196
23336
  []
23197
23337
  );
23198
- React86__default.useCallback(
23338
+ React87__default.useCallback(
23199
23339
  (group) => {
23200
23340
  for (const z of zonesRef.current.values()) {
23201
23341
  if (z.group === group) return z;
@@ -23204,7 +23344,7 @@ function useDataDnd(args) {
23204
23344
  },
23205
23345
  []
23206
23346
  );
23207
- const handleDragEnd = React86__default.useCallback(
23347
+ const handleDragEnd = React87__default.useCallback(
23208
23348
  (event) => {
23209
23349
  const { active, over } = event;
23210
23350
  const activeIdStr = String(active.id);
@@ -23295,8 +23435,8 @@ function useDataDnd(args) {
23295
23435
  },
23296
23436
  [eventBus]
23297
23437
  );
23298
- const sortableData = React86__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
23299
- const SortableItem = React86__default.useCallback(
23438
+ const sortableData = React87__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
23439
+ const SortableItem = React87__default.useCallback(
23300
23440
  ({ id, children }) => {
23301
23441
  const {
23302
23442
  attributes,
@@ -23336,7 +23476,7 @@ function useDataDnd(args) {
23336
23476
  id: droppableId,
23337
23477
  data: sortableData
23338
23478
  });
23339
- const ctx = React86__default.useContext(RootCtx);
23479
+ const ctx = React87__default.useContext(RootCtx);
23340
23480
  const activeDrag2 = ctx?.activeDrag ?? null;
23341
23481
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
23342
23482
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -23351,7 +23491,7 @@ function useDataDnd(args) {
23351
23491
  showForeignPlaceholder,
23352
23492
  ctxAvailable: ctx != null
23353
23493
  });
23354
- React86__default.useEffect(() => {
23494
+ React87__default.useEffect(() => {
23355
23495
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
23356
23496
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
23357
23497
  return /* @__PURE__ */ jsx(
@@ -23365,11 +23505,11 @@ function useDataDnd(args) {
23365
23505
  }
23366
23506
  );
23367
23507
  };
23368
- const rootContextValue = React86__default.useMemo(
23508
+ const rootContextValue = React87__default.useMemo(
23369
23509
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
23370
23510
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
23371
23511
  );
23372
- const handleDragStart = React86__default.useCallback((event) => {
23512
+ const handleDragStart = React87__default.useCallback((event) => {
23373
23513
  const sourceZone = findZoneByItem(event.active.id);
23374
23514
  const rect = event.active.rect.current.initial;
23375
23515
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -23388,7 +23528,7 @@ function useDataDnd(args) {
23388
23528
  isRoot
23389
23529
  });
23390
23530
  }, [findZoneByItem, isRoot, zoneId]);
23391
- const handleDragOver = React86__default.useCallback((event) => {
23531
+ const handleDragOver = React87__default.useCallback((event) => {
23392
23532
  const { active, over } = event;
23393
23533
  const overData = over?.data?.current;
23394
23534
  const overGroup = overData?.dndGroup ?? null;
@@ -23458,7 +23598,7 @@ function useDataDnd(args) {
23458
23598
  return next;
23459
23599
  });
23460
23600
  }, []);
23461
- const handleDragCancel = React86__default.useCallback((event) => {
23601
+ const handleDragCancel = React87__default.useCallback((event) => {
23462
23602
  setActiveDrag(null);
23463
23603
  setOverZoneGroup(null);
23464
23604
  dndLog.warn("dragCancel", {
@@ -23466,12 +23606,12 @@ function useDataDnd(args) {
23466
23606
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
23467
23607
  });
23468
23608
  }, []);
23469
- const handleDragEndWithCleanup = React86__default.useCallback((event) => {
23609
+ const handleDragEndWithCleanup = React87__default.useCallback((event) => {
23470
23610
  handleDragEnd(event);
23471
23611
  setActiveDrag(null);
23472
23612
  setOverZoneGroup(null);
23473
23613
  }, [handleDragEnd]);
23474
- const wrapContainer = React86__default.useCallback(
23614
+ const wrapContainer = React87__default.useCallback(
23475
23615
  (children) => {
23476
23616
  if (!enabled) return children;
23477
23617
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -23525,7 +23665,7 @@ var init_useDataDnd = __esm({
23525
23665
  init_useAlmadarDndCollision();
23526
23666
  init_Box();
23527
23667
  dndLog = createLogger("almadar:ui:dnd");
23528
- RootCtx = React86__default.createContext(null);
23668
+ RootCtx = React87__default.createContext(null);
23529
23669
  }
23530
23670
  });
23531
23671
  function renderIconInput(icon, props) {
@@ -24067,7 +24207,7 @@ function DataList({
24067
24207
  }) {
24068
24208
  const eventBus = useEventBus();
24069
24209
  const { t } = useTranslate();
24070
- const [visibleCount, setVisibleCount] = React86__default.useState(pageSize || Infinity);
24210
+ const [visibleCount, setVisibleCount] = React87__default.useState(pageSize || Infinity);
24071
24211
  const fieldDefs = fields ?? columns ?? [];
24072
24212
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
24073
24213
  const dnd = useDataDnd({
@@ -24083,14 +24223,14 @@ function DataList({
24083
24223
  dndRoot
24084
24224
  });
24085
24225
  const orderedData = dnd.orderedItems;
24086
- const allData = React86__default.useMemo(
24226
+ const allData = React87__default.useMemo(
24087
24227
  () => sortRows(orderedData, sortBy, sortDirection),
24088
24228
  [orderedData, sortBy, sortDirection]
24089
24229
  );
24090
24230
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
24091
24231
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
24092
24232
  const hasRenderProp = typeof children === "function";
24093
- React86__default.useEffect(() => {
24233
+ React87__default.useEffect(() => {
24094
24234
  const renderItemTypeOf = typeof schemaRenderItem;
24095
24235
  const childrenTypeOf = typeof children;
24096
24236
  if (data.length > 0 && !hasRenderProp) {
@@ -24205,7 +24345,7 @@ function DataList({
24205
24345
  return v === void 0 || v === null || v === "" ? raw : String(v);
24206
24346
  };
24207
24347
  return /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: cn("py-2", className), children: [
24208
- groups2.map((group, gi) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
24348
+ groups2.map((group, gi) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
24209
24349
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
24210
24350
  group.items.map((itemData, index) => {
24211
24351
  const id = itemData.id || `${gi}-${index}`;
@@ -24404,7 +24544,7 @@ function DataList({
24404
24544
  className
24405
24545
  ),
24406
24546
  children: [
24407
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
24547
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
24408
24548
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
24409
24549
  group.items.map(
24410
24550
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -24491,7 +24631,7 @@ var init_FormSection = __esm({
24491
24631
  columns = 1,
24492
24632
  className
24493
24633
  }) => {
24494
- const [collapsed, setCollapsed] = React86__default.useState(defaultCollapsed);
24634
+ const [collapsed, setCollapsed] = React87__default.useState(defaultCollapsed);
24495
24635
  const { t } = useTranslate();
24496
24636
  const eventBus = useEventBus();
24497
24637
  const gridClass = {
@@ -24499,7 +24639,7 @@ var init_FormSection = __esm({
24499
24639
  2: "grid-cols-1 md:grid-cols-2",
24500
24640
  3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
24501
24641
  }[columns];
24502
- React86__default.useCallback(() => {
24642
+ React87__default.useCallback(() => {
24503
24643
  if (collapsible) {
24504
24644
  setCollapsed((prev) => !prev);
24505
24645
  eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
@@ -25544,7 +25684,7 @@ var init_Flex = __esm({
25544
25684
  flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
25545
25685
  }
25546
25686
  }
25547
- return React86__default.createElement(Component, {
25687
+ return React87__default.createElement(Component, {
25548
25688
  className: cn(
25549
25689
  inline ? "inline-flex" : "flex",
25550
25690
  directionStyles[direction],
@@ -25663,7 +25803,7 @@ var init_Grid = __esm({
25663
25803
  as: Component = "div"
25664
25804
  }) => {
25665
25805
  const mergedStyle = rows ? { gridTemplateRows: `repeat(${rows}, minmax(0, 1fr))`, ...style } : style;
25666
- return React86__default.createElement(
25806
+ return React87__default.createElement(
25667
25807
  Component,
25668
25808
  {
25669
25809
  className: cn(
@@ -25895,9 +26035,9 @@ var init_Popover = __esm({
25895
26035
  onMouseLeave: handleClose,
25896
26036
  onPointerDown: tapTriggerProps.onPointerDown
25897
26037
  };
25898
- const childElement = React86__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
26038
+ const childElement = React87__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
25899
26039
  const childPointerDown = childElement.props.onPointerDown;
25900
- const triggerElement = React86__default.cloneElement(
26040
+ const triggerElement = React87__default.cloneElement(
25901
26041
  childElement,
25902
26042
  {
25903
26043
  ref: triggerRef,
@@ -26506,9 +26646,9 @@ var init_Tooltip = __esm({
26506
26646
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
26507
26647
  };
26508
26648
  }, []);
26509
- const triggerElement = React86__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
26649
+ const triggerElement = React87__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
26510
26650
  const childPointerDown = triggerElement.props.onPointerDown;
26511
- const trigger = React86__default.cloneElement(triggerElement, {
26651
+ const trigger = React87__default.cloneElement(triggerElement, {
26512
26652
  ref: triggerRef,
26513
26653
  onMouseEnter: handleMouseEnter,
26514
26654
  onMouseLeave: handleMouseLeave,
@@ -26598,7 +26738,7 @@ var init_WizardProgress = __esm({
26598
26738
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
26599
26739
  const isActive = index === currentStep;
26600
26740
  const isCompleted = index < currentStep;
26601
- return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
26741
+ return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
26602
26742
  /* @__PURE__ */ jsx(
26603
26743
  "button",
26604
26744
  {
@@ -28233,13 +28373,13 @@ var init_MapView = __esm({
28233
28373
  shadowSize: [41, 41]
28234
28374
  });
28235
28375
  L.Marker.prototype.options.icon = defaultIcon;
28236
- const { useEffect: useEffect62, useRef: useRef61, useCallback: useCallback95, useState: useState93 } = React86__default;
28376
+ const { useEffect: useEffect63, useRef: useRef62, useCallback: useCallback96, useState: useState94 } = React87__default;
28237
28377
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
28238
28378
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
28239
28379
  function MapUpdater({ centerLat, centerLng, zoom }) {
28240
28380
  const map = useMap();
28241
- const prevRef = useRef61({ centerLat, centerLng, zoom });
28242
- useEffect62(() => {
28381
+ const prevRef = useRef62({ centerLat, centerLng, zoom });
28382
+ useEffect63(() => {
28243
28383
  const prev = prevRef.current;
28244
28384
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
28245
28385
  map.setView([centerLat, centerLng], zoom);
@@ -28250,7 +28390,7 @@ var init_MapView = __esm({
28250
28390
  }
28251
28391
  function MapClickHandler({ onMapClick }) {
28252
28392
  const map = useMap();
28253
- useEffect62(() => {
28393
+ useEffect63(() => {
28254
28394
  if (!onMapClick) return;
28255
28395
  const handler = (e) => {
28256
28396
  onMapClick(e.latlng.lat, e.latlng.lng);
@@ -28278,8 +28418,8 @@ var init_MapView = __esm({
28278
28418
  showAttribution = true
28279
28419
  }) {
28280
28420
  const eventBus = useEventBus2();
28281
- const [clickedPosition, setClickedPosition] = useState93(null);
28282
- const handleMapClick = useCallback95((lat, lng) => {
28421
+ const [clickedPosition, setClickedPosition] = useState94(null);
28422
+ const handleMapClick = useCallback96((lat, lng) => {
28283
28423
  if (showClickedPin) {
28284
28424
  setClickedPosition({ lat, lng });
28285
28425
  }
@@ -28288,7 +28428,7 @@ var init_MapView = __esm({
28288
28428
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
28289
28429
  }
28290
28430
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
28291
- const handleMarkerClick = useCallback95((marker) => {
28431
+ const handleMarkerClick = useCallback96((marker) => {
28292
28432
  onMarkerClick?.(marker);
28293
28433
  if (markerClickEvent) {
28294
28434
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -29151,8 +29291,8 @@ function TableView({
29151
29291
  }) {
29152
29292
  const eventBus = useEventBus();
29153
29293
  const { t } = useTranslate();
29154
- const [visibleCount, setVisibleCount] = React86__default.useState(pageSize > 0 ? pageSize : Infinity);
29155
- const [localSelected, setLocalSelected] = React86__default.useState(/* @__PURE__ */ new Set());
29294
+ const [visibleCount, setVisibleCount] = React87__default.useState(pageSize > 0 ? pageSize : Infinity);
29295
+ const [localSelected, setLocalSelected] = React87__default.useState(/* @__PURE__ */ new Set());
29156
29296
  const colDefs = (Array.isArray(columns) ? columns : void 0) ?? (Array.isArray(fields) ? fields : void 0) ?? [];
29157
29297
  const actionDefs = Array.isArray(itemActions) ? itemActions : [];
29158
29298
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
@@ -29174,7 +29314,7 @@ function TableView({
29174
29314
  const hasRenderProp = typeof children === "function";
29175
29315
  const idField = dndItemIdField ?? "id";
29176
29316
  const isCoarsePointer = useMediaQuery("(pointer: coarse)");
29177
- React86__default.useEffect(() => {
29317
+ React87__default.useEffect(() => {
29178
29318
  tableViewLog.debug("render", {
29179
29319
  rowCount: data.length,
29180
29320
  colCount: colDefs.length,
@@ -29231,7 +29371,7 @@ function TableView({
29231
29371
  };
29232
29372
  eventBus.emit(`UI:${itemClickEvent}`, payload);
29233
29373
  };
29234
- const colFloors = React86__default.useMemo(
29374
+ const colFloors = React87__default.useMemo(
29235
29375
  () => colDefs.map((col) => {
29236
29376
  const longest = data.reduce((widest, row) => {
29237
29377
  const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
@@ -29393,12 +29533,12 @@ function TableView({
29393
29533
  ]
29394
29534
  }
29395
29535
  );
29396
- return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React86__default.Fragment, { children: rowInner }, id);
29536
+ return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React87__default.Fragment, { children: rowInner }, id);
29397
29537
  };
29398
29538
  const items = Array.from(data);
29399
29539
  const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
29400
29540
  let runningIndex = 0;
29401
- const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
29541
+ const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
29402
29542
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
29403
29543
  group.items.map((row) => renderRow(row, runningIndex++))
29404
29544
  ] }, gi)) });
@@ -30761,7 +30901,7 @@ var init_StepFlow = __esm({
30761
30901
  className
30762
30902
  }) => {
30763
30903
  if (orientation === "vertical") {
30764
- return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React86__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
30904
+ return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React87__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
30765
30905
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
30766
30906
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
30767
30907
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -30772,7 +30912,7 @@ var init_StepFlow = __esm({
30772
30912
  ] })
30773
30913
  ] }) }, index)) });
30774
30914
  }
30775
- 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(React86__default.Fragment, { children: [
30915
+ return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
30776
30916
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
30777
30917
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
30778
30918
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -31762,7 +31902,7 @@ var init_LikertScale = __esm({
31762
31902
  md: "text-base",
31763
31903
  lg: "text-lg"
31764
31904
  };
31765
- LikertScale = React86__default.forwardRef(
31905
+ LikertScale = React87__default.forwardRef(
31766
31906
  ({
31767
31907
  question,
31768
31908
  options = DEFAULT_LIKERT_OPTIONS,
@@ -31774,7 +31914,7 @@ var init_LikertScale = __esm({
31774
31914
  variant = "radios",
31775
31915
  className
31776
31916
  }, ref) => {
31777
- const groupId = React86__default.useId();
31917
+ const groupId = React87__default.useId();
31778
31918
  const eventBus = useEventBus();
31779
31919
  const handleSelect = useCallback(
31780
31920
  (next) => {
@@ -34063,7 +34203,7 @@ var init_DocBreadcrumb = __esm({
34063
34203
  "aria-label": t("aria.breadcrumb"),
34064
34204
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
34065
34205
  const isLast = idx === items.length - 1;
34066
- return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
34206
+ return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
34067
34207
  idx > 0 && /* @__PURE__ */ jsx(
34068
34208
  Icon,
34069
34209
  {
@@ -34932,7 +35072,7 @@ var init_MiniStateMachine = __esm({
34932
35072
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
34933
35073
  const tc = transitionCounts[s.name] ?? 0;
34934
35074
  const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
34935
- return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
35075
+ return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
34936
35076
  /* @__PURE__ */ jsx(
34937
35077
  AvlState,
34938
35078
  {
@@ -35136,7 +35276,7 @@ var init_PageHeader = __esm({
35136
35276
  info: "bg-info/10 text-info"
35137
35277
  };
35138
35278
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
35139
- 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(React86__default.Fragment, { children: [
35279
+ breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
35140
35280
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
35141
35281
  crumb.href ? /* @__PURE__ */ jsx(
35142
35282
  "a",
@@ -35494,7 +35634,7 @@ var init_Section = __esm({
35494
35634
  as: Component = "section"
35495
35635
  }) => {
35496
35636
  const hasHeader = title || description || action;
35497
- return React86__default.createElement(
35637
+ return React87__default.createElement(
35498
35638
  Component,
35499
35639
  {
35500
35640
  className: cn(
@@ -35868,7 +36008,7 @@ var init_WizardContainer = __esm({
35868
36008
  const isCompleted = index < currentStep;
35869
36009
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
35870
36010
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
35871
- return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
36011
+ return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
35872
36012
  /* @__PURE__ */ jsx(
35873
36013
  Button,
35874
36014
  {
@@ -37655,7 +37795,7 @@ var init_ImportPreviewTree = __esm({
37655
37795
  const renderUnit = (unit, childrenByParent, depth) => {
37656
37796
  const summary = fieldSummary(unit);
37657
37797
  const children = childrenByParent.get(unit.ref) ?? [];
37658
- return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
37798
+ return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
37659
37799
  /* @__PURE__ */ jsxs(
37660
37800
  Box,
37661
37801
  {
@@ -37752,7 +37892,7 @@ var init_ImportProgress = __esm({
37752
37892
  PIPELINE.map((key, index) => {
37753
37893
  const isComplete = index < currentIndex;
37754
37894
  const isActive = index === currentIndex;
37755
- return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
37895
+ return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
37756
37896
  index > 0 ? /* @__PURE__ */ jsx(Box, { className: "h-px w-4 bg-border" }) : null,
37757
37897
  /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", "data-testid": `import-progress-step-${key}`, children: [
37758
37898
  /* @__PURE__ */ jsx(
@@ -38854,18 +38994,30 @@ var init_DetailPanel = __esm({
38854
38994
  DetailPanel.displayName = "DetailPanel";
38855
38995
  }
38856
38996
  });
38857
-
38858
- // components/game/atoms/DrawGroup.tsx
38859
- function DrawGroup(_props) {
38997
+ function DrawGroup(props) {
38998
+ const register = useContext(DrawableRegistryContext);
38999
+ if (register) register({ ...props, type: "draw-group" });
38860
39000
  return null;
38861
39001
  }
38862
39002
  var init_DrawGroup = __esm({
38863
39003
  "components/game/atoms/DrawGroup.tsx"() {
38864
39004
  "use client";
39005
+ init_registry();
39006
+ }
39007
+ });
39008
+ function DrawMesh(props) {
39009
+ const register = useContext(DrawableRegistryContext);
39010
+ if (register) register({ ...props, type: "draw-mesh" });
39011
+ return null;
39012
+ }
39013
+ var init_DrawMesh = __esm({
39014
+ "components/game/atoms/DrawMesh.tsx"() {
39015
+ "use client";
39016
+ init_registry();
38865
39017
  }
38866
39018
  });
38867
39019
  function extractTitle(children) {
38868
- if (!React86__default.isValidElement(children)) return void 0;
39020
+ if (!React87__default.isValidElement(children)) return void 0;
38869
39021
  const props = children.props;
38870
39022
  if (typeof props.title === "string") {
38871
39023
  return props.title;
@@ -39215,12 +39367,12 @@ var init_Form = __esm({
39215
39367
  const isSchemaEntity = isOrbitalEntitySchema(entity);
39216
39368
  const resolvedEntity = isSchemaEntity ? entity : void 0;
39217
39369
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
39218
- const normalizedInitialData = React86__default.useMemo(() => {
39370
+ const normalizedInitialData = React87__default.useMemo(() => {
39219
39371
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
39220
39372
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
39221
39373
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
39222
39374
  }, [entity, initialData]);
39223
- const entityDerivedFields = React86__default.useMemo(() => {
39375
+ const entityDerivedFields = React87__default.useMemo(() => {
39224
39376
  if (fields && fields.length > 0) return void 0;
39225
39377
  if (!resolvedEntity) return void 0;
39226
39378
  return resolvedEntity.fields.map(
@@ -39241,16 +39393,16 @@ var init_Form = __esm({
39241
39393
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
39242
39394
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
39243
39395
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
39244
- const [formData, setFormData] = React86__default.useState(
39396
+ const [formData, setFormData] = React87__default.useState(
39245
39397
  normalizedInitialData
39246
39398
  );
39247
- const [collapsedSections, setCollapsedSections] = React86__default.useState(
39399
+ const [collapsedSections, setCollapsedSections] = React87__default.useState(
39248
39400
  /* @__PURE__ */ new Set()
39249
39401
  );
39250
- const [submitError, setSubmitError] = React86__default.useState(null);
39251
- const formRef = React86__default.useRef(null);
39402
+ const [submitError, setSubmitError] = React87__default.useState(null);
39403
+ const formRef = React87__default.useRef(null);
39252
39404
  const formMode = props.mode;
39253
- const mountedRef = React86__default.useRef(false);
39405
+ const mountedRef = React87__default.useRef(false);
39254
39406
  if (!mountedRef.current) {
39255
39407
  mountedRef.current = true;
39256
39408
  debug("forms", "mount", {
@@ -39263,7 +39415,7 @@ var init_Form = __esm({
39263
39415
  });
39264
39416
  }
39265
39417
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
39266
- const evalContext = React86__default.useMemo(
39418
+ const evalContext = React87__default.useMemo(
39267
39419
  () => ({
39268
39420
  formValues: formData,
39269
39421
  globalVariables: externalContext?.globalVariables ?? {},
@@ -39272,7 +39424,7 @@ var init_Form = __esm({
39272
39424
  }),
39273
39425
  [formData, externalContext]
39274
39426
  );
39275
- React86__default.useEffect(() => {
39427
+ React87__default.useEffect(() => {
39276
39428
  debug("forms", "initialData-sync", {
39277
39429
  mode: formMode,
39278
39430
  normalizedInitialData,
@@ -39283,7 +39435,7 @@ var init_Form = __esm({
39283
39435
  setFormData(normalizedInitialData);
39284
39436
  }
39285
39437
  }, [normalizedInitialData]);
39286
- const processCalculations = React86__default.useCallback(
39438
+ const processCalculations = React87__default.useCallback(
39287
39439
  (changedFieldId, newFormData) => {
39288
39440
  if (!hiddenCalculations.length) return;
39289
39441
  const context = {
@@ -39308,7 +39460,7 @@ var init_Form = __esm({
39308
39460
  },
39309
39461
  [hiddenCalculations, externalContext, eventBus]
39310
39462
  );
39311
- const checkViolations = React86__default.useCallback(
39463
+ const checkViolations = React87__default.useCallback(
39312
39464
  (changedFieldId, newFormData) => {
39313
39465
  if (!violationTriggers.length) return;
39314
39466
  const context = {
@@ -39346,7 +39498,7 @@ var init_Form = __esm({
39346
39498
  processCalculations(name, newFormData);
39347
39499
  checkViolations(name, newFormData);
39348
39500
  };
39349
- const isFieldVisible = React86__default.useCallback(
39501
+ const isFieldVisible = React87__default.useCallback(
39350
39502
  (fieldName) => {
39351
39503
  const condition = conditionalFields[fieldName];
39352
39504
  if (!condition) return true;
@@ -39354,7 +39506,7 @@ var init_Form = __esm({
39354
39506
  },
39355
39507
  [conditionalFields, evalContext]
39356
39508
  );
39357
- const isSectionVisible = React86__default.useCallback(
39509
+ const isSectionVisible = React87__default.useCallback(
39358
39510
  (section) => {
39359
39511
  if (!section.condition) return true;
39360
39512
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -39430,7 +39582,7 @@ var init_Form = __esm({
39430
39582
  eventBus.emit(`UI:${onCancel}`);
39431
39583
  }
39432
39584
  };
39433
- const renderField = React86__default.useCallback(
39585
+ const renderField = React87__default.useCallback(
39434
39586
  (field) => {
39435
39587
  const fieldName = field.name || field.field;
39436
39588
  if (!fieldName) return null;
@@ -39451,7 +39603,7 @@ var init_Form = __esm({
39451
39603
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
39452
39604
  );
39453
39605
  const effectiveFields = entityDerivedFields ?? fields;
39454
- const normalizedFields = React86__default.useMemo(() => {
39606
+ const normalizedFields = React87__default.useMemo(() => {
39455
39607
  if (!effectiveFields || effectiveFields.length === 0) return [];
39456
39608
  return effectiveFields.map((field) => {
39457
39609
  if (typeof field === "string") {
@@ -39475,7 +39627,7 @@ var init_Form = __esm({
39475
39627
  return field;
39476
39628
  });
39477
39629
  }, [effectiveFields, resolvedEntity]);
39478
- const schemaFields = React86__default.useMemo(() => {
39630
+ const schemaFields = React87__default.useMemo(() => {
39479
39631
  if (normalizedFields.length === 0) return null;
39480
39632
  if (isDebugEnabled()) {
39481
39633
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -39485,7 +39637,7 @@ var init_Form = __esm({
39485
39637
  }
39486
39638
  return normalizedFields.map(renderField).filter(Boolean);
39487
39639
  }, [normalizedFields, renderField, entityName, conditionalFields]);
39488
- const sectionElements = React86__default.useMemo(() => {
39640
+ const sectionElements = React87__default.useMemo(() => {
39489
39641
  if (!sections || sections.length === 0) return null;
39490
39642
  return sections.map((section) => {
39491
39643
  if (!isSectionVisible(section)) {
@@ -40211,7 +40363,7 @@ var init_List = __esm({
40211
40363
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
40212
40364
  return [];
40213
40365
  }, [entity]);
40214
- const getItemActions = React86__default.useCallback(
40366
+ const getItemActions = React87__default.useCallback(
40215
40367
  (item) => {
40216
40368
  if (!itemActions) return [];
40217
40369
  if (typeof itemActions === "function") {
@@ -40692,7 +40844,7 @@ var init_MediaGallery = __esm({
40692
40844
  [selectable, selectedItems, selectionEvent, eventBus]
40693
40845
  );
40694
40846
  const entityData = Array.isArray(entity) ? entity : [];
40695
- const items = React86__default.useMemo(() => {
40847
+ const items = React87__default.useMemo(() => {
40696
40848
  if (propItems && propItems.length > 0) return propItems;
40697
40849
  if (entityData.length === 0) return [];
40698
40850
  return entityData.map((record, idx) => {
@@ -40857,7 +41009,7 @@ var init_MediaGallery = __esm({
40857
41009
  }
40858
41010
  });
40859
41011
  function extractTitle2(children) {
40860
- if (!React86__default.isValidElement(children)) return void 0;
41012
+ if (!React87__default.isValidElement(children)) return void 0;
40861
41013
  const props = children.props;
40862
41014
  if (typeof props.title === "string") {
40863
41015
  return props.title;
@@ -41112,7 +41264,7 @@ var init_debugRegistry = __esm({
41112
41264
  }
41113
41265
  });
41114
41266
  function useDebugData() {
41115
- const [data, setData] = React86.useState(() => ({
41267
+ const [data, setData] = React87.useState(() => ({
41116
41268
  traits: [],
41117
41269
  ticks: [],
41118
41270
  guards: [],
@@ -41126,7 +41278,7 @@ function useDebugData() {
41126
41278
  },
41127
41279
  lastUpdate: Date.now()
41128
41280
  }));
41129
- React86.useEffect(() => {
41281
+ React87.useEffect(() => {
41130
41282
  const updateData = () => {
41131
41283
  setData({
41132
41284
  traits: getAllTraits(),
@@ -41235,12 +41387,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
41235
41387
  return positions;
41236
41388
  }
41237
41389
  function WalkMinimap() {
41238
- const [walkStep, setWalkStep] = React86.useState(null);
41239
- const [traits2, setTraits] = React86.useState([]);
41240
- const [coveredEdges, setCoveredEdges] = React86.useState([]);
41241
- const [completedTraits, setCompletedTraits] = React86.useState(/* @__PURE__ */ new Set());
41242
- const prevTraitRef = React86.useRef(null);
41243
- React86.useEffect(() => {
41390
+ const [walkStep, setWalkStep] = React87.useState(null);
41391
+ const [traits2, setTraits] = React87.useState([]);
41392
+ const [coveredEdges, setCoveredEdges] = React87.useState([]);
41393
+ const [completedTraits, setCompletedTraits] = React87.useState(/* @__PURE__ */ new Set());
41394
+ const prevTraitRef = React87.useRef(null);
41395
+ React87.useEffect(() => {
41244
41396
  const interval = setInterval(() => {
41245
41397
  const w = window;
41246
41398
  const step = w.__orbitalWalkStep;
@@ -41676,15 +41828,15 @@ var init_EntitiesTab = __esm({
41676
41828
  });
41677
41829
  function EventFlowTab({ events: events2 }) {
41678
41830
  const { t } = useTranslate();
41679
- const [filter, setFilter] = React86.useState("all");
41680
- const containerRef = React86.useRef(null);
41681
- const [autoScroll, setAutoScroll] = React86.useState(true);
41682
- React86.useEffect(() => {
41831
+ const [filter, setFilter] = React87.useState("all");
41832
+ const containerRef = React87.useRef(null);
41833
+ const [autoScroll, setAutoScroll] = React87.useState(true);
41834
+ React87.useEffect(() => {
41683
41835
  if (autoScroll && containerRef.current) {
41684
41836
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
41685
41837
  }
41686
41838
  }, [events2.length, autoScroll]);
41687
- const filteredEvents = React86.useMemo(() => {
41839
+ const filteredEvents = React87.useMemo(() => {
41688
41840
  if (filter === "all") return events2;
41689
41841
  return events2.filter((e) => e.type === filter);
41690
41842
  }, [events2, filter]);
@@ -41800,7 +41952,7 @@ var init_EventFlowTab = __esm({
41800
41952
  });
41801
41953
  function GuardsPanel({ guards }) {
41802
41954
  const { t } = useTranslate();
41803
- const [filter, setFilter] = React86.useState("all");
41955
+ const [filter, setFilter] = React87.useState("all");
41804
41956
  if (guards.length === 0) {
41805
41957
  return /* @__PURE__ */ jsx(
41806
41958
  EmptyState,
@@ -41813,7 +41965,7 @@ function GuardsPanel({ guards }) {
41813
41965
  }
41814
41966
  const passedCount = guards.filter((g) => g.result).length;
41815
41967
  const failedCount = guards.length - passedCount;
41816
- const filteredGuards = React86.useMemo(() => {
41968
+ const filteredGuards = React87.useMemo(() => {
41817
41969
  if (filter === "all") return guards;
41818
41970
  if (filter === "passed") return guards.filter((g) => g.result);
41819
41971
  return guards.filter((g) => !g.result);
@@ -41976,10 +42128,10 @@ function EffectBadge({ effect }) {
41976
42128
  }
41977
42129
  function TransitionTimeline({ transitions }) {
41978
42130
  const { t } = useTranslate();
41979
- const containerRef = React86.useRef(null);
41980
- const [autoScroll, setAutoScroll] = React86.useState(true);
41981
- const [expandedId, setExpandedId] = React86.useState(null);
41982
- React86.useEffect(() => {
42131
+ const containerRef = React87.useRef(null);
42132
+ const [autoScroll, setAutoScroll] = React87.useState(true);
42133
+ const [expandedId, setExpandedId] = React87.useState(null);
42134
+ React87.useEffect(() => {
41983
42135
  if (autoScroll && containerRef.current) {
41984
42136
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
41985
42137
  }
@@ -42259,9 +42411,9 @@ function getAllEvents(traits2) {
42259
42411
  function EventDispatcherTab({ traits: traits2, schema }) {
42260
42412
  const eventBus = useEventBus();
42261
42413
  const { t } = useTranslate();
42262
- const [log13, setLog] = React86.useState([]);
42263
- const prevStatesRef = React86.useRef(/* @__PURE__ */ new Map());
42264
- React86.useEffect(() => {
42414
+ const [log13, setLog] = React87.useState([]);
42415
+ const prevStatesRef = React87.useRef(/* @__PURE__ */ new Map());
42416
+ React87.useEffect(() => {
42265
42417
  for (const trait of traits2) {
42266
42418
  const prev = prevStatesRef.current.get(trait.id);
42267
42419
  if (prev && prev !== trait.currentState) {
@@ -42430,10 +42582,10 @@ function VerifyModePanel({
42430
42582
  localCount
42431
42583
  }) {
42432
42584
  const { t } = useTranslate();
42433
- const [expanded, setExpanded] = React86.useState(true);
42434
- const scrollRef = React86.useRef(null);
42435
- const prevCountRef = React86.useRef(0);
42436
- React86.useEffect(() => {
42585
+ const [expanded, setExpanded] = React87.useState(true);
42586
+ const scrollRef = React87.useRef(null);
42587
+ const prevCountRef = React87.useRef(0);
42588
+ React87.useEffect(() => {
42437
42589
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
42438
42590
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
42439
42591
  }
@@ -42490,10 +42642,10 @@ function RuntimeDebugger({
42490
42642
  schema
42491
42643
  }) {
42492
42644
  const { t } = useTranslate();
42493
- const [isCollapsed, setIsCollapsed] = React86.useState(mode === "verify" ? true : defaultCollapsed);
42494
- const [isVisible, setIsVisible] = React86.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
42645
+ const [isCollapsed, setIsCollapsed] = React87.useState(mode === "verify" ? true : defaultCollapsed);
42646
+ const [isVisible, setIsVisible] = React87.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
42495
42647
  const debugData = useDebugData();
42496
- React86.useEffect(() => {
42648
+ React87.useEffect(() => {
42497
42649
  if (mode === "inline") return;
42498
42650
  return onDebugToggle((enabled) => {
42499
42651
  setIsVisible(enabled);
@@ -42502,7 +42654,7 @@ function RuntimeDebugger({
42502
42654
  }
42503
42655
  });
42504
42656
  }, [mode]);
42505
- React86.useEffect(() => {
42657
+ React87.useEffect(() => {
42506
42658
  if (mode === "inline") return;
42507
42659
  const handleKeyDown = (e) => {
42508
42660
  if (e.key === "`" && isVisible) {
@@ -43022,7 +43174,7 @@ var init_StatCard = __esm({
43022
43174
  const labelToUse = propLabel ?? propTitle;
43023
43175
  const eventBus = useEventBus();
43024
43176
  const { t } = useTranslate();
43025
- const handleActionClick = React86__default.useCallback(() => {
43177
+ const handleActionClick = React87__default.useCallback(() => {
43026
43178
  if (action?.event) {
43027
43179
  eventBus.emit(`UI:${action.event}`, {});
43028
43180
  }
@@ -43033,7 +43185,7 @@ var init_StatCard = __esm({
43033
43185
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
43034
43186
  const isLoading = externalLoading ?? false;
43035
43187
  const error = externalError;
43036
- const computeMetricValue = React86__default.useCallback(
43188
+ const computeMetricValue = React87__default.useCallback(
43037
43189
  (metric, items) => {
43038
43190
  if (metric.value !== void 0) {
43039
43191
  return metric.value;
@@ -43072,7 +43224,7 @@ var init_StatCard = __esm({
43072
43224
  },
43073
43225
  []
43074
43226
  );
43075
- const schemaStats = React86__default.useMemo(() => {
43227
+ const schemaStats = React87__default.useMemo(() => {
43076
43228
  if (!metrics || metrics.length === 0) return null;
43077
43229
  return metrics.map((metric) => ({
43078
43230
  label: metric.label,
@@ -43080,7 +43232,7 @@ var init_StatCard = __esm({
43080
43232
  format: metric.format
43081
43233
  }));
43082
43234
  }, [metrics, data, computeMetricValue]);
43083
- const calculatedTrend = React86__default.useMemo(() => {
43235
+ const calculatedTrend = React87__default.useMemo(() => {
43084
43236
  if (manualTrend !== void 0) return manualTrend;
43085
43237
  if (previousValue === void 0 || currentValue === void 0)
43086
43238
  return void 0;
@@ -43720,8 +43872,8 @@ var init_SubagentTracePanel = __esm({
43720
43872
  ] });
43721
43873
  };
43722
43874
  InlineActivityStream = ({ activities, autoScroll = true, className }) => {
43723
- const endRef = React86__default.useRef(null);
43724
- React86__default.useEffect(() => {
43875
+ const endRef = React87__default.useRef(null);
43876
+ React87__default.useEffect(() => {
43725
43877
  if (!autoScroll) return;
43726
43878
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
43727
43879
  }, [activities.length, autoScroll]);
@@ -43815,7 +43967,7 @@ var init_SubagentTracePanel = __esm({
43815
43967
  };
43816
43968
  SubagentRichCard = ({ subagent }) => {
43817
43969
  const { t } = useTranslate();
43818
- const activities = React86__default.useMemo(
43970
+ const activities = React87__default.useMemo(
43819
43971
  () => subagentMessagesToActivities(subagent.messages),
43820
43972
  [subagent.messages]
43821
43973
  );
@@ -43892,8 +44044,8 @@ var init_SubagentTracePanel = __esm({
43892
44044
  ] });
43893
44045
  };
43894
44046
  CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
43895
- const endRef = React86__default.useRef(null);
43896
- React86__default.useEffect(() => {
44047
+ const endRef = React87__default.useRef(null);
44048
+ React87__default.useEffect(() => {
43897
44049
  if (!autoScroll) return;
43898
44050
  endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
43899
44051
  }, [messages.length, autoScroll]);
@@ -44328,7 +44480,7 @@ var init_Timeline = __esm({
44328
44480
  }) => {
44329
44481
  const { t } = useTranslate();
44330
44482
  const entityData = entity ?? [];
44331
- const items = React86__default.useMemo(() => {
44483
+ const items = React87__default.useMemo(() => {
44332
44484
  if (propItems) return propItems;
44333
44485
  if (entityData.length === 0) return [];
44334
44486
  return entityData.map((record, idx) => {
@@ -44430,7 +44582,7 @@ var init_Timeline = __esm({
44430
44582
  }
44431
44583
  });
44432
44584
  function extractToastProps(children) {
44433
- if (!React86__default.isValidElement(children)) {
44585
+ if (!React87__default.isValidElement(children)) {
44434
44586
  if (typeof children === "string") {
44435
44587
  return { message: children };
44436
44588
  }
@@ -44472,7 +44624,7 @@ var init_ToastSlot = __esm({
44472
44624
  eventBus.emit(`${prefix}CLOSE`);
44473
44625
  };
44474
44626
  if (!isVisible) return null;
44475
- const isCustomContent = React86__default.isValidElement(children) && !message;
44627
+ const isCustomContent = React87__default.isValidElement(children) && !message;
44476
44628
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
44477
44629
  Toast,
44478
44630
  {
@@ -44568,6 +44720,7 @@ var init_component_registry_generated = __esm({
44568
44720
  init_DocTOC();
44569
44721
  init_DocumentViewer();
44570
44722
  init_DrawGroup();
44723
+ init_DrawMesh();
44571
44724
  init_DrawShape();
44572
44725
  init_DrawShapeLayer();
44573
44726
  init_DrawSprite();
@@ -44836,6 +44989,7 @@ var init_component_registry_generated = __esm({
44836
44989
  "DocTOC": DocTOC,
44837
44990
  "DocumentViewer": DocumentViewer,
44838
44991
  "DrawGroup": DrawGroup,
44992
+ "DrawMesh": DrawMesh,
44839
44993
  "DrawShape": DrawShape,
44840
44994
  "DrawShapeLayer": DrawShapeLayer,
44841
44995
  "DrawSprite": DrawSprite,
@@ -45045,7 +45199,7 @@ function SuspenseConfigProvider({
45045
45199
  config,
45046
45200
  children
45047
45201
  }) {
45048
- return React86__default.createElement(
45202
+ return React87__default.createElement(
45049
45203
  SuspenseConfigContext.Provider,
45050
45204
  { value: config },
45051
45205
  children
@@ -45087,7 +45241,7 @@ function enrichFormFields(fields, entityDef) {
45087
45241
  }
45088
45242
  return { name: field, label: humanizeFieldName(field) };
45089
45243
  }
45090
- if (field && typeof field === "object" && !Array.isArray(field) && !React86__default.isValidElement(field) && !(field instanceof Date)) {
45244
+ if (field && typeof field === "object" && !Array.isArray(field) && !React87__default.isValidElement(field) && !(field instanceof Date)) {
45091
45245
  const obj = field;
45092
45246
  const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
45093
45247
  if (!fieldName) return field;
@@ -45559,7 +45713,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
45559
45713
  const key = `${parentId}-${index}-trait:${traitName}`;
45560
45714
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
45561
45715
  }
45562
- return /* @__PURE__ */ jsx(React86__default.Fragment, { children: child }, `${parentId}-${index}`);
45716
+ return /* @__PURE__ */ jsx(React87__default.Fragment, { children: child }, `${parentId}-${index}`);
45563
45717
  }
45564
45718
  if (!child || typeof child !== "object") return null;
45565
45719
  const childId = `${parentId}-${index}`;
@@ -45616,14 +45770,14 @@ function isPatternConfig(value) {
45616
45770
  if (value === null || value === void 0) return false;
45617
45771
  if (typeof value !== "object") return false;
45618
45772
  if (Array.isArray(value)) return false;
45619
- if (React86__default.isValidElement(value)) return false;
45773
+ if (React87__default.isValidElement(value)) return false;
45620
45774
  if (value instanceof Date) return false;
45621
45775
  if (typeof value === "function") return false;
45622
45776
  const record = value;
45623
45777
  return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
45624
45778
  }
45625
45779
  function isPlainConfigObject(value) {
45626
- if (React86__default.isValidElement(value)) return false;
45780
+ if (React87__default.isValidElement(value)) return false;
45627
45781
  if (value instanceof Date) return false;
45628
45782
  const proto = Object.getPrototypeOf(value);
45629
45783
  return proto === Object.prototype || proto === null;
@@ -45764,7 +45918,7 @@ function SlotContentRenderer({
45764
45918
  for (const slotKey of CONTENT_NODE_SLOTS) {
45765
45919
  const slotVal = restProps[slotKey];
45766
45920
  if (slotVal === void 0 || slotVal === null) continue;
45767
- if (React86__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
45921
+ if (React87__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
45768
45922
  const typelessChildren = !Array.isArray(slotVal) && typeof slotVal === "object" && !("type" in slotVal) && Array.isArray(slotVal.children) ? slotVal.children : void 0;
45769
45923
  if (typelessChildren !== void 0 || Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
45770
45924
  nodeSlotOverrides[slotKey] = renderPatternChildren(
@@ -45818,7 +45972,7 @@ function SlotContentRenderer({
45818
45972
  const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
45819
45973
  if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
45820
45974
  const sample = resolvedItems[0];
45821
- if (sample && typeof sample === "object" && !Array.isArray(sample) && !React86__default.isValidElement(sample) && !(sample instanceof Date)) {
45975
+ if (sample && typeof sample === "object" && !Array.isArray(sample) && !React87__default.isValidElement(sample) && !(sample instanceof Date)) {
45822
45976
  const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
45823
45977
  finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
45824
45978
  }