@almadar/ui 5.107.0 → 5.109.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.
- package/dist/avl/index.cjs +1427 -2828
- package/dist/avl/index.js +525 -1926
- package/dist/components/core/atoms/Box.d.ts +2 -0
- package/dist/components/{game → core}/atoms/GameIcon.d.ts +1 -1
- package/dist/components/core/atoms/index.d.ts +1 -0
- package/dist/components/core/templates/index.d.ts +0 -1
- package/dist/components/game/molecules/index.d.ts +8 -28
- package/dist/components/index.cjs +223 -1691
- package/dist/components/index.js +213 -1671
- package/dist/lib/drawable/projector.d.ts +1 -1
- package/dist/{components/game/three/molecules/GameCanvas3D.d.ts → lib/drawable/three/Canvas3DHost.d.ts} +12 -9
- package/dist/lib/drawable/{Drawable3D.d.ts → three/Drawable3D.d.ts} +2 -2
- package/dist/lib/drawable/three/GameCamera3D.d.ts +16 -0
- package/dist/lib/drawable/three/game3dTheme.d.ts +14 -0
- package/dist/{components/game → lib/drawable}/three/hooks/useGameCanvas3DEvents.d.ts +1 -1
- package/dist/{components/game → lib/drawable}/three/index.cjs +2019 -2020
- package/dist/{components/game → lib/drawable}/three/index.css +3 -3
- package/dist/lib/drawable/three/index.d.ts +39 -0
- package/dist/{components/game → lib/drawable}/three/index.js +1932 -1934
- package/dist/lib/drawable/{mesh3d.d.ts → three/mesh3d.d.ts} +4 -4
- package/dist/{components/game/lib → lib}/puzzleObject.d.ts +11 -2
- package/dist/marketing/index.d.cts +2 -0
- package/dist/{components/game/providers → providers}/GameAudioProvider.d.ts +1 -1
- package/dist/providers/index.cjs +1619 -2690
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.js +827 -1902
- package/dist/runtime/index.cjs +1288 -2689
- package/dist/runtime/index.js +505 -1906
- package/package.json +7 -7
- package/dist/components/game/atoms/ActionButton.d.ts +0 -31
- package/dist/components/game/atoms/ComboCounter.d.ts +0 -20
- package/dist/components/game/atoms/DamageNumber.d.ts +0 -18
- package/dist/components/game/atoms/GameCard.d.ts +0 -34
- package/dist/components/game/atoms/ItemSlot.d.ts +0 -31
- package/dist/components/game/atoms/ResourceCounter.d.ts +0 -26
- package/dist/components/game/atoms/Sprite.d.ts +0 -52
- package/dist/components/game/atoms/StatusEffect.d.ts +0 -25
- package/dist/components/game/atoms/TurnIndicator.d.ts +0 -22
- package/dist/components/game/atoms/WaypointMarker.d.ts +0 -23
- package/dist/components/game/molecules/EventLog.d.ts +0 -31
- package/dist/components/game/molecules/InventoryGrid.d.ts +0 -35
- package/dist/components/game/molecules/ObjectRulePanel.d.ts +0 -32
- package/dist/components/game/molecules/ResourceBar.d.ts +0 -26
- package/dist/components/game/molecules/RuleEditor.d.ts +0 -39
- package/dist/components/game/molecules/VariablePanel.d.ts +0 -28
- package/dist/components/game/templates/GameTemplate.d.ts +0 -35
- package/dist/components/game/three/atoms/SpriteBillboard3D.d.ts +0 -18
- package/dist/components/game/three/game3dTheme.d.ts +0 -55
- package/dist/components/game/three/index.d.ts +0 -12
- package/dist/components/game/three/lib/game3dAssetManifest.d.ts +0 -48
- package/dist/components/game/three/molecules/GameCamera3D.d.ts +0 -35
- package/dist/components/game/three/molecules/index.d.ts +0 -32
- package/dist/components/game/three/patterns.d.ts +0 -16
- /package/dist/{components/game/hooks → hooks}/useCamera.d.ts +0 -0
- /package/dist/{components/game/hooks → hooks}/useGameAudio.d.ts +0 -0
- /package/dist/{components/game/hooks → hooks}/useImageCache.d.ts +0 -0
- /package/dist/{components/game/hooks → hooks}/useUnitSpriteAtlas.d.ts +0 -0
- /package/dist/{components/game/lib → lib}/boardEntity.d.ts +0 -0
- /package/dist/{components/game/three/molecules → lib/drawable/three}/Camera3D.d.ts +0 -0
- /package/dist/{components/game/three/molecules → lib/drawable/three}/Canvas3DErrorBoundary.d.ts +0 -0
- /package/dist/{components/game/three/molecules → lib/drawable/three}/Canvas3DLoadingState.d.ts +0 -0
- /package/dist/{components/game/three/molecules → lib/drawable/three}/Lighting3D.d.ts +0 -0
- /package/dist/{components/game/three/molecules → lib/drawable/three}/ModelLoader.d.ts +0 -0
- /package/dist/{components/game/three/molecules → lib/drawable/three}/Scene3D.d.ts +0 -0
- /package/dist/{components/game → lib/drawable}/three/hooks/useAssetLoader.d.ts +0 -0
- /package/dist/{components/game → lib/drawable}/three/hooks/useRaycaster.d.ts +0 -0
- /package/dist/{components/game → lib/drawable}/three/hooks/useSceneGraph.d.ts +0 -0
- /package/dist/{components/game → lib/drawable}/three/hooks/useThree.d.ts +0 -0
- /package/dist/{components/game → lib/drawable}/three/lib/AssetLoader.d.ts +0 -0
- /package/dist/{components/game → lib/drawable}/three/lib/culling.d.ts +0 -0
- /package/dist/{components/game → lib/drawable}/three/lib/grid3D.d.ts +0 -0
- /package/dist/{components/game/lib → lib}/editorUtils.d.ts +0 -0
- /package/dist/{components/game/lib → lib}/game.d.ts +0 -0
- /package/dist/{components/game/lib/index.d.ts → lib/gameShared.d.ts} +0 -0
- /package/dist/{components/game/lib → lib}/isometric.d.ts +0 -0
- /package/dist/{components/game/lib → lib}/isometricTypes.d.ts +0 -0
- /package/dist/{components/game/lib → lib}/makeAsset.d.ts +0 -0
- /package/dist/{components/game/lib → lib}/mechanics.d.ts +0 -0
- /package/dist/{components/game/lib → lib}/physicsPresets.d.ts +0 -0
- /package/dist/{components/game/lib → lib}/physicsTypes.d.ts +0 -0
- /package/dist/{components/game/lib → lib}/spriteAnimation.d.ts +0 -0
- /package/dist/{components/game/lib → lib}/spriteAnimationTypes.d.ts +0 -0
- /package/dist/{components/game/lib → lib}/spriteSheetConstants.d.ts +0 -0
package/dist/providers/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import { EventBusContext, useTraitScope, useEntitySchemaOptional, TraitScopeProvider, useCurrentPagePath } from '@almadar/ui/providers';
|
|
1
|
+
import * as React83 from 'react';
|
|
2
|
+
import React83__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, lazy, useLayoutEffect, useId, useSyncExternalStore } from 'react';
|
|
3
|
+
import { EventBusContext, useTraitScope, useEntitySchemaOptional, TraitScopeProvider, useCurrentPagePath, useGameAudioContextOptional } from '@almadar/ui/providers';
|
|
4
4
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -388,7 +388,7 @@ var init_Box = __esm({
|
|
|
388
388
|
fixed: "fixed",
|
|
389
389
|
sticky: "sticky"
|
|
390
390
|
};
|
|
391
|
-
Box =
|
|
391
|
+
Box = React83__default.forwardRef(
|
|
392
392
|
({
|
|
393
393
|
padding,
|
|
394
394
|
paddingX,
|
|
@@ -453,7 +453,7 @@ var init_Box = __esm({
|
|
|
453
453
|
onPointerDown?.(e);
|
|
454
454
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
455
455
|
const isClickable = action || onClick;
|
|
456
|
-
return
|
|
456
|
+
return React83__default.createElement(
|
|
457
457
|
Component,
|
|
458
458
|
{
|
|
459
459
|
ref,
|
|
@@ -549,7 +549,7 @@ function loadLib(key, importer) {
|
|
|
549
549
|
return p;
|
|
550
550
|
}
|
|
551
551
|
function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
552
|
-
const Lazy =
|
|
552
|
+
const Lazy = React83__default.lazy(async () => {
|
|
553
553
|
const lib = await loadLib(libKey, importer);
|
|
554
554
|
const Comp = pick(lib);
|
|
555
555
|
if (!Comp) {
|
|
@@ -559,7 +559,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
559
559
|
return { default: Comp };
|
|
560
560
|
});
|
|
561
561
|
const Wrapped = (props) => /* @__PURE__ */ jsx(
|
|
562
|
-
|
|
562
|
+
React83__default.Suspense,
|
|
563
563
|
{
|
|
564
564
|
fallback: /* @__PURE__ */ jsx(
|
|
565
565
|
"span",
|
|
@@ -1290,7 +1290,7 @@ var init_Icon = __esm({
|
|
|
1290
1290
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
1291
1291
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
1292
1292
|
const family = useIconFamily();
|
|
1293
|
-
const RenderedComponent =
|
|
1293
|
+
const RenderedComponent = React83__default.useMemo(() => {
|
|
1294
1294
|
if (directIcon) return null;
|
|
1295
1295
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
1296
1296
|
}, [directIcon, effectiveName, family]);
|
|
@@ -1411,7 +1411,7 @@ var init_atlasSlice = __esm({
|
|
|
1411
1411
|
}
|
|
1412
1412
|
});
|
|
1413
1413
|
function useAtlasSliceDataUrl(asset) {
|
|
1414
|
-
const [, bump] =
|
|
1414
|
+
const [, bump] = React83.useReducer((x) => x + 1, 0);
|
|
1415
1415
|
if (!isAtlasAsset(asset)) return void 0;
|
|
1416
1416
|
const key = `${asset.atlas}#${asset.sprite}`;
|
|
1417
1417
|
const cached = sliceDataUrlCache.get(key);
|
|
@@ -1474,13 +1474,13 @@ function AtlasImage({
|
|
|
1474
1474
|
style,
|
|
1475
1475
|
"aria-hidden": ariaHidden
|
|
1476
1476
|
}) {
|
|
1477
|
-
const [, bump] =
|
|
1478
|
-
const canvasRef =
|
|
1477
|
+
const [, bump] = React83.useReducer((x) => x + 1, 0);
|
|
1478
|
+
const canvasRef = React83.useRef(null);
|
|
1479
1479
|
const sliced = isAtlasAsset(asset);
|
|
1480
1480
|
const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
|
|
1481
1481
|
const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
|
|
1482
1482
|
const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
|
|
1483
|
-
|
|
1483
|
+
React83.useEffect(() => {
|
|
1484
1484
|
const canvas = canvasRef.current;
|
|
1485
1485
|
if (!canvas || !img || !rect) return;
|
|
1486
1486
|
canvas.width = rect.sw;
|
|
@@ -1556,7 +1556,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1556
1556
|
const IconComp = value;
|
|
1557
1557
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1558
1558
|
}
|
|
1559
|
-
if (
|
|
1559
|
+
if (React83__default.isValidElement(value)) {
|
|
1560
1560
|
return value;
|
|
1561
1561
|
}
|
|
1562
1562
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -1633,7 +1633,7 @@ var init_Button = __esm({
|
|
|
1633
1633
|
md: "h-icon-default w-icon-default",
|
|
1634
1634
|
lg: "h-icon-default w-icon-default"
|
|
1635
1635
|
};
|
|
1636
|
-
Button =
|
|
1636
|
+
Button = React83__default.forwardRef(
|
|
1637
1637
|
({
|
|
1638
1638
|
className,
|
|
1639
1639
|
variant = "primary",
|
|
@@ -1701,7 +1701,7 @@ var Dialog;
|
|
|
1701
1701
|
var init_Dialog = __esm({
|
|
1702
1702
|
"components/core/atoms/Dialog.tsx"() {
|
|
1703
1703
|
init_cn();
|
|
1704
|
-
Dialog =
|
|
1704
|
+
Dialog = React83__default.forwardRef(
|
|
1705
1705
|
({
|
|
1706
1706
|
role = "dialog",
|
|
1707
1707
|
"aria-modal": ariaModal = true,
|
|
@@ -1819,7 +1819,7 @@ var init_Typography = __esm({
|
|
|
1819
1819
|
}) => {
|
|
1820
1820
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
1821
1821
|
const Component = as || defaultElements[variant];
|
|
1822
|
-
return
|
|
1822
|
+
return React83__default.createElement(
|
|
1823
1823
|
Component,
|
|
1824
1824
|
{
|
|
1825
1825
|
id,
|
|
@@ -2315,7 +2315,7 @@ var init_Badge = __esm({
|
|
|
2315
2315
|
md: "px-2.5 py-1 text-sm",
|
|
2316
2316
|
lg: "px-3 py-1.5 text-base"
|
|
2317
2317
|
};
|
|
2318
|
-
Badge =
|
|
2318
|
+
Badge = React83__default.forwardRef(
|
|
2319
2319
|
({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
|
|
2320
2320
|
const iconSizes3 = {
|
|
2321
2321
|
sm: "h-icon-default w-icon-default",
|
|
@@ -2652,7 +2652,7 @@ var init_SvgFlow = __esm({
|
|
|
2652
2652
|
width = 100,
|
|
2653
2653
|
height = 100
|
|
2654
2654
|
}) => {
|
|
2655
|
-
const markerId =
|
|
2655
|
+
const markerId = React83__default.useMemo(() => {
|
|
2656
2656
|
flowIdCounter += 1;
|
|
2657
2657
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
2658
2658
|
}, []);
|
|
@@ -3245,7 +3245,7 @@ var init_SvgRing = __esm({
|
|
|
3245
3245
|
width = 100,
|
|
3246
3246
|
height = 100
|
|
3247
3247
|
}) => {
|
|
3248
|
-
const gradientId =
|
|
3248
|
+
const gradientId = React83__default.useMemo(() => {
|
|
3249
3249
|
ringIdCounter += 1;
|
|
3250
3250
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
3251
3251
|
}, []);
|
|
@@ -3426,7 +3426,7 @@ var init_Input = __esm({
|
|
|
3426
3426
|
init_cn();
|
|
3427
3427
|
init_Icon();
|
|
3428
3428
|
init_useEventBus();
|
|
3429
|
-
Input =
|
|
3429
|
+
Input = React83__default.forwardRef(
|
|
3430
3430
|
({
|
|
3431
3431
|
className,
|
|
3432
3432
|
inputType,
|
|
@@ -3586,7 +3586,7 @@ var Label;
|
|
|
3586
3586
|
var init_Label = __esm({
|
|
3587
3587
|
"components/core/atoms/Label.tsx"() {
|
|
3588
3588
|
init_cn();
|
|
3589
|
-
Label =
|
|
3589
|
+
Label = React83__default.forwardRef(
|
|
3590
3590
|
({ className, required, children, ...props }, ref) => {
|
|
3591
3591
|
return /* @__PURE__ */ jsxs(
|
|
3592
3592
|
"label",
|
|
@@ -3613,7 +3613,7 @@ var init_Textarea = __esm({
|
|
|
3613
3613
|
"components/core/atoms/Textarea.tsx"() {
|
|
3614
3614
|
init_cn();
|
|
3615
3615
|
init_useEventBus();
|
|
3616
|
-
Textarea =
|
|
3616
|
+
Textarea = React83__default.forwardRef(
|
|
3617
3617
|
({ className, error, onChange, ...props }, ref) => {
|
|
3618
3618
|
const eventBus = useEventBus();
|
|
3619
3619
|
const handleChange = (e) => {
|
|
@@ -3852,7 +3852,7 @@ var init_Select = __esm({
|
|
|
3852
3852
|
init_cn();
|
|
3853
3853
|
init_Icon();
|
|
3854
3854
|
init_useEventBus();
|
|
3855
|
-
Select =
|
|
3855
|
+
Select = React83__default.forwardRef(
|
|
3856
3856
|
(props, _ref) => {
|
|
3857
3857
|
const { multiple, searchable, clearable } = props;
|
|
3858
3858
|
if (multiple || searchable || clearable) {
|
|
@@ -3869,7 +3869,7 @@ var init_Checkbox = __esm({
|
|
|
3869
3869
|
"components/core/atoms/Checkbox.tsx"() {
|
|
3870
3870
|
init_cn();
|
|
3871
3871
|
init_useEventBus();
|
|
3872
|
-
Checkbox =
|
|
3872
|
+
Checkbox = React83__default.forwardRef(
|
|
3873
3873
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
3874
3874
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
3875
3875
|
const eventBus = useEventBus();
|
|
@@ -3923,7 +3923,7 @@ var init_Spinner = __esm({
|
|
|
3923
3923
|
md: "h-6 w-6",
|
|
3924
3924
|
lg: "h-8 w-8"
|
|
3925
3925
|
};
|
|
3926
|
-
Spinner =
|
|
3926
|
+
Spinner = React83__default.forwardRef(
|
|
3927
3927
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
3928
3928
|
if (overlay) {
|
|
3929
3929
|
return /* @__PURE__ */ jsx(
|
|
@@ -4013,7 +4013,7 @@ var init_Card = __esm({
|
|
|
4013
4013
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
4014
4014
|
"tile-image-first": "p-0 overflow-hidden"
|
|
4015
4015
|
};
|
|
4016
|
-
Card =
|
|
4016
|
+
Card = React83__default.forwardRef(
|
|
4017
4017
|
({
|
|
4018
4018
|
className,
|
|
4019
4019
|
variant = "bordered",
|
|
@@ -4061,9 +4061,9 @@ var init_Card = __esm({
|
|
|
4061
4061
|
}
|
|
4062
4062
|
);
|
|
4063
4063
|
Card.displayName = "Card";
|
|
4064
|
-
CardHeader =
|
|
4064
|
+
CardHeader = React83__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
4065
4065
|
CardHeader.displayName = "CardHeader";
|
|
4066
|
-
CardTitle =
|
|
4066
|
+
CardTitle = React83__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4067
4067
|
"h3",
|
|
4068
4068
|
{
|
|
4069
4069
|
ref,
|
|
@@ -4076,11 +4076,11 @@ var init_Card = __esm({
|
|
|
4076
4076
|
}
|
|
4077
4077
|
));
|
|
4078
4078
|
CardTitle.displayName = "CardTitle";
|
|
4079
|
-
CardContent =
|
|
4079
|
+
CardContent = React83__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
4080
4080
|
CardContent.displayName = "CardContent";
|
|
4081
4081
|
CardBody = CardContent;
|
|
4082
4082
|
CardBody.displayName = "CardBody";
|
|
4083
|
-
CardFooter =
|
|
4083
|
+
CardFooter = React83__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4084
4084
|
"div",
|
|
4085
4085
|
{
|
|
4086
4086
|
ref,
|
|
@@ -4091,6 +4091,38 @@ var init_Card = __esm({
|
|
|
4091
4091
|
CardFooter.displayName = "CardFooter";
|
|
4092
4092
|
}
|
|
4093
4093
|
});
|
|
4094
|
+
function GameIcon({ assetUrl, icon, size = "md", alt, className }) {
|
|
4095
|
+
const px = typeof size === "number" ? size : sizeMap[size];
|
|
4096
|
+
const family = useIconFamily();
|
|
4097
|
+
if (assetUrl?.url) {
|
|
4098
|
+
return /* @__PURE__ */ jsx(
|
|
4099
|
+
AtlasImage,
|
|
4100
|
+
{
|
|
4101
|
+
asset: assetUrl,
|
|
4102
|
+
size: px,
|
|
4103
|
+
alt: alt ?? assetUrl.category ?? "",
|
|
4104
|
+
className: cn("flex-shrink-0", className)
|
|
4105
|
+
}
|
|
4106
|
+
);
|
|
4107
|
+
}
|
|
4108
|
+
const I = typeof icon === "string" ? resolveIconForFamily(icon, family) : icon;
|
|
4109
|
+
return /* @__PURE__ */ jsx(I, { width: px, height: px, className: cn("flex-shrink-0", className) });
|
|
4110
|
+
}
|
|
4111
|
+
var sizeMap;
|
|
4112
|
+
var init_GameIcon = __esm({
|
|
4113
|
+
"components/core/atoms/GameIcon.tsx"() {
|
|
4114
|
+
"use client";
|
|
4115
|
+
init_cn();
|
|
4116
|
+
init_iconFamily();
|
|
4117
|
+
init_AtlasImage();
|
|
4118
|
+
sizeMap = {
|
|
4119
|
+
sm: 16,
|
|
4120
|
+
md: 24,
|
|
4121
|
+
lg: 32
|
|
4122
|
+
};
|
|
4123
|
+
GameIcon.displayName = "GameIcon";
|
|
4124
|
+
}
|
|
4125
|
+
});
|
|
4094
4126
|
var variantStyles5, sizeStyles4, iconSizes, FilterPill;
|
|
4095
4127
|
var init_FilterPill = __esm({
|
|
4096
4128
|
"components/core/atoms/FilterPill.tsx"() {
|
|
@@ -4135,7 +4167,7 @@ var init_FilterPill = __esm({
|
|
|
4135
4167
|
md: "w-3.5 h-3.5",
|
|
4136
4168
|
lg: "w-4 h-4"
|
|
4137
4169
|
};
|
|
4138
|
-
FilterPill =
|
|
4170
|
+
FilterPill = React83__default.forwardRef(
|
|
4139
4171
|
({
|
|
4140
4172
|
className,
|
|
4141
4173
|
variant = "default",
|
|
@@ -4264,8 +4296,8 @@ var init_Avatar = __esm({
|
|
|
4264
4296
|
actionPayload
|
|
4265
4297
|
}) => {
|
|
4266
4298
|
const eventBus = useEventBus();
|
|
4267
|
-
const [imgFailed, setImgFailed] =
|
|
4268
|
-
|
|
4299
|
+
const [imgFailed, setImgFailed] = React83__default.useState(false);
|
|
4300
|
+
React83__default.useEffect(() => {
|
|
4269
4301
|
setImgFailed(false);
|
|
4270
4302
|
}, [src]);
|
|
4271
4303
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -4378,7 +4410,7 @@ var init_Center = __esm({
|
|
|
4378
4410
|
as: Component = "div"
|
|
4379
4411
|
}) => {
|
|
4380
4412
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
4381
|
-
return
|
|
4413
|
+
return React83__default.createElement(Component, {
|
|
4382
4414
|
className: cn(
|
|
4383
4415
|
inline ? "inline-flex" : "flex",
|
|
4384
4416
|
horizontal && "justify-center",
|
|
@@ -4646,7 +4678,7 @@ var init_Radio = __esm({
|
|
|
4646
4678
|
md: "w-2.5 h-2.5",
|
|
4647
4679
|
lg: "w-3 h-3"
|
|
4648
4680
|
};
|
|
4649
|
-
Radio =
|
|
4681
|
+
Radio = React83__default.forwardRef(
|
|
4650
4682
|
({
|
|
4651
4683
|
label,
|
|
4652
4684
|
helperText,
|
|
@@ -4663,12 +4695,12 @@ var init_Radio = __esm({
|
|
|
4663
4695
|
onChange,
|
|
4664
4696
|
...props
|
|
4665
4697
|
}, ref) => {
|
|
4666
|
-
const reactId =
|
|
4698
|
+
const reactId = React83__default.useId();
|
|
4667
4699
|
const baseId = id || `radio-${reactId}`;
|
|
4668
4700
|
const hasError = !!error;
|
|
4669
4701
|
const eventBus = useEventBus();
|
|
4670
|
-
const [selected, setSelected] =
|
|
4671
|
-
|
|
4702
|
+
const [selected, setSelected] = React83__default.useState(value);
|
|
4703
|
+
React83__default.useEffect(() => {
|
|
4672
4704
|
if (value !== void 0) setSelected(value);
|
|
4673
4705
|
}, [value]);
|
|
4674
4706
|
const pick = (next, e) => {
|
|
@@ -4850,7 +4882,7 @@ var init_Switch = __esm({
|
|
|
4850
4882
|
"components/core/atoms/Switch.tsx"() {
|
|
4851
4883
|
"use client";
|
|
4852
4884
|
init_cn();
|
|
4853
|
-
Switch =
|
|
4885
|
+
Switch = React83.forwardRef(
|
|
4854
4886
|
({
|
|
4855
4887
|
checked,
|
|
4856
4888
|
defaultChecked = false,
|
|
@@ -4861,10 +4893,10 @@ var init_Switch = __esm({
|
|
|
4861
4893
|
name,
|
|
4862
4894
|
className
|
|
4863
4895
|
}, ref) => {
|
|
4864
|
-
const [isChecked, setIsChecked] =
|
|
4896
|
+
const [isChecked, setIsChecked] = React83.useState(
|
|
4865
4897
|
checked !== void 0 ? checked : defaultChecked
|
|
4866
4898
|
);
|
|
4867
|
-
|
|
4899
|
+
React83.useEffect(() => {
|
|
4868
4900
|
if (checked !== void 0) {
|
|
4869
4901
|
setIsChecked(checked);
|
|
4870
4902
|
}
|
|
@@ -5027,7 +5059,7 @@ var init_Stack = __esm({
|
|
|
5027
5059
|
};
|
|
5028
5060
|
const isHorizontal = direction === "horizontal";
|
|
5029
5061
|
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";
|
|
5030
|
-
return
|
|
5062
|
+
return React83__default.createElement(
|
|
5031
5063
|
Component,
|
|
5032
5064
|
{
|
|
5033
5065
|
className: cn(
|
|
@@ -5073,7 +5105,7 @@ var init_TextHighlight = __esm({
|
|
|
5073
5105
|
}) => {
|
|
5074
5106
|
const eventBus = useEventBus();
|
|
5075
5107
|
const baseStyles = "cursor-pointer transition-all duration-150";
|
|
5076
|
-
const
|
|
5108
|
+
const typeStyles = {
|
|
5077
5109
|
question: cn(
|
|
5078
5110
|
// Blue border for questions
|
|
5079
5111
|
"bg-card border-b-2 border-primary-600",
|
|
@@ -5093,7 +5125,7 @@ var init_TextHighlight = __esm({
|
|
|
5093
5125
|
"data-highlight": "true",
|
|
5094
5126
|
"data-highlight-type": highlightType,
|
|
5095
5127
|
"data-annotation-id": annotationId,
|
|
5096
|
-
className: cn(baseStyles,
|
|
5128
|
+
className: cn(baseStyles, typeStyles[highlightType], className),
|
|
5097
5129
|
onClick: () => {
|
|
5098
5130
|
if (action) eventBus.emit(`UI:${action}`, { annotationId });
|
|
5099
5131
|
onClick?.();
|
|
@@ -5227,7 +5259,7 @@ var Aside;
|
|
|
5227
5259
|
var init_Aside = __esm({
|
|
5228
5260
|
"components/core/atoms/Aside.tsx"() {
|
|
5229
5261
|
init_cn();
|
|
5230
|
-
Aside =
|
|
5262
|
+
Aside = React83__default.forwardRef(
|
|
5231
5263
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
5232
5264
|
);
|
|
5233
5265
|
Aside.displayName = "Aside";
|
|
@@ -5306,9 +5338,9 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5306
5338
|
className
|
|
5307
5339
|
}) => {
|
|
5308
5340
|
const { t } = useTranslate();
|
|
5309
|
-
const [isVisible, setIsVisible] =
|
|
5310
|
-
const timeoutRef =
|
|
5311
|
-
const triggerRef =
|
|
5341
|
+
const [isVisible, setIsVisible] = React83__default.useState(false);
|
|
5342
|
+
const timeoutRef = React83__default.useRef(null);
|
|
5343
|
+
const triggerRef = React83__default.useRef(null);
|
|
5312
5344
|
const handleMouseEnter = () => {
|
|
5313
5345
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5314
5346
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -5319,7 +5351,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5319
5351
|
};
|
|
5320
5352
|
const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
|
|
5321
5353
|
const open = isVisible || revealed;
|
|
5322
|
-
|
|
5354
|
+
React83__default.useEffect(() => {
|
|
5323
5355
|
return () => {
|
|
5324
5356
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5325
5357
|
};
|
|
@@ -5529,7 +5561,7 @@ var init_StatusDot = __esm({
|
|
|
5529
5561
|
md: "w-2.5 h-2.5",
|
|
5530
5562
|
lg: "w-3 h-3"
|
|
5531
5563
|
};
|
|
5532
|
-
StatusDot =
|
|
5564
|
+
StatusDot = React83__default.forwardRef(
|
|
5533
5565
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
5534
5566
|
return /* @__PURE__ */ jsx(
|
|
5535
5567
|
"span",
|
|
@@ -5583,7 +5615,7 @@ var init_TrendIndicator = __esm({
|
|
|
5583
5615
|
down: "trending-down",
|
|
5584
5616
|
flat: "arrow-right"
|
|
5585
5617
|
};
|
|
5586
|
-
TrendIndicator =
|
|
5618
|
+
TrendIndicator = React83__default.forwardRef(
|
|
5587
5619
|
({
|
|
5588
5620
|
className,
|
|
5589
5621
|
value,
|
|
@@ -5650,7 +5682,7 @@ var init_RangeSlider = __esm({
|
|
|
5650
5682
|
md: "w-4 h-4",
|
|
5651
5683
|
lg: "w-5 h-5"
|
|
5652
5684
|
};
|
|
5653
|
-
RangeSlider =
|
|
5685
|
+
RangeSlider = React83__default.forwardRef(
|
|
5654
5686
|
({
|
|
5655
5687
|
className,
|
|
5656
5688
|
min = 0,
|
|
@@ -6244,7 +6276,7 @@ var init_ContentSection = __esm({
|
|
|
6244
6276
|
md: "py-16",
|
|
6245
6277
|
lg: "py-24"
|
|
6246
6278
|
};
|
|
6247
|
-
ContentSection =
|
|
6279
|
+
ContentSection = React83__default.forwardRef(
|
|
6248
6280
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
6249
6281
|
return /* @__PURE__ */ jsx(
|
|
6250
6282
|
Box,
|
|
@@ -6778,7 +6810,7 @@ var init_AnimatedReveal = __esm({
|
|
|
6778
6810
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
6779
6811
|
"none": {}
|
|
6780
6812
|
};
|
|
6781
|
-
AnimatedReveal =
|
|
6813
|
+
AnimatedReveal = React83__default.forwardRef(
|
|
6782
6814
|
({
|
|
6783
6815
|
trigger = "scroll",
|
|
6784
6816
|
animation = "fade-up",
|
|
@@ -6938,7 +6970,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6938
6970
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
6939
6971
|
"use client";
|
|
6940
6972
|
init_cn();
|
|
6941
|
-
AnimatedGraphic =
|
|
6973
|
+
AnimatedGraphic = React83__default.forwardRef(
|
|
6942
6974
|
({
|
|
6943
6975
|
src,
|
|
6944
6976
|
svgContent,
|
|
@@ -6961,7 +6993,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6961
6993
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
6962
6994
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
6963
6995
|
const prevAnimateRef = useRef(animate);
|
|
6964
|
-
const setRef =
|
|
6996
|
+
const setRef = React83__default.useCallback(
|
|
6965
6997
|
(node) => {
|
|
6966
6998
|
containerRef.current = node;
|
|
6967
6999
|
if (typeof ref === "function") ref(node);
|
|
@@ -7102,15 +7134,15 @@ var init_TraitFrame = __esm({
|
|
|
7102
7134
|
}
|
|
7103
7135
|
});
|
|
7104
7136
|
|
|
7105
|
-
//
|
|
7137
|
+
// lib/boardEntity.ts
|
|
7106
7138
|
var init_boardEntity = __esm({
|
|
7107
|
-
"
|
|
7139
|
+
"lib/boardEntity.ts"() {
|
|
7108
7140
|
}
|
|
7109
7141
|
});
|
|
7110
7142
|
|
|
7111
|
-
//
|
|
7143
|
+
// lib/makeAsset.ts
|
|
7112
7144
|
var init_makeAsset = __esm({
|
|
7113
|
-
"
|
|
7145
|
+
"lib/makeAsset.ts"() {
|
|
7114
7146
|
}
|
|
7115
7147
|
});
|
|
7116
7148
|
function getState() {
|
|
@@ -7387,13 +7419,13 @@ function useImageCache(urls) {
|
|
|
7387
7419
|
};
|
|
7388
7420
|
}
|
|
7389
7421
|
var init_useImageCache = __esm({
|
|
7390
|
-
"
|
|
7422
|
+
"hooks/useImageCache.ts"() {
|
|
7391
7423
|
"use client";
|
|
7392
7424
|
init_verificationRegistry();
|
|
7393
7425
|
}
|
|
7394
7426
|
});
|
|
7395
7427
|
|
|
7396
|
-
//
|
|
7428
|
+
// lib/isometric.ts
|
|
7397
7429
|
function isoToScreen(tileX, tileY, scale, baseOffsetX, layout = "isometric") {
|
|
7398
7430
|
const scaledTileWidth = TILE_WIDTH * scale;
|
|
7399
7431
|
const scaledFloorHeight = FLOOR_HEIGHT * scale;
|
|
@@ -7431,7 +7463,7 @@ function screenToIso(screenX, screenY, scale, baseOffsetX, layout = "isometric")
|
|
|
7431
7463
|
}
|
|
7432
7464
|
var TILE_WIDTH, FLOOR_HEIGHT, DIAMOND_TOP_Y, BACKGROUND_FALLBACK_COLOR, MINIMAP_TERRAIN_COLORS;
|
|
7433
7465
|
var init_isometric = __esm({
|
|
7434
|
-
"
|
|
7466
|
+
"lib/isometric.ts"() {
|
|
7435
7467
|
TILE_WIDTH = 256;
|
|
7436
7468
|
FLOOR_HEIGHT = 128;
|
|
7437
7469
|
DIAMOND_TOP_Y = 374;
|
|
@@ -7444,155 +7476,13 @@ var init_isometric = __esm({
|
|
|
7444
7476
|
}
|
|
7445
7477
|
});
|
|
7446
7478
|
|
|
7447
|
-
//
|
|
7448
|
-
|
|
7449
|
-
|
|
7450
|
-
sx: frame % columns * frameWidth,
|
|
7451
|
-
sy: row * frameHeight,
|
|
7452
|
-
sw: frameWidth,
|
|
7453
|
-
sh: frameHeight
|
|
7454
|
-
};
|
|
7455
|
-
}
|
|
7456
|
-
var init_spriteAnimation = __esm({
|
|
7457
|
-
"components/game/lib/spriteAnimation.ts"() {
|
|
7458
|
-
}
|
|
7459
|
-
});
|
|
7460
|
-
|
|
7461
|
-
// components/game/lib/index.ts
|
|
7462
|
-
var init_lib = __esm({
|
|
7463
|
-
"components/game/lib/index.ts"() {
|
|
7479
|
+
// lib/gameShared.ts
|
|
7480
|
+
var init_gameShared = __esm({
|
|
7481
|
+
"lib/gameShared.ts"() {
|
|
7464
7482
|
init_boardEntity();
|
|
7465
7483
|
init_makeAsset();
|
|
7466
7484
|
}
|
|
7467
7485
|
});
|
|
7468
|
-
function GameIcon({ assetUrl, icon, size = "md", alt, className }) {
|
|
7469
|
-
const px = typeof size === "number" ? size : sizeMap[size];
|
|
7470
|
-
if (assetUrl?.url) {
|
|
7471
|
-
return /* @__PURE__ */ jsx(
|
|
7472
|
-
AtlasImage,
|
|
7473
|
-
{
|
|
7474
|
-
asset: assetUrl,
|
|
7475
|
-
size: px,
|
|
7476
|
-
alt: alt ?? assetUrl.category ?? "",
|
|
7477
|
-
className: cn("flex-shrink-0", className)
|
|
7478
|
-
}
|
|
7479
|
-
);
|
|
7480
|
-
}
|
|
7481
|
-
const I = typeof icon === "string" ? resolveIcon(icon) : icon;
|
|
7482
|
-
return /* @__PURE__ */ jsx(I, { width: px, height: px, className: cn("flex-shrink-0", className) });
|
|
7483
|
-
}
|
|
7484
|
-
var sizeMap;
|
|
7485
|
-
var init_GameIcon = __esm({
|
|
7486
|
-
"components/game/atoms/GameIcon.tsx"() {
|
|
7487
|
-
"use client";
|
|
7488
|
-
init_cn();
|
|
7489
|
-
init_Icon();
|
|
7490
|
-
init_AtlasImage();
|
|
7491
|
-
sizeMap = {
|
|
7492
|
-
sm: 16,
|
|
7493
|
-
md: 24,
|
|
7494
|
-
lg: 32
|
|
7495
|
-
};
|
|
7496
|
-
GameIcon.displayName = "GameIcon";
|
|
7497
|
-
}
|
|
7498
|
-
});
|
|
7499
|
-
function GameCard({
|
|
7500
|
-
id,
|
|
7501
|
-
cost,
|
|
7502
|
-
art,
|
|
7503
|
-
frameAsset,
|
|
7504
|
-
attack,
|
|
7505
|
-
defense,
|
|
7506
|
-
name,
|
|
7507
|
-
selected = false,
|
|
7508
|
-
disabled = false,
|
|
7509
|
-
size = "md",
|
|
7510
|
-
animState = "idle",
|
|
7511
|
-
onClick,
|
|
7512
|
-
clickEvent,
|
|
7513
|
-
className
|
|
7514
|
-
}) {
|
|
7515
|
-
const eventBus = useEventBus();
|
|
7516
|
-
const handleClick = React90.useCallback(() => {
|
|
7517
|
-
if (disabled) return;
|
|
7518
|
-
onClick?.(id);
|
|
7519
|
-
if (clickEvent) eventBus.emit(`UI:${clickEvent}`, { cardId: id });
|
|
7520
|
-
}, [disabled, id, onClick, clickEvent, eventBus]);
|
|
7521
|
-
const artPx = artPxMap[size];
|
|
7522
|
-
return /* @__PURE__ */ jsxs(
|
|
7523
|
-
Button,
|
|
7524
|
-
{
|
|
7525
|
-
variant: "ghost",
|
|
7526
|
-
onClick: handleClick,
|
|
7527
|
-
disabled,
|
|
7528
|
-
title: name,
|
|
7529
|
-
className: cn(
|
|
7530
|
-
"relative isolate flex flex-col items-center rounded-interactive",
|
|
7531
|
-
"px-1.5 pt-1.5 pb-1 transition-all duration-150",
|
|
7532
|
-
frameAsset?.url ? "border-0" : "border-2 bg-card/90",
|
|
7533
|
-
cardSizeMap[size],
|
|
7534
|
-
disabled ? "border-border opacity-50 cursor-not-allowed" : "border-accent hover:brightness-125 hover:-translate-y-1 cursor-pointer",
|
|
7535
|
-
selected && "ring-2 ring-foreground ring-offset-1 ring-offset-background -translate-y-1",
|
|
7536
|
-
ANIM_STATE_CLASS[animState],
|
|
7537
|
-
className
|
|
7538
|
-
),
|
|
7539
|
-
children: [
|
|
7540
|
-
frameAsset?.url && /* @__PURE__ */ jsx(AtlasImage, { asset: frameAsset, fill: true, fit: "fill", "aria-hidden": true, style: { zIndex: -1 } }),
|
|
7541
|
-
cost != null && /* @__PURE__ */ jsx(
|
|
7542
|
-
Typography,
|
|
7543
|
-
{
|
|
7544
|
-
as: "span",
|
|
7545
|
-
className: cn(
|
|
7546
|
-
"absolute -top-2 -left-2 flex items-center justify-center",
|
|
7547
|
-
"min-w-[22px] h-[22px] rounded-full px-1",
|
|
7548
|
-
"bg-info text-foreground text-xs font-bold border border-background"
|
|
7549
|
-
),
|
|
7550
|
-
children: cost
|
|
7551
|
-
}
|
|
7552
|
-
),
|
|
7553
|
-
/* @__PURE__ */ jsx(Box, { className: "flex-1 flex items-center justify-center w-full", children: art ? /* @__PURE__ */ jsx(GameIcon, { assetUrl: art, icon: "image", size: artPx, alt: name ?? id, className: "flex-shrink-0" }) : /* @__PURE__ */ jsx(Box, { className: "rounded bg-muted/40", style: { width: artPx, height: artPx } }) }),
|
|
7554
|
-
name != null && /* @__PURE__ */ jsx(
|
|
7555
|
-
Typography,
|
|
7556
|
-
{
|
|
7557
|
-
variant: "small",
|
|
7558
|
-
className: "w-full truncate text-center text-[10px] leading-tight font-semibold",
|
|
7559
|
-
children: name
|
|
7560
|
-
}
|
|
7561
|
-
),
|
|
7562
|
-
(attack != null || defense != null) && /* @__PURE__ */ jsxs(Box, { className: "flex w-full items-center justify-between px-0.5 text-[10px] font-bold leading-none", children: [
|
|
7563
|
-
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-error", children: attack != null ? `\u2694${attack}` : "" }),
|
|
7564
|
-
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-info", children: defense != null ? `\u{1F6E1}${defense}` : "" })
|
|
7565
|
-
] })
|
|
7566
|
-
]
|
|
7567
|
-
}
|
|
7568
|
-
);
|
|
7569
|
-
}
|
|
7570
|
-
var cardSizeMap, artPxMap, ANIM_STATE_CLASS;
|
|
7571
|
-
var init_GameCard = __esm({
|
|
7572
|
-
"components/game/atoms/GameCard.tsx"() {
|
|
7573
|
-
"use client";
|
|
7574
|
-
init_cn();
|
|
7575
|
-
init_useEventBus();
|
|
7576
|
-
init_Box();
|
|
7577
|
-
init_Button();
|
|
7578
|
-
init_Typography();
|
|
7579
|
-
init_AtlasImage();
|
|
7580
|
-
init_GameIcon();
|
|
7581
|
-
cardSizeMap = {
|
|
7582
|
-
sm: "w-16 h-24",
|
|
7583
|
-
md: "w-20 h-28",
|
|
7584
|
-
lg: "w-24 h-36"
|
|
7585
|
-
};
|
|
7586
|
-
artPxMap = { sm: 40, md: 52, lg: 64 };
|
|
7587
|
-
ANIM_STATE_CLASS = {
|
|
7588
|
-
idle: "",
|
|
7589
|
-
drawn: "scale-105",
|
|
7590
|
-
played: "-translate-y-2 opacity-80",
|
|
7591
|
-
flipped: "scale-x-0"
|
|
7592
|
-
};
|
|
7593
|
-
GameCard.displayName = "GameCard";
|
|
7594
|
-
}
|
|
7595
|
-
});
|
|
7596
7486
|
function HealthBar({
|
|
7597
7487
|
current = 3,
|
|
7598
7488
|
max = 5,
|
|
@@ -7797,9 +7687,9 @@ function ControlButton({
|
|
|
7797
7687
|
className
|
|
7798
7688
|
}) {
|
|
7799
7689
|
const eventBus = useEventBus();
|
|
7800
|
-
const [isPressed, setIsPressed] =
|
|
7690
|
+
const [isPressed, setIsPressed] = React83.useState(false);
|
|
7801
7691
|
const actualPressed = pressed ?? isPressed;
|
|
7802
|
-
const handlePointerDown =
|
|
7692
|
+
const handlePointerDown = React83.useCallback(
|
|
7803
7693
|
(e) => {
|
|
7804
7694
|
e.preventDefault();
|
|
7805
7695
|
if (disabled) return;
|
|
@@ -7809,7 +7699,7 @@ function ControlButton({
|
|
|
7809
7699
|
},
|
|
7810
7700
|
[disabled, pressEvent, eventBus, onPress]
|
|
7811
7701
|
);
|
|
7812
|
-
const handlePointerUp =
|
|
7702
|
+
const handlePointerUp = React83.useCallback(
|
|
7813
7703
|
(e) => {
|
|
7814
7704
|
e.preventDefault();
|
|
7815
7705
|
if (disabled) return;
|
|
@@ -7819,7 +7709,7 @@ function ControlButton({
|
|
|
7819
7709
|
},
|
|
7820
7710
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
7821
7711
|
);
|
|
7822
|
-
const handlePointerLeave =
|
|
7712
|
+
const handlePointerLeave = React83.useCallback(
|
|
7823
7713
|
(e) => {
|
|
7824
7714
|
if (isPressed) {
|
|
7825
7715
|
setIsPressed(false);
|
|
@@ -7890,157 +7780,6 @@ var init_ControlButton = __esm({
|
|
|
7890
7780
|
ControlButton.displayName = "ControlButton";
|
|
7891
7781
|
}
|
|
7892
7782
|
});
|
|
7893
|
-
function Sprite({
|
|
7894
|
-
spritesheet = DEFAULT_SPRITESHEET,
|
|
7895
|
-
frameWidth = 64,
|
|
7896
|
-
frameHeight = 64,
|
|
7897
|
-
frame = 0,
|
|
7898
|
-
x = 0,
|
|
7899
|
-
y = 0,
|
|
7900
|
-
scale = 1,
|
|
7901
|
-
flipX = false,
|
|
7902
|
-
flipY = false,
|
|
7903
|
-
rotation = 0,
|
|
7904
|
-
opacity = 1,
|
|
7905
|
-
zIndex = 0,
|
|
7906
|
-
columns = 16,
|
|
7907
|
-
animState: _animState,
|
|
7908
|
-
frameRate: _frameRate,
|
|
7909
|
-
className,
|
|
7910
|
-
onClick,
|
|
7911
|
-
action
|
|
7912
|
-
}) {
|
|
7913
|
-
const eventBus = useEventBus();
|
|
7914
|
-
const sourcePosition = useMemo(() => {
|
|
7915
|
-
const { sx, sy } = frameRect(frame, Math.floor(frame / columns), columns, frameWidth, frameHeight);
|
|
7916
|
-
return { x: sx, y: sy };
|
|
7917
|
-
}, [frame, columns, frameWidth, frameHeight]);
|
|
7918
|
-
const transform = useMemo(() => {
|
|
7919
|
-
const transforms = [
|
|
7920
|
-
`translate(${x}px, ${y}px)`
|
|
7921
|
-
];
|
|
7922
|
-
if (scale !== 1) {
|
|
7923
|
-
transforms.push(`scale(${scale})`);
|
|
7924
|
-
}
|
|
7925
|
-
if (flipX || flipY) {
|
|
7926
|
-
transforms.push(`scale(${flipX ? -1 : 1}, ${flipY ? -1 : 1})`);
|
|
7927
|
-
}
|
|
7928
|
-
if (rotation !== 0) {
|
|
7929
|
-
transforms.push(`rotate(${rotation}deg)`);
|
|
7930
|
-
}
|
|
7931
|
-
return transforms.join(" ");
|
|
7932
|
-
}, [x, y, scale, flipX, flipY, rotation]);
|
|
7933
|
-
const backgroundPosition = `-${sourcePosition.x}px -${sourcePosition.y}px`;
|
|
7934
|
-
const handleClick = () => {
|
|
7935
|
-
if (action) eventBus.emit(`UI:${action}`, {});
|
|
7936
|
-
onClick?.();
|
|
7937
|
-
};
|
|
7938
|
-
return /* @__PURE__ */ jsx(
|
|
7939
|
-
Box,
|
|
7940
|
-
{
|
|
7941
|
-
position: "absolute",
|
|
7942
|
-
className,
|
|
7943
|
-
onClick: action || onClick ? handleClick : void 0,
|
|
7944
|
-
style: {
|
|
7945
|
-
width: frameWidth,
|
|
7946
|
-
height: frameHeight,
|
|
7947
|
-
backgroundImage: `url(${spritesheet.url})`,
|
|
7948
|
-
backgroundPosition,
|
|
7949
|
-
backgroundRepeat: "no-repeat",
|
|
7950
|
-
imageRendering: "pixelated",
|
|
7951
|
-
transform,
|
|
7952
|
-
transformOrigin: "center center",
|
|
7953
|
-
opacity,
|
|
7954
|
-
zIndex,
|
|
7955
|
-
pointerEvents: action || onClick ? "auto" : "none"
|
|
7956
|
-
}
|
|
7957
|
-
}
|
|
7958
|
-
);
|
|
7959
|
-
}
|
|
7960
|
-
var DEFAULT_SPRITESHEET;
|
|
7961
|
-
var init_Sprite = __esm({
|
|
7962
|
-
"components/game/atoms/Sprite.tsx"() {
|
|
7963
|
-
"use client";
|
|
7964
|
-
init_useEventBus();
|
|
7965
|
-
init_Box();
|
|
7966
|
-
init_spriteAnimation();
|
|
7967
|
-
DEFAULT_SPRITESHEET = {
|
|
7968
|
-
url: "https://almadar-kflow-assets.web.app/shared/isometric-blocks/Spritesheet/allTiles_sheet.png",
|
|
7969
|
-
role: "tile",
|
|
7970
|
-
category: "tile"
|
|
7971
|
-
};
|
|
7972
|
-
}
|
|
7973
|
-
});
|
|
7974
|
-
function isKnownState(s) {
|
|
7975
|
-
return s in DEFAULT_STATE_STYLES;
|
|
7976
|
-
}
|
|
7977
|
-
function StateIndicator({
|
|
7978
|
-
assetUrl = DEFAULT_ASSET_URL,
|
|
7979
|
-
state = "idle",
|
|
7980
|
-
label,
|
|
7981
|
-
size = "md",
|
|
7982
|
-
animated = true,
|
|
7983
|
-
stateStyles,
|
|
7984
|
-
className
|
|
7985
|
-
}) {
|
|
7986
|
-
const mergedStyles = stateStyles ? { ...DEFAULT_STATE_STYLES, ...stateStyles } : DEFAULT_STATE_STYLES;
|
|
7987
|
-
const knownState = isKnownState(state) ? state : null;
|
|
7988
|
-
const config = knownState !== null ? mergedStyles[knownState] ?? DEFAULT_STYLE : DEFAULT_STYLE;
|
|
7989
|
-
const displayLabel = label ?? state.charAt(0).toUpperCase() + state.slice(1);
|
|
7990
|
-
return /* @__PURE__ */ jsxs(
|
|
7991
|
-
Box,
|
|
7992
|
-
{
|
|
7993
|
-
display: "inline-flex",
|
|
7994
|
-
className: cn(
|
|
7995
|
-
"items-center gap-1 rounded-full text-foreground font-medium",
|
|
7996
|
-
config.bgClass,
|
|
7997
|
-
SIZE_CLASSES[size],
|
|
7998
|
-
animated && (knownState === null || !STATIC_STATES.has(knownState)) && "animate-pulse",
|
|
7999
|
-
className
|
|
8000
|
-
),
|
|
8001
|
-
children: [
|
|
8002
|
-
/* @__PURE__ */ jsx(Box, { as: "span", children: assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 16, alt: displayLabel, className: "flex-shrink-0" }) : typeof config.icon === "string" ? /^[a-zA-Z0-9-]+$/.test(config.icon) ? /* @__PURE__ */ jsx(Icon, { name: config.icon }) : config.icon : /* @__PURE__ */ jsx(Icon, { icon: config.icon }) }),
|
|
8003
|
-
/* @__PURE__ */ jsx(Box, { as: "span", children: displayLabel })
|
|
8004
|
-
]
|
|
8005
|
-
}
|
|
8006
|
-
);
|
|
8007
|
-
}
|
|
8008
|
-
var DEFAULT_ASSET_URL, DEFAULT_STATE_STYLES, DEFAULT_STYLE, STATIC_STATES, SIZE_CLASSES;
|
|
8009
|
-
var init_StateIndicator = __esm({
|
|
8010
|
-
"components/game/atoms/StateIndicator.tsx"() {
|
|
8011
|
-
init_Box();
|
|
8012
|
-
init_Icon();
|
|
8013
|
-
init_cn();
|
|
8014
|
-
init_GameIcon();
|
|
8015
|
-
DEFAULT_ASSET_URL = {
|
|
8016
|
-
url: "https://almadar-kflow-assets.web.app/shared/isometric-dungeon/Isometric/chestClosed_E.png",
|
|
8017
|
-
role: "ui",
|
|
8018
|
-
category: "state"
|
|
8019
|
-
};
|
|
8020
|
-
DEFAULT_STATE_STYLES = {
|
|
8021
|
-
idle: { icon: "\u23F8", bgClass: "bg-muted" },
|
|
8022
|
-
active: { icon: "\u25B6", bgClass: "bg-success" },
|
|
8023
|
-
sleeping: { icon: "\u{1F4A4}", bgClass: "bg-muted" },
|
|
8024
|
-
moving: { icon: "\u{1F6B6}", bgClass: "bg-info" },
|
|
8025
|
-
eating: { icon: "\u{1F37D}\uFE0F", bgClass: "bg-success" },
|
|
8026
|
-
waiting: { icon: "\u23F3", bgClass: "bg-warning" },
|
|
8027
|
-
happy: { icon: "\u{1F60A}", bgClass: "bg-success" },
|
|
8028
|
-
scared: { icon: "\u{1F628}", bgClass: "bg-error" },
|
|
8029
|
-
done: { icon: "\u2713", bgClass: "bg-success" },
|
|
8030
|
-
error: { icon: "\u2717", bgClass: "bg-error" },
|
|
8031
|
-
ready: { icon: "\u2713", bgClass: "bg-success" },
|
|
8032
|
-
cooldown: { icon: "\u{1F504}", bgClass: "bg-warning" }
|
|
8033
|
-
};
|
|
8034
|
-
DEFAULT_STYLE = { icon: "?", bgClass: "bg-muted" };
|
|
8035
|
-
STATIC_STATES = /* @__PURE__ */ new Set(["idle", "done"]);
|
|
8036
|
-
SIZE_CLASSES = {
|
|
8037
|
-
sm: "text-xs px-1.5 py-0.5",
|
|
8038
|
-
md: "text-sm px-2 py-1",
|
|
8039
|
-
lg: "text-base px-3 py-1.5"
|
|
8040
|
-
};
|
|
8041
|
-
StateIndicator.displayName = "StateIndicator";
|
|
8042
|
-
}
|
|
8043
|
-
});
|
|
8044
7783
|
function formatTime(seconds, format) {
|
|
8045
7784
|
const clamped = Math.max(0, Math.floor(seconds));
|
|
8046
7785
|
if (format === "ss") {
|
|
@@ -8097,524 +7836,6 @@ var init_TimerDisplay = __esm({
|
|
|
8097
7836
|
TimerDisplay.displayName = "TimerDisplay";
|
|
8098
7837
|
}
|
|
8099
7838
|
});
|
|
8100
|
-
function ResourceCounter({
|
|
8101
|
-
assetUrl = DEFAULT_ASSET_URL2,
|
|
8102
|
-
icon,
|
|
8103
|
-
label = "Gold",
|
|
8104
|
-
value = 250,
|
|
8105
|
-
max,
|
|
8106
|
-
color,
|
|
8107
|
-
size = "md",
|
|
8108
|
-
className
|
|
8109
|
-
}) {
|
|
8110
|
-
const sizes = sizeMap6[size];
|
|
8111
|
-
return /* @__PURE__ */ jsxs(
|
|
8112
|
-
Box,
|
|
8113
|
-
{
|
|
8114
|
-
className: cn(
|
|
8115
|
-
"inline-flex items-center rounded-container",
|
|
8116
|
-
"bg-card/80 border border-muted font-medium text-foreground",
|
|
8117
|
-
sizes.wrapper,
|
|
8118
|
-
className
|
|
8119
|
-
),
|
|
8120
|
-
children: [
|
|
8121
|
-
assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: sizes.img, alt: label, className: "flex-shrink-0" }) : icon ? /* @__PURE__ */ jsx(Box, { as: "span", className: cn("flex-shrink-0", sizes.icon), children: typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon }) : /* @__PURE__ */ jsx(Icon, { icon }) }) : null,
|
|
8122
|
-
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground", children: label }),
|
|
8123
|
-
/* @__PURE__ */ jsxs(Typography, { as: "span", className: cn("font-bold tabular-nums", color && (color in colorTokenClasses2 ? colorTokenClasses2[color] : color)), children: [
|
|
8124
|
-
value,
|
|
8125
|
-
max != null && /* @__PURE__ */ jsxs(Typography, { as: "span", className: "text-muted-foreground", children: [
|
|
8126
|
-
"/",
|
|
8127
|
-
max
|
|
8128
|
-
] })
|
|
8129
|
-
] })
|
|
8130
|
-
]
|
|
8131
|
-
}
|
|
8132
|
-
);
|
|
8133
|
-
}
|
|
8134
|
-
var colorTokenClasses2, DEFAULT_ASSET_URL2, sizeMap6;
|
|
8135
|
-
var init_ResourceCounter = __esm({
|
|
8136
|
-
"components/game/atoms/ResourceCounter.tsx"() {
|
|
8137
|
-
init_cn();
|
|
8138
|
-
init_Icon();
|
|
8139
|
-
init_Box();
|
|
8140
|
-
init_Typography();
|
|
8141
|
-
init_GameIcon();
|
|
8142
|
-
colorTokenClasses2 = {
|
|
8143
|
-
primary: "text-primary",
|
|
8144
|
-
secondary: "text-secondary",
|
|
8145
|
-
success: "text-success",
|
|
8146
|
-
warning: "text-warning",
|
|
8147
|
-
error: "text-error",
|
|
8148
|
-
muted: "text-muted-foreground"
|
|
8149
|
-
};
|
|
8150
|
-
DEFAULT_ASSET_URL2 = {
|
|
8151
|
-
url: "https://almadar-kflow-assets.web.app/shared/world-map/gold_mine.png",
|
|
8152
|
-
role: "ui",
|
|
8153
|
-
category: "coin"
|
|
8154
|
-
};
|
|
8155
|
-
sizeMap6 = {
|
|
8156
|
-
sm: { wrapper: "text-xs gap-1 px-1.5 py-0.5", icon: "text-sm", img: 16 },
|
|
8157
|
-
md: { wrapper: "text-sm gap-1.5 px-2 py-1", icon: "text-base", img: 20 },
|
|
8158
|
-
lg: { wrapper: "text-base gap-2 px-3 py-1.5", icon: "text-lg", img: 28 }
|
|
8159
|
-
};
|
|
8160
|
-
ResourceCounter.displayName = "ResourceCounter";
|
|
8161
|
-
}
|
|
8162
|
-
});
|
|
8163
|
-
function ItemSlot({
|
|
8164
|
-
assetUrl = DEFAULT_ASSET_URL3,
|
|
8165
|
-
icon = "sword",
|
|
8166
|
-
label = "Iron Sword",
|
|
8167
|
-
quantity,
|
|
8168
|
-
rarity = "uncommon",
|
|
8169
|
-
empty,
|
|
8170
|
-
size = "md",
|
|
8171
|
-
selected,
|
|
8172
|
-
onClick,
|
|
8173
|
-
action,
|
|
8174
|
-
className
|
|
8175
|
-
}) {
|
|
8176
|
-
const eventBus = useEventBus();
|
|
8177
|
-
const isClickable = onClick != null || action != null;
|
|
8178
|
-
const px = assetSizeMap[size];
|
|
8179
|
-
return /* @__PURE__ */ jsx(
|
|
8180
|
-
Button,
|
|
8181
|
-
{
|
|
8182
|
-
variant: "ghost",
|
|
8183
|
-
onClick: () => {
|
|
8184
|
-
if (action) eventBus.emit(`UI:${action}`, {});
|
|
8185
|
-
onClick?.();
|
|
8186
|
-
},
|
|
8187
|
-
disabled: !isClickable,
|
|
8188
|
-
title: label,
|
|
8189
|
-
className: cn(
|
|
8190
|
-
"relative flex items-center justify-center rounded-interactive border-2",
|
|
8191
|
-
"bg-card/80 transition-all duration-150",
|
|
8192
|
-
sizeMap7[size],
|
|
8193
|
-
empty ? "border-border bg-card/50" : rarityBorderMap[rarity],
|
|
8194
|
-
!empty && rarityGlowMap[rarity],
|
|
8195
|
-
selected && "ring-2 ring-foreground ring-offset-1 ring-offset-background",
|
|
8196
|
-
isClickable && !empty && "hover:brightness-125 cursor-pointer",
|
|
8197
|
-
isClickable && empty && "hover:border-muted cursor-pointer",
|
|
8198
|
-
!isClickable && "cursor-default",
|
|
8199
|
-
className
|
|
8200
|
-
),
|
|
8201
|
-
children: empty ? /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground text-base", children: "+" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8202
|
-
assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: px, alt: label, className: "flex-shrink-0" }) : icon ? /* @__PURE__ */ jsx(Box, { as: "span", className: "flex-shrink-0", children: typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon }) : /* @__PURE__ */ jsx(Icon, { icon }) }) : null,
|
|
8203
|
-
quantity != null && quantity > 1 && /* @__PURE__ */ jsx(
|
|
8204
|
-
Typography,
|
|
8205
|
-
{
|
|
8206
|
-
as: "span",
|
|
8207
|
-
className: cn(
|
|
8208
|
-
"absolute -bottom-1 -right-1 flex items-center justify-center",
|
|
8209
|
-
"min-w-[18px] h-[18px] rounded-full px-1",
|
|
8210
|
-
"bg-surface border border-muted text-xs font-bold text-foreground"
|
|
8211
|
-
),
|
|
8212
|
-
children: quantity
|
|
8213
|
-
}
|
|
8214
|
-
)
|
|
8215
|
-
] })
|
|
8216
|
-
}
|
|
8217
|
-
);
|
|
8218
|
-
}
|
|
8219
|
-
var sizeMap7, rarityBorderMap, rarityGlowMap, DEFAULT_ASSET_URL3, assetSizeMap;
|
|
8220
|
-
var init_ItemSlot = __esm({
|
|
8221
|
-
"components/game/atoms/ItemSlot.tsx"() {
|
|
8222
|
-
"use client";
|
|
8223
|
-
init_cn();
|
|
8224
|
-
init_Icon();
|
|
8225
|
-
init_useEventBus();
|
|
8226
|
-
init_Button();
|
|
8227
|
-
init_Box();
|
|
8228
|
-
init_Typography();
|
|
8229
|
-
init_GameIcon();
|
|
8230
|
-
sizeMap7 = {
|
|
8231
|
-
sm: "w-10 h-10 text-lg",
|
|
8232
|
-
md: "w-14 h-14 text-2xl",
|
|
8233
|
-
lg: "w-18 h-18 text-3xl"
|
|
8234
|
-
};
|
|
8235
|
-
rarityBorderMap = {
|
|
8236
|
-
common: "border-muted",
|
|
8237
|
-
uncommon: "border-success",
|
|
8238
|
-
rare: "border-info",
|
|
8239
|
-
epic: "border-accent",
|
|
8240
|
-
legendary: "border-warning"
|
|
8241
|
-
};
|
|
8242
|
-
rarityGlowMap = {
|
|
8243
|
-
common: "",
|
|
8244
|
-
uncommon: "",
|
|
8245
|
-
rare: "shadow-sm",
|
|
8246
|
-
epic: "shadow-lg",
|
|
8247
|
-
legendary: "shadow-lg"
|
|
8248
|
-
};
|
|
8249
|
-
DEFAULT_ASSET_URL3 = {
|
|
8250
|
-
url: "https://almadar-kflow-assets.web.app/shared/isometric-dungeon/Isometric/chestClosed_E.png",
|
|
8251
|
-
role: "item",
|
|
8252
|
-
category: "item"
|
|
8253
|
-
};
|
|
8254
|
-
assetSizeMap = {
|
|
8255
|
-
sm: 28,
|
|
8256
|
-
md: 40,
|
|
8257
|
-
lg: 56
|
|
8258
|
-
};
|
|
8259
|
-
ItemSlot.displayName = "ItemSlot";
|
|
8260
|
-
}
|
|
8261
|
-
});
|
|
8262
|
-
function TurnIndicator({
|
|
8263
|
-
assetUrl = DEFAULT_ASSET_URL4,
|
|
8264
|
-
currentTurn = 1,
|
|
8265
|
-
maxTurns,
|
|
8266
|
-
activeTeam,
|
|
8267
|
-
phase,
|
|
8268
|
-
size = "md",
|
|
8269
|
-
className
|
|
8270
|
-
}) {
|
|
8271
|
-
const sizes = sizeMap8[size];
|
|
8272
|
-
return /* @__PURE__ */ jsxs(
|
|
8273
|
-
Box,
|
|
8274
|
-
{
|
|
8275
|
-
className: cn(
|
|
8276
|
-
"inline-flex items-center rounded-container",
|
|
8277
|
-
"bg-card/80 border border-muted font-medium text-foreground",
|
|
8278
|
-
sizes.wrapper,
|
|
8279
|
-
className
|
|
8280
|
-
),
|
|
8281
|
-
children: [
|
|
8282
|
-
/* @__PURE__ */ jsxs(Typography, { as: "span", className: "font-bold tabular-nums", children: [
|
|
8283
|
-
"Turn ",
|
|
8284
|
-
currentTurn,
|
|
8285
|
-
maxTurns != null && /* @__PURE__ */ jsxs(Typography, { as: "span", className: "text-muted-foreground", children: [
|
|
8286
|
-
"/",
|
|
8287
|
-
maxTurns
|
|
8288
|
-
] })
|
|
8289
|
-
] }),
|
|
8290
|
-
phase && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8291
|
-
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground", children: "|" }),
|
|
8292
|
-
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground", children: phase })
|
|
8293
|
-
] }),
|
|
8294
|
-
activeTeam && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8295
|
-
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground", children: "|" }),
|
|
8296
|
-
assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 12, className: "flex-shrink-0" }) : /* @__PURE__ */ jsx(Box, { as: "span", className: cn("rounded-full bg-success/20", sizes.dot) }),
|
|
8297
|
-
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-success", children: activeTeam })
|
|
8298
|
-
] })
|
|
8299
|
-
]
|
|
8300
|
-
}
|
|
8301
|
-
);
|
|
8302
|
-
}
|
|
8303
|
-
var sizeMap8, DEFAULT_ASSET_URL4;
|
|
8304
|
-
var init_TurnIndicator = __esm({
|
|
8305
|
-
"components/game/atoms/TurnIndicator.tsx"() {
|
|
8306
|
-
init_cn();
|
|
8307
|
-
init_Box();
|
|
8308
|
-
init_Typography();
|
|
8309
|
-
init_GameIcon();
|
|
8310
|
-
sizeMap8 = {
|
|
8311
|
-
sm: { wrapper: "text-xs gap-1.5 px-2 py-0.5", dot: "w-1.5 h-1.5" },
|
|
8312
|
-
md: { wrapper: "text-sm gap-2 px-3 py-1", dot: "w-2 h-2" },
|
|
8313
|
-
lg: { wrapper: "text-base gap-2.5 px-4 py-1.5", dot: "w-2.5 h-2.5" }
|
|
8314
|
-
};
|
|
8315
|
-
DEFAULT_ASSET_URL4 = {
|
|
8316
|
-
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/symbol_01.png",
|
|
8317
|
-
role: "ui",
|
|
8318
|
-
category: "turn"
|
|
8319
|
-
};
|
|
8320
|
-
TurnIndicator.displayName = "TurnIndicator";
|
|
8321
|
-
}
|
|
8322
|
-
});
|
|
8323
|
-
function getComboIntensity(combo) {
|
|
8324
|
-
if (combo >= 10) return "text-error animate-pulse";
|
|
8325
|
-
if (combo >= 7) return "text-warning";
|
|
8326
|
-
if (combo >= 4) return "text-warning";
|
|
8327
|
-
return "text-foreground";
|
|
8328
|
-
}
|
|
8329
|
-
function getComboScale(combo) {
|
|
8330
|
-
if (combo >= 10) return "scale-110";
|
|
8331
|
-
if (combo >= 5) return "scale-105";
|
|
8332
|
-
return "";
|
|
8333
|
-
}
|
|
8334
|
-
function ComboCounter({
|
|
8335
|
-
assetUrl = DEFAULT_ASSET_URL5,
|
|
8336
|
-
combo = 5,
|
|
8337
|
-
multiplier,
|
|
8338
|
-
streak,
|
|
8339
|
-
size = "md",
|
|
8340
|
-
className
|
|
8341
|
-
}) {
|
|
8342
|
-
const sizes = sizeMap9[size];
|
|
8343
|
-
if (combo <= 0) return null;
|
|
8344
|
-
return /* @__PURE__ */ jsxs(
|
|
8345
|
-
Box,
|
|
8346
|
-
{
|
|
8347
|
-
className: cn(
|
|
8348
|
-
"inline-flex flex-col items-center justify-center",
|
|
8349
|
-
"rounded-container bg-card/80 border border-muted px-3 py-1.5",
|
|
8350
|
-
"transition-transform duration-200",
|
|
8351
|
-
getComboScale(combo),
|
|
8352
|
-
className
|
|
8353
|
-
),
|
|
8354
|
-
children: [
|
|
8355
|
-
assetUrl && /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 24, className: "flex-shrink-0 mb-0.5" }),
|
|
8356
|
-
/* @__PURE__ */ jsx(Typography, { as: "span", className: cn("font-black tabular-nums leading-none", sizes.combo, getComboIntensity(combo)), children: combo }),
|
|
8357
|
-
/* @__PURE__ */ jsx(Typography, { as: "span", className: cn("font-bold uppercase tracking-wider text-muted-foreground", sizes.label), children: "combo" }),
|
|
8358
|
-
multiplier != null && multiplier > 1 && /* @__PURE__ */ jsxs(Typography, { as: "span", className: cn("font-bold text-warning tabular-nums", sizes.multiplier), children: [
|
|
8359
|
-
"x",
|
|
8360
|
-
multiplier.toFixed(1)
|
|
8361
|
-
] }),
|
|
8362
|
-
streak != null && streak > 0 && /* @__PURE__ */ jsxs(Typography, { as: "span", className: cn("text-muted-foreground tabular-nums", sizes.label), children: [
|
|
8363
|
-
streak,
|
|
8364
|
-
" streak"
|
|
8365
|
-
] })
|
|
8366
|
-
]
|
|
8367
|
-
}
|
|
8368
|
-
);
|
|
8369
|
-
}
|
|
8370
|
-
var DEFAULT_ASSET_URL5, sizeMap9;
|
|
8371
|
-
var init_ComboCounter = __esm({
|
|
8372
|
-
"components/game/atoms/ComboCounter.tsx"() {
|
|
8373
|
-
init_cn();
|
|
8374
|
-
init_Box();
|
|
8375
|
-
init_Typography();
|
|
8376
|
-
init_GameIcon();
|
|
8377
|
-
DEFAULT_ASSET_URL5 = {
|
|
8378
|
-
url: "https://almadar-kflow-assets.web.app/shared/effects/flash/flash00.png",
|
|
8379
|
-
role: "effect",
|
|
8380
|
-
category: "effect"
|
|
8381
|
-
};
|
|
8382
|
-
sizeMap9 = {
|
|
8383
|
-
sm: { combo: "text-lg", label: "text-xs", multiplier: "text-xs" },
|
|
8384
|
-
md: { combo: "text-2xl", label: "text-xs", multiplier: "text-sm" },
|
|
8385
|
-
lg: { combo: "text-4xl", label: "text-sm", multiplier: "text-base" }
|
|
8386
|
-
};
|
|
8387
|
-
ComboCounter.displayName = "ComboCounter";
|
|
8388
|
-
}
|
|
8389
|
-
});
|
|
8390
|
-
function WaypointMarker({
|
|
8391
|
-
assetUrl = DEFAULT_ASSET_URL6,
|
|
8392
|
-
label,
|
|
8393
|
-
icon,
|
|
8394
|
-
active = true,
|
|
8395
|
-
completed = false,
|
|
8396
|
-
size = "md",
|
|
8397
|
-
className
|
|
8398
|
-
}) {
|
|
8399
|
-
const sizes = sizeMap10[size];
|
|
8400
|
-
return /* @__PURE__ */ jsxs(Box, { className: cn("flex flex-col items-center", className), children: [
|
|
8401
|
-
/* @__PURE__ */ jsxs(Box, { className: "relative flex items-center justify-center", children: [
|
|
8402
|
-
active && /* @__PURE__ */ jsx(
|
|
8403
|
-
Box,
|
|
8404
|
-
{
|
|
8405
|
-
position: "absolute",
|
|
8406
|
-
className: cn(
|
|
8407
|
-
"rounded-full border-2 border-info animate-ping opacity-50",
|
|
8408
|
-
sizes.ring
|
|
8409
|
-
)
|
|
8410
|
-
}
|
|
8411
|
-
),
|
|
8412
|
-
active && /* @__PURE__ */ jsx(
|
|
8413
|
-
Box,
|
|
8414
|
-
{
|
|
8415
|
-
position: "absolute",
|
|
8416
|
-
className: cn(
|
|
8417
|
-
"rounded-full border-2 border-info",
|
|
8418
|
-
sizes.ring
|
|
8419
|
-
)
|
|
8420
|
-
}
|
|
8421
|
-
),
|
|
8422
|
-
/* @__PURE__ */ jsx(
|
|
8423
|
-
Box,
|
|
8424
|
-
{
|
|
8425
|
-
position: "relative",
|
|
8426
|
-
className: cn(
|
|
8427
|
-
"flex items-center justify-center rounded-full transition-all duration-200",
|
|
8428
|
-
sizes.dot,
|
|
8429
|
-
completed && "bg-success text-foreground",
|
|
8430
|
-
active && !completed && "bg-info text-foreground",
|
|
8431
|
-
!active && !completed && "bg-muted"
|
|
8432
|
-
),
|
|
8433
|
-
children: completed ? checkIcon : assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: sizes.img, alt: label, className: "flex-shrink-0" }) : icon ? typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon }) : /* @__PURE__ */ jsx(Icon, { icon }) : null
|
|
8434
|
-
}
|
|
8435
|
-
)
|
|
8436
|
-
] }),
|
|
8437
|
-
label && /* @__PURE__ */ jsx(
|
|
8438
|
-
Typography,
|
|
8439
|
-
{
|
|
8440
|
-
as: "span",
|
|
8441
|
-
className: cn(
|
|
8442
|
-
"text-center whitespace-nowrap",
|
|
8443
|
-
sizes.label,
|
|
8444
|
-
completed ? "text-success" : active ? "text-info" : "text-muted-foreground"
|
|
8445
|
-
),
|
|
8446
|
-
children: label
|
|
8447
|
-
}
|
|
8448
|
-
)
|
|
8449
|
-
] });
|
|
8450
|
-
}
|
|
8451
|
-
var DEFAULT_ASSET_URL6, sizeMap10, checkIcon;
|
|
8452
|
-
var init_WaypointMarker = __esm({
|
|
8453
|
-
"components/game/atoms/WaypointMarker.tsx"() {
|
|
8454
|
-
init_cn();
|
|
8455
|
-
init_Icon();
|
|
8456
|
-
init_Box();
|
|
8457
|
-
init_Typography();
|
|
8458
|
-
init_GameIcon();
|
|
8459
|
-
DEFAULT_ASSET_URL6 = {
|
|
8460
|
-
url: "https://almadar-kflow-assets.web.app/shared/world-map/battle_marker.png",
|
|
8461
|
-
role: "ui",
|
|
8462
|
-
category: "waypoint"
|
|
8463
|
-
};
|
|
8464
|
-
sizeMap10 = {
|
|
8465
|
-
sm: { dot: "w-4 h-4", ring: "w-6 h-6", label: "text-xs mt-1", img: 12 },
|
|
8466
|
-
md: { dot: "w-6 h-6", ring: "w-8 h-8", label: "text-sm mt-1.5", img: 18 },
|
|
8467
|
-
lg: { dot: "w-8 h-8", ring: "w-10 h-10", label: "text-base mt-2", img: 24 }
|
|
8468
|
-
};
|
|
8469
|
-
checkIcon = /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 3, className: "w-3/5 h-3/5", children: /* @__PURE__ */ jsx("path", { d: "M5 13l4 4L19 7", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
8470
|
-
WaypointMarker.displayName = "WaypointMarker";
|
|
8471
|
-
}
|
|
8472
|
-
});
|
|
8473
|
-
function formatDuration(seconds) {
|
|
8474
|
-
if (seconds >= 60) {
|
|
8475
|
-
return `${Math.floor(seconds / 60)}m`;
|
|
8476
|
-
}
|
|
8477
|
-
return `${Math.round(seconds)}s`;
|
|
8478
|
-
}
|
|
8479
|
-
function StatusEffect({
|
|
8480
|
-
assetUrl = DEFAULT_ASSET_URL7,
|
|
8481
|
-
icon,
|
|
8482
|
-
label = "Shield",
|
|
8483
|
-
duration = 30,
|
|
8484
|
-
stacks,
|
|
8485
|
-
variant = "buff",
|
|
8486
|
-
size = "md",
|
|
8487
|
-
className
|
|
8488
|
-
}) {
|
|
8489
|
-
const sizes = sizeMap11[size];
|
|
8490
|
-
return /* @__PURE__ */ jsxs(Box, { position: "relative", className: cn("inline-flex flex-col items-center", className), children: [
|
|
8491
|
-
/* @__PURE__ */ jsxs(
|
|
8492
|
-
Box,
|
|
8493
|
-
{
|
|
8494
|
-
position: "relative",
|
|
8495
|
-
className: cn(
|
|
8496
|
-
"flex items-center justify-center rounded-interactive border-2",
|
|
8497
|
-
sizes.container,
|
|
8498
|
-
variantStyles7[variant]
|
|
8499
|
-
),
|
|
8500
|
-
title: label,
|
|
8501
|
-
children: [
|
|
8502
|
-
/* @__PURE__ */ jsx(Box, { as: "span", className: cn("flex items-center justify-center", sizes.icon), children: assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: sizes.img, alt: label, className: "flex-shrink-0" }) : icon != null && typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon, size: "sm" }) : icon != null ? /* @__PURE__ */ jsx(Icon, { icon, size: "sm" }) : null }),
|
|
8503
|
-
duration !== void 0 && /* @__PURE__ */ jsx(
|
|
8504
|
-
Typography,
|
|
8505
|
-
{
|
|
8506
|
-
as: "span",
|
|
8507
|
-
className: cn(
|
|
8508
|
-
"absolute bottom-0 left-0 right-0 text-center font-mono font-bold text-foreground bg-background/60 leading-tight",
|
|
8509
|
-
sizes.timer
|
|
8510
|
-
),
|
|
8511
|
-
children: formatDuration(duration)
|
|
8512
|
-
}
|
|
8513
|
-
)
|
|
8514
|
-
]
|
|
8515
|
-
}
|
|
8516
|
-
),
|
|
8517
|
-
stacks !== void 0 && stacks > 1 && /* @__PURE__ */ jsx(
|
|
8518
|
-
Typography,
|
|
8519
|
-
{
|
|
8520
|
-
as: "span",
|
|
8521
|
-
className: cn(
|
|
8522
|
-
"absolute flex items-center justify-center rounded-full bg-card text-foreground font-bold leading-none",
|
|
8523
|
-
sizes.badge
|
|
8524
|
-
),
|
|
8525
|
-
children: stacks
|
|
8526
|
-
}
|
|
8527
|
-
),
|
|
8528
|
-
label && /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-xs text-muted-foreground mt-0.5 text-center whitespace-nowrap", children: label })
|
|
8529
|
-
] });
|
|
8530
|
-
}
|
|
8531
|
-
var DEFAULT_ASSET_URL7, sizeMap11, variantStyles7;
|
|
8532
|
-
var init_StatusEffect = __esm({
|
|
8533
|
-
"components/game/atoms/StatusEffect.tsx"() {
|
|
8534
|
-
init_cn();
|
|
8535
|
-
init_Icon();
|
|
8536
|
-
init_Box();
|
|
8537
|
-
init_Typography();
|
|
8538
|
-
init_GameIcon();
|
|
8539
|
-
DEFAULT_ASSET_URL7 = {
|
|
8540
|
-
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/flame_01.png",
|
|
8541
|
-
role: "ui",
|
|
8542
|
-
category: "effect"
|
|
8543
|
-
};
|
|
8544
|
-
sizeMap11 = {
|
|
8545
|
-
sm: { container: "w-8 h-8", icon: "text-sm", badge: "text-xs -top-1 -right-1 w-4 h-4", timer: "text-[9px]", img: 20 },
|
|
8546
|
-
md: { container: "w-10 h-10", icon: "text-base", badge: "text-xs -top-1 -right-1 w-5 h-5", timer: "text-xs", img: 28 },
|
|
8547
|
-
lg: { container: "w-12 h-12", icon: "text-lg", badge: "text-sm -top-1.5 -right-1.5 w-6 h-6", timer: "text-xs", img: 36 }
|
|
8548
|
-
};
|
|
8549
|
-
variantStyles7 = {
|
|
8550
|
-
buff: "border-success bg-success/20",
|
|
8551
|
-
debuff: "border-error bg-error/20",
|
|
8552
|
-
neutral: "border-muted bg-muted/20"
|
|
8553
|
-
};
|
|
8554
|
-
StatusEffect.displayName = "StatusEffect";
|
|
8555
|
-
}
|
|
8556
|
-
});
|
|
8557
|
-
function DamageNumber({
|
|
8558
|
-
assetUrl = DEFAULT_ASSET_URL8,
|
|
8559
|
-
value = 42,
|
|
8560
|
-
type = "damage",
|
|
8561
|
-
size = "md",
|
|
8562
|
-
className
|
|
8563
|
-
}) {
|
|
8564
|
-
const displayText = type === "miss" ? "MISS" : type === "heal" ? `+${value}` : `${value}`;
|
|
8565
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8566
|
-
/* @__PURE__ */ jsx("style", { children: floatKeyframes }),
|
|
8567
|
-
/* @__PURE__ */ jsxs(
|
|
8568
|
-
Typography,
|
|
8569
|
-
{
|
|
8570
|
-
as: "span",
|
|
8571
|
-
className: cn(
|
|
8572
|
-
"inline-flex items-center gap-0.5 font-mono select-none pointer-events-none",
|
|
8573
|
-
sizeMap12[size],
|
|
8574
|
-
typeStyles[type],
|
|
8575
|
-
className
|
|
8576
|
-
),
|
|
8577
|
-
style: { animation: "damageFloat 1s ease-out forwards" },
|
|
8578
|
-
children: [
|
|
8579
|
-
assetUrl && /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 14, className: "flex-shrink-0" }),
|
|
8580
|
-
displayText
|
|
8581
|
-
]
|
|
8582
|
-
}
|
|
8583
|
-
)
|
|
8584
|
-
] });
|
|
8585
|
-
}
|
|
8586
|
-
var sizeMap12, typeStyles, floatKeyframes, DEFAULT_ASSET_URL8;
|
|
8587
|
-
var init_DamageNumber = __esm({
|
|
8588
|
-
"components/game/atoms/DamageNumber.tsx"() {
|
|
8589
|
-
init_cn();
|
|
8590
|
-
init_Typography();
|
|
8591
|
-
init_GameIcon();
|
|
8592
|
-
sizeMap12 = {
|
|
8593
|
-
sm: "text-sm",
|
|
8594
|
-
md: "text-lg",
|
|
8595
|
-
lg: "text-2xl"
|
|
8596
|
-
};
|
|
8597
|
-
typeStyles = {
|
|
8598
|
-
damage: "text-error font-bold",
|
|
8599
|
-
heal: "text-success font-bold",
|
|
8600
|
-
crit: "text-warning font-extrabold",
|
|
8601
|
-
miss: "text-muted-foreground italic"
|
|
8602
|
-
};
|
|
8603
|
-
floatKeyframes = `
|
|
8604
|
-
@keyframes damageFloat {
|
|
8605
|
-
0% { opacity: 1; transform: translateY(0) scale(1); }
|
|
8606
|
-
20% { transform: translateY(-8px) scale(1.1); }
|
|
8607
|
-
100% { opacity: 0; transform: translateY(-32px) scale(0.8); }
|
|
8608
|
-
}
|
|
8609
|
-
`;
|
|
8610
|
-
DEFAULT_ASSET_URL8 = {
|
|
8611
|
-
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/spark_01.png",
|
|
8612
|
-
role: "effect",
|
|
8613
|
-
category: "effect"
|
|
8614
|
-
};
|
|
8615
|
-
DamageNumber.displayName = "DamageNumber";
|
|
8616
|
-
}
|
|
8617
|
-
});
|
|
8618
7839
|
function DialogueBubble({
|
|
8619
7840
|
speaker = "Hero",
|
|
8620
7841
|
text = "The dungeon awaits. Choose your path wisely.",
|
|
@@ -8676,16 +7897,14 @@ function ChoiceButton({
|
|
|
8676
7897
|
payload,
|
|
8677
7898
|
className
|
|
8678
7899
|
}) {
|
|
8679
|
-
const eventBus = useEventBus();
|
|
8680
7900
|
return /* @__PURE__ */ jsxs(
|
|
8681
7901
|
Button,
|
|
8682
7902
|
{
|
|
8683
7903
|
variant: "ghost",
|
|
8684
7904
|
disabled,
|
|
8685
|
-
|
|
8686
|
-
|
|
8687
|
-
|
|
8688
|
-
},
|
|
7905
|
+
action,
|
|
7906
|
+
actionPayload: payload,
|
|
7907
|
+
onClick,
|
|
8689
7908
|
className: cn(
|
|
8690
7909
|
"w-full text-left px-4 py-2.5 rounded-interactive border transition-all duration-150",
|
|
8691
7910
|
"flex items-center gap-2",
|
|
@@ -8724,7 +7943,6 @@ var init_ChoiceButton = __esm({
|
|
|
8724
7943
|
"components/game/atoms/ChoiceButton.tsx"() {
|
|
8725
7944
|
init_cn();
|
|
8726
7945
|
init_Icon();
|
|
8727
|
-
init_useEventBus();
|
|
8728
7946
|
init_Button();
|
|
8729
7947
|
init_Box();
|
|
8730
7948
|
init_Typography();
|
|
@@ -8732,250 +7950,6 @@ var init_ChoiceButton = __esm({
|
|
|
8732
7950
|
ChoiceButton.displayName = "ChoiceButton";
|
|
8733
7951
|
}
|
|
8734
7952
|
});
|
|
8735
|
-
function ActionButton({
|
|
8736
|
-
assetUrl = DEFAULT_ASSET_URL9,
|
|
8737
|
-
label = "Attack",
|
|
8738
|
-
icon,
|
|
8739
|
-
cooldown = 0,
|
|
8740
|
-
disabled = false,
|
|
8741
|
-
hotkey,
|
|
8742
|
-
size = "md",
|
|
8743
|
-
variant = "primary",
|
|
8744
|
-
onClick,
|
|
8745
|
-
action,
|
|
8746
|
-
className
|
|
8747
|
-
}) {
|
|
8748
|
-
const eventBus = useEventBus();
|
|
8749
|
-
const sizes = sizeMap13[size];
|
|
8750
|
-
const onCooldown = cooldown > 0;
|
|
8751
|
-
const isDisabled = disabled || onCooldown;
|
|
8752
|
-
const cooldownDeg = Math.round(cooldown * 360);
|
|
8753
|
-
return /* @__PURE__ */ jsxs(
|
|
8754
|
-
Button,
|
|
8755
|
-
{
|
|
8756
|
-
variant: variant === "danger" ? "danger" : variant === "secondary" ? "secondary" : "primary",
|
|
8757
|
-
disabled: isDisabled,
|
|
8758
|
-
onClick: () => {
|
|
8759
|
-
if (action) eventBus.emit(`UI:${action}`, {});
|
|
8760
|
-
onClick?.();
|
|
8761
|
-
},
|
|
8762
|
-
className: cn(
|
|
8763
|
-
"relative inline-flex items-center gap-1.5 rounded-interactive border font-medium overflow-hidden transition-colors duration-150",
|
|
8764
|
-
sizes.button,
|
|
8765
|
-
variantStyles8[variant],
|
|
8766
|
-
isDisabled && "opacity-60 cursor-not-allowed",
|
|
8767
|
-
className
|
|
8768
|
-
),
|
|
8769
|
-
children: [
|
|
8770
|
-
onCooldown && /* @__PURE__ */ jsx(
|
|
8771
|
-
Box,
|
|
8772
|
-
{
|
|
8773
|
-
position: "absolute",
|
|
8774
|
-
className: "inset-0 bg-foreground/40 pointer-events-none",
|
|
8775
|
-
style: {
|
|
8776
|
-
clipPath: `conic-gradient(from 0deg, transparent ${360 - cooldownDeg}deg, black ${360 - cooldownDeg}deg)`,
|
|
8777
|
-
WebkitClipPath: `conic-gradient(from 0deg, transparent ${360 - cooldownDeg}deg, black ${360 - cooldownDeg}deg)`,
|
|
8778
|
-
background: `conic-gradient(from 0deg, transparent ${360 - cooldownDeg}deg, rgba(0,0,0,0.6) ${360 - cooldownDeg}deg)`
|
|
8779
|
-
}
|
|
8780
|
-
}
|
|
8781
|
-
),
|
|
8782
|
-
assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 16, className: cn("flex-shrink-0", sizes.icon) }) : icon ? /* @__PURE__ */ jsx(Box, { as: "span", className: cn("flex-shrink-0", sizes.icon), children: typeof icon === "string" ? (() => {
|
|
8783
|
-
const I = resolveIcon(icon);
|
|
8784
|
-
return I ? /* @__PURE__ */ jsx(I, { className: "w-4 h-4" }) : null;
|
|
8785
|
-
})() : /* @__PURE__ */ (() => {
|
|
8786
|
-
const I = icon;
|
|
8787
|
-
return /* @__PURE__ */ jsx(I, { className: "w-4 h-4" });
|
|
8788
|
-
})() }) : null,
|
|
8789
|
-
/* @__PURE__ */ jsx(Typography, { as: "span", className: "relative z-10", children: label }),
|
|
8790
|
-
hotkey && /* @__PURE__ */ jsx(
|
|
8791
|
-
Typography,
|
|
8792
|
-
{
|
|
8793
|
-
as: "span",
|
|
8794
|
-
className: cn(
|
|
8795
|
-
"absolute top-0.5 right-0.5 bg-foreground/30 text-primary-foreground rounded font-mono leading-tight",
|
|
8796
|
-
sizes.hotkey
|
|
8797
|
-
),
|
|
8798
|
-
children: hotkey
|
|
8799
|
-
}
|
|
8800
|
-
)
|
|
8801
|
-
]
|
|
8802
|
-
}
|
|
8803
|
-
);
|
|
8804
|
-
}
|
|
8805
|
-
var sizeMap13, variantStyles8, DEFAULT_ASSET_URL9;
|
|
8806
|
-
var init_ActionButton = __esm({
|
|
8807
|
-
"components/game/atoms/ActionButton.tsx"() {
|
|
8808
|
-
init_cn();
|
|
8809
|
-
init_Icon();
|
|
8810
|
-
init_useEventBus();
|
|
8811
|
-
init_Button();
|
|
8812
|
-
init_Box();
|
|
8813
|
-
init_Typography();
|
|
8814
|
-
init_GameIcon();
|
|
8815
|
-
sizeMap13 = {
|
|
8816
|
-
sm: { button: "h-button-sm px-3 text-xs", hotkey: "text-[9px] px-1", icon: "text-xs" },
|
|
8817
|
-
md: { button: "h-button-md px-4 text-sm", hotkey: "text-xs px-1.5", icon: "text-sm" },
|
|
8818
|
-
lg: { button: "h-button-lg px-5 text-base", hotkey: "text-xs px-2", icon: "text-base" }
|
|
8819
|
-
};
|
|
8820
|
-
variantStyles8 = {
|
|
8821
|
-
primary: "bg-primary text-primary-foreground hover:bg-primary-hover border-primary",
|
|
8822
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary-hover border-border",
|
|
8823
|
-
danger: "bg-error text-error-foreground hover:bg-error/90 border-error"
|
|
8824
|
-
};
|
|
8825
|
-
DEFAULT_ASSET_URL9 = {
|
|
8826
|
-
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/slash_01.png",
|
|
8827
|
-
role: "ui",
|
|
8828
|
-
category: "action"
|
|
8829
|
-
};
|
|
8830
|
-
ActionButton.displayName = "ActionButton";
|
|
8831
|
-
}
|
|
8832
|
-
});
|
|
8833
|
-
function MiniMap({
|
|
8834
|
-
tiles = DEFAULT_TILES,
|
|
8835
|
-
units = DEFAULT_UNITS,
|
|
8836
|
-
width = 150,
|
|
8837
|
-
height = 150,
|
|
8838
|
-
mapWidth = 100,
|
|
8839
|
-
mapHeight = 100,
|
|
8840
|
-
viewportRect = DEFAULT_VIEWPORT,
|
|
8841
|
-
className,
|
|
8842
|
-
tileAssets,
|
|
8843
|
-
unitAssets
|
|
8844
|
-
}) {
|
|
8845
|
-
const canvasRef = React90.useRef(null);
|
|
8846
|
-
const imgCacheRef = React90.useRef(/* @__PURE__ */ new Map());
|
|
8847
|
-
function loadImg(url) {
|
|
8848
|
-
const cached = imgCacheRef.current.get(url);
|
|
8849
|
-
if (cached) return cached.complete ? cached : null;
|
|
8850
|
-
const img = new Image();
|
|
8851
|
-
img.src = url;
|
|
8852
|
-
img.onload = () => {
|
|
8853
|
-
const canvas = canvasRef.current;
|
|
8854
|
-
if (!canvas) return;
|
|
8855
|
-
const ctx = canvas.getContext("2d");
|
|
8856
|
-
if (ctx) ctx.clearRect(0, 0, 0, 0);
|
|
8857
|
-
};
|
|
8858
|
-
imgCacheRef.current.set(url, img);
|
|
8859
|
-
return null;
|
|
8860
|
-
}
|
|
8861
|
-
React90.useEffect(() => {
|
|
8862
|
-
const canvas = canvasRef.current;
|
|
8863
|
-
if (!canvas) return;
|
|
8864
|
-
const ctx = canvas.getContext("2d");
|
|
8865
|
-
if (!ctx) return;
|
|
8866
|
-
const scaleX2 = width / mapWidth;
|
|
8867
|
-
const scaleY2 = height / mapHeight;
|
|
8868
|
-
ctx.clearRect(0, 0, width, height);
|
|
8869
|
-
ctx.fillStyle = "#111";
|
|
8870
|
-
ctx.fillRect(0, 0, width, height);
|
|
8871
|
-
for (const tile of tiles) {
|
|
8872
|
-
const tileAsset = tileAssets?.[tile.color] ?? tileAssets?.["default"];
|
|
8873
|
-
const tileImg = tileAsset ? loadImg(tileAsset.url) : null;
|
|
8874
|
-
const tx = Math.floor(tile.x * scaleX2);
|
|
8875
|
-
const ty = Math.floor(tile.y * scaleY2);
|
|
8876
|
-
const tw = Math.max(1, Math.ceil(scaleX2));
|
|
8877
|
-
const th = Math.max(1, Math.ceil(scaleY2));
|
|
8878
|
-
if (tileImg) {
|
|
8879
|
-
ctx.drawImage(tileImg, tx, ty, tw, th);
|
|
8880
|
-
} else {
|
|
8881
|
-
ctx.fillStyle = tile.color;
|
|
8882
|
-
ctx.fillRect(tx, ty, tw, th);
|
|
8883
|
-
}
|
|
8884
|
-
}
|
|
8885
|
-
for (const unit of units) {
|
|
8886
|
-
if (unit.isPlayer) continue;
|
|
8887
|
-
const unitAsset = unitAssets?.[unit.color] ?? unitAssets?.["default"];
|
|
8888
|
-
const unitImg = unitAsset ? loadImg(unitAsset.url) : null;
|
|
8889
|
-
const ux = Math.floor(unit.x * scaleX2) - 1;
|
|
8890
|
-
const uy = Math.floor(unit.y * scaleY2) - 1;
|
|
8891
|
-
if (unitImg) {
|
|
8892
|
-
ctx.drawImage(unitImg, ux, uy, 5, 5);
|
|
8893
|
-
} else {
|
|
8894
|
-
ctx.fillStyle = unit.color;
|
|
8895
|
-
ctx.fillRect(ux, uy, 3, 3);
|
|
8896
|
-
}
|
|
8897
|
-
}
|
|
8898
|
-
if (viewportRect) {
|
|
8899
|
-
ctx.strokeStyle = "#ffffff";
|
|
8900
|
-
ctx.lineWidth = 1;
|
|
8901
|
-
ctx.strokeRect(
|
|
8902
|
-
Math.floor(viewportRect.x * scaleX2),
|
|
8903
|
-
Math.floor(viewportRect.y * scaleY2),
|
|
8904
|
-
Math.floor(viewportRect.w * scaleX2),
|
|
8905
|
-
Math.floor(viewportRect.h * scaleY2)
|
|
8906
|
-
);
|
|
8907
|
-
}
|
|
8908
|
-
}, [tiles, units, width, height, mapWidth, mapHeight, viewportRect, tileAssets, unitAssets]);
|
|
8909
|
-
const scaleX = width / mapWidth;
|
|
8910
|
-
const scaleY = height / mapHeight;
|
|
8911
|
-
const playerUnit = units.find((u) => u.isPlayer);
|
|
8912
|
-
const playerLeft = playerUnit ? Math.floor(playerUnit.x * scaleX) - 1 : null;
|
|
8913
|
-
const playerTop = playerUnit ? Math.floor(playerUnit.y * scaleY) - 1 : null;
|
|
8914
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8915
|
-
/* @__PURE__ */ jsx("style", { children: `@keyframes minimap-blink{0%,49%{opacity:1}50%,100%{opacity:0}}` }),
|
|
8916
|
-
/* @__PURE__ */ jsxs(
|
|
8917
|
-
Box,
|
|
8918
|
-
{
|
|
8919
|
-
position: "relative",
|
|
8920
|
-
display: "inline-block",
|
|
8921
|
-
className: cn(
|
|
8922
|
-
"border border-border/20 rounded-container",
|
|
8923
|
-
className
|
|
8924
|
-
),
|
|
8925
|
-
children: [
|
|
8926
|
-
/* @__PURE__ */ jsx(
|
|
8927
|
-
"canvas",
|
|
8928
|
-
{
|
|
8929
|
-
ref: canvasRef,
|
|
8930
|
-
width,
|
|
8931
|
-
height,
|
|
8932
|
-
className: "block",
|
|
8933
|
-
style: { width, height }
|
|
8934
|
-
}
|
|
8935
|
-
),
|
|
8936
|
-
playerLeft !== null && playerTop !== null && /* @__PURE__ */ jsx(
|
|
8937
|
-
Box,
|
|
8938
|
-
{
|
|
8939
|
-
position: "absolute",
|
|
8940
|
-
style: {
|
|
8941
|
-
left: playerLeft,
|
|
8942
|
-
top: playerTop,
|
|
8943
|
-
width: 3,
|
|
8944
|
-
height: 3,
|
|
8945
|
-
backgroundColor: "#ffffff",
|
|
8946
|
-
animation: "minimap-blink 1s steps(2, end) infinite",
|
|
8947
|
-
pointerEvents: "none"
|
|
8948
|
-
}
|
|
8949
|
-
}
|
|
8950
|
-
)
|
|
8951
|
-
]
|
|
8952
|
-
}
|
|
8953
|
-
)
|
|
8954
|
-
] });
|
|
8955
|
-
}
|
|
8956
|
-
var DEFAULT_TILES, DEFAULT_UNITS, DEFAULT_VIEWPORT;
|
|
8957
|
-
var init_MiniMap = __esm({
|
|
8958
|
-
"components/game/atoms/MiniMap.tsx"() {
|
|
8959
|
-
"use client";
|
|
8960
|
-
init_cn();
|
|
8961
|
-
init_Box();
|
|
8962
|
-
DEFAULT_TILES = [
|
|
8963
|
-
{ x: 10, y: 10, color: "#4ade80" },
|
|
8964
|
-
{ x: 20, y: 15, color: "#4ade80" },
|
|
8965
|
-
{ x: 30, y: 25, color: "#22c55e" },
|
|
8966
|
-
{ x: 50, y: 40, color: "#4ade80" },
|
|
8967
|
-
{ x: 60, y: 55, color: "#16a34a" },
|
|
8968
|
-
{ x: 40, y: 60, color: "#4ade80" },
|
|
8969
|
-
{ x: 70, y: 30, color: "#22c55e" },
|
|
8970
|
-
{ x: 80, y: 70, color: "#4ade80" }
|
|
8971
|
-
];
|
|
8972
|
-
DEFAULT_UNITS = [
|
|
8973
|
-
{ x: 30, y: 30, color: "#60a5fa", isPlayer: true }
|
|
8974
|
-
];
|
|
8975
|
-
DEFAULT_VIEWPORT = { x: 20, y: 20, w: 40, h: 40 };
|
|
8976
|
-
MiniMap.displayName = "MiniMap";
|
|
8977
|
-
}
|
|
8978
|
-
});
|
|
8979
7953
|
function ControlGrid({
|
|
8980
7954
|
kind,
|
|
8981
7955
|
buttons = DEFAULT_BUTTONS,
|
|
@@ -8993,8 +7967,8 @@ function ControlGrid({
|
|
|
8993
7967
|
className
|
|
8994
7968
|
}) {
|
|
8995
7969
|
const eventBus = useEventBus();
|
|
8996
|
-
const [active, setActive] =
|
|
8997
|
-
const handlePress =
|
|
7970
|
+
const [active, setActive] = React83.useState(/* @__PURE__ */ new Set());
|
|
7971
|
+
const handlePress = React83.useCallback(
|
|
8998
7972
|
(id) => {
|
|
8999
7973
|
setActive((prev) => new Set(prev).add(id));
|
|
9000
7974
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -9008,7 +7982,7 @@ function ControlGrid({
|
|
|
9008
7982
|
},
|
|
9009
7983
|
[kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
|
|
9010
7984
|
);
|
|
9011
|
-
const handleRelease =
|
|
7985
|
+
const handleRelease = React83.useCallback(
|
|
9012
7986
|
(id) => {
|
|
9013
7987
|
setActive((prev) => {
|
|
9014
7988
|
const next = new Set(prev);
|
|
@@ -9193,7 +8167,7 @@ function StatBadge({
|
|
|
9193
8167
|
{
|
|
9194
8168
|
className: cn(
|
|
9195
8169
|
"inline-flex items-center gap-2 rounded-container border backdrop-blur-sm",
|
|
9196
|
-
|
|
8170
|
+
sizeMap6[size] ?? sizeMap6.md,
|
|
9197
8171
|
variantMap2[variant] ?? variantMap2.default,
|
|
9198
8172
|
className
|
|
9199
8173
|
),
|
|
@@ -9230,7 +8204,7 @@ function StatBadge({
|
|
|
9230
8204
|
}
|
|
9231
8205
|
);
|
|
9232
8206
|
}
|
|
9233
|
-
var
|
|
8207
|
+
var sizeMap6, variantMap2;
|
|
9234
8208
|
var init_StatBadge = __esm({
|
|
9235
8209
|
"components/game/molecules/StatBadge.tsx"() {
|
|
9236
8210
|
init_cn();
|
|
@@ -9240,7 +8214,7 @@ var init_StatBadge = __esm({
|
|
|
9240
8214
|
init_GameIcon();
|
|
9241
8215
|
init_HealthBar();
|
|
9242
8216
|
init_ScoreDisplay();
|
|
9243
|
-
|
|
8217
|
+
sizeMap6 = {
|
|
9244
8218
|
sm: "text-xs px-2 py-1",
|
|
9245
8219
|
md: "text-sm px-3 py-1.5",
|
|
9246
8220
|
lg: "text-base px-4 py-2"
|
|
@@ -9255,129 +8229,6 @@ var init_StatBadge = __esm({
|
|
|
9255
8229
|
StatBadge.displayName = "StatBadge";
|
|
9256
8230
|
}
|
|
9257
8231
|
});
|
|
9258
|
-
function InventoryGrid({
|
|
9259
|
-
items = DEFAULT_GRID_ITEMS,
|
|
9260
|
-
columns = 4,
|
|
9261
|
-
totalSlots = 12,
|
|
9262
|
-
selectedId = "",
|
|
9263
|
-
onSelect,
|
|
9264
|
-
selectEvent,
|
|
9265
|
-
size = "md",
|
|
9266
|
-
className
|
|
9267
|
-
}) {
|
|
9268
|
-
const eventBus = useEventBus();
|
|
9269
|
-
const slotCount = totalSlots ?? items.length;
|
|
9270
|
-
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
9271
|
-
const handleSelect = React90.useCallback(
|
|
9272
|
-
(id) => {
|
|
9273
|
-
onSelect?.(id);
|
|
9274
|
-
if (selectEvent) {
|
|
9275
|
-
eventBus.emit(`UI:${selectEvent}`, { id });
|
|
9276
|
-
}
|
|
9277
|
-
},
|
|
9278
|
-
[onSelect, selectEvent, eventBus]
|
|
9279
|
-
);
|
|
9280
|
-
const gridClass = columnMap[columns] ?? `grid-cols-${columns}`;
|
|
9281
|
-
return /* @__PURE__ */ jsxs(
|
|
9282
|
-
Box,
|
|
9283
|
-
{
|
|
9284
|
-
className: cn("grid gap-2", gridClass, className),
|
|
9285
|
-
children: [
|
|
9286
|
-
items.map((item) => /* @__PURE__ */ jsx(
|
|
9287
|
-
ItemSlot,
|
|
9288
|
-
{
|
|
9289
|
-
icon: item.icon,
|
|
9290
|
-
assetUrl: item.assetUrl,
|
|
9291
|
-
label: item.label,
|
|
9292
|
-
quantity: item.quantity,
|
|
9293
|
-
rarity: item.rarity,
|
|
9294
|
-
size,
|
|
9295
|
-
selected: selectedId === item.id,
|
|
9296
|
-
onClick: () => handleSelect(item.id)
|
|
9297
|
-
},
|
|
9298
|
-
item.id
|
|
9299
|
-
)),
|
|
9300
|
-
Array.from({ length: emptySlotCount }).map((_, index) => /* @__PURE__ */ jsx(
|
|
9301
|
-
ItemSlot,
|
|
9302
|
-
{
|
|
9303
|
-
empty: true,
|
|
9304
|
-
size
|
|
9305
|
-
},
|
|
9306
|
-
`empty-${index}`
|
|
9307
|
-
))
|
|
9308
|
-
]
|
|
9309
|
-
}
|
|
9310
|
-
);
|
|
9311
|
-
}
|
|
9312
|
-
var columnMap, DEFAULT_GRID_ITEMS;
|
|
9313
|
-
var init_InventoryGrid = __esm({
|
|
9314
|
-
"components/game/molecules/InventoryGrid.tsx"() {
|
|
9315
|
-
"use client";
|
|
9316
|
-
init_cn();
|
|
9317
|
-
init_useEventBus();
|
|
9318
|
-
init_ItemSlot();
|
|
9319
|
-
init_Box();
|
|
9320
|
-
columnMap = {
|
|
9321
|
-
2: "grid-cols-2",
|
|
9322
|
-
3: "grid-cols-3",
|
|
9323
|
-
4: "grid-cols-4",
|
|
9324
|
-
5: "grid-cols-5",
|
|
9325
|
-
6: "grid-cols-6",
|
|
9326
|
-
7: "grid-cols-7",
|
|
9327
|
-
8: "grid-cols-8"
|
|
9328
|
-
};
|
|
9329
|
-
DEFAULT_GRID_ITEMS = [
|
|
9330
|
-
{ id: "grid-1", icon: "sword", label: "Iron Sword", quantity: 1, rarity: "common" },
|
|
9331
|
-
{ id: "grid-2", icon: "flask-conical", label: "Health Potion", quantity: 3, rarity: "uncommon" },
|
|
9332
|
-
{ id: "grid-3", icon: "shield", label: "Wooden Shield", quantity: 1, rarity: "common" },
|
|
9333
|
-
{ id: "grid-4", icon: "gem", label: "Ruby Gem", quantity: 2, rarity: "rare" }
|
|
9334
|
-
];
|
|
9335
|
-
InventoryGrid.displayName = "InventoryGrid";
|
|
9336
|
-
}
|
|
9337
|
-
});
|
|
9338
|
-
function ResourceBar({
|
|
9339
|
-
resources = DEFAULT_RESOURCES,
|
|
9340
|
-
size = "md",
|
|
9341
|
-
className
|
|
9342
|
-
}) {
|
|
9343
|
-
return /* @__PURE__ */ jsx(
|
|
9344
|
-
Box,
|
|
9345
|
-
{
|
|
9346
|
-
className: cn(
|
|
9347
|
-
"flex items-center gap-2 flex-wrap",
|
|
9348
|
-
className
|
|
9349
|
-
),
|
|
9350
|
-
children: resources.map((resource, i) => /* @__PURE__ */ jsx(
|
|
9351
|
-
StatBadge,
|
|
9352
|
-
{
|
|
9353
|
-
label: resource.label,
|
|
9354
|
-
value: resource.value,
|
|
9355
|
-
max: resource.max,
|
|
9356
|
-
format: resource.max != null ? "bar" : "number",
|
|
9357
|
-
icon: resource.icon,
|
|
9358
|
-
assetUrl: resource.assetUrl,
|
|
9359
|
-
size
|
|
9360
|
-
},
|
|
9361
|
-
i
|
|
9362
|
-
))
|
|
9363
|
-
}
|
|
9364
|
-
);
|
|
9365
|
-
}
|
|
9366
|
-
var DEFAULT_RESOURCES;
|
|
9367
|
-
var init_ResourceBar = __esm({
|
|
9368
|
-
"components/game/molecules/ResourceBar.tsx"() {
|
|
9369
|
-
"use client";
|
|
9370
|
-
init_cn();
|
|
9371
|
-
init_StatBadge();
|
|
9372
|
-
init_Box();
|
|
9373
|
-
DEFAULT_RESOURCES = [
|
|
9374
|
-
{ icon: "coins", label: "Gold", value: 320 },
|
|
9375
|
-
{ icon: "zap", label: "Energy", value: 7, max: 10 },
|
|
9376
|
-
{ icon: "gem", label: "Crystals", value: 15 }
|
|
9377
|
-
];
|
|
9378
|
-
ResourceBar.displayName = "ResourceBar";
|
|
9379
|
-
}
|
|
9380
|
-
});
|
|
9381
8232
|
function convertElementsToStats(elements) {
|
|
9382
8233
|
return elements.map((el) => {
|
|
9383
8234
|
const [source, field] = el.bind?.split(".") ?? [];
|
|
@@ -9485,7 +8336,7 @@ function GameMenu({
|
|
|
9485
8336
|
}) {
|
|
9486
8337
|
const resolvedOptions = options ?? menuItems ?? DEFAULT_MENU_OPTIONS;
|
|
9487
8338
|
const eventBus = useEventBus();
|
|
9488
|
-
const handleOptionClick =
|
|
8339
|
+
const handleOptionClick = React83.useCallback(
|
|
9489
8340
|
(option) => {
|
|
9490
8341
|
if (option.event) {
|
|
9491
8342
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -9711,7 +8562,7 @@ function StateGraph({
|
|
|
9711
8562
|
}) {
|
|
9712
8563
|
const eventBus = useEventBus();
|
|
9713
8564
|
const nodes = states ?? [];
|
|
9714
|
-
const positions =
|
|
8565
|
+
const positions = React83.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
|
|
9715
8566
|
return /* @__PURE__ */ jsxs(
|
|
9716
8567
|
Box,
|
|
9717
8568
|
{
|
|
@@ -9770,6 +8621,152 @@ var init_StateGraph = __esm({
|
|
|
9770
8621
|
init_TransitionArrow();
|
|
9771
8622
|
}
|
|
9772
8623
|
});
|
|
8624
|
+
function MiniMap({
|
|
8625
|
+
tiles = DEFAULT_TILES,
|
|
8626
|
+
units = DEFAULT_UNITS,
|
|
8627
|
+
width = 150,
|
|
8628
|
+
height = 150,
|
|
8629
|
+
mapWidth = 100,
|
|
8630
|
+
mapHeight = 100,
|
|
8631
|
+
viewportRect = DEFAULT_VIEWPORT,
|
|
8632
|
+
className,
|
|
8633
|
+
tileAssets,
|
|
8634
|
+
unitAssets
|
|
8635
|
+
}) {
|
|
8636
|
+
const canvasRef = React83.useRef(null);
|
|
8637
|
+
const imgCacheRef = React83.useRef(/* @__PURE__ */ new Map());
|
|
8638
|
+
function loadImg(url) {
|
|
8639
|
+
const cached = imgCacheRef.current.get(url);
|
|
8640
|
+
if (cached) return cached.complete ? cached : null;
|
|
8641
|
+
const img = new Image();
|
|
8642
|
+
img.src = url;
|
|
8643
|
+
img.onload = () => {
|
|
8644
|
+
const canvas = canvasRef.current;
|
|
8645
|
+
if (!canvas) return;
|
|
8646
|
+
const ctx = canvas.getContext("2d");
|
|
8647
|
+
if (ctx) ctx.clearRect(0, 0, 0, 0);
|
|
8648
|
+
};
|
|
8649
|
+
imgCacheRef.current.set(url, img);
|
|
8650
|
+
return null;
|
|
8651
|
+
}
|
|
8652
|
+
React83.useEffect(() => {
|
|
8653
|
+
const canvas = canvasRef.current;
|
|
8654
|
+
if (!canvas) return;
|
|
8655
|
+
const ctx = canvas.getContext("2d");
|
|
8656
|
+
if (!ctx) return;
|
|
8657
|
+
const scaleX2 = width / mapWidth;
|
|
8658
|
+
const scaleY2 = height / mapHeight;
|
|
8659
|
+
ctx.clearRect(0, 0, width, height);
|
|
8660
|
+
ctx.fillStyle = "#111";
|
|
8661
|
+
ctx.fillRect(0, 0, width, height);
|
|
8662
|
+
for (const tile of tiles) {
|
|
8663
|
+
const tileAsset = tileAssets?.[tile.color] ?? tileAssets?.["default"];
|
|
8664
|
+
const tileImg = tileAsset ? loadImg(tileAsset.url) : null;
|
|
8665
|
+
const tx = Math.floor(tile.x * scaleX2);
|
|
8666
|
+
const ty = Math.floor(tile.y * scaleY2);
|
|
8667
|
+
const tw = Math.max(1, Math.ceil(scaleX2));
|
|
8668
|
+
const th = Math.max(1, Math.ceil(scaleY2));
|
|
8669
|
+
if (tileImg) {
|
|
8670
|
+
ctx.drawImage(tileImg, tx, ty, tw, th);
|
|
8671
|
+
} else {
|
|
8672
|
+
ctx.fillStyle = tile.color;
|
|
8673
|
+
ctx.fillRect(tx, ty, tw, th);
|
|
8674
|
+
}
|
|
8675
|
+
}
|
|
8676
|
+
for (const unit of units) {
|
|
8677
|
+
if (unit.isPlayer) continue;
|
|
8678
|
+
const unitAsset = unitAssets?.[unit.color] ?? unitAssets?.["default"];
|
|
8679
|
+
const unitImg = unitAsset ? loadImg(unitAsset.url) : null;
|
|
8680
|
+
const ux = Math.floor(unit.x * scaleX2) - 1;
|
|
8681
|
+
const uy = Math.floor(unit.y * scaleY2) - 1;
|
|
8682
|
+
if (unitImg) {
|
|
8683
|
+
ctx.drawImage(unitImg, ux, uy, 5, 5);
|
|
8684
|
+
} else {
|
|
8685
|
+
ctx.fillStyle = unit.color;
|
|
8686
|
+
ctx.fillRect(ux, uy, 3, 3);
|
|
8687
|
+
}
|
|
8688
|
+
}
|
|
8689
|
+
if (viewportRect) {
|
|
8690
|
+
ctx.strokeStyle = "#ffffff";
|
|
8691
|
+
ctx.lineWidth = 1;
|
|
8692
|
+
ctx.strokeRect(
|
|
8693
|
+
Math.floor(viewportRect.x * scaleX2),
|
|
8694
|
+
Math.floor(viewportRect.y * scaleY2),
|
|
8695
|
+
Math.floor(viewportRect.w * scaleX2),
|
|
8696
|
+
Math.floor(viewportRect.h * scaleY2)
|
|
8697
|
+
);
|
|
8698
|
+
}
|
|
8699
|
+
}, [tiles, units, width, height, mapWidth, mapHeight, viewportRect, tileAssets, unitAssets]);
|
|
8700
|
+
const scaleX = width / mapWidth;
|
|
8701
|
+
const scaleY = height / mapHeight;
|
|
8702
|
+
const playerUnit = units.find((u) => u.isPlayer);
|
|
8703
|
+
const playerLeft = playerUnit ? Math.floor(playerUnit.x * scaleX) - 1 : null;
|
|
8704
|
+
const playerTop = playerUnit ? Math.floor(playerUnit.y * scaleY) - 1 : null;
|
|
8705
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8706
|
+
/* @__PURE__ */ jsx("style", { children: `@keyframes minimap-blink{0%,49%{opacity:1}50%,100%{opacity:0}}` }),
|
|
8707
|
+
/* @__PURE__ */ jsxs(
|
|
8708
|
+
Box,
|
|
8709
|
+
{
|
|
8710
|
+
position: "relative",
|
|
8711
|
+
display: "inline-block",
|
|
8712
|
+
className: cn(
|
|
8713
|
+
"border border-border/20 rounded-container",
|
|
8714
|
+
className
|
|
8715
|
+
),
|
|
8716
|
+
children: [
|
|
8717
|
+
/* @__PURE__ */ jsx(
|
|
8718
|
+
"canvas",
|
|
8719
|
+
{
|
|
8720
|
+
ref: canvasRef,
|
|
8721
|
+
width,
|
|
8722
|
+
height,
|
|
8723
|
+
className: "block",
|
|
8724
|
+
style: { width, height }
|
|
8725
|
+
}
|
|
8726
|
+
),
|
|
8727
|
+
playerLeft !== null && playerTop !== null && /* @__PURE__ */ jsx(
|
|
8728
|
+
Box,
|
|
8729
|
+
{
|
|
8730
|
+
position: "absolute",
|
|
8731
|
+
style: {
|
|
8732
|
+
left: playerLeft,
|
|
8733
|
+
top: playerTop,
|
|
8734
|
+
width: 3,
|
|
8735
|
+
height: 3,
|
|
8736
|
+
backgroundColor: "#ffffff",
|
|
8737
|
+
animation: "minimap-blink 1s steps(2, end) infinite",
|
|
8738
|
+
pointerEvents: "none"
|
|
8739
|
+
}
|
|
8740
|
+
}
|
|
8741
|
+
)
|
|
8742
|
+
]
|
|
8743
|
+
}
|
|
8744
|
+
)
|
|
8745
|
+
] });
|
|
8746
|
+
}
|
|
8747
|
+
var DEFAULT_TILES, DEFAULT_UNITS, DEFAULT_VIEWPORT;
|
|
8748
|
+
var init_MiniMap = __esm({
|
|
8749
|
+
"components/game/atoms/MiniMap.tsx"() {
|
|
8750
|
+
"use client";
|
|
8751
|
+
init_cn();
|
|
8752
|
+
init_Box();
|
|
8753
|
+
DEFAULT_TILES = [
|
|
8754
|
+
{ x: 10, y: 10, color: "#4ade80" },
|
|
8755
|
+
{ x: 20, y: 15, color: "#4ade80" },
|
|
8756
|
+
{ x: 30, y: 25, color: "#22c55e" },
|
|
8757
|
+
{ x: 50, y: 40, color: "#4ade80" },
|
|
8758
|
+
{ x: 60, y: 55, color: "#16a34a" },
|
|
8759
|
+
{ x: 40, y: 60, color: "#4ade80" },
|
|
8760
|
+
{ x: 70, y: 30, color: "#22c55e" },
|
|
8761
|
+
{ x: 80, y: 70, color: "#4ade80" }
|
|
8762
|
+
];
|
|
8763
|
+
DEFAULT_UNITS = [
|
|
8764
|
+
{ x: 30, y: 30, color: "#60a5fa", isPlayer: true }
|
|
8765
|
+
];
|
|
8766
|
+
DEFAULT_VIEWPORT = { x: 20, y: 20, w: 40, h: 40 };
|
|
8767
|
+
MiniMap.displayName = "MiniMap";
|
|
8768
|
+
}
|
|
8769
|
+
});
|
|
9773
8770
|
function useCamera() {
|
|
9774
8771
|
const cameraRef = useRef({ x: 0, y: 0, zoom: 1 });
|
|
9775
8772
|
const targetCameraRef = useRef(null);
|
|
@@ -9879,7 +8876,7 @@ function useCamera() {
|
|
|
9879
8876
|
};
|
|
9880
8877
|
}
|
|
9881
8878
|
var init_useCamera = __esm({
|
|
9882
|
-
"
|
|
8879
|
+
"hooks/useCamera.ts"() {
|
|
9883
8880
|
"use client";
|
|
9884
8881
|
}
|
|
9885
8882
|
});
|
|
@@ -10865,7 +9862,7 @@ function Canvas({
|
|
|
10865
9862
|
keyMap,
|
|
10866
9863
|
keyUpMap
|
|
10867
9864
|
};
|
|
10868
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
9865
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(Canvas3DHost, { ...props3d }) });
|
|
10869
9866
|
}
|
|
10870
9867
|
return /* @__PURE__ */ jsx(
|
|
10871
9868
|
Canvas2D,
|
|
@@ -10889,35 +9886,17 @@ function Canvas({
|
|
|
10889
9886
|
}
|
|
10890
9887
|
);
|
|
10891
9888
|
}
|
|
10892
|
-
var
|
|
9889
|
+
var Canvas3DHost;
|
|
10893
9890
|
var init_Canvas = __esm({
|
|
10894
9891
|
"components/game/molecules/Canvas.tsx"() {
|
|
10895
9892
|
"use client";
|
|
10896
9893
|
init_Canvas2D();
|
|
10897
|
-
|
|
10898
|
-
() => import('@almadar/ui/components/molecules/game/three').then((m) => ({ default: m.
|
|
9894
|
+
Canvas3DHost = lazy(
|
|
9895
|
+
() => import('@almadar/ui/components/molecules/game/three').then((m) => ({ default: m.Canvas3DHost }))
|
|
10899
9896
|
);
|
|
10900
9897
|
Canvas.displayName = "Canvas";
|
|
10901
9898
|
}
|
|
10902
9899
|
});
|
|
10903
|
-
var init_useGameAudio = __esm({
|
|
10904
|
-
"components/game/hooks/useGameAudio.ts"() {
|
|
10905
|
-
"use client";
|
|
10906
|
-
}
|
|
10907
|
-
});
|
|
10908
|
-
function useGameAudioContextOptional() {
|
|
10909
|
-
return useContext(GameAudioContext);
|
|
10910
|
-
}
|
|
10911
|
-
var GameAudioContext;
|
|
10912
|
-
var init_GameAudioProvider = __esm({
|
|
10913
|
-
"components/game/providers/GameAudioProvider.tsx"() {
|
|
10914
|
-
"use client";
|
|
10915
|
-
init_useEventBus();
|
|
10916
|
-
init_useGameAudio();
|
|
10917
|
-
GameAudioContext = createContext(null);
|
|
10918
|
-
GameAudioContext.displayName = "GameAudioContext";
|
|
10919
|
-
}
|
|
10920
|
-
});
|
|
10921
9900
|
function GameAudioToggle({
|
|
10922
9901
|
size = "sm",
|
|
10923
9902
|
className,
|
|
@@ -10949,11 +9928,347 @@ var init_GameAudioToggle = __esm({
|
|
|
10949
9928
|
"use client";
|
|
10950
9929
|
init_atoms();
|
|
10951
9930
|
init_cn();
|
|
10952
|
-
init_GameAudioProvider();
|
|
10953
9931
|
init_GameIcon();
|
|
10954
9932
|
GameAudioToggle.displayName = "GameAudioToggle";
|
|
10955
9933
|
}
|
|
10956
9934
|
});
|
|
9935
|
+
function pickPath(entry) {
|
|
9936
|
+
if (Array.isArray(entry.path)) {
|
|
9937
|
+
return entry.path[Math.floor(Math.random() * entry.path.length)];
|
|
9938
|
+
}
|
|
9939
|
+
return entry.path;
|
|
9940
|
+
}
|
|
9941
|
+
function useGameAudio({
|
|
9942
|
+
manifest,
|
|
9943
|
+
baseUrl = "",
|
|
9944
|
+
initialMuted = false,
|
|
9945
|
+
initialVolume = 1
|
|
9946
|
+
}) {
|
|
9947
|
+
const [muted, setMutedState] = useState(initialMuted);
|
|
9948
|
+
const [masterVolume, setMasterVolumeState] = useState(initialVolume);
|
|
9949
|
+
const mutedRef = useRef(muted);
|
|
9950
|
+
const volumeRef = useRef(masterVolume);
|
|
9951
|
+
const manifestRef = useRef(manifest);
|
|
9952
|
+
mutedRef.current = muted;
|
|
9953
|
+
volumeRef.current = masterVolume;
|
|
9954
|
+
manifestRef.current = manifest;
|
|
9955
|
+
const poolsRef = useRef(/* @__PURE__ */ new Map());
|
|
9956
|
+
const getOrCreateElement = useCallback((key) => {
|
|
9957
|
+
const entry = manifestRef.current[key];
|
|
9958
|
+
if (!entry) return null;
|
|
9959
|
+
let pool = poolsRef.current.get(key);
|
|
9960
|
+
if (!pool) {
|
|
9961
|
+
pool = [];
|
|
9962
|
+
poolsRef.current.set(key, pool);
|
|
9963
|
+
}
|
|
9964
|
+
const maxSize = entry.poolSize ?? 1;
|
|
9965
|
+
for (const audio of pool) {
|
|
9966
|
+
if (audio.paused && (audio.ended || audio.currentTime === 0)) {
|
|
9967
|
+
return audio;
|
|
9968
|
+
}
|
|
9969
|
+
}
|
|
9970
|
+
if (pool.length < maxSize) {
|
|
9971
|
+
const src = baseUrl + pickPath(entry);
|
|
9972
|
+
const audio = new Audio(src);
|
|
9973
|
+
audio.loop = entry.loop ?? false;
|
|
9974
|
+
pool.push(audio);
|
|
9975
|
+
return audio;
|
|
9976
|
+
}
|
|
9977
|
+
if (!entry.loop) {
|
|
9978
|
+
let oldest = pool[0];
|
|
9979
|
+
for (const audio of pool) {
|
|
9980
|
+
if (audio.currentTime > oldest.currentTime) {
|
|
9981
|
+
oldest = audio;
|
|
9982
|
+
}
|
|
9983
|
+
}
|
|
9984
|
+
oldest.pause();
|
|
9985
|
+
oldest.currentTime = 0;
|
|
9986
|
+
return oldest;
|
|
9987
|
+
}
|
|
9988
|
+
return null;
|
|
9989
|
+
}, [baseUrl]);
|
|
9990
|
+
const play = useCallback((key) => {
|
|
9991
|
+
if (mutedRef.current) return;
|
|
9992
|
+
const entry = manifestRef.current[key];
|
|
9993
|
+
if (!entry) return;
|
|
9994
|
+
const audio = getOrCreateElement(key);
|
|
9995
|
+
if (!audio) return;
|
|
9996
|
+
audio.volume = Math.min(1, (entry.volume ?? 1) * volumeRef.current);
|
|
9997
|
+
if (!entry.loop) {
|
|
9998
|
+
audio.currentTime = 0;
|
|
9999
|
+
}
|
|
10000
|
+
const promise = audio.play();
|
|
10001
|
+
if (promise) {
|
|
10002
|
+
promise.catch(() => {
|
|
10003
|
+
});
|
|
10004
|
+
}
|
|
10005
|
+
}, [getOrCreateElement]);
|
|
10006
|
+
const stop = useCallback((key) => {
|
|
10007
|
+
const pool = poolsRef.current.get(key);
|
|
10008
|
+
if (!pool) return;
|
|
10009
|
+
for (const audio of pool) {
|
|
10010
|
+
audio.pause();
|
|
10011
|
+
audio.currentTime = 0;
|
|
10012
|
+
}
|
|
10013
|
+
}, []);
|
|
10014
|
+
const currentMusicKeyRef = useRef(null);
|
|
10015
|
+
const currentMusicElRef = useRef(null);
|
|
10016
|
+
const musicFadeRef = useRef(null);
|
|
10017
|
+
const pendingMusicKeyRef = useRef(null);
|
|
10018
|
+
const clearMusicFade = useCallback(() => {
|
|
10019
|
+
if (musicFadeRef.current) {
|
|
10020
|
+
clearInterval(musicFadeRef.current);
|
|
10021
|
+
musicFadeRef.current = null;
|
|
10022
|
+
}
|
|
10023
|
+
}, []);
|
|
10024
|
+
const playMusic = useCallback((key) => {
|
|
10025
|
+
if (key === currentMusicKeyRef.current) return;
|
|
10026
|
+
pendingMusicKeyRef.current = key;
|
|
10027
|
+
const entry = manifestRef.current[key];
|
|
10028
|
+
if (!entry) return;
|
|
10029
|
+
const fadeDurationMs = entry.crossfadeDurationMs ?? 1500;
|
|
10030
|
+
const stepMs = 50;
|
|
10031
|
+
const totalSteps = Math.max(1, fadeDurationMs / stepMs);
|
|
10032
|
+
const targetVolume = Math.min(1, (entry.volume ?? 1) * volumeRef.current);
|
|
10033
|
+
clearMusicFade();
|
|
10034
|
+
const src = baseUrl + (Array.isArray(entry.path) ? entry.path[0] : entry.path);
|
|
10035
|
+
const incoming = new Audio(src);
|
|
10036
|
+
incoming.loop = true;
|
|
10037
|
+
incoming.volume = 0;
|
|
10038
|
+
const outgoing = currentMusicElRef.current;
|
|
10039
|
+
const outgoingStartVol = outgoing?.volume ?? 0;
|
|
10040
|
+
currentMusicKeyRef.current = key;
|
|
10041
|
+
currentMusicElRef.current = incoming;
|
|
10042
|
+
if (!mutedRef.current) {
|
|
10043
|
+
incoming.play().catch(() => {
|
|
10044
|
+
currentMusicKeyRef.current = null;
|
|
10045
|
+
currentMusicElRef.current = outgoing;
|
|
10046
|
+
});
|
|
10047
|
+
}
|
|
10048
|
+
let step = 0;
|
|
10049
|
+
musicFadeRef.current = setInterval(() => {
|
|
10050
|
+
step++;
|
|
10051
|
+
const progress = Math.min(step / totalSteps, 1);
|
|
10052
|
+
incoming.volume = Math.min(1, targetVolume * progress);
|
|
10053
|
+
if (outgoing) {
|
|
10054
|
+
outgoing.volume = Math.max(0, outgoingStartVol * (1 - progress));
|
|
10055
|
+
}
|
|
10056
|
+
if (progress >= 1) {
|
|
10057
|
+
clearMusicFade();
|
|
10058
|
+
if (outgoing) {
|
|
10059
|
+
outgoing.pause();
|
|
10060
|
+
outgoing.src = "";
|
|
10061
|
+
}
|
|
10062
|
+
}
|
|
10063
|
+
}, stepMs);
|
|
10064
|
+
}, [baseUrl, clearMusicFade]);
|
|
10065
|
+
const stopMusic = useCallback((fadeDurationMs = 1e3) => {
|
|
10066
|
+
const outgoing = currentMusicElRef.current;
|
|
10067
|
+
if (!outgoing) return;
|
|
10068
|
+
currentMusicKeyRef.current = null;
|
|
10069
|
+
currentMusicElRef.current = null;
|
|
10070
|
+
pendingMusicKeyRef.current = null;
|
|
10071
|
+
clearMusicFade();
|
|
10072
|
+
const startVolume = outgoing.volume;
|
|
10073
|
+
const stepMs = 50;
|
|
10074
|
+
const totalSteps = Math.max(1, fadeDurationMs / stepMs);
|
|
10075
|
+
let step = 0;
|
|
10076
|
+
musicFadeRef.current = setInterval(() => {
|
|
10077
|
+
step++;
|
|
10078
|
+
const progress = step / totalSteps;
|
|
10079
|
+
outgoing.volume = Math.max(0, startVolume * (1 - progress));
|
|
10080
|
+
if (progress >= 1) {
|
|
10081
|
+
clearMusicFade();
|
|
10082
|
+
outgoing.pause();
|
|
10083
|
+
outgoing.src = "";
|
|
10084
|
+
}
|
|
10085
|
+
}, stepMs);
|
|
10086
|
+
}, [clearMusicFade]);
|
|
10087
|
+
const stopAll = useCallback(() => {
|
|
10088
|
+
for (const pool of poolsRef.current.values()) {
|
|
10089
|
+
for (const audio of pool) {
|
|
10090
|
+
audio.pause();
|
|
10091
|
+
audio.currentTime = 0;
|
|
10092
|
+
}
|
|
10093
|
+
}
|
|
10094
|
+
stopMusic(0);
|
|
10095
|
+
}, [stopMusic]);
|
|
10096
|
+
const setMuted = useCallback((value) => {
|
|
10097
|
+
setMutedState(value);
|
|
10098
|
+
if (value) {
|
|
10099
|
+
for (const [key, pool] of poolsRef.current.entries()) {
|
|
10100
|
+
if (manifestRef.current[key]?.loop) {
|
|
10101
|
+
for (const audio of pool) {
|
|
10102
|
+
if (!audio.paused) audio.pause();
|
|
10103
|
+
}
|
|
10104
|
+
}
|
|
10105
|
+
}
|
|
10106
|
+
currentMusicElRef.current?.pause();
|
|
10107
|
+
} else {
|
|
10108
|
+
for (const [key, pool] of poolsRef.current.entries()) {
|
|
10109
|
+
const entry = manifestRef.current[key];
|
|
10110
|
+
if (entry?.loop && entry?.autostart) {
|
|
10111
|
+
for (const audio of pool) {
|
|
10112
|
+
if (audio.paused) audio.play().catch(() => {
|
|
10113
|
+
});
|
|
10114
|
+
}
|
|
10115
|
+
}
|
|
10116
|
+
}
|
|
10117
|
+
const musicEl = currentMusicElRef.current;
|
|
10118
|
+
if (musicEl) {
|
|
10119
|
+
musicEl.play().catch(() => {
|
|
10120
|
+
});
|
|
10121
|
+
}
|
|
10122
|
+
}
|
|
10123
|
+
}, []);
|
|
10124
|
+
const setMasterVolume = useCallback((volume) => {
|
|
10125
|
+
const clamped = Math.max(0, Math.min(1, volume));
|
|
10126
|
+
setMasterVolumeState(clamped);
|
|
10127
|
+
for (const [key, pool] of poolsRef.current.entries()) {
|
|
10128
|
+
const entryVol = manifestRef.current[key]?.volume ?? 1;
|
|
10129
|
+
for (const audio of pool) {
|
|
10130
|
+
audio.volume = Math.min(1, entryVol * clamped);
|
|
10131
|
+
}
|
|
10132
|
+
}
|
|
10133
|
+
if (!musicFadeRef.current && currentMusicElRef.current) {
|
|
10134
|
+
const key = currentMusicKeyRef.current;
|
|
10135
|
+
const entryVol = key ? manifestRef.current[key]?.volume ?? 1 : 1;
|
|
10136
|
+
currentMusicElRef.current.volume = Math.min(1, entryVol * clamped);
|
|
10137
|
+
}
|
|
10138
|
+
}, []);
|
|
10139
|
+
const unlockedRef = useRef(false);
|
|
10140
|
+
useEffect(() => {
|
|
10141
|
+
const autoKeys = Object.keys(manifest).filter((k) => manifest[k].autostart);
|
|
10142
|
+
const hasPendingMusic = () => pendingMusicKeyRef.current !== null;
|
|
10143
|
+
const hasAutoStart = autoKeys.length > 0;
|
|
10144
|
+
if (!hasAutoStart && !hasPendingMusic()) return;
|
|
10145
|
+
const unlock = () => {
|
|
10146
|
+
if (unlockedRef.current) return;
|
|
10147
|
+
unlockedRef.current = true;
|
|
10148
|
+
if (!mutedRef.current) {
|
|
10149
|
+
for (const key of autoKeys) {
|
|
10150
|
+
play(key);
|
|
10151
|
+
}
|
|
10152
|
+
const pending = pendingMusicKeyRef.current;
|
|
10153
|
+
if (pending && pending !== currentMusicKeyRef.current) {
|
|
10154
|
+
playMusic(pending);
|
|
10155
|
+
}
|
|
10156
|
+
}
|
|
10157
|
+
};
|
|
10158
|
+
document.addEventListener("click", unlock, { once: true });
|
|
10159
|
+
document.addEventListener("keydown", unlock, { once: true });
|
|
10160
|
+
document.addEventListener("touchstart", unlock, { once: true });
|
|
10161
|
+
return () => {
|
|
10162
|
+
document.removeEventListener("click", unlock);
|
|
10163
|
+
document.removeEventListener("keydown", unlock);
|
|
10164
|
+
document.removeEventListener("touchstart", unlock);
|
|
10165
|
+
};
|
|
10166
|
+
}, [manifest, play, playMusic]);
|
|
10167
|
+
useEffect(() => {
|
|
10168
|
+
return () => {
|
|
10169
|
+
clearMusicFade();
|
|
10170
|
+
for (const pool of poolsRef.current.values()) {
|
|
10171
|
+
for (const audio of pool) {
|
|
10172
|
+
audio.pause();
|
|
10173
|
+
audio.src = "";
|
|
10174
|
+
}
|
|
10175
|
+
}
|
|
10176
|
+
poolsRef.current.clear();
|
|
10177
|
+
if (currentMusicElRef.current) {
|
|
10178
|
+
currentMusicElRef.current.pause();
|
|
10179
|
+
currentMusicElRef.current.src = "";
|
|
10180
|
+
currentMusicElRef.current = null;
|
|
10181
|
+
}
|
|
10182
|
+
};
|
|
10183
|
+
}, [clearMusicFade]);
|
|
10184
|
+
return {
|
|
10185
|
+
play,
|
|
10186
|
+
stop,
|
|
10187
|
+
stopAll,
|
|
10188
|
+
playMusic,
|
|
10189
|
+
stopMusic,
|
|
10190
|
+
muted,
|
|
10191
|
+
setMuted,
|
|
10192
|
+
masterVolume,
|
|
10193
|
+
setMasterVolume
|
|
10194
|
+
};
|
|
10195
|
+
}
|
|
10196
|
+
var init_useGameAudio = __esm({
|
|
10197
|
+
"hooks/useGameAudio.ts"() {
|
|
10198
|
+
"use client";
|
|
10199
|
+
useGameAudio.displayName = "useGameAudio";
|
|
10200
|
+
}
|
|
10201
|
+
});
|
|
10202
|
+
function isKnownState(s) {
|
|
10203
|
+
return s in DEFAULT_STATE_STYLES;
|
|
10204
|
+
}
|
|
10205
|
+
function StateIndicator({
|
|
10206
|
+
assetUrl = DEFAULT_ASSET_URL,
|
|
10207
|
+
state = "idle",
|
|
10208
|
+
label,
|
|
10209
|
+
size = "md",
|
|
10210
|
+
animated = true,
|
|
10211
|
+
stateStyles,
|
|
10212
|
+
className
|
|
10213
|
+
}) {
|
|
10214
|
+
const mergedStyles = stateStyles ? { ...DEFAULT_STATE_STYLES, ...stateStyles } : DEFAULT_STATE_STYLES;
|
|
10215
|
+
const knownState = isKnownState(state) ? state : null;
|
|
10216
|
+
const config = knownState !== null ? mergedStyles[knownState] ?? DEFAULT_STYLE : DEFAULT_STYLE;
|
|
10217
|
+
const displayLabel = label ?? state.charAt(0).toUpperCase() + state.slice(1);
|
|
10218
|
+
return /* @__PURE__ */ jsxs(
|
|
10219
|
+
Box,
|
|
10220
|
+
{
|
|
10221
|
+
display: "inline-flex",
|
|
10222
|
+
className: cn(
|
|
10223
|
+
"items-center gap-1 rounded-full text-foreground font-medium",
|
|
10224
|
+
config.bgClass,
|
|
10225
|
+
SIZE_CLASSES[size],
|
|
10226
|
+
animated && (knownState === null || !STATIC_STATES.has(knownState)) && "animate-pulse",
|
|
10227
|
+
className
|
|
10228
|
+
),
|
|
10229
|
+
children: [
|
|
10230
|
+
/* @__PURE__ */ jsx(Box, { as: "span", children: assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 16, alt: displayLabel, className: "flex-shrink-0" }) : typeof config.icon === "string" ? /^[a-zA-Z0-9-]+$/.test(config.icon) ? /* @__PURE__ */ jsx(Icon, { name: config.icon }) : config.icon : /* @__PURE__ */ jsx(Icon, { icon: config.icon }) }),
|
|
10231
|
+
/* @__PURE__ */ jsx(Box, { as: "span", children: displayLabel })
|
|
10232
|
+
]
|
|
10233
|
+
}
|
|
10234
|
+
);
|
|
10235
|
+
}
|
|
10236
|
+
var DEFAULT_ASSET_URL, DEFAULT_STATE_STYLES, DEFAULT_STYLE, STATIC_STATES, SIZE_CLASSES;
|
|
10237
|
+
var init_StateIndicator = __esm({
|
|
10238
|
+
"components/game/atoms/StateIndicator.tsx"() {
|
|
10239
|
+
init_Box();
|
|
10240
|
+
init_Icon();
|
|
10241
|
+
init_cn();
|
|
10242
|
+
init_GameIcon();
|
|
10243
|
+
DEFAULT_ASSET_URL = {
|
|
10244
|
+
url: "https://almadar-kflow-assets.web.app/shared/isometric-dungeon/Isometric/chestClosed_E.png",
|
|
10245
|
+
role: "ui",
|
|
10246
|
+
category: "state"
|
|
10247
|
+
};
|
|
10248
|
+
DEFAULT_STATE_STYLES = {
|
|
10249
|
+
idle: { icon: "\u23F8", bgClass: "bg-muted" },
|
|
10250
|
+
active: { icon: "\u25B6", bgClass: "bg-success" },
|
|
10251
|
+
sleeping: { icon: "\u{1F4A4}", bgClass: "bg-muted" },
|
|
10252
|
+
moving: { icon: "\u{1F6B6}", bgClass: "bg-info" },
|
|
10253
|
+
eating: { icon: "\u{1F37D}\uFE0F", bgClass: "bg-success" },
|
|
10254
|
+
waiting: { icon: "\u23F3", bgClass: "bg-warning" },
|
|
10255
|
+
happy: { icon: "\u{1F60A}", bgClass: "bg-success" },
|
|
10256
|
+
scared: { icon: "\u{1F628}", bgClass: "bg-error" },
|
|
10257
|
+
done: { icon: "\u2713", bgClass: "bg-success" },
|
|
10258
|
+
error: { icon: "\u2717", bgClass: "bg-error" },
|
|
10259
|
+
ready: { icon: "\u2713", bgClass: "bg-success" },
|
|
10260
|
+
cooldown: { icon: "\u{1F504}", bgClass: "bg-warning" }
|
|
10261
|
+
};
|
|
10262
|
+
DEFAULT_STYLE = { icon: "?", bgClass: "bg-muted" };
|
|
10263
|
+
STATIC_STATES = /* @__PURE__ */ new Set(["idle", "done"]);
|
|
10264
|
+
SIZE_CLASSES = {
|
|
10265
|
+
sm: "text-xs px-1.5 py-0.5",
|
|
10266
|
+
md: "text-sm px-2 py-1",
|
|
10267
|
+
lg: "text-base px-3 py-1.5"
|
|
10268
|
+
};
|
|
10269
|
+
StateIndicator.displayName = "StateIndicator";
|
|
10270
|
+
}
|
|
10271
|
+
});
|
|
10957
10272
|
function LinearView({
|
|
10958
10273
|
trait,
|
|
10959
10274
|
size = "md",
|
|
@@ -10965,7 +10280,7 @@ function LinearView({
|
|
|
10965
10280
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
10966
10281
|
const isDone = i < currentIdx;
|
|
10967
10282
|
const isCurrent = i === currentIdx;
|
|
10968
|
-
return /* @__PURE__ */ jsxs(
|
|
10283
|
+
return /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
|
|
10969
10284
|
i > 0 && /* @__PURE__ */ jsx(
|
|
10970
10285
|
Typography,
|
|
10971
10286
|
{
|
|
@@ -11500,7 +10815,7 @@ function SequenceBar({
|
|
|
11500
10815
|
else onSlotRemove?.(index);
|
|
11501
10816
|
}, [emit, slotRemoveEvent, onSlotRemove, playing]);
|
|
11502
10817
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
11503
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
10818
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
|
|
11504
10819
|
i > 0 && /* @__PURE__ */ jsx(
|
|
11505
10820
|
Typography,
|
|
11506
10821
|
{
|
|
@@ -11538,254 +10853,10 @@ var init_SequenceBar = __esm({
|
|
|
11538
10853
|
SequenceBar.displayName = "SequenceBar";
|
|
11539
10854
|
}
|
|
11540
10855
|
});
|
|
11541
|
-
function RuleEditor({
|
|
11542
|
-
rule,
|
|
11543
|
-
availableEvents,
|
|
11544
|
-
availableActions,
|
|
11545
|
-
onChange,
|
|
11546
|
-
onRemove,
|
|
11547
|
-
disabled = false,
|
|
11548
|
-
className
|
|
11549
|
-
}) {
|
|
11550
|
-
const { t } = useTranslate();
|
|
11551
|
-
const handleWhenChange = useCallback((v) => {
|
|
11552
|
-
onChange({ ...rule, whenEvent: v });
|
|
11553
|
-
}, [rule, onChange]);
|
|
11554
|
-
const handleThenChange = useCallback((v) => {
|
|
11555
|
-
onChange({ ...rule, thenAction: v });
|
|
11556
|
-
}, [rule, onChange]);
|
|
11557
|
-
return /* @__PURE__ */ jsxs(HStack, { className: cn("items-center p-2 rounded-lg bg-muted/50 border border-border", className), gap: "sm", children: [
|
|
11558
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-primary font-bold whitespace-nowrap", children: t("eventHandler.when") }),
|
|
11559
|
-
/* @__PURE__ */ jsx(
|
|
11560
|
-
Select,
|
|
11561
|
-
{
|
|
11562
|
-
value: rule.whenEvent,
|
|
11563
|
-
onValueChange: handleWhenChange,
|
|
11564
|
-
options: availableEvents,
|
|
11565
|
-
disabled,
|
|
11566
|
-
className: "flex-1 min-w-0"
|
|
11567
|
-
}
|
|
11568
|
-
),
|
|
11569
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-accent font-bold whitespace-nowrap", children: "\u2192 " + t("eventHandler.then") }),
|
|
11570
|
-
/* @__PURE__ */ jsx(
|
|
11571
|
-
Select,
|
|
11572
|
-
{
|
|
11573
|
-
value: rule.thenAction,
|
|
11574
|
-
onValueChange: handleThenChange,
|
|
11575
|
-
options: availableActions,
|
|
11576
|
-
disabled,
|
|
11577
|
-
className: "flex-1 min-w-0"
|
|
11578
|
-
}
|
|
11579
|
-
),
|
|
11580
|
-
onRemove && /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: onRemove, disabled, className: "shrink-0", children: "\xD7" })
|
|
11581
|
-
] });
|
|
11582
|
-
}
|
|
11583
|
-
var init_RuleEditor = __esm({
|
|
11584
|
-
"components/game/molecules/RuleEditor.tsx"() {
|
|
11585
|
-
init_atoms();
|
|
11586
|
-
init_cn();
|
|
11587
|
-
RuleEditor.displayName = "RuleEditor";
|
|
11588
|
-
}
|
|
11589
|
-
});
|
|
11590
|
-
function EventLog({
|
|
11591
|
-
entries,
|
|
11592
|
-
maxHeight = 200,
|
|
11593
|
-
label,
|
|
11594
|
-
className
|
|
11595
|
-
}) {
|
|
11596
|
-
const { t } = useTranslate();
|
|
11597
|
-
const scrollRef = useRef(null);
|
|
11598
|
-
useEffect(() => {
|
|
11599
|
-
if (scrollRef.current) {
|
|
11600
|
-
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
11601
|
-
}
|
|
11602
|
-
}, [entries.length]);
|
|
11603
|
-
return /* @__PURE__ */ jsxs(VStack, { className: cn("p-3 rounded-lg bg-card border border-border", className), gap: "sm", children: [
|
|
11604
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-muted-foreground font-medium", children: label ?? t("eventHandler.eventLog") }),
|
|
11605
|
-
/* @__PURE__ */ jsx(
|
|
11606
|
-
Box,
|
|
11607
|
-
{
|
|
11608
|
-
ref: scrollRef,
|
|
11609
|
-
className: "overflow-y-auto",
|
|
11610
|
-
style: { maxHeight },
|
|
11611
|
-
children: /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
|
|
11612
|
-
entries.length === 0 && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground italic", children: t("eventHandler.noEvents") }),
|
|
11613
|
-
entries.map((entry) => /* @__PURE__ */ jsxs(HStack, { className: "items-start", gap: "xs", children: [
|
|
11614
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: STATUS_STYLES[entry.status], children: STATUS_DOTS[entry.status] }),
|
|
11615
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-foreground", children: entry.icon }),
|
|
11616
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: cn("flex-1", STATUS_STYLES[entry.status]), children: entry.message })
|
|
11617
|
-
] }, entry.id))
|
|
11618
|
-
] })
|
|
11619
|
-
}
|
|
11620
|
-
)
|
|
11621
|
-
] });
|
|
11622
|
-
}
|
|
11623
|
-
var STATUS_STYLES, STATUS_DOTS;
|
|
11624
|
-
var init_EventLog = __esm({
|
|
11625
|
-
"components/game/molecules/EventLog.tsx"() {
|
|
11626
|
-
init_atoms();
|
|
11627
|
-
init_cn();
|
|
11628
|
-
STATUS_STYLES = {
|
|
11629
|
-
pending: "text-muted-foreground",
|
|
11630
|
-
active: "text-primary animate-pulse",
|
|
11631
|
-
done: "text-success",
|
|
11632
|
-
error: "text-error"
|
|
11633
|
-
};
|
|
11634
|
-
STATUS_DOTS = {
|
|
11635
|
-
pending: "\u25CB",
|
|
11636
|
-
active: "\u25CF",
|
|
11637
|
-
done: "\u2714",
|
|
11638
|
-
error: "\u2717"
|
|
11639
|
-
};
|
|
11640
|
-
EventLog.displayName = "EventLog";
|
|
11641
|
-
}
|
|
11642
|
-
});
|
|
11643
10856
|
|
|
11644
|
-
//
|
|
11645
|
-
function objId(o) {
|
|
11646
|
-
return o.id == null ? "" : String(o.id);
|
|
11647
|
-
}
|
|
11648
|
-
function objName(o) {
|
|
11649
|
-
return o.name == null ? "" : String(o.name);
|
|
11650
|
-
}
|
|
11651
|
-
function objIcon(o) {
|
|
11652
|
-
return o.icon == null ? "" : String(o.icon);
|
|
11653
|
-
}
|
|
11654
|
-
function objStates(o) {
|
|
11655
|
-
return Array.isArray(o.states) ? o.states : [];
|
|
11656
|
-
}
|
|
11657
|
-
function objCurrentState(o) {
|
|
11658
|
-
return o.currentState == null ? "" : String(o.currentState);
|
|
11659
|
-
}
|
|
11660
|
-
function objAvailableEvents(o) {
|
|
11661
|
-
return Array.isArray(o.availableEvents) ? o.availableEvents : [];
|
|
11662
|
-
}
|
|
11663
|
-
function objAvailableActions(o) {
|
|
11664
|
-
return Array.isArray(o.availableActions) ? o.availableActions : [];
|
|
11665
|
-
}
|
|
11666
|
-
function objRules(o) {
|
|
11667
|
-
return Array.isArray(o.rules) ? o.rules : [];
|
|
11668
|
-
}
|
|
11669
|
-
function objMaxRules(o) {
|
|
11670
|
-
const n = Number(o.maxRules);
|
|
11671
|
-
return Number.isFinite(n) && n > 0 ? n : 3;
|
|
11672
|
-
}
|
|
10857
|
+
// lib/puzzleObject.ts
|
|
11673
10858
|
var init_puzzleObject = __esm({
|
|
11674
|
-
"
|
|
11675
|
-
}
|
|
11676
|
-
});
|
|
11677
|
-
function ObjectRulePanel({
|
|
11678
|
-
object,
|
|
11679
|
-
onRulesChange,
|
|
11680
|
-
rulesChangeEvent,
|
|
11681
|
-
disabled = false,
|
|
11682
|
-
className
|
|
11683
|
-
}) {
|
|
11684
|
-
const { t } = useTranslate();
|
|
11685
|
-
const { emit } = useEventBus();
|
|
11686
|
-
const id = objId(object);
|
|
11687
|
-
const name = objName(object);
|
|
11688
|
-
const icon = objIcon(object);
|
|
11689
|
-
const states = objStates(object);
|
|
11690
|
-
const currentState = objCurrentState(object);
|
|
11691
|
-
const availableEvents = objAvailableEvents(object);
|
|
11692
|
-
const availableActions = objAvailableActions(object);
|
|
11693
|
-
const rules = objRules(object);
|
|
11694
|
-
const maxRules = objMaxRules(object);
|
|
11695
|
-
const canAdd = rules.length < maxRules;
|
|
11696
|
-
const emitRules = useCallback((newRules) => {
|
|
11697
|
-
if (rulesChangeEvent) emit(`UI:${rulesChangeEvent}`, { objectId: id, rules: newRules });
|
|
11698
|
-
else onRulesChange?.(id, newRules);
|
|
11699
|
-
}, [rulesChangeEvent, emit, id, onRulesChange]);
|
|
11700
|
-
const handleRuleChange = useCallback((index, updatedRule) => {
|
|
11701
|
-
const newRules = [...rules];
|
|
11702
|
-
newRules[index] = updatedRule;
|
|
11703
|
-
emitRules(newRules);
|
|
11704
|
-
}, [rules, emitRules]);
|
|
11705
|
-
const handleRuleRemove = useCallback((index) => {
|
|
11706
|
-
const newRules = rules.filter((_, i) => i !== index);
|
|
11707
|
-
emitRules(newRules);
|
|
11708
|
-
}, [rules, emitRules]);
|
|
11709
|
-
const handleAddRule = useCallback(() => {
|
|
11710
|
-
if (!canAdd || disabled) return;
|
|
11711
|
-
const firstEvent = availableEvents[0]?.value || "";
|
|
11712
|
-
const firstAction = availableActions[0]?.value || "";
|
|
11713
|
-
const newRule = {
|
|
11714
|
-
id: `rule-${nextRuleId++}`,
|
|
11715
|
-
whenEvent: firstEvent,
|
|
11716
|
-
thenAction: firstAction
|
|
11717
|
-
};
|
|
11718
|
-
emitRules([...rules, newRule]);
|
|
11719
|
-
}, [canAdd, disabled, rules, availableEvents, availableActions, emitRules]);
|
|
11720
|
-
const machine = {
|
|
11721
|
-
name,
|
|
11722
|
-
states,
|
|
11723
|
-
currentState,
|
|
11724
|
-
transitions: rules.map((r) => ({
|
|
11725
|
-
from: currentState,
|
|
11726
|
-
to: states.find((s) => s !== currentState) || currentState,
|
|
11727
|
-
event: r.whenEvent
|
|
11728
|
-
}))
|
|
11729
|
-
};
|
|
11730
|
-
return /* @__PURE__ */ jsxs(VStack, { className: cn("p-4 rounded-lg bg-card border border-border", className), gap: "sm", children: [
|
|
11731
|
-
/* @__PURE__ */ jsxs(HStack, { className: "items-center", gap: "sm", children: [
|
|
11732
|
-
/* @__PURE__ */ jsx(Typography, { variant: "h5", children: icon }),
|
|
11733
|
-
/* @__PURE__ */ jsxs(VStack, { gap: "none", children: [
|
|
11734
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body1", className: "text-foreground font-bold", children: name }),
|
|
11735
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground", children: t("eventHandler.state") + ": " + currentState })
|
|
11736
|
-
] })
|
|
11737
|
-
] }),
|
|
11738
|
-
/* @__PURE__ */ jsx(TraitStateViewer, { trait: machine, variant: "compact", size: "sm" }),
|
|
11739
|
-
/* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
|
|
11740
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-muted-foreground font-medium", children: t("eventHandler.rules", { count: rules.length, max: maxRules }) + ":" }),
|
|
11741
|
-
rules.map((rule, i) => /* @__PURE__ */ jsx(
|
|
11742
|
-
RuleEditor,
|
|
11743
|
-
{
|
|
11744
|
-
rule,
|
|
11745
|
-
availableEvents,
|
|
11746
|
-
availableActions,
|
|
11747
|
-
onChange: (r) => handleRuleChange(i, r),
|
|
11748
|
-
onRemove: () => handleRuleRemove(i),
|
|
11749
|
-
disabled
|
|
11750
|
-
},
|
|
11751
|
-
rule.id
|
|
11752
|
-
)),
|
|
11753
|
-
canAdd && !disabled && /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: handleAddRule, className: "self-start", children: t("eventHandler.addRule") })
|
|
11754
|
-
] })
|
|
11755
|
-
] });
|
|
11756
|
-
}
|
|
11757
|
-
var nextRuleId;
|
|
11758
|
-
var init_ObjectRulePanel = __esm({
|
|
11759
|
-
"components/game/molecules/ObjectRulePanel.tsx"() {
|
|
11760
|
-
init_atoms();
|
|
11761
|
-
init_cn();
|
|
11762
|
-
init_useEventBus();
|
|
11763
|
-
init_TraitStateViewer();
|
|
11764
|
-
init_RuleEditor();
|
|
11765
|
-
init_puzzleObject();
|
|
11766
|
-
nextRuleId = 1;
|
|
11767
|
-
ObjectRulePanel.displayName = "ObjectRulePanel";
|
|
11768
|
-
}
|
|
11769
|
-
});
|
|
11770
|
-
function VariablePanel({
|
|
11771
|
-
entityName,
|
|
11772
|
-
variables,
|
|
11773
|
-
className
|
|
11774
|
-
}) {
|
|
11775
|
-
const { t } = useTranslate();
|
|
11776
|
-
return /* @__PURE__ */ jsxs(VStack, { className: cn("p-3 rounded-lg bg-card border border-border", className), gap: "sm", children: [
|
|
11777
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-muted-foreground font-medium", children: t("stateArchitect.variables", { name: entityName }) }),
|
|
11778
|
-
(variables ?? []).map((v) => /* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between", children: [
|
|
11779
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-foreground font-medium", children: v.name }),
|
|
11780
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-accent font-mono", children: v.value })
|
|
11781
|
-
] }, v.name))
|
|
11782
|
-
] });
|
|
11783
|
-
}
|
|
11784
|
-
var init_VariablePanel = __esm({
|
|
11785
|
-
"components/game/molecules/VariablePanel.tsx"() {
|
|
11786
|
-
init_atoms();
|
|
11787
|
-
init_cn();
|
|
11788
|
-
VariablePanel.displayName = "VariablePanel";
|
|
10859
|
+
"lib/puzzleObject.ts"() {
|
|
11789
10860
|
}
|
|
11790
10861
|
});
|
|
11791
10862
|
function StateJsonView({
|
|
@@ -11826,125 +10897,6 @@ var init_StateJsonView = __esm({
|
|
|
11826
10897
|
StateJsonView.displayName = "StateJsonView";
|
|
11827
10898
|
}
|
|
11828
10899
|
});
|
|
11829
|
-
var GameTemplate;
|
|
11830
|
-
var init_GameTemplate = __esm({
|
|
11831
|
-
"components/game/templates/GameTemplate.tsx"() {
|
|
11832
|
-
init_cn();
|
|
11833
|
-
init_Box();
|
|
11834
|
-
init_Stack();
|
|
11835
|
-
init_Typography();
|
|
11836
|
-
init_Button();
|
|
11837
|
-
GameTemplate = ({
|
|
11838
|
-
entity,
|
|
11839
|
-
title = "Game",
|
|
11840
|
-
children,
|
|
11841
|
-
hud,
|
|
11842
|
-
debugPanel,
|
|
11843
|
-
showDebugPanel = false,
|
|
11844
|
-
controls,
|
|
11845
|
-
className,
|
|
11846
|
-
backgroundAsset
|
|
11847
|
-
}) => {
|
|
11848
|
-
return /* @__PURE__ */ jsxs(
|
|
11849
|
-
Box,
|
|
11850
|
-
{
|
|
11851
|
-
display: "flex",
|
|
11852
|
-
fullHeight: true,
|
|
11853
|
-
className: cn("flex-col lg:flex-row", className),
|
|
11854
|
-
children: [
|
|
11855
|
-
/* @__PURE__ */ jsxs(Box, { display: "flex", className: "flex-1 flex-col", children: [
|
|
11856
|
-
/* @__PURE__ */ jsxs(
|
|
11857
|
-
Box,
|
|
11858
|
-
{
|
|
11859
|
-
padding: "md",
|
|
11860
|
-
border: true,
|
|
11861
|
-
className: "border-b-2 border-x-0 border-t-0 border-border flex items-center justify-between",
|
|
11862
|
-
children: [
|
|
11863
|
-
/* @__PURE__ */ jsx(Typography, { variant: "h4", children: title }),
|
|
11864
|
-
controls && /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
|
|
11865
|
-
controls.isPlaying ? /* @__PURE__ */ jsx(
|
|
11866
|
-
Button,
|
|
11867
|
-
{
|
|
11868
|
-
variant: "secondary",
|
|
11869
|
-
size: "sm",
|
|
11870
|
-
icon: "pause",
|
|
11871
|
-
onClick: controls.onPause,
|
|
11872
|
-
children: "Pause"
|
|
11873
|
-
}
|
|
11874
|
-
) : /* @__PURE__ */ jsx(
|
|
11875
|
-
Button,
|
|
11876
|
-
{
|
|
11877
|
-
variant: "primary",
|
|
11878
|
-
size: "sm",
|
|
11879
|
-
icon: "play",
|
|
11880
|
-
onClick: controls.onPlay,
|
|
11881
|
-
children: "Play"
|
|
11882
|
-
}
|
|
11883
|
-
),
|
|
11884
|
-
/* @__PURE__ */ jsx(
|
|
11885
|
-
Button,
|
|
11886
|
-
{
|
|
11887
|
-
variant: "ghost",
|
|
11888
|
-
size: "sm",
|
|
11889
|
-
icon: "rotate-ccw",
|
|
11890
|
-
onClick: controls.onReset,
|
|
11891
|
-
children: "Reset"
|
|
11892
|
-
}
|
|
11893
|
-
)
|
|
11894
|
-
] })
|
|
11895
|
-
]
|
|
11896
|
-
}
|
|
11897
|
-
),
|
|
11898
|
-
/* @__PURE__ */ jsxs(
|
|
11899
|
-
Box,
|
|
11900
|
-
{
|
|
11901
|
-
position: "relative",
|
|
11902
|
-
fullWidth: true,
|
|
11903
|
-
className: backgroundAsset ? "flex-1" : "flex-1 bg-muted",
|
|
11904
|
-
style: backgroundAsset ? { backgroundImage: `url(${backgroundAsset.url})`, backgroundSize: "cover", backgroundPosition: "center" } : void 0,
|
|
11905
|
-
children: [
|
|
11906
|
-
children,
|
|
11907
|
-
hud && /* @__PURE__ */ jsx(
|
|
11908
|
-
Box,
|
|
11909
|
-
{
|
|
11910
|
-
position: "absolute",
|
|
11911
|
-
className: "top-0 left-0 right-0 pointer-events-none",
|
|
11912
|
-
children: /* @__PURE__ */ jsx(Box, { padding: "md", className: "pointer-events-auto w-fit", children: hud })
|
|
11913
|
-
}
|
|
11914
|
-
)
|
|
11915
|
-
]
|
|
11916
|
-
}
|
|
11917
|
-
)
|
|
11918
|
-
] }),
|
|
11919
|
-
showDebugPanel && debugPanel && /* @__PURE__ */ jsxs(
|
|
11920
|
-
Box,
|
|
11921
|
-
{
|
|
11922
|
-
bg: "surface",
|
|
11923
|
-
border: true,
|
|
11924
|
-
shadow: "sm",
|
|
11925
|
-
overflow: "auto",
|
|
11926
|
-
className: "w-full lg:w-80 lg:border-l-2 lg:border-t-0 border-t-2 border-border",
|
|
11927
|
-
children: [
|
|
11928
|
-
/* @__PURE__ */ jsx(
|
|
11929
|
-
Box,
|
|
11930
|
-
{
|
|
11931
|
-
padding: "md",
|
|
11932
|
-
border: true,
|
|
11933
|
-
className: "border-b-2 border-x-0 border-t-0 border-border",
|
|
11934
|
-
children: /* @__PURE__ */ jsx(Typography, { variant: "h6", children: "Debug Panel" })
|
|
11935
|
-
}
|
|
11936
|
-
),
|
|
11937
|
-
/* @__PURE__ */ jsx(Box, { padding: "md", children: debugPanel })
|
|
11938
|
-
]
|
|
11939
|
-
}
|
|
11940
|
-
)
|
|
11941
|
-
]
|
|
11942
|
-
}
|
|
11943
|
-
);
|
|
11944
|
-
};
|
|
11945
|
-
GameTemplate.displayName = "GameTemplate";
|
|
11946
|
-
}
|
|
11947
|
-
});
|
|
11948
10900
|
var FONT_BASE, GAME_FONTS, FONT_FACES, GameShell;
|
|
11949
10901
|
var init_GameShell = __esm({
|
|
11950
10902
|
"components/game/templates/GameShell.tsx"() {
|
|
@@ -12115,11 +11067,9 @@ var init_GameShell = __esm({
|
|
|
12115
11067
|
GameShell.displayName = "GameShell";
|
|
12116
11068
|
}
|
|
12117
11069
|
});
|
|
12118
|
-
|
|
12119
|
-
// components/game/molecules/index.ts
|
|
12120
11070
|
var init_molecules = __esm({
|
|
12121
11071
|
"components/game/molecules/index.ts"() {
|
|
12122
|
-
|
|
11072
|
+
init_gameShared();
|
|
12123
11073
|
init_puzzleObject();
|
|
12124
11074
|
}
|
|
12125
11075
|
});
|
|
@@ -12519,7 +11469,7 @@ var init_ErrorBoundary = __esm({
|
|
|
12519
11469
|
}
|
|
12520
11470
|
);
|
|
12521
11471
|
};
|
|
12522
|
-
ErrorBoundary = class extends
|
|
11472
|
+
ErrorBoundary = class extends React83__default.Component {
|
|
12523
11473
|
constructor(props) {
|
|
12524
11474
|
super(props);
|
|
12525
11475
|
__publicField(this, "reset", () => {
|
|
@@ -13184,7 +12134,7 @@ var init_Container = __esm({
|
|
|
13184
12134
|
as: Component = "div"
|
|
13185
12135
|
}) => {
|
|
13186
12136
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
13187
|
-
return
|
|
12137
|
+
return React83__default.createElement(
|
|
13188
12138
|
Component,
|
|
13189
12139
|
{
|
|
13190
12140
|
className: cn(
|
|
@@ -16009,7 +14959,7 @@ var init_CodeBlock = __esm({
|
|
|
16009
14959
|
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
16010
14960
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
16011
14961
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
16012
|
-
CodeBlock =
|
|
14962
|
+
CodeBlock = React83__default.memo(
|
|
16013
14963
|
({
|
|
16014
14964
|
code: rawCode,
|
|
16015
14965
|
language = "text",
|
|
@@ -16596,7 +15546,7 @@ var init_MarkdownContent = __esm({
|
|
|
16596
15546
|
init_Box();
|
|
16597
15547
|
init_CodeBlock();
|
|
16598
15548
|
init_cn();
|
|
16599
|
-
MarkdownContent =
|
|
15549
|
+
MarkdownContent = React83__default.memo(
|
|
16600
15550
|
({ content, direction = "ltr", className }) => {
|
|
16601
15551
|
const { t: _t } = useTranslate();
|
|
16602
15552
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -17923,7 +16873,7 @@ var init_StateMachineView = __esm({
|
|
|
17923
16873
|
style: { top: title ? 30 : 0 },
|
|
17924
16874
|
children: [
|
|
17925
16875
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
17926
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
16876
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React83__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
17927
16877
|
StateNode2,
|
|
17928
16878
|
{
|
|
17929
16879
|
state,
|
|
@@ -19354,14 +18304,14 @@ function SpacerPattern({ size = "flex" }) {
|
|
|
19354
18304
|
if (size === "flex") {
|
|
19355
18305
|
return /* @__PURE__ */ jsx(Spacer, {});
|
|
19356
18306
|
}
|
|
19357
|
-
const
|
|
18307
|
+
const sizeMap8 = {
|
|
19358
18308
|
xs: "0.25rem",
|
|
19359
18309
|
sm: "0.5rem",
|
|
19360
18310
|
md: "1rem",
|
|
19361
18311
|
lg: "1.5rem",
|
|
19362
18312
|
xl: "2rem"
|
|
19363
18313
|
};
|
|
19364
|
-
return /* @__PURE__ */ jsx(Box, { style: { width:
|
|
18314
|
+
return /* @__PURE__ */ jsx(Box, { style: { width: sizeMap8[size], height: sizeMap8[size], flexShrink: 0 } });
|
|
19365
18315
|
}
|
|
19366
18316
|
function DividerPattern({
|
|
19367
18317
|
orientation = "horizontal",
|
|
@@ -23561,8 +22511,8 @@ var init_Menu = __esm({
|
|
|
23561
22511
|
"bottom-end": "bottom-start"
|
|
23562
22512
|
};
|
|
23563
22513
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
23564
|
-
const triggerChild =
|
|
23565
|
-
const triggerElement =
|
|
22514
|
+
const triggerChild = React83__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
22515
|
+
const triggerElement = React83__default.cloneElement(
|
|
23566
22516
|
triggerChild,
|
|
23567
22517
|
{
|
|
23568
22518
|
ref: triggerRef,
|
|
@@ -23657,14 +22607,14 @@ function useDataDnd(args) {
|
|
|
23657
22607
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
23658
22608
|
const enabled = isZone || Boolean(dndRoot);
|
|
23659
22609
|
const eventBus = useEventBus();
|
|
23660
|
-
const parentRoot =
|
|
22610
|
+
const parentRoot = React83__default.useContext(RootCtx);
|
|
23661
22611
|
const isRoot = enabled && parentRoot === null;
|
|
23662
|
-
const zoneId =
|
|
22612
|
+
const zoneId = React83__default.useId();
|
|
23663
22613
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
23664
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
23665
|
-
const optimisticOrdersRef =
|
|
22614
|
+
const [optimisticOrders, setOptimisticOrders] = React83__default.useState(() => /* @__PURE__ */ new Map());
|
|
22615
|
+
const optimisticOrdersRef = React83__default.useRef(optimisticOrders);
|
|
23666
22616
|
optimisticOrdersRef.current = optimisticOrders;
|
|
23667
|
-
const clearOptimisticOrder =
|
|
22617
|
+
const clearOptimisticOrder = React83__default.useCallback((group) => {
|
|
23668
22618
|
setOptimisticOrders((prev) => {
|
|
23669
22619
|
if (!prev.has(group)) return prev;
|
|
23670
22620
|
const next = new Map(prev);
|
|
@@ -23689,7 +22639,7 @@ function useDataDnd(args) {
|
|
|
23689
22639
|
const raw = it[dndItemIdField];
|
|
23690
22640
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
23691
22641
|
}).join("|");
|
|
23692
|
-
const itemIds =
|
|
22642
|
+
const itemIds = React83__default.useMemo(
|
|
23693
22643
|
() => orderedItems.map((it, idx) => {
|
|
23694
22644
|
const raw = it[dndItemIdField];
|
|
23695
22645
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -23700,7 +22650,7 @@ function useDataDnd(args) {
|
|
|
23700
22650
|
const raw = it[dndItemIdField];
|
|
23701
22651
|
return raw != null ? String(raw) : `__${idx}`;
|
|
23702
22652
|
}).join("|");
|
|
23703
|
-
|
|
22653
|
+
React83__default.useEffect(() => {
|
|
23704
22654
|
const root = isRoot ? null : parentRoot;
|
|
23705
22655
|
if (root) {
|
|
23706
22656
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -23708,20 +22658,20 @@ function useDataDnd(args) {
|
|
|
23708
22658
|
clearOptimisticOrder(ownGroup);
|
|
23709
22659
|
}
|
|
23710
22660
|
}, [itemsContentSig, ownGroup]);
|
|
23711
|
-
const zonesRef =
|
|
23712
|
-
const registerZone =
|
|
22661
|
+
const zonesRef = React83__default.useRef(/* @__PURE__ */ new Map());
|
|
22662
|
+
const registerZone = React83__default.useCallback((zoneId2, meta2) => {
|
|
23713
22663
|
zonesRef.current.set(zoneId2, meta2);
|
|
23714
22664
|
}, []);
|
|
23715
|
-
const unregisterZone =
|
|
22665
|
+
const unregisterZone = React83__default.useCallback((zoneId2) => {
|
|
23716
22666
|
zonesRef.current.delete(zoneId2);
|
|
23717
22667
|
}, []);
|
|
23718
|
-
const [activeDrag, setActiveDrag] =
|
|
23719
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
23720
|
-
const meta =
|
|
22668
|
+
const [activeDrag, setActiveDrag] = React83__default.useState(null);
|
|
22669
|
+
const [overZoneGroup, setOverZoneGroup] = React83__default.useState(null);
|
|
22670
|
+
const meta = React83__default.useMemo(
|
|
23721
22671
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
23722
22672
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
23723
22673
|
);
|
|
23724
|
-
|
|
22674
|
+
React83__default.useEffect(() => {
|
|
23725
22675
|
const target = isRoot ? null : parentRoot;
|
|
23726
22676
|
if (!target) {
|
|
23727
22677
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -23740,7 +22690,7 @@ function useDataDnd(args) {
|
|
|
23740
22690
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
23741
22691
|
const sensors = useAlmadarDndSensors(true);
|
|
23742
22692
|
const collisionDetection = almadarDndCollisionDetection;
|
|
23743
|
-
const findZoneByItem =
|
|
22693
|
+
const findZoneByItem = React83__default.useCallback(
|
|
23744
22694
|
(id) => {
|
|
23745
22695
|
for (const z of zonesRef.current.values()) {
|
|
23746
22696
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -23749,7 +22699,7 @@ function useDataDnd(args) {
|
|
|
23749
22699
|
},
|
|
23750
22700
|
[]
|
|
23751
22701
|
);
|
|
23752
|
-
|
|
22702
|
+
React83__default.useCallback(
|
|
23753
22703
|
(group) => {
|
|
23754
22704
|
for (const z of zonesRef.current.values()) {
|
|
23755
22705
|
if (z.group === group) return z;
|
|
@@ -23758,7 +22708,7 @@ function useDataDnd(args) {
|
|
|
23758
22708
|
},
|
|
23759
22709
|
[]
|
|
23760
22710
|
);
|
|
23761
|
-
const handleDragEnd =
|
|
22711
|
+
const handleDragEnd = React83__default.useCallback(
|
|
23762
22712
|
(event) => {
|
|
23763
22713
|
const { active, over } = event;
|
|
23764
22714
|
const activeIdStr = String(active.id);
|
|
@@ -23849,8 +22799,8 @@ function useDataDnd(args) {
|
|
|
23849
22799
|
},
|
|
23850
22800
|
[eventBus]
|
|
23851
22801
|
);
|
|
23852
|
-
const sortableData =
|
|
23853
|
-
const SortableItem =
|
|
22802
|
+
const sortableData = React83__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
22803
|
+
const SortableItem = React83__default.useCallback(
|
|
23854
22804
|
({ id, children }) => {
|
|
23855
22805
|
const {
|
|
23856
22806
|
attributes,
|
|
@@ -23890,7 +22840,7 @@ function useDataDnd(args) {
|
|
|
23890
22840
|
id: droppableId,
|
|
23891
22841
|
data: sortableData
|
|
23892
22842
|
});
|
|
23893
|
-
const ctx =
|
|
22843
|
+
const ctx = React83__default.useContext(RootCtx);
|
|
23894
22844
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
23895
22845
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
23896
22846
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -23905,7 +22855,7 @@ function useDataDnd(args) {
|
|
|
23905
22855
|
showForeignPlaceholder,
|
|
23906
22856
|
ctxAvailable: ctx != null
|
|
23907
22857
|
});
|
|
23908
|
-
|
|
22858
|
+
React83__default.useEffect(() => {
|
|
23909
22859
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
23910
22860
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
23911
22861
|
return /* @__PURE__ */ jsx(
|
|
@@ -23919,11 +22869,11 @@ function useDataDnd(args) {
|
|
|
23919
22869
|
}
|
|
23920
22870
|
);
|
|
23921
22871
|
};
|
|
23922
|
-
const rootContextValue =
|
|
22872
|
+
const rootContextValue = React83__default.useMemo(
|
|
23923
22873
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
23924
22874
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
23925
22875
|
);
|
|
23926
|
-
const handleDragStart =
|
|
22876
|
+
const handleDragStart = React83__default.useCallback((event) => {
|
|
23927
22877
|
const sourceZone = findZoneByItem(event.active.id);
|
|
23928
22878
|
const rect = event.active.rect.current.initial;
|
|
23929
22879
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -23942,7 +22892,7 @@ function useDataDnd(args) {
|
|
|
23942
22892
|
isRoot
|
|
23943
22893
|
});
|
|
23944
22894
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
23945
|
-
const handleDragOver =
|
|
22895
|
+
const handleDragOver = React83__default.useCallback((event) => {
|
|
23946
22896
|
const { active, over } = event;
|
|
23947
22897
|
const overData = over?.data?.current;
|
|
23948
22898
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -24012,7 +22962,7 @@ function useDataDnd(args) {
|
|
|
24012
22962
|
return next;
|
|
24013
22963
|
});
|
|
24014
22964
|
}, []);
|
|
24015
|
-
const handleDragCancel =
|
|
22965
|
+
const handleDragCancel = React83__default.useCallback((event) => {
|
|
24016
22966
|
setActiveDrag(null);
|
|
24017
22967
|
setOverZoneGroup(null);
|
|
24018
22968
|
dndLog.warn("dragCancel", {
|
|
@@ -24020,12 +22970,12 @@ function useDataDnd(args) {
|
|
|
24020
22970
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
24021
22971
|
});
|
|
24022
22972
|
}, []);
|
|
24023
|
-
const handleDragEndWithCleanup =
|
|
22973
|
+
const handleDragEndWithCleanup = React83__default.useCallback((event) => {
|
|
24024
22974
|
handleDragEnd(event);
|
|
24025
22975
|
setActiveDrag(null);
|
|
24026
22976
|
setOverZoneGroup(null);
|
|
24027
22977
|
}, [handleDragEnd]);
|
|
24028
|
-
const wrapContainer =
|
|
22978
|
+
const wrapContainer = React83__default.useCallback(
|
|
24029
22979
|
(children) => {
|
|
24030
22980
|
if (!enabled) return children;
|
|
24031
22981
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -24079,7 +23029,7 @@ var init_useDataDnd = __esm({
|
|
|
24079
23029
|
init_useAlmadarDndCollision();
|
|
24080
23030
|
init_Box();
|
|
24081
23031
|
dndLog = createLogger("almadar:ui:dnd");
|
|
24082
|
-
RootCtx =
|
|
23032
|
+
RootCtx = React83__default.createContext(null);
|
|
24083
23033
|
}
|
|
24084
23034
|
});
|
|
24085
23035
|
function renderIconInput(icon, props) {
|
|
@@ -24605,7 +23555,7 @@ function DataList({
|
|
|
24605
23555
|
}) {
|
|
24606
23556
|
const eventBus = useEventBus();
|
|
24607
23557
|
const { t } = useTranslate();
|
|
24608
|
-
const [visibleCount, setVisibleCount] =
|
|
23558
|
+
const [visibleCount, setVisibleCount] = React83__default.useState(pageSize || Infinity);
|
|
24609
23559
|
const fieldDefs = fields ?? columns ?? [];
|
|
24610
23560
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
24611
23561
|
const dnd = useDataDnd({
|
|
@@ -24624,7 +23574,7 @@ function DataList({
|
|
|
24624
23574
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
24625
23575
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
24626
23576
|
const hasRenderProp = typeof children === "function";
|
|
24627
|
-
|
|
23577
|
+
React83__default.useEffect(() => {
|
|
24628
23578
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
24629
23579
|
const childrenTypeOf = typeof children;
|
|
24630
23580
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -24728,7 +23678,7 @@ function DataList({
|
|
|
24728
23678
|
const items2 = [...data];
|
|
24729
23679
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
24730
23680
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
24731
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
23681
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
|
|
24732
23682
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
24733
23683
|
group.items.map((itemData, index) => {
|
|
24734
23684
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -24869,7 +23819,7 @@ function DataList({
|
|
|
24869
23819
|
className
|
|
24870
23820
|
),
|
|
24871
23821
|
children: [
|
|
24872
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
23822
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
|
|
24873
23823
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
24874
23824
|
group.items.map(
|
|
24875
23825
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -24954,7 +23904,7 @@ var init_FormSection = __esm({
|
|
|
24954
23904
|
columns = 1,
|
|
24955
23905
|
className
|
|
24956
23906
|
}) => {
|
|
24957
|
-
const [collapsed, setCollapsed] =
|
|
23907
|
+
const [collapsed, setCollapsed] = React83__default.useState(defaultCollapsed);
|
|
24958
23908
|
const { t } = useTranslate();
|
|
24959
23909
|
const eventBus = useEventBus();
|
|
24960
23910
|
const gridClass = {
|
|
@@ -24962,7 +23912,7 @@ var init_FormSection = __esm({
|
|
|
24962
23912
|
2: "grid-cols-1 md:grid-cols-2",
|
|
24963
23913
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
24964
23914
|
}[columns];
|
|
24965
|
-
|
|
23915
|
+
React83__default.useCallback(() => {
|
|
24966
23916
|
if (collapsible) {
|
|
24967
23917
|
setCollapsed((prev) => !prev);
|
|
24968
23918
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -25912,7 +24862,7 @@ var init_Flex = __esm({
|
|
|
25912
24862
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
25913
24863
|
}
|
|
25914
24864
|
}
|
|
25915
|
-
return
|
|
24865
|
+
return React83__default.createElement(Component, {
|
|
25916
24866
|
className: cn(
|
|
25917
24867
|
inline ? "inline-flex" : "flex",
|
|
25918
24868
|
directionStyles[direction],
|
|
@@ -26031,7 +24981,7 @@ var init_Grid = __esm({
|
|
|
26031
24981
|
as: Component = "div"
|
|
26032
24982
|
}) => {
|
|
26033
24983
|
const mergedStyle = rows ? { gridTemplateRows: `repeat(${rows}, minmax(0, 1fr))`, ...style } : style;
|
|
26034
|
-
return
|
|
24984
|
+
return React83__default.createElement(
|
|
26035
24985
|
Component,
|
|
26036
24986
|
{
|
|
26037
24987
|
className: cn(
|
|
@@ -26227,9 +25177,9 @@ var init_Popover = __esm({
|
|
|
26227
25177
|
onMouseLeave: handleClose,
|
|
26228
25178
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
26229
25179
|
};
|
|
26230
|
-
const childElement =
|
|
25180
|
+
const childElement = React83__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
26231
25181
|
const childPointerDown = childElement.props.onPointerDown;
|
|
26232
|
-
const triggerElement =
|
|
25182
|
+
const triggerElement = React83__default.cloneElement(
|
|
26233
25183
|
childElement,
|
|
26234
25184
|
{
|
|
26235
25185
|
ref: triggerRef,
|
|
@@ -26831,9 +25781,9 @@ var init_Tooltip = __esm({
|
|
|
26831
25781
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
26832
25782
|
};
|
|
26833
25783
|
}, []);
|
|
26834
|
-
const triggerElement =
|
|
25784
|
+
const triggerElement = React83__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
26835
25785
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
26836
|
-
const trigger =
|
|
25786
|
+
const trigger = React83__default.cloneElement(triggerElement, {
|
|
26837
25787
|
ref: triggerRef,
|
|
26838
25788
|
onMouseEnter: handleMouseEnter,
|
|
26839
25789
|
onMouseLeave: handleMouseLeave,
|
|
@@ -26923,7 +25873,7 @@ var init_WizardProgress = __esm({
|
|
|
26923
25873
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
26924
25874
|
const isActive = index === currentStep;
|
|
26925
25875
|
const isCompleted = index < currentStep;
|
|
26926
|
-
return /* @__PURE__ */ jsxs(
|
|
25876
|
+
return /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
|
|
26927
25877
|
/* @__PURE__ */ jsx(
|
|
26928
25878
|
"button",
|
|
26929
25879
|
{
|
|
@@ -27826,13 +26776,13 @@ var init_LineChart = __esm({
|
|
|
27826
26776
|
LineChart2.displayName = "LineChart";
|
|
27827
26777
|
}
|
|
27828
26778
|
});
|
|
27829
|
-
var
|
|
26779
|
+
var sizeMap7, stateColors, ProgressDots;
|
|
27830
26780
|
var init_ProgressDots = __esm({
|
|
27831
26781
|
"components/core/molecules/ProgressDots.tsx"() {
|
|
27832
26782
|
"use client";
|
|
27833
26783
|
init_cn();
|
|
27834
26784
|
init_atoms();
|
|
27835
|
-
|
|
26785
|
+
sizeMap7 = {
|
|
27836
26786
|
sm: { dot: 6, active: 8 },
|
|
27837
26787
|
md: { dot: 8, active: 10 },
|
|
27838
26788
|
lg: { dot: 10, active: 14 }
|
|
@@ -27858,7 +26808,7 @@ var init_ProgressDots = __esm({
|
|
|
27858
26808
|
[currentIndex]
|
|
27859
26809
|
);
|
|
27860
26810
|
const resolveState = getState2 ?? defaultGetState;
|
|
27861
|
-
const dims =
|
|
26811
|
+
const dims = sizeMap7[size];
|
|
27862
26812
|
return /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", className: cn(className), children: Array.from({ length: count }, (_, index) => {
|
|
27863
26813
|
const state = resolveState(index);
|
|
27864
26814
|
const isActive = state === "active";
|
|
@@ -28484,13 +27434,13 @@ var init_MapView = __esm({
|
|
|
28484
27434
|
shadowSize: [41, 41]
|
|
28485
27435
|
});
|
|
28486
27436
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
28487
|
-
const { useEffect:
|
|
27437
|
+
const { useEffect: useEffect61, useRef: useRef58, useCallback: useCallback92, useState: useState89 } = React83__default;
|
|
28488
27438
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
28489
27439
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
28490
27440
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
28491
27441
|
const map = useMap();
|
|
28492
|
-
const prevRef =
|
|
28493
|
-
|
|
27442
|
+
const prevRef = useRef58({ centerLat, centerLng, zoom });
|
|
27443
|
+
useEffect61(() => {
|
|
28494
27444
|
const prev = prevRef.current;
|
|
28495
27445
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
28496
27446
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -28501,7 +27451,7 @@ var init_MapView = __esm({
|
|
|
28501
27451
|
}
|
|
28502
27452
|
function MapClickHandler({ onMapClick }) {
|
|
28503
27453
|
const map = useMap();
|
|
28504
|
-
|
|
27454
|
+
useEffect61(() => {
|
|
28505
27455
|
if (!onMapClick) return;
|
|
28506
27456
|
const handler = (e) => {
|
|
28507
27457
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -28530,7 +27480,7 @@ var init_MapView = __esm({
|
|
|
28530
27480
|
}) {
|
|
28531
27481
|
const eventBus = useEventBus2();
|
|
28532
27482
|
const [clickedPosition, setClickedPosition] = useState89(null);
|
|
28533
|
-
const handleMapClick =
|
|
27483
|
+
const handleMapClick = useCallback92((lat, lng) => {
|
|
28534
27484
|
if (showClickedPin) {
|
|
28535
27485
|
setClickedPosition({ lat, lng });
|
|
28536
27486
|
}
|
|
@@ -28539,7 +27489,7 @@ var init_MapView = __esm({
|
|
|
28539
27489
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
28540
27490
|
}
|
|
28541
27491
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
28542
|
-
const handleMarkerClick =
|
|
27492
|
+
const handleMarkerClick = useCallback92((marker) => {
|
|
28543
27493
|
onMarkerClick?.(marker);
|
|
28544
27494
|
if (markerClickEvent) {
|
|
28545
27495
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -29399,8 +28349,8 @@ function TableView({
|
|
|
29399
28349
|
}) {
|
|
29400
28350
|
const eventBus = useEventBus();
|
|
29401
28351
|
const { t } = useTranslate();
|
|
29402
|
-
const [visibleCount, setVisibleCount] =
|
|
29403
|
-
const [localSelected, setLocalSelected] =
|
|
28352
|
+
const [visibleCount, setVisibleCount] = React83__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
28353
|
+
const [localSelected, setLocalSelected] = React83__default.useState(/* @__PURE__ */ new Set());
|
|
29404
28354
|
const colDefs = columns ?? fields ?? [];
|
|
29405
28355
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
29406
28356
|
const dnd = useDataDnd({
|
|
@@ -29595,12 +28545,12 @@ function TableView({
|
|
|
29595
28545
|
]
|
|
29596
28546
|
}
|
|
29597
28547
|
);
|
|
29598
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
28548
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React83__default.Fragment, { children: rowInner }, id);
|
|
29599
28549
|
};
|
|
29600
28550
|
const items = Array.from(data);
|
|
29601
28551
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
29602
28552
|
let runningIndex = 0;
|
|
29603
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
28553
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
|
|
29604
28554
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
29605
28555
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
29606
28556
|
] }, gi)) });
|
|
@@ -30957,7 +29907,7 @@ var init_StepFlow = __esm({
|
|
|
30957
29907
|
className
|
|
30958
29908
|
}) => {
|
|
30959
29909
|
if (orientation === "vertical") {
|
|
30960
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
29910
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React83__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
30961
29911
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
30962
29912
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
30963
29913
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -30968,7 +29918,7 @@ var init_StepFlow = __esm({
|
|
|
30968
29918
|
] })
|
|
30969
29919
|
] }) }, index)) });
|
|
30970
29920
|
}
|
|
30971
|
-
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(
|
|
29921
|
+
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(React83__default.Fragment, { children: [
|
|
30972
29922
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
30973
29923
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
30974
29924
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -31953,7 +30903,7 @@ var init_LikertScale = __esm({
|
|
|
31953
30903
|
md: "text-base",
|
|
31954
30904
|
lg: "text-lg"
|
|
31955
30905
|
};
|
|
31956
|
-
LikertScale =
|
|
30906
|
+
LikertScale = React83__default.forwardRef(
|
|
31957
30907
|
({
|
|
31958
30908
|
question,
|
|
31959
30909
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -31965,7 +30915,7 @@ var init_LikertScale = __esm({
|
|
|
31965
30915
|
variant = "radios",
|
|
31966
30916
|
className
|
|
31967
30917
|
}, ref) => {
|
|
31968
|
-
const groupId =
|
|
30918
|
+
const groupId = React83__default.useId();
|
|
31969
30919
|
const eventBus = useEventBus();
|
|
31970
30920
|
const handleSelect = useCallback(
|
|
31971
30921
|
(next) => {
|
|
@@ -34247,7 +33197,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
34247
33197
|
"aria-label": t("aria.breadcrumb"),
|
|
34248
33198
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
34249
33199
|
const isLast = idx === items.length - 1;
|
|
34250
|
-
return /* @__PURE__ */ jsxs(
|
|
33200
|
+
return /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
|
|
34251
33201
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
34252
33202
|
Icon,
|
|
34253
33203
|
{
|
|
@@ -35116,7 +34066,7 @@ var init_MiniStateMachine = __esm({
|
|
|
35116
34066
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
35117
34067
|
const tc = transitionCounts[s.name] ?? 0;
|
|
35118
34068
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
35119
|
-
return /* @__PURE__ */ jsxs(
|
|
34069
|
+
return /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
|
|
35120
34070
|
/* @__PURE__ */ jsx(
|
|
35121
34071
|
AvlState,
|
|
35122
34072
|
{
|
|
@@ -35320,7 +34270,7 @@ var init_PageHeader = __esm({
|
|
|
35320
34270
|
info: "bg-info/10 text-info"
|
|
35321
34271
|
};
|
|
35322
34272
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
35323
|
-
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(
|
|
34273
|
+
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(React83__default.Fragment, { children: [
|
|
35324
34274
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
35325
34275
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
35326
34276
|
"a",
|
|
@@ -35637,7 +34587,7 @@ var init_Navigation = __esm({
|
|
|
35637
34587
|
Navigation.displayName = "Navigation";
|
|
35638
34588
|
}
|
|
35639
34589
|
});
|
|
35640
|
-
var paddingStyles4,
|
|
34590
|
+
var paddingStyles4, variantStyles7, Section;
|
|
35641
34591
|
var init_Section = __esm({
|
|
35642
34592
|
"components/core/molecules/Section.tsx"() {
|
|
35643
34593
|
init_cn();
|
|
@@ -35650,7 +34600,7 @@ var init_Section = __esm({
|
|
|
35650
34600
|
lg: "p-6",
|
|
35651
34601
|
xl: "p-8"
|
|
35652
34602
|
};
|
|
35653
|
-
|
|
34603
|
+
variantStyles7 = {
|
|
35654
34604
|
default: "",
|
|
35655
34605
|
card: [
|
|
35656
34606
|
"bg-card",
|
|
@@ -35678,12 +34628,12 @@ var init_Section = __esm({
|
|
|
35678
34628
|
as: Component = "section"
|
|
35679
34629
|
}) => {
|
|
35680
34630
|
const hasHeader = title || description || action;
|
|
35681
|
-
return
|
|
34631
|
+
return React83__default.createElement(
|
|
35682
34632
|
Component,
|
|
35683
34633
|
{
|
|
35684
34634
|
className: cn(
|
|
35685
34635
|
paddingStyles4[padding],
|
|
35686
|
-
|
|
34636
|
+
variantStyles7[variant],
|
|
35687
34637
|
className
|
|
35688
34638
|
)
|
|
35689
34639
|
},
|
|
@@ -36052,7 +35002,7 @@ var init_WizardContainer = __esm({
|
|
|
36052
35002
|
const isCompleted = index < currentStep;
|
|
36053
35003
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
36054
35004
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
36055
|
-
return /* @__PURE__ */ jsxs(
|
|
35005
|
+
return /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
|
|
36056
35006
|
/* @__PURE__ */ jsx(
|
|
36057
35007
|
Button,
|
|
36058
35008
|
{
|
|
@@ -38485,7 +37435,7 @@ var init_DetailPanel = __esm({
|
|
|
38485
37435
|
}
|
|
38486
37436
|
});
|
|
38487
37437
|
function extractTitle(children) {
|
|
38488
|
-
if (!
|
|
37438
|
+
if (!React83__default.isValidElement(children)) return void 0;
|
|
38489
37439
|
const props = children.props;
|
|
38490
37440
|
if (typeof props.title === "string") {
|
|
38491
37441
|
return props.title;
|
|
@@ -38835,12 +37785,12 @@ var init_Form = __esm({
|
|
|
38835
37785
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
38836
37786
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
38837
37787
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
38838
|
-
const normalizedInitialData =
|
|
37788
|
+
const normalizedInitialData = React83__default.useMemo(() => {
|
|
38839
37789
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
38840
37790
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
38841
37791
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
38842
37792
|
}, [entity, initialData]);
|
|
38843
|
-
const entityDerivedFields =
|
|
37793
|
+
const entityDerivedFields = React83__default.useMemo(() => {
|
|
38844
37794
|
if (fields && fields.length > 0) return void 0;
|
|
38845
37795
|
if (!resolvedEntity) return void 0;
|
|
38846
37796
|
return resolvedEntity.fields.map(
|
|
@@ -38861,16 +37811,16 @@ var init_Form = __esm({
|
|
|
38861
37811
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
38862
37812
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
38863
37813
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
38864
|
-
const [formData, setFormData] =
|
|
37814
|
+
const [formData, setFormData] = React83__default.useState(
|
|
38865
37815
|
normalizedInitialData
|
|
38866
37816
|
);
|
|
38867
|
-
const [collapsedSections, setCollapsedSections] =
|
|
37817
|
+
const [collapsedSections, setCollapsedSections] = React83__default.useState(
|
|
38868
37818
|
/* @__PURE__ */ new Set()
|
|
38869
37819
|
);
|
|
38870
|
-
const [submitError, setSubmitError] =
|
|
38871
|
-
const formRef =
|
|
37820
|
+
const [submitError, setSubmitError] = React83__default.useState(null);
|
|
37821
|
+
const formRef = React83__default.useRef(null);
|
|
38872
37822
|
const formMode = props.mode;
|
|
38873
|
-
const mountedRef =
|
|
37823
|
+
const mountedRef = React83__default.useRef(false);
|
|
38874
37824
|
if (!mountedRef.current) {
|
|
38875
37825
|
mountedRef.current = true;
|
|
38876
37826
|
debug("forms", "mount", {
|
|
@@ -38883,7 +37833,7 @@ var init_Form = __esm({
|
|
|
38883
37833
|
});
|
|
38884
37834
|
}
|
|
38885
37835
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
38886
|
-
const evalContext =
|
|
37836
|
+
const evalContext = React83__default.useMemo(
|
|
38887
37837
|
() => ({
|
|
38888
37838
|
formValues: formData,
|
|
38889
37839
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -38892,7 +37842,7 @@ var init_Form = __esm({
|
|
|
38892
37842
|
}),
|
|
38893
37843
|
[formData, externalContext]
|
|
38894
37844
|
);
|
|
38895
|
-
|
|
37845
|
+
React83__default.useEffect(() => {
|
|
38896
37846
|
debug("forms", "initialData-sync", {
|
|
38897
37847
|
mode: formMode,
|
|
38898
37848
|
normalizedInitialData,
|
|
@@ -38903,7 +37853,7 @@ var init_Form = __esm({
|
|
|
38903
37853
|
setFormData(normalizedInitialData);
|
|
38904
37854
|
}
|
|
38905
37855
|
}, [normalizedInitialData]);
|
|
38906
|
-
const processCalculations =
|
|
37856
|
+
const processCalculations = React83__default.useCallback(
|
|
38907
37857
|
(changedFieldId, newFormData) => {
|
|
38908
37858
|
if (!hiddenCalculations.length) return;
|
|
38909
37859
|
const context = {
|
|
@@ -38928,7 +37878,7 @@ var init_Form = __esm({
|
|
|
38928
37878
|
},
|
|
38929
37879
|
[hiddenCalculations, externalContext, eventBus]
|
|
38930
37880
|
);
|
|
38931
|
-
const checkViolations =
|
|
37881
|
+
const checkViolations = React83__default.useCallback(
|
|
38932
37882
|
(changedFieldId, newFormData) => {
|
|
38933
37883
|
if (!violationTriggers.length) return;
|
|
38934
37884
|
const context = {
|
|
@@ -38966,7 +37916,7 @@ var init_Form = __esm({
|
|
|
38966
37916
|
processCalculations(name, newFormData);
|
|
38967
37917
|
checkViolations(name, newFormData);
|
|
38968
37918
|
};
|
|
38969
|
-
const isFieldVisible =
|
|
37919
|
+
const isFieldVisible = React83__default.useCallback(
|
|
38970
37920
|
(fieldName) => {
|
|
38971
37921
|
const condition = conditionalFields[fieldName];
|
|
38972
37922
|
if (!condition) return true;
|
|
@@ -38974,7 +37924,7 @@ var init_Form = __esm({
|
|
|
38974
37924
|
},
|
|
38975
37925
|
[conditionalFields, evalContext]
|
|
38976
37926
|
);
|
|
38977
|
-
const isSectionVisible =
|
|
37927
|
+
const isSectionVisible = React83__default.useCallback(
|
|
38978
37928
|
(section) => {
|
|
38979
37929
|
if (!section.condition) return true;
|
|
38980
37930
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -39050,7 +38000,7 @@ var init_Form = __esm({
|
|
|
39050
38000
|
eventBus.emit(`UI:${onCancel}`);
|
|
39051
38001
|
}
|
|
39052
38002
|
};
|
|
39053
|
-
const renderField =
|
|
38003
|
+
const renderField = React83__default.useCallback(
|
|
39054
38004
|
(field) => {
|
|
39055
38005
|
const fieldName = field.name || field.field;
|
|
39056
38006
|
if (!fieldName) return null;
|
|
@@ -39071,7 +38021,7 @@ var init_Form = __esm({
|
|
|
39071
38021
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
39072
38022
|
);
|
|
39073
38023
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
39074
|
-
const normalizedFields =
|
|
38024
|
+
const normalizedFields = React83__default.useMemo(() => {
|
|
39075
38025
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
39076
38026
|
return effectiveFields.map((field) => {
|
|
39077
38027
|
if (typeof field === "string") {
|
|
@@ -39095,7 +38045,7 @@ var init_Form = __esm({
|
|
|
39095
38045
|
return field;
|
|
39096
38046
|
});
|
|
39097
38047
|
}, [effectiveFields, resolvedEntity]);
|
|
39098
|
-
const schemaFields =
|
|
38048
|
+
const schemaFields = React83__default.useMemo(() => {
|
|
39099
38049
|
if (normalizedFields.length === 0) return null;
|
|
39100
38050
|
if (isDebugEnabled()) {
|
|
39101
38051
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -39105,7 +38055,7 @@ var init_Form = __esm({
|
|
|
39105
38055
|
}
|
|
39106
38056
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
39107
38057
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
39108
|
-
const sectionElements =
|
|
38058
|
+
const sectionElements = React83__default.useMemo(() => {
|
|
39109
38059
|
if (!sections || sections.length === 0) return null;
|
|
39110
38060
|
return sections.map((section) => {
|
|
39111
38061
|
if (!isSectionVisible(section)) {
|
|
@@ -39642,18 +38592,18 @@ function entityFieldsFromListItem(item) {
|
|
|
39642
38592
|
function getStatusStyle(fieldName, value) {
|
|
39643
38593
|
const val = String(value).toLowerCase();
|
|
39644
38594
|
if (val.includes("complete") || val.includes("done"))
|
|
39645
|
-
return
|
|
38595
|
+
return STATUS_STYLES.complete;
|
|
39646
38596
|
if (val.includes("active") || val.includes("progress"))
|
|
39647
|
-
return
|
|
38597
|
+
return STATUS_STYLES.active;
|
|
39648
38598
|
if (val.includes("pending") || val.includes("waiting"))
|
|
39649
|
-
return
|
|
38599
|
+
return STATUS_STYLES.pending;
|
|
39650
38600
|
if (val.includes("block") || val.includes("cancel"))
|
|
39651
|
-
return
|
|
39652
|
-
if (val.includes("high") || val.includes("urgent")) return
|
|
38601
|
+
return STATUS_STYLES.blocked;
|
|
38602
|
+
if (val.includes("high") || val.includes("urgent")) return STATUS_STYLES.high;
|
|
39653
38603
|
if (val.includes("medium") || val.includes("normal"))
|
|
39654
|
-
return
|
|
39655
|
-
if (val.includes("low")) return
|
|
39656
|
-
return
|
|
38604
|
+
return STATUS_STYLES.medium;
|
|
38605
|
+
if (val.includes("low")) return STATUS_STYLES.low;
|
|
38606
|
+
return STATUS_STYLES.default;
|
|
39657
38607
|
}
|
|
39658
38608
|
function formatValue3(value, fieldName) {
|
|
39659
38609
|
if (typeof value === "number") {
|
|
@@ -39686,7 +38636,7 @@ function formatValue3(value, fieldName) {
|
|
|
39686
38636
|
function formatFieldLabel2(fieldName) {
|
|
39687
38637
|
return fieldName.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase()).replace(/Id$/, "").trim();
|
|
39688
38638
|
}
|
|
39689
|
-
var
|
|
38639
|
+
var STATUS_STYLES, StatusBadge, ProgressIndicator, List3;
|
|
39690
38640
|
var init_List = __esm({
|
|
39691
38641
|
"components/core/organisms/List.tsx"() {
|
|
39692
38642
|
"use client";
|
|
@@ -39699,7 +38649,7 @@ var init_List = __esm({
|
|
|
39699
38649
|
init_getNestedValue();
|
|
39700
38650
|
init_useEventBus();
|
|
39701
38651
|
init_types2();
|
|
39702
|
-
|
|
38652
|
+
STATUS_STYLES = {
|
|
39703
38653
|
complete: {
|
|
39704
38654
|
bg: "bg-success/10",
|
|
39705
38655
|
text: "text-success",
|
|
@@ -39830,7 +38780,7 @@ var init_List = __esm({
|
|
|
39830
38780
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
39831
38781
|
return [];
|
|
39832
38782
|
}, [entity]);
|
|
39833
|
-
const getItemActions =
|
|
38783
|
+
const getItemActions = React83__default.useCallback(
|
|
39834
38784
|
(item) => {
|
|
39835
38785
|
if (!itemActions) return [];
|
|
39836
38786
|
if (typeof itemActions === "function") {
|
|
@@ -40305,7 +39255,7 @@ var init_MediaGallery = __esm({
|
|
|
40305
39255
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
40306
39256
|
);
|
|
40307
39257
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
40308
|
-
const items =
|
|
39258
|
+
const items = React83__default.useMemo(() => {
|
|
40309
39259
|
if (propItems) return propItems;
|
|
40310
39260
|
if (entityData.length === 0) return [];
|
|
40311
39261
|
return entityData.map((record, idx) => {
|
|
@@ -40468,7 +39418,7 @@ var init_MediaGallery = __esm({
|
|
|
40468
39418
|
}
|
|
40469
39419
|
});
|
|
40470
39420
|
function extractTitle2(children) {
|
|
40471
|
-
if (!
|
|
39421
|
+
if (!React83__default.isValidElement(children)) return void 0;
|
|
40472
39422
|
const props = children.props;
|
|
40473
39423
|
if (typeof props.title === "string") {
|
|
40474
39424
|
return props.title;
|
|
@@ -40723,7 +39673,7 @@ var init_debugRegistry = __esm({
|
|
|
40723
39673
|
}
|
|
40724
39674
|
});
|
|
40725
39675
|
function useDebugData() {
|
|
40726
|
-
const [data, setData] =
|
|
39676
|
+
const [data, setData] = React83.useState(() => ({
|
|
40727
39677
|
traits: [],
|
|
40728
39678
|
ticks: [],
|
|
40729
39679
|
guards: [],
|
|
@@ -40737,7 +39687,7 @@ function useDebugData() {
|
|
|
40737
39687
|
},
|
|
40738
39688
|
lastUpdate: Date.now()
|
|
40739
39689
|
}));
|
|
40740
|
-
|
|
39690
|
+
React83.useEffect(() => {
|
|
40741
39691
|
const updateData = () => {
|
|
40742
39692
|
setData({
|
|
40743
39693
|
traits: getAllTraits(),
|
|
@@ -40846,12 +39796,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
40846
39796
|
return positions;
|
|
40847
39797
|
}
|
|
40848
39798
|
function WalkMinimap() {
|
|
40849
|
-
const [walkStep, setWalkStep] =
|
|
40850
|
-
const [traits2, setTraits] =
|
|
40851
|
-
const [coveredEdges, setCoveredEdges] =
|
|
40852
|
-
const [completedTraits, setCompletedTraits] =
|
|
40853
|
-
const prevTraitRef =
|
|
40854
|
-
|
|
39799
|
+
const [walkStep, setWalkStep] = React83.useState(null);
|
|
39800
|
+
const [traits2, setTraits] = React83.useState([]);
|
|
39801
|
+
const [coveredEdges, setCoveredEdges] = React83.useState([]);
|
|
39802
|
+
const [completedTraits, setCompletedTraits] = React83.useState(/* @__PURE__ */ new Set());
|
|
39803
|
+
const prevTraitRef = React83.useRef(null);
|
|
39804
|
+
React83.useEffect(() => {
|
|
40855
39805
|
const interval = setInterval(() => {
|
|
40856
39806
|
const w = window;
|
|
40857
39807
|
const step = w.__orbitalWalkStep;
|
|
@@ -41287,15 +40237,15 @@ var init_EntitiesTab = __esm({
|
|
|
41287
40237
|
});
|
|
41288
40238
|
function EventFlowTab({ events: events2 }) {
|
|
41289
40239
|
const { t } = useTranslate();
|
|
41290
|
-
const [filter, setFilter] =
|
|
41291
|
-
const containerRef =
|
|
41292
|
-
const [autoScroll, setAutoScroll] =
|
|
41293
|
-
|
|
40240
|
+
const [filter, setFilter] = React83.useState("all");
|
|
40241
|
+
const containerRef = React83.useRef(null);
|
|
40242
|
+
const [autoScroll, setAutoScroll] = React83.useState(true);
|
|
40243
|
+
React83.useEffect(() => {
|
|
41294
40244
|
if (autoScroll && containerRef.current) {
|
|
41295
40245
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
41296
40246
|
}
|
|
41297
40247
|
}, [events2.length, autoScroll]);
|
|
41298
|
-
const filteredEvents =
|
|
40248
|
+
const filteredEvents = React83.useMemo(() => {
|
|
41299
40249
|
if (filter === "all") return events2;
|
|
41300
40250
|
return events2.filter((e) => e.type === filter);
|
|
41301
40251
|
}, [events2, filter]);
|
|
@@ -41411,7 +40361,7 @@ var init_EventFlowTab = __esm({
|
|
|
41411
40361
|
});
|
|
41412
40362
|
function GuardsPanel({ guards }) {
|
|
41413
40363
|
const { t } = useTranslate();
|
|
41414
|
-
const [filter, setFilter] =
|
|
40364
|
+
const [filter, setFilter] = React83.useState("all");
|
|
41415
40365
|
if (guards.length === 0) {
|
|
41416
40366
|
return /* @__PURE__ */ jsx(
|
|
41417
40367
|
EmptyState,
|
|
@@ -41424,7 +40374,7 @@ function GuardsPanel({ guards }) {
|
|
|
41424
40374
|
}
|
|
41425
40375
|
const passedCount = guards.filter((g) => g.result).length;
|
|
41426
40376
|
const failedCount = guards.length - passedCount;
|
|
41427
|
-
const filteredGuards =
|
|
40377
|
+
const filteredGuards = React83.useMemo(() => {
|
|
41428
40378
|
if (filter === "all") return guards;
|
|
41429
40379
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
41430
40380
|
return guards.filter((g) => !g.result);
|
|
@@ -41587,10 +40537,10 @@ function EffectBadge({ effect }) {
|
|
|
41587
40537
|
}
|
|
41588
40538
|
function TransitionTimeline({ transitions }) {
|
|
41589
40539
|
const { t } = useTranslate();
|
|
41590
|
-
const containerRef =
|
|
41591
|
-
const [autoScroll, setAutoScroll] =
|
|
41592
|
-
const [expandedId, setExpandedId] =
|
|
41593
|
-
|
|
40540
|
+
const containerRef = React83.useRef(null);
|
|
40541
|
+
const [autoScroll, setAutoScroll] = React83.useState(true);
|
|
40542
|
+
const [expandedId, setExpandedId] = React83.useState(null);
|
|
40543
|
+
React83.useEffect(() => {
|
|
41594
40544
|
if (autoScroll && containerRef.current) {
|
|
41595
40545
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
41596
40546
|
}
|
|
@@ -41870,9 +40820,9 @@ function getAllEvents(traits2) {
|
|
|
41870
40820
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
41871
40821
|
const eventBus = useEventBus();
|
|
41872
40822
|
const { t } = useTranslate();
|
|
41873
|
-
const [log13, setLog] =
|
|
41874
|
-
const prevStatesRef =
|
|
41875
|
-
|
|
40823
|
+
const [log13, setLog] = React83.useState([]);
|
|
40824
|
+
const prevStatesRef = React83.useRef(/* @__PURE__ */ new Map());
|
|
40825
|
+
React83.useEffect(() => {
|
|
41876
40826
|
for (const trait of traits2) {
|
|
41877
40827
|
const prev = prevStatesRef.current.get(trait.id);
|
|
41878
40828
|
if (prev && prev !== trait.currentState) {
|
|
@@ -42041,10 +40991,10 @@ function VerifyModePanel({
|
|
|
42041
40991
|
localCount
|
|
42042
40992
|
}) {
|
|
42043
40993
|
const { t } = useTranslate();
|
|
42044
|
-
const [expanded, setExpanded] =
|
|
42045
|
-
const scrollRef =
|
|
42046
|
-
const prevCountRef =
|
|
42047
|
-
|
|
40994
|
+
const [expanded, setExpanded] = React83.useState(true);
|
|
40995
|
+
const scrollRef = React83.useRef(null);
|
|
40996
|
+
const prevCountRef = React83.useRef(0);
|
|
40997
|
+
React83.useEffect(() => {
|
|
42048
40998
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
42049
40999
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
42050
41000
|
}
|
|
@@ -42101,10 +41051,10 @@ function RuntimeDebugger({
|
|
|
42101
41051
|
schema
|
|
42102
41052
|
}) {
|
|
42103
41053
|
const { t } = useTranslate();
|
|
42104
|
-
const [isCollapsed, setIsCollapsed] =
|
|
42105
|
-
const [isVisible, setIsVisible] =
|
|
41054
|
+
const [isCollapsed, setIsCollapsed] = React83.useState(mode === "verify" ? true : defaultCollapsed);
|
|
41055
|
+
const [isVisible, setIsVisible] = React83.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
42106
41056
|
const debugData = useDebugData();
|
|
42107
|
-
|
|
41057
|
+
React83.useEffect(() => {
|
|
42108
41058
|
if (mode === "inline") return;
|
|
42109
41059
|
return onDebugToggle((enabled) => {
|
|
42110
41060
|
setIsVisible(enabled);
|
|
@@ -42113,7 +41063,7 @@ function RuntimeDebugger({
|
|
|
42113
41063
|
}
|
|
42114
41064
|
});
|
|
42115
41065
|
}, [mode]);
|
|
42116
|
-
|
|
41066
|
+
React83.useEffect(() => {
|
|
42117
41067
|
if (mode === "inline") return;
|
|
42118
41068
|
const handleKeyDown = (e) => {
|
|
42119
41069
|
if (e.key === "`" && isVisible) {
|
|
@@ -42633,7 +41583,7 @@ var init_StatCard = __esm({
|
|
|
42633
41583
|
const labelToUse = propLabel ?? propTitle;
|
|
42634
41584
|
const eventBus = useEventBus();
|
|
42635
41585
|
const { t } = useTranslate();
|
|
42636
|
-
const handleActionClick =
|
|
41586
|
+
const handleActionClick = React83__default.useCallback(() => {
|
|
42637
41587
|
if (action?.event) {
|
|
42638
41588
|
eventBus.emit(`UI:${action.event}`, {});
|
|
42639
41589
|
}
|
|
@@ -42644,7 +41594,7 @@ var init_StatCard = __esm({
|
|
|
42644
41594
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
42645
41595
|
const isLoading = externalLoading ?? false;
|
|
42646
41596
|
const error = externalError;
|
|
42647
|
-
const computeMetricValue =
|
|
41597
|
+
const computeMetricValue = React83__default.useCallback(
|
|
42648
41598
|
(metric, items) => {
|
|
42649
41599
|
if (metric.value !== void 0) {
|
|
42650
41600
|
return metric.value;
|
|
@@ -42683,7 +41633,7 @@ var init_StatCard = __esm({
|
|
|
42683
41633
|
},
|
|
42684
41634
|
[]
|
|
42685
41635
|
);
|
|
42686
|
-
const schemaStats =
|
|
41636
|
+
const schemaStats = React83__default.useMemo(() => {
|
|
42687
41637
|
if (!metrics || metrics.length === 0) return null;
|
|
42688
41638
|
return metrics.map((metric) => ({
|
|
42689
41639
|
label: metric.label,
|
|
@@ -42691,7 +41641,7 @@ var init_StatCard = __esm({
|
|
|
42691
41641
|
format: metric.format
|
|
42692
41642
|
}));
|
|
42693
41643
|
}, [metrics, data, computeMetricValue]);
|
|
42694
|
-
const calculatedTrend =
|
|
41644
|
+
const calculatedTrend = React83__default.useMemo(() => {
|
|
42695
41645
|
if (manualTrend !== void 0) return manualTrend;
|
|
42696
41646
|
if (previousValue === void 0 || currentValue === void 0)
|
|
42697
41647
|
return void 0;
|
|
@@ -43331,8 +42281,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
43331
42281
|
] });
|
|
43332
42282
|
};
|
|
43333
42283
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
43334
|
-
const endRef =
|
|
43335
|
-
|
|
42284
|
+
const endRef = React83__default.useRef(null);
|
|
42285
|
+
React83__default.useEffect(() => {
|
|
43336
42286
|
if (!autoScroll) return;
|
|
43337
42287
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
43338
42288
|
}, [activities.length, autoScroll]);
|
|
@@ -43426,7 +42376,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
43426
42376
|
};
|
|
43427
42377
|
SubagentRichCard = ({ subagent }) => {
|
|
43428
42378
|
const { t } = useTranslate();
|
|
43429
|
-
const activities =
|
|
42379
|
+
const activities = React83__default.useMemo(
|
|
43430
42380
|
() => subagentMessagesToActivities(subagent.messages),
|
|
43431
42381
|
[subagent.messages]
|
|
43432
42382
|
);
|
|
@@ -43503,8 +42453,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
43503
42453
|
] });
|
|
43504
42454
|
};
|
|
43505
42455
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
43506
|
-
const endRef =
|
|
43507
|
-
|
|
42456
|
+
const endRef = React83__default.useRef(null);
|
|
42457
|
+
React83__default.useEffect(() => {
|
|
43508
42458
|
if (!autoScroll) return;
|
|
43509
42459
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
43510
42460
|
}, [messages.length, autoScroll]);
|
|
@@ -43883,7 +42833,7 @@ var init_TeamOrganism = __esm({
|
|
|
43883
42833
|
TeamOrganism.displayName = "TeamOrganism";
|
|
43884
42834
|
}
|
|
43885
42835
|
});
|
|
43886
|
-
var lookStyles10,
|
|
42836
|
+
var lookStyles10, STATUS_STYLES2, Timeline;
|
|
43887
42837
|
var init_Timeline = __esm({
|
|
43888
42838
|
"components/core/organisms/Timeline.tsx"() {
|
|
43889
42839
|
"use client";
|
|
@@ -43899,7 +42849,7 @@ var init_Timeline = __esm({
|
|
|
43899
42849
|
horizontal: "flex-row [&>*]:flex-row [&>*]:items-center",
|
|
43900
42850
|
swimlane: "flex-row gap-6 [&>*]:flex-row [&>*]:items-center"
|
|
43901
42851
|
};
|
|
43902
|
-
|
|
42852
|
+
STATUS_STYLES2 = {
|
|
43903
42853
|
complete: {
|
|
43904
42854
|
dotColor: "text-success",
|
|
43905
42855
|
lineColor: "bg-success",
|
|
@@ -43934,7 +42884,7 @@ var init_Timeline = __esm({
|
|
|
43934
42884
|
}) => {
|
|
43935
42885
|
const { t } = useTranslate();
|
|
43936
42886
|
const entityData = entity ?? [];
|
|
43937
|
-
const items =
|
|
42887
|
+
const items = React83__default.useMemo(() => {
|
|
43938
42888
|
if (propItems) return propItems;
|
|
43939
42889
|
if (entityData.length === 0) return [];
|
|
43940
42890
|
return entityData.map((record, idx) => {
|
|
@@ -43983,7 +42933,7 @@ var init_Timeline = __esm({
|
|
|
43983
42933
|
title && /* @__PURE__ */ jsx(Typography, { variant: "h5", weight: "semibold", children: title }),
|
|
43984
42934
|
/* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("relative", lookStyles10[look]), children: items.map((item, idx) => {
|
|
43985
42935
|
const status = item.status || "pending";
|
|
43986
|
-
const style =
|
|
42936
|
+
const style = STATUS_STYLES2[status] || STATUS_STYLES2.pending;
|
|
43987
42937
|
const ItemIcon = item.icon || style.icon;
|
|
43988
42938
|
const isLast = idx === items.length - 1;
|
|
43989
42939
|
return /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "relative", children: [
|
|
@@ -44036,7 +42986,7 @@ var init_Timeline = __esm({
|
|
|
44036
42986
|
}
|
|
44037
42987
|
});
|
|
44038
42988
|
function extractToastProps(children) {
|
|
44039
|
-
if (!
|
|
42989
|
+
if (!React83__default.isValidElement(children)) {
|
|
44040
42990
|
if (typeof children === "string") {
|
|
44041
42991
|
return { message: children };
|
|
44042
42992
|
}
|
|
@@ -44078,7 +43028,7 @@ var init_ToastSlot = __esm({
|
|
|
44078
43028
|
eventBus.emit(`${prefix}CLOSE`);
|
|
44079
43029
|
};
|
|
44080
43030
|
if (!isVisible) return null;
|
|
44081
|
-
const isCustomContent =
|
|
43031
|
+
const isCustomContent = React83__default.isValidElement(children) && !message;
|
|
44082
43032
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
44083
43033
|
Toast,
|
|
44084
43034
|
{
|
|
@@ -44094,38 +43044,13 @@ var init_ToastSlot = __esm({
|
|
|
44094
43044
|
ToastSlot.displayName = "ToastSlot";
|
|
44095
43045
|
}
|
|
44096
43046
|
});
|
|
44097
|
-
|
|
44098
|
-
|
|
44099
|
-
|
|
44100
|
-
const Resolved = m[name];
|
|
44101
|
-
if (!Resolved) {
|
|
44102
|
-
throw new Error(
|
|
44103
|
-
`[@almadar/ui] 3D component "${name}" was not found in the three subpath bundle.`
|
|
44104
|
-
);
|
|
44105
|
-
}
|
|
44106
|
-
return { default: Resolved };
|
|
44107
|
-
})
|
|
44108
|
-
);
|
|
44109
|
-
function ThreeWrapper(props) {
|
|
44110
|
-
return React90__default.createElement(
|
|
44111
|
-
ThreeBoundary,
|
|
44112
|
-
{ name },
|
|
44113
|
-
React90__default.createElement(
|
|
44114
|
-
React90__default.Suspense,
|
|
44115
|
-
{ fallback: null },
|
|
44116
|
-
React90__default.createElement(Lazy, props)
|
|
44117
|
-
)
|
|
44118
|
-
);
|
|
44119
|
-
}
|
|
44120
|
-
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
44121
|
-
return ThreeWrapper;
|
|
44122
|
-
}
|
|
44123
|
-
var ThreeBoundary, GameCanvas3D2, COMPONENT_REGISTRY;
|
|
43047
|
+
|
|
43048
|
+
// components/core/organisms/component-registry.generated.ts
|
|
43049
|
+
var COMPONENT_REGISTRY;
|
|
44124
43050
|
var init_component_registry_generated = __esm({
|
|
44125
43051
|
"components/core/organisms/component-registry.generated.ts"() {
|
|
44126
43052
|
init_AboutPageTemplate();
|
|
44127
43053
|
init_Accordion();
|
|
44128
|
-
init_ActionButton();
|
|
44129
43054
|
init_ActionPalette();
|
|
44130
43055
|
init_ActionTile();
|
|
44131
43056
|
init_ActivationBlock();
|
|
@@ -44169,7 +43094,6 @@ var init_component_registry_generated = __esm({
|
|
|
44169
43094
|
init_ChoiceButton();
|
|
44170
43095
|
init_CodeBlock();
|
|
44171
43096
|
init_CodeRunnerPanel();
|
|
44172
|
-
init_ComboCounter();
|
|
44173
43097
|
init_CommunityLinks();
|
|
44174
43098
|
init_ConditionalWrapper();
|
|
44175
43099
|
init_ConfettiEffect();
|
|
@@ -44181,7 +43105,6 @@ var init_component_registry_generated = __esm({
|
|
|
44181
43105
|
init_ControlButton();
|
|
44182
43106
|
init_ControlGrid();
|
|
44183
43107
|
init_CounterTemplate();
|
|
44184
|
-
init_DamageNumber();
|
|
44185
43108
|
init_DashboardGrid();
|
|
44186
43109
|
init_DashboardLayout();
|
|
44187
43110
|
init_DataGrid();
|
|
@@ -44211,7 +43134,6 @@ var init_component_registry_generated = __esm({
|
|
|
44211
43134
|
init_EmptyState();
|
|
44212
43135
|
init_ErrorBoundary();
|
|
44213
43136
|
init_ErrorState();
|
|
44214
|
-
init_EventLog();
|
|
44215
43137
|
init_FeatureCard();
|
|
44216
43138
|
init_FeatureDetailPageTemplate();
|
|
44217
43139
|
init_FeatureGrid();
|
|
@@ -44228,12 +43150,10 @@ var init_component_registry_generated = __esm({
|
|
|
44228
43150
|
init_FormField();
|
|
44229
43151
|
init_FormSectionHeader();
|
|
44230
43152
|
init_GameAudioToggle();
|
|
44231
|
-
init_GameCard();
|
|
44232
43153
|
init_GameHud();
|
|
44233
43154
|
init_GameIcon();
|
|
44234
43155
|
init_GameMenu();
|
|
44235
43156
|
init_GameShell();
|
|
44236
|
-
init_GameTemplate();
|
|
44237
43157
|
init_GenericAppTemplate();
|
|
44238
43158
|
init_GeometricPattern();
|
|
44239
43159
|
init_GradientDivider();
|
|
@@ -44250,8 +43170,6 @@ var init_component_registry_generated = __esm({
|
|
|
44250
43170
|
init_Input();
|
|
44251
43171
|
init_InputGroup();
|
|
44252
43172
|
init_InstallBox();
|
|
44253
|
-
init_InventoryGrid();
|
|
44254
|
-
init_ItemSlot();
|
|
44255
43173
|
init_JazariStateMachine();
|
|
44256
43174
|
init_LandingPageTemplate();
|
|
44257
43175
|
init_LawReferenceTooltip();
|
|
@@ -44272,13 +43190,11 @@ var init_component_registry_generated = __esm({
|
|
|
44272
43190
|
init_MediaGallery();
|
|
44273
43191
|
init_Menu();
|
|
44274
43192
|
init_Meter();
|
|
44275
|
-
init_MiniMap();
|
|
44276
43193
|
init_Modal();
|
|
44277
43194
|
init_ModalSlot();
|
|
44278
43195
|
init_ModuleCard();
|
|
44279
43196
|
init_Navigation();
|
|
44280
43197
|
init_NumberStepper();
|
|
44281
|
-
init_ObjectRulePanel();
|
|
44282
43198
|
init_OptionConstraintGroup();
|
|
44283
43199
|
init_OrbitalVisualization();
|
|
44284
43200
|
init_Overlay();
|
|
@@ -44304,8 +43220,6 @@ var init_component_registry_generated = __esm({
|
|
|
44304
43220
|
init_RelationSelect();
|
|
44305
43221
|
init_RepeatableFormSection();
|
|
44306
43222
|
init_ReplyTree();
|
|
44307
|
-
init_ResourceBar();
|
|
44308
|
-
init_ResourceCounter();
|
|
44309
43223
|
init_RichBlockEditor();
|
|
44310
43224
|
init_RuntimeDebugger2();
|
|
44311
43225
|
init_ScaledDiagram();
|
|
@@ -44331,19 +43245,16 @@ var init_component_registry_generated = __esm({
|
|
|
44331
43245
|
init_Split();
|
|
44332
43246
|
init_SplitPane();
|
|
44333
43247
|
init_SplitSection();
|
|
44334
|
-
init_Sprite();
|
|
44335
43248
|
init_StarRating();
|
|
44336
43249
|
init_StatBadge();
|
|
44337
43250
|
init_StatCard();
|
|
44338
43251
|
init_StatDisplay();
|
|
44339
43252
|
init_StateGraph();
|
|
44340
|
-
init_StateIndicator();
|
|
44341
43253
|
init_StateJsonView();
|
|
44342
43254
|
init_StateMachineView();
|
|
44343
43255
|
init_StatsGrid();
|
|
44344
43256
|
init_StatsOrganism();
|
|
44345
43257
|
init_StatusDot();
|
|
44346
|
-
init_StatusEffect();
|
|
44347
43258
|
init_StepFlow();
|
|
44348
43259
|
init_StepFlowOrganism();
|
|
44349
43260
|
init_SubagentTracePanel();
|
|
@@ -44380,46 +43291,19 @@ var init_component_registry_generated = __esm({
|
|
|
44380
43291
|
init_TraitFrame();
|
|
44381
43292
|
init_TraitSlot();
|
|
44382
43293
|
init_TrendIndicator();
|
|
44383
|
-
init_TurnIndicator();
|
|
44384
43294
|
init_TypewriterText();
|
|
44385
43295
|
init_Typography();
|
|
44386
43296
|
init_UISlotRenderer();
|
|
44387
43297
|
init_UploadDropZone();
|
|
44388
|
-
init_VariablePanel();
|
|
44389
43298
|
init_VersionDiff();
|
|
44390
43299
|
init_ViolationAlert();
|
|
44391
43300
|
init_VoteStack();
|
|
44392
|
-
init_WaypointMarker();
|
|
44393
43301
|
init_WizardContainer();
|
|
44394
43302
|
init_WizardNavigation();
|
|
44395
43303
|
init_WizardProgress();
|
|
44396
|
-
ThreeBoundary = class extends React90__default.Component {
|
|
44397
|
-
constructor() {
|
|
44398
|
-
super(...arguments);
|
|
44399
|
-
__publicField(this, "state", { failed: false });
|
|
44400
|
-
}
|
|
44401
|
-
static getDerivedStateFromError() {
|
|
44402
|
-
return { failed: true };
|
|
44403
|
-
}
|
|
44404
|
-
render() {
|
|
44405
|
-
if (this.state.failed) {
|
|
44406
|
-
return React90__default.createElement(
|
|
44407
|
-
"div",
|
|
44408
|
-
{
|
|
44409
|
-
"data-testid": "three-unavailable",
|
|
44410
|
-
style: { padding: 16, fontSize: 13, lineHeight: 1.5, opacity: 0.7 }
|
|
44411
|
-
},
|
|
44412
|
-
`3D pattern "${this.props.name}" requires three.js. Install the optional peers three + @react-three/fiber + @react-three/drei (matching the host React major) to render it.`
|
|
44413
|
-
);
|
|
44414
|
-
}
|
|
44415
|
-
return this.props.children;
|
|
44416
|
-
}
|
|
44417
|
-
};
|
|
44418
|
-
GameCanvas3D2 = lazyThree("GameCanvas3D", () => import('@almadar/ui/components/molecules/game/three'));
|
|
44419
43304
|
COMPONENT_REGISTRY = {
|
|
44420
43305
|
"AboutPageTemplate": AboutPageTemplate,
|
|
44421
43306
|
"Accordion": Accordion,
|
|
44422
|
-
"ActionButton": ActionButton,
|
|
44423
43307
|
"ActionPalette": ActionPalette,
|
|
44424
43308
|
"ActionTile": ActionTile,
|
|
44425
43309
|
"ActivationBlock": ActivationBlock,
|
|
@@ -44468,7 +43352,6 @@ var init_component_registry_generated = __esm({
|
|
|
44468
43352
|
"ChoiceButton": ChoiceButton,
|
|
44469
43353
|
"CodeBlock": CodeBlock,
|
|
44470
43354
|
"CodeRunnerPanel": CodeRunnerPanel,
|
|
44471
|
-
"ComboCounter": ComboCounter,
|
|
44472
43355
|
"CommunityLinks": CommunityLinks,
|
|
44473
43356
|
"ConditionalWrapper": ConditionalWrapper,
|
|
44474
43357
|
"ConfettiEffect": ConfettiEffect,
|
|
@@ -44480,7 +43363,6 @@ var init_component_registry_generated = __esm({
|
|
|
44480
43363
|
"ControlButton": ControlButton,
|
|
44481
43364
|
"ControlGrid": ControlGrid,
|
|
44482
43365
|
"CounterTemplate": CounterTemplate,
|
|
44483
|
-
"DamageNumber": DamageNumber,
|
|
44484
43366
|
"DashboardGrid": DashboardGrid,
|
|
44485
43367
|
"DashboardLayout": DashboardLayout,
|
|
44486
43368
|
"DataGrid": DataGrid,
|
|
@@ -44512,7 +43394,6 @@ var init_component_registry_generated = __esm({
|
|
|
44512
43394
|
"EmptyState": EmptyState,
|
|
44513
43395
|
"ErrorBoundary": ErrorBoundary,
|
|
44514
43396
|
"ErrorState": ErrorState,
|
|
44515
|
-
"EventLog": EventLog,
|
|
44516
43397
|
"FeatureCard": FeatureCard,
|
|
44517
43398
|
"FeatureDetailPageTemplate": FeatureDetailPageTemplate,
|
|
44518
43399
|
"FeatureGrid": FeatureGrid,
|
|
@@ -44530,13 +43411,10 @@ var init_component_registry_generated = __esm({
|
|
|
44530
43411
|
"FormLayout": FormLayout,
|
|
44531
43412
|
"FormSectionHeader": FormSectionHeader,
|
|
44532
43413
|
"GameAudioToggle": GameAudioToggle,
|
|
44533
|
-
"GameCanvas3D": GameCanvas3D2,
|
|
44534
|
-
"GameCard": GameCard,
|
|
44535
43414
|
"GameHud": GameHud,
|
|
44536
43415
|
"GameIcon": GameIcon,
|
|
44537
43416
|
"GameMenu": GameMenu,
|
|
44538
43417
|
"GameShell": GameShell,
|
|
44539
|
-
"GameTemplate": GameTemplate,
|
|
44540
43418
|
"GenericAppTemplate": GenericAppTemplate,
|
|
44541
43419
|
"GeometricPattern": GeometricPattern,
|
|
44542
43420
|
"GradientDivider": GradientDivider,
|
|
@@ -44553,8 +43431,6 @@ var init_component_registry_generated = __esm({
|
|
|
44553
43431
|
"Input": Input,
|
|
44554
43432
|
"InputGroup": InputGroup,
|
|
44555
43433
|
"InstallBox": InstallBox,
|
|
44556
|
-
"InventoryGrid": InventoryGrid,
|
|
44557
|
-
"ItemSlot": ItemSlot,
|
|
44558
43434
|
"JazariStateMachine": JazariStateMachine,
|
|
44559
43435
|
"Label": LabelPattern,
|
|
44560
43436
|
"LabelPattern": LabelPattern,
|
|
@@ -44577,13 +43453,11 @@ var init_component_registry_generated = __esm({
|
|
|
44577
43453
|
"MediaGallery": MediaGallery,
|
|
44578
43454
|
"Menu": Menu,
|
|
44579
43455
|
"Meter": Meter,
|
|
44580
|
-
"MiniMap": MiniMap,
|
|
44581
43456
|
"Modal": Modal,
|
|
44582
43457
|
"ModalSlot": ModalSlot,
|
|
44583
43458
|
"ModuleCard": ModuleCard,
|
|
44584
43459
|
"Navigation": Navigation,
|
|
44585
43460
|
"NumberStepper": NumberStepper,
|
|
44586
|
-
"ObjectRulePanel": ObjectRulePanel,
|
|
44587
43461
|
"OptionConstraintGroup": OptionConstraintGroup,
|
|
44588
43462
|
"OrbitalVisualization": OrbitalVisualization,
|
|
44589
43463
|
"Overlay": Overlay,
|
|
@@ -44609,8 +43483,6 @@ var init_component_registry_generated = __esm({
|
|
|
44609
43483
|
"RelationSelect": RelationSelect,
|
|
44610
43484
|
"RepeatableFormSection": RepeatableFormSection,
|
|
44611
43485
|
"ReplyTree": ReplyTree,
|
|
44612
|
-
"ResourceBar": ResourceBar,
|
|
44613
|
-
"ResourceCounter": ResourceCounter,
|
|
44614
43486
|
"RichBlockEditor": RichBlockEditor,
|
|
44615
43487
|
"RuntimeDebugger": RuntimeDebugger,
|
|
44616
43488
|
"ScaledDiagram": ScaledDiagram,
|
|
@@ -44638,20 +43510,17 @@ var init_component_registry_generated = __esm({
|
|
|
44638
43510
|
"Split": Split,
|
|
44639
43511
|
"SplitPane": SplitPane,
|
|
44640
43512
|
"SplitSection": SplitSection,
|
|
44641
|
-
"Sprite": Sprite,
|
|
44642
43513
|
"Stack": Stack,
|
|
44643
43514
|
"StarRating": StarRating,
|
|
44644
43515
|
"StatBadge": StatBadge,
|
|
44645
43516
|
"StatCard": StatCard,
|
|
44646
43517
|
"StatDisplay": StatDisplay,
|
|
44647
43518
|
"StateGraph": StateGraph,
|
|
44648
|
-
"StateIndicator": StateIndicator,
|
|
44649
43519
|
"StateJsonView": StateJsonView,
|
|
44650
43520
|
"StateMachineView": StateMachineView,
|
|
44651
43521
|
"StatsGrid": StatsGrid,
|
|
44652
43522
|
"StatsOrganism": StatsOrganism,
|
|
44653
43523
|
"StatusDot": StatusDot,
|
|
44654
|
-
"StatusEffect": StatusEffect,
|
|
44655
43524
|
"StepFlow": StepFlow,
|
|
44656
43525
|
"StepFlowOrganism": StepFlowOrganism,
|
|
44657
43526
|
"SubagentTracePanel": SubagentTracePanel,
|
|
@@ -44688,17 +43557,14 @@ var init_component_registry_generated = __esm({
|
|
|
44688
43557
|
"TraitFrame": TraitFrame,
|
|
44689
43558
|
"TraitSlot": TraitSlot,
|
|
44690
43559
|
"TrendIndicator": TrendIndicator,
|
|
44691
|
-
"TurnIndicator": TurnIndicator,
|
|
44692
43560
|
"TypewriterText": TypewriterText,
|
|
44693
43561
|
"Typography": Typography,
|
|
44694
43562
|
"UISlotRenderer": UISlotRenderer,
|
|
44695
43563
|
"UploadDropZone": UploadDropZone,
|
|
44696
43564
|
"VStack": VStack,
|
|
44697
|
-
"VariablePanel": VariablePanel,
|
|
44698
43565
|
"VersionDiff": VersionDiff,
|
|
44699
43566
|
"ViolationAlert": ViolationAlert,
|
|
44700
43567
|
"VoteStack": VoteStack,
|
|
44701
|
-
"WaypointMarker": WaypointMarker,
|
|
44702
43568
|
"WizardContainer": WizardContainer,
|
|
44703
43569
|
"WizardNavigation": WizardNavigation,
|
|
44704
43570
|
"WizardProgress": WizardProgress,
|
|
@@ -44720,7 +43586,7 @@ function SuspenseConfigProvider({
|
|
|
44720
43586
|
config,
|
|
44721
43587
|
children
|
|
44722
43588
|
}) {
|
|
44723
|
-
return
|
|
43589
|
+
return React83__default.createElement(
|
|
44724
43590
|
SuspenseConfigContext.Provider,
|
|
44725
43591
|
{ value: config },
|
|
44726
43592
|
children
|
|
@@ -44762,7 +43628,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
44762
43628
|
}
|
|
44763
43629
|
return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
|
|
44764
43630
|
}
|
|
44765
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
43631
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React83__default.isValidElement(field) && !(field instanceof Date)) {
|
|
44766
43632
|
const obj = field;
|
|
44767
43633
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
44768
43634
|
if (!fieldName) return field;
|
|
@@ -45215,7 +44081,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
45215
44081
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
45216
44082
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
45217
44083
|
}
|
|
45218
|
-
return /* @__PURE__ */ jsx(
|
|
44084
|
+
return /* @__PURE__ */ jsx(React83__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
45219
44085
|
}
|
|
45220
44086
|
if (!child || typeof child !== "object") return null;
|
|
45221
44087
|
const childId = `${parentId}-${index}`;
|
|
@@ -45268,14 +44134,14 @@ function isPatternConfig(value) {
|
|
|
45268
44134
|
if (value === null || value === void 0) return false;
|
|
45269
44135
|
if (typeof value !== "object") return false;
|
|
45270
44136
|
if (Array.isArray(value)) return false;
|
|
45271
|
-
if (
|
|
44137
|
+
if (React83__default.isValidElement(value)) return false;
|
|
45272
44138
|
if (value instanceof Date) return false;
|
|
45273
44139
|
if (typeof value === "function") return false;
|
|
45274
44140
|
const record = value;
|
|
45275
44141
|
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
45276
44142
|
}
|
|
45277
44143
|
function isPlainConfigObject(value) {
|
|
45278
|
-
if (
|
|
44144
|
+
if (React83__default.isValidElement(value)) return false;
|
|
45279
44145
|
if (value instanceof Date) return false;
|
|
45280
44146
|
const proto = Object.getPrototypeOf(value);
|
|
45281
44147
|
return proto === Object.prototype || proto === null;
|
|
@@ -45402,7 +44268,7 @@ function SlotContentRenderer({
|
|
|
45402
44268
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
45403
44269
|
const slotVal = restProps[slotKey];
|
|
45404
44270
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
45405
|
-
if (
|
|
44271
|
+
if (React83__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
45406
44272
|
if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
45407
44273
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
45408
44274
|
slotVal,
|
|
@@ -45454,7 +44320,7 @@ function SlotContentRenderer({
|
|
|
45454
44320
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
45455
44321
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
45456
44322
|
const sample = resolvedItems[0];
|
|
45457
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
44323
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React83__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
45458
44324
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
45459
44325
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
45460
44326
|
}
|
|
@@ -47017,4 +45883,63 @@ function useOptionalOfflineMode() {
|
|
|
47017
45883
|
return useContext(OfflineModeContext);
|
|
47018
45884
|
}
|
|
47019
45885
|
|
|
47020
|
-
|
|
45886
|
+
// providers/GameAudioProvider.tsx
|
|
45887
|
+
init_useEventBus();
|
|
45888
|
+
init_useGameAudio();
|
|
45889
|
+
var GameAudioContext2 = createContext(null);
|
|
45890
|
+
GameAudioContext2.displayName = "GameAudioContext";
|
|
45891
|
+
function useGameAudioContext2() {
|
|
45892
|
+
const ctx = useContext(GameAudioContext2);
|
|
45893
|
+
if (!ctx) {
|
|
45894
|
+
throw new Error("useGameAudioContext must be used inside <GameAudioProvider>");
|
|
45895
|
+
}
|
|
45896
|
+
return ctx;
|
|
45897
|
+
}
|
|
45898
|
+
function useGameAudioContextOptional2() {
|
|
45899
|
+
return useContext(GameAudioContext2);
|
|
45900
|
+
}
|
|
45901
|
+
function GameAudioProvider2({
|
|
45902
|
+
manifest,
|
|
45903
|
+
baseUrl = "",
|
|
45904
|
+
children,
|
|
45905
|
+
initialMuted = false
|
|
45906
|
+
}) {
|
|
45907
|
+
const eventBus = useEventBus();
|
|
45908
|
+
const { play, stop, stopAll, playMusic, stopMusic, muted, setMuted, masterVolume, setMasterVolume } = useGameAudio({ manifest, baseUrl, initialMuted });
|
|
45909
|
+
useEffect(() => {
|
|
45910
|
+
const unsubPlay = eventBus.on("UI:PLAY_SOUND", (event) => {
|
|
45911
|
+
const key = event.payload?.key;
|
|
45912
|
+
if (key) play(key);
|
|
45913
|
+
});
|
|
45914
|
+
const unsubStop = eventBus.on("UI:STOP_SOUND", (event) => {
|
|
45915
|
+
const key = event.payload?.key;
|
|
45916
|
+
if (key) {
|
|
45917
|
+
stop(key);
|
|
45918
|
+
} else {
|
|
45919
|
+
stopAll();
|
|
45920
|
+
}
|
|
45921
|
+
});
|
|
45922
|
+
const unsubChangeMusic = eventBus.on("UI:CHANGE_MUSIC", (event) => {
|
|
45923
|
+
const key = event.payload?.key;
|
|
45924
|
+
if (key) {
|
|
45925
|
+
playMusic(key);
|
|
45926
|
+
} else {
|
|
45927
|
+
stopMusic();
|
|
45928
|
+
}
|
|
45929
|
+
});
|
|
45930
|
+
const unsubStopMusic = eventBus.on("UI:STOP_MUSIC", () => {
|
|
45931
|
+
stopMusic();
|
|
45932
|
+
});
|
|
45933
|
+
return () => {
|
|
45934
|
+
unsubPlay();
|
|
45935
|
+
unsubStop();
|
|
45936
|
+
unsubChangeMusic();
|
|
45937
|
+
unsubStopMusic();
|
|
45938
|
+
};
|
|
45939
|
+
}, [eventBus, play, stop, stopAll, playMusic, stopMusic]);
|
|
45940
|
+
const value = { muted, setMuted, masterVolume, setMasterVolume, play, playMusic, stopMusic };
|
|
45941
|
+
return /* @__PURE__ */ jsx(GameAudioContext2.Provider, { value, children });
|
|
45942
|
+
}
|
|
45943
|
+
GameAudioProvider2.displayName = "GameAudioProvider";
|
|
45944
|
+
|
|
45945
|
+
export { ANONYMOUS_USER, CurrentPagePathContext, CurrentPagePathProvider, EntitySchemaProvider, EventBusContext2 as EventBusContext, EventBusProvider, GameAudioContext2 as GameAudioContext, GameAudioProvider2 as GameAudioProvider, NavigationProvider2 as NavigationProvider, OfflineModeProvider, OrbitalProvider, OrbitalThemeProvider, SelectionContext, SelectionProvider, ServerBridgeProvider, TraitContext, TraitProvider, TraitScopeProvider3 as TraitScopeProvider, UserContext, UserProvider, VerificationProvider, extractRouteParams2 as extractRouteParams, findPageByName2 as findPageByName, findPageByPath2 as findPageByPath, getAllPages2 as getAllPages, getDefaultPage2 as getDefaultPage, matchPath2 as matchPath, pathMatches2 as pathMatches, useActivePage2 as useActivePage, useCurrentPagePath2 as useCurrentPagePath, useEntitySchema, useEntitySchemaOptional6 as useEntitySchemaOptional, useGameAudioContext2 as useGameAudioContext, useGameAudioContextOptional2 as useGameAudioContextOptional, useHasPermission, useHasRole, useInitPayload2 as useInitPayload, useNavigateTo2 as useNavigateTo, useNavigation2 as useNavigation, useNavigationId2 as useNavigationId, useNavigationState2 as useNavigationState, useOfflineMode, useOptionalOfflineMode, useSelection, useSelectionOptional, useServerBridge, useTrait, useTraitContext, useTraitScope2 as useTraitScope, useUser, useUserForEvaluation };
|