@almadar/ui 5.107.0 → 5.108.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/avl/index.cjs +1427 -2828
  2. package/dist/avl/index.js +525 -1926
  3. package/dist/components/{game → core}/atoms/GameIcon.d.ts +1 -1
  4. package/dist/components/core/atoms/index.d.ts +1 -0
  5. package/dist/components/core/templates/index.d.ts +0 -1
  6. package/dist/components/game/molecules/index.d.ts +8 -28
  7. package/dist/components/index.cjs +223 -1691
  8. package/dist/components/index.js +213 -1671
  9. package/dist/lib/drawable/projector.d.ts +1 -1
  10. package/dist/{components/game/three/molecules/GameCanvas3D.d.ts → lib/drawable/three/Canvas3DHost.d.ts} +12 -9
  11. package/dist/lib/drawable/{Drawable3D.d.ts → three/Drawable3D.d.ts} +2 -2
  12. package/dist/lib/drawable/three/GameCamera3D.d.ts +16 -0
  13. package/dist/lib/drawable/three/game3dTheme.d.ts +14 -0
  14. package/dist/{components/game → lib/drawable}/three/hooks/useGameCanvas3DEvents.d.ts +1 -1
  15. package/dist/{components/game → lib/drawable}/three/index.cjs +2019 -2020
  16. package/dist/{components/game → lib/drawable}/three/index.css +3 -3
  17. package/dist/lib/drawable/three/index.d.ts +39 -0
  18. package/dist/{components/game → lib/drawable}/three/index.js +1932 -1934
  19. package/dist/lib/drawable/{mesh3d.d.ts → three/mesh3d.d.ts} +4 -4
  20. package/dist/{components/game/lib → lib}/puzzleObject.d.ts +11 -2
  21. package/dist/{components/game/providers → providers}/GameAudioProvider.d.ts +1 -1
  22. package/dist/providers/index.cjs +1619 -2690
  23. package/dist/providers/index.d.ts +2 -0
  24. package/dist/providers/index.js +827 -1902
  25. package/dist/runtime/index.cjs +1288 -2689
  26. package/dist/runtime/index.js +505 -1906
  27. package/package.json +7 -7
  28. package/dist/components/game/atoms/ActionButton.d.ts +0 -31
  29. package/dist/components/game/atoms/ComboCounter.d.ts +0 -20
  30. package/dist/components/game/atoms/DamageNumber.d.ts +0 -18
  31. package/dist/components/game/atoms/GameCard.d.ts +0 -34
  32. package/dist/components/game/atoms/ItemSlot.d.ts +0 -31
  33. package/dist/components/game/atoms/ResourceCounter.d.ts +0 -26
  34. package/dist/components/game/atoms/Sprite.d.ts +0 -52
  35. package/dist/components/game/atoms/StatusEffect.d.ts +0 -25
  36. package/dist/components/game/atoms/TurnIndicator.d.ts +0 -22
  37. package/dist/components/game/atoms/WaypointMarker.d.ts +0 -23
  38. package/dist/components/game/molecules/EventLog.d.ts +0 -31
  39. package/dist/components/game/molecules/InventoryGrid.d.ts +0 -35
  40. package/dist/components/game/molecules/ObjectRulePanel.d.ts +0 -32
  41. package/dist/components/game/molecules/ResourceBar.d.ts +0 -26
  42. package/dist/components/game/molecules/RuleEditor.d.ts +0 -39
  43. package/dist/components/game/molecules/VariablePanel.d.ts +0 -28
  44. package/dist/components/game/templates/GameTemplate.d.ts +0 -35
  45. package/dist/components/game/three/atoms/SpriteBillboard3D.d.ts +0 -18
  46. package/dist/components/game/three/game3dTheme.d.ts +0 -55
  47. package/dist/components/game/three/index.d.ts +0 -12
  48. package/dist/components/game/three/lib/game3dAssetManifest.d.ts +0 -48
  49. package/dist/components/game/three/molecules/GameCamera3D.d.ts +0 -35
  50. package/dist/components/game/three/molecules/index.d.ts +0 -32
  51. package/dist/components/game/three/patterns.d.ts +0 -16
  52. /package/dist/{components/game/hooks → hooks}/useCamera.d.ts +0 -0
  53. /package/dist/{components/game/hooks → hooks}/useGameAudio.d.ts +0 -0
  54. /package/dist/{components/game/hooks → hooks}/useImageCache.d.ts +0 -0
  55. /package/dist/{components/game/hooks → hooks}/useUnitSpriteAtlas.d.ts +0 -0
  56. /package/dist/{components/game/lib → lib}/boardEntity.d.ts +0 -0
  57. /package/dist/{components/game/three/molecules → lib/drawable/three}/Camera3D.d.ts +0 -0
  58. /package/dist/{components/game/three/molecules → lib/drawable/three}/Canvas3DErrorBoundary.d.ts +0 -0
  59. /package/dist/{components/game/three/molecules → lib/drawable/three}/Canvas3DLoadingState.d.ts +0 -0
  60. /package/dist/{components/game/three/molecules → lib/drawable/three}/Lighting3D.d.ts +0 -0
  61. /package/dist/{components/game/three/molecules → lib/drawable/three}/ModelLoader.d.ts +0 -0
  62. /package/dist/{components/game/three/molecules → lib/drawable/three}/Scene3D.d.ts +0 -0
  63. /package/dist/{components/game → lib/drawable}/three/hooks/useAssetLoader.d.ts +0 -0
  64. /package/dist/{components/game → lib/drawable}/three/hooks/useRaycaster.d.ts +0 -0
  65. /package/dist/{components/game → lib/drawable}/three/hooks/useSceneGraph.d.ts +0 -0
  66. /package/dist/{components/game → lib/drawable}/three/hooks/useThree.d.ts +0 -0
  67. /package/dist/{components/game → lib/drawable}/three/lib/AssetLoader.d.ts +0 -0
  68. /package/dist/{components/game → lib/drawable}/three/lib/culling.d.ts +0 -0
  69. /package/dist/{components/game → lib/drawable}/three/lib/grid3D.d.ts +0 -0
  70. /package/dist/{components/game/lib → lib}/editorUtils.d.ts +0 -0
  71. /package/dist/{components/game/lib → lib}/game.d.ts +0 -0
  72. /package/dist/{components/game/lib/index.d.ts → lib/gameShared.d.ts} +0 -0
  73. /package/dist/{components/game/lib → lib}/isometric.d.ts +0 -0
  74. /package/dist/{components/game/lib → lib}/isometricTypes.d.ts +0 -0
  75. /package/dist/{components/game/lib → lib}/makeAsset.d.ts +0 -0
  76. /package/dist/{components/game/lib → lib}/mechanics.d.ts +0 -0
  77. /package/dist/{components/game/lib → lib}/physicsPresets.d.ts +0 -0
  78. /package/dist/{components/game/lib → lib}/physicsTypes.d.ts +0 -0
  79. /package/dist/{components/game/lib → lib}/spriteAnimation.d.ts +0 -0
  80. /package/dist/{components/game/lib → lib}/spriteAnimationTypes.d.ts +0 -0
  81. /package/dist/{components/game/lib → lib}/spriteSheetConstants.d.ts +0 -0
@@ -3,7 +3,8 @@ import * as React73 from 'react';
3
3
  import React73__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, useState, Suspense, lazy, useSyncExternalStore, useLayoutEffect, useId } from 'react';
4
4
  import { clsx } from 'clsx';
5
5
  import { twMerge } from 'tailwind-merge';
6
- import { EventBusContext, useTraitScope, useCurrentPagePath, useEntitySchemaOptional, TraitScopeProvider } from '@almadar/ui/providers';
6
+ import { EventBusContext, useTraitScope, useCurrentPagePath, useGameAudioContextOptional, useEntitySchemaOptional, TraitScopeProvider } from '@almadar/ui/providers';
7
+ export { GameAudioContext, GameAudioProvider, useGameAudioContext } from '@almadar/ui/providers';
7
8
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
8
9
  import * as LucideIcons2 from 'lucide-react';
9
10
  import { X, List, Printer, ChevronRight, ChevronLeft, RotateCcw, Play, Terminal, CheckCircle, XCircle, ChevronDown, Search, ChevronUp, MoreHorizontal, Package, Calendar, Pencil, Eye, Image as Image$1, Upload, ZoomIn, TrendingUp, TrendingDown, Minus, AlertCircle, Circle, Clock, CheckCircle2, Loader2, Code, FileText, WrapText, Check, Copy, HelpCircle, Type, Heading1, Heading2, Heading3, ListOrdered, Quote, GitBranch, Plus, ArrowRight, Trash, ArrowLeft, Menu as Menu$1, AlertTriangle, Trash2, Eraser, ZoomOut, Download, Lightbulb, PauseCircle, Link2, Tag, User, DollarSign } from 'lucide-react';
@@ -3144,6 +3145,38 @@ var init_Badge = __esm({
3144
3145
  Badge.displayName = "Badge";
3145
3146
  }
3146
3147
  });
3148
+ function GameIcon({ assetUrl, icon, size = "md", alt, className }) {
3149
+ const px = typeof size === "number" ? size : sizeMap[size];
3150
+ const family = useIconFamily();
3151
+ if (assetUrl?.url) {
3152
+ return /* @__PURE__ */ jsx(
3153
+ AtlasImage,
3154
+ {
3155
+ asset: assetUrl,
3156
+ size: px,
3157
+ alt: alt ?? assetUrl.category ?? "",
3158
+ className: cn("flex-shrink-0", className)
3159
+ }
3160
+ );
3161
+ }
3162
+ const I = typeof icon === "string" ? resolveIconForFamily(icon, family) : icon;
3163
+ return /* @__PURE__ */ jsx(I, { width: px, height: px, className: cn("flex-shrink-0", className) });
3164
+ }
3165
+ var sizeMap;
3166
+ var init_GameIcon = __esm({
3167
+ "components/core/atoms/GameIcon.tsx"() {
3168
+ "use client";
3169
+ init_cn();
3170
+ init_iconFamily();
3171
+ init_AtlasImage();
3172
+ sizeMap = {
3173
+ sm: 16,
3174
+ md: 24,
3175
+ lg: 32
3176
+ };
3177
+ GameIcon.displayName = "GameIcon";
3178
+ }
3179
+ });
3147
3180
  var variantStyles4, sizeStyles4, iconSizes, FilterPill;
