@zylem/behaviors 0.5.2 → 0.5.5

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 (73) hide show
  1. package/dist/{behavior-system-CldqNUgr.d.ts → behavior-system-HEt67el5.d.ts} +14 -1
  2. package/dist/{chunk-Y4PHT2HG.js → chunk-3QUECYMT.js} +2 -2
  3. package/dist/{chunk-DZ4LLQON.js → chunk-4GW6DCYF.js} +24 -2
  4. package/dist/chunk-4GW6DCYF.js.map +1 -0
  5. package/dist/{chunk-G2KUXVU6.js → chunk-B2ERQ6HD.js} +2 -2
  6. package/dist/{chunk-7W3KY55G.js → chunk-D7N6SC4D.js} +2 -2
  7. package/dist/{chunk-LZIHSJZR.js → chunk-DWVLGXMF.js} +2 -2
  8. package/dist/{chunk-WU6XXL3D.js → chunk-GL5JGXPR.js} +2 -2
  9. package/dist/{chunk-7JLWZXPA.js → chunk-GLXEJD2P.js} +2 -2
  10. package/dist/{chunk-4MZ57HPD.js → chunk-IRMJTAIK.js} +2 -2
  11. package/dist/{chunk-7DGXUAPV.js → chunk-JACX7ZMJ.js} +2 -2
  12. package/dist/{chunk-4LLK2FJI.js → chunk-S5HFWDGM.js} +2 -2
  13. package/dist/{chunk-7JJEIADR.js → chunk-USFIJUDN.js} +300 -157
  14. package/dist/chunk-USFIJUDN.js.map +1 -0
  15. package/dist/{chunk-QS3VXWVO.js → chunk-WQUPSOFV.js} +2 -2
  16. package/dist/{chunk-4CEW64HO.js → chunk-ZOYA3TZG.js} +2 -2
  17. package/dist/{components-BmievOxF.d.ts → components-JZQoO2sU.d.ts} +1 -1
  18. package/dist/cooldown.d.ts +1 -1
  19. package/dist/coordinators/boundary-ricochet-3d.d.ts +2 -2
  20. package/dist/coordinators/boundary-ricochet.d.ts +2 -2
  21. package/dist/coordinators/multidirectional-space-shooter.d.ts +1 -1
  22. package/dist/coordinators/top-down-shooter.d.ts +1 -1
  23. package/dist/core.d.ts +20 -5
  24. package/dist/core.js +24 -1
  25. package/dist/core.js.map +1 -1
  26. package/dist/destructible-3d.d.ts +1 -1
  27. package/dist/first-person.d.ts +1 -1
  28. package/dist/first-person.js +2 -2
  29. package/dist/index.d.ts +4 -4
  30. package/dist/index.js +13 -13
  31. package/dist/jumper-2d.d.ts +1 -1
  32. package/dist/jumper-2d.js +2 -2
  33. package/dist/jumper-3d.d.ts +1 -1
  34. package/dist/jumper-3d.js +2 -2
  35. package/dist/{moveable-rdIvWiak.d.ts → moveable-BdFmI3s1.d.ts} +1 -1
  36. package/dist/particle-emitter/presets.d.ts +1 -1
  37. package/dist/particle-emitter/presets.js +1 -1
  38. package/dist/particle-emitter.d.ts +3 -3
  39. package/dist/particle-emitter.js +2 -2
  40. package/dist/platformer-2d.d.ts +1 -1
  41. package/dist/platformer-2d.js +2 -2
  42. package/dist/platformer-3d.d.ts +1 -1
  43. package/dist/platformer-3d.js +2 -2
  44. package/dist/ricochet-2d.d.ts +1 -1
  45. package/dist/ricochet-2d.js +2 -2
  46. package/dist/ricochet-3d.d.ts +1 -1
  47. package/dist/ricochet-3d.js +2 -2
  48. package/dist/runtime-2d.d.ts +1 -1
  49. package/dist/screen-visibility.d.ts +1 -1
  50. package/dist/screen-wrap.d.ts +1 -1
  51. package/dist/shooter-2d.d.ts +1 -1
  52. package/dist/{spark-Dx3cJbTW.d.ts → spark-C4Tp-52_.d.ts} +4 -2
  53. package/dist/thruster.d.ts +1 -1
  54. package/dist/top-down-movement.d.ts +1 -1
  55. package/dist/top-down-movement.js +2 -2
  56. package/dist/world-boundary-2d.d.ts +1 -1
  57. package/dist/world-boundary-2d.js +2 -2
  58. package/dist/world-boundary-3d.d.ts +1 -1
  59. package/dist/world-boundary-3d.js +2 -2
  60. package/package.json +159 -161
  61. package/dist/chunk-7JJEIADR.js.map +0 -1
  62. package/dist/chunk-DZ4LLQON.js.map +0 -1
  63. /package/dist/{chunk-Y4PHT2HG.js.map → chunk-3QUECYMT.js.map} +0 -0
  64. /package/dist/{chunk-G2KUXVU6.js.map → chunk-B2ERQ6HD.js.map} +0 -0
  65. /package/dist/{chunk-7W3KY55G.js.map → chunk-D7N6SC4D.js.map} +0 -0
  66. /package/dist/{chunk-LZIHSJZR.js.map → chunk-DWVLGXMF.js.map} +0 -0
  67. /package/dist/{chunk-WU6XXL3D.js.map → chunk-GL5JGXPR.js.map} +0 -0
  68. /package/dist/{chunk-7JLWZXPA.js.map → chunk-GLXEJD2P.js.map} +0 -0
  69. /package/dist/{chunk-4MZ57HPD.js.map → chunk-IRMJTAIK.js.map} +0 -0
  70. /package/dist/{chunk-7DGXUAPV.js.map → chunk-JACX7ZMJ.js.map} +0 -0
  71. /package/dist/{chunk-4LLK2FJI.js.map → chunk-S5HFWDGM.js.map} +0 -0
  72. /package/dist/{chunk-QS3VXWVO.js.map → chunk-WQUPSOFV.js.map} +0 -0
  73. /package/dist/{chunk-4CEW64HO.js.map → chunk-ZOYA3TZG.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/lib/behaviors/particle-emitter/preset-builder.ts","../src/lib/behaviors/particle-emitter/gpu/particles.ts","../src/lib/behaviors/particle-emitter/gpu/types.ts","../src/lib/behaviors/particle-emitter/gpu/textures.ts","../src/lib/behaviors/particle-emitter/gpu/nodes.ts","../src/lib/behaviors/particle-emitter/gpu/easing.ts","../src/lib/behaviors/particle-emitter/gpu/utils.ts","../src/lib/behaviors/particle-emitter/presets/electricity/arc.ts","../src/lib/behaviors/particle-emitter/presets/electricity/pulse.ts","../src/lib/behaviors/particle-emitter/presets/electricity/spark.ts","../src/lib/behaviors/particle-emitter/presets/electricity/storm.ts","../src/lib/behaviors/particle-emitter/presets/electricity/surge.ts","../src/lib/behaviors/particle-emitter/presets/electricity/index.ts","../src/lib/behaviors/particle-emitter/presets/fire/blaze.ts","../src/lib/behaviors/particle-emitter/presets/fire/ember.ts","../src/lib/behaviors/particle-emitter/presets/fire/flamelet.ts","../src/lib/behaviors/particle-emitter/presets/fire/smolder.ts","../src/lib/behaviors/particle-emitter/presets/fire/spark.ts","../src/lib/behaviors/particle-emitter/presets/fire/index.ts","../src/lib/behaviors/particle-emitter/presets/gas/haze.ts","../src/lib/behaviors/particle-emitter/presets/gas/miasma.ts","../src/lib/behaviors/particle-emitter/presets/gas/plume.ts","../src/lib/behaviors/particle-emitter/presets/gas/smoke.ts","../src/lib/behaviors/particle-emitter/presets/gas/vapor.ts","../src/lib/behaviors/particle-emitter/presets/gas/index.ts","../src/lib/behaviors/particle-emitter/presets/magic/arcane.ts","../src/lib/behaviors/particle-emitter/presets/magic/corrupted.ts","../src/lib/behaviors/particle-emitter/presets/magic/holy.ts","../src/lib/behaviors/particle-emitter/presets/magic/nature.ts","../src/lib/behaviors/particle-emitter/presets/magic/psychic.ts","../src/lib/behaviors/particle-emitter/presets/magic/void.ts","../src/lib/behaviors/particle-emitter/presets/magic/index.ts","../src/lib/behaviors/particle-emitter/presets/water/drizzle.ts","../src/lib/behaviors/particle-emitter/presets/water/mist.ts","../src/lib/behaviors/particle-emitter/presets/water/splash.ts","../src/lib/behaviors/particle-emitter/presets/water/spray.ts","../src/lib/behaviors/particle-emitter/presets/water/torrent.ts","../src/lib/behaviors/particle-emitter/presets/water/index.ts"],"sourcesContent":["import {\n\tAdditiveBlending,\n\tColor,\n\ttype Blending,\n\ttype ColorRepresentation,\n\ttype Texture,\n} from 'three';\n\nimport { Particles } from './gpu';\nimport type {\n\tColorStop as GpuColorStop,\n\tEaseFunction,\n\tEmitterSettings,\n\tParticleSettings,\n\tParticlesConfig,\n\tRenderSettings,\n} from './gpu';\n\n/**\n * Builds {@link ParticlesConfig} objects for the WebGPU/TSL particle engine\n * ({@link Particles}) from a high-level \"semantic\" description.\n *\n * This module previously targeted the CPU-simulated `three.quarks`\n * `ParticleSystem`. The authoring surface (semantic presets, magic modifiers,\n * option names) is preserved; the output now drives the GPU engine instead.\n *\n * ## three.quarks feature-parity notes\n *\n * The GPU engine simulates each particle from a small set of per-instance\n * values, so several three.quarks behaviors are approximated or unsupported:\n *\n * - `ColorOverLife` -> sampled gradient (`particles.colors`). Per-stop alpha is\n * collapsed into a single fade-in/fade-out window (`fadeAlpha`).\n * - `SizeOverLife` (bezier) -> fade-in/out window (`fadeSize`), approximated\n * from the curve's endpoints.\n * - `SpeedOverLife` (bezier) -> chooses an `easeFunction` (accelerate vs.\n * decelerate); the exact curve is not reproduced.\n * - `ForceOverLife` -> constant `gravity` (midpoint of the configured ranges).\n * - `RotationOverLife` -> per-particle `rotationSpeed`.\n * - Cone/Sphere emitters -> emission direction/position ranges approximating\n * the shape; not an exact volumetric match.\n * - `renderMode` -> only billboard is supported (sprites always face the\n * camera); stretched/mesh/trail modes are ignored.\n * - `Noise`, `OrbitOverLife`, sprite-sheet tiling, and trails -> not supported.\n */\n\n/** Subset of three.quarks `RenderMode` kept for preset-authoring compatibility. */\nexport enum RenderMode {\n\tBillBoard = 0,\n\tStretchedBillBoard = 1,\n\tHorizontalBillBoard = 2,\n\tVerticalBillBoard = 3,\n\tMesh = 4,\n\tTrail = 5,\n}\n\n/** A particle effect factory returning a fresh {@link Particles} object. */\nexport interface ParticleEffectDefinition {\n\tcreate(): Particles;\n}\n\nexport interface ParticlePresetMaterialOptions {\n\ttexture?: Texture;\n\topacity?: number;\n\tdepthWrite?: boolean;\n\talphaTest?: number;\n\tblending?: Blending;\n\tuTileCount?: number;\n\tvTileCount?: number;\n\tblendTiles?: boolean;\n}\n\nexport type NumericRange = number | readonly [number, number];\nexport type CurvePoints = readonly [number, number, number, number];\nexport type ColorStop = readonly [ColorRepresentation, number];\nexport type AlphaStop = readonly [number, number];\n\nexport interface ParticleColorOverLifeConfig {\n\tcolors: readonly ColorStop[];\n\talpha: readonly AlphaStop[];\n}\n\nexport interface ParticleForceOverLifeConfig {\n\tx?: NumericRange;\n\ty?: NumericRange;\n\tz?: NumericRange;\n}\n\nexport interface ParticleNoiseConfig {\n\tfrequency: NumericRange;\n\tpower: NumericRange;\n\tpositionAmount?: NumericRange;\n\trotationAmount?: NumericRange;\n}\n\nexport interface ParticleOrbitConfig {\n\tspeed: NumericRange;\n\taxis?: readonly [number, number, number];\n}\n\nexport interface ParticleBehaviorConfig {\n\tcolorOverLife?: ParticleColorOverLifeConfig;\n\tsizeOverLife?: CurvePoints;\n\tspeedOverLife?: CurvePoints;\n\trotationOverLife?: NumericRange;\n\tforceOverLife?: ParticleForceOverLifeConfig;\n\tnoise?: ParticleNoiseConfig;\n\torbitOverLife?: ParticleOrbitConfig;\n}\n\nexport interface ParticleBehaviorOverrides {\n\tcolorOverLife?: ParticleColorOverLifeConfig | null;\n\tsizeOverLife?: CurvePoints | null;\n\tspeedOverLife?: CurvePoints | null;\n\trotationOverLife?: NumericRange | null;\n\tforceOverLife?: Partial<ParticleForceOverLifeConfig> | null;\n\tnoise?: Partial<ParticleNoiseConfig> | null;\n\torbitOverLife?: Partial<ParticleOrbitConfig> | null;\n}\n\nexport type ParticleShapeConfig =\n\t| { type: 'point' }\n\t| {\n\t\t\ttype: 'cone';\n\t\t\tradius?: number;\n\t\t\tthickness?: number;\n\t\t\tangle?: number;\n\t\t\tspeed?: NumericRange;\n\t }\n\t| {\n\t\t\ttype: 'sphere';\n\t\t\tradius?: number;\n\t\t\tthickness?: number;\n\t\t\tspeed?: NumericRange;\n\t };\n\ntype ParticleEmissionConfig =\n\t| {\n\t\t\ttype: 'burst';\n\t\t\tcount: number;\n\t }\n\t| {\n\t\t\ttype: 'rate';\n\t\t\trate: number;\n\t };\n\ninterface SemanticParticleSystemConfig {\n\tdefaults: {\n\t\tduration: number;\n\t\tlooping?: boolean;\n\t\tworldSpace?: boolean;\n\t\tcolor: ColorRepresentation;\n\t\tlife: NumericRange;\n\t\tsize: NumericRange;\n\t\tspeed: NumericRange;\n\t\trotation?: NumericRange;\n\t\topacity?: number;\n\t\trenderMode?: RenderMode;\n\t};\n\temission: ParticleEmissionConfig;\n\tshape?: ParticleShapeConfig;\n\tbehaviors?: ParticleBehaviorConfig;\n\t/** Reserved for renderer-specific hints; ignored by the GPU engine. */\n\trendererEmitterSettings?: Record<string, unknown>;\n}\n\nexport interface SemanticParticlePresetDefinition<\n\tFamily extends string = string,\n\tVariant extends string = string,\n> {\n\tfamily: Family;\n\tvariant: Variant;\n\tdescription: string;\n\taxes: Readonly<Record<string, string>>;\n\tsystem: SemanticParticleSystemConfig;\n}\n\nexport type ParticleMagicAlignment =\n\t| 'arcane'\n\t| 'holy'\n\t| 'corrupted'\n\t| 'nature'\n\t| 'void'\n\t| 'psychic';\n\nexport type ParticleMagicTemperament =\n\t| 'calm'\n\t| 'ominous'\n\t| 'playful'\n\t| 'regal'\n\t| 'predatory';\n\nexport type ParticleMagicAgency =\n\t| 'passive'\n\t| 'reactive'\n\t| 'seeking'\n\t| 'sentient-feeling';\n\nexport type ParticleMagicOrder = 'geometric' | 'organic' | 'chaotic';\n\nexport type ParticleMagicRealityEffect =\n\t| 'warping'\n\t| 'illuminating'\n\t| 'binding'\n\t| 'decaying'\n\t| 'healing';\n\nexport interface ParticleMagicModifierOptions {\n\talignment: ParticleMagicAlignment;\n\ttemperament?: ParticleMagicTemperament;\n\tagency?: ParticleMagicAgency;\n\torder?: ParticleMagicOrder;\n\trealityEffect?: ParticleMagicRealityEffect;\n\tintensity?: number;\n}\n\nexport type ParticleMagicModifierInput =\n\t| ParticleMagicAlignment\n\t| ParticleMagicModifierOptions;\n\nexport interface SemanticParticlePresetOptions\n\textends ParticlePresetMaterialOptions {\n\tbehaviors?: ParticleBehaviorOverrides;\n\tcolor?: ColorRepresentation;\n\tcount?: number;\n\tduration?: number;\n\temissionRate?: number;\n\tlife?: NumericRange;\n\tlooping?: boolean;\n\tmagic?: ParticleMagicModifierInput;\n\trenderMode?: RenderMode;\n\trendererEmitterSettings?: Record<string, unknown>;\n\trotation?: NumericRange;\n\tshape?: ParticleShapeConfig;\n\tsize?: NumericRange;\n\tspeed?: NumericRange;\n\tworldSpace?: boolean;\n}\n\ninterface MagicPalette {\n\tstart: ColorRepresentation;\n\tmid: ColorRepresentation;\n\tend: ColorRepresentation;\n}\n\nconst DEFAULT_MAGIC_BEHAVIOR_BY_ALIGNMENT: Record<\n\tParticleMagicAlignment,\n\tOmit<ParticleMagicModifierOptions, 'alignment'>\n> = {\n\tarcane: {\n\t\ttemperament: 'regal',\n\t\tagency: 'reactive',\n\t\torder: 'geometric',\n\t\trealityEffect: 'warping',\n\t\tintensity: 1,\n\t},\n\tholy: {\n\t\ttemperament: 'calm',\n\t\tagency: 'passive',\n\t\torder: 'geometric',\n\t\trealityEffect: 'illuminating',\n\t\tintensity: 1,\n\t},\n\tcorrupted: {\n\t\ttemperament: 'ominous',\n\t\tagency: 'seeking',\n\t\torder: 'chaotic',\n\t\trealityEffect: 'decaying',\n\t\tintensity: 1.05,\n\t},\n\tnature: {\n\t\ttemperament: 'calm',\n\t\tagency: 'reactive',\n\t\torder: 'organic',\n\t\trealityEffect: 'healing',\n\t\tintensity: 0.9,\n\t},\n\tvoid: {\n\t\ttemperament: 'ominous',\n\t\tagency: 'seeking',\n\t\torder: 'chaotic',\n\t\trealityEffect: 'warping',\n\t\tintensity: 1.15,\n\t},\n\tpsychic: {\n\t\ttemperament: 'predatory',\n\t\tagency: 'sentient-feeling',\n\t\torder: 'organic',\n\t\trealityEffect: 'binding',\n\t\tintensity: 1,\n\t},\n};\n\nconst MAGIC_PALETTES: Record<ParticleMagicAlignment, MagicPalette> = {\n\tarcane: { start: '#dbeafe', mid: '#60a5fa', end: '#1d4ed8' },\n\tholy: { start: '#fff7d1', mid: '#fde68a', end: '#f59e0b' },\n\tcorrupted: { start: '#bef264', mid: '#84cc16', end: '#4d7c0f' },\n\tnature: { start: '#dcfce7', mid: '#4ade80', end: '#15803d' },\n\tvoid: { start: '#c4b5fd', mid: '#475569', end: '#0f172a' },\n\tpsychic: { start: '#fce7f3', mid: '#f472b6', end: '#db2777' },\n};\n\nexport function particleEffect(create: () => Particles): ParticleEffectDefinition {\n\treturn { create };\n}\n\nexport function defineSemanticParticlePreset<\n\tT extends SemanticParticlePresetDefinition,\n>(preset: T): T {\n\treturn preset;\n}\n\nexport function createMagicModifier(\n\talignment: ParticleMagicAlignment,\n\toverrides: Omit<ParticleMagicModifierOptions, 'alignment'> = {},\n): ParticleMagicModifierOptions {\n\treturn {\n\t\talignment,\n\t\t...DEFAULT_MAGIC_BEHAVIOR_BY_ALIGNMENT[alignment],\n\t\t...overrides,\n\t};\n}\n\n/**\n * Builds a {@link ParticlesConfig} from a semantic preset and per-call options,\n * then wraps it in a {@link ParticleEffectDefinition} factory.\n */\nexport function createSemanticParticleEffect(\n\tpreset: SemanticParticlePresetDefinition,\n\toptions: SemanticParticlePresetOptions = {},\n): ParticleEffectDefinition {\n\tconst config = buildParticlesConfig(preset, options);\n\treturn particleEffect(() => new Particles(config));\n}\n\nexport function buildParticlesConfig(\n\tpreset: SemanticParticlePresetDefinition,\n\toptions: SemanticParticlePresetOptions = {},\n): ParticlesConfig {\n\tconst defaults = preset.system.defaults;\n\tconst magic = normalizeMagicModifier(options.magic);\n\tconst resolvedShape = mergeShapeConfig(preset.system.shape, options.shape);\n\tconst baseBehaviors = mergeBehaviorConfig(preset.system.behaviors, options.behaviors);\n\n\tconst baseColor = options.color ?? defaults.color;\n\tconst resolvedColor = magic\n\t\t? mixColors(baseColor, MAGIC_PALETTES[magic.alignment].start, 0.2)\n\t\t: baseColor;\n\tconst behaviors = magic\n\t\t? applyMagicBehaviors(baseBehaviors, resolvedColor, magic)\n\t\t: baseBehaviors;\n\n\tconst duration = options.duration ?? defaults.duration;\n\tconst looping =\n\t\toptions.looping ?? defaults.looping ?? preset.system.emission.type === 'rate';\n\tconst life = toRange(options.life ?? defaults.life);\n\tconst size = toRange(options.size ?? defaults.size);\n\tconst baseSpeed = toRange(options.speed ?? defaults.speed);\n\tconst shapeSpeed = resolvedShape && 'speed' in resolvedShape ? resolvedShape.speed : undefined;\n\tconst speed = shapeSpeed !== undefined ? toRange(addRanges(baseSpeed, shapeSpeed)!) : baseSpeed;\n\n\tconst intensity = magic ? clamp(magic.intensity ?? 1, 0.5, 1.5) : (defaults.opacity ?? 1);\n\n\tconst colors = behaviors?.colorOverLife\n\t\t? [behaviors.colorOverLife.colors.map(([color, stop]) => toGpuColorStop(color, stop))]\n\t\t: [\n\t\t\t\t[\n\t\t\t\t\t{ color: toHexColor(resolvedColor), stop: 0 },\n\t\t\t\t\t{ color: toHexColor(resolvedColor), stop: 1 },\n\t\t\t\t],\n\t\t\t];\n\n\tconst fadeAlpha = behaviors?.colorOverLife\n\t\t? deriveFadeFromAlpha(behaviors.colorOverLife.alpha)\n\t\t: [0.1, 0.85];\n\tconst fadeSize = behaviors?.sizeOverLife\n\t\t? deriveFadeFromSizeCurve(behaviors.sizeOverLife)\n\t\t: [0.15, 0.9];\n\tconst gravity = behaviors?.forceOverLife\n\t\t? forceToGravity(behaviors.forceOverLife)\n\t\t: [0, 0, 0];\n\tconst easeFunction = behaviors?.speedOverLife\n\t\t? speedCurveToEase(behaviors.speedOverLife)\n\t\t: 'easeLinear';\n\n\tconst emission = resolveEmission(preset.system.emission, options, duration, life[1]);\n\tconst direction = shapeToDirection(resolvedShape);\n\tconst startPosition = shapeToStartPosition(resolvedShape);\n\tconst startRotation = rotationToStart(options.rotation ?? defaults.rotation);\n\tconst rotationSpeed = behaviors?.rotationOverLife\n\t\t? rangeToRotationSpeedZ(behaviors.rotationOverLife)\n\t\t: { min: [0, 0, 0] as Vec3, max: [0, 0, 0] as Vec3 };\n\n\tconst blending = (options.blending ?? AdditiveBlending) as RenderSettings['blendingMode'];\n\n\tconst particles: Partial<ParticleSettings> & Pick<ParticleSettings, 'count'> = {\n\t\tcount: emission.count,\n\t\tintensity,\n\t\tfadeSize: fadeSize as [number, number],\n\t\tfadeAlpha: fadeAlpha as [number, number],\n\t\tgravity: gravity as Vec3,\n\t\tcolors,\n\t\teaseFunction,\n\t};\n\tif (options.texture) {\n\t\tparticles.alphaMapsStart = [options.texture] as unknown as ParticleSettings['alphaMapsStart'];\n\t}\n\n\tconst emitter: Partial<EmitterSettings> = {\n\t\tduration,\n\t\trate: emission.rate,\n\t\tspawnMode: emission.spawnMode,\n\t\tloop: looping,\n\t\tstatic: 0,\n\t\tworldUpRight: false,\n\t\tlifetime: life as [number, number],\n\t\tspeed: speed as [number, number],\n\t\tsize: size as [number, number],\n\t\tdirectionMin: direction.min,\n\t\tdirectionMax: direction.max,\n\t\tstartPositionMin: startPosition.min,\n\t\tstartPositionMax: startPosition.max,\n\t\tstartRotationMin: startRotation.min,\n\t\tstartRotationMax: startRotation.max,\n\t\trotationSpeedMin: rotationSpeed.min,\n\t\trotationSpeedMax: rotationSpeed.max,\n\t};\n\n\treturn {\n\t\tparticles,\n\t\temitter,\n\t\trender: { blendingMode: blending },\n\t};\n}\n\ntype Vec3 = [number, number, number];\n\ninterface EmissionResult {\n\tspawnMode: 'time' | 'burst';\n\trate: number;\n\tcount: number;\n}\n\nfunction resolveEmission(\n\temission: ParticleEmissionConfig,\n\toptions: SemanticParticlePresetOptions,\n\tduration: number,\n\tmaxLifetime: number,\n): EmissionResult {\n\tif (emission.type === 'burst') {\n\t\tconst count = Math.max(1, Math.round(options.count ?? emission.count));\n\t\treturn { spawnMode: 'burst', rate: count, count };\n\t}\n\n\tconst perSecond = Math.max(0, options.emissionRate ?? emission.rate);\n\tconst rate = Math.max(1, Math.round(perSecond * Math.max(duration, 0.0001)));\n\tconst simultaneous = Math.ceil(perSecond * Math.max(maxLifetime, 0.0001) * 1.5);\n\tconst count = Math.min(200000, Math.max(rate, simultaneous, 8));\n\treturn { spawnMode: 'time', rate, count };\n}\n\nfunction deriveFadeFromAlpha(alpha: readonly AlphaStop[]): [number, number] {\n\tif (!alpha || alpha.length === 0) return [0.1, 0.85];\n\tconst sorted = [...alpha].sort((a, b) => a[1] - b[1]);\n\tconst maxAlpha = Math.max(...sorted.map(([value]) => value), 0.0001);\n\n\tlet fadeIn = 0.15;\n\tfor (const [value, stop] of sorted) {\n\t\tif (value >= maxAlpha * 0.6) {\n\t\t\tfadeIn = stop;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tlet fadeOut = 0.85;\n\tfor (const [value, stop] of sorted) {\n\t\tif (value >= maxAlpha * 0.4) fadeOut = stop;\n\t}\n\n\tfadeIn = clamp(fadeIn, 0.02, 0.45);\n\tfadeOut = clamp(fadeOut, 0.55, 0.99);\n\tif (fadeOut <= fadeIn) fadeOut = Math.min(0.99, fadeIn + 0.3);\n\treturn [fadeIn, fadeOut];\n}\n\nfunction deriveFadeFromSizeCurve(points: CurvePoints): [number, number] {\n\tconst start = points[0];\n\tconst end = points[3];\n\tconst fadeIn = start < 0.5 ? 0.25 : 0.02;\n\tconst fadeOut = end < 0.5 ? 0.75 : 0.98;\n\treturn [fadeIn, fadeOut];\n}\n\nfunction forceToGravity(force: ParticleForceOverLifeConfig): Vec3 {\n\tconst mid = (range: NumericRange | undefined): number => {\n\t\tif (range === undefined) return 0;\n\t\tconst [min, max] = toRange(range);\n\t\treturn (min + max) * 0.5;\n\t};\n\treturn [mid(force.x), mid(force.y), mid(force.z)];\n}\n\nfunction speedCurveToEase(points: CurvePoints): EaseFunction {\n\tconst start = points[0];\n\tconst end = points[3];\n\tif (end < start - 0.05) return 'easeOutCubic';\n\tif (end > start + 0.05) return 'easeInCubic';\n\treturn 'easeLinear';\n}\n\nfunction shapeToDirection(shape: ParticleShapeConfig | undefined): { min: Vec3; max: Vec3 } {\n\tif (!shape || shape.type === 'point' || shape.type === 'sphere') {\n\t\treturn { min: [-1, -1, -1], max: [1, 1, 1] };\n\t}\n\tconst angle = shape.angle ?? 0.3;\n\tconst spread = Math.tan(clamp(angle, 0, 1.4));\n\treturn { min: [-spread, 1, -spread], max: [spread, 1, spread] };\n}\n\nfunction shapeToStartPosition(shape: ParticleShapeConfig | undefined): { min: Vec3; max: Vec3 } {\n\tif (!shape || shape.type === 'point') {\n\t\treturn { min: [0, 0, 0], max: [0, 0, 0] };\n\t}\n\tconst r = shape.radius ?? 0;\n\tif (shape.type === 'sphere') {\n\t\treturn { min: [-r, -r, -r], max: [r, r, r] };\n\t}\n\treturn { min: [-r, 0, -r], max: [r, 0, r] };\n}\n\nfunction rotationToStart(rotation: NumericRange | undefined): { min: Vec3; max: Vec3 } {\n\tif (rotation === undefined) {\n\t\treturn { min: [0, 0, 0], max: [0, 0, 0] };\n\t}\n\tconst [min, max] = toRange(rotation);\n\tconst norm = (theta: number) => theta / Math.PI - 1;\n\treturn { min: [0, 0, norm(min)], max: [0, 0, norm(max)] };\n}\n\nfunction rangeToRotationSpeedZ(rotation: NumericRange): { min: Vec3; max: Vec3 } {\n\tconst [min, max] = toRange(rotation);\n\treturn { min: [0, 0, min], max: [0, 0, max] };\n}\n\nfunction toGpuColorStop(color: ColorRepresentation, stop: number): GpuColorStop {\n\treturn { color: toHexColor(color), stop };\n}\n\nfunction normalizeMagicModifier(\n\tinput?: ParticleMagicModifierInput,\n): ParticleMagicModifierOptions | null {\n\tif (!input) return null;\n\tif (typeof input === 'string') return createMagicModifier(input);\n\treturn createMagicModifier(input.alignment, input);\n}\n\nfunction applyMagicBehaviors(\n\tbase: ParticleBehaviorConfig | undefined,\n\tbaseColor: ColorRepresentation,\n\tmagic: ParticleMagicModifierOptions,\n): ParticleBehaviorConfig {\n\tconst intensity = clamp(magic.intensity ?? 1, 0.25, 1.5);\n\tconst palette = MAGIC_PALETTES[magic.alignment];\n\n\treturn {\n\t\t...base,\n\t\tcolorOverLife: tintColorOverLife(base?.colorOverLife, baseColor, palette, intensity),\n\t\trotationOverLife: addRanges(base?.rotationOverLife, resolveMagicRotation(magic, intensity)),\n\t\tforceOverLife: mergeForce(base?.forceOverLife, resolveMagicForce(magic, intensity)),\n\t\tnoise: mergeNoise(base?.noise, resolveMagicNoise(magic, intensity)),\n\t\torbitOverLife: resolveMagicOrbit(magic, intensity) ?? base?.orbitOverLife,\n\t};\n}\n\nfunction resolveMagicRotation(\n\tmagic: ParticleMagicModifierOptions,\n\tintensity: number,\n): NumericRange | undefined {\n\tconst amount = 0.7 + intensity * 1.4;\n\n\tswitch (magic.order) {\n\t\tcase 'geometric':\n\t\t\treturn [amount * 0.45, amount];\n\t\tcase 'organic':\n\t\t\treturn [-amount * 0.55, amount * 0.55];\n\t\tcase 'chaotic':\n\t\t\treturn [-amount * 2.4, amount * 2.4];\n\t\tdefault:\n\t\t\treturn undefined;\n\t}\n}\n\nfunction resolveMagicForce(\n\tmagic: ParticleMagicModifierOptions,\n\tintensity: number,\n): ParticleForceOverLifeConfig | undefined {\n\tconst amount = 0.2 + intensity * 0.55;\n\n\tswitch (magic.realityEffect) {\n\t\tcase 'illuminating':\n\t\tcase 'healing':\n\t\t\treturn { y: [amount * 0.6, amount] };\n\t\tcase 'decaying':\n\t\t\treturn { y: [-amount, -amount * 0.5] };\n\t\tcase 'binding':\n\t\t\treturn { y: [-amount * 0.35, amount * 0.15] };\n\t\tcase 'warping':\n\t\t\treturn { x: [-amount * 0.35, amount * 0.35], z: [-amount * 0.35, amount * 0.35] };\n\t\tdefault:\n\t\t\treturn undefined;\n\t}\n}\n\nfunction resolveMagicNoise(\n\tmagic: ParticleMagicModifierOptions,\n\tintensity: number,\n): ParticleNoiseConfig {\n\tconst calmMultiplier = magic.temperament === 'calm' ? 0.6 : 1;\n\tconst ominousBoost = magic.temperament === 'ominous' ? 1.25 : 1;\n\tconst basePower = (0.08 + intensity * 0.1) * calmMultiplier * ominousBoost;\n\n\tswitch (magic.order) {\n\t\tcase 'geometric':\n\t\t\treturn {\n\t\t\t\tfrequency: [1.5, 3.5],\n\t\t\t\tpower: [basePower * 0.4, basePower * 0.8],\n\t\t\t\tpositionAmount: [0.08, 0.2],\n\t\t\t\trotationAmount: [0.1, 0.2],\n\t\t\t};\n\t\tcase 'organic':\n\t\t\treturn {\n\t\t\t\tfrequency: [2.5, 5.5],\n\t\t\t\tpower: [basePower * 0.7, basePower * 1.2],\n\t\t\t\tpositionAmount: [0.12, 0.3],\n\t\t\t\trotationAmount: [0.14, 0.26],\n\t\t\t};\n\t\tcase 'chaotic':\n\t\tdefault:\n\t\t\treturn {\n\t\t\t\tfrequency: [4, 8],\n\t\t\t\tpower: [basePower, basePower * 1.7],\n\t\t\t\tpositionAmount: [0.18, 0.38],\n\t\t\t\trotationAmount: [0.18, 0.34],\n\t\t\t};\n\t}\n}\n\nfunction resolveMagicOrbit(\n\tmagic: ParticleMagicModifierOptions,\n\tintensity: number,\n): ParticleOrbitConfig | undefined {\n\tif (magic.order === 'geometric') {\n\t\treturn { speed: [3 + intensity * 2, 6 + intensity * 3], axis: [0, 1, 0] };\n\t}\n\tif (magic.agency === 'sentient-feeling') {\n\t\treturn { speed: [1 + intensity, 2.5 + intensity * 1.2], axis: [0, 1, 0] };\n\t}\n\treturn undefined;\n}\n\nfunction tintColorOverLife(\n\tbase: ParticleColorOverLifeConfig | undefined,\n\tbaseColor: ColorRepresentation,\n\tpalette: MagicPalette,\n\tintensity: number,\n): ParticleColorOverLifeConfig {\n\tif (!base) {\n\t\treturn {\n\t\t\tcolors: [\n\t\t\t\t[mixColors(baseColor, palette.start, 0.25), 0],\n\t\t\t\t[mixColors(baseColor, palette.mid, 0.55), 0.45],\n\t\t\t\t[mixColors(baseColor, palette.end, 0.75), 1],\n\t\t\t],\n\t\t\talpha: [\n\t\t\t\t[0.22, 0],\n\t\t\t\t[1, 0.12],\n\t\t\t\t[0.52 + intensity * 0.08, 0.64],\n\t\t\t\t[0, 1],\n\t\t\t],\n\t\t};\n\t}\n\n\treturn {\n\t\tcolors: base.colors.map(([color, stop], index) => {\n\t\t\tconst target =\n\t\t\t\tindex === 0\n\t\t\t\t\t? palette.start\n\t\t\t\t\t: index === base.colors.length - 1\n\t\t\t\t\t\t? palette.end\n\t\t\t\t\t\t: palette.mid;\n\t\t\tconst amount = index === 0 ? 0.18 : 0.3 + intensity * 0.15;\n\t\t\treturn [mixColors(color, target, amount), stop] as const;\n\t\t}),\n\t\talpha: base.alpha,\n\t};\n}\n\nfunction mergeNoise(\n\tbase: ParticleNoiseConfig | undefined,\n\toverlay: ParticleNoiseConfig | undefined,\n): ParticleNoiseConfig | undefined {\n\tif (!base) return overlay;\n\tif (!overlay) return base;\n\treturn {\n\t\tfrequency: addRanges(base.frequency, overlay.frequency) ?? base.frequency,\n\t\tpower: addRanges(base.power, overlay.power) ?? base.power,\n\t\tpositionAmount: addRanges(base.positionAmount, overlay.positionAmount),\n\t\trotationAmount: addRanges(base.rotationAmount, overlay.rotationAmount),\n\t};\n}\n\nfunction mergeForce(\n\tbase: ParticleForceOverLifeConfig | undefined,\n\toverlay: ParticleForceOverLifeConfig | undefined,\n): ParticleForceOverLifeConfig | undefined {\n\tif (!base) return overlay;\n\tif (!overlay) return base;\n\treturn {\n\t\tx: addRanges(base.x, overlay.x),\n\t\ty: addRanges(base.y, overlay.y),\n\t\tz: addRanges(base.z, overlay.z),\n\t};\n}\n\nfunction mergeBehaviorConfig(\n\tbase: ParticleBehaviorConfig | undefined,\n\toverrides: ParticleBehaviorOverrides | undefined,\n): ParticleBehaviorConfig | undefined {\n\tif (!base && !overrides) return undefined;\n\n\tconst merged: ParticleBehaviorConfig = {};\n\n\tassignIfDefined(merged, 'colorOverLife', resolveOverrideValue(base?.colorOverLife, overrides?.colorOverLife));\n\tassignIfDefined(merged, 'sizeOverLife', resolveOverrideValue(base?.sizeOverLife, overrides?.sizeOverLife));\n\tassignIfDefined(merged, 'speedOverLife', resolveOverrideValue(base?.speedOverLife, overrides?.speedOverLife));\n\tassignIfDefined(merged, 'rotationOverLife', resolveOverrideValue(base?.rotationOverLife, overrides?.rotationOverLife));\n\tassignIfDefined(merged, 'forceOverLife', resolvePartialOverride(base?.forceOverLife, overrides?.forceOverLife));\n\tassignIfDefined(merged, 'noise', resolveNoiseOverride(base?.noise, overrides?.noise));\n\tassignIfDefined(merged, 'orbitOverLife', resolveOrbitOverride(base?.orbitOverLife, overrides?.orbitOverLife));\n\n\treturn Object.keys(merged).length > 0 ? merged : undefined;\n}\n\nfunction mergeShapeConfig(\n\tbase: ParticleShapeConfig | undefined,\n\toverride: ParticleShapeConfig | undefined,\n): ParticleShapeConfig | undefined {\n\tif (!override) return base;\n\tif (!base || override.type !== base.type) return override;\n\tif (override.type === 'point') return override;\n\tif (override.type === 'cone' && base.type === 'cone') return { ...base, ...override };\n\tif (override.type === 'sphere' && base.type === 'sphere') return { ...base, ...override };\n\treturn override;\n}\n\nfunction addRanges(\n\tbase: NumericRange | undefined,\n\toverlay: NumericRange | undefined,\n): NumericRange | undefined {\n\tif (base === undefined) return overlay;\n\tif (overlay === undefined) return base;\n\tconst [baseMin, baseMax] = toRange(base);\n\tconst [overlayMin, overlayMax] = toRange(overlay);\n\treturn [baseMin + overlayMin, baseMax + overlayMax];\n}\n\nfunction resolveOverrideValue<T>(\n\tbase: T | undefined,\n\toverride: T | null | undefined,\n): T | undefined {\n\tif (override === null) return undefined;\n\treturn override ?? base;\n}\n\nfunction resolvePartialOverride<T extends object>(\n\tbase: T | undefined,\n\toverride: Partial<T> | null | undefined,\n): T | undefined {\n\tif (override === null) return undefined;\n\tif (!override) return base;\n\tconst resolved = { ...base, ...override };\n\treturn Object.keys(resolved).length > 0 ? (resolved as T) : undefined;\n}\n\nfunction resolveNoiseOverride(\n\tbase: ParticleNoiseConfig | undefined,\n\toverride: Partial<ParticleNoiseConfig> | null | undefined,\n): ParticleNoiseConfig | undefined {\n\tif (override === null) return undefined;\n\tif (!override) return base;\n\tconst frequency = override.frequency ?? base?.frequency;\n\tconst power = override.power ?? base?.power;\n\tif (frequency === undefined || power === undefined) return undefined;\n\treturn { ...base, ...override, frequency, power };\n}\n\nfunction resolveOrbitOverride(\n\tbase: ParticleOrbitConfig | undefined,\n\toverride: Partial<ParticleOrbitConfig> | null | undefined,\n): ParticleOrbitConfig | undefined {\n\tif (override === null) return undefined;\n\tif (!override) return base;\n\tconst speed = override.speed ?? base?.speed;\n\tif (speed === undefined) return undefined;\n\treturn { ...base, ...override, speed };\n}\n\nfunction assignIfDefined<T extends object, K extends keyof T>(\n\ttarget: T,\n\tkey: K,\n\tvalue: T[K] | undefined,\n) {\n\tif (value !== undefined) target[key] = value;\n}\n\nfunction toHexColor(color: ColorRepresentation): string {\n\treturn `#${new Color(color).getHexString()}`;\n}\n\nfunction toRange(value: NumericRange): readonly [number, number] {\n\tif (Array.isArray(value)) {\n\t\treturn [value[0] ?? 0, value[1] ?? value[0] ?? 0];\n\t}\n\treturn [value as number, value as number];\n}\n\nfunction mixColors(\n\tbase: ColorRepresentation,\n\toverlay: ColorRepresentation,\n\tamount: number,\n): string {\n\tconst color = new Color(base);\n\tcolor.lerp(new Color(overlay), clamp(amount, 0, 1));\n\treturn `#${color.getHexString()}`;\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n\treturn Math.min(Math.max(value, min), max);\n}\n","/**\n * WebGPU-accelerated particle system using Three.js TSL.\n *\n * Ported/adapted from the `threeparticles` project (MIT). The per-particle\n * simulation (position/rotation/scale/color over life) runs in the node\n * material on the GPU; emission is done on the CPU in `update(delta)`. No\n * renderer/compute access is required, so it ticks from the behavior system\n * exactly like the previous three.quarks `BatchedRenderer` node did.\n *\n * @module\n */\n// @ts-nocheck - TSL types are incompatible with TypeScript\nimport * as THREE from 'three/webgpu';\nimport { texture, uniform, instancedArray } from 'three/tsl';\nimport type { EmitterSettings, ParticlesConfig, ParticleSettings, RenderSettings } from './types';\nimport { EASE_FUNCTIONS } from './types';\nimport { createTextureAtlas, createColorGradientTexture } from './textures';\nimport { createParticleMaterialTemplate } from './nodes';\nimport { randFloat, randInt } from './utils';\n\ninterface ResolvedConfig {\n\tparticles: ParticleSettings;\n\trender: RenderSettings;\n\temitter: EmitterSettings;\n}\n\nexport class Particles extends THREE.Object3D {\n\tprivate mesh: THREE.InstancedMesh;\n\t/** Base object for positioning the emitter. */\n\tpublic base: THREE.Object3D;\n\tprivate debugMesh: THREE.Mesh;\n\tprivate material: THREE.NodeMaterial;\n\tprivate config: ResolvedConfig;\n\n\tprivate uniforms: Record<string, unknown>;\n\tprivate buffers: Record<string, Float32Array>;\n\tprivate attributes: Record<string, unknown>;\n\n\tprivate easingIndex = 0;\n\tprivate alphaMapCount = 0;\n\tprivate emitted = 0;\n\tprivate cursor = 0;\n\t/** Whether the particle system is currently running. */\n\tpublic running = false;\n\n\tconstructor(config: ParticlesConfig, geometry?: THREE.BufferGeometry) {\n\t\tsuper();\n\n\t\tthis.name = 'Particles';\n\t\tthis.type = 'Particles';\n\n\t\tthis.base = new THREE.Object3D();\n\t\tthis.base.name = 'Base';\n\t\tthis.add(this.base);\n\n\t\t// Debug Mesh\n\t\tthis.debugMesh = new THREE.Mesh(\n\t\t\tnew THREE.BoxGeometry(0.2, 0.2, 0.2),\n\t\t\tnew THREE.MeshBasicMaterial({ color: 0xffffff, wireframe: true }),\n\t\t);\n\t\tthis.debugMesh.name = 'Debug';\n\t\tthis.base.add(this.debugMesh);\n\n\t\tconst p = config.particles;\n\t\tconst r = config.render ?? {};\n\t\tconst e = config.emitter ?? {};\n\n\t\tthis.config = {\n\t\t\tparticles: {\n\t\t\t\tcount: p.count ?? 1000,\n\t\t\t\tintensity: p.intensity ?? 1,\n\t\t\t\tfadeSize: p.fadeSize ?? [0.1, 0.9],\n\t\t\t\tfadeAlpha: p.fadeAlpha ?? [0.0, 1.0],\n\t\t\t\tfadeAlphaMap: p.fadeAlphaMap ?? [0.0, 1.0],\n\t\t\t\tgravity: p.gravity ?? [0, 0, 0],\n\t\t\t\talphaMapsStart: p.alphaMapsStart ?? [],\n\t\t\t\talphaMapsEnd: p.alphaMapsEnd ?? [],\n\t\t\t\tcolors: p.colors ?? [[{ color: '#ffffff', stop: 0 }]],\n\t\t\t\tappearance: p.appearance ?? 0,\n\t\t\t\teaseFunction: p.easeFunction ?? 'easeLinear',\n\t\t\t},\n\t\t\trender: {\n\t\t\t\talphaMapSize: r.alphaMapSize ?? 256,\n\t\t\t\talphaMapFilter: r.alphaMapFilter ?? THREE.LinearFilter,\n\t\t\t\tfrustumCulled: r.frustumCulled ?? true,\n\t\t\t\tblendingMode: r.blendingMode ?? THREE.AdditiveBlending,\n\t\t\t\tside: r.side ?? THREE.FrontSide,\n\t\t\t\tdepthTest: r.depthTest ?? true,\n\t\t\t},\n\t\t\temitter: {\n\t\t\t\tduration: e.duration ?? 1,\n\t\t\t\trate: e.rate ?? 1000,\n\t\t\t\tspawnMode: e.spawnMode ?? 'time',\n\t\t\t\tstatic: e.static ?? 0.0,\n\t\t\t\tworldUpRight: e.worldUpRight ?? false,\n\t\t\t\tloop: e.loop ?? false,\n\t\t\t\tdelay: e.delay ?? 0,\n\t\t\t\tdebug: e.debug ?? false,\n\t\t\t\tlifetime: e.lifetime ?? [0.1, 1],\n\t\t\t\tspeed: e.speed ?? [5, 20],\n\t\t\t\tsize: e.size ?? [0.1, 1],\n\t\t\t\tstartPositionMin: e.startPositionMin ?? [0, 0, 0],\n\t\t\t\tstartPositionMax: e.startPositionMax ?? [0, 0, 0],\n\t\t\t\tstartRotationMin: e.startRotationMin ?? [0, 0, 0],\n\t\t\t\tstartRotationMax: e.startRotationMax ?? [0, 0, 0],\n\t\t\t\trotationSpeedMin: e.rotationSpeedMin ?? [0, 0, 0],\n\t\t\t\trotationSpeedMax: e.rotationSpeedMax ?? [0, 0, 0],\n\t\t\t\tdirectionMin: e.directionMin ?? [0, 0, 0],\n\t\t\t\tdirectionMax: e.directionMax ?? [0, 0, 0],\n\t\t\t},\n\t\t};\n\n\t\tthis.debugMesh.visible = this.config.emitter.debug;\n\t\tthis.easingIndex = EASE_FUNCTIONS.indexOf(this.config.particles.easeFunction);\n\t\tif (this.easingIndex < 0) this.easingIndex = 0;\n\n\t\tconst alphaMaps = [\n\t\t\t...(this.config.particles.alphaMapsStart ?? []),\n\t\t\t...(this.config.particles.alphaMapsEnd ?? []),\n\t\t];\n\t\tthis.alphaMapCount = alphaMaps.length;\n\n\t\tlet atlas: THREE.Texture | null = null;\n\t\tif (alphaMaps.length > 0) {\n\t\t\tatlas = createTextureAtlas(\n\t\t\t\talphaMaps,\n\t\t\t\tundefined,\n\t\t\t\tthis.config.render.alphaMapSize,\n\t\t\t\tthis.config.render.alphaMapFilter,\n\t\t\t);\n\t\t} else {\n\t\t\tconst canvas = document.createElement('canvas');\n\t\t\tatlas = new THREE.CanvasTexture(canvas);\n\t\t}\n\n\t\tconst colorGradientTexture = createColorGradientTexture(this.config.particles.colors, 128);\n\n\t\tthis.uniforms = {\n\t\t\tcursor: uniform(0),\n\t\t\trate: uniform(0),\n\t\t\tuTime: uniform(0),\n\t\t\tuPosition: uniform(this.base.position),\n\t\t\talphaMap: texture(atlas),\n\t\t\tuColorGradient: texture(colorGradientTexture),\n\t\t};\n\n\t\tconst defaultGeometry = geometry ?? new THREE.PlaneGeometry(0.5, 0.5);\n\t\tconst count = this.config.particles.count;\n\n\t\tthis.buffers = {\n\t\t\tinstanceLifetime: new Float32Array(count * 2),\n\t\t\tinstance: new Float32Array(count * 7),\n\t\t\tinstanceDirection: new Float32Array(count * 3),\n\t\t\tinstanceRotationSpeed: new Float32Array(count * 3),\n\t\t\tinstanceAlphaMapUVOffset: new Float32Array(count * 2),\n\t\t\tinstanceSpeed: new Float32Array(count),\n\t\t};\n\n\t\tthis.attributes = {\n\t\t\tinstanceLifetime: instancedArray(this.buffers.instanceLifetime, 'float'),\n\t\t\tinstance: instancedArray(this.buffers.instance, 'float'),\n\t\t\tinstanceDirection: instancedArray(this.buffers.instanceDirection, 'float'),\n\t\t\tinstanceRotationSpeed: instancedArray(this.buffers.instanceRotationSpeed, 'float'),\n\t\t\tinstanceAlphaMapUVOffset: instancedArray(this.buffers.instanceAlphaMapUVOffset, 'float'),\n\t\t\tinstanceSpeed: instancedArray(this.buffers.instanceSpeed, 'float'),\n\t\t};\n\n\t\tthis.material = this.createMaterial();\n\t\tthis.mesh = new THREE.InstancedMesh(defaultGeometry, this.material, count);\n\n\t\tthis.mesh.userData = {\n\t\t\tattributes: this.attributes,\n\t\t\tuniforms: this.uniforms,\n\t\t\tconfig: this.config,\n\t\t\talphaMapCount: this.alphaMapCount,\n\t\t\teasingIndex: this.easingIndex,\n\t\t};\n\n\t\tthis.add(this.mesh);\n\t\tthis.mesh.frustumCulled = this.config.render.frustumCulled ?? false;\n\t}\n\n\tprivate createMaterial(): THREE.NodeMaterial {\n\t\tconst _mat = createParticleMaterialTemplate();\n\t\t_mat.blending = this.config.render.blendingMode;\n\t\t_mat.premultipliedAlpha =\n\t\t\tthis.config.render.blendingMode === THREE.SubtractiveBlending ||\n\t\t\tthis.config.render.blendingMode === THREE.MultiplyBlending;\n\t\t_mat.depthWrite = false;\n\t\t_mat.side = this.config.render.side;\n\t\t_mat.depthTest = this.config.render.depthTest;\n\t\t_mat.transparent = true;\n\t\treturn _mat;\n\t}\n\n\t/** Starts the particle system from the beginning. */\n\tpublic start(): void {\n\t\tthis.running = true;\n\t\tthis.uniforms.uTime.value = 0;\n\t\tthis.cursor = 0;\n\t\tthis.emitted = 0;\n\t\tthis.visible = true;\n\t\tthis.mesh.visible = true;\n\t\tthis.attributes.instanceLifetime.value.array.fill(0);\n\t}\n\n\t/** Restarts (alias for start). */\n\tpublic restart(): void {\n\t\tthis.start();\n\t}\n\n\t/** Pauses the particle system, keeping current state. */\n\tpublic pause(): void {\n\t\tthis.running = false;\n\t}\n\n\t/** Resumes a paused system without resetting its state. */\n\tpublic resume(): void {\n\t\tthis.running = true;\n\t\tthis.visible = true;\n\t\tthis.mesh.visible = true;\n\t}\n\n\t/** Stops the particle system and hides it. */\n\tpublic stop(): void {\n\t\tthis.running = false;\n\t\tthis.visible = false;\n\t\tthis.mesh.visible = false;\n\t}\n\n\t/** Whether emission loops continuously. */\n\tpublic get looping(): boolean {\n\t\treturn this.config.emitter.loop;\n\t}\n\n\t/**\n\t * For non-looping systems, whether all emitted particles have aged past\n\t * their maximum lifetime (so the effect is visually finished).\n\t */\n\tpublic isComplete(): boolean {\n\t\tif (this.config.emitter.loop) return false;\n\t\tconst e = this.config.emitter;\n\t\tconst maxLifetime = e.lifetime[1];\n\t\tconst endTime = e.delay + e.duration + maxLifetime;\n\t\treturn this.emitted >= e.rate && this.uniforms.uTime.value > endTime;\n\t}\n\n\t/** Updates the particle system. Call each frame. */\n\tpublic update(delta: number): void {\n\t\tthis.mesh.visible = this.visible;\n\t\tif (!this.running) return;\n\t\tthis._update();\n\t\tthis.uniforms.uTime.value += delta;\n\t}\n\n\tprivate _compute(i: number): void {\n\t\tconst { emitter } = this.config;\n\t\tconst pos = this.uniforms.uPosition.value;\n\t\tconst dynamicFactor = 1 - emitter.static;\n\n\t\tconst inst = this.attributes.instance.value.array;\n\t\tconst i7 = i * 7;\n\t\tinst[i7 + 0] =\n\t\t\trandFloat(emitter.startPositionMin[0], emitter.startPositionMax[0]) + pos.x * dynamicFactor;\n\t\tinst[i7 + 1] =\n\t\t\trandFloat(emitter.startPositionMin[1], emitter.startPositionMax[1]) + pos.y * dynamicFactor;\n\t\tinst[i7 + 2] =\n\t\t\trandFloat(emitter.startPositionMin[2], emitter.startPositionMax[2]) + pos.z * dynamicFactor;\n\t\tinst[i7 + 3] = randFloat(emitter.startRotationMin[0], emitter.startRotationMax[0]);\n\t\tinst[i7 + 4] = randFloat(emitter.startRotationMin[1], emitter.startRotationMax[1]);\n\t\tinst[i7 + 5] = randFloat(emitter.startRotationMin[2], emitter.startRotationMax[2]);\n\t\tinst[i7 + 6] = randFloat(emitter.size[0], emitter.size[1]);\n\n\t\tconst i3 = i * 3;\n\t\tconst dir = this.attributes.instanceDirection.value.array;\n\t\tdir[i3 + 0] = randFloat(emitter.directionMin[0], emitter.directionMax[0]);\n\t\tdir[i3 + 1] = randFloat(emitter.directionMin[1], emitter.directionMax[1]);\n\t\tdir[i3 + 2] = randFloat(emitter.directionMin[2], emitter.directionMax[2]);\n\n\t\tconst rotSpeed = this.attributes.instanceRotationSpeed.value.array;\n\t\trotSpeed[i3 + 0] = randFloat(emitter.rotationSpeedMin[0], emitter.rotationSpeedMax[0]);\n\t\trotSpeed[i3 + 1] = randFloat(emitter.rotationSpeedMin[1], emitter.rotationSpeedMax[1]);\n\t\trotSpeed[i3 + 2] = randFloat(emitter.rotationSpeedMin[2], emitter.rotationSpeedMax[2]);\n\n\t\tconst i2 = i * 2;\n\t\tconst lifetime = this.attributes.instanceLifetime.value.array;\n\t\tlifetime[i2 + 0] = this.uniforms.uTime.value;\n\t\tlifetime[i2 + 1] = randFloat(emitter.lifetime[0], emitter.lifetime[1]);\n\n\t\tconst startCount = this.config.particles.alphaMapsStart?.length ?? 0;\n\t\tconst endCount = this.config.particles.alphaMapsEnd?.length ?? 0;\n\t\tconst startIdx = startCount > 0 ? randInt(0, startCount - 1) : 0;\n\t\tlet endIdx = 0;\n\t\tif (endCount > 0) {\n\t\t\tendIdx = startCount + randInt(0, endCount - 1);\n\t\t} else if (startCount > 0) {\n\t\t\tendIdx = randInt(0, startCount - 1);\n\t\t}\n\t\tconst alphaOffset = this.attributes.instanceAlphaMapUVOffset.value.array;\n\t\talphaOffset[i2 + 0] = startIdx;\n\t\talphaOffset[i2 + 1] = endIdx;\n\n\t\tthis.attributes.instanceSpeed.value.array[i] = randFloat(emitter.speed[0], emitter.speed[1]);\n\t}\n\n\tprivate _update(): void {\n\t\tconst loop = this.config.emitter.loop;\n\t\tconst spawnMode = this.config.emitter.spawnMode;\n\t\tconst maxParticlesTotal = this.config.particles.count;\n\t\tconst maxParticles = this.config.emitter.rate;\n\t\tconst duration = this.config.emitter.duration;\n\t\tconst delay = this.config.emitter.delay;\n\n\t\tconst amount =\n\t\t\tspawnMode === 'burst'\n\t\t\t\t? maxParticles\n\t\t\t\t: Math.max(\n\t\t\t\t\t\t0,\n\t\t\t\t\t\tMath.floor(((this.uniforms.uTime.value - delay) / duration) * maxParticles),\n\t\t\t\t\t);\n\n\t\tconst rate = amount - this.emitted;\n\n\t\tif (this.emitted >= maxParticles && !loop) return;\n\n\t\tif (spawnMode === 'time') {\n\t\t\tif (this.cursor >= maxParticlesTotal) this.cursor = 0;\n\t\t\tthis.uniforms.cursor.value = this.cursor;\n\t\t\tthis.uniforms.rate.value = rate;\n\t\t}\n\n\t\tfor (let _i = this.cursor; _i < this.cursor + rate; _i++) {\n\t\t\tthis._compute(_i % maxParticlesTotal);\n\t\t}\n\n\t\tthis.attributes.instance.value.needsUpdate = true;\n\t\tthis.attributes.instanceDirection.value.needsUpdate = true;\n\t\tthis.attributes.instanceRotationSpeed.value.needsUpdate = true;\n\t\tthis.attributes.instanceLifetime.value.needsUpdate = true;\n\t\tthis.attributes.instanceAlphaMapUVOffset.value.needsUpdate = true;\n\t\tthis.attributes.instanceSpeed.value.needsUpdate = true;\n\n\t\tif (spawnMode === 'time') {\n\t\t\tthis.cursor += rate;\n\t\t\tthis.cursor = this.cursor % maxParticlesTotal;\n\t\t}\n\n\t\tthis.emitted += rate;\n\t}\n\n\t/** Updates configuration at runtime (shallow per-section merge). */\n\tpublic updateConfig(config: Partial<ParticlesConfig>): void {\n\t\tif (config.particles) Object.assign(this.config.particles, config.particles);\n\t\tif (config.render) Object.assign(this.config.render, config.render);\n\t\tif (config.emitter) Object.assign(this.config.emitter, config.emitter);\n\t}\n\n\t/** Disposes of all resources used by the particle system. */\n\tpublic dispose(): void {\n\t\tthis.stop();\n\t\tthis.mesh.geometry.dispose();\n\t\tthis.material.dispose();\n\t}\n}\n","import type * as THREE from 'three/webgpu';\n\n/**\n * GPU particle engine configuration types.\n *\n * Ported/adapted from the `threeparticles` project (MIT) — a WebGPU/TSL\n * particle system — to replace the previous three.quarks backend. Editor-only\n * export types from the original are omitted.\n */\n\n/** Color stop definition for gradient textures. */\nexport interface ColorStop {\n\t/** CSS color string (hex, rgb, named color, etc.) */\n\tcolor: string;\n\t/** Position in gradient from 0 to 1 */\n\tstop: number;\n}\n\n/** Available easing function identifiers. */\nexport type EaseFunction =\n\t| 'easeLinear'\n\t| 'easeInPower1'\n\t| 'easeOutPower1'\n\t| 'easeInOutPower1'\n\t| 'easeInPower2'\n\t| 'easeOutPower2'\n\t| 'easeInOutPower2'\n\t| 'easeInPower3'\n\t| 'easeOutPower3'\n\t| 'easeInOutPower3'\n\t| 'easeInPower4'\n\t| 'easeOutPower4'\n\t| 'easeInOutPower4'\n\t| 'easeInQuad'\n\t| 'easeOutQuad'\n\t| 'easeInOutQuad'\n\t| 'easeInCubic'\n\t| 'easeOutCubic'\n\t| 'easeInOutCubic'\n\t| 'easeInQuart'\n\t| 'easeOutQuart'\n\t| 'easeInOutQuart'\n\t| 'easeInQuint'\n\t| 'easeOutQuint'\n\t| 'easeInOutQuint'\n\t| 'easeInSine'\n\t| 'easeOutSine'\n\t| 'easeInOutSine'\n\t| 'easeInExpo'\n\t| 'easeOutExpo'\n\t| 'easeInOutExpo'\n\t| 'easeInCirc'\n\t| 'easeOutCirc'\n\t| 'easeInOutCirc'\n\t| 'easeInElastic'\n\t| 'easeOutElastic'\n\t| 'easeInOutElastic'\n\t| 'easeInBack'\n\t| 'easeOutBack'\n\t| 'easeInOutBack';\n\n/** All easing function names, ordered by shader ID. */\nexport const EASE_FUNCTIONS: EaseFunction[] = [\n\t'easeLinear',\n\t'easeInPower1',\n\t'easeOutPower1',\n\t'easeInOutPower1',\n\t'easeInPower2',\n\t'easeOutPower2',\n\t'easeInOutPower2',\n\t'easeInPower3',\n\t'easeOutPower3',\n\t'easeInOutPower3',\n\t'easeInPower4',\n\t'easeOutPower4',\n\t'easeInOutPower4',\n\t'easeInQuad',\n\t'easeOutQuad',\n\t'easeInOutQuad',\n\t'easeInCubic',\n\t'easeOutCubic',\n\t'easeInOutCubic',\n\t'easeInQuart',\n\t'easeOutQuart',\n\t'easeInOutQuart',\n\t'easeInQuint',\n\t'easeOutQuint',\n\t'easeInOutQuint',\n\t'easeInSine',\n\t'easeOutSine',\n\t'easeInOutSine',\n\t'easeInExpo',\n\t'easeOutExpo',\n\t'easeInOutExpo',\n\t'easeInCirc',\n\t'easeOutCirc',\n\t'easeInOutCirc',\n\t'easeInElastic',\n\t'easeOutElastic',\n\t'easeInOutElastic',\n\t'easeInBack',\n\t'easeOutBack',\n\t'easeInOutBack',\n];\n\n/** Particle shape rendering modes. */\nexport enum AppearanceMode {\n\t/** Square/quad particles */\n\tSquare = 0,\n\t/** Circular particles with soft edges */\n\tCircular = 1,\n}\n\n/** Configuration for particle visual appearance and behavior. */\nexport interface ParticleSettings {\n\t/** Maximum number of particles in the system */\n\tcount: number;\n\t/** Color intensity multiplier (1.0 = normal) */\n\tintensity: number;\n\t/** Size fade range [start, end] as progress values (0-1) */\n\tfadeSize: [min: number, max: number];\n\t/** Alpha fade range [start, end] as progress values (0-1) */\n\tfadeAlpha: [min: number, max: number];\n\t/** Alpha map morph range [start, end] as progress values (0-1) */\n\tfadeAlphaMap: [min: number, max: number];\n\t/** World-space gravity force [x, y, z] */\n\tgravity: [x: number, y: number, z: number];\n\t/** Alpha map textures for particle start state */\n\talphaMapsStart?: THREE.Texture[];\n\t/** Alpha map textures for particle end state */\n\talphaMapsEnd?: THREE.Texture[];\n\t/** Color gradient definitions per row */\n\tcolors: ColorStop[][];\n\t/** Particle shape mode */\n\tappearance: AppearanceMode;\n\t/** Easing function for particle animation */\n\teaseFunction: EaseFunction;\n}\n\n/** Configuration for WebGPU rendering settings. */\nexport interface RenderSettings {\n\t/** Size of each alpha map slot in the texture atlas (pixels) */\n\talphaMapSize: number;\n\t/** Texture filtering mode for alpha maps */\n\talphaMapFilter: THREE.MagnificationTextureFilter;\n\t/** Enable frustum culling for the particle mesh */\n\tfrustumCulled: boolean;\n\t/** Blending mode for particle rendering */\n\tblendingMode: THREE.Blending;\n\t/** Which side of faces to render */\n\tside: THREE.Side;\n\t/** Enable depth testing */\n\tdepthTest: boolean;\n}\n\n/** Configuration for particle emission behavior. */\nexport interface EmitterSettings {\n\t/** Total duration of emission in seconds */\n\tduration: number;\n\t/** Number of particles to emit per cycle */\n\trate: number;\n\t/** Emission timing mode: \"time\" spreads over duration, \"burst\" emits all at once */\n\tspawnMode: 'time' | 'burst';\n\t/** Static position blend (0 = dynamic, 1 = static at spawn position) */\n\tstatic: number;\n\t/** Apply world up-right correction during animation */\n\tworldUpRight: boolean;\n\t/** Loop the emission continuously */\n\tloop: boolean;\n\t/** Delay before first emission in seconds */\n\tdelay: number;\n\t/** Show debug wireframe mesh at emitter position */\n\tdebug: boolean;\n\t/** Particle lifetime range [min, max] in seconds */\n\tlifetime: [min: number, max: number];\n\t/** Speed range [min, max] in units per second */\n\tspeed: [min: number, max: number];\n\t/** Size range [min, max] */\n\tsize: [min: number, max: number];\n\t/** Minimum spawn position offset [x, y, z] */\n\tstartPositionMin: [x: number, y: number, z: number];\n\t/** Maximum spawn position offset [x, y, z] */\n\tstartPositionMax: [x: number, y: number, z: number];\n\t/** Minimum initial rotation [x, y, z] normalized -1 to 1 */\n\tstartRotationMin: [x: number, y: number, z: number];\n\t/** Maximum initial rotation [x, y, z] normalized -1 to 1 */\n\tstartRotationMax: [x: number, y: number, z: number];\n\t/** Minimum rotation speed [x, y, z] in radians per second */\n\trotationSpeedMin: [x: number, y: number, z: number];\n\t/** Maximum rotation speed [x, y, z] in radians per second */\n\trotationSpeedMax: [x: number, y: number, z: number];\n\t/** Minimum emission direction [x, y, z] */\n\tdirectionMin: [x: number, y: number, z: number];\n\t/** Maximum emission direction [x, y, z] */\n\tdirectionMax: [x: number, y: number, z: number];\n}\n\n/**\n * Complete particle system configuration. All sections are deep-partial at the\n * authoring boundary; the {@link Particles} constructor fills defaults.\n */\nexport interface ParticlesConfig {\n\tparticles: Partial<ParticleSettings> & Pick<ParticleSettings, 'count'>;\n\trender?: Partial<RenderSettings>;\n\temitter?: Partial<EmitterSettings>;\n}\n","import * as THREE from 'three/webgpu';\nimport type { ColorStop } from './types';\n\n/**\n * Texture helpers for the GPU particle engine. Ported from `threeparticles` (MIT).\n *\n * Both helpers use a 2D canvas, so they run only in a DOM/browser environment\n * (which is where WebGPU rendering happens anyway).\n */\n\n/**\n * Combines multiple textures into a horizontal atlas strip.\n *\n * @returns Combined canvas texture, or null if no textures provided.\n */\nexport function createTextureAtlas(\n\ttextures: THREE.Texture[],\n\tonLoad?: () => void,\n\tsize = 512,\n\tfilter?: THREE.MagnificationTextureFilter,\n): THREE.CanvasTexture | null {\n\tif (!textures || textures.length === 0) return null;\n\n\tconst canvas = document.createElement('canvas');\n\tconst ctx = canvas.getContext('2d')!;\n\n\tconst count = textures.length;\n\tcanvas.width = size * count;\n\tcanvas.height = size;\n\n\tlet loadedCount = 0;\n\tlet imagesLoaded = 0;\n\n\ttextures.forEach((texture, i) => {\n\t\tconst img = texture.image as HTMLImageElement;\n\t\tif (img && img.complete && img.width > 0) {\n\t\t\tctx.drawImage(img, i * size, 0, size, size);\n\t\t\timagesLoaded++;\n\t\t} else {\n\t\t\tconst checkAndDraw = () => {\n\t\t\t\tconst ready = texture.image as HTMLImageElement;\n\t\t\t\tif (ready && ready.complete && ready.width > 0) {\n\t\t\t\t\tctx.drawImage(ready, i * size, 0, size, size);\n\t\t\t\t\tloadedCount++;\n\t\t\t\t\tif (loadedCount === count - imagesLoaded) {\n\t\t\t\t\t\tatlasTexture.needsUpdate = true;\n\t\t\t\t\t\tif (onLoad) onLoad();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tsetTimeout(checkAndDraw, 100);\n\t\t\t\t}\n\t\t\t};\n\t\t\tcheckAndDraw();\n\t\t}\n\t});\n\n\tconst atlasTexture = new THREE.CanvasTexture(canvas);\n\tif (filter !== undefined) {\n\t\tatlasTexture.minFilter = filter;\n\t\tatlasTexture.magFilter = filter;\n\t}\n\tatlasTexture.needsUpdate = true;\n\n\treturn atlasTexture;\n}\n\n/**\n * Builds a gradient lookup texture (one row per color-stop array) sampled by\n * the particle material to color particles over their lifetime progress.\n */\nexport function createColorGradientTexture(\n\trows: ColorStop[][],\n\twidth = 512,\n): THREE.CanvasTexture {\n\tlet safeRows = rows;\n\tif (!safeRows || safeRows.length === 0) safeRows = [[{ color: 'white', stop: 0 }]];\n\n\tconst normalized = safeRows.map((row) => {\n\t\tconst sorted = [...row].sort((a, b) => a.stop - b.stop);\n\t\tif (sorted[0]!.stop > 0) sorted.unshift({ color: sorted[0]!.color, stop: 0 });\n\t\tif (sorted[sorted.length - 1]!.stop < 1)\n\t\t\tsorted.push({ color: sorted[sorted.length - 1]!.color, stop: 1 });\n\t\treturn sorted;\n\t});\n\n\tconst canvas = document.createElement('canvas');\n\tconst ctx = canvas.getContext('2d')!;\n\tcanvas.width = width;\n\tcanvas.height = normalized.length;\n\n\tfor (let y = 0; y < normalized.length; y++) {\n\t\tconst stops = normalized[y]!;\n\t\tconst g = ctx.createLinearGradient(0, 0, width, 0);\n\t\tfor (const s of stops) g.addColorStop(THREE.MathUtils.clamp(s.stop, 0, 1), s.color);\n\t\tctx.fillStyle = g;\n\t\tctx.fillRect(0, y, width, 1);\n\t}\n\n\tconst tex = new THREE.CanvasTexture(canvas);\n\ttex.minFilter = THREE.LinearFilter;\n\ttex.magFilter = THREE.LinearFilter;\n\ttex.wrapS = THREE.ClampToEdgeWrapping;\n\ttex.wrapT = THREE.ClampToEdgeWrapping;\n\ttex.needsUpdate = true;\n\n\treturn tex;\n}\n","/**\n * TSL shader nodes for WebGPU based particle computation.\n * Handle position, rotation, scale, and color on the GPU from storage buffers.\n *\n * Ported from the `threeparticles` project (MIT).\n * @module\n */\n// @ts-nocheck - TSL types are incompatible with TypeScript\nimport * as THREE from 'three/webgpu';\nimport {\n\tnormalize,\n\tmax,\n\tvarying,\n\tIf,\n\tdistance,\n\tDiscard,\n\tselect,\n\tlength,\n\trange,\n\tinstanceIndex,\n\tvec3,\n\tfloat,\n\tmix,\n\ttexture,\n\tvec4,\n\tFn,\n\tvec2,\n\tsmoothstep,\n\tuv,\n\tuint,\n\tmodelWorldMatrix,\n\ttranspose,\n\tmat3,\n\tbool,\n} from 'three/tsl';\nimport { applyEasing } from './easing';\n\n// Instance index multipliers for accessing packed buffer data\nconst idx7 = instanceIndex.mul(7);\nconst idx3 = instanceIndex.mul(3);\nconst idx2 = instanceIndex.mul(2);\n\n/** Varying progress value shared between shader nodes */\nconst vProgress = varying(float(0), 'vProgress');\n\n/** TSL node for computing particle position based on time, velocity, and gravity. */\nconst positionNode = /*@__PURE__*/ Fn(\n\t([pos, age, duration, vProgress, uGravity, dir, speed, worldUpRight, easingIndex]) => {\n\t\tconst progress = age.div(duration);\n\t\tconst _pos = vec3(pos);\n\n\t\tIf(progress.lessThan(0.0).or(progress.greaterThan(1.0)), () => {\n\t\t\tvProgress.assign(1.0);\n\t\t\t_pos.assign(vec3(0, 9999, 0));\n\t\t}).Else(() => {\n\t\t\tvProgress.assign(applyEasing(progress, easingIndex));\n\t\t\tconst normalizedDirection = select(length(dir).greaterThan(0), normalize(dir), vec3(0));\n\t\t\tconst gravityForce = uGravity.mul(0.5).mul(age.mul(age));\n\t\t\tconst easedAge = vProgress.mul(duration);\n\t\t\tconst offset = normalizedDirection.mul(easedAge).mul(speed).add(gravityForce);\n\n\t\t\tIf(worldUpRight, () => {\n\t\t\t\tconst m = mat3(modelWorldMatrix);\n\t\t\t\tconst rot = mat3(normalize(m[0]), normalize(m[1]), normalize(m[2]));\n\t\t\t\tconst inverseRotation = transpose(rot);\n\t\t\t\tconst worldOffset = inverseRotation.mul(offset);\n\t\t\t\tconst blendedOffset = mix(offset, worldOffset, vProgress);\n\t\t\t\t_pos.addAssign(blendedOffset);\n\t\t\t}).Else(() => {\n\t\t\t\t_pos.addAssign(offset);\n\t\t\t});\n\t\t});\n\n\t\treturn _pos;\n\t},\n);\n\n/** TSL node for computing particle rotation over time. */\nconst rotationNode = /*@__PURE__*/ Fn(([rot, rotSpeed, age]) => {\n\tconst tau = float(Math.PI * 2.0).toConst();\n\tconst init = rot.z.add(1.0).mul(0.5).mul(tau);\n\tconst angle = init.add(rotSpeed.z.mul(age));\n\tconst wrapped = angle.mod(tau);\n\treturn wrapped.add(tau).mod(tau);\n});\n\n/** TSL node for computing particle scale with fade. */\nconst scaleNode = /*@__PURE__*/ Fn(([fadeSize, scale, vProgress]) => {\n\tconst uFadeSize = vec2(fadeSize[0], fadeSize[1]).toVar();\n\treturn smoothstep(0.0, uFadeSize.x, vProgress)\n\t\t.mul(smoothstep(1.01, uFadeSize.y, vProgress))\n\t\t.mul(scale);\n});\n\n/** TSL node for computing particle color with gradient lookup and alpha mapping. */\nconst colorNode = /*@__PURE__*/ Fn(\n\t([\n\t\tcolors,\n\t\tintensity,\n\t\tfadeAlpha,\n\t\tfadeAlphaMap,\n\t\tvProgress,\n\t\tuColorGradient,\n\t\tuAlphaMapCount,\n\t\tvAlphaMapUVOffsetX,\n\t\tvAlphaMapUVOffsetY,\n\t\talphaMap,\n\t]) => {\n\t\tconst vColorGradientRow = range(0, colors.length - 1).toVar();\n\t\tconst uColorGradientRows = float(colors.length).toVar();\n\t\tconst uIntensity = float(intensity).toVar();\n\t\tconst uFadeAlpha = vec2(fadeAlpha[0], fadeAlpha[1]).toVar();\n\t\tconst uFadeAlphaMap = vec2(fadeAlphaMap[0], fadeAlphaMap[1]).toVar();\n\n\t\tconst u = vProgress;\n\t\tconst v = vColorGradientRow.add(0.5).div(max(uColorGradientRows, 1.0));\n\t\tconst finalColor = uColorGradient.sample(vec2(u, v)).rgb;\n\t\tfinalColor.mulAssign(uIntensity);\n\n\t\tconst alpha = smoothstep(0.0, uFadeAlpha.x, vProgress).mul(\n\t\t\tsmoothstep(1.01, uFadeAlpha.y, vProgress),\n\t\t);\n\n\t\tconst vUv = uv();\n\n\t\tIf(uAlphaMapCount.equal(0), () => {\n\t\t\tconst center = vec2(0.5).toVar();\n\t\t\tconst dist = distance(vUv, center);\n\t\t\tconst radius = float(0.5);\n\t\t\tconst feather = float(0.98);\n\t\t\tconst _alpha = float(1.0).sub(smoothstep(radius.sub(feather), radius, dist));\n\t\t\talpha.assign(_alpha.mul(alpha));\n\t\t\tIf(_alpha.lessThan(0.01), () => Discard());\n\t\t}).ElseIf(uAlphaMapCount.greaterThan(0), () => {\n\t\t\tconst startU = vAlphaMapUVOffsetX.add(vUv.x).div(uAlphaMapCount);\n\t\t\tconst startUV = vec2(startU, vUv.y);\n\t\t\tconst startAlpha = alphaMap.sample(startUV).a;\n\n\t\t\tIf(uAlphaMapCount.greaterThan(1), () => {\n\t\t\t\tconst endU = vAlphaMapUVOffsetY.add(vUv.x).div(uAlphaMapCount);\n\t\t\t\tconst endUV = vec2(endU, vUv.y);\n\t\t\t\tconst endAlpha = alphaMap.sample(endUV).a;\n\t\t\t\tconst morphProgress = smoothstep(uFadeAlphaMap.x, uFadeAlphaMap.y, vProgress);\n\t\t\t\tconst morphedAlpha = mix(startAlpha, endAlpha, morphProgress);\n\t\t\t\talpha.assign(morphedAlpha.mul(alpha));\n\t\t\t}).Else(() => {\n\t\t\t\talpha.assign(startAlpha.mul(alpha));\n\t\t\t});\n\t\t});\n\n\t\treturn vec4(finalColor, alpha);\n\t},\n);\n\n/** Custom THREE.Node for instance position computation. */\nclass InstancePositionNode extends THREE.Node {\n\tconstructor() {\n\t\tsuper('vec3');\n\t\tthis.updateType = THREE.NodeUpdateType.OBJECT;\n\t}\n\n\tsetup(frame) {\n\t\tconst mesh = frame.object;\n\t\tconst { attributes, uniforms, config, easingIndex } = mesh.userData;\n\n\t\tconst uPosition = uniforms.uPosition;\n\n\t\tconst _static = float(config.emitter.static).toVar();\n\t\tconst posX = attributes.instance.element(idx7.add(0));\n\t\tconst posY = attributes.instance.element(idx7.add(1));\n\t\tconst posZ = attributes.instance.element(idx7.add(2));\n\t\tconst pos = vec3(posX, posY, posZ).add(uPosition.mul(_static));\n\n\t\tconst dirX = attributes.instanceDirection.element(idx3.add(0));\n\t\tconst dirY = attributes.instanceDirection.element(idx3.add(1));\n\t\tconst dirZ = attributes.instanceDirection.element(idx3.add(2));\n\t\tconst dir = vec3(dirX, dirY, dirZ);\n\n\t\tconst time = uniforms.uTime;\n\t\tconst uGravity = vec3(...config.particles.gravity);\n\n\t\tconst worldUpRight = bool(config.emitter.worldUpRight);\n\n\t\tconst startTime = attributes.instanceLifetime.element(idx2.add(0));\n\t\tconst duration = attributes.instanceLifetime.element(idx2.add(1));\n\n\t\tconst speed = attributes.instanceSpeed.element(instanceIndex).toVar();\n\t\tconst age = select(speed.lessThan(0.0), duration.sub(time.sub(startTime)), time.sub(startTime));\n\n\t\treturn positionNode(pos, age, duration, vProgress, uGravity, dir, speed, worldUpRight, easingIndex);\n\t}\n}\n\n/** Custom THREE.Node for instance rotation computation. */\nclass InstanceRotationNode extends THREE.Node {\n\tconstructor() {\n\t\tsuper('vec3');\n\t\tthis.updateType = THREE.NodeUpdateType.OBJECT;\n\t}\n\n\tsetup(frame) {\n\t\tconst mesh = frame.object;\n\t\tconst { attributes, uniforms } = mesh.userData;\n\n\t\tconst rotX = attributes.instance.element(idx7.add(3));\n\t\tconst rotY = attributes.instance.element(idx7.add(4));\n\t\tconst rotZ = attributes.instance.element(idx7.add(5));\n\t\tconst rot = vec3(rotX, rotY, rotZ);\n\n\t\tconst rotSpeedX = attributes.instanceRotationSpeed.element(idx3.add(0));\n\t\tconst rotSpeedY = attributes.instanceRotationSpeed.element(idx3.add(1));\n\t\tconst rotSpeedZ = attributes.instanceRotationSpeed.element(idx3.add(2));\n\t\tconst rotSpeed = vec3(rotSpeedX, rotSpeedY, rotSpeedZ);\n\n\t\tconst time = uniforms.uTime;\n\t\tconst startTime = attributes.instanceLifetime.element(idx2.add(0));\n\t\tconst duration = attributes.instanceLifetime.element(idx2.add(1));\n\n\t\tconst speed = attributes.instanceSpeed.element(instanceIndex).toVar();\n\t\tconst age = select(speed.lessThan(0.0), duration.sub(time.sub(startTime)), time.sub(startTime));\n\n\t\treturn rotationNode(rot, rotSpeed, age);\n\t}\n}\n\n/** Custom THREE.Node for instance scale computation. */\nclass InstanceScaleNode extends THREE.Node {\n\tconstructor() {\n\t\tsuper('vec3');\n\t\tthis.updateType = THREE.NodeUpdateType.OBJECT;\n\t}\n\n\tsetup(frame) {\n\t\tconst mesh = frame.object;\n\t\tconst { attributes, config } = mesh.userData;\n\n\t\tconst scale = attributes.instance.element(idx7.add(6));\n\n\t\treturn scaleNode(config.particles.fadeSize, scale, vProgress);\n\t}\n}\n\n/** Custom THREE.Node for instance color computation. */\nclass InstanceColorNode extends THREE.Node {\n\tconstructor() {\n\t\tsuper('vec3');\n\t\tthis.updateType = THREE.NodeUpdateType.OBJECT;\n\t}\n\n\tsetup(frame) {\n\t\tconst mesh = frame.object;\n\t\tconst { attributes, uniforms, config, alphaMapCount } = mesh.userData;\n\n\t\tconst uAlphaMapCount = uint(alphaMapCount).toVar();\n\n\t\tconst vAlphaMapUVOffsetX = attributes.instanceAlphaMapUVOffset.element(idx2.add(0));\n\t\tconst vAlphaMapUVOffsetY = attributes.instanceAlphaMapUVOffset.element(idx2.add(1));\n\n\t\treturn colorNode(\n\t\t\tconfig.particles.colors,\n\t\t\tconfig.particles.intensity,\n\t\t\tconfig.particles.fadeAlpha,\n\t\t\tconfig.particles.fadeAlphaMap,\n\t\t\tvProgress,\n\t\t\tuniforms.uColorGradient,\n\t\t\tuAlphaMapCount,\n\t\t\tvAlphaMapUVOffsetX,\n\t\t\tvAlphaMapUVOffsetY,\n\t\t\tuniforms.alphaMap,\n\t\t);\n\t}\n}\n\n/**\n * Builds a fresh sprite material wired to the instance nodes. (Each system gets\n * its own material; the nodes read per-mesh data via `mesh.userData`.)\n */\nexport function createParticleMaterialTemplate(): THREE.SpriteNodeMaterial {\n\tconst mat = new THREE.SpriteNodeMaterial();\n\tmat.positionNode = new InstancePositionNode();\n\tmat.rotationNode = new InstanceRotationNode();\n\tmat.scaleNode = new InstanceScaleNode();\n\tmat.colorNode = new InstanceColorNode();\n\treturn mat;\n}\n","/**\n * TSL easing functions for WebGPU based particle animation.\n * All functions take a progress value t (0-1) and return the eased value.\n *\n * Ported from the `threeparticles` project (MIT).\n * @module\n */\n// @ts-nocheck - TSL types are incompatible with TypeScript\nimport { PI, float, mul, sub, pow, add, cos, sin, sqrt, select, Fn, If, Switch } from 'three/tsl';\n\n// Linear\nexport const easeLinear = /*@__PURE__*/ Fn(([t]) => t, { t: 'float', return: 'float' });\n\n// Power 1\nexport const easeInPower1 = /*@__PURE__*/ Fn(([t]) => t, { t: 'float', return: 'float' });\nexport const easeOutPower1 = /*@__PURE__*/ Fn(([t]) => sub(1.0, sub(1.0, t)), {\n\tt: 'float',\n\treturn: 'float',\n});\nexport const easeInOutPower1 = /*@__PURE__*/ Fn(([t]) => t, { t: 'float', return: 'float' });\n\n// Power 2\nexport const easeInPower2 = /*@__PURE__*/ Fn(([t]) => t.mul(t), { t: 'float', return: 'float' });\nexport const easeOutPower2 = /*@__PURE__*/ Fn(([t]) => sub(1.0, pow(sub(1.0, t), 2.0)), {\n\tt: 'float',\n\treturn: 'float',\n});\nexport const easeInOutPower2 = /*@__PURE__*/ Fn(\n\t([t]) =>\n\t\tselect(\n\t\t\tt.lessThan(0.5),\n\t\t\tmul(2.0, t).mul(t),\n\t\t\tsub(1.0, pow(float(-2.0).mul(t).add(2.0), 2.0).div(2.0)),\n\t\t),\n\t{ t: 'float', return: 'float' },\n);\n\n// Power 3\nexport const easeInPower3 = /*@__PURE__*/ Fn(([t]) => t.mul(t).mul(t), {\n\tt: 'float',\n\treturn: 'float',\n});\nexport const easeOutPower3 = /*@__PURE__*/ Fn(([t]) => sub(1.0, pow(sub(1.0, t), 3.0)), {\n\tt: 'float',\n\treturn: 'float',\n});\nexport const easeInOutPower3 = /*@__PURE__*/ Fn(\n\t([t]) =>\n\t\tselect(\n\t\t\tt.lessThan(0.5),\n\t\t\tmul(4.0, t).mul(t).mul(t),\n\t\t\tsub(1.0, pow(float(-2.0).mul(t).add(2.0), 3.0).div(2.0)),\n\t\t),\n\t{ t: 'float', return: 'float' },\n);\n\n// Power 4\nexport const easeInPower4 = /*@__PURE__*/ Fn(([t]) => t.mul(t).mul(t).mul(t), {\n\tt: 'float',\n\treturn: 'float',\n});\nexport const easeOutPower4 = /*@__PURE__*/ Fn(([t]) => sub(1.0, pow(sub(1.0, t), 4.0)), {\n\tt: 'float',\n\treturn: 'float',\n});\nexport const easeInOutPower4 = /*@__PURE__*/ Fn(\n\t([t]) =>\n\t\tselect(\n\t\t\tt.lessThan(0.5),\n\t\t\tmul(8.0, t).mul(t).mul(t).mul(t),\n\t\t\tsub(1.0, pow(float(-2.0).mul(t).add(2.0), 4.0).div(2.0)),\n\t\t),\n\t{ t: 'float', return: 'float' },\n);\n\n// Quad\nexport const easeInQuad = /*@__PURE__*/ Fn(([t]) => t.mul(t), { t: 'float', return: 'float' });\nexport const easeOutQuad = /*@__PURE__*/ Fn(([t]) => t.mul(sub(2.0, t)), {\n\tt: 'float',\n\treturn: 'float',\n});\nexport const easeInOutQuad = /*@__PURE__*/ Fn(\n\t([t]) =>\n\t\tselect(t.lessThan(0.5), mul(2.0, t).mul(t), float(-1.0).add(sub(4.0, mul(2.0, t)).mul(t))),\n\t{ t: 'float', return: 'float' },\n);\n\n// Cubic\nexport const easeInCubic = /*@__PURE__*/ Fn(([t]) => t.mul(t).mul(t), {\n\tt: 'float',\n\treturn: 'float',\n});\nexport const easeOutCubic = /*@__PURE__*/ Fn(\n\t([t]) => {\n\t\tconst t1 = t.sub(1.0);\n\t\treturn add(1.0, t1.mul(t1).mul(t1));\n\t},\n\t{ t: 'float', return: 'float' },\n);\nexport const easeInOutCubic = /*@__PURE__*/ Fn(\n\t([t]) =>\n\t\tselect(\n\t\t\tt.lessThan(0.5),\n\t\t\tmul(4.0, t).mul(t).mul(t),\n\t\t\tt.sub(1.0).mul(mul(2.0, t).sub(2.0)).mul(mul(2.0, t).sub(2.0)).add(1.0),\n\t\t),\n\t{ t: 'float', return: 'float' },\n);\n\n// Quart\nexport const easeInQuart = /*@__PURE__*/ Fn(([t]) => t.mul(t).mul(t).mul(t), {\n\tt: 'float',\n\treturn: 'float',\n});\nexport const easeOutQuart = /*@__PURE__*/ Fn(\n\t([t]) => {\n\t\tconst t1 = t.sub(1.0);\n\t\treturn sub(1.0, t1.mul(t1).mul(t1).mul(t1));\n\t},\n\t{ t: 'float', return: 'float' },\n);\nexport const easeInOutQuart = /*@__PURE__*/ Fn(\n\t([t]) => {\n\t\tconst t1 = t.sub(1.0);\n\t\treturn select(\n\t\t\tt.lessThan(0.5),\n\t\t\tmul(8.0, t).mul(t).mul(t).mul(t),\n\t\t\tsub(1.0, mul(8.0, t1).mul(t1).mul(t1).mul(t1)),\n\t\t);\n\t},\n\t{ t: 'float', return: 'float' },\n);\n\n// Quint\nexport const easeInQuint = /*@__PURE__*/ Fn(([t]) => t.mul(t).mul(t).mul(t).mul(t), {\n\tt: 'float',\n\treturn: 'float',\n});\nexport const easeOutQuint = /*@__PURE__*/ Fn(\n\t([t]) => {\n\t\tconst t1 = t.sub(1.0);\n\t\treturn add(1.0, t1.mul(t1).mul(t1).mul(t1).mul(t1));\n\t},\n\t{ t: 'float', return: 'float' },\n);\nexport const easeInOutQuint = /*@__PURE__*/ Fn(\n\t([t]) => {\n\t\tconst t1 = t.sub(1.0);\n\t\treturn select(\n\t\t\tt.lessThan(0.5),\n\t\t\tmul(16.0, t).mul(t).mul(t).mul(t).mul(t),\n\t\t\tadd(1.0, mul(16.0, t1).mul(t1).mul(t1).mul(t1).mul(t1)),\n\t\t);\n\t},\n\t{ t: 'float', return: 'float' },\n);\n\n// Sine\nexport const easeInSine = /*@__PURE__*/ Fn(\n\t([t]) => float(-1.0).mul(cos(t.mul(PI).mul(0.5))).add(1.0),\n\t{ t: 'float', return: 'float' },\n);\nexport const easeOutSine = /*@__PURE__*/ Fn(([t]) => sin(t.mul(PI).mul(0.5)), {\n\tt: 'float',\n\treturn: 'float',\n});\nexport const easeInOutSine = /*@__PURE__*/ Fn(([t]) => float(-0.5).mul(cos(PI.mul(t)).sub(1.0)), {\n\tt: 'float',\n\treturn: 'float',\n});\n\n// Expo\nexport const easeInExpo = /*@__PURE__*/ Fn(\n\t([t]) => select(t.equal(0.0), 0.0, pow(2.0, mul(10.0, t.sub(1.0)))),\n\t{ t: 'float', return: 'float' },\n);\nexport const easeOutExpo = /*@__PURE__*/ Fn(\n\t([t]) => select(t.equal(1.0), 1.0, sub(1.0, pow(2.0, float(-10.0).mul(t)))),\n\t{ t: 'float', return: 'float' },\n);\nexport const easeInOutExpo = /*@__PURE__*/ Fn(\n\t([t]) => {\n\t\tIf(t.equal(0.0).or(t.equal(1.0)), () => t);\n\t\treturn select(\n\t\t\tt.lessThan(0.5),\n\t\t\tmul(0.5, pow(2.0, mul(20.0, t).sub(10.0))),\n\t\t\tmul(0.5, pow(2.0, float(-20.0).mul(t).add(10.0)).negate().add(2.0)),\n\t\t);\n\t},\n\t{ t: 'float', return: 'float' },\n);\n\n// Circ\nexport const easeInCirc = /*@__PURE__*/ Fn(\n\t([t]) => float(-1.0).mul(sqrt(sub(1.0, t.mul(t))).sub(1.0)),\n\t{ t: 'float', return: 'float' },\n);\nexport const easeOutCirc = /*@__PURE__*/ Fn(\n\t([t]) => {\n\t\tconst t1 = t.sub(1.0);\n\t\treturn sqrt(sub(1.0, t1.mul(t1)));\n\t},\n\t{ t: 'float', return: 'float' },\n);\nexport const easeInOutCirc = /*@__PURE__*/ Fn(\n\t([t]) => {\n\t\tconst t1 = mul(2.0, t);\n\t\tconst t2 = t1.sub(2.0);\n\t\treturn select(\n\t\t\tt.lessThan(0.5),\n\t\t\tfloat(-0.5).mul(sqrt(sub(1.0, t1.mul(t1))).sub(1.0)),\n\t\t\tmul(0.5, sqrt(sub(1.0, t2.mul(t2))).add(1.0)),\n\t\t);\n\t},\n\t{ t: 'float', return: 'float' },\n);\n\n// Elastic\nexport const easeInElastic = /*@__PURE__*/ Fn(\n\t([t]) => {\n\t\tIf(t.equal(0.0).or(t.equal(1.0)), () => t);\n\t\treturn pow(2.0, mul(10.0, t.sub(1.0)))\n\t\t\t.negate()\n\t\t\t.mul(sin(t.sub(1.075).mul(mul(2.0, PI)).div(0.3)));\n\t},\n\t{ t: 'float', return: 'float' },\n);\nexport const easeOutElastic = /*@__PURE__*/ Fn(\n\t([t]) => {\n\t\tIf(t.equal(0.0).or(t.equal(1.0)), () => t);\n\t\treturn pow(2.0, float(-10.0).mul(t))\n\t\t\t.mul(sin(t.sub(0.075).mul(mul(2.0, PI)).div(0.3)))\n\t\t\t.add(1.0);\n\t},\n\t{ t: 'float', return: 'float' },\n);\nexport const easeInOutElastic = /*@__PURE__*/ Fn(\n\t([t]) => {\n\t\tIf(t.lessThan(0.5), () =>\n\t\t\tfloat(-0.5)\n\t\t\t\t.mul(pow(2.0, mul(20.0, t).sub(10.0)))\n\t\t\t\t.mul(sin(mul(20.0, t).sub(11.125).mul(mul(2.0, PI)).div(4.5))),\n\t\t);\n\t\treturn pow(2.0, float(-20.0).mul(t).add(10.0))\n\t\t\t.mul(sin(mul(20.0, t).sub(11.125).mul(mul(2.0, PI)).div(4.5)))\n\t\t\t.mul(0.5)\n\t\t\t.add(1.0);\n\t},\n\t{ t: 'float', return: 'float' },\n);\n\n// Back\nexport const easeInBack = /*@__PURE__*/ Fn(\n\t([t]) => {\n\t\tconst s = float(1.70158);\n\t\treturn t.mul(t).mul(s.add(1.0).mul(t).sub(s));\n\t},\n\t{ t: 'float', return: 'float' },\n);\nexport const easeOutBack = /*@__PURE__*/ Fn(\n\t([t]) => {\n\t\tconst s = float(1.70158);\n\t\tconst t1 = t.sub(1.0);\n\t\treturn t1.mul(t1).mul(s.add(1.0).mul(t1).add(s)).add(1.0);\n\t},\n\t{ t: 'float', return: 'float' },\n);\nexport const easeInOutBack = /*@__PURE__*/ Fn(\n\t([t_immutable]) => {\n\t\tconst t = t_immutable.toVar();\n\t\tconst s = float(1.70158 * 1.525);\n\t\tt.mulAssign(2.0);\n\t\tIf(t.lessThan(1.0), () => mul(0.5, t.mul(t).mul(s.add(1.0).mul(t).sub(s))));\n\t\tt.subAssign(2.0);\n\t\treturn mul(0.5, t.mul(t).mul(s.add(1.0).mul(t).add(s)).add(2.0));\n\t},\n\t{ t: 'float', return: 'float' },\n);\n\n// Bounce\nexport const easeOutBounce = /*@__PURE__*/ Fn(\n\t([t_immutable]) => {\n\t\tconst t = t_immutable.toVar();\n\t\tIf(t.lessThan(1.0 / 2.75), () => mul(7.5625, t).mul(t))\n\t\t\t.ElseIf(t.lessThan(2.0 / 2.75), () => {\n\t\t\t\tt.subAssign(1.5 / 2.75);\n\t\t\t\treturn mul(7.5625, t).mul(t).add(0.75);\n\t\t\t})\n\t\t\t.ElseIf(t.lessThan(2.5 / 2.75), () => {\n\t\t\t\tt.subAssign(2.25 / 2.75);\n\t\t\t\treturn mul(7.5625, t).mul(t).add(0.9375);\n\t\t\t})\n\t\t\t.Else(() => {\n\t\t\t\tt.subAssign(2.625 / 2.75);\n\t\t\t\treturn mul(7.5625, t).mul(t).add(0.984375);\n\t\t\t});\n\t},\n\t{ t: 'float', return: 'float' },\n);\nexport const easeInBounce = /*@__PURE__*/ Fn(([t]) => sub(1.0, easeOutBounce(sub(1.0, t))), {\n\tt: 'float',\n\treturn: 'float',\n});\nexport const easeInOutBounce = /*@__PURE__*/ Fn(\n\t([t]) =>\n\t\tselect(\n\t\t\tt.lessThan(0.5),\n\t\t\tsub(1.0, easeOutBounce(sub(1.0, mul(2.0, t)))).mul(0.5),\n\t\t\tadd(1.0, easeOutBounce(mul(2.0, t).sub(1.0))).mul(0.5),\n\t\t),\n\t{ t: 'float', return: 'float' },\n);\n\n/**\n * Applies an easing function based on its index in EASE_FUNCTIONS.\n * Used by the particle shader to select the correct easing at runtime.\n */\nexport const applyEasing = /*@__PURE__*/ Fn(\n\t([t, easingId]) => {\n\t\tSwitch(easingId)\n\t\t\t.Case(0, () => easeLinear(t))\n\t\t\t.Case(1, () => easeInPower1(t))\n\t\t\t.Case(2, () => easeOutPower1(t))\n\t\t\t.Case(3, () => easeInOutPower1(t))\n\t\t\t.Case(4, () => easeInPower2(t))\n\t\t\t.Case(5, () => easeOutPower2(t))\n\t\t\t.Case(6, () => easeInOutPower2(t))\n\t\t\t.Case(7, () => easeInPower3(t))\n\t\t\t.Case(8, () => easeOutPower3(t))\n\t\t\t.Case(9, () => easeInOutPower3(t))\n\t\t\t.Case(10, () => easeInPower4(t))\n\t\t\t.Case(11, () => easeOutPower4(t))\n\t\t\t.Case(12, () => easeInOutPower4(t))\n\t\t\t.Case(13, () => easeInQuad(t))\n\t\t\t.Case(14, () => easeOutQuad(t))\n\t\t\t.Case(15, () => easeInOutQuad(t))\n\t\t\t.Case(16, () => easeInCubic(t))\n\t\t\t.Case(17, () => easeOutCubic(t))\n\t\t\t.Case(18, () => easeInOutCubic(t))\n\t\t\t.Case(19, () => easeInQuart(t))\n\t\t\t.Case(20, () => easeOutQuart(t))\n\t\t\t.Case(21, () => easeInOutQuart(t))\n\t\t\t.Case(22, () => easeInQuint(t))\n\t\t\t.Case(23, () => easeOutQuint(t))\n\t\t\t.Case(24, () => easeInOutQuint(t))\n\t\t\t.Case(25, () => easeInSine(t))\n\t\t\t.Case(26, () => easeOutSine(t))\n\t\t\t.Case(27, () => easeInOutSine(t))\n\t\t\t.Case(28, () => easeInExpo(t))\n\t\t\t.Case(29, () => easeOutExpo(t))\n\t\t\t.Case(30, () => easeInOutExpo(t))\n\t\t\t.Case(31, () => easeInCirc(t))\n\t\t\t.Case(32, () => easeOutCirc(t))\n\t\t\t.Case(33, () => easeInOutCirc(t))\n\t\t\t.Case(34, () => easeInElastic(t))\n\t\t\t.Case(35, () => easeOutElastic(t))\n\t\t\t.Case(36, () => easeInOutElastic(t))\n\t\t\t.Case(37, () => easeInBack(t))\n\t\t\t.Case(38, () => easeOutBack(t))\n\t\t\t.Case(39, () => easeInOutBack(t));\n\t\treturn t;\n\t},\n\t{ t: 'float', easingId: 'int', return: 'float' },\n);\n","/** Generates a random float within [min, max). */\nexport function randFloat(min: number, max: number): number {\n\treturn Math.random() * (max - min) + min;\n}\n\n/** Generates a random integer within [min, max]. */\nexport function randInt(min: number, max: number): number {\n\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n}\n","import { RenderMode } from '../../preset-builder';\n\nimport {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const electricityArcPreset = defineSemanticParticlePreset({\n\tfamily: 'electricity',\n\tvariant: 'arc',\n\tdescription: 'directed snapping bridge of charge',\n\taxes: {\n\t\t'continuity vs discontinuity': 'semi-continuous',\n\t\t'branching tendency': 'medium',\n\t\t'snap/crackle quality': 'high',\n\t\t'seeking behavior': 'medium',\n\t\t'charge buildup': 'medium',\n\t\t'rhythmic pulsing': 'low',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 0.7,\n\t\t\tlooping: true,\n\t\t\tcolor: '#60a5fa',\n\t\t\tlife: [0.12, 0.26],\n\t\t\tsize: [0.06, 0.14],\n\t\t\tspeed: [2.4, 4],\n\t\t\trotation: [-0.3, 0.3],\n\t\t\topacity: 0.96,\n\t\t\trenderMode: RenderMode.StretchedBillBoard,\n\t\t},\n\t\temission: { type: 'rate', rate: 28 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.06,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.05,\n\t\t\tspeed: [1.2, 2.4],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#ffffff', 0],\n\t\t\t\t\t['#7dd3fc', 0.3],\n\t\t\t\t\t['#2563eb', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.2, 0],\n\t\t\t\t\t[1, 0.05],\n\t\t\t\t\t[0.46, 0.5],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.7, 0.96, 0.82, 0.26],\n\t\t\tspeedOverLife: [1.08, 0.94, 0.7, 0.38],\n\t\t\tnoise: {\n\t\t\t\tfrequency: [2.4, 4.8],\n\t\t\t\tpower: [0.05, 0.12],\n\t\t\t\tpositionAmount: [0.14, 0.28],\n\t\t\t\trotationAmount: [0.04, 0.12],\n\t\t\t},\n\t\t},\n\t\trendererEmitterSettings: {\n\t\t\tspeedFactor: 0.62,\n\t\t\tlengthFactor: 1.16,\n\t\t},\n\t},\n});\n\nexport function arc(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(electricityArcPreset, options);\n}\n","import {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const electricityPulsePreset = defineSemanticParticlePreset({\n\tfamily: 'electricity',\n\tvariant: 'pulse',\n\tdescription: 'rhythmic swelling packet of charge',\n\taxes: {\n\t\t'continuity vs discontinuity': 'discrete rhythmic',\n\t\t'branching tendency': 'low',\n\t\t'snap/crackle quality': 'medium',\n\t\t'seeking behavior': 'low',\n\t\t'charge buildup': 'medium',\n\t\t'rhythmic pulsing': 'high',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 0.28,\n\t\t\tcolor: '#a5f3fc',\n\t\t\tlife: [0.14, 0.3],\n\t\t\tsize: [0.18, 0.34],\n\t\t\tspeed: [0.18, 0.42],\n\t\t\topacity: 0.88,\n\t\t},\n\t\temission: { type: 'burst', count: 10 },\n\t\tshape: {\n\t\t\ttype: 'sphere',\n\t\t\tradius: 0.04,\n\t\t\tthickness: 0.5,\n\t\t\tspeed: [0.02, 0.08],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#ffffff', 0],\n\t\t\t\t\t['#a5f3fc', 0.4],\n\t\t\t\t\t['#0891b2', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.14, 0],\n\t\t\t\t\t[0.92, 0.08],\n\t\t\t\t\t[0.42, 0.54],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.2, 0.92, 1.26, 0.18],\n\t\t},\n\t},\n});\n\nexport function pulse(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(electricityPulsePreset, options);\n}\n","import { RenderMode } from '../../preset-builder';\n\nimport {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const electricitySparkPreset = defineSemanticParticlePreset({\n\tfamily: 'electricity',\n\tvariant: 'spark',\n\tdescription: 'tiny discontinuous discharge',\n\taxes: {\n\t\t'continuity vs discontinuity': 'highly discontinuous',\n\t\t'branching tendency': 'low',\n\t\t'snap/crackle quality': 'high',\n\t\t'seeking behavior': 'low',\n\t\t'charge buildup': 'low',\n\t\t'rhythmic pulsing': 'low',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 0.2,\n\t\t\tcolor: '#7dd3fc',\n\t\t\tlife: [0.08, 0.18],\n\t\t\tsize: [0.08, 0.16],\n\t\t\tspeed: [2.2, 4.2],\n\t\t\trotation: [-Math.PI, Math.PI],\n\t\t\topacity: 0.92,\n\t\t\trenderMode: RenderMode.StretchedBillBoard,\n\t\t},\n\t\temission: { type: 'burst', count: 12 },\n\t\tshape: {\n\t\t\ttype: 'sphere',\n\t\t\tradius: 0.06,\n\t\t\tthickness: 0.95,\n\t\t\tspeed: [0.8, 1.6],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#ffffff', 0],\n\t\t\t\t\t['#bae6fd', 0.3],\n\t\t\t\t\t['#38bdf8', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.22, 0],\n\t\t\t\t\t[1, 0.06],\n\t\t\t\t\t[0.48, 0.4],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.44, 0.98, 0.7, 0.04],\n\t\t\tspeedOverLife: [1.24, 0.9, 0.36, 0.04],\n\t\t},\n\t\trendererEmitterSettings: {\n\t\t\tspeedFactor: 0.46,\n\t\t\tlengthFactor: 1.02,\n\t\t},\n\t},\n});\n\nexport function spark(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(electricitySparkPreset, options);\n}\n","import { RenderMode } from '../../preset-builder';\n\nimport {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const electricityStormPreset = defineSemanticParticlePreset({\n\tfamily: 'electricity',\n\tvariant: 'storm',\n\tdescription: 'restless volume of crackling atmospheric charge',\n\taxes: {\n\t\t'continuity vs discontinuity': 'mixed',\n\t\t'branching tendency': 'high',\n\t\t'snap/crackle quality': 'high',\n\t\t'seeking behavior': 'medium-high',\n\t\t'charge buildup': 'high',\n\t\t'rhythmic pulsing': 'medium',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 1.2,\n\t\t\tlooping: true,\n\t\t\tcolor: '#38bdf8',\n\t\t\tlife: [0.32, 0.82],\n\t\t\tsize: [0.08, 0.2],\n\t\t\tspeed: [2.2, 4.8],\n\t\t\trotation: [-Math.PI, Math.PI],\n\t\t\topacity: 0.94,\n\t\t\trenderMode: RenderMode.StretchedBillBoard,\n\t\t},\n\t\temission: { type: 'rate', rate: 34 },\n\t\tshape: {\n\t\t\ttype: 'sphere',\n\t\t\tradius: 0.16,\n\t\t\tthickness: 0.98,\n\t\t\tspeed: [1, 2],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#ffffff', 0],\n\t\t\t\t\t['#67e8f9', 0.25],\n\t\t\t\t\t['#2563eb', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.18, 0],\n\t\t\t\t\t[0.98, 0.06],\n\t\t\t\t\t[0.5, 0.5],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.62, 0.96, 0.84, 0.26],\n\t\t\tspeedOverLife: [1.18, 0.94, 0.66, 0.32],\n\t\t\tnoise: {\n\t\t\t\tfrequency: [4.8, 8.4],\n\t\t\t\tpower: [0.08, 0.18],\n\t\t\t\tpositionAmount: [0.18, 0.38],\n\t\t\t\trotationAmount: [0.08, 0.18],\n\t\t\t},\n\t\t},\n\t\trendererEmitterSettings: {\n\t\t\tspeedFactor: 0.66,\n\t\t\tlengthFactor: 1.18,\n\t\t},\n\t},\n});\n\nexport function storm(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(electricityStormPreset, options);\n}\n","import { RenderMode } from '../../preset-builder';\n\nimport {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const electricitySurgePreset = defineSemanticParticlePreset({\n\tfamily: 'electricity',\n\tvariant: 'surge',\n\tdescription: 'charge-rich spike that overwhelms the space',\n\taxes: {\n\t\t'continuity vs discontinuity': 'bursting',\n\t\t'branching tendency': 'medium',\n\t\t'snap/crackle quality': 'high',\n\t\t'seeking behavior': 'medium',\n\t\t'charge buildup': 'high',\n\t\t'rhythmic pulsing': 'medium',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 0.34,\n\t\t\tcolor: '#38bdf8',\n\t\t\tlife: [0.18, 0.36],\n\t\t\tsize: [0.12, 0.26],\n\t\t\tspeed: [2.8, 5.2],\n\t\t\trotation: [-Math.PI, Math.PI],\n\t\t\topacity: 0.98,\n\t\t\trenderMode: RenderMode.StretchedBillBoard,\n\t\t},\n\t\temission: { type: 'burst', count: 24 },\n\t\tshape: {\n\t\t\ttype: 'sphere',\n\t\t\tradius: 0.08,\n\t\t\tthickness: 0.98,\n\t\t\tspeed: [1.1, 2.2],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#ffffff', 0],\n\t\t\t\t\t['#67e8f9', 0.22],\n\t\t\t\t\t['#0ea5e9', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.22, 0],\n\t\t\t\t\t[1, 0.04],\n\t\t\t\t\t[0.52, 0.44],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.32, 0.9, 0.84, 0.08],\n\t\t\tspeedOverLife: [1.22, 0.88, 0.42, 0.06],\n\t\t\tnoise: {\n\t\t\t\tfrequency: [4.5, 8],\n\t\t\t\tpower: [0.08, 0.18],\n\t\t\t\tpositionAmount: [0.22, 0.42],\n\t\t\t\trotationAmount: [0.08, 0.16],\n\t\t\t},\n\t\t},\n\t\trendererEmitterSettings: {\n\t\t\tspeedFactor: 0.68,\n\t\t\tlengthFactor: 1.2,\n\t\t},\n\t},\n});\n\nexport function surge(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(electricitySurgePreset, options);\n}\n","export { arc, electricityArcPreset } from './arc';\nexport { pulse, electricityPulsePreset } from './pulse';\nexport { spark, electricitySparkPreset } from './spark';\nexport { storm, electricityStormPreset } from './storm';\nexport { surge, electricitySurgePreset } from './surge';\n\nimport { arc } from './arc';\nimport { pulse } from './pulse';\nimport { spark } from './spark';\nimport { storm } from './storm';\nimport { surge } from './surge';\n\nexport const electricityPresets = {\n\tspark,\n\tarc,\n\tsurge,\n\tpulse,\n\tstorm,\n} as const;\n","import { RenderMode } from '../../preset-builder';\n\nimport {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const fireBlazePreset = defineSemanticParticlePreset({\n\tfamily: 'fire',\n\tvariant: 'blaze',\n\tdescription: 'sustained, strong open burning',\n\taxes: {\n\t\t'heat feel': 'intense',\n\t\t'hunger/spread tendency': 'high',\n\t\t'smoke affinity': 'medium',\n\t\tturbulence: 'high',\n\t\tresiduality: 'medium',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 1.8,\n\t\t\tlooping: true,\n\t\t\tcolor: '#f97316',\n\t\t\tlife: [0.55, 1.1],\n\t\t\tsize: [0.32, 0.62],\n\t\t\tspeed: [0.55, 1.4],\n\t\t\trotation: [-0.24, 0.24],\n\t\t\topacity: 0.96,\n\t\t\trenderMode: RenderMode.VerticalBillBoard,\n\t\t},\n\t\temission: { type: 'rate', rate: 42 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.18,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.28,\n\t\t\tspeed: [0.35, 0.95],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#ffffff', 0],\n\t\t\t\t\t['#fde68a', 0.18],\n\t\t\t\t\t['#fb923c', 0.5],\n\t\t\t\t\t['#ef4444', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.18, 0],\n\t\t\t\t\t[1, 0.08],\n\t\t\t\t\t[0.56, 0.54],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.45, 0.92, 1.14, 0.22],\n\t\t\tspeedOverLife: [1.08, 0.96, 0.62, 0.16],\n\t\t\tforceOverLife: {\n\t\t\t\ty: [0.38, 0.72],\n\t\t\t},\n\t\t\tnoise: {\n\t\t\t\tfrequency: [4.5, 6.5],\n\t\t\t\tpower: [0.1, 0.18],\n\t\t\t\tpositionAmount: [0.32, 0.55],\n\t\t\t\trotationAmount: [0.18, 0.3],\n\t\t\t},\n\t\t},\n\t},\n});\n\nexport function blaze(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(fireBlazePreset, options);\n}\n","import {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const fireEmberPreset = defineSemanticParticlePreset({\n\tfamily: 'fire',\n\tvariant: 'ember',\n\tdescription: 'lingering, warm, residual, drifting',\n\taxes: {\n\t\t'heat feel': 'warm',\n\t\t'hunger/spread tendency': 'low',\n\t\t'smoke affinity': 'medium',\n\t\tturbulence: 'low',\n\t\tresiduality: 'high',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 2.2,\n\t\t\tlooping: true,\n\t\t\tcolor: '#fb923c',\n\t\t\tlife: [1.1, 2.2],\n\t\t\tsize: [0.05, 0.14],\n\t\t\tspeed: [0.08, 0.32],\n\t\t\trotation: [-0.45, 0.45],\n\t\t\topacity: 0.9,\n\t\t},\n\t\temission: { type: 'rate', rate: 8 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.12,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.22,\n\t\t\tspeed: [0.08, 0.26],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#fff7d1', 0],\n\t\t\t\t\t['#fb923c', 0.35],\n\t\t\t\t\t['#b45309', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.12, 0],\n\t\t\t\t\t[0.9, 0.12],\n\t\t\t\t\t[0.42, 0.7],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.42, 0.9, 0.72, 0.18],\n\t\t\tforceOverLife: {\n\t\t\t\ty: [0.18, 0.42],\n\t\t\t},\n\t\t\tnoise: {\n\t\t\t\tfrequency: [1.2, 2.6],\n\t\t\t\tpower: [0.02, 0.08],\n\t\t\t\tpositionAmount: [0.06, 0.14],\n\t\t\t\trotationAmount: [0.04, 0.1],\n\t\t\t},\n\t\t},\n\t},\n});\n\nexport function ember(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(fireEmberPreset, options);\n}\n","import { RenderMode } from '../../preset-builder';\n\nimport {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const fireFlameletPreset = defineSemanticParticlePreset({\n\tfamily: 'fire',\n\tvariant: 'flamelet',\n\tdescription: 'small coherent tongue of flame',\n\taxes: {\n\t\t'heat feel': 'hot',\n\t\t'hunger/spread tendency': 'medium',\n\t\t'smoke affinity': 'low',\n\t\tturbulence: 'medium',\n\t\tresiduality: 'low',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 1.2,\n\t\t\tlooping: true,\n\t\t\tcolor: '#fb923c',\n\t\t\tlife: [0.48, 0.9],\n\t\t\tsize: [0.2, 0.38],\n\t\t\tspeed: [0.35, 0.9],\n\t\t\trotation: [-0.18, 0.18],\n\t\t\topacity: 0.94,\n\t\t\trenderMode: RenderMode.VerticalBillBoard,\n\t\t},\n\t\temission: { type: 'rate', rate: 22 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.1,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.18,\n\t\t\tspeed: [0.3, 0.72],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#fff7d1', 0],\n\t\t\t\t\t['#fbbf24', 0.24],\n\t\t\t\t\t['#fb923c', 0.62],\n\t\t\t\t\t['#ef4444', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.16, 0],\n\t\t\t\t\t[0.94, 0.1],\n\t\t\t\t\t[0.48, 0.58],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.44, 0.92, 1.08, 0.16],\n\t\t\tspeedOverLife: [1.08, 0.95, 0.62, 0.18],\n\t\t\tforceOverLife: {\n\t\t\t\ty: [0.3, 0.55],\n\t\t\t},\n\t\t\tnoise: {\n\t\t\t\tfrequency: [3, 5],\n\t\t\t\tpower: [0.08, 0.14],\n\t\t\t\tpositionAmount: [0.24, 0.42],\n\t\t\t\trotationAmount: [0.16, 0.24],\n\t\t\t},\n\t\t},\n\t},\n});\n\nexport function flamelet(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(fireFlameletPreset, options);\n}\n","import {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const fireSmolderPreset = defineSemanticParticlePreset({\n\tfamily: 'fire',\n\tvariant: 'smolder',\n\tdescription: 'low-oxygen, persistent, smoky heat',\n\taxes: {\n\t\t'heat feel': 'buried-hot',\n\t\t'hunger/spread tendency': 'low',\n\t\t'smoke affinity': 'high',\n\t\tturbulence: 'low',\n\t\tresiduality: 'high',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 2.6,\n\t\t\tlooping: true,\n\t\t\tcolor: '#c2410c',\n\t\t\tlife: [1.4, 2.8],\n\t\t\tsize: [0.28, 0.58],\n\t\t\tspeed: [0.06, 0.22],\n\t\t\trotation: [-0.35, 0.35],\n\t\t\topacity: 0.76,\n\t\t},\n\t\temission: { type: 'rate', rate: 14 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.16,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.12,\n\t\t\tspeed: [0.04, 0.16],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#fed7aa', 0],\n\t\t\t\t\t['#c2410c', 0.28],\n\t\t\t\t\t['#525252', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.14, 0],\n\t\t\t\t\t[0.76, 0.12],\n\t\t\t\t\t[0.4, 0.68],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.34, 0.86, 1.08, 0.46],\n\t\t\tforceOverLife: {\n\t\t\t\ty: [0.08, 0.2],\n\t\t\t},\n\t\t\tnoise: {\n\t\t\t\tfrequency: [1.6, 3.1],\n\t\t\t\tpower: [0.04, 0.12],\n\t\t\t\tpositionAmount: [0.12, 0.26],\n\t\t\t\trotationAmount: [0.06, 0.14],\n\t\t\t},\n\t\t},\n\t},\n});\n\nexport function smolder(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(fireSmolderPreset, options);\n}\n","import { RenderMode } from '../../preset-builder';\n\nimport {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const fireSparkPreset = defineSemanticParticlePreset({\n\tfamily: 'fire',\n\tvariant: 'spark',\n\tdescription: 'tiny, sudden, energetic, fleeting',\n\taxes: {\n\t\t'heat feel': 'sharp-hot',\n\t\t'hunger/spread tendency': 'low',\n\t\t'smoke affinity': 'low',\n\t\tturbulence: 'high',\n\t\tresiduality: 'low',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 0.24,\n\t\t\tcolor: '#ffd166',\n\t\t\tlife: [0.12, 0.24],\n\t\t\tsize: [0.08, 0.16],\n\t\t\tspeed: [1.8, 4.6],\n\t\t\trotation: [-Math.PI, Math.PI],\n\t\t\trenderMode: RenderMode.StretchedBillBoard,\n\t\t},\n\t\temission: { type: 'burst', count: 10 },\n\t\tshape: {\n\t\t\ttype: 'sphere',\n\t\t\tradius: 0.05,\n\t\t\tthickness: 0.92,\n\t\t\tspeed: [0.45, 1.2],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#ffffff', 0],\n\t\t\t\t\t['#fde68a', 0.2],\n\t\t\t\t\t['#fb923c', 0.62],\n\t\t\t\t\t['#ef4444', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.18, 0],\n\t\t\t\t\t[1, 0.08],\n\t\t\t\t\t[0.52, 0.5],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.48, 1.08, 0.88, 0.06],\n\t\t\tspeedOverLife: [1.18, 0.88, 0.42, 0.04],\n\t\t},\n\t\trendererEmitterSettings: {\n\t\t\tspeedFactor: 0.55,\n\t\t\tlengthFactor: 1.08,\n\t\t},\n\t},\n});\n\nexport function spark(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(fireSparkPreset, options);\n}\n","export { blaze, fireBlazePreset } from './blaze';\nexport { ember, fireEmberPreset } from './ember';\nexport { flamelet, fireFlameletPreset } from './flamelet';\nexport { smolder, fireSmolderPreset } from './smolder';\nexport { spark, fireSparkPreset } from './spark';\n\nimport { blaze } from './blaze';\nimport { ember } from './ember';\nimport { flamelet } from './flamelet';\nimport { smolder } from './smolder';\nimport { spark } from './spark';\n\nexport const firePresets = {\n\tspark,\n\tember,\n\tflamelet,\n\tblaze,\n\tsmolder,\n} as const;\n","import {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const gasHazePreset = defineSemanticParticlePreset({\n\tfamily: 'gas',\n\tvariant: 'haze',\n\tdescription: 'broad, thin atmospheric contamination',\n\taxes: {\n\t\t'opacity feel': 'low',\n\t\ttoxicity: 'low-medium',\n\t\tbuoyancy: 'neutral',\n\t\t'spread tendency': 'high',\n\t\tthickness: 'thin',\n\t\t'staining / contaminating character': 'low',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 4.4,\n\t\t\tlooping: true,\n\t\t\tcolor: '#cbd5e1',\n\t\t\tlife: [3.4, 5.4],\n\t\t\tsize: [0.9, 1.7],\n\t\t\tspeed: [0.02, 0.08],\n\t\t\trotation: [-Math.PI, Math.PI],\n\t\t\topacity: 0.18,\n\t\t},\n\t\temission: { type: 'rate', rate: 10 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.64,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.5,\n\t\t\tspeed: [0.01, 0.04],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#f8fafc', 0],\n\t\t\t\t\t['#cbd5e1', 0.4],\n\t\t\t\t\t['#94a3b8', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.04, 0],\n\t\t\t\t\t[0.2, 0.24],\n\t\t\t\t\t[0.08, 0.88],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.88, 1.08, 1.28, 1.42],\n\t\t\tnoise: {\n\t\t\t\tfrequency: [0.6, 1.4],\n\t\t\t\tpower: [0.02, 0.06],\n\t\t\t\tpositionAmount: [0.08, 0.16],\n\t\t\t\trotationAmount: [0.06, 0.1],\n\t\t\t},\n\t\t},\n\t},\n});\n\nexport function haze(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(gasHazePreset, options);\n}\n","import {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const gasMiasmaPreset = defineSemanticParticlePreset({\n\tfamily: 'gas',\n\tvariant: 'miasma',\n\tdescription: 'thick, toxic, contaminating exhalation',\n\taxes: {\n\t\t'opacity feel': 'medium',\n\t\ttoxicity: 'high',\n\t\tbuoyancy: 'low-medium',\n\t\t'spread tendency': 'high',\n\t\tthickness: 'sticky',\n\t\t'staining / contaminating character': 'high',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 3.8,\n\t\t\tlooping: true,\n\t\t\tcolor: '#84cc16',\n\t\t\tlife: [2.8, 4.6],\n\t\t\tsize: [0.52, 1.08],\n\t\t\tspeed: [0.03, 0.16],\n\t\t\trotation: [-Math.PI, Math.PI],\n\t\t\topacity: 0.5,\n\t\t},\n\t\temission: { type: 'rate', rate: 16 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.3,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.3,\n\t\t\tspeed: [0.02, 0.08],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#ecfccb', 0],\n\t\t\t\t\t['#84cc16', 0.4],\n\t\t\t\t\t['#3f6212', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.08, 0],\n\t\t\t\t\t[0.58, 0.14],\n\t\t\t\t\t[0.24, 0.8],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.4, 0.92, 1.3, 1.9],\n\t\t\tnoise: {\n\t\t\t\tfrequency: [1.8, 3.8],\n\t\t\t\tpower: [0.08, 0.18],\n\t\t\t\tpositionAmount: [0.16, 0.34],\n\t\t\t\trotationAmount: [0.08, 0.18],\n\t\t\t},\n\t\t},\n\t},\n});\n\nexport function miasma(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(gasMiasmaPreset, options);\n}\n","import {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const gasPlumePreset = defineSemanticParticlePreset({\n\tfamily: 'gas',\n\tvariant: 'plume',\n\tdescription: 'columnar rising release with strong lift',\n\taxes: {\n\t\t'opacity feel': 'medium',\n\t\ttoxicity: 'medium',\n\t\tbuoyancy: 'very-high',\n\t\t'spread tendency': 'medium',\n\t\tthickness: 'medium',\n\t\t'staining / contaminating character': 'medium',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 2.8,\n\t\t\tlooping: true,\n\t\t\tcolor: '#94a3b8',\n\t\t\tlife: [1.8, 3.2],\n\t\t\tsize: [0.32, 0.72],\n\t\t\tspeed: [0.16, 0.52],\n\t\t\trotation: [-Math.PI, Math.PI],\n\t\t\topacity: 0.48,\n\t\t},\n\t\temission: { type: 'rate', rate: 22 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.18,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.18,\n\t\t\tspeed: [0.08, 0.24],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#e2e8f0', 0],\n\t\t\t\t\t['#94a3b8', 0.36],\n\t\t\t\t\t['#475569', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.06, 0],\n\t\t\t\t\t[0.54, 0.14],\n\t\t\t\t\t[0.2, 0.84],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.42, 0.92, 1.36, 1.84],\n\t\t\tforceOverLife: {\n\t\t\t\ty: [0.28, 0.6],\n\t\t\t},\n\t\t\tnoise: {\n\t\t\t\tfrequency: [1.6, 3.4],\n\t\t\t\tpower: [0.08, 0.14],\n\t\t\t\tpositionAmount: [0.14, 0.28],\n\t\t\t\trotationAmount: [0.08, 0.16],\n\t\t\t},\n\t\t},\n\t},\n});\n\nexport function plume(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(gasPlumePreset, options);\n}\n","import {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const gasSmokePreset = defineSemanticParticlePreset({\n\tfamily: 'gas',\n\tvariant: 'smoke',\n\tdescription: 'opaque, buoyant, lingering combustion residue',\n\taxes: {\n\t\t'opacity feel': 'medium-high',\n\t\ttoxicity: 'medium',\n\t\tbuoyancy: 'high',\n\t\t'spread tendency': 'medium',\n\t\tthickness: 'medium',\n\t\t'staining / contaminating character': 'medium',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 3.2,\n\t\t\tlooping: true,\n\t\t\tcolor: '#737373',\n\t\t\tlife: [2.4, 4.2],\n\t\t\tsize: [0.45, 0.92],\n\t\t\tspeed: [0.08, 0.3],\n\t\t\trotation: [-Math.PI, Math.PI],\n\t\t\topacity: 0.58,\n\t\t},\n\t\temission: { type: 'rate', rate: 14 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.24,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.28,\n\t\t\tspeed: [0.04, 0.14],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#d4d4d8', 0],\n\t\t\t\t\t['#737373', 0.4],\n\t\t\t\t\t['#404040', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.08, 0],\n\t\t\t\t\t[0.68, 0.14],\n\t\t\t\t\t[0.24, 0.84],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.38, 0.88, 1.4, 2.08],\n\t\t\tforceOverLife: {\n\t\t\t\ty: [0.12, 0.28],\n\t\t\t},\n\t\t\tnoise: {\n\t\t\t\tfrequency: [1.2, 2.8],\n\t\t\t\tpower: [0.08, 0.16],\n\t\t\t\tpositionAmount: [0.12, 0.26],\n\t\t\t\trotationAmount: [0.08, 0.18],\n\t\t\t},\n\t\t},\n\t},\n});\n\nexport function smoke(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(gasSmokePreset, options);\n}\n","import {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const gasVaporPreset = defineSemanticParticlePreset({\n\tfamily: 'gas',\n\tvariant: 'vapor',\n\tdescription: 'visible gaseous release with light buoyancy',\n\taxes: {\n\t\t'opacity feel': 'light',\n\t\ttoxicity: 'neutral',\n\t\tbuoyancy: 'high',\n\t\t'spread tendency': 'medium',\n\t\tthickness: 'thin',\n\t\t'staining / contaminating character': 'low',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 3,\n\t\t\tlooping: true,\n\t\t\tcolor: '#e2e8f0',\n\t\t\tlife: [2.2, 3.6],\n\t\t\tsize: [0.38, 0.78],\n\t\t\tspeed: [0.04, 0.18],\n\t\t\trotation: [-Math.PI, Math.PI],\n\t\t\topacity: 0.28,\n\t\t},\n\t\temission: { type: 'rate', rate: 18 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.28,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.36,\n\t\t\tspeed: [0.02, 0.08],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#f8fafc', 0],\n\t\t\t\t\t['#e2e8f0', 0.36],\n\t\t\t\t\t['#cbd5e1', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.06, 0],\n\t\t\t\t\t[0.34, 0.22],\n\t\t\t\t\t[0.12, 0.84],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.42, 0.9, 1.38, 1.98],\n\t\t\tforceOverLife: {\n\t\t\t\ty: [0.06, 0.18],\n\t\t\t},\n\t\t\tnoise: {\n\t\t\t\tfrequency: [1, 2],\n\t\t\t\tpower: [0.04, 0.08],\n\t\t\t\tpositionAmount: [0.1, 0.2],\n\t\t\t\trotationAmount: [0.08, 0.14],\n\t\t\t},\n\t\t},\n\t},\n});\n\nexport function vapor(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(gasVaporPreset, options);\n}\n","export { haze, gasHazePreset } from './haze';\nexport { miasma, gasMiasmaPreset } from './miasma';\nexport { plume, gasPlumePreset } from './plume';\nexport { smoke, gasSmokePreset } from './smoke';\nexport { vapor, gasVaporPreset } from './vapor';\n\nimport { haze } from './haze';\nimport { miasma } from './miasma';\nimport { plume } from './plume';\nimport { smoke } from './smoke';\nimport { vapor } from './vapor';\n\nexport const gasPresets = {\n\tvapor,\n\tsmoke,\n\thaze,\n\tplume,\n\tmiasma,\n} as const;\n","import {\n\tcreateMagicModifier,\n\ttype ParticleMagicModifierOptions,\n} from '../../preset-builder';\n\nexport function arcane(\n\toptions: Omit<ParticleMagicModifierOptions, 'alignment'> = {},\n) {\n\treturn createMagicModifier('arcane', options);\n}\n","import {\n\tcreateMagicModifier,\n\ttype ParticleMagicModifierOptions,\n} from '../../preset-builder';\n\nexport function corrupted(\n\toptions: Omit<ParticleMagicModifierOptions, 'alignment'> = {},\n) {\n\treturn createMagicModifier('corrupted', options);\n}\n","import {\n\tcreateMagicModifier,\n\ttype ParticleMagicModifierOptions,\n} from '../../preset-builder';\n\nexport function holy(\n\toptions: Omit<ParticleMagicModifierOptions, 'alignment'> = {},\n) {\n\treturn createMagicModifier('holy', options);\n}\n","import {\n\tcreateMagicModifier,\n\ttype ParticleMagicModifierOptions,\n} from '../../preset-builder';\n\nexport function nature(\n\toptions: Omit<ParticleMagicModifierOptions, 'alignment'> = {},\n) {\n\treturn createMagicModifier('nature', options);\n}\n","import {\n\tcreateMagicModifier,\n\ttype ParticleMagicModifierOptions,\n} from '../../preset-builder';\n\nexport function psychic(\n\toptions: Omit<ParticleMagicModifierOptions, 'alignment'> = {},\n) {\n\treturn createMagicModifier('psychic', options);\n}\n","import {\n\tcreateMagicModifier,\n\ttype ParticleMagicModifierOptions,\n} from '../../preset-builder';\n\nexport function voidMagic(\n\toptions: Omit<ParticleMagicModifierOptions, 'alignment'> = {},\n) {\n\treturn createMagicModifier('void', options);\n}\n","export { arcane } from './arcane';\nexport { corrupted } from './corrupted';\nexport { holy } from './holy';\nexport { nature } from './nature';\nexport { psychic } from './psychic';\nexport { voidMagic } from './void';\n\nimport { arcane } from './arcane';\nimport { corrupted } from './corrupted';\nimport { holy } from './holy';\nimport { nature } from './nature';\nimport { psychic } from './psychic';\nimport { voidMagic } from './void';\n\nexport const magicPresets = {\n\tarcane,\n\tholy,\n\tcorrupted,\n\tnature,\n\tvoid: voidMagic,\n\tpsychic,\n} as const;\n","import { RenderMode } from '../../preset-builder';\n\nimport {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const waterDrizzlePreset = defineSemanticParticlePreset({\n\tfamily: 'water',\n\tvariant: 'drizzle',\n\tdescription: 'soft, continuous, light fall',\n\taxes: {\n\t\tpressure: 'low',\n\t\t'surface tension feel': 'light',\n\t\taeration: 'low',\n\t\tcoherence: 'discrete',\n\t\t'gravitational obedience': 'very-high',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 1.4,\n\t\t\tlooping: true,\n\t\t\tcolor: '#e0f2fe',\n\t\t\tlife: [0.6, 1.05],\n\t\t\tsize: [0.05, 0.1],\n\t\t\tspeed: [2.8, 4.4],\n\t\t\topacity: 0.62,\n\t\t\trenderMode: RenderMode.StretchedBillBoard,\n\t\t},\n\t\temission: { type: 'rate', rate: 26 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.46,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.04,\n\t\t\tspeed: [1.8, 2.6],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#f8fafc', 0],\n\t\t\t\t\t['#e0f2fe', 0.45],\n\t\t\t\t\t['#7dd3fc', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.12, 0],\n\t\t\t\t\t[0.78, 0.08],\n\t\t\t\t\t[0.52, 0.58],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tspeedOverLife: [1.02, 1, 0.94, 0.88],\n\t\t\tforceOverLife: {\n\t\t\t\ty: [-8.2, -6.4],\n\t\t\t},\n\t\t},\n\t\trendererEmitterSettings: {\n\t\t\tspeedFactor: 0.42,\n\t\t\tlengthFactor: 1.24,\n\t\t},\n\t},\n});\n\nexport function drizzle(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(waterDrizzlePreset, options);\n}\n","import {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const waterMistPreset = defineSemanticParticlePreset({\n\tfamily: 'water',\n\tvariant: 'mist',\n\tdescription: 'diffuse suspended moisture',\n\taxes: {\n\t\tpressure: 'low',\n\t\t'surface tension feel': 'soft',\n\t\taeration: 'low',\n\t\tcoherence: 'diffuse',\n\t\t'gravitational obedience': 'low',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 3.2,\n\t\t\tlooping: true,\n\t\t\tcolor: '#dbeafe',\n\t\t\tlife: [2.4, 3.8],\n\t\t\tsize: [0.4, 0.82],\n\t\t\tspeed: [0.05, 0.2],\n\t\t\trotation: [-Math.PI, Math.PI],\n\t\t\topacity: 0.36,\n\t\t},\n\t\temission: { type: 'rate', rate: 16 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.32,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.42,\n\t\t\tspeed: [0.02, 0.08],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#f8fafc', 0],\n\t\t\t\t\t['#dbeafe', 0.35],\n\t\t\t\t\t['#bfdbfe', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.08, 0],\n\t\t\t\t\t[0.44, 0.2],\n\t\t\t\t\t[0.18, 0.82],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.38, 0.86, 1.42, 2.02],\n\t\t\tforceOverLife: {\n\t\t\t\ty: [0.02, 0.12],\n\t\t\t},\n\t\t\tnoise: {\n\t\t\t\tfrequency: [0.8, 1.8],\n\t\t\t\tpower: [0.04, 0.1],\n\t\t\t\tpositionAmount: [0.1, 0.18],\n\t\t\t\trotationAmount: [0.08, 0.14],\n\t\t\t},\n\t\t},\n\t},\n});\n\nexport function mist(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(waterMistPreset, options);\n}\n","import { RenderMode } from '../../preset-builder';\n\nimport {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const waterSplashPreset = defineSemanticParticlePreset({\n\tfamily: 'water',\n\tvariant: 'splash',\n\tdescription: 'sudden impact-driven burst',\n\taxes: {\n\t\tpressure: 'impact-driven',\n\t\t'surface tension feel': 'beaded',\n\t\taeration: 'medium',\n\t\tcoherence: 'shattering',\n\t\t'gravitational obedience': 'high',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 0.34,\n\t\t\tcolor: '#7dd3fc',\n\t\t\tlife: [0.26, 0.55],\n\t\t\tsize: [0.1, 0.22],\n\t\t\tspeed: [1.4, 3.1],\n\t\t\trotation: [-Math.PI, Math.PI],\n\t\t\topacity: 0.82,\n\t\t\trenderMode: RenderMode.StretchedBillBoard,\n\t\t},\n\t\temission: { type: 'burst', count: 18 },\n\t\tshape: {\n\t\t\ttype: 'sphere',\n\t\t\tradius: 0.08,\n\t\t\tthickness: 0.96,\n\t\t\tspeed: [0.7, 1.4],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#ffffff', 0],\n\t\t\t\t\t['#bae6fd', 0.4],\n\t\t\t\t\t['#38bdf8', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.18, 0],\n\t\t\t\t\t[0.88, 0.08],\n\t\t\t\t\t[0.42, 0.54],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.32, 0.86, 0.92, 0.08],\n\t\t\tspeedOverLife: [1.12, 0.88, 0.46, 0.08],\n\t\t\tforceOverLife: {\n\t\t\t\ty: [-4.4, -2.6],\n\t\t\t},\n\t\t},\n\t\trendererEmitterSettings: {\n\t\t\tspeedFactor: 0.36,\n\t\t\tlengthFactor: 0.88,\n\t\t},\n\t},\n});\n\nexport function splash(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(waterSplashPreset, options);\n}\n","import { RenderMode } from '../../preset-builder';\n\nimport {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const waterSprayPreset = defineSemanticParticlePreset({\n\tfamily: 'water',\n\tvariant: 'spray',\n\tdescription: 'fine ejected droplets',\n\taxes: {\n\t\tpressure: 'medium-high',\n\t\t'surface tension feel': 'light',\n\t\taeration: 'medium',\n\t\tcoherence: 'broken',\n\t\t'gravitational obedience': 'high',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 1,\n\t\t\tlooping: true,\n\t\t\tcolor: '#93c5fd',\n\t\t\tlife: [0.45, 0.9],\n\t\t\tsize: [0.08, 0.16],\n\t\t\tspeed: [1.1, 2.3],\n\t\t\trotation: [-Math.PI, Math.PI],\n\t\t\topacity: 0.72,\n\t\t\trenderMode: RenderMode.StretchedBillBoard,\n\t\t},\n\t\temission: { type: 'rate', rate: 38 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.12,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.24,\n\t\t\tspeed: [0.85, 1.8],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#eff6ff', 0],\n\t\t\t\t\t['#93c5fd', 0.45],\n\t\t\t\t\t['#60a5fa', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.16, 0],\n\t\t\t\t\t[0.82, 0.08],\n\t\t\t\t\t[0.52, 0.58],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.72, 0.96, 0.82, 0.28],\n\t\t\tspeedOverLife: [1.04, 0.92, 0.68, 0.38],\n\t\t\tforceOverLife: {\n\t\t\t\ty: [-5.8, -3.8],\n\t\t\t},\n\t\t\tnoise: {\n\t\t\t\tfrequency: [1.2, 2.2],\n\t\t\t\tpower: [0.04, 0.08],\n\t\t\t\tpositionAmount: [0.08, 0.16],\n\t\t\t\trotationAmount: [0.04, 0.08],\n\t\t\t},\n\t\t},\n\t\trendererEmitterSettings: {\n\t\t\tspeedFactor: 0.5,\n\t\t\tlengthFactor: 0.95,\n\t\t},\n\t},\n});\n\nexport function spray(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(waterSprayPreset, options);\n}\n","import { RenderMode } from '../../preset-builder';\n\nimport {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const waterTorrentPreset = defineSemanticParticlePreset({\n\tfamily: 'water',\n\tvariant: 'torrent',\n\tdescription: 'strong, forceful, dense flow',\n\taxes: {\n\t\tpressure: 'high',\n\t\t'surface tension feel': 'driven',\n\t\taeration: 'medium',\n\t\tcoherence: 'strong',\n\t\t'gravitational obedience': 'high',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 1,\n\t\t\tlooping: true,\n\t\t\tcolor: '#38bdf8',\n\t\t\tlife: [0.35, 0.75],\n\t\t\tsize: [0.1, 0.22],\n\t\t\tspeed: [2.6, 4.9],\n\t\t\trotation: [-0.3, 0.3],\n\t\t\topacity: 0.84,\n\t\t\trenderMode: RenderMode.StretchedBillBoard,\n\t\t},\n\t\temission: { type: 'rate', rate: 60 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.18,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.12,\n\t\t\tspeed: [1.8, 3.1],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#f0f9ff', 0],\n\t\t\t\t\t['#7dd3fc', 0.35],\n\t\t\t\t\t['#0ea5e9', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.18, 0],\n\t\t\t\t\t[0.92, 0.08],\n\t\t\t\t\t[0.56, 0.52],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.72, 0.94, 0.84, 0.28],\n\t\t\tspeedOverLife: [1.04, 0.92, 0.68, 0.34],\n\t\t\tforceOverLife: {\n\t\t\t\ty: [-6.8, -4.8],\n\t\t\t},\n\t\t\tnoise: {\n\t\t\t\tfrequency: [1.4, 2.6],\n\t\t\t\tpower: [0.04, 0.09],\n\t\t\t\tpositionAmount: [0.08, 0.14],\n\t\t\t\trotationAmount: [0.06, 0.1],\n\t\t\t},\n\t\t},\n\t\trendererEmitterSettings: {\n\t\t\tspeedFactor: 0.56,\n\t\t\tlengthFactor: 1.08,\n\t\t},\n\t},\n});\n\nexport function torrent(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(waterTorrentPreset, options);\n}\n","export { drizzle, waterDrizzlePreset } from './drizzle';\nexport { mist, waterMistPreset } from './mist';\nexport { splash, waterSplashPreset } from './splash';\nexport { spray, waterSprayPreset } from './spray';\nexport { torrent, waterTorrentPreset } from './torrent';\n\nimport { drizzle } from './drizzle';\nimport { mist } from './mist';\nimport { splash } from './splash';\nimport { spray } from './spray';\nimport { torrent } from './torrent';\n\nexport const waterPresets = {\n\tmist,\n\tspray,\n\tsplash,\n\tdrizzle,\n\ttorrent,\n} as const;\n"],"mappings":";AAAA;AAAA,EACC,oBAAAA;AAAA,EACA;AAAA,OAIM;;;ACMP,YAAYC,YAAW;AACvB,SAAS,WAAAC,UAAS,SAAS,sBAAsB;;;ACiD1C,IAAM,iBAAiC;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAA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AAAA,UACP,CAAC,WAAW,CAAC;AAAA,UACb,CAAC,WAAW,IAAI;AAAA,UAChB,CAAC,WAAW,CAAC;AAAA,QACd;AAAA,QACA,OAAO;AAAA,UACN,CAAC,MAAM,CAAC;AAAA,UACR,CAAC,MAAM,IAAI;AAAA,UACX,CAAC,MAAM,IAAI;AAAA,UACX,CAAC,GAAG,CAAC;AAAA,QACN;AAAA,MACD;AAAA,MACA,cAAc,CAAC,MAAM,MAAM,MAAM,IAAI;AAAA,MACrC,eAAe,CAAC,MAAM,MAAM,MAAM,IAAI;AAAA,MACtC,eAAe;AAAA,QACd,GAAG,CAAC,MAAM,IAAI;AAAA,MACf;AAAA,MACA,OAAO;AAAA,QACN,WAAW,CAAC,KAAK,GAAG;AAAA,QACpB,OAAO,CAAC,MAAM,IAAI;AAAA,QAClB,gBAAgB,CAAC,MAAM,IAAI;AAAA,QAC3B,gBAAgB,CAAC,MAAM,GAAG;AAAA,MAC3B;AAAA,IACD;AAAA,IACA,yBAAyB;AAAA,MACxB,aAAa;AAAA,MACb,cAAc;AAAA,IACf;AAAA,EACD;AACD,CAAC;AAEM,SAAS,QACf,UAAyC,CAAC,GACzC;AACD,SAAO,6BAA6B,oBAAoB,OAAO;AAChE;;;AChEO,IAAM,eAAe;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;","names":["AdditiveBlending","THREE","texture","texture","THREE","If","select","float","Fn","float","Fn","vProgress","If","select","max","texture","AdditiveBlending","count","range","max","spark","spark"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/lib/runtime/wasm-stage-runtime.ts"],"sourcesContent":["/**\n * `WasmStageRuntime` — owns one wasm `WebAssembly.Instance` of\n * `@zylem/runtime` and exposes the unified-Stage FFI as typed TypeScript\n * methods. This is the single simulation adapter for the whole framework:\n * behavior systems talk to it through the {@link BehaviorRuntime} contract,\n * and hosts (e.g. `@zylem/game-lib`) drive it through\n * {@link createSimulation} in `./simulation`.\n */\n\nimport {\n\tloadStageFfi,\n\ttype StageWasmExports,\n\tSTAGE_RENDER_STRIDE,\n\tSTAGE_INPUT_STRIDE,\n\tSTAGE_SNAPSHOT_STRIDE,\n\tSTAGE_EVENT_STRIDE,\n} from '@zylem/runtime';\n\nexport {\n\tSTAGE_RENDER_STRIDE,\n\tSTAGE_INPUT_STRIDE,\n\tSTAGE_SNAPSHOT_STRIDE,\n\tSTAGE_EVENT_STRIDE,\n};\nexport type { StageWasmExports };\n\n/** Sentinel handle for \"no entity / failed allocation\". Mirrors `INVALID_SLOT` in Rust. */\nexport const STAGE_INVALID_SLOT = 0xffffffff;\n\nexport const StageBodyKind = {\n\tDynamic: 0,\n\tStatic: 1,\n\tKinematicPosition: 2,\n\tKinematicVelocity: 3,\n} as const;\n\nexport type StageBodyKindValue = (typeof StageBodyKind)[keyof typeof StageBodyKind];\n\nexport const StageBoundaryDim = {\n\tTwo: 2,\n\tThree: 3,\n} as const;\n\nexport const StageRicochetDim = {\n\tTwo: 2,\n\tThree: 3,\n} as const;\n\nexport const StageRicochetReflection = {\n\tMirror: 0,\n\tAngled: 1,\n} as const;\n\nexport const StageTopDownPlane = {\n\tXy: 0,\n\tXz: 1,\n} as const;\n\nexport const StageEventType = {\n\tCollisionStarted: 1,\n\tCollisionStopped: 2,\n\tBoundaryHit: 3,\n\tRicochet: 4,\n\tRegionEntered: 5,\n\tJumpStarted: 6,\n\tLanded: 7,\n\tWrapped: 8,\n\tCooldownFired: 9,\n} as const;\n\nexport type StageBoundaryDimValue = (typeof StageBoundaryDim)[keyof typeof StageBoundaryDim];\nexport type StageRicochetDimValue = (typeof StageRicochetDim)[keyof typeof StageRicochetDim];\nexport type StageRicochetReflectionValue =\n\t(typeof StageRicochetReflection)[keyof typeof StageRicochetReflection];\nexport type StageTopDownPlaneValue = (typeof StageTopDownPlane)[keyof typeof StageTopDownPlane];\n\n/** Position + rotation snapshot for one runtime slot. */\nexport interface StagePose {\n\tposition: [number, number, number];\n\trotation: [number, number, number, number];\n}\n\nexport interface StageWorldBoundaryOptions {\n\ttop: number;\n\tbottom: number;\n\tleft: number;\n\tright: number;\n\tfront?: number;\n\tback?: number;\n\tpadding?: number;\n}\n\nexport interface StageScreenWrapOptions {\n\twidth: number;\n\theight: number;\n\tcenterX?: number;\n\tcenterY?: number;\n\tedgeThreshold?: number;\n}\n\nexport interface StageRicochetOptions {\n\tminSpeed: number;\n\tmaxSpeed: number;\n\tspeedMultiplier: number;\n\tmaxAngleDeg: number;\n\treflectionMode: StageRicochetReflectionValue;\n}\n\nexport interface StageThrusterOptions {\n\tmaxSpeed: number;\n\tacceleration: number;\n\tturnRateRadPerSec: number;\n\tlinearDamping: number;\n}\n\nexport interface StageTopDownOptions {\n\tplane: StageTopDownPlaneValue;\n\tspeed: number;\n\tfaceMovement?: boolean;\n}\n\nexport interface StageShooter2DOptions {\n\tfireRateHz: number;\n\tmuzzleOffsetX: number;\n\tmuzzleOffsetY: number;\n\tmuzzleSpeed: number;\n}\n\nexport interface StageJumper2DOptions {\n\tjumpForce: number;\n\tmaxJumps: number;\n\tjumpBufferTime: number;\n\tcoyoteTime: number;\n\tgravity: number;\n}\n\nexport interface StageJumper3DOptions {\n\tjumpForce: number;\n\tmaxJumps: number;\n\tgravity: number;\n\t/** Coyote time in seconds (default 0.1). */\n\tcoyoteTime?: number;\n\t/** Jump buffer window in seconds (default 0.08). */\n\tjumpBufferTime?: number;\n}\n\nexport interface StagePlatformer3DOptions {\n\thalfHeight: number;\n\tradius: number;\n\twalkSpeed: number;\n\trunSpeed: number;\n\tjumpForce: number;\n\tmaxJumps: number;\n\tgravity: number;\n\t/** Coyote time in seconds (default 0.1). */\n\tcoyoteTime?: number;\n\t/** Jump buffer window in seconds (default 0.1). */\n\tjumpBufferTime?: number;\n\t/** Velocity multiplier applied on early jump release (default 0.5). */\n\tjumpCutMultiplier?: number;\n\t/** Seconds before a multi-jump becomes available (default 0.15). */\n\tmultiJumpWindow?: number;\n\t/** Max slope angle in degrees the KCC can climb (default 50). */\n\tslopeClimbAngle?: number;\n\t/** Slope angle in degrees past which the character slides (default 40). */\n\tslopeSlideAngle?: number;\n\t/** Autostep max height in world units; 0 disables (default 0.3). */\n\tautostepHeight?: number;\n\t/** Minimum unobstructed width for an autostep (default 0.1). */\n\tautostepMinWidth?: number;\n\t/** Snap-to-ground distance in world units; 0 disables (default 0.3). */\n\tsnapToGroundDistance?: number;\n\t/** KCC collision offset between collider and environment (default 0.05). */\n\tcharacterOffset?: number;\n\t/** Collider local offset X (fallback / override). */\n\toffsetX?: number;\n\t/** Collider local offset Y (fallback / override). */\n\toffsetY?: number;\n\t/** Collider local offset Z (fallback / override). */\n\toffsetZ?: number;\n\t/** 0 = auto-read attached collider; 1 = use stored shape fields. */\n\tshapeSource?: number;\n}\n\nexport const StagePlatformerShapeSource = {\n\tAuto: 0,\n\tOverride: 1,\n} as const;\n\nexport interface StagePlatformer2DOptions {\n\thalfHeight: number;\n\tradius: number;\n\twalkSpeed: number;\n\trunSpeed: number;\n\tjumpForce: number;\n\tmaxJumps: number;\n\tgravity: number;\n\t/** Coyote time in seconds (default 0.1). */\n\tcoyoteTime?: number;\n\t/** Jump buffer window in seconds (default 0.1). */\n\tjumpBufferTime?: number;\n\t/** Velocity multiplier applied on early jump release (default 0.5). */\n\tjumpCutMultiplier?: number;\n\t/** Seconds before a multi-jump becomes available (default 0.15). */\n\tmultiJumpWindow?: number;\n\t/** Max slope angle in degrees the KCC can climb (default 50). */\n\tslopeClimbAngle?: number;\n\t/** Slope angle in degrees past which the character slides (default 40). */\n\tslopeSlideAngle?: number;\n\t/** Autostep max height in world units; 0 disables (default 0.25). */\n\tautostepHeight?: number;\n\t/** Minimum unobstructed width for an autostep (default 0.05). */\n\tautostepMinWidth?: number;\n\t/** Snap-to-ground distance in world units; 0 disables (default 0.2). */\n\tsnapToGroundDistance?: number;\n\t/** KCC collision offset between collider and environment (default 0.05). */\n\tcharacterOffset?: number;\n\t/** Collider local offset X (fallback / override). */\n\toffsetX?: number;\n\t/** Collider local offset Y (fallback / override). */\n\toffsetY?: number;\n\t/** Collider local offset Z (fallback / override). */\n\toffsetZ?: number;\n\t/** 0 = auto-read attached collider; 1 = use stored shape fields. */\n\tshapeSource?: number;\n}\n\nexport interface StageFirstPersonOptions {\n\twalkSpeed: number;\n\trunSpeed: number;\n\teyeHeight: number;\n\tlookSensitivity: number;\n}\n\nexport interface StageFirstPersonInput {\n\tmoveX: number;\n\tmoveZ: number;\n\tlookYawDelta: number;\n\tlookPitchDelta: number;\n\trun: boolean;\n}\n\n/** Button bits for the slot-indexed input buffer's bitmask field. */\nexport const STAGE_INPUT_BUTTON_JUMP = 1;\nexport const STAGE_INPUT_BUTTON_RUN = 2;\n\n/**\n * Decoded per-slot behavior snapshot written by the runtime after every\n * step: movement fields come from whichever character behavior the entity\n * has (platformer 3D/2D, jumper 3D/2D); first-person fills yaw/pitch.\n * Values reflect the end of the previous `step()` (one-frame read lag).\n */\nexport interface StageBehaviorSnapshot {\n\tgrounded: boolean;\n\tfsmState: number;\n\tjumpCount: number;\n\tverticalVelocity: number;\n\tspeed: number;\n\tyaw: number;\n\tpitch: number;\n}\n\n/**\n * Wasm fast-path backrefs a behavior system stores on its `BehaviorRef` every\n * frame so descriptor handles can read the runtime snapshot buffer instead of\n * a duplicate TS FSM (or hardcoded defaults).\n */\nexport interface WasmSnapshotBackref {\n\t__wasmStage?: BehaviorRuntime | null;\n\t__entity?: { runtimeHandle?: number } | null;\n}\n\n/**\n * Read the behavior snapshot for the entity a `BehaviorRef` is linked to.\n * Returns `null` off the wasm fast path (no stage runtime / no\n * `runtimeHandle` / no snapshot yet), in which case handles should fall back\n * to their TS FSM.\n */\nexport function readBehaviorSnapshot(ref: object): StageBehaviorSnapshot | null {\n\tconst backref = ref as WasmSnapshotBackref;\n\tconst wasmStage = backref.__wasmStage;\n\tconst handle = backref.__entity?.runtimeHandle ?? -1;\n\tif (!wasmStage || handle < 0) return null;\n\treturn wasmStage.readSnapshot(handle);\n}\n\n/**\n * Runtime surface behavior systems rely on. `WasmStageRuntime` is the real\n * wasm-backed implementation; `MockBehaviorRuntime` (see\n * `./mock-behavior-runtime`) implements the same contract for unit tests, so\n * descriptors stay runtime-agnostic.\n */\nexport interface BehaviorRuntime {\n\tgetPose(handle: number, out?: StagePose): StagePose | null;\n\tsetPosition(handle: number, x: number, y: number, z: number): boolean;\n\tsetRotation(handle: number, x: number, y: number, z: number, w: number): boolean;\n\n\t// ─── Batched input / snapshot buffers (preferred fast path) ─────────\n\t// Field-scoped writes into the slot-indexed input buffer, consumed by\n\t// the runtime in one pass at the start of each step. Behaviors composed\n\t// on one entity each write only their part of the slot.\n\twriteInputAxes(handle: number, axisA: number, axisB: number): boolean;\n\twriteInputLook(handle: number, yawDelta: number, pitchDelta: number): boolean;\n\t/** Write reserved input slots (thruster world-space vector X/Y). */\n\twriteInputReserved(handle: number, reservedA: number, reservedB: number): boolean;\n\twriteInputButton(handle: number, buttonMask: number, pressed: boolean): boolean;\n\t/** Read the per-slot behavior snapshot written at the end of the previous step. */\n\treadSnapshot(handle: number, out?: StageBehaviorSnapshot): StageBehaviorSnapshot | null;\n\n\tattachThruster(handle: number, opts: StageThrusterOptions): boolean;\n\tsetThrusterInput(\n\t\thandle: number,\n\t\tthrust: number,\n\t\trotate: number,\n\t\tvectorX?: number,\n\t\tvectorY?: number,\n\t): void;\n\n\tattachTopDown(handle: number, opts: StageTopDownOptions): boolean;\n\tsetTopDownInput(handle: number, moveX: number, moveY: number): void;\n\n\tattachShooter2D(handle: number, opts: StageShooter2DOptions): boolean;\n\n\tattachScreenWrap(handle: number, opts: StageScreenWrapOptions): boolean;\n\tqueryScreenWrap(handle: number): { fsm: number; lastWrappedAxes: number } | null;\n\n\tattachWorldBoundary(\n\t\thandle: number,\n\t\tdim: StageBoundaryDimValue,\n\t\topts: StageWorldBoundaryOptions,\n\t): boolean;\n\tqueryWorldBoundary(handle: number): { hits: number; clamped: [number, number, number] } | null;\n\n\tattachRicochet(handle: number, dim: StageRicochetDimValue, opts: StageRicochetOptions): boolean;\n\n\tattachPlatformer3D(handle: number, opts: StagePlatformer3DOptions): boolean;\n\tsetPlatformer3DInputAxes(handle: number, moveX: number, moveZ: number): void;\n\tsetPlatformer3DInputButtons(handle: number, jump: boolean, run: boolean): void;\n\n\tattachPlatformer2D(handle: number, opts: StagePlatformer2DOptions): boolean;\n\tsetPlatformer2DInputAxes(handle: number, moveX: number): void;\n\tsetPlatformer2DInputButtons(handle: number, jump: boolean, run: boolean): void;\n\n\tattachFirstPerson(handle: number, opts: StageFirstPersonOptions): boolean;\n\tsetFirstPersonInput(handle: number, input: StageFirstPersonInput): void;\n\n\tattachJumper2D(handle: number, opts: StageJumper2DOptions): boolean;\n\tsetJumper2DInput(handle: number, jumpPressed: boolean): void;\n\n\tattachJumper3D(handle: number, opts: StageJumper3DOptions): boolean;\n\tsetJumper3DInput(handle: number, jumpPressed: boolean): void;\n}\n\n/** Default options used when constructing a wasm-backed Stage runtime. */\nexport interface WasmStageRuntimeOptions {\n\tinitialCapacity?: number;\n\tgravity?: readonly [number, number, number];\n\timports?: WebAssembly.Imports;\n\t/**\n\t * Custom wasm source. Defaults to the `zylem_runtime.wasm` bundled with\n\t * `@zylem/runtime`.\n\t */\n\tsource?: RequestInfo | URL | ArrayBuffer | Uint8Array;\n}\n\nexport type StageEventTypeValue = (typeof StageEventType)[keyof typeof StageEventType];\n\n/** One decoded event drained from the runtime's per-step event buffer. */\nexport interface StageEvent {\n\ttype: StageEventTypeValue;\n\tprimarySlot: number | null;\n\tsecondarySlot: number | null;\n\tpayload: [number, number, number];\n}\n\n/**\n * Decoded view of one entity's slot in the unified render buffer.\n *\n * Mirrors the `STAGE_RENDER_STRIDE` (12-float) packing documented in\n * `runtime/stage/render.rs`:\n * `[0..3]` position, `[3..7]` rotation xyzw, `[7]` uniform scale,\n * `[8..12]` custom0..custom3 (per-behavior shading hints).\n */\nexport interface StageRenderSlot {\n\tposition: [number, number, number];\n\trotation: [number, number, number, number];\n\tscale: number;\n\tcustom: [number, number, number, number];\n}\n\n/**\n * Read a single entity slot out of a unified-Stage render buffer view.\n *\n * @param view The `Float32Array` over wasm memory (e.g. `WasmStageRuntime.render`).\n * @param slot The entity's wasm slot id (its `runtimeHandle`).\n * @param out Optional target object to write into (avoids per-call allocation).\n * @returns The decoded slot, or `null` when the slot is out of range.\n */\nexport function readStageRenderSlot(\n\tview: Float32Array,\n\tslot: number,\n\tout?: StageRenderSlot,\n): StageRenderSlot | null {\n\tconst base = slot * STAGE_RENDER_STRIDE;\n\tif (slot < 0 || base + STAGE_RENDER_STRIDE > view.length) {\n\t\treturn null;\n\t}\n\tconst result: StageRenderSlot = out ?? {\n\t\tposition: [0, 0, 0],\n\t\trotation: [0, 0, 0, 1],\n\t\tscale: 1,\n\t\tcustom: [0, 0, 0, 0],\n\t};\n\tresult.position[0] = view[base]!;\n\tresult.position[1] = view[base + 1]!;\n\tresult.position[2] = view[base + 2]!;\n\tresult.rotation[0] = view[base + 3]!;\n\tresult.rotation[1] = view[base + 4]!;\n\tresult.rotation[2] = view[base + 5]!;\n\tresult.rotation[3] = view[base + 6]!;\n\t// A freshly-zeroed slot reports scale 0; treat that as the identity scale so\n\t// entities aren't collapsed before the runtime writes a real value.\n\tconst scale = view[base + 7]!;\n\tresult.scale = scale === 0 ? 1 : scale;\n\tresult.custom[0] = view[base + 8]!;\n\tresult.custom[1] = view[base + 9]!;\n\tresult.custom[2] = view[base + 10]!;\n\tresult.custom[3] = view[base + 11]!;\n\treturn result;\n}\n\nexport interface StageBodyConfig {\n\tkind: StageBodyKindValue;\n\tposition: readonly [number, number, number];\n\trotation: readonly [number, number, number, number];\n\tlinearDamping: number;\n\tangularDamping: number;\n\tgravityScale: number;\n\tcanSleep: boolean;\n\tccdEnabled: boolean;\n\tlockRotation: readonly [boolean, boolean, boolean];\n\tlockTranslation: readonly [boolean, boolean, boolean];\n}\n\nexport type StageColliderShape =\n\t| { type: 'box'; halfExtents: readonly [number, number, number] }\n\t| { type: 'sphere'; radius: number }\n\t| { type: 'capsule'; halfHeight: number; radius: number }\n\t| { type: 'cylinder'; halfHeight: number; radius: number }\n\t| { type: 'cone'; halfHeight: number; radius: number }\n\t| { type: 'convexHull'; vertices: Float32Array }\n\t| { type: 'trimesh'; vertices: Float32Array; indices: Uint32Array }\n\t| {\n\t\ttype: 'heightfield';\n\t\trows: number;\n\t\tcols: number;\n\t\tscale: readonly [number, number, number];\n\t\theights: Float32Array;\n\t};\n\nexport interface StageColliderConfig {\n\tshape: StageColliderShape;\n\toffset: readonly [number, number, number];\n\tfriction: number;\n\trestitution: number;\n\tsensor: boolean;\n\t/** Packed interaction-groups: high 16 bits = membership, low 16 bits = filter. */\n\tcollisionGroups: number;\n}\n\n/** Result of a physics raycast against the stage. */\nexport interface StageRaycastHit {\n\tslot: number;\n\tdistance: number;\n\tnormal: [number, number, number];\n}\n\n/** Body introspection payload for debug tooling. */\nexport interface StageBodyInfo {\n\tbodyType: number;\n\tmass: number;\n\tisSleeping: boolean;\n\tisEnabled: boolean;\n\tlinearVelocity: [number, number, number];\n}\n\n/** Line-list wireframe for physics debug rendering. */\nexport interface StageDebugRender {\n\t/** `[x, y, z]` per vertex, two vertices per line. */\n\tvertices: Float32Array;\n\t/** RGBA per vertex. */\n\tcolors: Float32Array;\n}\n\n/**\n * Owns the wasm instance plus the live float-views over its render / event /\n * pose / scratch buffers. One instance per logical stage; each stage gets\n * its own `WebAssembly.Instance` so the singleton inside `stage_ffi.rs`\n * stays single-stage scoped (today's `thread_local!` contract).\n */\nexport class WasmStageRuntime implements BehaviorRuntime {\n\treadonly exports: StageWasmExports;\n\tprivate readonly memory: WebAssembly.Memory;\n\tprivate renderView: Float32Array = new Float32Array(0);\n\tprivate inputView: Float32Array = new Float32Array(0);\n\tprivate snapshotView: Float32Array = new Float32Array(0);\n\tprivate eventView: Float32Array = new Float32Array(0);\n\tprivate poseView: Float32Array = new Float32Array(0);\n\tprivate vec3View: Float32Array = new Float32Array(0);\n\tprivate queryView: Float32Array = new Float32Array(0);\n\tprivate scratchView: Float32Array = new Float32Array(0);\n\n\tconstructor(exports: StageWasmExports, options: WasmStageRuntimeOptions = {}) {\n\t\tthis.exports = exports;\n\t\tthis.memory = exports.memory;\n\t\tconst capacity = Math.max(options.initialCapacity ?? 64, 8);\n\t\texports.zylem_stage_create(capacity);\n\t\tif (options.gravity) {\n\t\t\texports.zylem_stage_set_gravity(\n\t\t\t\toptions.gravity[0],\n\t\t\t\toptions.gravity[1],\n\t\t\t\toptions.gravity[2],\n\t\t\t);\n\t\t}\n\t\tthis.refreshViews();\n\t}\n\n\t/** Recreate typed views over wasm memory. Call after step() or whenever memory may have grown. */\n\trefreshViews(): void {\n\t\tconst buffer = this.memory.buffer;\n\t\tconst renderPtr = this.exports.zylem_stage_render_ptr();\n\t\tconst renderLen = this.exports.zylem_stage_render_len();\n\t\tconst inputPtr = this.exports.zylem_stage_input_ptr();\n\t\tconst inputLen = this.exports.zylem_stage_input_len();\n\t\tconst snapshotPtr = this.exports.zylem_stage_snapshot_ptr();\n\t\tconst snapshotLen = this.exports.zylem_stage_snapshot_len();\n\t\tconst eventPtr = this.exports.zylem_stage_event_ptr();\n\t\tconst eventLen = this.exports.zylem_stage_event_len();\n\t\tconst posePtr = this.exports.zylem_stage_pose_ptr();\n\t\tconst poseLen = this.exports.zylem_stage_pose_len();\n\t\tconst vec3Ptr = this.exports.zylem_stage_vec3_ptr();\n\t\tconst queryPtr = this.exports.zylem_stage_query_ptr();\n\t\tconst queryLen = this.exports.zylem_stage_query_len();\n\t\tconst scratchPtr = this.exports.zylem_stage_scratch_ptr();\n\t\tconst scratchCap = this.exports.zylem_stage_scratch_capacity();\n\n\t\tthis.renderView = renderLen > 0 ? new Float32Array(buffer, renderPtr, renderLen) : new Float32Array(0);\n\t\tthis.inputView = inputLen > 0 ? new Float32Array(buffer, inputPtr, inputLen) : new Float32Array(0);\n\t\tthis.snapshotView = snapshotLen > 0 ? new Float32Array(buffer, snapshotPtr, snapshotLen) : new Float32Array(0);\n\t\tthis.eventView = eventLen > 0 ? new Float32Array(buffer, eventPtr, eventLen) : new Float32Array(0);\n\t\tthis.poseView = poseLen > 0 ? new Float32Array(buffer, posePtr, poseLen) : new Float32Array(0);\n\t\tthis.vec3View = vec3Ptr !== 0 ? new Float32Array(buffer, vec3Ptr, 3) : new Float32Array(0);\n\t\tthis.queryView = queryLen > 0 ? new Float32Array(buffer, queryPtr, queryLen) : new Float32Array(0);\n\t\tthis.scratchView = scratchCap > 0 ? new Float32Array(buffer, scratchPtr, scratchCap) : new Float32Array(0);\n\t}\n\n\t/** Step the simulation by `dt` seconds. Refreshes views afterwards. */\n\tstep(dt: number): number {\n\t\tconst active = this.exports.zylem_stage_step(dt);\n\t\tthis.refreshViews();\n\t\treturn active;\n\t}\n\n\tdispose(): void {\n\t\tthis.exports.zylem_stage_destroy();\n\t}\n\n\tget tickCount(): number {\n\t\treturn this.exports.zylem_stage_tick_count() >>> 0;\n\t}\n\n\tget activeCount(): number {\n\t\treturn this.exports.zylem_stage_active_count() >>> 0;\n\t}\n\n\tsetGravity(x: number, y: number, z: number): void {\n\t\tthis.exports.zylem_stage_set_gravity(x, y, z);\n\t}\n\n\t/**\n\t * Toggle per-step collision-event collection in the wasm stage. Hosts\n\t * with no collision listeners should disable it — with thousands of\n\t * touching bodies the per-step contact-pair hashing is a significant\n\t * fraction of `step()`.\n\t */\n\tsetEventsEnabled(enabled: boolean): void {\n\t\tthis.exports.zylem_stage_set_events_enabled(enabled ? 1 : 0);\n\t}\n\n\t// ─── Entity lifecycle ───────────────────────────────────────────────\n\n\tcreateEntity(): number {\n\t\tconst slot = this.exports.zylem_stage_create_entity() >>> 0;\n\t\t// The wasm may have grown memory while resizing the slot table; refresh views.\n\t\tthis.refreshViews();\n\t\treturn slot;\n\t}\n\n\tdestroyEntity(slot: number): boolean {\n\t\treturn this.exports.zylem_stage_destroy_entity(slot) !== 0;\n\t}\n\n\t// ─── Body / collider attach ────────────────────────────────────────\n\n\tattachBody(slot: number, config: StageBodyConfig): boolean {\n\t\tconst ok = this.exports.zylem_stage_attach_body(\n\t\t\tslot,\n\t\t\tconfig.kind,\n\t\t\tconfig.position[0], config.position[1], config.position[2],\n\t\t\tconfig.rotation[0], config.rotation[1], config.rotation[2], config.rotation[3],\n\t\t\tconfig.linearDamping,\n\t\t\tconfig.angularDamping,\n\t\t\tconfig.gravityScale,\n\t\t\tconfig.canSleep ? 1 : 0,\n\t\t\tconfig.ccdEnabled ? 1 : 0,\n\t\t\tconfig.lockRotation[0] ? 1 : 0, config.lockRotation[1] ? 1 : 0, config.lockRotation[2] ? 1 : 0,\n\t\t\tconfig.lockTranslation[0] ? 1 : 0, config.lockTranslation[1] ? 1 : 0, config.lockTranslation[2] ? 1 : 0,\n\t\t);\n\t\treturn ok !== 0;\n\t}\n\n\taddCollider(slot: number, config: StageColliderConfig): boolean {\n\t\tconst offset = config.offset;\n\t\tconst sensor = config.sensor ? 1 : 0;\n\t\tconst groups = config.collisionGroups >>> 0;\n\t\tconst friction = config.friction;\n\t\tconst restitution = config.restitution;\n\t\tswitch (config.shape.type) {\n\t\t\tcase 'box': {\n\t\t\t\tconst [hx, hy, hz] = config.shape.halfExtents;\n\t\t\t\treturn (\n\t\t\t\t\tthis.exports.zylem_stage_add_collider_box(\n\t\t\t\t\t\tslot, hx, hy, hz, offset[0], offset[1], offset[2],\n\t\t\t\t\t\tfriction, restitution, sensor, groups,\n\t\t\t\t\t) !== 0\n\t\t\t\t);\n\t\t\t}\n\t\t\tcase 'sphere': {\n\t\t\t\treturn (\n\t\t\t\t\tthis.exports.zylem_stage_add_collider_sphere(\n\t\t\t\t\t\tslot, config.shape.radius, offset[0], offset[1], offset[2],\n\t\t\t\t\t\tfriction, restitution, sensor, groups,\n\t\t\t\t\t) !== 0\n\t\t\t\t);\n\t\t\t}\n\t\t\tcase 'capsule': {\n\t\t\t\treturn (\n\t\t\t\t\tthis.exports.zylem_stage_add_collider_capsule(\n\t\t\t\t\t\tslot, config.shape.halfHeight, config.shape.radius,\n\t\t\t\t\t\toffset[0], offset[1], offset[2], friction, restitution, sensor, groups,\n\t\t\t\t\t) !== 0\n\t\t\t\t);\n\t\t\t}\n\t\t\tcase 'cylinder': {\n\t\t\t\treturn (\n\t\t\t\t\tthis.exports.zylem_stage_add_collider_cylinder(\n\t\t\t\t\t\tslot, config.shape.halfHeight, config.shape.radius,\n\t\t\t\t\t\toffset[0], offset[1], offset[2], friction, restitution, sensor, groups,\n\t\t\t\t\t) !== 0\n\t\t\t\t);\n\t\t\t}\n\t\t\tcase 'cone': {\n\t\t\t\treturn (\n\t\t\t\t\tthis.exports.zylem_stage_add_collider_cone(\n\t\t\t\t\t\tslot, config.shape.halfHeight, config.shape.radius,\n\t\t\t\t\t\toffset[0], offset[1], offset[2], friction, restitution, sensor, groups,\n\t\t\t\t\t) !== 0\n\t\t\t\t);\n\t\t\t}\n\t\t\tcase 'convexHull': {\n\t\t\t\tconst verts = config.shape.vertices;\n\t\t\t\tif (verts.length % 3 !== 0) return false;\n\t\t\t\tconst offsetFloats = this.stageScratch(verts);\n\t\t\t\treturn (\n\t\t\t\t\tthis.exports.zylem_stage_add_collider_convex_hull(\n\t\t\t\t\t\tslot, offsetFloats, verts.length / 3,\n\t\t\t\t\t\toffset[0], offset[1], offset[2], friction, restitution, sensor, groups,\n\t\t\t\t\t) !== 0\n\t\t\t\t);\n\t\t\t}\n\t\t\tcase 'trimesh': {\n\t\t\t\tconst verts = config.shape.vertices;\n\t\t\t\tconst indices = config.shape.indices;\n\t\t\t\tif (verts.length % 3 !== 0 || indices.length % 3 !== 0) return false;\n\t\t\t\tconst vertOffset = this.stageScratch(verts);\n\t\t\t\tconst indexOffset = this.stageScratchIndices(indices, vertOffset + verts.length);\n\t\t\t\treturn (\n\t\t\t\t\tthis.exports.zylem_stage_add_collider_trimesh(\n\t\t\t\t\t\tslot, vertOffset, verts.length / 3, indexOffset, indices.length,\n\t\t\t\t\t\toffset[0], offset[1], offset[2], friction, restitution, sensor, groups,\n\t\t\t\t\t) !== 0\n\t\t\t\t);\n\t\t\t}\n\t\t\tcase 'heightfield': {\n\t\t\t\tconst heights = config.shape.heights;\n\t\t\t\tconst heightOffset = this.stageScratch(heights);\n\t\t\t\treturn (\n\t\t\t\t\tthis.exports.zylem_stage_add_collider_heightfield(\n\t\t\t\t\t\tslot, config.shape.rows, config.shape.cols,\n\t\t\t\t\t\tconfig.shape.scale[0], config.shape.scale[1], config.shape.scale[2],\n\t\t\t\t\t\theightOffset, offset[0], offset[1], offset[2],\n\t\t\t\t\t\tfriction, restitution, sensor, groups,\n\t\t\t\t\t) !== 0\n\t\t\t\t);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tconst _exhaustive: never = config.shape;\n\t\t\t\tvoid _exhaustive;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate stageScratch(values: Float32Array, baseOffset = 0): number {\n\t\tthis.scratchView.set(values, baseOffset);\n\t\treturn baseOffset;\n\t}\n\n\tprivate stageScratchIndices(indices: Uint32Array, baseOffset: number): number {\n\t\tfor (let i = 0; i < indices.length; i++) {\n\t\t\tthis.scratchView[baseOffset + i] = indices[i]!;\n\t\t}\n\t\treturn baseOffset;\n\t}\n\n\t// ─── Pose / velocity ───────────────────────────────────────────────\n\n\tgetPose(slot: number, out?: StagePose): StagePose | null {\n\t\tconst ok = this.exports.zylem_stage_get_pose(slot) !== 0;\n\t\tif (!ok) return null;\n\t\tconst v = this.poseView;\n\t\tconst result: StagePose = out ?? {\n\t\t\tposition: [0, 0, 0],\n\t\t\trotation: [0, 0, 0, 1],\n\t\t};\n\t\tresult.position[0] = v[0]!;\n\t\tresult.position[1] = v[1]!;\n\t\tresult.position[2] = v[2]!;\n\t\tresult.rotation[0] = v[3]!;\n\t\tresult.rotation[1] = v[4]!;\n\t\tresult.rotation[2] = v[5]!;\n\t\tresult.rotation[3] = v[6]!;\n\t\treturn result;\n\t}\n\n\tsetPosition(slot: number, x: number, y: number, z: number): boolean {\n\t\treturn this.exports.zylem_stage_set_position(slot, x, y, z) !== 0;\n\t}\n\n\tsetRotation(slot: number, x: number, y: number, z: number, w: number): boolean {\n\t\treturn this.exports.zylem_stage_set_rotation(slot, x, y, z, w) !== 0;\n\t}\n\n\tsetLinearVelocity(slot: number, x: number, y: number, z: number): boolean {\n\t\treturn this.exports.zylem_stage_set_linvel(slot, x, y, z) !== 0;\n\t}\n\n\tgetLinearVelocity(slot: number, out?: [number, number, number]): [number, number, number] | null {\n\t\tif (this.exports.zylem_stage_get_linvel(slot) === 0) return null;\n\t\tconst v = this.vec3View;\n\t\tconst result = out ?? ([0, 0, 0] as [number, number, number]);\n\t\tresult[0] = v[0]!;\n\t\tresult[1] = v[1]!;\n\t\tresult[2] = v[2]!;\n\t\treturn result;\n\t}\n\n\tsetAngularVelocity(slot: number, x: number, y: number, z: number): boolean {\n\t\treturn this.exports.zylem_stage_set_angvel(slot, x, y, z) !== 0;\n\t}\n\n\tgetAngularVelocity(slot: number, out?: [number, number, number]): [number, number, number] | null {\n\t\tif (this.exports.zylem_stage_get_angvel(slot) === 0) return null;\n\t\tconst v = this.vec3View;\n\t\tconst result = out ?? ([0, 0, 0] as [number, number, number]);\n\t\tresult[0] = v[0]!;\n\t\tresult[1] = v[1]!;\n\t\tresult[2] = v[2]!;\n\t\treturn result;\n\t}\n\n\tapplyImpulse(slot: number, x: number, y: number, z: number): boolean {\n\t\treturn this.exports.zylem_stage_apply_impulse(slot, x, y, z) !== 0;\n\t}\n\n\t// ─── Queries / diagnostics ─────────────────────────────────────────\n\n\t/** Cast a ray against the physics world. Returns the closest hit or `null`. */\n\tcastRay(\n\t\torigin: readonly [number, number, number],\n\t\tdir: readonly [number, number, number],\n\t\tmaxDistance: number,\n\t\tsolidOnly = true,\n\t): StageRaycastHit | null {\n\t\tconst hit = this.exports.zylem_stage_cast_ray(\n\t\t\torigin[0], origin[1], origin[2],\n\t\t\tdir[0], dir[1], dir[2],\n\t\t\tmaxDistance, solidOnly ? 1 : 0,\n\t\t);\n\t\tif (hit === 0) return null;\n\t\tconst v = this.queryView;\n\t\treturn {\n\t\t\tslot: v[0]! >>> 0,\n\t\t\tdistance: v[1]!,\n\t\t\tnormal: [v[2]!, v[3]!, v[4]!],\n\t\t};\n\t}\n\n\t/** Body introspection for debug tooling. */\n\tgetBodyInfo(slot: number): StageBodyInfo | null {\n\t\tif (this.exports.zylem_stage_body_info(slot) === 0) return null;\n\t\tconst v = this.queryView;\n\t\treturn {\n\t\t\tbodyType: v[0]! | 0,\n\t\t\tmass: v[1]!,\n\t\t\tisSleeping: v[2]! > 0.5,\n\t\t\tisEnabled: v[3]! > 0.5,\n\t\t\tlinearVelocity: [v[4]!, v[5]!, v[6]!],\n\t\t};\n\t}\n\n\t/** Wireframe debug render of every collider (all shapes). */\n\tgetDebugRender(): StageDebugRender | null {\n\t\tconst vertexCount = this.exports.zylem_stage_debug_render() >>> 0;\n\t\tthis.refreshViews();\n\t\tif (vertexCount === 0) return null;\n\t\tconst buffer = this.memory.buffer;\n\t\tconst vertices = new Float32Array(\n\t\t\tbuffer,\n\t\t\tthis.exports.zylem_stage_debug_vertices_ptr(),\n\t\t\tthis.exports.zylem_stage_debug_vertices_len(),\n\t\t);\n\t\tconst colors = new Float32Array(\n\t\t\tbuffer,\n\t\t\tthis.exports.zylem_stage_debug_colors_ptr(),\n\t\t\tthis.exports.zylem_stage_debug_colors_len(),\n\t\t);\n\t\treturn {\n\t\t\tvertices: new Float32Array(vertices),\n\t\t\tcolors: new Float32Array(colors),\n\t\t};\n\t}\n\n\t// ─── Render / event reads ──────────────────────────────────────────\n\n\t/** Read-only view over the render buffer; one slot occupies {@link STAGE_RENDER_STRIDE} floats. */\n\tget render(): Float32Array {\n\t\treturn this.renderView;\n\t}\n\n\tget renderStride(): number {\n\t\treturn STAGE_RENDER_STRIDE;\n\t}\n\n\t/**\n\t * Decode a single entity slot from the live render buffer. Convenience\n\t * wrapper over {@link readStageRenderSlot} bound to this runtime's view.\n\t */\n\treadRenderSlot(slot: number, out?: StageRenderSlot): StageRenderSlot | null {\n\t\treturn readStageRenderSlot(this.renderView, slot, out);\n\t}\n\n\t/** Drain the wasm event buffer into a fresh array of typed events. */\n\tdrainEvents(): StageEvent[] {\n\t\tconst count = this.exports.zylem_stage_event_count() >>> 0;\n\t\tif (count === 0) return [];\n\t\tconst view = this.eventView;\n\t\tconst events: StageEvent[] = new Array(count);\n\t\tfor (let i = 0; i < count; i++) {\n\t\t\tconst base = i * STAGE_EVENT_STRIDE;\n\t\t\tconst primaryRaw = view[base + 1]!;\n\t\t\tconst secondaryRaw = view[base + 2]!;\n\t\t\tevents[i] = {\n\t\t\t\ttype: (view[base]! | 0) as StageEventTypeValue,\n\t\t\t\tprimarySlot: Number.isNaN(primaryRaw) ? null : primaryRaw >>> 0,\n\t\t\t\tsecondarySlot: Number.isNaN(secondaryRaw) ? null : secondaryRaw >>> 0,\n\t\t\t\tpayload: [view[base + 3]!, view[base + 4]!, view[base + 5]!],\n\t\t\t};\n\t\t}\n\t\treturn events;\n\t}\n\n\t// ─── Batched input / snapshot buffers ─────────────────────────────\n\n\t/** Writable view over the slot-indexed input buffer ({@link STAGE_INPUT_STRIDE} floats/slot). */\n\tget input(): Float32Array {\n\t\treturn this.inputView;\n\t}\n\n\tget inputStride(): number {\n\t\treturn STAGE_INPUT_STRIDE;\n\t}\n\n\t/** Read-only view over the per-slot behavior snapshot buffer ({@link STAGE_SNAPSHOT_STRIDE} floats/slot). */\n\tget snapshot(): Float32Array {\n\t\treturn this.snapshotView;\n\t}\n\n\tget snapshotStride(): number {\n\t\treturn STAGE_SNAPSHOT_STRIDE;\n\t}\n\n\t/**\n\t * Write the primary movement axes for a slot into the slot-indexed input\n\t * buffer and mark the slot dirty. Field-scoped (doesn't touch look\n\t * deltas or buttons) so multiple behaviors composed on one entity can\n\t * each write their part.\n\t */\n\twriteInputAxes(slot: number, axisA: number, axisB: number): boolean {\n\t\tconst base = slot * STAGE_INPUT_STRIDE;\n\t\tconst view = this.inputView;\n\t\tif (slot < 0 || base + STAGE_INPUT_STRIDE > view.length) return false;\n\t\tview[base] = axisA;\n\t\tview[base + 1] = axisB;\n\t\tview[base + 7] = 1;\n\t\treturn true;\n\t}\n\n\t/** Write the look deltas (first-person yaw/pitch) for a slot. */\n\twriteInputLook(slot: number, yawDelta: number, pitchDelta: number): boolean {\n\t\tconst base = slot * STAGE_INPUT_STRIDE;\n\t\tconst view = this.inputView;\n\t\tif (slot < 0 || base + STAGE_INPUT_STRIDE > view.length) return false;\n\t\tview[base + 2] = yawDelta;\n\t\tview[base + 3] = pitchDelta;\n\t\tview[base + 7] = 1;\n\t\treturn true;\n\t}\n\n\t/** Write reserved input slots (thruster world-space vector X/Y). */\n\twriteInputReserved(slot: number, reservedA: number, reservedB: number): boolean {\n\t\tconst base = slot * STAGE_INPUT_STRIDE;\n\t\tconst view = this.inputView;\n\t\tif (slot < 0 || base + STAGE_INPUT_STRIDE > view.length) return false;\n\t\tview[base + 5] = reservedA;\n\t\tview[base + 6] = reservedB;\n\t\tview[base + 7] = 1;\n\t\treturn true;\n\t}\n\n\t/**\n\t * Set or clear one button bit ({@link STAGE_INPUT_BUTTON_JUMP} /\n\t * {@link STAGE_INPUT_BUTTON_RUN}) in a slot's input bitmask.\n\t */\n\twriteInputButton(slot: number, buttonMask: number, pressed: boolean): boolean {\n\t\tconst base = slot * STAGE_INPUT_STRIDE;\n\t\tconst view = this.inputView;\n\t\tif (slot < 0 || base + STAGE_INPUT_STRIDE > view.length) return false;\n\t\tconst current = view[base + 4]! | 0;\n\t\tview[base + 4] = pressed ? (current | buttonMask) : (current & ~buttonMask);\n\t\tview[base + 7] = 1;\n\t\treturn true;\n\t}\n\n\t/**\n\t * Decode a slot's behavior snapshot from the buffer written at the end of\n\t * the previous step. Returns `null` when the slot has no behavior data.\n\t */\n\treadSnapshot(slot: number, out?: StageBehaviorSnapshot): StageBehaviorSnapshot | null {\n\t\tconst base = slot * STAGE_SNAPSHOT_STRIDE;\n\t\tconst view = this.snapshotView;\n\t\tif (slot < 0 || base + STAGE_SNAPSHOT_STRIDE > view.length) return null;\n\t\tif (view[base + 7] === 0) return null;\n\t\tconst result: StageBehaviorSnapshot = out ?? {\n\t\t\tgrounded: false,\n\t\t\tfsmState: 0,\n\t\t\tjumpCount: 0,\n\t\t\tverticalVelocity: 0,\n\t\t\tspeed: 0,\n\t\t\tyaw: 0,\n\t\t\tpitch: 0,\n\t\t};\n\t\tresult.grounded = view[base]! > 0.5;\n\t\tresult.fsmState = view[base + 1]! | 0;\n\t\tresult.jumpCount = view[base + 2]! | 0;\n\t\tresult.verticalVelocity = view[base + 3]!;\n\t\tresult.speed = view[base + 4]!;\n\t\tresult.yaw = view[base + 5]!;\n\t\tresult.pitch = view[base + 6]!;\n\t\treturn result;\n\t}\n\n\t// ─── Behavior helpers ─────────────────────────────────────────────\n\n\tget queryScratch(): Float32Array {\n\t\treturn this.queryView;\n\t}\n\n\tattachCooldown(slot: number): boolean {\n\t\treturn this.exports.zylem_stage_attach_cooldown(slot) !== 0;\n\t}\n\n\tregisterCooldown(slot: number, id: number, durationSeconds: number, immediate = false): boolean {\n\t\treturn (\n\t\t\tthis.exports.zylem_stage_cooldown_register(slot, id >>> 0, durationSeconds, immediate ? 1 : 0) !== 0\n\t\t);\n\t}\n\n\tfireCooldown(slot: number, id: number): boolean {\n\t\treturn this.exports.zylem_stage_cooldown_fire(slot, id >>> 0) !== 0;\n\t}\n\n\tresetCooldown(slot: number, id: number): boolean {\n\t\treturn this.exports.zylem_stage_cooldown_reset(slot, id >>> 0) !== 0;\n\t}\n\n\tcooldownRemaining(slot: number, id: number): number {\n\t\treturn this.exports.zylem_stage_cooldown_remaining(slot, id >>> 0);\n\t}\n\n\tattachWorldBoundary(\n\t\tslot: number,\n\t\tdim: StageBoundaryDimValue,\n\t\tbounds: StageWorldBoundaryOptions,\n\t): boolean {\n\t\treturn (\n\t\t\tthis.exports.zylem_stage_attach_world_boundary(\n\t\t\t\tslot,\n\t\t\t\tdim,\n\t\t\t\tbounds.top, bounds.bottom, bounds.left, bounds.right,\n\t\t\t\tbounds.front ?? 0, bounds.back ?? 0, bounds.padding ?? 0,\n\t\t\t) !== 0\n\t\t);\n\t}\n\n\tqueryWorldBoundary(slot: number): { hits: number; clamped: [number, number, number] } | null {\n\t\tif (this.exports.zylem_stage_query_world_boundary(slot) === 0) return null;\n\t\tconst v = this.queryView;\n\t\treturn {\n\t\t\thits: v[0]! | 0,\n\t\t\tclamped: [v[1]!, v[2]!, v[3]!],\n\t\t};\n\t}\n\n\tattachScreenWrap(slot: number, opts: StageScreenWrapOptions): boolean {\n\t\treturn (\n\t\t\tthis.exports.zylem_stage_attach_screen_wrap(\n\t\t\t\tslot, opts.width, opts.height,\n\t\t\t\topts.centerX ?? 0, opts.centerY ?? 0, opts.edgeThreshold ?? 0,\n\t\t\t) !== 0\n\t\t);\n\t}\n\n\tqueryScreenWrap(slot: number): { fsm: number; lastWrappedAxes: number } | null {\n\t\tif (this.exports.zylem_stage_query_screen_wrap(slot) === 0) return null;\n\t\tconst v = this.queryView;\n\t\treturn { fsm: v[0]! | 0, lastWrappedAxes: v[1]! | 0 };\n\t}\n\n\tattachRicochet(\n\t\tslot: number,\n\t\tdim: StageRicochetDimValue,\n\t\topts: StageRicochetOptions,\n\t): boolean {\n\t\treturn (\n\t\t\tthis.exports.zylem_stage_attach_ricochet(\n\t\t\t\tslot, dim, opts.minSpeed, opts.maxSpeed, opts.speedMultiplier,\n\t\t\t\topts.maxAngleDeg, opts.reflectionMode,\n\t\t\t) !== 0\n\t\t);\n\t}\n\n\tqueryRicochet(slot: number): { bounces: number; lastKind: number } | null {\n\t\tif (this.exports.zylem_stage_query_ricochet(slot) === 0) return null;\n\t\tconst v = this.queryView;\n\t\treturn { bounces: v[0]! | 0, lastKind: v[1]! | 0 };\n\t}\n\n\tattachThruster(slot: number, opts: StageThrusterOptions): boolean {\n\t\treturn (\n\t\t\tthis.exports.zylem_stage_attach_thruster(\n\t\t\t\tslot, opts.maxSpeed, opts.acceleration, opts.turnRateRadPerSec, opts.linearDamping,\n\t\t\t) !== 0\n\t\t);\n\t}\n\n\tsetThrusterInput(\n\t\tslot: number,\n\t\tthrust: number,\n\t\tturn: number,\n\t\tvectorX = 0,\n\t\tvectorY = 0,\n\t): void {\n\t\tthis.exports.zylem_stage_set_thruster_input(slot, thrust, turn, vectorX, vectorY);\n\t}\n\n\tqueryThruster(slot: number): { headingRad: number; speed: number } | null {\n\t\tif (this.exports.zylem_stage_query_thruster(slot) === 0) return null;\n\t\tconst v = this.queryView;\n\t\treturn { headingRad: v[0]!, speed: v[1]! };\n\t}\n\n\tattachTopDown(slot: number, opts: StageTopDownOptions): boolean {\n\t\treturn this.exports.zylem_stage_attach_top_down(slot, opts.plane, opts.speed, opts.faceMovement ? 1 : 0) !== 0;\n\t}\n\n\tsetTopDownInput(slot: number, axisA: number, axisB: number): void {\n\t\tthis.exports.zylem_stage_set_top_down_input(slot, axisA, axisB);\n\t}\n\n\tattachJumper2D(slot: number, opts: StageJumper2DOptions): boolean {\n\t\treturn (\n\t\t\tthis.exports.zylem_stage_attach_jumper_2d(\n\t\t\t\tslot, opts.jumpForce, opts.maxJumps >>> 0,\n\t\t\t\topts.jumpBufferTime, opts.coyoteTime, opts.gravity,\n\t\t\t) !== 0\n\t\t);\n\t}\n\n\tsetJumper2DInput(slot: number, jumpPressed: boolean): void {\n\t\tthis.exports.zylem_stage_set_jumper_2d_input(slot, jumpPressed ? 1 : 0);\n\t}\n\n\tqueryJumper2D(slot: number): { grounded: boolean; jumpCount: number; coyote: number; jumpBuffer: number } | null {\n\t\tif (this.exports.zylem_stage_query_jumper_2d(slot) === 0) return null;\n\t\tconst v = this.queryView;\n\t\treturn {\n\t\t\tgrounded: v[0]! > 0.5,\n\t\t\tjumpCount: v[1]! | 0,\n\t\t\tcoyote: v[2]!,\n\t\t\tjumpBuffer: v[3]!,\n\t\t};\n\t}\n\n\tattachJumper3D(slot: number, opts: StageJumper3DOptions): boolean {\n\t\treturn this.exports.zylem_stage_attach_jumper_3d(\n\t\t\tslot, opts.jumpForce, opts.maxJumps >>> 0, opts.gravity,\n\t\t\topts.coyoteTime ?? 0.1, opts.jumpBufferTime ?? 0.08,\n\t\t) !== 0;\n\t}\n\n\tsetJumper3DInput(slot: number, jump: boolean): void {\n\t\tthis.exports.zylem_stage_set_jumper_3d_input(slot, jump ? 1 : 0);\n\t}\n\n\tqueryJumper3D(slot: number): { grounded: boolean; jumpCount: number; verticalVelocity: number } | null {\n\t\tif (this.exports.zylem_stage_query_jumper_3d(slot) === 0) return null;\n\t\tconst v = this.queryView;\n\t\treturn { grounded: v[0]! > 0.5, jumpCount: v[1]! | 0, verticalVelocity: v[2]! };\n\t}\n\n\tattachShooter2D(slot: number, opts: StageShooter2DOptions): boolean {\n\t\treturn (\n\t\t\tthis.exports.zylem_stage_attach_shooter_2d(\n\t\t\t\tslot, opts.fireRateHz, opts.muzzleOffsetX, opts.muzzleOffsetY, opts.muzzleSpeed,\n\t\t\t) !== 0\n\t\t);\n\t}\n\n\tfireShooter2D(slot: number, x: number, y: number, z: number, yaw: number): boolean {\n\t\treturn this.exports.zylem_stage_shooter_2d_fire(slot, x, y, z, yaw) !== 0;\n\t}\n\n\tqueryShooter2D(slot: number): { cooldown: number; firedCount: number } | null {\n\t\tif (this.exports.zylem_stage_query_shooter_2d(slot) === 0) return null;\n\t\tconst v = this.queryView;\n\t\treturn { cooldown: v[0]!, firedCount: v[1]! | 0 };\n\t}\n\n\tattachPlatformer3D(slot: number, opts: StagePlatformer3DOptions): boolean {\n\t\treturn (\n\t\t\tthis.exports.zylem_stage_attach_platformer_3d(\n\t\t\t\tslot, opts.halfHeight, opts.radius,\n\t\t\t\topts.walkSpeed, opts.runSpeed, opts.jumpForce,\n\t\t\t\topts.maxJumps >>> 0, opts.gravity,\n\t\t\t\topts.coyoteTime ?? 0.1, opts.jumpBufferTime ?? 0.1,\n\t\t\t\topts.jumpCutMultiplier ?? 0.5, opts.multiJumpWindow ?? 0.15,\n\t\t\t\topts.slopeClimbAngle ?? 50, opts.slopeSlideAngle ?? 40,\n\t\t\t\topts.autostepHeight ?? 0.3, opts.autostepMinWidth ?? 0.1,\n\t\t\t\topts.snapToGroundDistance ?? 0.3, opts.characterOffset ?? 0.05,\n\t\t\t\topts.offsetX ?? 0, opts.offsetY ?? 0, opts.offsetZ ?? 0,\n\t\t\t\topts.shapeSource ?? StagePlatformerShapeSource.Auto,\n\t\t\t) !== 0\n\t\t);\n\t}\n\n\tsetPlatformer3DInputAxes(slot: number, moveX: number, moveZ: number): void {\n\t\tthis.exports.zylem_stage_set_platformer_3d_input_axes(slot, moveX, moveZ);\n\t}\n\n\tsetPlatformer3DInputButtons(slot: number, jump: boolean, run: boolean): void {\n\t\tthis.exports.zylem_stage_set_platformer_3d_input_buttons(slot, jump ? 1 : 0, run ? 1 : 0);\n\t}\n\n\tqueryPlatformer3D(slot: number): { grounded: boolean; jumpCount: number; fsmState: number; speed: number } | null {\n\t\tif (this.exports.zylem_stage_query_platformer_3d(slot) === 0) return null;\n\t\tconst v = this.queryView;\n\t\treturn {\n\t\t\tgrounded: v[0]! > 0.5,\n\t\t\tjumpCount: v[1]! | 0,\n\t\t\tfsmState: v[2]! | 0,\n\t\t\tspeed: v[3]!,\n\t\t};\n\t}\n\n\tattachPlatformer2D(slot: number, opts: StagePlatformer2DOptions): boolean {\n\t\treturn (\n\t\t\tthis.exports.zylem_stage_attach_platformer_2d(\n\t\t\t\tslot, opts.halfHeight, opts.radius,\n\t\t\t\topts.walkSpeed, opts.runSpeed, opts.jumpForce,\n\t\t\t\topts.maxJumps >>> 0, opts.gravity,\n\t\t\t\topts.coyoteTime ?? 0.1, opts.jumpBufferTime ?? 0.1,\n\t\t\t\topts.jumpCutMultiplier ?? 0.5, opts.multiJumpWindow ?? 0.15,\n\t\t\t\topts.slopeClimbAngle ?? 50, opts.slopeSlideAngle ?? 40,\n\t\t\t\topts.autostepHeight ?? 0.25, opts.autostepMinWidth ?? 0.05,\n\t\t\t\topts.snapToGroundDistance ?? 0.2, opts.characterOffset ?? 0.05,\n\t\t\t\topts.offsetX ?? 0, opts.offsetY ?? 0, opts.offsetZ ?? 0,\n\t\t\t\topts.shapeSource ?? StagePlatformerShapeSource.Auto,\n\t\t\t) !== 0\n\t\t);\n\t}\n\n\tsetPlatformer2DInputAxes(slot: number, moveX: number): void {\n\t\tthis.exports.zylem_stage_set_platformer_2d_input_axes(slot, moveX);\n\t}\n\n\tsetPlatformer2DInputButtons(slot: number, jump: boolean, run: boolean): void {\n\t\tthis.exports.zylem_stage_set_platformer_2d_input_buttons(slot, jump ? 1 : 0, run ? 1 : 0);\n\t}\n\n\tqueryPlatformer2D(slot: number): { grounded: boolean; jumpCount: number; fsmState: number; verticalVelocity: number } | null {\n\t\tif (this.exports.zylem_stage_query_platformer_2d(slot) === 0) return null;\n\t\tconst v = this.queryView;\n\t\treturn {\n\t\t\tgrounded: v[0]! > 0.5,\n\t\t\tjumpCount: v[1]! | 0,\n\t\t\tfsmState: v[2]! | 0,\n\t\t\tverticalVelocity: v[3]!,\n\t\t};\n\t}\n\n\tattachFirstPerson(slot: number, opts: StageFirstPersonOptions): boolean {\n\t\treturn (\n\t\t\tthis.exports.zylem_stage_attach_first_person(\n\t\t\t\tslot, opts.walkSpeed, opts.runSpeed, opts.eyeHeight, opts.lookSensitivity,\n\t\t\t) !== 0\n\t\t);\n\t}\n\n\tsetFirstPersonInput(slot: number, input: StageFirstPersonInput): void {\n\t\tthis.exports.zylem_stage_set_first_person_input(\n\t\t\tslot, input.moveX, input.moveZ, input.lookYawDelta, input.lookPitchDelta, input.run ? 1 : 0,\n\t\t);\n\t}\n\n\tqueryFirstPerson(slot: number): { yaw: number; pitch: number; speed: number; eyeHeight: number } | null {\n\t\tif (this.exports.zylem_stage_query_first_person(slot) === 0) return null;\n\t\tconst v = this.queryView;\n\t\treturn { yaw: v[0]!, pitch: v[1]!, speed: v[2]!, eyeHeight: v[3]! };\n\t}\n}\n\n/**\n * Load the bundled `@zylem/runtime` wasm (or a custom `source`), instantiate\n * it, and construct a `WasmStageRuntime` around the exports.\n */\nexport async function createWasmStageRuntime(\n\toptions: WasmStageRuntimeOptions = {},\n): Promise<WasmStageRuntime> {\n\tconst { exports } = await loadStageFfi({\n\t\tsource: options.source,\n\t\timports: options.imports,\n\t});\n\treturn new WasmStageRuntime(exports, options);\n}\n"],"mappings":";AASA;AAAA,EACC;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAWA,IAAM,qBAAqB;AAE3B,IAAM,gBAAgB;AAAA,EAC5B,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,mBAAmB;AAAA,EACnB,mBAAmB;AACpB;AAIO,IAAM,mBAAmB;AAAA,EAC/B,KAAK;AAAA,EACL,OAAO;AACR;AAEO,IAAM,mBAAmB;AAAA,EAC/B,KAAK;AAAA,EACL,OAAO;AACR;AAEO,IAAM,0BAA0B;AAAA,EACtC,QAAQ;AAAA,EACR,QAAQ;AACT;AAEO,IAAM,oBAAoB;AAAA,EAChC,IAAI;AAAA,EACJ,IAAI;AACL;AAEO,IAAM,iBAAiB;AAAA,EAC7B,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,UAAU;AAAA,EACV,eAAe;AAAA,EACf,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,eAAe;AAChB;AAoHO,IAAM,6BAA6B;AAAA,EACzC,MAAM;AAAA,EACN,UAAU;AACX;AAwDO,IAAM,0BAA0B;AAChC,IAAM,yBAAyB;AAkC/B,SAAS,qBAAqB,KAA2C;AAC/E,QAAM,UAAU;AAChB,QAAM,YAAY,QAAQ;AAC1B,QAAM,SAAS,QAAQ,UAAU,iBAAiB;AAClD,MAAI,CAAC,aAAa,SAAS,EAAG,QAAO;AACrC,SAAO,UAAU,aAAa,MAAM;AACrC;AAkHO,SAAS,oBACf,MACA,MACA,KACyB;AACzB,QAAM,OAAO,OAAO;AACp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