3148
3181
  var init_FilterPill = __esm({
3149
3182
  "components/core/atoms/FilterPill.tsx"() {
@@ -4384,7 +4417,7 @@ var init_TextHighlight = __esm({
4384
4417
  }) => {
4385
4418
  const eventBus = useEventBus();
4386
4419
  const baseStyles = "cursor-pointer transition-all duration-150";
4387
- const typeStyles2 = {
4420
+ const typeStyles = {
4388
4421
  question: cn(
4389
4422
  // Blue border for questions
4390
4423
  "bg-card border-b-2 border-primary-600",
@@ -4404,7 +4437,7 @@ var init_TextHighlight = __esm({
4404
4437
  "data-highlight": "true",
4405
4438
  "data-highlight-type": highlightType,
4406
4439
  "data-annotation-id": annotationId,
4407
- className: cn(baseStyles, typeStyles2[highlightType], className),
4440
+ className: cn(baseStyles, typeStyles[highlightType], className),
4408
4441
  onClick: () => {
4409
4442
  if (action) eventBus.emit(`UI:${action}`, { annotationId });
4410
4443
  onClick?.();
@@ -8145,135 +8178,6 @@ var init_Accordion = __esm({
8145
8178
  Accordion.displayName = "Accordion";
8146
8179
  }
8147
8180
  });
8148
- function GameIcon({ assetUrl, icon, size = "md", alt, className }) {
8149
- const px = typeof size === "number" ? size : sizeMap[size];
8150
- if (assetUrl?.url) {
8151
- return /* @__PURE__ */ jsx(
8152
- AtlasImage,
8153
- {
8154
- asset: assetUrl,
8155
- size: px,
8156
- alt: alt ?? assetUrl.category ?? "",
8157
- className: cn("flex-shrink-0", className)
8158
- }
8159
- );
8160
- }
8161
- const I = typeof icon === "string" ? resolveIcon(icon) : icon;
8162
- return /* @__PURE__ */ jsx(I, { width: px, height: px, className: cn("flex-shrink-0", className) });
8163
- }
8164
- var sizeMap;
8165
- var init_GameIcon = __esm({
8166
- "components/game/atoms/GameIcon.tsx"() {
8167
- "use client";
8168
- init_cn();
8169
- init_Icon();
8170
- init_AtlasImage();
8171
- sizeMap = {
8172
- sm: 16,
8173
- md: 24,
8174
- lg: 32
8175
- };
8176
- GameIcon.displayName = "GameIcon";
8177
- }
8178
- });
8179
- function ActionButton({
8180
- assetUrl = DEFAULT_ASSET_URL,
8181
- label = "Attack",
8182
- icon,
8183
- cooldown = 0,
8184
- disabled = false,
8185
- hotkey,
8186
- size = "md",
8187
- variant = "primary",
8188
- onClick,
8189
- action,
8190
- className
8191
- }) {
8192
- const eventBus = useEventBus();
8193
- const sizes = sizeMap2[size];
8194
- const onCooldown = cooldown > 0;
8195
- const isDisabled = disabled || onCooldown;
8196
- const cooldownDeg = Math.round(cooldown * 360);
8197
- return /* @__PURE__ */ jsxs(
8198
- Button,
8199
- {
8200
- variant: variant === "danger" ? "danger" : variant === "secondary" ? "secondary" : "primary",
8201
- disabled: isDisabled,
8202
- onClick: () => {
8203
- if (action) eventBus.emit(`UI:${action}`, {});
8204
- onClick?.();
8205
- },
8206
- className: cn(
8207
- "relative inline-flex items-center gap-1.5 rounded-interactive border font-medium overflow-hidden transition-colors duration-150",
8208
- sizes.button,
8209
- variantStyles7[variant],
8210
- isDisabled && "opacity-60 cursor-not-allowed",
8211
- className
8212
- ),
8213
- children: [
8214
- onCooldown && /* @__PURE__ */ jsx(
8215
- Box,
8216
- {
8217
- position: "absolute",
8218
- className: "inset-0 bg-foreground/40 pointer-events-none",
8219
- style: {
8220
- clipPath: `conic-gradient(from 0deg, transparent ${360 - cooldownDeg}deg, black ${360 - cooldownDeg}deg)`,
8221
- WebkitClipPath: `conic-gradient(from 0deg, transparent ${360 - cooldownDeg}deg, black ${360 - cooldownDeg}deg)`,
8222
- background: `conic-gradient(from 0deg, transparent ${360 - cooldownDeg}deg, rgba(0,0,0,0.6) ${360 - cooldownDeg}deg)`
8223
- }
8224
- }
8225
- ),
8226
- 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" ? (() => {
8227
- const I = resolveIcon(icon);
8228
- return I ? /* @__PURE__ */ jsx(I, { className: "w-4 h-4" }) : null;
8229
- })() : /* @__PURE__ */ (() => {
8230
- const I = icon;
8231
- return /* @__PURE__ */ jsx(I, { className: "w-4 h-4" });
8232
- })() }) : null,
8233
- /* @__PURE__ */ jsx(Typography, { as: "span", className: "relative z-10", children: label }),
8234
- hotkey && /* @__PURE__ */ jsx(
8235
- Typography,
8236
- {
8237
- as: "span",
8238
- className: cn(
8239
- "absolute top-0.5 right-0.5 bg-foreground/30 text-primary-foreground rounded font-mono leading-tight",
8240
- sizes.hotkey
8241
- ),
8242
- children: hotkey
8243
- }
8244
- )
8245
- ]
8246
- }
8247
- );
8248
- }
8249
- var sizeMap2, variantStyles7, DEFAULT_ASSET_URL;
8250
- var init_ActionButton = __esm({
8251
- "components/game/atoms/ActionButton.tsx"() {
8252
- init_cn();
8253
- init_Icon();
8254
- init_useEventBus();
8255
- init_Button();
8256
- init_Box();
8257
- init_Typography();
8258
- init_GameIcon();
8259
- sizeMap2 = {
8260
- sm: { button: "h-button-sm px-3 text-xs", hotkey: "text-[9px] px-1", icon: "text-xs" },
8261
- md: { button: "h-button-md px-4 text-sm", hotkey: "text-xs px-1.5", icon: "text-sm" },
8262
- lg: { button: "h-button-lg px-5 text-base", hotkey: "text-xs px-2", icon: "text-base" }
8263
- };
8264
- variantStyles7 = {
8265
- primary: "bg-primary text-primary-foreground hover:bg-primary-hover border-primary",
8266
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary-hover border-border",
8267
- danger: "bg-error text-error-foreground hover:bg-error/90 border-error"
8268
- };
8269
- DEFAULT_ASSET_URL = {
8270
- url: "https://almadar-kflow-assets.web.app/shared/effects/particles/slash_01.png",
8271
- role: "ui",
8272
- category: "action"
8273
- };
8274
- ActionButton.displayName = "ActionButton";
8275
- }
8276
- });
8277
8181
  function ActionTile({
8278
8182
  action,
8279
8183
  size = "md",
@@ -14117,14 +14021,14 @@ function SpacerPattern({ size = "flex" }) {
14117
14021
  if (size === "flex") {
14118
14022
  return /* @__PURE__ */ jsx(Spacer, {});
14119
14023
  }
14120
- const sizeMap16 = {
14024
+ const sizeMap8 = {
14121
14025
  xs: "0.25rem",
14122
14026
  sm: "0.5rem",
14123
14027
  md: "1rem",
14124
14028
  lg: "1.5rem",
14125
14029
  xl: "2rem"
14126
14030
  };
14127
- return /* @__PURE__ */ jsx(Box, { style: { width: sizeMap16[size], height: sizeMap16[size], flexShrink: 0 } });
14031
+ return /* @__PURE__ */ jsx(Box, { style: { width: sizeMap8[size], height: sizeMap8[size], flexShrink: 0 } });
14128
14032
  }
14129
14033
  function DividerPattern({
14130
14034
  orientation = "horizontal",
@@ -15410,7 +15314,7 @@ function useImageCache(urls) {
15410
15314
  };
15411
15315
  }
15412
15316
  var init_useImageCache = __esm({
15413
- "components/game/hooks/useImageCache.ts"() {
15317
+ "hooks/useImageCache.ts"() {
15414
15318
  "use client";
15415
15319
  init_verificationRegistry();
15416
15320
  }
@@ -15524,7 +15428,7 @@ function useCamera() {
15524
15428
  };
15525
15429
  }
15526
15430
  var init_useCamera = __esm({
15527
- "components/game/hooks/useCamera.ts"() {
15431
+ "hooks/useCamera.ts"() {
15528
15432
  "use client";
15529
15433
  }
15530
15434
  });
@@ -15788,7 +15692,7 @@ var init_webPainter2d = __esm({
15788
15692
  }
15789
15693
  });
15790
15694
 
15791
- // components/game/lib/isometric.ts
15695
+ // lib/isometric.ts
15792
15696
  function isoToScreen(tileX, tileY, scale, baseOffsetX, layout = "isometric") {
15793
15697
  const scaledTileWidth = TILE_WIDTH * scale;
15794
15698
  const scaledFloorHeight = FLOOR_HEIGHT * scale;
@@ -15826,7 +15730,7 @@ function screenToIso(screenX, screenY, scale, baseOffsetX, layout = "isometric")
15826
15730
  }
15827
15731
  var TILE_WIDTH, TILE_HEIGHT, FLOOR_HEIGHT, DIAMOND_TOP_Y, FEATURE_COLORS, BACKGROUND_FALLBACK_COLOR, MINIMAP_TERRAIN_COLORS;
15828
15732
  var init_isometric = __esm({
15829
- "components/game/lib/isometric.ts"() {
15733
+ "lib/isometric.ts"() {
15830
15734
  TILE_WIDTH = 256;
15831
15735
  TILE_HEIGHT = 512;
15832
15736
  FLOOR_HEIGHT = 128;
@@ -16572,7 +16476,7 @@ function Canvas({
16572
16476
  keyMap,
16573
16477
  keyUpMap
16574
16478
  };
16575
- return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(GameCanvas3D, { ...props3d }) });
16479
+ return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(Canvas3DHost, { ...props3d }) });
16576
16480
  }
16577
16481
  return /* @__PURE__ */ jsx(
16578
16482
  Canvas2D,
@@ -16596,13 +16500,13 @@ function Canvas({
16596
16500
  }
16597
16501
  );
16598
16502
  }
16599
- var GameCanvas3D;
16503
+ var Canvas3DHost;
16600
16504
  var init_Canvas = __esm({
16601
16505
  "components/game/molecules/Canvas.tsx"() {
16602
16506
  "use client";
16603
16507
  init_Canvas2D();
16604
- GameCanvas3D = lazy(
16605
- () => import('@almadar/ui/components/molecules/game/three').then((m) => ({ default: m.GameCanvas3D }))
16508
+ Canvas3DHost = lazy(
16509
+ () => import('@almadar/ui/components/molecules/game/three').then((m) => ({ default: m.Canvas3DHost }))
16606
16510
  );
16607
16511
  Canvas.displayName = "Canvas";
16608
16512
  }
@@ -18470,16 +18374,14 @@ function ChoiceButton({
18470
18374
  payload,
18471
18375
  className
18472
18376
  }) {
18473
- const eventBus = useEventBus();
18474
18377
  return /* @__PURE__ */ jsxs(
18475
18378
  Button,
18476
18379
  {
18477
18380
  variant: "ghost",
18478
18381
  disabled,
18479
- onClick: () => {
18480
- if (action) eventBus.emit(`UI:${action}`, payload ?? {});
18481
- onClick?.();
18482
- },
18382
+ action,
18383
+ actionPayload: payload,
18384
+ onClick,
18483
18385
  className: cn(
18484
18386
  "w-full text-left px-4 py-2.5 rounded-interactive border transition-all duration-150",
18485
18387
  "flex items-center gap-2",
@@ -18518,7 +18420,6 @@ var init_ChoiceButton = __esm({
18518
18420
  "components/game/atoms/ChoiceButton.tsx"() {
18519
18421
  init_cn();
18520
18422
  init_Icon();
18521
- init_useEventBus();
18522
18423
  init_Button();
18523
18424
  init_Box();
18524
18425
  init_Typography();
@@ -18689,73 +18590,6 @@ var init_CodeRunnerPanel = __esm({
18689
18590
  CodeRunnerPanel.displayName = "CodeRunnerPanel";
18690
18591
  }
18691
18592
  });
18692
- function getComboIntensity(combo) {
18693
- if (combo >= 10) return "text-error animate-pulse";
18694
- if (combo >= 7) return "text-warning";
18695
- if (combo >= 4) return "text-warning";
18696
- return "text-foreground";
18697
- }
18698
- function getComboScale(combo) {
18699
- if (combo >= 10) return "scale-110";
18700
- if (combo >= 5) return "scale-105";
18701
- return "";
18702
- }
18703
- function ComboCounter({
18704
- assetUrl = DEFAULT_ASSET_URL2,
18705
- combo = 5,
18706
- multiplier,
18707
- streak,
18708
- size = "md",
18709
- className
18710
- }) {
18711
- const sizes = sizeMap3[size];
18712
- if (combo <= 0) return null;
18713
- return /* @__PURE__ */ jsxs(
18714
- Box,
18715
- {
18716
- className: cn(
18717
- "inline-flex flex-col items-center justify-center",
18718
- "rounded-container bg-card/80 border border-muted px-3 py-1.5",
18719
- "transition-transform duration-200",
18720
- getComboScale(combo),
18721
- className
18722
- ),
18723
- children: [
18724
- assetUrl && /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 24, className: "flex-shrink-0 mb-0.5" }),
18725
- /* @__PURE__ */ jsx(Typography, { as: "span", className: cn("font-black tabular-nums leading-none", sizes.combo, getComboIntensity(combo)), children: combo }),
18726
- /* @__PURE__ */ jsx(Typography, { as: "span", className: cn("font-bold uppercase tracking-wider text-muted-foreground", sizes.label), children: "combo" }),
18727
- multiplier != null && multiplier > 1 && /* @__PURE__ */ jsxs(Typography, { as: "span", className: cn("font-bold text-warning tabular-nums", sizes.multiplier), children: [
18728
- "x",
18729
- multiplier.toFixed(1)
18730
- ] }),
18731
- streak != null && streak > 0 && /* @__PURE__ */ jsxs(Typography, { as: "span", className: cn("text-muted-foreground tabular-nums", sizes.label), children: [
18732
- streak,
18733
- " streak"
18734
- ] })
18735
- ]
18736
- }
18737
- );
18738
- }
18739
- var DEFAULT_ASSET_URL2, sizeMap3;
18740
- var init_ComboCounter = __esm({
18741
- "components/game/atoms/ComboCounter.tsx"() {
18742
- init_cn();
18743
- init_Box();
18744
- init_Typography();
18745
- init_GameIcon();
18746
- DEFAULT_ASSET_URL2 = {
18747
- url: "https://almadar-kflow-assets.web.app/shared/effects/flash/flash00.png",
18748
- role: "effect",
18749
- category: "effect"
18750
- };
18751
- sizeMap3 = {
18752
- sm: { combo: "text-lg", label: "text-xs", multiplier: "text-xs" },
18753
- md: { combo: "text-2xl", label: "text-xs", multiplier: "text-sm" },
18754
- lg: { combo: "text-4xl", label: "text-sm", multiplier: "text-base" }
18755
- };
18756
- ComboCounter.displayName = "ComboCounter";
18757
- }
18758
- });
18759
18593
  function formatCount(count) {
18760
18594
  if (count >= 1e3) {
18761
18595
  return `${(count / 1e3).toFixed(1)}k`;
@@ -19005,7 +18839,7 @@ function ControlButton({
19005
18839
  "select-none touch-none",
19006
18840
  "transition-all duration-100",
19007
18841
  "active:scale-95",
19008
- sizeMap4[size] ?? sizeMap4.md,
18842
+ sizeMap2[size] ?? sizeMap2.md,
19009
18843
  shapeMap[shape] ?? shapeMap.circle,
19010
18844
  variantMap[variant] ?? variantMap.secondary,
19011
18845
  actualPressed && "scale-95 brightness-110 border-foreground",
@@ -19022,7 +18856,7 @@ function ControlButton({
19022
18856
  }
19023
18857
  );
19024
18858
  }
19025
- var sizeMap4, shapeMap, variantMap;
18859
+ var sizeMap2, shapeMap, variantMap;
19026
18860
  var init_ControlButton = __esm({
19027
18861
  "components/game/atoms/ControlButton.tsx"() {
19028
18862
  "use client";
@@ -19033,7 +18867,7 @@ var init_ControlButton = __esm({
19033
18867
  init_Box();
19034
18868
  init_Typography();
19035
18869
  init_GameIcon();
19036
- sizeMap4 = {
18870
+ sizeMap2 = {
19037
18871
  sm: "w-10 h-10 text-sm",
19038
18872
  md: "w-14 h-14 text-base",
19039
18873
  lg: "w-18 h-18 text-lg",
@@ -19474,67 +19308,6 @@ var init_CounterTemplate = __esm({
19474
19308
  CounterTemplate.displayName = "CounterTemplate";
19475
19309
  }
19476
19310
  });
19477
- function DamageNumber({
19478
- assetUrl = DEFAULT_ASSET_URL3,
19479
- value = 42,
19480
- type = "damage",
19481
- size = "md",
19482
- className
19483
- }) {
19484
- const displayText = type === "miss" ? "MISS" : type === "heal" ? `+${value}` : `${value}`;
19485
- return /* @__PURE__ */ jsxs(Fragment, { children: [
19486
- /* @__PURE__ */ jsx("style", { children: floatKeyframes }),
19487
- /* @__PURE__ */ jsxs(
19488
- Typography,
19489
- {
19490
- as: "span",
19491
- className: cn(
19492
- "inline-flex items-center gap-0.5 font-mono select-none pointer-events-none",
19493
- sizeMap5[size],
19494
- typeStyles[type],
19495
- className
19496
- ),
19497
- style: { animation: "damageFloat 1s ease-out forwards" },
19498
- children: [
19499
- assetUrl && /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 14, className: "flex-shrink-0" }),
19500
- displayText
19501
- ]
19502
- }
19503
- )
19504
- ] });
19505
- }
19506
- var sizeMap5, typeStyles, floatKeyframes, DEFAULT_ASSET_URL3;
19507
- var init_DamageNumber = __esm({
19508
- "components/game/atoms/DamageNumber.tsx"() {
19509
- init_cn();
19510
- init_Typography();
19511
- init_GameIcon();
19512
- sizeMap5 = {
19513
- sm: "text-sm",
19514
- md: "text-lg",
19515
- lg: "text-2xl"
19516
- };
19517
- typeStyles = {
19518
- damage: "text-error font-bold",
19519
- heal: "text-success font-bold",
19520
- crit: "text-warning font-extrabold",
19521
- miss: "text-muted-foreground italic"
19522
- };
19523
- floatKeyframes = `
19524
- @keyframes damageFloat {
19525
- 0% { opacity: 1; transform: translateY(0) scale(1); }
19526
- 20% { transform: translateY(-8px) scale(1.1); }
19527
- 100% { opacity: 0; transform: translateY(-32px) scale(0.8); }
19528
- }
19529
- `;
19530
- DEFAULT_ASSET_URL3 = {
19531
- url: "https://almadar-kflow-assets.web.app/shared/effects/particles/spark_01.png",
19532
- role: "effect",
19533
- category: "effect"
19534
- };
19535
- DamageNumber.displayName = "DamageNumber";
19536
- }
19537
- });
19538
19311
  var gapStyles4, columnStyles, colSpanStyles, rowSpanStyles, DashboardGrid;
19539
19312
  var init_DashboardGrid = __esm({
19540
19313
  "components/core/organisms/layout/DashboardGrid.tsx"() {
@@ -25709,13 +25482,13 @@ var init_LineChart = __esm({
25709
25482
  LineChart2.displayName = "LineChart";
25710
25483
  }
25711
25484
  });
25712
- var sizeMap6, stateColors, ProgressDots;
25485
+ var sizeMap3, stateColors, ProgressDots;
25713
25486
  var init_ProgressDots = __esm({
25714
25487
  "components/core/molecules/ProgressDots.tsx"() {
25715
25488
  "use client";
25716
25489
  init_cn();
25717
25490
  init_atoms();
25718
- sizeMap6 = {
25491
+ sizeMap3 = {
25719
25492
  sm: { dot: 6, active: 8 },
25720
25493
  md: { dot: 8, active: 10 },
25721
25494
  lg: { dot: 10, active: 14 }
@@ -25741,7 +25514,7 @@ var init_ProgressDots = __esm({
25741
25514
  [currentIndex]
25742
25515
  );
25743
25516
  const resolveState = getState2 ?? defaultGetState;
25744
- const dims = sizeMap6[size];
25517
+ const dims = sizeMap3[size];
25745
25518
  return /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", className: cn(className), children: Array.from({ length: count }, (_, index) => {
25746
25519
  const state = resolveState(index);
25747
25520
  const isActive = state === "active";
@@ -25769,7 +25542,7 @@ var init_ProgressDots = __esm({
25769
25542
  }
25770
25543
  });
25771
25544
 
25772
- // components/game/lib/game.ts
25545
+ // lib/game.ts
25773
25546
  function createInitialGameState(width, height, units, defaultTerrain = "floorStone") {
25774
25547
  const board = Array.from(
25775
25548
  { length: height },
@@ -25839,11 +25612,11 @@ function calculateAttackTargets(state, unitId) {
25839
25612
  return targets;
25840
25613
  }
25841
25614
  var init_game = __esm({
25842
- "components/game/lib/game.ts"() {
25615
+ "lib/game.ts"() {
25843
25616
  }
25844
25617
  });
25845
25618
 
25846
- // components/game/lib/boardEntity.ts
25619
+ // lib/boardEntity.ts
25847
25620
  function boardEntity(entity) {
25848
25621
  if (!entity) return void 0;
25849
25622
  return Array.isArray(entity) ? entity[0] : entity;
@@ -25875,11 +25648,11 @@ function unitHealth(u) {
25875
25648
  return num(u.health);
25876
25649
  }
25877
25650
  var init_boardEntity = __esm({
25878
- "components/game/lib/boardEntity.ts"() {
25651
+ "lib/boardEntity.ts"() {
25879
25652
  }
25880
25653
  });
25881
25654
 
25882
- // components/game/lib/makeAsset.ts
25655
+ // lib/makeAsset.ts
25883
25656
  function makeAsset(url, role, overrides = {}) {
25884
25657
  const defaults = ROLE_DEFAULTS[role] ?? { dimension: "2d", animations: ["static"], aspect: "1:1" };
25885
25658
  return {
@@ -25899,7 +25672,7 @@ function makeAssetMap(record, role, overrides = {}) {
25899
25672
  }
25900
25673
  var ROLE_DEFAULTS;
25901
25674
  var init_makeAsset = __esm({
25902
- "components/game/lib/makeAsset.ts"() {
25675
+ "lib/makeAsset.ts"() {
25903
25676
  ROLE_DEFAULTS = {
25904
25677
  tile: { dimension: "2d", animations: ["static"], aspect: "1:1" },
25905
25678
  decoration: { dimension: "2d", animations: ["static"], aspect: "1:1" },
@@ -25915,10 +25688,10 @@ var init_makeAsset = __esm({
25915
25688
  }
25916
25689
  });
25917
25690
 
25918
- // components/game/lib/spriteSheetConstants.ts
25691
+ // lib/spriteSheetConstants.ts
25919
25692
  var SHEET_COLUMNS, SPRITE_SHEET_LAYOUT;
25920
25693
  var init_spriteSheetConstants = __esm({
25921
- "components/game/lib/spriteSheetConstants.ts"() {
25694
+ "lib/spriteSheetConstants.ts"() {
25922
25695
  SHEET_COLUMNS = 8;
25923
25696
  SPRITE_SHEET_LAYOUT = {
25924
25697
  idle: { row: 0, frames: 4, frameRate: 6, loop: true },
@@ -25930,7 +25703,7 @@ var init_spriteSheetConstants = __esm({
25930
25703
  }
25931
25704
  });
25932
25705
 
25933
- // components/game/lib/spriteAnimation.ts
25706
+ // lib/spriteAnimation.ts
25934
25707
  function inferDirection(dx, dy) {
25935
25708
  if (dx === 0 && dy === 0) return "se";
25936
25709
  if (dx >= 0 && dy >= 0) return "se";
@@ -26038,14 +25811,14 @@ function tickAnimationState(state, deltaMs) {
26038
25811
  return { ...state, elapsed: newElapsed, frame, finished };
26039
25812
  }
26040
25813
  var init_spriteAnimation = __esm({
26041
- "components/game/lib/spriteAnimation.ts"() {
25814
+ "lib/spriteAnimation.ts"() {
26042
25815
  init_spriteSheetConstants();
26043
25816
  }
26044
25817
  });
26045
25818
 
26046
- // components/game/lib/index.ts
26047
- var init_lib = __esm({
26048
- "components/game/lib/index.ts"() {
25819
+ // lib/gameShared.ts
25820
+ var init_gameShared = __esm({
25821
+ "lib/gameShared.ts"() {
26049
25822
  init_game();
26050
25823
  init_boardEntity();
26051
25824
  init_makeAsset();
@@ -26055,103 +25828,6 @@ var init_lib = __esm({
26055
25828
  init_spriteSheetConstants();
26056
25829
  }
26057
25830
  });
26058
- function GameCard({
26059
- id,
26060
- cost,
26061
- art,
26062
- frameAsset,
26063
- attack,
26064
- defense,
26065
- name,
26066
- selected = false,
26067
- disabled = false,
26068
- size = "md",
26069
- animState = "idle",
26070
- onClick,
26071
- clickEvent,
26072
- className
26073
- }) {
26074
- const eventBus = useEventBus();
26075
- const handleClick = React73.useCallback(() => {
26076
- if (disabled) return;
26077
- onClick?.(id);
26078
- if (clickEvent) eventBus.emit(`UI:${clickEvent}`, { cardId: id });
26079
- }, [disabled, id, onClick, clickEvent, eventBus]);
26080
- const artPx = artPxMap[size];
26081
- return /* @__PURE__ */ jsxs(
26082
- Button,
26083
- {
26084
- variant: "ghost",
26085
- onClick: handleClick,
26086
- disabled,
26087
- title: name,
26088
- className: cn(
26089
- "relative isolate flex flex-col items-center rounded-interactive",
26090
- "px-1.5 pt-1.5 pb-1 transition-all duration-150",
26091
- frameAsset?.url ? "border-0" : "border-2 bg-card/90",
26092
- cardSizeMap[size],
26093
- disabled ? "border-border opacity-50 cursor-not-allowed" : "border-accent hover:brightness-125 hover:-translate-y-1 cursor-pointer",
26094
- selected && "ring-2 ring-foreground ring-offset-1 ring-offset-background -translate-y-1",
26095
- ANIM_STATE_CLASS[animState],
26096
- className
26097
- ),
26098
- children: [
26099
- frameAsset?.url && /* @__PURE__ */ jsx(AtlasImage, { asset: frameAsset, fill: true, fit: "fill", "aria-hidden": true, style: { zIndex: -1 } }),
26100
- cost != null && /* @__PURE__ */ jsx(
26101
- Typography,
26102
- {
26103
- as: "span",
26104
- className: cn(
26105
- "absolute -top-2 -left-2 flex items-center justify-center",
26106
- "min-w-[22px] h-[22px] rounded-full px-1",
26107
- "bg-info text-foreground text-xs font-bold border border-background"
26108
- ),
26109
- children: cost
26110
- }
26111
- ),
26112
- /* @__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 } }) }),
26113
- name != null && /* @__PURE__ */ jsx(
26114
- Typography,
26115
- {
26116
- variant: "small",
26117
- className: "w-full truncate text-center text-[10px] leading-tight font-semibold",
26118
- children: name
26119
- }
26120
- ),
26121
- (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: [
26122
- /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-error", children: attack != null ? `\u2694${attack}` : "" }),
26123
- /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-info", children: defense != null ? `\u{1F6E1}${defense}` : "" })
26124
- ] })
26125
- ]
26126
- }
26127
- );
26128
- }
26129
- var cardSizeMap, artPxMap, ANIM_STATE_CLASS;
26130
- var init_GameCard = __esm({
26131
- "components/game/atoms/GameCard.tsx"() {
26132
- "use client";
26133
- init_cn();
26134
- init_useEventBus();
26135
- init_Box();
26136
- init_Button();
26137
- init_Typography();
26138
- init_AtlasImage();
26139
- init_GameIcon();
26140
- cardSizeMap = {
26141
- sm: "w-16 h-24",
26142
- md: "w-20 h-28",
26143
- lg: "w-24 h-36"
26144
- };
26145
- artPxMap = { sm: 40, md: 52, lg: 64 };
26146
- ANIM_STATE_CLASS = {
26147
- idle: "",
26148
- drawn: "scale-105",
26149
- played: "-translate-y-2 opacity-80",
26150
- flipped: "scale-x-0"
26151
- };
26152
- GameCard.displayName = "GameCard";
26153
- }
26154
- });
26155
25831
  function HealthBar({
26156
25832
  current = 3,
26157
25833
  max = 5,
@@ -26165,7 +25841,7 @@ function HealthBar({
26165
25841
  frameAsset,
26166
25842
  fillAsset
26167
25843
  }) {
26168
- const sizes = sizeMap7[size];
25844
+ const sizes = sizeMap4[size];
26169
25845
  const percentage = max > 0 ? Math.max(0, Math.min(100, current / max * 100)) : 0;
26170
25846
  if (format === "hearts") {
26171
25847
  return /* @__PURE__ */ jsx(Box, { className: cn("flex items-center gap-1", className), children: Array.from({ length: max }).map((_, i) => /* @__PURE__ */ jsx(
@@ -26270,7 +25946,7 @@ function HealthBar({
26270
25946
  max
26271
25947
  ] });
26272
25948
  }
26273
- var heartIcon, sizeMap7;
25949
+ var heartIcon, sizeMap4;
26274
25950
  var init_HealthBar = __esm({
26275
25951
  "components/game/atoms/HealthBar.tsx"() {
26276
25952
  init_cn();
@@ -26287,7 +25963,7 @@ var init_HealthBar = __esm({
26287
25963
  children: /* @__PURE__ */ jsx("path", { d: "M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" })
26288
25964
  }
26289
25965
  );
26290
- sizeMap7 = {
25966
+ sizeMap4 = {
26291
25967
  sm: { heart: "w-4 h-4", bar: "h-2", text: "text-sm", label: "text-xs", badge: "text-xs px-1.5 py-0.5" },
26292
25968
  md: { heart: "w-6 h-6", bar: "h-3", text: "text-base", label: "text-xs", badge: "text-xs px-2 py-0.5" },
26293
25969
  lg: { heart: "w-8 h-8", bar: "h-4", text: "text-lg", label: "text-sm", badge: "text-sm px-2.5 py-1" }
@@ -26312,7 +25988,7 @@ function ScoreDisplay({
26312
25988
  {
26313
25989
  className: cn(
26314
25990
  "flex items-center gap-2 font-bold",
26315
- sizeMap8[size],
25991
+ sizeMap5[size],
26316
25992
  className
26317
25993
  ),
26318
25994
  children: [
@@ -26323,7 +25999,7 @@ function ScoreDisplay({
26323
25999
  }
26324
26000
  );
26325
26001
  }
26326
- var sizeMap8;
26002
+ var sizeMap5;
26327
26003
  var init_ScoreDisplay = __esm({
26328
26004
  "components/game/atoms/ScoreDisplay.tsx"() {
26329
26005
  init_cn();
@@ -26331,7 +26007,7 @@ var init_ScoreDisplay = __esm({
26331
26007
  init_Box();
26332
26008
  init_Typography();
26333
26009
  init_GameIcon();
26334
- sizeMap8 = {
26010
+ sizeMap5 = {
26335
26011
  sm: "text-sm",
26336
26012
  md: "text-lg",
26337
26013
  lg: "text-2xl",
@@ -26340,192 +26016,6 @@ var init_ScoreDisplay = __esm({
26340
26016
  ScoreDisplay.displayName = "ScoreDisplay";
26341
26017
  }
26342
26018
  });
26343
- function Sprite({
26344
- spritesheet = DEFAULT_SPRITESHEET,
26345
- frameWidth = 64,
26346
- frameHeight = 64,
26347
- frame = 0,
26348
- x = 0,
26349
- y = 0,
26350
- scale = 1,
26351
- flipX = false,
26352
- flipY = false,
26353
- rotation = 0,
26354
- opacity = 1,
26355
- zIndex = 0,
26356
- columns = 16,
26357
- animState: _animState,
26358
- frameRate: _frameRate,
26359
- className,
26360
- onClick,
26361
- action
26362
- }) {
26363
- const eventBus = useEventBus();
26364
- const sourcePosition = useMemo(() => {
26365
- const { sx, sy } = frameRect(frame, Math.floor(frame / columns), columns, frameWidth, frameHeight);
26366
- return { x: sx, y: sy };
26367
- }, [frame, columns, frameWidth, frameHeight]);
26368
- const transform = useMemo(() => {
26369
- const transforms = [
26370
- `translate(${x}px, ${y}px)`
26371
- ];
26372
- if (scale !== 1) {
26373
- transforms.push(`scale(${scale})`);
26374
- }
26375
- if (flipX || flipY) {
26376
- transforms.push(`scale(${flipX ? -1 : 1}, ${flipY ? -1 : 1})`);
26377
- }
26378
- if (rotation !== 0) {
26379
- transforms.push(`rotate(${rotation}deg)`);
26380
- }
26381
- return transforms.join(" ");
26382
- }, [x, y, scale, flipX, flipY, rotation]);
26383
- const backgroundPosition = `-${sourcePosition.x}px -${sourcePosition.y}px`;
26384
- const handleClick = () => {
26385
- if (action) eventBus.emit(`UI:${action}`, {});
26386
- onClick?.();
26387
- };
26388
- return /* @__PURE__ */ jsx(
26389
- Box,
26390
- {
26391
- position: "absolute",
26392
- className,
26393
- onClick: action || onClick ? handleClick : void 0,
26394
- style: {
26395
- width: frameWidth,
26396
- height: frameHeight,
26397
- backgroundImage: `url(${spritesheet.url})`,
26398
- backgroundPosition,
26399
- backgroundRepeat: "no-repeat",
26400
- imageRendering: "pixelated",
26401
- transform,
26402
- transformOrigin: "center center",
26403
- opacity,
26404
- zIndex,
26405
- pointerEvents: action || onClick ? "auto" : "none"
26406
- }
26407
- }
26408
- );
26409
- }
26410
- function drawSprite(ctx, image, props) {
26411
- const {
26412
- frameWidth,
26413
- frameHeight,
26414
- frame,
26415
- x,
26416
- y,
26417
- scale = 1,
26418
- flipX = false,
26419
- flipY = false,
26420
- rotation = 0,
26421
- opacity = 1,
26422
- columns = 16
26423
- } = props;
26424
- const { sx: sourceX, sy: sourceY } = frameRect(frame, Math.floor(frame / columns), columns, frameWidth, frameHeight);
26425
- ctx.save();
26426
- ctx.globalAlpha = opacity;
26427
- ctx.translate(x + frameWidth / 2, y + frameHeight / 2);
26428
- if (rotation !== 0) {
26429
- ctx.rotate(rotation * Math.PI / 180);
26430
- }
26431
- ctx.scale(scale * (flipX ? -1 : 1), scale * (flipY ? -1 : 1));
26432
- ctx.drawImage(
26433
- image,
26434
- sourceX,
26435
- sourceY,
26436
- frameWidth,
26437
- frameHeight,
26438
- -frameWidth / 2,
26439
- -frameHeight / 2,
26440
- frameWidth,
26441
- frameHeight
26442
- );
26443
- ctx.restore();
26444
- }
26445
- var DEFAULT_SPRITESHEET;
26446
- var init_Sprite = __esm({
26447
- "components/game/atoms/Sprite.tsx"() {
26448
- "use client";
26449
- init_useEventBus();
26450
- init_Box();
26451
- init_spriteAnimation();
26452
- DEFAULT_SPRITESHEET = {
26453
- url: "https://almadar-kflow-assets.web.app/shared/isometric-blocks/Spritesheet/allTiles_sheet.png",
26454
- role: "tile",
26455
- category: "tile"
26456
- };
26457
- }
26458
- });
26459
- function isKnownState(s) {
26460
- return s in DEFAULT_STATE_STYLES;
26461
- }
26462
- function StateIndicator({
26463
- assetUrl = DEFAULT_ASSET_URL4,
26464
- state = "idle",
26465
- label,
26466
- size = "md",
26467
- animated = true,
26468
- stateStyles,
26469
- className
26470
- }) {
26471
- const mergedStyles = stateStyles ? { ...DEFAULT_STATE_STYLES, ...stateStyles } : DEFAULT_STATE_STYLES;
26472
- const knownState = isKnownState(state) ? state : null;
26473
- const config = knownState !== null ? mergedStyles[knownState] ?? DEFAULT_STYLE : DEFAULT_STYLE;
26474
- const displayLabel = label ?? state.charAt(0).toUpperCase() + state.slice(1);
26475
- return /* @__PURE__ */ jsxs(
26476
- Box,
26477
- {
26478
- display: "inline-flex",
26479
- className: cn(
26480
- "items-center gap-1 rounded-full text-foreground font-medium",
26481
- config.bgClass,
26482
- SIZE_CLASSES[size],
26483
- animated && (knownState === null || !STATIC_STATES.has(knownState)) && "animate-pulse",
26484
- className
26485
- ),
26486
- children: [
26487
- /* @__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 }) }),
26488
- /* @__PURE__ */ jsx(Box, { as: "span", children: displayLabel })
26489
- ]
26490
- }
26491
- );
26492
- }
26493
- var DEFAULT_ASSET_URL4, DEFAULT_STATE_STYLES, DEFAULT_STYLE, STATIC_STATES, SIZE_CLASSES;
26494
- var init_StateIndicator = __esm({
26495
- "components/game/atoms/StateIndicator.tsx"() {
26496
- init_Box();
26497
- init_Icon();
26498
- init_cn();
26499
- init_GameIcon();
26500
- DEFAULT_ASSET_URL4 = {
26501
- url: "https://almadar-kflow-assets.web.app/shared/isometric-dungeon/Isometric/chestClosed_E.png",
26502
- role: "ui",
26503
- category: "state"
26504
- };
26505
- DEFAULT_STATE_STYLES = {
26506
- idle: { icon: "\u23F8", bgClass: "bg-muted" },
26507
- active: { icon: "\u25B6", bgClass: "bg-success" },
26508
- sleeping: { icon: "\u{1F4A4}", bgClass: "bg-muted" },
26509
- moving: { icon: "\u{1F6B6}", bgClass: "bg-info" },
26510
- eating: { icon: "\u{1F37D}\uFE0F", bgClass: "bg-success" },
26511
- waiting: { icon: "\u23F3", bgClass: "bg-warning" },
26512
- happy: { icon: "\u{1F60A}", bgClass: "bg-success" },
26513
- scared: { icon: "\u{1F628}", bgClass: "bg-error" },
26514
- done: { icon: "\u2713", bgClass: "bg-success" },
26515
- error: { icon: "\u2717", bgClass: "bg-error" },
26516
- ready: { icon: "\u2713", bgClass: "bg-success" },
26517
- cooldown: { icon: "\u{1F504}", bgClass: "bg-warning" }
26518
- };
26519
- DEFAULT_STYLE = { icon: "?", bgClass: "bg-muted" };
26520
- STATIC_STATES = /* @__PURE__ */ new Set(["idle", "done"]);
26521
- SIZE_CLASSES = {
26522
- sm: "text-xs px-1.5 py-0.5",
26523
- md: "text-sm px-2 py-1",
26524
- lg: "text-base px-3 py-1.5"
26525
- };
26526
- StateIndicator.displayName = "StateIndicator";
26527
- }
26528
- });
26529
26019
  function formatTime(seconds, format) {
26530
26020
  const clamped = Math.max(0, Math.floor(seconds));
26531
26021
  if (format === "ss") {
@@ -26555,7 +26045,7 @@ function TimerDisplay({
26555
26045
  className: cn(
26556
26046
  "inline-flex items-center gap-1 justify-center rounded-container",
26557
26047
  "bg-card/80 border border-muted font-mono font-bold tabular-nums",
26558
- sizeMap9[size],
26048
+ sizeMap6[size],
26559
26049
  running && "border-success/50",
26560
26050
  isLow && "text-error border-error/50 animate-pulse",
26561
26051
  !isLow && "text-foreground",
@@ -26568,13 +26058,13 @@ function TimerDisplay({
26568
26058
  }
26569
26059
  );
26570
26060
  }
26571
- var sizeMap9;
26061
+ var sizeMap6;
26572
26062
  var init_TimerDisplay = __esm({
26573
26063
  "components/game/atoms/TimerDisplay.tsx"() {
26574
26064
  init_cn();
26575
26065
  init_Box();
26576
26066
  init_GameIcon();
26577
- sizeMap9 = {
26067
+ sizeMap6 = {
26578
26068
  sm: "text-sm px-2 py-0.5",
26579
26069
  md: "text-lg px-3 py-1",
26580
26070
  lg: "text-2xl px-4 py-1.5"
@@ -26582,396 +26072,6 @@ var init_TimerDisplay = __esm({
26582
26072
  TimerDisplay.displayName = "TimerDisplay";
26583
26073
  }
26584
26074
  });
26585
- function ResourceCounter({
26586
- assetUrl = DEFAULT_ASSET_URL5,
26587
- icon,
26588
- label = "Gold",
26589
- value = 250,
26590
- max,
26591
- color,
26592
- size = "md",
26593
- className
26594
- }) {
26595
- const sizes = sizeMap10[size];
26596
- return /* @__PURE__ */ jsxs(
26597
- Box,
26598
- {
26599
- className: cn(
26600
- "inline-flex items-center rounded-container",
26601
- "bg-card/80 border border-muted font-medium text-foreground",
26602
- sizes.wrapper,
26603
- className
26604
- ),
26605
- children: [
26606
- 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,
26607
- /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground", children: label }),
26608
- /* @__PURE__ */ jsxs(Typography, { as: "span", className: cn("font-bold tabular-nums", color && (color in colorTokenClasses2 ? colorTokenClasses2[color] : color)), children: [
26609
- value,
26610
- max != null && /* @__PURE__ */ jsxs(Typography, { as: "span", className: "text-muted-foreground", children: [
26611
- "/",
26612
- max
26613
- ] })
26614
- ] })
26615
- ]
26616
- }
26617
- );
26618
- }
26619
- var colorTokenClasses2, DEFAULT_ASSET_URL5, sizeMap10;
26620
- var init_ResourceCounter = __esm({
26621
- "components/game/atoms/ResourceCounter.tsx"() {
26622
- init_cn();
26623
- init_Icon();
26624
- init_Box();
26625
- init_Typography();
26626
- init_GameIcon();
26627
- colorTokenClasses2 = {
26628
- primary: "text-primary",
26629
- secondary: "text-secondary",
26630
- success: "text-success",
26631
- warning: "text-warning",
26632
- error: "text-error",
26633
- muted: "text-muted-foreground"
26634
- };
26635
- DEFAULT_ASSET_URL5 = {
26636
- url: "https://almadar-kflow-assets.web.app/shared/world-map/gold_mine.png",
26637
- role: "ui",
26638
- category: "coin"
26639
- };
26640
- sizeMap10 = {
26641
- sm: { wrapper: "text-xs gap-1 px-1.5 py-0.5", icon: "text-sm", img: 16 },
26642
- md: { wrapper: "text-sm gap-1.5 px-2 py-1", icon: "text-base", img: 20 },
26643
- lg: { wrapper: "text-base gap-2 px-3 py-1.5", icon: "text-lg", img: 28 }
26644
- };
26645
- ResourceCounter.displayName = "ResourceCounter";
26646
- }
26647
- });
26648
- function ItemSlot({
26649
- assetUrl = DEFAULT_ASSET_URL6,
26650
- icon = "sword",
26651
- label = "Iron Sword",
26652
- quantity,
26653
- rarity = "uncommon",
26654
- empty,
26655
- size = "md",
26656
- selected,
26657
- onClick,
26658
- action,
26659
- className
26660
- }) {
26661
- const eventBus = useEventBus();
26662
- const isClickable = onClick != null || action != null;
26663
- const px = assetSizeMap[size];
26664
- return /* @__PURE__ */ jsx(
26665
- Button,
26666
- {
26667
- variant: "ghost",
26668
- onClick: () => {
26669
- if (action) eventBus.emit(`UI:${action}`, {});
26670
- onClick?.();
26671
- },
26672
- disabled: !isClickable,
26673
- title: label,
26674
- className: cn(
26675
- "relative flex items-center justify-center rounded-interactive border-2",
26676
- "bg-card/80 transition-all duration-150",
26677
- sizeMap11[size],
26678
- empty ? "border-border bg-card/50" : rarityBorderMap[rarity],
26679
- !empty && rarityGlowMap[rarity],
26680
- selected && "ring-2 ring-foreground ring-offset-1 ring-offset-background",
26681
- isClickable && !empty && "hover:brightness-125 cursor-pointer",
26682
- isClickable && empty && "hover:border-muted cursor-pointer",
26683
- !isClickable && "cursor-default",
26684
- className
26685
- ),
26686
- children: empty ? /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground text-base", children: "+" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
26687
- 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,
26688
- quantity != null && quantity > 1 && /* @__PURE__ */ jsx(
26689
- Typography,
26690
- {
26691
- as: "span",
26692
- className: cn(
26693
- "absolute -bottom-1 -right-1 flex items-center justify-center",
26694
- "min-w-[18px] h-[18px] rounded-full px-1",
26695
- "bg-surface border border-muted text-xs font-bold text-foreground"
26696
- ),
26697
- children: quantity
26698
- }
26699
- )
26700
- ] })
26701
- }
26702
- );
26703
- }
26704
- var sizeMap11, rarityBorderMap, rarityGlowMap, DEFAULT_ASSET_URL6, assetSizeMap;
26705
- var init_ItemSlot = __esm({
26706
- "components/game/atoms/ItemSlot.tsx"() {
26707
- "use client";
26708
- init_cn();
26709
- init_Icon();
26710
- init_useEventBus();
26711
- init_Button();
26712
- init_Box();
26713
- init_Typography();
26714
- init_GameIcon();
26715
- sizeMap11 = {
26716
- sm: "w-10 h-10 text-lg",
26717
- md: "w-14 h-14 text-2xl",
26718
- lg: "w-18 h-18 text-3xl"
26719
- };
26720
- rarityBorderMap = {
26721
- common: "border-muted",
26722
- uncommon: "border-success",
26723
- rare: "border-info",
26724
- epic: "border-accent",
26725
- legendary: "border-warning"
26726
- };
26727
- rarityGlowMap = {
26728
- common: "",
26729
- uncommon: "",
26730
- rare: "shadow-sm",
26731
- epic: "shadow-lg",
26732
- legendary: "shadow-lg"
26733
- };
26734
- DEFAULT_ASSET_URL6 = {
26735
- url: "https://almadar-kflow-assets.web.app/shared/isometric-dungeon/Isometric/chestClosed_E.png",
26736
- role: "item",
26737
- category: "item"
26738
- };
26739
- assetSizeMap = {
26740
- sm: 28,
26741
- md: 40,
26742
- lg: 56
26743
- };
26744
- ItemSlot.displayName = "ItemSlot";
26745
- }
26746
- });
26747
- function TurnIndicator({
26748
- assetUrl = DEFAULT_ASSET_URL7,
26749
- currentTurn = 1,
26750
- maxTurns,
26751
- activeTeam,
26752
- phase,
26753
- size = "md",
26754
- className
26755
- }) {
26756
- const sizes = sizeMap12[size];
26757
- return /* @__PURE__ */ jsxs(
26758
- Box,
26759
- {
26760
- className: cn(
26761
- "inline-flex items-center rounded-container",
26762
- "bg-card/80 border border-muted font-medium text-foreground",
26763
- sizes.wrapper,
26764
- className
26765
- ),
26766
- children: [
26767
- /* @__PURE__ */ jsxs(Typography, { as: "span", className: "font-bold tabular-nums", children: [
26768
- "Turn ",
26769
- currentTurn,
26770
- maxTurns != null && /* @__PURE__ */ jsxs(Typography, { as: "span", className: "text-muted-foreground", children: [
26771
- "/",
26772
- maxTurns
26773
- ] })
26774
- ] }),
26775
- phase && /* @__PURE__ */ jsxs(Fragment, { children: [
26776
- /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground", children: "|" }),
26777
- /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground", children: phase })
26778
- ] }),
26779
- activeTeam && /* @__PURE__ */ jsxs(Fragment, { children: [
26780
- /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground", children: "|" }),
26781
- 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) }),
26782
- /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-success", children: activeTeam })
26783
- ] })
26784
- ]
26785
- }
26786
- );
26787
- }
26788
- var sizeMap12, DEFAULT_ASSET_URL7;
26789
- var init_TurnIndicator = __esm({
26790
- "components/game/atoms/TurnIndicator.tsx"() {
26791
- init_cn();
26792
- init_Box();
26793
- init_Typography();
26794
- init_GameIcon();
26795
- sizeMap12 = {
26796
- sm: { wrapper: "text-xs gap-1.5 px-2 py-0.5", dot: "w-1.5 h-1.5" },
26797
- md: { wrapper: "text-sm gap-2 px-3 py-1", dot: "w-2 h-2" },
26798
- lg: { wrapper: "text-base gap-2.5 px-4 py-1.5", dot: "w-2.5 h-2.5" }
26799
- };
26800
- DEFAULT_ASSET_URL7 = {
26801
- url: "https://almadar-kflow-assets.web.app/shared/effects/particles/symbol_01.png",
26802
- role: "ui",
26803
- category: "turn"
26804
- };
26805
- TurnIndicator.displayName = "TurnIndicator";
26806
- }
26807
- });
26808
- function WaypointMarker({
26809
- assetUrl = DEFAULT_ASSET_URL8,
26810
- label,
26811
- icon,
26812
- active = true,
26813
- completed = false,
26814
- size = "md",
26815
- className
26816
- }) {
26817
- const sizes = sizeMap13[size];
26818
- return /* @__PURE__ */ jsxs(Box, { className: cn("flex flex-col items-center", className), children: [
26819
- /* @__PURE__ */ jsxs(Box, { className: "relative flex items-center justify-center", children: [
26820
- active && /* @__PURE__ */ jsx(
26821
- Box,
26822
- {
26823
- position: "absolute",
26824
- className: cn(
26825
- "rounded-full border-2 border-info animate-ping opacity-50",
26826
- sizes.ring
26827
- )
26828
- }
26829
- ),
26830
- active && /* @__PURE__ */ jsx(
26831
- Box,
26832
- {
26833
- position: "absolute",
26834
- className: cn(
26835
- "rounded-full border-2 border-info",
26836
- sizes.ring
26837
- )
26838
- }
26839
- ),
26840
- /* @__PURE__ */ jsx(
26841
- Box,
26842
- {
26843
- position: "relative",
26844
- className: cn(
26845
- "flex items-center justify-center rounded-full transition-all duration-200",
26846
- sizes.dot,
26847
- completed && "bg-success text-foreground",
26848
- active && !completed && "bg-info text-foreground",
26849
- !active && !completed && "bg-muted"
26850
- ),
26851
- 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
26852
- }
26853
- )
26854
- ] }),
26855
- label && /* @__PURE__ */ jsx(
26856
- Typography,
26857
- {
26858
- as: "span",
26859
- className: cn(
26860
- "text-center whitespace-nowrap",
26861
- sizes.label,
26862
- completed ? "text-success" : active ? "text-info" : "text-muted-foreground"
26863
- ),
26864
- children: label
26865
- }
26866
- )
26867
- ] });
26868
- }
26869
- var DEFAULT_ASSET_URL8, sizeMap13, checkIcon;
26870
- var init_WaypointMarker = __esm({
26871
- "components/game/atoms/WaypointMarker.tsx"() {
26872
- init_cn();
26873
- init_Icon();
26874
- init_Box();
26875
- init_Typography();
26876
- init_GameIcon();
26877
- DEFAULT_ASSET_URL8 = {
26878
- url: "https://almadar-kflow-assets.web.app/shared/world-map/battle_marker.png",
26879
- role: "ui",
26880
- category: "waypoint"
26881
- };
26882
- sizeMap13 = {
26883
- sm: { dot: "w-4 h-4", ring: "w-6 h-6", label: "text-xs mt-1", img: 12 },
26884
- md: { dot: "w-6 h-6", ring: "w-8 h-8", label: "text-sm mt-1.5", img: 18 },
26885
- lg: { dot: "w-8 h-8", ring: "w-10 h-10", label: "text-base mt-2", img: 24 }
26886
- };
26887
- 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" }) });
26888
- WaypointMarker.displayName = "WaypointMarker";
26889
- }
26890
- });
26891
- function formatDuration(seconds) {
26892
- if (seconds >= 60) {
26893
- return `${Math.floor(seconds / 60)}m`;
26894
- }
26895
- return `${Math.round(seconds)}s`;
26896
- }
26897
- function StatusEffect({
26898
- assetUrl = DEFAULT_ASSET_URL9,
26899
- icon,
26900
- label = "Shield",
26901
- duration = 30,
26902
- stacks,
26903
- variant = "buff",
26904
- size = "md",
26905
- className
26906
- }) {
26907
- const sizes = sizeMap14[size];
26908
- return /* @__PURE__ */ jsxs(Box, { position: "relative", className: cn("inline-flex flex-col items-center", className), children: [
26909
- /* @__PURE__ */ jsxs(
26910
- Box,
26911
- {
26912
- position: "relative",
26913
- className: cn(
26914
- "flex items-center justify-center rounded-interactive border-2",
26915
- sizes.container,
26916
- variantStyles8[variant]
26917
- ),
26918
- title: label,
26919
- children: [
26920
- /* @__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 }),
26921
- duration !== void 0 && /* @__PURE__ */ jsx(
26922
- Typography,
26923
- {
26924
- as: "span",
26925
- className: cn(
26926
- "absolute bottom-0 left-0 right-0 text-center font-mono font-bold text-foreground bg-background/60 leading-tight",
26927
- sizes.timer
26928
- ),
26929
- children: formatDuration(duration)
26930
- }
26931
- )
26932
- ]
26933
- }
26934
- ),
26935
- stacks !== void 0 && stacks > 1 && /* @__PURE__ */ jsx(
26936
- Typography,
26937
- {
26938
- as: "span",
26939
- className: cn(
26940
- "absolute flex items-center justify-center rounded-full bg-card text-foreground font-bold leading-none",
26941
- sizes.badge
26942
- ),
26943
- children: stacks
26944
- }
26945
- ),
26946
- label && /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-xs text-muted-foreground mt-0.5 text-center whitespace-nowrap", children: label })
26947
- ] });
26948
- }
26949
- var DEFAULT_ASSET_URL9, sizeMap14, variantStyles8;
26950
- var init_StatusEffect = __esm({
26951
- "components/game/atoms/StatusEffect.tsx"() {
26952
- init_cn();
26953
- init_Icon();
26954
- init_Box();
26955
- init_Typography();
26956
- init_GameIcon();
26957
- DEFAULT_ASSET_URL9 = {
26958
- url: "https://almadar-kflow-assets.web.app/shared/effects/particles/flame_01.png",
26959
- role: "ui",
26960
- category: "effect"
26961
- };
26962
- sizeMap14 = {
26963
- 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 },
26964
- 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 },
26965
- 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 }
26966
- };
26967
- variantStyles8 = {
26968
- buff: "border-success bg-success/20",
26969
- debuff: "border-error bg-error/20",
26970
- neutral: "border-muted bg-muted/20"
26971
- };
26972
- StatusEffect.displayName = "StatusEffect";
26973
- }
26974
- });
26975
26075
  function DialogueBubble({
26976
26076
  speaker = "Hero",
26977
26077
  text = "The dungeon awaits. Choose your path wisely.",
@@ -27043,7 +26143,7 @@ function StatBadge({
27043
26143
  {
27044
26144
  className: cn(
27045
26145
  "inline-flex items-center gap-2 rounded-container border backdrop-blur-sm",
27046
- sizeMap15[size] ?? sizeMap15.md,
26146
+ sizeMap7[size] ?? sizeMap7.md,
27047
26147
  variantMap2[variant] ?? variantMap2.default,
27048
26148
  className
27049
26149
  ),
@@ -27080,7 +26180,7 @@ function StatBadge({
27080
26180
  }
27081
26181
  );
27082
26182
  }
27083
- var sizeMap15, variantMap2;
26183
+ var sizeMap7, variantMap2;
27084
26184
  var init_StatBadge = __esm({
27085
26185
  "components/game/molecules/StatBadge.tsx"() {
27086
26186
  init_cn();
@@ -27090,7 +26190,7 @@ var init_StatBadge = __esm({
27090
26190
  init_GameIcon();
27091
26191
  init_HealthBar();
27092
26192
  init_ScoreDisplay();
27093
- sizeMap15 = {
26193
+ sizeMap7 = {
27094
26194
  sm: "text-xs px-2 py-1",
27095
26195
  md: "text-sm px-3 py-1.5",
27096
26196
  lg: "text-base px-4 py-2"
@@ -27105,129 +26205,6 @@ var init_StatBadge = __esm({
27105
26205
  StatBadge.displayName = "StatBadge";
27106
26206
  }
27107
26207
  });
27108
- function InventoryGrid({
27109
- items = DEFAULT_GRID_ITEMS,
27110
- columns = 4,
27111
- totalSlots = 12,
27112
- selectedId = "",
27113
- onSelect,
27114
- selectEvent,
27115
- size = "md",
27116
- className
27117
- }) {
27118
- const eventBus = useEventBus();
27119
- const slotCount = totalSlots ?? items.length;
27120
- const emptySlotCount = Math.max(0, slotCount - items.length);
27121
- const handleSelect = React73.useCallback(
27122
- (id) => {
27123
- onSelect?.(id);
27124
- if (selectEvent) {
27125
- eventBus.emit(`UI:${selectEvent}`, { id });
27126
- }
27127
- },
27128
- [onSelect, selectEvent, eventBus]
27129
- );
27130
- const gridClass = columnMap[columns] ?? `grid-cols-${columns}`;
27131
- return /* @__PURE__ */ jsxs(
27132
- Box,
27133
- {
27134
- className: cn("grid gap-2", gridClass, className),
27135
- children: [
27136
- items.map((item) => /* @__PURE__ */ jsx(
27137
- ItemSlot,
27138
- {
27139
- icon: item.icon,
27140
- assetUrl: item.assetUrl,
27141
- label: item.label,
27142
- quantity: item.quantity,
27143
- rarity: item.rarity,
27144
- size,
27145
- selected: selectedId === item.id,
27146
- onClick: () => handleSelect(item.id)
27147
- },
27148
- item.id
27149
- )),
27150
- Array.from({ length: emptySlotCount }).map((_, index) => /* @__PURE__ */ jsx(
27151
- ItemSlot,
27152
- {
27153
- empty: true,
27154
- size
27155
- },
27156
- `empty-${index}`
27157
- ))
27158
- ]
27159
- }
27160
- );
27161
- }
27162
- var columnMap, DEFAULT_GRID_ITEMS;
27163
- var init_InventoryGrid = __esm({
27164
- "components/game/molecules/InventoryGrid.tsx"() {
27165
- "use client";
27166
- init_cn();
27167
- init_useEventBus();
27168
- init_ItemSlot();
27169
- init_Box();
27170
- columnMap = {
27171
- 2: "grid-cols-2",
27172
- 3: "grid-cols-3",
27173
- 4: "grid-cols-4",
27174
- 5: "grid-cols-5",
27175
- 6: "grid-cols-6",
27176
- 7: "grid-cols-7",
27177
- 8: "grid-cols-8"
27178
- };
27179
- DEFAULT_GRID_ITEMS = [
27180
- { id: "grid-1", icon: "sword", label: "Iron Sword", quantity: 1, rarity: "common" },
27181
- { id: "grid-2", icon: "flask-conical", label: "Health Potion", quantity: 3, rarity: "uncommon" },
27182
- { id: "grid-3", icon: "shield", label: "Wooden Shield", quantity: 1, rarity: "common" },
27183
- { id: "grid-4", icon: "gem", label: "Ruby Gem", quantity: 2, rarity: "rare" }
27184
- ];
27185
- InventoryGrid.displayName = "InventoryGrid";
27186
- }
27187
- });
27188
- function ResourceBar({
27189
- resources = DEFAULT_RESOURCES,
27190
- size = "md",
27191
- className
27192
- }) {
27193
- return /* @__PURE__ */ jsx(
27194
- Box,
27195
- {
27196
- className: cn(
27197
- "flex items-center gap-2 flex-wrap",
27198
- className
27199
- ),
27200
- children: resources.map((resource, i) => /* @__PURE__ */ jsx(
27201
- StatBadge,
27202
- {
27203
- label: resource.label,
27204
- value: resource.value,
27205
- max: resource.max,
27206
- format: resource.max != null ? "bar" : "number",
27207
- icon: resource.icon,
27208
- assetUrl: resource.assetUrl,
27209
- size
27210
- },
27211
- i
27212
- ))
27213
- }
27214
- );
27215
- }
27216
- var DEFAULT_RESOURCES;
27217
- var init_ResourceBar = __esm({
27218
- "components/game/molecules/ResourceBar.tsx"() {
27219
- "use client";
27220
- init_cn();
27221
- init_StatBadge();
27222
- init_Box();
27223
- DEFAULT_RESOURCES = [
27224
- { icon: "coins", label: "Gold", value: 320 },
27225
- { icon: "zap", label: "Energy", value: 7, max: 10 },
27226
- { icon: "gem", label: "Crystals", value: 15 }
27227
- ];
27228
- ResourceBar.displayName = "ResourceBar";
27229
- }
27230
- });
27231
26208
  function convertElementsToStats(elements) {
27232
26209
  return elements.map((el) => {
27233
26210
  const [source, field] = el.bind?.split(".") ?? [];
@@ -27710,11 +26687,46 @@ function useUnitSpriteAtlas(units) {
27710
26687
  return { sheetUrls, resolveUnitFrame, pendingCount };
27711
26688
  }
27712
26689
  var init_useUnitSpriteAtlas = __esm({
27713
- "components/game/hooks/useUnitSpriteAtlas.ts"() {
26690
+ "hooks/useUnitSpriteAtlas.ts"() {
27714
26691
  "use client";
27715
26692
  init_spriteAnimation();
27716
26693
  }
27717
26694
  });
26695
+ function GameAudioToggle({
26696
+ size = "sm",
26697
+ className,
26698
+ onAsset,
26699
+ offAsset
26700
+ }) {
26701
+ const ctx = useGameAudioContextOptional();
26702
+ const [localMuted, setLocalMuted] = useState(false);
26703
+ const muted = ctx ? ctx.muted : localMuted;
26704
+ const setMuted = ctx ? ctx.setMuted : setLocalMuted;
26705
+ const handleToggle = useCallback(() => {
26706
+ setMuted(!muted);
26707
+ }, [muted, setMuted]);
26708
+ const activeAsset = muted ? offAsset : onAsset;
26709
+ return /* @__PURE__ */ jsx(
26710
+ Button,
26711
+ {
26712
+ variant: "ghost",
26713
+ size,
26714
+ onClick: handleToggle,
26715
+ className: cn("text-lg leading-none px-2", className),
26716
+ "aria-pressed": muted,
26717
+ children: activeAsset ? /* @__PURE__ */ jsx(GameIcon, { assetUrl: activeAsset, icon: "image", size: 20, alt: muted ? "Muted" : "Sound on", className: "w-5 h-5 object-contain" }) : muted ? "\u{1F507}" : "\u{1F50A}"
26718
+ }
26719
+ );
26720
+ }
26721
+ var init_GameAudioToggle = __esm({
26722
+ "components/game/atoms/GameAudioToggle.tsx"() {
26723
+ "use client";
26724
+ init_atoms();
26725
+ init_cn();
26726
+ init_GameIcon();
26727
+ GameAudioToggle.displayName = "GameAudioToggle";
26728
+ }
26729
+ });
27718
26730
  function pickPath(entry) {
27719
26731
  if (Array.isArray(entry.path)) {
27720
26732
  return entry.path[Math.floor(Math.random() * entry.path.length)];
@@ -27977,108 +26989,79 @@ function useGameAudio({
27977
26989
  };
27978
26990
  }
27979
26991
  var init_useGameAudio = __esm({
27980
- "components/game/hooks/useGameAudio.ts"() {
26992
+ "hooks/useGameAudio.ts"() {
27981
26993
  "use client";
27982
26994
  useGameAudio.displayName = "useGameAudio";
27983
26995
  }
27984
26996
  });
27985
- function useGameAudioContext() {
27986
- const ctx = useContext(GameAudioContext);
27987
- if (!ctx) {
27988
- throw new Error("useGameAudioContext must be used inside <GameAudioProvider>");
27989
- }
27990
- return ctx;
27991
- }
27992
- function useGameAudioContextOptional() {
27993
- return useContext(GameAudioContext);
26997
+ function isKnownState(s) {
26998
+ return s in DEFAULT_STATE_STYLES;
27994
26999
  }
27995
- function GameAudioProvider({
27996
- manifest,
27997
- baseUrl = "",
27998
- children,
27999
- initialMuted = false
28000
- }) {
28001
- const eventBus = useEventBus();
28002
- const { play, stop, stopAll, playMusic, stopMusic, muted, setMuted, masterVolume, setMasterVolume } = useGameAudio({ manifest, baseUrl, initialMuted });
28003
- useEffect(() => {
28004
- const unsubPlay = eventBus.on("UI:PLAY_SOUND", (event) => {
28005
- const key = event.payload?.key;
28006
- if (key) play(key);
28007
- });
28008
- const unsubStop = eventBus.on("UI:STOP_SOUND", (event) => {
28009
- const key = event.payload?.key;
28010
- if (key) {
28011
- stop(key);
28012
- } else {
28013
- stopAll();
28014
- }
28015
- });
28016
- const unsubChangeMusic = eventBus.on("UI:CHANGE_MUSIC", (event) => {
28017
- const key = event.payload?.key;
28018
- if (key) {
28019
- playMusic(key);
28020
- } else {
28021
- stopMusic();
28022
- }
28023
- });
28024
- const unsubStopMusic = eventBus.on("UI:STOP_MUSIC", () => {
28025
- stopMusic();
28026
- });
28027
- return () => {
28028
- unsubPlay();
28029
- unsubStop();
28030
- unsubChangeMusic();
28031
- unsubStopMusic();
28032
- };
28033
- }, [eventBus, play, stop, stopAll, playMusic, stopMusic]);
28034
- const value = { muted, setMuted, masterVolume, setMasterVolume, play, playMusic, stopMusic };
28035
- return /* @__PURE__ */ jsx(GameAudioContext.Provider, { value, children });
28036
- }
28037
- var GameAudioContext;
28038
- var init_GameAudioProvider = __esm({
28039
- "components/game/providers/GameAudioProvider.tsx"() {
28040
- "use client";
28041
- init_useEventBus();
28042
- init_useGameAudio();
28043
- GameAudioContext = createContext(null);
28044
- GameAudioContext.displayName = "GameAudioContext";
28045
- GameAudioProvider.displayName = "GameAudioProvider";
28046
- }
28047
- });
28048
- function GameAudioToggle({
28049
- size = "sm",
28050
- className,
28051
- onAsset,
28052
- offAsset
27000
+ function StateIndicator({
27001
+ assetUrl = DEFAULT_ASSET_URL,
27002
+ state = "idle",
27003
+ label,
27004
+ size = "md",
27005
+ animated = true,
27006
+ stateStyles,
27007
+ className
28053
27008
  }) {
28054
- const ctx = useGameAudioContextOptional();
28055
- const [localMuted, setLocalMuted] = useState(false);
28056
- const muted = ctx ? ctx.muted : localMuted;
28057
- const setMuted = ctx ? ctx.setMuted : setLocalMuted;
28058
- const handleToggle = useCallback(() => {
28059
- setMuted(!muted);
28060
- }, [muted, setMuted]);
28061
- const activeAsset = muted ? offAsset : onAsset;
28062
- return /* @__PURE__ */ jsx(
28063
- Button,
27009
+ const mergedStyles = stateStyles ? { ...DEFAULT_STATE_STYLES, ...stateStyles } : DEFAULT_STATE_STYLES;
27010
+ const knownState = isKnownState(state) ? state : null;
27011
+ const config = knownState !== null ? mergedStyles[knownState] ?? DEFAULT_STYLE : DEFAULT_STYLE;
27012
+ const displayLabel = label ?? state.charAt(0).toUpperCase() + state.slice(1);
27013
+ return /* @__PURE__ */ jsxs(
27014
+ Box,
28064
27015
  {
28065
- variant: "ghost",
28066
- size,
28067
- onClick: handleToggle,
28068
- className: cn("text-lg leading-none px-2", className),
28069
- "aria-pressed": muted,
28070
- children: activeAsset ? /* @__PURE__ */ jsx(GameIcon, { assetUrl: activeAsset, icon: "image", size: 20, alt: muted ? "Muted" : "Sound on", className: "w-5 h-5 object-contain" }) : muted ? "\u{1F507}" : "\u{1F50A}"
27016
+ display: "inline-flex",
27017
+ className: cn(
27018
+ "items-center gap-1 rounded-full text-foreground font-medium",
27019
+ config.bgClass,
27020
+ SIZE_CLASSES[size],
27021
+ animated && (knownState === null || !STATIC_STATES.has(knownState)) && "animate-pulse",
27022
+ className
27023
+ ),
27024
+ children: [
27025
+ /* @__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 }) }),
27026
+ /* @__PURE__ */ jsx(Box, { as: "span", children: displayLabel })
27027
+ ]
28071
27028
  }
28072
27029
  );
28073
27030
  }
28074
- var init_GameAudioToggle = __esm({
28075
- "components/game/atoms/GameAudioToggle.tsx"() {
28076
- "use client";
28077
- init_atoms();
27031
+ var DEFAULT_ASSET_URL, DEFAULT_STATE_STYLES, DEFAULT_STYLE, STATIC_STATES, SIZE_CLASSES;
27032
+ var init_StateIndicator = __esm({
27033
+ "components/game/atoms/StateIndicator.tsx"() {
27034
+ init_Box();
27035
+ init_Icon();
28078
27036
  init_cn();
28079
- init_GameAudioProvider();
28080
27037
  init_GameIcon();
28081
- GameAudioToggle.displayName = "GameAudioToggle";
27038
+ DEFAULT_ASSET_URL = {
27039
+ url: "https://almadar-kflow-assets.web.app/shared/isometric-dungeon/Isometric/chestClosed_E.png",
27040
+ role: "ui",
27041
+ category: "state"
27042
+ };
27043
+ DEFAULT_STATE_STYLES = {
27044
+ idle: { icon: "\u23F8", bgClass: "bg-muted" },
27045
+ active: { icon: "\u25B6", bgClass: "bg-success" },
27046
+ sleeping: { icon: "\u{1F4A4}", bgClass: "bg-muted" },
27047
+ moving: { icon: "\u{1F6B6}", bgClass: "bg-info" },
27048
+ eating: { icon: "\u{1F37D}\uFE0F", bgClass: "bg-success" },
27049
+ waiting: { icon: "\u23F3", bgClass: "bg-warning" },
27050
+ happy: { icon: "\u{1F60A}", bgClass: "bg-success" },
27051
+ scared: { icon: "\u{1F628}", bgClass: "bg-error" },
27052
+ done: { icon: "\u2713", bgClass: "bg-success" },
27053
+ error: { icon: "\u2717", bgClass: "bg-error" },
27054
+ ready: { icon: "\u2713", bgClass: "bg-success" },
27055
+ cooldown: { icon: "\u{1F504}", bgClass: "bg-warning" }
27056
+ };
27057
+ DEFAULT_STYLE = { icon: "?", bgClass: "bg-muted" };
27058
+ STATIC_STATES = /* @__PURE__ */ new Set(["idle", "done"]);
27059
+ SIZE_CLASSES = {
27060
+ sm: "text-xs px-1.5 py-0.5",
27061
+ md: "text-sm px-2 py-1",
27062
+ lg: "text-base px-3 py-1.5"
27063
+ };
27064
+ StateIndicator.displayName = "StateIndicator";
28082
27065
  }
28083
27066
  });
28084
27067
  function LinearView({
@@ -28651,7 +27634,7 @@ function EditorToolbar({ mode, onModeChange, className }) {
28651
27634
  }
28652
27635
  var TERRAIN_COLORS, FEATURE_TYPES, MODE_LABELS;
28653
27636
  var init_editorUtils = __esm({
28654
- "components/game/lib/editorUtils.tsx"() {
27637
+ "lib/editorUtils.tsx"() {
28655
27638
  init_Box();
28656
27639
  init_Stack();
28657
27640
  init_Typography();
@@ -28763,110 +27746,8 @@ var init_SequenceBar = __esm({
28763
27746
  SequenceBar.displayName = "SequenceBar";
28764
27747
  }
28765
27748
  });
28766
- function RuleEditor({
28767
- rule,
28768
- availableEvents,
28769
- availableActions,
28770
- onChange,
28771
- onRemove,
28772
- disabled = false,
28773
- className
28774
- }) {
28775
- const { t } = useTranslate();
28776
- const handleWhenChange = useCallback((v) => {
28777
- onChange({ ...rule, whenEvent: v });
28778
- }, [rule, onChange]);
28779
- const handleThenChange = useCallback((v) => {
28780
- onChange({ ...rule, thenAction: v });
28781
- }, [rule, onChange]);
28782
- return /* @__PURE__ */ jsxs(HStack, { className: cn("items-center p-2 rounded-lg bg-muted/50 border border-border", className), gap: "sm", children: [
28783
- /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-primary font-bold whitespace-nowrap", children: t("eventHandler.when") }),
28784
- /* @__PURE__ */ jsx(
28785
- Select,
28786
- {
28787
- value: rule.whenEvent,
28788
- onValueChange: handleWhenChange,
28789
- options: availableEvents,
28790
- disabled,
28791
- className: "flex-1 min-w-0"
28792
- }
28793
- ),
28794
- /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-accent font-bold whitespace-nowrap", children: "\u2192 " + t("eventHandler.then") }),
28795
- /* @__PURE__ */ jsx(
28796
- Select,
28797
- {
28798
- value: rule.thenAction,
28799
- onValueChange: handleThenChange,
28800
- options: availableActions,
28801
- disabled,
28802
- className: "flex-1 min-w-0"
28803
- }
28804
- ),
28805
- onRemove && /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: onRemove, disabled, className: "shrink-0", children: "\xD7" })
28806
- ] });
28807
- }
28808
- var init_RuleEditor = __esm({
28809
- "components/game/molecules/RuleEditor.tsx"() {
28810
- init_atoms();
28811
- init_cn();
28812
- RuleEditor.displayName = "RuleEditor";
28813
- }
28814
- });
28815
- function EventLog({
28816
- entries,
28817
- maxHeight = 200,
28818
- label,
28819
- className
28820
- }) {
28821
- const { t } = useTranslate();
28822
- const scrollRef = useRef(null);
28823
- useEffect(() => {
28824
- if (scrollRef.current) {
28825
- scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
28826
- }
28827
- }, [entries.length]);
28828
- return /* @__PURE__ */ jsxs(VStack, { className: cn("p-3 rounded-lg bg-card border border-border", className), gap: "sm", children: [
28829
- /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-muted-foreground font-medium", children: label ?? t("eventHandler.eventLog") }),
28830
- /* @__PURE__ */ jsx(
28831
- Box,
28832
- {
28833
- ref: scrollRef,
28834
- className: "overflow-y-auto",
28835
- style: { maxHeight },
28836
- children: /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
28837
- entries.length === 0 && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground italic", children: t("eventHandler.noEvents") }),
28838
- entries.map((entry) => /* @__PURE__ */ jsxs(HStack, { className: "items-start", gap: "xs", children: [
28839
- /* @__PURE__ */ jsx(Typography, { variant: "caption", className: STATUS_STYLES[entry.status], children: STATUS_DOTS[entry.status] }),
28840
- /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-foreground", children: entry.icon }),
28841
- /* @__PURE__ */ jsx(Typography, { variant: "caption", className: cn("flex-1", STATUS_STYLES[entry.status]), children: entry.message })
28842
- ] }, entry.id))
28843
- ] })
28844
- }
28845
- )
28846
- ] });
28847
- }
28848
- var STATUS_STYLES, STATUS_DOTS;
28849
- var init_EventLog = __esm({
28850
- "components/game/molecules/EventLog.tsx"() {
28851
- init_atoms();
28852
- init_cn();
28853
- STATUS_STYLES = {
28854
- pending: "text-muted-foreground",
28855
- active: "text-primary animate-pulse",
28856
- done: "text-success",
28857
- error: "text-error"
28858
- };
28859
- STATUS_DOTS = {
28860
- pending: "\u25CB",
28861
- active: "\u25CF",
28862
- done: "\u2714",
28863
- error: "\u2717"
28864
- };
28865
- EventLog.displayName = "EventLog";
28866
- }
28867
- });
28868
27749
 
28869
- // components/game/lib/puzzleObject.ts
27750
+ // lib/puzzleObject.ts
28870
27751
  function objId(o) {
28871
27752
  return o.id == null ? "" : String(o.id);
28872
27753
  }
@@ -28896,121 +27777,7 @@ function objMaxRules(o) {
28896
27777
  return Number.isFinite(n) && n > 0 ? n : 3;
28897
27778
  }
28898
27779
  var init_puzzleObject = __esm({
28899
- "components/game/lib/puzzleObject.ts"() {
28900
- }
28901
- });
28902
- function ObjectRulePanel({
28903
- object,
28904
- onRulesChange,
28905
- rulesChangeEvent,
28906
- disabled = false,
28907
- className
28908
- }) {
28909
- const { t } = useTranslate();
28910
- const { emit } = useEventBus();
28911
- const id = objId(object);
28912
- const name = objName(object);
28913
- const icon = objIcon(object);
28914
- const states = objStates(object);
28915
- const currentState = objCurrentState(object);
28916
- const availableEvents = objAvailableEvents(object);
28917
- const availableActions = objAvailableActions(object);
28918
- const rules = objRules(object);
28919
- const maxRules = objMaxRules(object);
28920
- const canAdd = rules.length < maxRules;
28921
- const emitRules = useCallback((newRules) => {
28922
- if (rulesChangeEvent) emit(`UI:${rulesChangeEvent}`, { objectId: id, rules: newRules });
28923
- else onRulesChange?.(id, newRules);
28924
- }, [rulesChangeEvent, emit, id, onRulesChange]);
28925
- const handleRuleChange = useCallback((index, updatedRule) => {
28926
- const newRules = [...rules];
28927
- newRules[index] = updatedRule;
28928
- emitRules(newRules);
28929
- }, [rules, emitRules]);
28930
- const handleRuleRemove = useCallback((index) => {
28931
- const newRules = rules.filter((_, i) => i !== index);
28932
- emitRules(newRules);
28933
- }, [rules, emitRules]);
28934
- const handleAddRule = useCallback(() => {
28935
- if (!canAdd || disabled) return;
28936
- const firstEvent = availableEvents[0]?.value || "";
28937
- const firstAction = availableActions[0]?.value || "";
28938
- const newRule = {
28939
- id: `rule-${nextRuleId++}`,
28940
- whenEvent: firstEvent,
28941
- thenAction: firstAction
28942
- };
28943
- emitRules([...rules, newRule]);
28944
- }, [canAdd, disabled, rules, availableEvents, availableActions, emitRules]);
28945
- const machine = {
28946
- name,
28947
- states,
28948
- currentState,
28949
- transitions: rules.map((r) => ({
28950
- from: currentState,
28951
- to: states.find((s) => s !== currentState) || currentState,
28952
- event: r.whenEvent
28953
- }))
28954
- };
28955
- return /* @__PURE__ */ jsxs(VStack, { className: cn("p-4 rounded-lg bg-card border border-border", className), gap: "sm", children: [
28956
- /* @__PURE__ */ jsxs(HStack, { className: "items-center", gap: "sm", children: [
28957
- /* @__PURE__ */ jsx(Typography, { variant: "h5", children: icon }),
28958
- /* @__PURE__ */ jsxs(VStack, { gap: "none", children: [
28959
- /* @__PURE__ */ jsx(Typography, { variant: "body1", className: "text-foreground font-bold", children: name }),
28960
- /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground", children: t("eventHandler.state") + ": " + currentState })
28961
- ] })
28962
- ] }),
28963
- /* @__PURE__ */ jsx(TraitStateViewer, { trait: machine, variant: "compact", size: "sm" }),
28964
- /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
28965
- /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-muted-foreground font-medium", children: t("eventHandler.rules", { count: rules.length, max: maxRules }) + ":" }),
28966
- rules.map((rule, i) => /* @__PURE__ */ jsx(
28967
- RuleEditor,
28968
- {
28969
- rule,
28970
- availableEvents,
28971
- availableActions,
28972
- onChange: (r) => handleRuleChange(i, r),
28973
- onRemove: () => handleRuleRemove(i),
28974
- disabled
28975
- },
28976
- rule.id
28977
- )),
28978
- canAdd && !disabled && /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: handleAddRule, className: "self-start", children: t("eventHandler.addRule") })
28979
- ] })
28980
- ] });
28981
- }
28982
- var nextRuleId;
28983
- var init_ObjectRulePanel = __esm({
28984
- "components/game/molecules/ObjectRulePanel.tsx"() {
28985
- init_atoms();
28986
- init_cn();
28987
- init_useEventBus();
28988
- init_TraitStateViewer();
28989
- init_RuleEditor();
28990
- init_puzzleObject();
28991
- nextRuleId = 1;
28992
- ObjectRulePanel.displayName = "ObjectRulePanel";
28993
- }
28994
- });
28995
- function VariablePanel({
28996
- entityName,
28997
- variables,
28998
- className
28999
- }) {
29000
- const { t } = useTranslate();
29001
- return /* @__PURE__ */ jsxs(VStack, { className: cn("p-3 rounded-lg bg-card border border-border", className), gap: "sm", children: [
29002
- /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-muted-foreground font-medium", children: t("stateArchitect.variables", { name: entityName }) }),
29003
- (variables ?? []).map((v) => /* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between", children: [
29004
- /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-foreground font-medium", children: v.name }),
29005
- /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-accent font-mono", children: v.value })
29006
- ] }, v.name))
29007
- ] });
29008
- }
29009
- var init_VariablePanel = __esm({
29010
- "components/game/molecules/VariablePanel.tsx"() {
29011
- init_atoms();
29012
- init_cn();
29013
- VariablePanel.displayName = "VariablePanel";
27780
+ "lib/puzzleObject.ts"() {
29014
27781
  }
29015
27782
  });
29016
27783
  function StateJsonView({
@@ -29052,10 +27819,10 @@ var init_StateJsonView = __esm({
29052
27819
  }
29053
27820
  });
29054
27821
 
29055
- // components/game/lib/mechanics.ts
27822
+ // lib/mechanics.ts
29056
27823
  var projectileMotion, pendulum, springOscillator;
29057
27824
  var init_mechanics = __esm({
29058
- "components/game/lib/mechanics.ts"() {
27825
+ "lib/mechanics.ts"() {
29059
27826
  projectileMotion = {
29060
27827
  id: "mechanics-projectile",
29061
27828
  name: "Projectile Motion",
@@ -29110,10 +27877,10 @@ var init_mechanics = __esm({
29110
27877
  }
29111
27878
  });
29112
27879
 
29113
- // components/game/lib/physicsPresets.ts
27880
+ // lib/physicsPresets.ts
29114
27881
  var ALL_PRESETS;
29115
27882
  var init_physicsPresets = __esm({
29116
- "components/game/lib/physicsPresets.ts"() {
27883
+ "lib/physicsPresets.ts"() {
29117
27884
  init_mechanics();
29118
27885
  init_mechanics();
29119
27886
  ALL_PRESETS = [
@@ -29123,125 +27890,6 @@ var init_physicsPresets = __esm({
29123
27890
  ];
29124
27891
  }
29125
27892
  });
29126
- var GameTemplate;
29127
- var init_GameTemplate = __esm({
29128
- "components/game/templates/GameTemplate.tsx"() {
29129
- init_cn();
29130
- init_Box();
29131
- init_Stack();
29132
- init_Typography();
29133
- init_Button();
29134
- GameTemplate = ({
29135
- entity,
29136
- title = "Game",
29137
- children,
29138
- hud,
29139
- debugPanel,
29140
- showDebugPanel = false,
29141
- controls,
29142
- className,
29143
- backgroundAsset
29144
- }) => {
29145
- return /* @__PURE__ */ jsxs(
29146
- Box,
29147
- {
29148
- display: "flex",
29149
- fullHeight: true,
29150
- className: cn("flex-col lg:flex-row", className),
29151
- children: [
29152
- /* @__PURE__ */ jsxs(Box, { display: "flex", className: "flex-1 flex-col", children: [
29153
- /* @__PURE__ */ jsxs(
29154
- Box,
29155
- {
29156
- padding: "md",
29157
- border: true,
29158
- className: "border-b-2 border-x-0 border-t-0 border-border flex items-center justify-between",
29159
- children: [
29160
- /* @__PURE__ */ jsx(Typography, { variant: "h4", children: title }),
29161
- controls && /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
29162
- controls.isPlaying ? /* @__PURE__ */ jsx(
29163
- Button,
29164
- {
29165
- variant: "secondary",
29166
- size: "sm",
29167
- icon: "pause",
29168
- onClick: controls.onPause,
29169
- children: "Pause"
29170
- }
29171
- ) : /* @__PURE__ */ jsx(
29172
- Button,
29173
- {
29174
- variant: "primary",
29175
- size: "sm",
29176
- icon: "play",
29177
- onClick: controls.onPlay,
29178
- children: "Play"
29179
- }
29180
- ),
29181
- /* @__PURE__ */ jsx(
29182
- Button,
29183
- {
29184
- variant: "ghost",
29185
- size: "sm",
29186
- icon: "rotate-ccw",
29187
- onClick: controls.onReset,
29188
- children: "Reset"
29189
- }
29190
- )
29191
- ] })
29192
- ]
29193
- }
29194
- ),
29195
- /* @__PURE__ */ jsxs(
29196
- Box,
29197
- {
29198
- position: "relative",
29199
- fullWidth: true,
29200
- className: backgroundAsset ? "flex-1" : "flex-1 bg-muted",
29201
- style: backgroundAsset ? { backgroundImage: `url(${backgroundAsset.url})`, backgroundSize: "cover", backgroundPosition: "center" } : void 0,
29202
- children: [
29203
- children,
29204
- hud && /* @__PURE__ */ jsx(
29205
- Box,
29206
- {
29207
- position: "absolute",
29208
- className: "top-0 left-0 right-0 pointer-events-none",
29209
- children: /* @__PURE__ */ jsx(Box, { padding: "md", className: "pointer-events-auto w-fit", children: hud })
29210
- }
29211
- )
29212
- ]
29213
- }
29214
- )
29215
- ] }),
29216
- showDebugPanel && debugPanel && /* @__PURE__ */ jsxs(
29217
- Box,
29218
- {
29219
- bg: "surface",
29220
- border: true,
29221
- shadow: "sm",
29222
- overflow: "auto",
29223
- className: "w-full lg:w-80 lg:border-l-2 lg:border-t-0 border-t-2 border-border",
29224
- children: [
29225
- /* @__PURE__ */ jsx(
29226
- Box,
29227
- {
29228
- padding: "md",
29229
- border: true,
29230
- className: "border-b-2 border-x-0 border-t-0 border-border",
29231
- children: /* @__PURE__ */ jsx(Typography, { variant: "h6", children: "Debug Panel" })
29232
- }
29233
- ),
29234
- /* @__PURE__ */ jsx(Box, { padding: "md", children: debugPanel })
29235
- ]
29236
- }
29237
- )
29238
- ]
29239
- }
29240
- );
29241
- };
29242
- GameTemplate.displayName = "GameTemplate";
29243
- }
29244
- });
29245
27893
  var FONT_BASE, GAME_FONTS, FONT_FACES, GameShell;
29246
27894
  var init_GameShell = __esm({
29247
27895
  "components/game/templates/GameShell.tsx"() {
@@ -29412,41 +28060,23 @@ var init_GameShell = __esm({
29412
28060
  GameShell.displayName = "GameShell";
29413
28061
  }
29414
28062
  });
29415
-
29416
- // components/game/molecules/index.ts
29417
28063
  var init_molecules = __esm({
29418
28064
  "components/game/molecules/index.ts"() {
29419
- init_lib();
29420
- init_GameCard();
28065
+ init_gameShared();
29421
28066
  init_HealthBar();
29422
28067
  init_ScoreDisplay();
29423
28068
  init_ControlButton();
29424
- init_Sprite();
29425
- init_StateIndicator();
29426
28069
  init_TimerDisplay();
29427
- init_ResourceCounter();
29428
- init_ItemSlot();
29429
- init_TurnIndicator();
29430
- init_ComboCounter();
29431
- init_WaypointMarker();
29432
- init_StatusEffect();
29433
- init_DamageNumber();
29434
28070
  init_DialogueBubble();
29435
28071
  init_ChoiceButton();
29436
- init_ActionButton();
29437
- init_MiniMap();
29438
- init_GameIcon();
29439
28072
  init_ControlGrid();
29440
28073
  init_StatBadge();
29441
- init_InventoryGrid();
29442
- init_ResourceBar();
29443
28074
  init_GameHud();
29444
28075
  init_GameMenu();
29445
28076
  init_StateGraph();
29446
28077
  init_Canvas2D();
29447
28078
  init_Canvas();
29448
28079
  init_useUnitSpriteAtlas();
29449
- init_GameAudioProvider();
29450
28080
  init_GameAudioToggle();
29451
28081
  init_useGameAudio();
29452
28082
  init_useCamera();
@@ -29456,16 +28086,11 @@ var init_molecules = __esm({
29456
28086
  init_ActionTile();
29457
28087
  init_ActionPalette();
29458
28088
  init_SequenceBar();
29459
- init_RuleEditor();
29460
- init_EventLog();
29461
- init_ObjectRulePanel();
29462
28089
  init_puzzleObject();
29463
28090
  init_StateNode();
29464
28091
  init_TransitionArrow();
29465
- init_VariablePanel();
29466
28092
  init_StateJsonView();
29467
28093
  init_physicsPresets();
29468
- init_GameTemplate();
29469
28094
  init_GameShell();
29470
28095
  }
29471
28096
  });
@@ -30068,13 +28693,13 @@ var init_MapView = __esm({
30068
28693
  shadowSize: [41, 41]
30069
28694
  });
30070
28695
  L.Marker.prototype.options.icon = defaultIcon;
30071
- const { useEffect: useEffect66, useRef: useRef62, useCallback: useCallback108, useState: useState100 } = React73__default;
28696
+ const { useEffect: useEffect64, useRef: useRef61, useCallback: useCallback104, useState: useState100 } = React73__default;
30072
28697
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
30073
28698
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
30074
28699
  function MapUpdater({ centerLat, centerLng, zoom }) {
30075
28700
  const map = useMap();
30076
- const prevRef = useRef62({ centerLat, centerLng, zoom });
30077
- useEffect66(() => {
28701
+ const prevRef = useRef61({ centerLat, centerLng, zoom });
28702
+ useEffect64(() => {
30078
28703
  const prev = prevRef.current;
30079
28704
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
30080
28705
  map.setView([centerLat, centerLng], zoom);
@@ -30085,7 +28710,7 @@ var init_MapView = __esm({
30085
28710
  }
30086
28711
  function MapClickHandler({ onMapClick }) {
30087
28712
  const map = useMap();
30088
- useEffect66(() => {
28713
+ useEffect64(() => {
30089
28714
  if (!onMapClick) return;
30090
28715
  const handler = (e) => {
30091
28716
  onMapClick(e.latlng.lat, e.latlng.lng);
@@ -30114,7 +28739,7 @@ var init_MapView = __esm({
30114
28739
  }) {
30115
28740
  const eventBus = useEventBus2();
30116
28741
  const [clickedPosition, setClickedPosition] = useState100(null);
30117
- const handleMapClick = useCallback108((lat, lng) => {
28742
+ const handleMapClick = useCallback104((lat, lng) => {
30118
28743
  if (showClickedPin) {
30119
28744
  setClickedPosition({ lat, lng });
30120
28745
  }
@@ -30123,7 +28748,7 @@ var init_MapView = __esm({
30123
28748
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
30124
28749
  }
30125
28750
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
30126
- const handleMarkerClick = useCallback108((marker) => {
28751
+ const handleMarkerClick = useCallback104((marker) => {
30127
28752
  onMarkerClick?.(marker);
30128
28753
  if (markerClickEvent) {
30129
28754
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -37221,7 +35846,7 @@ var init_Navigation = __esm({
37221
35846
  Navigation.displayName = "Navigation";
37222
35847
  }
37223
35848
  });
37224
- var paddingStyles4, variantStyles9, Section;
35849
+ var paddingStyles4, variantStyles7, Section;
37225
35850
  var init_Section = __esm({
37226
35851
  "components/core/molecules/Section.tsx"() {
37227
35852
  init_cn();
@@ -37234,7 +35859,7 @@ var init_Section = __esm({
37234
35859
  lg: "p-6",
37235
35860
  xl: "p-8"
37236
35861
  };
37237
- variantStyles9 = {
35862
+ variantStyles7 = {
37238
35863
  default: "",
37239
35864
  card: [
37240
35865
  "bg-card",
@@ -37267,7 +35892,7 @@ var init_Section = __esm({
37267
35892
  {
37268
35893
  className: cn(
37269
35894
  paddingStyles4[padding],
37270
- variantStyles9[variant],
35895
+ variantStyles7[variant],
37271
35896
  className
37272
35897
  )
37273
35898
  },
@@ -41443,18 +40068,18 @@ function entityFieldsFromListItem(item) {
41443
40068
  function getStatusStyle(fieldName, value) {
41444
40069
  const val = String(value).toLowerCase();
41445
40070
  if (val.includes("complete") || val.includes("done"))
41446
- return STATUS_STYLES2.complete;
40071
+ return STATUS_STYLES.complete;
41447
40072
  if (val.includes("active") || val.includes("progress"))
41448
- return STATUS_STYLES2.active;
40073
+ return STATUS_STYLES.active;
41449
40074
  if (val.includes("pending") || val.includes("waiting"))
41450
- return STATUS_STYLES2.pending;
40075
+ return STATUS_STYLES.pending;
41451
40076
  if (val.includes("block") || val.includes("cancel"))
41452
- return STATUS_STYLES2.blocked;
41453
- if (val.includes("high") || val.includes("urgent")) return STATUS_STYLES2.high;
40077
+ return STATUS_STYLES.blocked;
40078
+ if (val.includes("high") || val.includes("urgent")) return STATUS_STYLES.high;
41454
40079
  if (val.includes("medium") || val.includes("normal"))
41455
- return STATUS_STYLES2.medium;
41456
- if (val.includes("low")) return STATUS_STYLES2.low;
41457
- return STATUS_STYLES2.default;
40080
+ return STATUS_STYLES.medium;
40081
+ if (val.includes("low")) return STATUS_STYLES.low;
40082
+ return STATUS_STYLES.default;
41458
40083
  }
41459
40084
  function formatValue3(value, fieldName) {
41460
40085
  if (typeof value === "number") {
@@ -41487,7 +40112,7 @@ function formatValue3(value, fieldName) {
41487
40112
  function formatFieldLabel2(fieldName) {
41488
40113
  return fieldName.replace(/([A-Z])/g, " $1").replace(/^./, (str2) => str2.toUpperCase()).replace(/Id$/, "").trim();
41489
40114
  }
41490
- var STATUS_STYLES2, StatusBadge, ProgressIndicator, List3;
40115
+ var STATUS_STYLES, StatusBadge, ProgressIndicator, List3;
41491
40116
  var init_List = __esm({
41492
40117
  "components/core/organisms/List.tsx"() {
41493
40118
  "use client";
@@ -41500,7 +40125,7 @@ var init_List = __esm({
41500
40125
  init_getNestedValue();
41501
40126
  init_useEventBus();
41502
40127
  init_types2();
41503
- STATUS_STYLES2 = {
40128
+ STATUS_STYLES = {
41504
40129
  complete: {
41505
40130
  bg: "bg-success/10",
41506
40131
  text: "text-success",
@@ -45684,7 +44309,7 @@ var init_TeamOrganism = __esm({
45684
44309
  TeamOrganism.displayName = "TeamOrganism";
45685
44310
  }
45686
44311
  });
45687
- var lookStyles10, STATUS_STYLES3, Timeline;
44312
+ var lookStyles10, STATUS_STYLES2, Timeline;
45688
44313
  var init_Timeline = __esm({
45689
44314
  "components/core/organisms/Timeline.tsx"() {
45690
44315
  "use client";
@@ -45700,7 +44325,7 @@ var init_Timeline = __esm({
45700
44325
  horizontal: "flex-row [&>*]:flex-row [&>*]:items-center",
45701
44326
  swimlane: "flex-row gap-6 [&>*]:flex-row [&>*]:items-center"
45702
44327
  };
45703
- STATUS_STYLES3 = {
44328
+ STATUS_STYLES2 = {
45704
44329
  complete: {
45705
44330
  dotColor: "text-success",
45706
44331
  lineColor: "bg-success",
@@ -45784,7 +44409,7 @@ var init_Timeline = __esm({
45784
44409
  title && /* @__PURE__ */ jsx(Typography, { variant: "h5", weight: "semibold", children: title }),
45785
44410
  /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("relative", lookStyles10[look]), children: items.map((item, idx) => {
45786
44411
  const status = item.status || "pending";
45787
- const style = STATUS_STYLES3[status] || STATUS_STYLES3.pending;
44412
+ const style = STATUS_STYLES2[status] || STATUS_STYLES2.pending;
45788
44413
  const ItemIcon = item.icon || style.icon;
45789
44414
  const isLast = idx === items.length - 1;
45790
44415
  return /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "relative", children: [
@@ -45895,38 +44520,13 @@ var init_ToastSlot = __esm({
45895
44520
  ToastSlot.displayName = "ToastSlot";
45896
44521
  }
45897
44522
  });
45898
- function lazyThree(name, loader) {
45899
- const Lazy = React73__default.lazy(
45900
- () => loader().then((m) => {
45901
- const Resolved = m[name];
45902
- if (!Resolved) {
45903
- throw new Error(
45904
- `[@almadar/ui] 3D component "${name}" was not found in the three subpath bundle.`
45905
- );
45906
- }
45907
- return { default: Resolved };
45908
- })
45909
- );
45910
- function ThreeWrapper(props) {
45911
- return React73__default.createElement(
45912
- ThreeBoundary,
45913
- { name },
45914
- React73__default.createElement(
45915
- React73__default.Suspense,
45916
- { fallback: null },
45917
- React73__default.createElement(Lazy, props)
45918
- )
45919
- );
45920
- }
45921
- ThreeWrapper.displayName = `Lazy(${name})`;
45922
- return ThreeWrapper;
45923
- }
45924
- var ThreeBoundary, GameCanvas3D2, COMPONENT_REGISTRY;
44523
+
44524
+ // components/core/organisms/component-registry.generated.ts
44525
+ var COMPONENT_REGISTRY;
45925
44526
  var init_component_registry_generated = __esm({
45926
44527
  "components/core/organisms/component-registry.generated.ts"() {
45927
44528
  init_AboutPageTemplate();
45928
44529
  init_Accordion();
45929
- init_ActionButton();
45930
44530
  init_ActionPalette();
45931
44531
  init_ActionTile();
45932
44532
  init_ActivationBlock();
@@ -45970,7 +44570,6 @@ var init_component_registry_generated = __esm({
45970
44570
  init_ChoiceButton();
45971
44571
  init_CodeBlock();
45972
44572
  init_CodeRunnerPanel();
45973
- init_ComboCounter();
45974
44573
  init_CommunityLinks();
45975
44574
  init_ConditionalWrapper();
45976
44575
  init_ConfettiEffect();
@@ -45982,7 +44581,6 @@ var init_component_registry_generated = __esm({
45982
44581
  init_ControlButton();
45983
44582
  init_ControlGrid();
45984
44583
  init_CounterTemplate();
45985
- init_DamageNumber();
45986
44584
  init_DashboardGrid();
45987
44585
  init_DashboardLayout();
45988
44586
  init_DataGrid();
@@ -46012,7 +44610,6 @@ var init_component_registry_generated = __esm({
46012
44610
  init_EmptyState();
46013
44611
  init_ErrorBoundary();
46014
44612
  init_ErrorState();
46015
- init_EventLog();
46016
44613
  init_FeatureCard();
46017
44614
  init_FeatureDetailPageTemplate();
46018
44615
  init_FeatureGrid();
@@ -46029,12 +44626,10 @@ var init_component_registry_generated = __esm({
46029
44626
  init_FormField();
46030
44627
  init_FormSectionHeader();
46031
44628
  init_GameAudioToggle();
46032
- init_GameCard();
46033
44629
  init_GameHud();
46034
44630
  init_GameIcon();
46035
44631
  init_GameMenu();
46036
44632
  init_GameShell();
46037
- init_GameTemplate();
46038
44633
  init_GenericAppTemplate();
46039
44634
  init_GeometricPattern();
46040
44635
  init_GradientDivider();
@@ -46051,8 +44646,6 @@ var init_component_registry_generated = __esm({
46051
44646
  init_Input();
46052
44647
  init_InputGroup();
46053
44648
  init_InstallBox();
46054
- init_InventoryGrid();
46055
- init_ItemSlot();
46056
44649
  init_JazariStateMachine();
46057
44650
  init_LandingPageTemplate();
46058
44651
  init_LawReferenceTooltip();
@@ -46073,13 +44666,11 @@ var init_component_registry_generated = __esm({
46073
44666
  init_MediaGallery();
46074
44667
  init_Menu();
46075
44668
  init_Meter();
46076
- init_MiniMap();
46077
44669
  init_Modal();
46078
44670
  init_ModalSlot();
46079
44671
  init_ModuleCard();
46080
44672
  init_Navigation();
46081
44673
  init_NumberStepper();
46082
- init_ObjectRulePanel();
46083
44674
  init_OptionConstraintGroup();
46084
44675
  init_OrbitalVisualization();
46085
44676
  init_Overlay();
@@ -46105,8 +44696,6 @@ var init_component_registry_generated = __esm({
46105
44696
  init_RelationSelect();
46106
44697
  init_RepeatableFormSection();
46107
44698
  init_ReplyTree();
46108
- init_ResourceBar();
46109
- init_ResourceCounter();
46110
44699
  init_RichBlockEditor();
46111
44700
  init_RuntimeDebugger2();
46112
44701
  init_ScaledDiagram();
@@ -46132,19 +44721,16 @@ var init_component_registry_generated = __esm({
46132
44721
  init_Split();
46133
44722
  init_SplitPane();
46134
44723
  init_SplitSection();
46135
- init_Sprite();
46136
44724
  init_StarRating();
46137
44725
  init_StatBadge();
46138
44726
  init_StatCard();
46139
44727
  init_StatDisplay();
46140
44728
  init_StateGraph();
46141
- init_StateIndicator();
46142
44729
  init_StateJsonView();
46143
44730
  init_StateMachineView();
46144
44731
  init_StatsGrid();
46145
44732
  init_StatsOrganism();
46146
44733
  init_StatusDot();
46147
- init_StatusEffect();
46148
44734
  init_StepFlow();
46149
44735
  init_StepFlowOrganism();
46150
44736
  init_SubagentTracePanel();
@@ -46181,46 +44767,19 @@ var init_component_registry_generated = __esm({
46181
44767
  init_TraitFrame();
46182
44768
  init_TraitSlot();
46183
44769
  init_TrendIndicator();
46184
- init_TurnIndicator();
46185
44770
  init_TypewriterText();
46186
44771
  init_Typography();
46187
44772
  init_UISlotRenderer();
46188
44773
  init_UploadDropZone();
46189
- init_VariablePanel();
46190
44774
  init_VersionDiff();
46191
44775
  init_ViolationAlert();
46192
44776
  init_VoteStack();
46193
- init_WaypointMarker();
46194
44777
  init_WizardContainer();
46195
44778
  init_WizardNavigation();
46196
44779
  init_WizardProgress();
46197
- ThreeBoundary = class extends React73__default.Component {
46198
- constructor() {
46199
- super(...arguments);
46200
- __publicField(this, "state", { failed: false });
46201
- }
46202
- static getDerivedStateFromError() {
46203
- return { failed: true };
46204
- }
46205
- render() {
46206
- if (this.state.failed) {
46207
- return React73__default.createElement(
46208
- "div",
46209
- {
46210
- "data-testid": "three-unavailable",
46211
- style: { padding: 16, fontSize: 13, lineHeight: 1.5, opacity: 0.7 }
46212
- },
46213
- `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.`
46214
- );
46215
- }
46216
- return this.props.children;
46217
- }
46218
- };
46219
- GameCanvas3D2 = lazyThree("GameCanvas3D", () => import('@almadar/ui/components/molecules/game/three'));
46220
44780
  COMPONENT_REGISTRY = {
46221
44781
  "AboutPageTemplate": AboutPageTemplate,
46222
44782
  "Accordion": Accordion,
46223
- "ActionButton": ActionButton,
46224
44783
  "ActionPalette": ActionPalette,
46225
44784
  "ActionTile": ActionTile,
46226
44785
  "ActivationBlock": ActivationBlock,
@@ -46269,7 +44828,6 @@ var init_component_registry_generated = __esm({
46269
44828
  "ChoiceButton": ChoiceButton,
46270
44829
  "CodeBlock": CodeBlock,
46271
44830
  "CodeRunnerPanel": CodeRunnerPanel,
46272
- "ComboCounter": ComboCounter,
46273
44831
  "CommunityLinks": CommunityLinks,
46274
44832
  "ConditionalWrapper": ConditionalWrapper,
46275
44833
  "ConfettiEffect": ConfettiEffect,
@@ -46281,7 +44839,6 @@ var init_component_registry_generated = __esm({
46281
44839
  "ControlButton": ControlButton,
46282
44840
  "ControlGrid": ControlGrid,
46283
44841
  "CounterTemplate": CounterTemplate,
46284
- "DamageNumber": DamageNumber,
46285
44842
  "DashboardGrid": DashboardGrid,
46286
44843
  "DashboardLayout": DashboardLayout,
46287
44844
  "DataGrid": DataGrid,
@@ -46313,7 +44870,6 @@ var init_component_registry_generated = __esm({
46313
44870
  "EmptyState": EmptyState,
46314
44871
  "ErrorBoundary": ErrorBoundary,
46315
44872
  "ErrorState": ErrorState,
46316
- "EventLog": EventLog,
46317
44873
  "FeatureCard": FeatureCard,
46318
44874
  "FeatureDetailPageTemplate": FeatureDetailPageTemplate,
46319
44875
  "FeatureGrid": FeatureGrid,
@@ -46331,13 +44887,10 @@ var init_component_registry_generated = __esm({
46331
44887
  "FormLayout": FormLayout,
46332
44888
  "FormSectionHeader": FormSectionHeader,
46333
44889
  "GameAudioToggle": GameAudioToggle,
46334
- "GameCanvas3D": GameCanvas3D2,
46335
- "GameCard": GameCard,
46336
44890
  "GameHud": GameHud,
46337
44891
  "GameIcon": GameIcon,
46338
44892
  "GameMenu": GameMenu,
46339
44893
  "GameShell": GameShell,
46340
- "GameTemplate": GameTemplate,
46341
44894
  "GenericAppTemplate": GenericAppTemplate,
46342
44895
  "GeometricPattern": GeometricPattern,
46343
44896
  "GradientDivider": GradientDivider,
@@ -46354,8 +44907,6 @@ var init_component_registry_generated = __esm({
46354
44907
  "Input": Input,
46355
44908
  "InputGroup": InputGroup,
46356
44909
  "InstallBox": InstallBox,
46357
- "InventoryGrid": InventoryGrid,
46358
- "ItemSlot": ItemSlot,
46359
44910
  "JazariStateMachine": JazariStateMachine,
46360
44911
  "Label": LabelPattern,
46361
44912
  "LabelPattern": LabelPattern,
@@ -46378,13 +44929,11 @@ var init_component_registry_generated = __esm({
46378
44929
  "MediaGallery": MediaGallery,
46379
44930
  "Menu": Menu,
46380
44931
  "Meter": Meter,
46381
- "MiniMap": MiniMap,
46382
44932
  "Modal": Modal,
46383
44933
  "ModalSlot": ModalSlot,
46384
44934
  "ModuleCard": ModuleCard,
46385
44935
  "Navigation": Navigation,
46386
44936
  "NumberStepper": NumberStepper,
46387
- "ObjectRulePanel": ObjectRulePanel,
46388
44937
  "OptionConstraintGroup": OptionConstraintGroup,
46389
44938
  "OrbitalVisualization": OrbitalVisualization,
46390
44939
  "Overlay": Overlay,
@@ -46410,8 +44959,6 @@ var init_component_registry_generated = __esm({
46410
44959
  "RelationSelect": RelationSelect,
46411
44960
  "RepeatableFormSection": RepeatableFormSection,
46412
44961
  "ReplyTree": ReplyTree,
46413
- "ResourceBar": ResourceBar,
46414
- "ResourceCounter": ResourceCounter,
46415
44962
  "RichBlockEditor": RichBlockEditor,
46416
44963
  "RuntimeDebugger": RuntimeDebugger,
46417
44964
  "ScaledDiagram": ScaledDiagram,
@@ -46439,20 +44986,17 @@ var init_component_registry_generated = __esm({
46439
44986
  "Split": Split,
46440
44987
  "SplitPane": SplitPane,
46441
44988
  "SplitSection": SplitSection,
46442
- "Sprite": Sprite,
46443
44989
  "Stack": Stack,
46444
44990
  "StarRating": StarRating,
46445
44991
  "StatBadge": StatBadge,
46446
44992
  "StatCard": StatCard,
46447
44993
  "StatDisplay": StatDisplay,
46448
44994
  "StateGraph": StateGraph,
46449
- "StateIndicator": StateIndicator,
46450
44995
  "StateJsonView": StateJsonView,
46451
44996
  "StateMachineView": StateMachineView,
46452
44997
  "StatsGrid": StatsGrid,
46453
44998
  "StatsOrganism": StatsOrganism,
46454
44999
  "StatusDot": StatusDot,
46455
- "StatusEffect": StatusEffect,
46456
45000
  "StepFlow": StepFlow,
46457
45001
  "StepFlowOrganism": StepFlowOrganism,
46458
45002
  "SubagentTracePanel": SubagentTracePanel,
@@ -46489,17 +45033,14 @@ var init_component_registry_generated = __esm({
46489
45033
  "TraitFrame": TraitFrame,
46490
45034
  "TraitSlot": TraitSlot,
46491
45035
  "TrendIndicator": TrendIndicator,
46492
- "TurnIndicator": TurnIndicator,
46493
45036
  "TypewriterText": TypewriterText,
46494
45037
  "Typography": Typography,
46495
45038
  "UISlotRenderer": UISlotRenderer,
46496
45039
  "UploadDropZone": UploadDropZone,
46497
45040
  "VStack": VStack,
46498
- "VariablePanel": VariablePanel,
46499
45041
  "VersionDiff": VersionDiff,
46500
45042
  "ViolationAlert": ViolationAlert,
46501
45043
  "VoteStack": VoteStack,
46502
- "WaypointMarker": WaypointMarker,
46503
45044
  "WizardContainer": WizardContainer,
46504
45045
  "WizardNavigation": WizardNavigation,
46505
45046
  "WizardProgress": WizardProgress,
@@ -47516,6 +46057,7 @@ var init_atoms = __esm({
47516
46057
  init_Card();
47517
46058
  init_Badge();
47518
46059
  init_AtlasImage();
46060
+ init_GameIcon();
47519
46061
  init_FilterPill();
47520
46062
  init_Spinner();
47521
46063
  init_Avatar();
@@ -49624,7 +48166,7 @@ var I18nContext = createContext({
49624
48166
  });
49625
48167
  I18nContext.displayName = "I18nContext";
49626
48168
  var I18nProvider = I18nContext.Provider;
49627
- function useTranslate119() {
48169
+ function useTranslate115() {
49628
48170
  return useContext(I18nContext);
49629
48171
  }
49630
48172
  function createTranslate(messages) {
@@ -49889,4 +48431,4 @@ function useGitHubBranches(owner, repo, enabled = true) {
49889
48431
  });
49890
48432
  }
49891
48433
 
49892
- export { ALL_PRESETS, ALMADAR_DND_MIME, AR_BOOK_FIELDS, AboutPageTemplate, Accordion, ActionButton, Card2 as ActionCard, ActionPalette, ActionTile, ActivationBlock, Alert, AlgorithmCanvas, AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, Aside, AssetPicker, AtlasImage, AtlasPanel, AuthLayout, Avatar, Badge, BehaviorView, BiologyCanvas, BloomQuizBlock, BookChapterView, BookCoverPage, BookNavBar, BookTableOfContents, BookViewer, Box, BranchingLogicBuilder, Breadcrumb, Button, ButtonGroup, CTABanner, CalendarGrid, Canvas, Canvas2D, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CaseStudyCard, CaseStudyOrganism, Center, Chart, ChartLegend, ChatBar, Checkbox, ChemistryCanvas, ChoiceButton, Coachmark, CodeBlock, CodeRunnerPanel, CollapsibleSection, ComboCounter, CommunityLinks, ConditionalWrapper, ConfettiEffect, ConfirmDialog, ConnectionBlock, Container, ContentRenderer, ContentSection, ControlButton, ControlGrid, CounterTemplate, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DEFAULT_SLOTS, DIAMOND_TOP_Y, DamageNumber, DashboardGrid, DashboardLayout, DataGrid, DataList, DataTable, DateRangePicker, DateRangeSelector, DayCell, DetailPanel, Dialog, DialogueBubble, Divider, DocBreadcrumb, DocPagination, DocSearch, DocSidebar, DocTOC, DocumentViewer, StateMachineView as DomStateMachineVisualizer, Drawer, DrawerSlot, ELEMENT_SELECTED_EVENT, EdgeDecoration, EditorCheckbox, EditorSelect, EditorSlider, EditorTextInput, EditorToolbar, EmptyState, EntityDisplayEvents, ErrorBoundary, ErrorState, EventLog, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FeatureCard, FeatureDetailPageTemplate, FeatureGrid, FeatureGridOrganism, FileTree, FilterGroup, FilterPill, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormActions, FormField, FormLayout, FormSection, FormSectionHeader, GameAudioContext, GameAudioProvider, GameAudioToggle, GameCard, GameHud, GameIcon, GameMenu, GameShell, GameTemplate, GenericAppTemplate, GeometricPattern, GradientDivider, GraphCanvas, GraphView, Grid, GridPicker, HStack, Header, HealthBar, HeroOrganism, HeroSection, I18nProvider, IDENTITY_BOOK_FIELDS, Icon, IconPicker, InfiniteScrollSentinel, Input, InputGroup, InstallBox, InventoryGrid, ItemSlot, JazariStateMachine, JsonTreeEditor, Label, LandingPageTemplate, LawReferenceTooltip, LearningCanvas, Lightbox, LikertScale, LineChart2 as LineChart, List3 as List, LoadingState, MapView, MarkdownContent, MarketingFooter, MarketingStatCard, MasterDetail, MasterDetailLayout, MathCanvas, MatrixQuestion, MediaGallery, Menu, Meter, MiniMap, Modal, ModalSlot, ModuleCard, Navigation, NodeSlotEditor, NotifyListener, NumberStepper, ObjectRulePanel, OnboardingSpotlight, OptionConstraintGroup, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, Overlay, PageHeader, Pagination, PatternTile, PhysicsCanvas, Popover, PositionedCanvas, PricingCard, PricingGrid, PricingOrganism, PricingPageTemplate, ProgressBar, ProgressDots, PropertyInspector, PullQuote, PullToRefresh, QrScanner, QuizBlock, Radio, RangeSlider, ReflectionBlock, RelationSelect, RepeatableFormSection, ReplyTree, ResourceBar, ResourceCounter, RichBlockEditor, RuleEditor, RuntimeDebugger, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, ScoreDisplay, SearchInput, Section, SectionHeader, SegmentRenderer, Select, SequenceBar, ServiceCatalog, ShowcaseCard, ShowcaseOrganism, SidePanel, Sidebar, SignaturePad, SimpleGrid, Skeleton, SlotContentRenderer, SocialProof, SortableList, Spacer, Sparkline, Spinner, Split, SplitPane, SplitSection, Sprite, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateGraph, StateIndicator, StateJsonView, StateMachineView, StateNode2 as StateNode, StatsGrid, StatsOrganism, StatusBar, StatusDot, StatusEffect, StepFlow, StepFlowOrganism, SubagentTracePanel, SvgBranch, SvgConnection, SvgFlow, SvgGrid, SvgLobe, SvgMesh, SvgMorph, SvgNode, SvgPulse, SvgRing, SvgShield, SvgStack, SwipeableRow, Switch, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, TabbedContainer, TableView, Tabs, TagCloud, TagInput, TeamCard, TeamOrganism, TerrainPalette, TextHighlight, Textarea, ThemeToggle, TimeSlotCell, Timeline, TimerDisplay, Toast, ToastSlot, Tooltip, TraitFrame, TraitSlot, TraitStateViewer, TransitionArrow, TrendIndicator, TurnIndicator, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UploadDropZone, VStack, VariablePanel, VersionDiff, ViolationAlert, VoteStack, WaypointMarker, WizardContainer, WizardNavigation, WizardProgress, boardEntity, bool, calculateAttackTargets, calculateValidMoves, cn, createInitialGameState, createSharedEntityStore, createTranslate, createUnitAnimationState, drawSprite, getCurrentFrame, getTileDimensions, inferDirection, isoToScreen, makeAsset, makeAssetMap, mapBookData, num, objAvailableActions, objAvailableEvents, objCurrentState, objIcon, objId, objMaxRules, objName, objRules, objStates, parseEditFocus, parseLessonSegments, parseMarkdownWithCodeBlocks, parseQueryBinding, pendulum, projectileMotion, resolveFieldMap, resolveFrame, resolveSheetDirection, rows, runTickFrame, screenToIso, springOscillator, str, tickAnimationState, toCodeLanguage, transitionAnimation, unitHealth, unitPosition, unitTeam, useAgentChat, useAnchorRect, useAtlasSliceDataUrl, useAuthContext, useCamera, useCanvasGestures, useCompile, useConnectGitHub, useDeepAgentGeneration, useDisconnectGitHub, useDragReorder, useDraggable, useDropZone, useEmitEvent, useEventBus, useEventListener, useExtensions, useFileEditor, useFileSystem, useGameAudio, useGameAudioContext, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useImageCache, useInfiniteScroll, useLongPress, useOrbitalHistory, usePreview, usePullToRefresh, useQuerySingleton, useRenderInterpolation, useSharedEntitySnapshot, useSharedEntityStore, useSwipeGesture, useTapReveal, useTraitListens, useTranslate119 as useTranslate, useUIEvents, useUISlotManager, useUnitSpriteAtlas, useValidation, vec2 };
48434
+ export { ALL_PRESETS, ALMADAR_DND_MIME, AR_BOOK_FIELDS, AboutPageTemplate, Accordion, Card2 as ActionCard, ActionPalette, ActionTile, ActivationBlock, Alert, AlgorithmCanvas, AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, Aside, AssetPicker, AtlasImage, AtlasPanel, AuthLayout, Avatar, Badge, BehaviorView, BiologyCanvas, BloomQuizBlock, BookChapterView, BookCoverPage, BookNavBar, BookTableOfContents, BookViewer, Box, BranchingLogicBuilder, Breadcrumb, Button, ButtonGroup, CTABanner, CalendarGrid, Canvas, Canvas2D, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CaseStudyCard, CaseStudyOrganism, Center, Chart, ChartLegend, ChatBar, Checkbox, ChemistryCanvas, ChoiceButton, Coachmark, CodeBlock, CodeRunnerPanel, CollapsibleSection, CommunityLinks, ConditionalWrapper, ConfettiEffect, ConfirmDialog, ConnectionBlock, Container, ContentRenderer, ContentSection, ControlButton, ControlGrid, CounterTemplate, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DEFAULT_SLOTS, DIAMOND_TOP_Y, DashboardGrid, DashboardLayout, DataGrid, DataList, DataTable, DateRangePicker, DateRangeSelector, DayCell, DetailPanel, Dialog, DialogueBubble, Divider, DocBreadcrumb, DocPagination, DocSearch, DocSidebar, DocTOC, DocumentViewer, StateMachineView as DomStateMachineVisualizer, Drawer, DrawerSlot, ELEMENT_SELECTED_EVENT, EdgeDecoration, EditorCheckbox, EditorSelect, EditorSlider, EditorTextInput, EditorToolbar, EmptyState, EntityDisplayEvents, ErrorBoundary, ErrorState, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FeatureCard, FeatureDetailPageTemplate, FeatureGrid, FeatureGridOrganism, FileTree, FilterGroup, FilterPill, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormActions, FormField, FormLayout, FormSection, FormSectionHeader, GameAudioToggle, GameHud, GameIcon, GameMenu, GameShell, GenericAppTemplate, GeometricPattern, GradientDivider, GraphCanvas, GraphView, Grid, GridPicker, HStack, Header, HealthBar, HeroOrganism, HeroSection, I18nProvider, IDENTITY_BOOK_FIELDS, Icon, IconPicker, InfiniteScrollSentinel, Input, InputGroup, InstallBox, JazariStateMachine, JsonTreeEditor, Label, LandingPageTemplate, LawReferenceTooltip, LearningCanvas, Lightbox, LikertScale, LineChart2 as LineChart, List3 as List, LoadingState, MapView, MarkdownContent, MarketingFooter, MarketingStatCard, MasterDetail, MasterDetailLayout, MathCanvas, MatrixQuestion, MediaGallery, Menu, Meter, Modal, ModalSlot, ModuleCard, Navigation, NodeSlotEditor, NotifyListener, NumberStepper, OnboardingSpotlight, OptionConstraintGroup, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, Overlay, PageHeader, Pagination, PatternTile, PhysicsCanvas, Popover, PositionedCanvas, PricingCard, PricingGrid, PricingOrganism, PricingPageTemplate, ProgressBar, ProgressDots, PropertyInspector, PullQuote, PullToRefresh, QrScanner, QuizBlock, Radio, RangeSlider, ReflectionBlock, RelationSelect, RepeatableFormSection, ReplyTree, RichBlockEditor, RuntimeDebugger, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, ScoreDisplay, SearchInput, Section, SectionHeader, SegmentRenderer, Select, SequenceBar, ServiceCatalog, ShowcaseCard, ShowcaseOrganism, SidePanel, Sidebar, SignaturePad, SimpleGrid, Skeleton, SlotContentRenderer, SocialProof, SortableList, Spacer, Sparkline, Spinner, Split, SplitPane, SplitSection, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateGraph, StateJsonView, StateMachineView, StateNode2 as StateNode, StatsGrid, StatsOrganism, StatusBar, StatusDot, StepFlow, StepFlowOrganism, SubagentTracePanel, SvgBranch, SvgConnection, SvgFlow, SvgGrid, SvgLobe, SvgMesh, SvgMorph, SvgNode, SvgPulse, SvgRing, SvgShield, SvgStack, SwipeableRow, Switch, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, TabbedContainer, TableView, Tabs, TagCloud, TagInput, TeamCard, TeamOrganism, TerrainPalette, TextHighlight, Textarea, ThemeToggle, TimeSlotCell, Timeline, TimerDisplay, Toast, ToastSlot, Tooltip, TraitFrame, TraitSlot, TraitStateViewer, TransitionArrow, TrendIndicator, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UploadDropZone, VStack, VersionDiff, ViolationAlert, VoteStack, WizardContainer, WizardNavigation, WizardProgress, boardEntity, bool, calculateAttackTargets, calculateValidMoves, cn, createInitialGameState, createSharedEntityStore, createTranslate, createUnitAnimationState, getCurrentFrame, getTileDimensions, inferDirection, isoToScreen, makeAsset, makeAssetMap, mapBookData, num, objAvailableActions, objAvailableEvents, objCurrentState, objIcon, objId, objMaxRules, objName, objRules, objStates, parseEditFocus, parseLessonSegments, parseMarkdownWithCodeBlocks, parseQueryBinding, pendulum, projectileMotion, resolveFieldMap, resolveFrame, resolveSheetDirection, rows, runTickFrame, screenToIso, springOscillator, str, tickAnimationState, toCodeLanguage, transitionAnimation, unitHealth, unitPosition, unitTeam, useAgentChat, useAnchorRect, useAtlasSliceDataUrl, useAuthContext, useCamera, useCanvasGestures, useCompile, useConnectGitHub, useDeepAgentGeneration, useDisconnectGitHub, useDragReorder, useDraggable, useDropZone, useEmitEvent, useEventBus, useEventListener, useExtensions, useFileEditor, useFileSystem, useGameAudio, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useImageCache, useInfiniteScroll, useLongPress, useOrbitalHistory, usePreview, usePullToRefresh, useQuerySingleton, useRenderInterpolation, useSharedEntitySnapshot, useSharedEntityStore, useSwipeGesture, useTapReveal, useTraitListens, useTranslate115 as useTranslate, useUIEvents, useUISlotManager, useUnitSpriteAtlas, useValidation, vec2 };