From d224939efd573f1af1f8b2c2724ce19a65f8835c Mon Sep 17 00:00:00 2001 From: tianmo Date: Thu, 22 Oct 2026 16:49:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=90=E5=8F=91=E5=B0=84=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/Preset/6.子发射器.json | 1542 +++++++++++++++++ .../{6.SpineBoy.json => 7.SpineBoy.json} | 0 dist/Preset/index.json | 8 +- .../{index-CUwqGGwd.js => index-8-FN8Glu.js} | 2 +- dist/assets/index-BDM5NpkZ.js | 1239 ------------- dist/assets/index-CPXvsWyv.js | 1239 +++++++++++++ .../{index-BS4GpQRH.js => index-CT90mgj8.js} | 2 +- dist/assets/index-DvMPoOSF.css | 1 + dist/assets/index-eyCkSEtn.css | 1 - dist/index.html | 4 +- package.json | 2 + public/Preset/6.子发射器.json | 1542 +++++++++++++++++ .../{6.SpineBoy.json => 7.SpineBoy.json} | 0 public/Preset/index.json | 8 +- scripts/pixi-stub.mjs | 21 + scripts/verify-particle-events.mjs | 174 ++ scripts/verify-sub-emitter-timeline.mjs | 87 + scripts/verify-timeline.mjs | 6 +- src/core/particleConfig.ts | 34 + src/core/particleEmitter.ts | 203 ++- src/core/particleMath.ts | 8 + src/core/particleTypes.ts | 25 + src/core/subEmitterIds.ts | 50 + src/core/subEmitterTiming.ts | 142 ++ src/editor/editorConfig.ts | 51 +- src/store/particleStore.ts | 123 +- src/timeline/playbackRange.ts | 6 + src/views/Stage.vue | 65 +- src/views/Timeline.vue | 94 +- .../ParticleModifiersSection.vue | 221 ++- .../particle-panel/SceneObjectsSection.vue | 65 +- src/views/particle-panel/useParticlePanel.ts | 13 + src/views/stage/emitterSync.ts | 67 +- 33 files changed, 5690 insertions(+), 1355 deletions(-) create mode 100644 dist/Preset/6.子发射器.json rename dist/Preset/{6.SpineBoy.json => 7.SpineBoy.json} (100%) rename dist/assets/{index-CUwqGGwd.js => index-8-FN8Glu.js} (99%) delete mode 100644 dist/assets/index-BDM5NpkZ.js create mode 100644 dist/assets/index-CPXvsWyv.js rename dist/assets/{index-BS4GpQRH.js => index-CT90mgj8.js} (99%) create mode 100644 dist/assets/index-DvMPoOSF.css delete mode 100644 dist/assets/index-eyCkSEtn.css create mode 100644 public/Preset/6.子发射器.json rename public/Preset/{6.SpineBoy.json => 7.SpineBoy.json} (100%) create mode 100644 scripts/pixi-stub.mjs create mode 100644 scripts/verify-particle-events.mjs create mode 100644 scripts/verify-sub-emitter-timeline.mjs create mode 100644 src/core/subEmitterIds.ts create mode 100644 src/core/subEmitterTiming.ts diff --git a/dist/Preset/6.子发射器.json b/dist/Preset/6.子发射器.json new file mode 100644 index 0000000..9660d71 --- /dev/null +++ b/dist/Preset/6.子发射器.json @@ -0,0 +1,1542 @@ +{ + "format": "SpineParticle.EditorConfig", + "version": 1, + "savedAt": "2026-10-22T08:47:16.245Z", + "editor": { + "viewScale": 0.8928571428571436, + "viewX": 22.94058570991544, + "viewY": 11.760248162437591 + }, + "settings": { + "backgroundX": 0, + "backgroundY": 0, + "backgroundOpacity": 1, + "backgroundImageName": "", + "backgroundImageData": "", + "showGrid": true, + "exportSettings": { + "imagesPath": "./images/", + "spineVersion": "4.2", + "keyframeCurve": "bezier", + "fps": 30, + "omitFps": false, + "integerFrameAlignment": true, + "bonePool": true, + "excludeEmptyAnimations": false, + "fileName": "SpineParticle.json" + } + }, + "timeline": { + "fps": 30, + "loop": true, + "playbackStart": 0, + "playbackEnd": 114, + "playbackEndAuto": true, + "abLoop": false, + "animations": [ + "animation" + ] + }, + "selection": { + "type": "particle", + "id": 1 + }, + "scene": { + "systems": [ + { + "id": 1, + "visible": true, + "animation": "animation", + "config": { + "imageResources": [ + { + "id": 1, + "textureName": "star", + "textureFolder": "", + "previewUrl": "/images/star.png", + "imageMode": "fixed", + "sequencePlayback": "loop-forward", + "sequenceFps": 30, + "sequenceFrames": [], + "weight": 100, + "locked": false, + "scale": 1, + "anchorX": 0.5, + "anchorY": 0.5, + "colorMode": "fixed", + "colorStart": "#ffffff", + "colorEnd": "#ff4d4d", + "colorGradient": [ + { + "position": 0, + "color": "#ffffff" + }, + { + "position": 1, + "color": "#ff4d4d" + } + ], + "blend": "normal", + "independentAlpha": "off", + "alpha": 1, + "alphaCurveMode": "跟随导出", + "alphaCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 0.1, + "y": 1 + }, + { + "x": 0.9, + "y": 1 + }, + { + "x": 1, + "y": 0 + } + ] + } + ], + "imageWeightVersion": 1, + "name": "Fireworks", + "mode": "burst", + "rate": 10, + "streamBehavior": "normal", + "loopDurationFrames": 30, + "generateLoopStartAnimation": false, + "loopStartUseCustomDuration": false, + "loopStartDurationFrames": 30, + "generateLoopEndAnimation": false, + "loopEndUseCustomDuration": false, + "loopEndDurationFrames": 30, + "burstCount": 1, + "burstLoop": false, + "delay": 0, + "duration": 0.5, + "shape": "point", + "showShape": true, + "shapeRangeVersion": 1, + "innerRadius": 83, + "outerRadius": 148, + "innerRectW": 0, + "innerRectH": 0, + "outerRectW": 200, + "outerRectH": 100, + "spawnPathId": 0, + "spawnPathDistribution": "fixed", + "radius": 30, + "rectW": 60, + "rectH": 40, + "centerX": 0, + "centerY": 0, + "rootRotation": 0, + "rootScaleX": 1, + "rootScaleY": 1, + "renderLayerMode": "top", + "renderLayerSpineId": 0, + "renderLayerSlotName": "", + "renderLayerSlotPosition": "above", + "renderLayerFollowAttachment": false, + "emissionAngleMode": "random", + "direction": -90, + "spread": 0, + "coneDirection": 90, + "coneAngle": 90, + "lifeMin": 1, + "lifeMax": 1.8, + "lifeMode": "fixed", + "lifeCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "speedMin": 400, + "speedMax": 100, + "speedMode": "random", + "speedCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleMin": 0.3, + "scaleMax": 0.8, + "scaleMode": "random", + "scaleAxisMode": "uniform", + "scaleYMin": 0.3, + "scaleYMax": 0.8, + "scaleCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleYCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleEndRatio": 0.3, + "initialRotationMode": "random", + "initialRotationMin": 0, + "initialRotationMax": 360, + "initialRotationCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "alpha": 0.9, + "alphaEnd": 0, + "rotationSpeedMin": 360, + "rotationSpeedMax": 180, + "speedOverLifeEnabled": false, + "speedOverLifeMode": "fixed", + "speedOverLifeMin": 1, + "speedOverLifeMax": 1, + "speedOverLifeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleOverLifeEnabled": false, + "scaleOverLifeMode": "curve", + "scaleOverLifeAxisMode": "uniform", + "scaleOverLifeMin": 0, + "scaleOverLifeMax": 1, + "scaleYOverLifeMin": 0, + "scaleYOverLifeMax": 1, + "scaleOverLifeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleYOverLifeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "rotationOverLifeEnabled": true, + "rotationOverLifeMode": "fixed", + "rotationOverLifeCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "gravity": 980, + "gravityMode": "fixed", + "gravityMin": 980, + "gravityMax": 980, + "gravityDirection": -90, + "gravityCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "damping": 1, + "seed": 715994, + "colorStart": "#ffffff", + "colorEnd": "#ff4d4d", + "colorOverLife": false, + "blend": "add", + "alphaMode": "curve", + "curveMode": "线性", + "alphaCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 0.2, + "y": 1 + }, + { + "x": 0.8, + "y": 1 + }, + { + "x": 1, + "y": 0 + } + ], + "textureName": "star", + "textureFolder": "", + "alphaScale": 1, + "anchorX": 0.5, + "anchorY": 0.5, + "independentAlpha": "off", + "offsetX": 0, + "offsetY": 0, + "noise": false, + "noiseAmt": 30, + "noiseRange": 100, + "noiseSpeed": 1, + "useGravity": false, + "wind": false, + "windX": 0, + "windY": 0, + "windMode": "fixed", + "windMin": 100, + "windMax": 100, + "windDirection": 0, + "windCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "forceField": false, + "forceStrength": 10, + "forceRadius": 100, + "forceCenterX": 0, + "forceCenterY": 0, + "forceFalloff": "linear", + "showForceFieldShape": true, + "vortex": false, + "vortexStrength": 10, + "vortexRadius": 100, + "vortexCenterX": 0, + "vortexCenterY": 0, + "vortexFalloff": "linear", + "showVortexShape": true, + "attraction": false, + "attractionCenterX": 200, + "attractionCenterY": 0, + "attractionRadius": 20, + "attractionDuration": 0.5, + "attractionDelay": 0.1, + "attractionDelayMode": "particle", + "attractionPath": "curve", + "showAttractionShape": true, + "trail": true, + "trailConfigVersion": 3, + "trailResources": [ + { + "id": 1, + "textureName": "trail", + "previewUrl": "/images/trail.png", + "weight": 100, + "locked": false, + "rotation": 0, + "colorMode": "particle", + "color": "#ffffff", + "colorGradient": [ + { + "position": 0, + "color": "#ffffff" + }, + { + "position": 1, + "color": "#ffffff" + } + ], + "blend": "normal", + "alphaMode": "particle", + "alpha": 1, + "alphaCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "boneCount": 3, + "trailRatio": 100, + "lengthMode": "fixed", + "length": 50, + "lengthMin": 100, + "lengthMax": 100, + "widthSizeMode": "fixed", + "width": 20, + "widthMin": 100, + "widthMax": 100, + "widthMode": "particle", + "lifeLengthEnabled": false, + "lifeLengthCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "shapeEnabled": false, + "shapeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ] + } + ], + "trailResourceVersion": 6, + "trailTextureName": "trail", + "trailPreviewUrl": "/images/trail.png", + "trailColorMode": "particle", + "trailColor": "#ffffff", + "trailColorGradient": [ + { + "position": 0, + "color": "#ffffff" + }, + { + "position": 1, + "color": "#ffffff" + } + ], + "trailAlphaMode": "particle", + "trailAlpha": 1, + "trailAlphaCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "trailBoneCount": 3, + "trailLength": 100, + "trailWidth": 100, + "trailWidthMode": "particle", + "trailLifeLengthEnabled": false, + "trailLifeLengthCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "trailShapeEnabled": false, + "trailShapeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "trailGridRows": 4, + "trailGridCols": 4, + "collision": false, + "collisionColliderIds": [ + 2 + ], + "pathFollow": false, + "eventEnabled": true, + "events": [ + { + "id": 1, + "event": "death", + "targetSystemId": 2, + "probability": 1, + "inherit": [], + "colorInheritMode": "add", + "collisionLimit": 1 + } + ], + "emitterFollow": false, + "emitterFollowMode": "none", + "emitterFollowPathId": 0, + "emitterFollowSpineId": 0, + "emitterFollowBoneName": "", + "emitterFollowBoneOffsetX": 0, + "emitterFollowBoneOffsetY": 0, + "emitterFollowBoneRotation": 0, + "emitterFollowBoneScaleX": 1, + "emitterFollowBoneScaleY": 1, + "emitterAngleMode": "fixed", + "emitterFollowCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "emitterFollowDuration": 2, + "emitterFollowSpace": "world", + "emitterFollowDirection": "forward", + "emitterFollowOffset": 0 + } + }, + { + "id": 2, + "visible": true, + "animation": "animation", + "config": { + "imageResources": [ + { + "id": 1, + "textureName": "star", + "textureFolder": "", + "previewUrl": "/images/star.png", + "imageMode": "fixed", + "sequencePlayback": "loop-forward", + "sequenceFps": 30, + "sequenceFrames": [], + "weight": 100, + "locked": false, + "scale": 1, + "anchorX": 0.5, + "anchorY": 0.5, + "colorMode": "fixed", + "colorStart": "#00eeff", + "colorEnd": "#ff4d4d", + "colorGradient": [ + { + "position": 0, + "color": "#ffffff" + }, + { + "position": 1, + "color": "#ff4d4d" + } + ], + "blend": "add", + "independentAlpha": "off", + "alpha": 1, + "alphaCurveMode": "跟随导出", + "alphaCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 0.1, + "y": 1 + }, + { + "x": 0.9, + "y": 1 + }, + { + "x": 1, + "y": 0 + } + ] + } + ], + "imageWeightVersion": 1, + "name": "Burst", + "mode": "burst", + "rate": 20, + "streamBehavior": "normal", + "loopDurationFrames": 30, + "generateLoopStartAnimation": false, + "loopStartUseCustomDuration": false, + "loopStartDurationFrames": 30, + "generateLoopEndAnimation": false, + "loopEndUseCustomDuration": false, + "loopEndDurationFrames": 30, + "burstCount": 10, + "burstLoop": false, + "delay": 0, + "duration": 1, + "shape": "point", + "showShape": true, + "shapeRangeVersion": 1, + "innerRadius": 0, + "outerRadius": 30, + "innerRectW": 0, + "innerRectH": 0, + "outerRectW": 60, + "outerRectH": 40, + "spawnPathId": 0, + "spawnPathDistribution": "fixed", + "radius": 30, + "rectW": 60, + "rectH": 40, + "centerX": 0, + "centerY": 0, + "rootRotation": 0, + "rootScaleX": 1, + "rootScaleY": 1, + "renderLayerMode": "top", + "renderLayerSpineId": 0, + "renderLayerSlotName": "", + "renderLayerSlotPosition": "above", + "renderLayerFollowAttachment": false, + "emissionAngleMode": "random", + "direction": 0, + "spread": 360, + "coneDirection": 90, + "coneAngle": 60, + "lifeMin": 0.6, + "lifeMax": 1.8, + "lifeMode": "random", + "lifeCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "speedMin": 182, + "speedMax": 107, + "speedMode": "random", + "speedCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleMin": 0.3, + "scaleMax": 0.8, + "scaleMode": "random", + "scaleAxisMode": "uniform", + "scaleYMin": 0.3, + "scaleYMax": 0.8, + "scaleCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleYCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleEndRatio": 0.3, + "initialRotationMode": "random", + "initialRotationMin": 0, + "initialRotationMax": 360, + "initialRotationCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "alpha": 0.9, + "alphaEnd": 0, + "rotationSpeedMin": -360, + "rotationSpeedMax": 360, + "speedOverLifeEnabled": false, + "speedOverLifeMode": "fixed", + "speedOverLifeMin": 1, + "speedOverLifeMax": 1, + "speedOverLifeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleOverLifeEnabled": false, + "scaleOverLifeMode": "curve", + "scaleOverLifeAxisMode": "uniform", + "scaleOverLifeMin": 0, + "scaleOverLifeMax": 1, + "scaleYOverLifeMin": 0, + "scaleYOverLifeMax": 1, + "scaleOverLifeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleYOverLifeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "rotationOverLifeEnabled": true, + "rotationOverLifeMode": "random", + "rotationOverLifeCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "gravity": 980, + "gravityMode": "fixed", + "gravityMin": 980, + "gravityMax": 980, + "gravityDirection": -90, + "gravityCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "damping": 1, + "seed": 981504, + "colorStart": "#ffffff", + "colorEnd": "#ff4d4d", + "colorOverLife": false, + "blend": "add", + "alphaMode": "curve", + "curveMode": "线性", + "alphaCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 0.2, + "y": 1 + }, + { + "x": 0.8, + "y": 1 + }, + { + "x": 1, + "y": 0 + } + ], + "textureName": "star", + "textureFolder": "", + "alphaScale": 1, + "anchorX": 0.5, + "anchorY": 0.5, + "independentAlpha": "off", + "offsetX": 0, + "offsetY": 0, + "noise": false, + "noiseAmt": 30, + "noiseRange": 100, + "noiseSpeed": 1, + "useGravity": true, + "wind": false, + "windX": 0, + "windY": 0, + "windMode": "fixed", + "windMin": 100, + "windMax": 100, + "windDirection": 0, + "windCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "forceField": false, + "forceStrength": 10, + "forceRadius": 100, + "forceCenterX": 0, + "forceCenterY": 0, + "forceFalloff": "linear", + "showForceFieldShape": true, + "vortex": false, + "vortexStrength": 10, + "vortexRadius": 100, + "vortexCenterX": 0, + "vortexCenterY": 0, + "vortexFalloff": "linear", + "showVortexShape": true, + "attraction": false, + "attractionCenterX": 200, + "attractionCenterY": 0, + "attractionRadius": 20, + "attractionDuration": 0.5, + "attractionDelay": 0.1, + "attractionDelayMode": "particle", + "attractionPath": "curve", + "showAttractionShape": true, + "trail": true, + "trailConfigVersion": 3, + "trailResources": [ + { + "id": 1, + "textureName": "trail", + "previewUrl": "/images/trail.png", + "weight": 100, + "locked": false, + "rotation": 0, + "colorMode": "fixed", + "color": "#77fdfb", + "colorGradient": [ + { + "position": 0, + "color": "#ffffff" + }, + { + "position": 1, + "color": "#ffffff" + } + ], + "blend": "normal", + "alphaMode": "particle", + "alpha": 1, + "alphaCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "boneCount": 8, + "trailRatio": 40, + "lengthMode": "fixed", + "length": 50, + "lengthMin": 100, + "lengthMax": 100, + "widthSizeMode": "fixed", + "width": 20, + "widthMin": 100, + "widthMax": 100, + "widthMode": "particle", + "lifeLengthEnabled": false, + "lifeLengthCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "shapeEnabled": false, + "shapeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ] + } + ], + "trailResourceVersion": 6, + "trailTextureName": "trail", + "trailPreviewUrl": "/images/trail.png", + "trailColorMode": "particle", + "trailColor": "#ffffff", + "trailColorGradient": [ + { + "position": 0, + "color": "#ffffff" + }, + { + "position": 1, + "color": "#ffffff" + } + ], + "trailAlphaMode": "particle", + "trailAlpha": 1, + "trailAlphaCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "trailBoneCount": 3, + "trailLength": 100, + "trailWidth": 100, + "trailWidthMode": "particle", + "trailLifeLengthEnabled": false, + "trailLifeLengthCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "trailShapeEnabled": false, + "trailShapeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "trailGridRows": 9, + "trailGridCols": 9, + "collision": true, + "collisionColliderIds": [ + 2 + ], + "pathFollow": false, + "eventEnabled": true, + "events": [ + { + "id": 1, + "event": "collision", + "targetSystemId": 4, + "probability": 1, + "inherit": [ + "scale" + ], + "colorInheritMode": "add", + "collisionLimit": 1 + } + ], + "emitterFollow": false, + "emitterFollowMode": "none", + "emitterFollowPathId": 0, + "emitterFollowSpineId": 0, + "emitterFollowBoneName": "", + "emitterFollowBoneOffsetX": 0, + "emitterFollowBoneOffsetY": 0, + "emitterFollowBoneRotation": 0, + "emitterFollowBoneScaleX": 1, + "emitterFollowBoneScaleY": 1, + "emitterAngleMode": "fixed", + "emitterFollowCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "emitterFollowDuration": 2, + "emitterFollowSpace": "world", + "emitterFollowDirection": "forward", + "emitterFollowOffset": 0 + } + }, + { + "id": 4, + "visible": true, + "animation": "animation", + "config": { + "imageResources": [ + { + "id": 1, + "textureName": "star", + "textureFolder": "", + "previewUrl": "/images/star.png", + "imageMode": "fixed", + "sequencePlayback": "loop-forward", + "sequenceFps": 30, + "sequenceFrames": [], + "weight": 100, + "locked": false, + "scale": 1, + "anchorX": 0.5, + "anchorY": 0.5, + "colorMode": "fixed", + "colorStart": "#ff0000", + "colorEnd": "#ff4d4d", + "colorGradient": [ + { + "position": 0, + "color": "#ffffff" + }, + { + "position": 1, + "color": "#ff4d4d" + } + ], + "blend": "add", + "independentAlpha": "off", + "alpha": 1, + "alphaCurveMode": "跟随导出", + "alphaCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 0.1, + "y": 1 + }, + { + "x": 0.9, + "y": 1 + }, + { + "x": 1, + "y": 0 + } + ] + } + ], + "imageWeightVersion": 1, + "name": "Burst_Collid", + "mode": "burst", + "rate": 20, + "streamBehavior": "normal", + "loopDurationFrames": 30, + "generateLoopStartAnimation": false, + "loopStartUseCustomDuration": false, + "loopStartDurationFrames": 30, + "generateLoopEndAnimation": false, + "loopEndUseCustomDuration": false, + "loopEndDurationFrames": 30, + "burstCount": 10, + "burstLoop": false, + "delay": 0, + "duration": 1, + "shape": "point", + "showShape": true, + "shapeRangeVersion": 1, + "innerRadius": 0, + "outerRadius": 30, + "innerRectW": 0, + "innerRectH": 0, + "outerRectW": 60, + "outerRectH": 40, + "spawnPathId": 0, + "spawnPathDistribution": "fixed", + "radius": 30, + "rectW": 60, + "rectH": 40, + "centerX": 0, + "centerY": 0, + "rootRotation": 0, + "rootScaleX": 1, + "rootScaleY": 1, + "renderLayerMode": "top", + "renderLayerSpineId": 0, + "renderLayerSlotName": "", + "renderLayerSlotPosition": "above", + "renderLayerFollowAttachment": false, + "emissionAngleMode": "random", + "direction": 0, + "spread": 360, + "coneDirection": 90, + "coneAngle": 60, + "lifeMin": 0.6, + "lifeMax": 1, + "lifeMode": "random", + "lifeCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "speedMin": 30, + "speedMax": 50, + "speedMode": "random", + "speedCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleMin": 0.3, + "scaleMax": 0.8, + "scaleMode": "fixed", + "scaleAxisMode": "uniform", + "scaleYMin": 0.3, + "scaleYMax": 0.8, + "scaleCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleYCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleEndRatio": 0.3, + "initialRotationMode": "random", + "initialRotationMin": 0, + "initialRotationMax": 360, + "initialRotationCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "alpha": 0.9, + "alphaEnd": 0, + "rotationSpeedMin": -180, + "rotationSpeedMax": 180, + "speedOverLifeEnabled": false, + "speedOverLifeMode": "fixed", + "speedOverLifeMin": 1, + "speedOverLifeMax": 1, + "speedOverLifeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleOverLifeEnabled": false, + "scaleOverLifeMode": "curve", + "scaleOverLifeAxisMode": "uniform", + "scaleOverLifeMin": 0, + "scaleOverLifeMax": 1, + "scaleYOverLifeMin": 0, + "scaleYOverLifeMax": 1, + "scaleOverLifeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleYOverLifeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "rotationOverLifeEnabled": true, + "rotationOverLifeMode": "random", + "rotationOverLifeCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "gravity": 980, + "gravityMode": "fixed", + "gravityMin": 980, + "gravityMax": 980, + "gravityDirection": -90, + "gravityCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "damping": 1, + "seed": 883913, + "colorStart": "#ffffff", + "colorEnd": "#ff4d4d", + "colorOverLife": false, + "blend": "add", + "alphaMode": "curve", + "curveMode": "线性", + "alphaCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 0.2, + "y": 1 + }, + { + "x": 0.8, + "y": 1 + }, + { + "x": 1, + "y": 0 + } + ], + "textureName": "star", + "textureFolder": "", + "alphaScale": 1, + "anchorX": 0.5, + "anchorY": 0.5, + "independentAlpha": "off", + "offsetX": 0, + "offsetY": 0, + "noise": false, + "noiseAmt": 30, + "noiseRange": 100, + "noiseSpeed": 1, + "useGravity": false, + "wind": false, + "windX": 0, + "windY": 0, + "windMode": "fixed", + "windMin": 100, + "windMax": 100, + "windDirection": 0, + "windCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "forceField": false, + "forceStrength": 10, + "forceRadius": 100, + "forceCenterX": 0, + "forceCenterY": 0, + "forceFalloff": "linear", + "showForceFieldShape": true, + "vortex": false, + "vortexStrength": 10, + "vortexRadius": 100, + "vortexCenterX": 0, + "vortexCenterY": 0, + "vortexFalloff": "linear", + "showVortexShape": true, + "attraction": false, + "attractionCenterX": 200, + "attractionCenterY": 0, + "attractionRadius": 20, + "attractionDuration": 0.5, + "attractionDelay": 0.1, + "attractionDelayMode": "particle", + "attractionPath": "curve", + "showAttractionShape": true, + "trail": false, + "trailConfigVersion": 3, + "trailResources": [ + { + "id": 1, + "textureName": "trail", + "previewUrl": "/images/trail.png", + "weight": 100, + "locked": false, + "rotation": 0, + "colorMode": "particle", + "color": "#ffffff", + "colorGradient": [ + { + "position": 0, + "color": "#ffffff" + }, + { + "position": 1, + "color": "#ffffff" + } + ], + "blend": "normal", + "alphaMode": "particle", + "alpha": 1, + "alphaCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "boneCount": 3, + "trailRatio": 100, + "lengthMode": "fixed", + "length": 100, + "lengthMin": 100, + "lengthMax": 100, + "widthSizeMode": "fixed", + "width": 100, + "widthMin": 100, + "widthMax": 100, + "widthMode": "particle", + "lifeLengthEnabled": false, + "lifeLengthCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "shapeEnabled": false, + "shapeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ] + } + ], + "trailResourceVersion": 6, + "trailTextureName": "trail", + "trailPreviewUrl": "/images/trail.png", + "trailColorMode": "particle", + "trailColor": "#ffffff", + "trailColorGradient": [ + { + "position": 0, + "color": "#ffffff" + }, + { + "position": 1, + "color": "#ffffff" + } + ], + "trailAlphaMode": "particle", + "trailAlpha": 1, + "trailAlphaCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "trailBoneCount": 3, + "trailLength": 100, + "trailWidth": 100, + "trailWidthMode": "particle", + "trailLifeLengthEnabled": false, + "trailLifeLengthCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "trailShapeEnabled": false, + "trailShapeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "trailGridRows": 4, + "trailGridCols": 4, + "collision": false, + "collisionColliderIds": [], + "pathFollow": false, + "eventEnabled": false, + "events": [], + "emitterFollow": false, + "emitterFollowMode": "none", + "emitterFollowPathId": 0, + "emitterFollowSpineId": 0, + "emitterFollowBoneName": "", + "emitterFollowBoneOffsetX": 0, + "emitterFollowBoneOffsetY": 0, + "emitterFollowBoneRotation": 0, + "emitterFollowBoneScaleX": 1, + "emitterFollowBoneScaleY": 1, + "emitterAngleMode": "fixed", + "emitterFollowCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "emitterFollowDuration": 2, + "emitterFollowSpace": "world", + "emitterFollowDirection": "forward", + "emitterFollowOffset": 0 + } + } + ], + "colliders": [ + { + "id": 2, + "name": "Collider", + "visible": true, + "shape": "rect", + "enabled": true, + "x": 0, + "y": -60, + "rotation": 0, + "scaleX": 4, + "scaleY": 0.5, + "radius": 50, + "radiusX": 70, + "radiusY": 45, + "width": 120, + "height": 80, + "sides": 6, + "response": "physics", + "elasticity": 0.5, + "friction": 0.3, + "followPath": false, + "followPathId": 0, + "followDuration": 2, + "followPathRotation": false, + "followCurveMode": "跟随导出", + "followCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ] + } + ], + "paths": [], + "spines": [] + } +} \ No newline at end of file diff --git a/dist/Preset/6.SpineBoy.json b/dist/Preset/7.SpineBoy.json similarity index 100% rename from dist/Preset/6.SpineBoy.json rename to dist/Preset/7.SpineBoy.json diff --git a/dist/Preset/index.json b/dist/Preset/index.json index 12adbb9..67c0c17 100644 --- a/dist/Preset/index.json +++ b/dist/Preset/index.json @@ -20,7 +20,11 @@ "file": "5.贴图轴点.json" }, { - "name": "6.SpineBoy", - "file": "6.SpineBoy.json" + "name": "6.子发射器", + "file": "6.子发射器.json" + }, + { + "name": "7.SpineBoy", + "file": "7.SpineBoy.json" } ] diff --git a/dist/assets/index-CUwqGGwd.js b/dist/assets/index-8-FN8Glu.js similarity index 99% rename from dist/assets/index-CUwqGGwd.js rename to dist/assets/index-8-FN8Glu.js index 02a25ac..48a0987 100644 --- a/dist/assets/index-CUwqGGwd.js +++ b/dist/assets/index-8-FN8Glu.js @@ -1,4 +1,4 @@ -var Ae=Object.defineProperty;var Be=(m,o,e)=>o in m?Ae(m,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):m[o]=e;var a=(m,o,e)=>Be(m,typeof o!="symbol"?o+"":o,e);import{T as Fe,a as he,b as F,S as ue,M as pe,c as oe,W as ne,B as H,d as z,L as Te,E as O,e as ce,p as q,f as Ee,g as fe,A as Q,h as me,i as De,j as V,s as re,G as we,k as $,l as Y,m as Le,P as Ie,n as Re,o as Ne,C as X,q as be,r as _e,t as Ue,u as Ye,v as Xe,w as ee,x as j,y as ke,z as Ve,D as J,F as ge,V as Ge,H as ae,I as We,J as $e,U as xe,K as E,R as ve,N as ye,O as Pe,Q as Oe,X as He,Y as ze,Z as qe,_ as Ke}from"./index-BDM5NpkZ.js";import{$ as bt,a0 as kt,a1 as vt,a2 as yt,a3 as Pt,a4 as St,a5 as Mt,a6 as At,a7 as Bt,a8 as Ft,a9 as Et,aa as Dt,ab as Lt,ac as It,ad as Rt,ae as Nt,af as _t,ag as Ut,ah as Yt,ai as Xt,aj as Vt,ak as Gt,al as Wt,am as $t,an as Ot,ao as Ht,ap as zt,aq as qt,ar as Kt,as as Zt,at as Jt,au as Qt,av as jt,aw as es,ax as ts,ay as ss,az as os,aA as ns,aB as as,aC as rs,aD as is,aE as ls,aF as hs,aG as cs,aH as ds,aI as us,aJ as ps,aK as fs,aL as ms,aM as gs,aN as xs,aO as Cs,aP as Ts,aQ as ws,aR as bs,aS as ks,aT as vs,aU as ys,aV as Ps,aW as Ss,aX as Ms,aY as As,aZ as Bs,a_ as Fs,a$ as Es,b0 as Ds,b1 as Ls,b2 as Is,b3 as Rs,b4 as Ns,b5 as _s,b6 as Us,b7 as Ys,b8 as Xs,b9 as Vs,ba as Gs,bb as Ws,bc as $s,bd as Os,be as Hs,bf as zs,bg as qs,bh as Ks,bi as Zs,bj as Js,bk as Qs,bl as js,bm as eo,bn as to,bo as so,bp as oo,bq as no,br as ao,bs as ro,bt as io,bu as lo,bv as ho,bw as co,bx as uo,by as po,bz as fo,bA as mo,bB as go,bC as xo,bD as Co,bE as To,bF as wo,bG as bo,bH as ko,bI as vo,bJ as yo,bK as Po,bL as So,bM as Mo,bN as Ao,bO as Bo,bP as Fo,bQ as Eo,bR as Do,bS as Lo,bT as Io,bU as Ro,bV as No,bW as _o,bX as Uo,bY as Yo,bZ as Xo,b_ as Vo,b$ as Go,c0 as Wo,c1 as $o,c2 as Oo,c3 as Ho}from"./index-BDM5NpkZ.js";import{SkeletonClipping as de,SkeletonPhysicsMovement as Ze,AnimationStateData as Je,AtlasAttachmentLoader as Qe,SkeletonBounds as je}from"./index-BS4GpQRH.js";import{AssetCache as qo,AssetManagerBase as Ko,Downloader as Zo,SkeletonRendererCore as Jo,Triangulator as Qo}from"./index-BS4GpQRH.js";if(typeof window<"u"&&window.PIXI){const m=window.require;window.require=o=>{if(m)return m(o);if(o.startsWith("@pixi/"))return window.PIXI}}const _=class _ extends Fe{constructor(e){super(e.resource.source);a(this,"texture");this.texture=he.from(e)}static from(e){return _.textureMap.has(e)?_.textureMap.get(e):new _(e)}setFilters(e,t){this.texture.baseTexture.scaleMode=_.toPixiTextureFilter(e),this.texture.baseTexture.mipmap=_.toPixiMipMap(e)}setWraps(e,t){this.texture.baseTexture.wrapMode=_.toPixiTextureWrap(e)}dispose(){this.texture.destroy()}static toPixiTextureFilter(e){switch(e){case F.Nearest:case F.MipMapNearestLinear:case F.MipMapNearestNearest:return ue.NEAREST;case F.Linear:case F.MipMapLinearLinear:case F.MipMapLinearNearest:return ue.LINEAR;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiMipMap(e){switch(e){case F.Nearest:case F.Linear:return pe.OFF;case F.MipMapNearestLinear:case F.MipMapNearestNearest:case F.MipMapLinearLinear:case F.MipMapLinearNearest:return pe.ON;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiTextureWrap(e){switch(e){case oe.ClampToEdge:return ne.CLAMP;case oe.MirroredRepeat:return ne.MIRRORED_REPEAT;case oe.Repeat:return ne.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(e)}`)}}static toPixiBlending(e){switch(e){case H.Normal:return z.NORMAL;case H.Additive:return z.ADD;case H.Multiply:return z.MULTIPLY;case H.Screen:return z.SCREEN;default:throw new Error(`Unknown blendMode: ${String(e)}`)}}};a(_,"textureMap",new Map);let G=_;const K="spineTextureAtlasLoader",et={extension:O.Asset,resolver:{test:m=>V(m,".atlas"),parse:m=>{var e,t;const o=m.split(".");return{resolution:parseFloat(((t=(e=re.RETINA_PREFIX)==null?void 0:e.exec(m))==null?void 0:t[1])??"1"),format:o[o.length-2],src:m}}},loader:{name:K,extension:{type:O.LoadParser,priority:Te.Normal,name:K},test(m){return V(m,".atlas")},async load(m){const o=await re.ADAPTER.fetch(m);if(!o.ok)throw new Error(`[${K}] Failed to fetch ${m}: ${o.status} ${o.statusText}`);return await o.text()},testParse(m,o){const e=V(o.src,".atlas"),t=typeof m=="string",s=o.loadParser===K;return Promise.resolve((e||s)&&t)},unload(m){m.dispose()},async parse(m,o,e){var p;const t=o.data||{};let s=q.dirname(o.src);s&&s.lastIndexOf("/")!==s.length-1&&(s+="/");const n=new Ee(m);if(t.images instanceof fe||typeof t.images=="string"){const h=t.images;t.images={},t.images[n.pages[0].name]=h}const r=[];let l=!0;for(const h of e.parsers)if(h.name==="loadTextures"){l=(p=h.config)==null?void 0:p.preferCreateImageBitmap;break}Q.setPreferences({preferCreateImageBitmap:!1});for(const h of n.pages){const u=h.name,c=t!=null&&t.images?t.images[u]:void 0;if(c instanceof fe)h.setTexture(G.from(c));else{const i=c??q.normalize([...s.split(q.sep),u].join(q.sep)),g={src:De(i,o.src),data:{...t.imageMetadata,alphaMode:h.pma?me.PMA:me.UNPACK}},x=e.load(g).then(d=>{h.setTexture(G.from(d.baseTexture))});r.push(x)}}return await Promise.all(r),Q.setPreferences({preferCreateImageBitmap:l}),n}}};ce.add(et);const Z="spineSkeletonLoader";function tt(m){return m.hasOwnProperty("bones")}function st(m){return m instanceof Uint8Array}const ot={extension:O.Asset,loader:{name:Z,extension:{type:O.LoadParser,priority:Te.Normal,name:Z},test(m){return V(m,".skel")},async load(m){const o=await re.ADAPTER.fetch(m);if(!o.ok)throw new Error(`[${Z}] Failed to fetch ${m}: ${o.status} ${o.statusText}`);return new Uint8Array(await o.arrayBuffer())},testParse(m,o){const e=V(o.src,".json")&&tt(m),t=V(o.src,".skel")&&st(m),s=o.loadParser===Z;return Promise.resolve(e||t||s)}}};ce.add(ot);class nt extends we{constructor(o=!1){super();const e=new $(void 0),t=new $(void 0,!0),s=new $(void 0,!0,!0);this.addAttribute("aVertexPosition",e,2,!1,Y.FLOAT),this.addAttribute("aTextureCoord",t,2,!1,Y.FLOAT),this.addIndex(s)}}const at=` +var Ae=Object.defineProperty;var Be=(m,o,e)=>o in m?Ae(m,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):m[o]=e;var a=(m,o,e)=>Be(m,typeof o!="symbol"?o+"":o,e);import{T as Fe,a as he,b as F,S as ue,M as pe,c as oe,W as ne,B as H,d as z,L as Te,E as O,e as ce,p as q,f as Ee,g as fe,A as Q,h as me,i as De,j as V,s as re,G as we,k as $,l as Y,m as Le,P as Ie,n as Re,o as Ne,C as X,q as be,r as _e,t as Ue,u as Ye,v as Xe,w as ee,x as j,y as ke,z as Ve,D as J,F as ge,V as Ge,H as ae,I as We,J as $e,U as xe,K as E,R as ve,N as ye,O as Pe,Q as Oe,X as He,Y as ze,Z as qe,_ as Ke}from"./index-CPXvsWyv.js";import{$ as bt,a0 as kt,a1 as vt,a2 as yt,a3 as Pt,a4 as St,a5 as Mt,a6 as At,a7 as Bt,a8 as Ft,a9 as Et,aa as Dt,ab as Lt,ac as It,ad as Rt,ae as Nt,af as _t,ag as Ut,ah as Yt,ai as Xt,aj as Vt,ak as Gt,al as Wt,am as $t,an as Ot,ao as Ht,ap as zt,aq as qt,ar as Kt,as as Zt,at as Jt,au as Qt,av as jt,aw as es,ax as ts,ay as ss,az as os,aA as ns,aB as as,aC as rs,aD as is,aE as ls,aF as hs,aG as cs,aH as ds,aI as us,aJ as ps,aK as fs,aL as ms,aM as gs,aN as xs,aO as Cs,aP as Ts,aQ as ws,aR as bs,aS as ks,aT as vs,aU as ys,aV as Ps,aW as Ss,aX as Ms,aY as As,aZ as Bs,a_ as Fs,a$ as Es,b0 as Ds,b1 as Ls,b2 as Is,b3 as Rs,b4 as Ns,b5 as _s,b6 as Us,b7 as Ys,b8 as Xs,b9 as Vs,ba as Gs,bb as Ws,bc as $s,bd as Os,be as Hs,bf as zs,bg as qs,bh as Ks,bi as Zs,bj as Js,bk as Qs,bl as js,bm as eo,bn as to,bo as so,bp as oo,bq as no,br as ao,bs as ro,bt as io,bu as lo,bv as ho,bw as co,bx as uo,by as po,bz as fo,bA as mo,bB as go,bC as xo,bD as Co,bE as To,bF as wo,bG as bo,bH as ko,bI as vo,bJ as yo,bK as Po,bL as So,bM as Mo,bN as Ao,bO as Bo,bP as Fo,bQ as Eo,bR as Do,bS as Lo,bT as Io,bU as Ro,bV as No,bW as _o,bX as Uo,bY as Yo,bZ as Xo,b_ as Vo,b$ as Go,c0 as Wo,c1 as $o,c2 as Oo,c3 as Ho}from"./index-CPXvsWyv.js";import{SkeletonClipping as de,SkeletonPhysicsMovement as Ze,AnimationStateData as Je,AtlasAttachmentLoader as Qe,SkeletonBounds as je}from"./index-CT90mgj8.js";import{AssetCache as qo,AssetManagerBase as Ko,Downloader as Zo,SkeletonRendererCore as Jo,Triangulator as Qo}from"./index-CT90mgj8.js";if(typeof window<"u"&&window.PIXI){const m=window.require;window.require=o=>{if(m)return m(o);if(o.startsWith("@pixi/"))return window.PIXI}}const _=class _ extends Fe{constructor(e){super(e.resource.source);a(this,"texture");this.texture=he.from(e)}static from(e){return _.textureMap.has(e)?_.textureMap.get(e):new _(e)}setFilters(e,t){this.texture.baseTexture.scaleMode=_.toPixiTextureFilter(e),this.texture.baseTexture.mipmap=_.toPixiMipMap(e)}setWraps(e,t){this.texture.baseTexture.wrapMode=_.toPixiTextureWrap(e)}dispose(){this.texture.destroy()}static toPixiTextureFilter(e){switch(e){case F.Nearest:case F.MipMapNearestLinear:case F.MipMapNearestNearest:return ue.NEAREST;case F.Linear:case F.MipMapLinearLinear:case F.MipMapLinearNearest:return ue.LINEAR;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiMipMap(e){switch(e){case F.Nearest:case F.Linear:return pe.OFF;case F.MipMapNearestLinear:case F.MipMapNearestNearest:case F.MipMapLinearLinear:case F.MipMapLinearNearest:return pe.ON;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiTextureWrap(e){switch(e){case oe.ClampToEdge:return ne.CLAMP;case oe.MirroredRepeat:return ne.MIRRORED_REPEAT;case oe.Repeat:return ne.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(e)}`)}}static toPixiBlending(e){switch(e){case H.Normal:return z.NORMAL;case H.Additive:return z.ADD;case H.Multiply:return z.MULTIPLY;case H.Screen:return z.SCREEN;default:throw new Error(`Unknown blendMode: ${String(e)}`)}}};a(_,"textureMap",new Map);let G=_;const K="spineTextureAtlasLoader",et={extension:O.Asset,resolver:{test:m=>V(m,".atlas"),parse:m=>{var e,t;const o=m.split(".");return{resolution:parseFloat(((t=(e=re.RETINA_PREFIX)==null?void 0:e.exec(m))==null?void 0:t[1])??"1"),format:o[o.length-2],src:m}}},loader:{name:K,extension:{type:O.LoadParser,priority:Te.Normal,name:K},test(m){return V(m,".atlas")},async load(m){const o=await re.ADAPTER.fetch(m);if(!o.ok)throw new Error(`[${K}] Failed to fetch ${m}: ${o.status} ${o.statusText}`);return await o.text()},testParse(m,o){const e=V(o.src,".atlas"),t=typeof m=="string",s=o.loadParser===K;return Promise.resolve((e||s)&&t)},unload(m){m.dispose()},async parse(m,o,e){var p;const t=o.data||{};let s=q.dirname(o.src);s&&s.lastIndexOf("/")!==s.length-1&&(s+="/");const n=new Ee(m);if(t.images instanceof fe||typeof t.images=="string"){const h=t.images;t.images={},t.images[n.pages[0].name]=h}const r=[];let l=!0;for(const h of e.parsers)if(h.name==="loadTextures"){l=(p=h.config)==null?void 0:p.preferCreateImageBitmap;break}Q.setPreferences({preferCreateImageBitmap:!1});for(const h of n.pages){const u=h.name,c=t!=null&&t.images?t.images[u]:void 0;if(c instanceof fe)h.setTexture(G.from(c));else{const i=c??q.normalize([...s.split(q.sep),u].join(q.sep)),g={src:De(i,o.src),data:{...t.imageMetadata,alphaMode:h.pma?me.PMA:me.UNPACK}},x=e.load(g).then(d=>{h.setTexture(G.from(d.baseTexture))});r.push(x)}}return await Promise.all(r),Q.setPreferences({preferCreateImageBitmap:l}),n}}};ce.add(et);const Z="spineSkeletonLoader";function tt(m){return m.hasOwnProperty("bones")}function st(m){return m instanceof Uint8Array}const ot={extension:O.Asset,loader:{name:Z,extension:{type:O.LoadParser,priority:Te.Normal,name:Z},test(m){return V(m,".skel")},async load(m){const o=await re.ADAPTER.fetch(m);if(!o.ok)throw new Error(`[${Z}] Failed to fetch ${m}: ${o.status} ${o.statusText}`);return new Uint8Array(await o.arrayBuffer())},testParse(m,o){const e=V(o.src,".json")&&tt(m),t=V(o.src,".skel")&&st(m),s=o.loadParser===Z;return Promise.resolve(e||t||s)}}};ce.add(ot);class nt extends we{constructor(o=!1){super();const e=new $(void 0),t=new $(void 0,!0),s=new $(void 0,!0,!0);this.addAttribute("aVertexPosition",e,2,!1,Y.FLOAT),this.addAttribute("aTextureCoord",t,2,!1,Y.FLOAT),this.addIndex(s)}}const at=` attribute vec2 aVertexPosition; attribute vec2 aTextureCoord; diff --git a/dist/assets/index-BDM5NpkZ.js b/dist/assets/index-BDM5NpkZ.js deleted file mode 100644 index b455daa..0000000 --- a/dist/assets/index-BDM5NpkZ.js +++ /dev/null @@ -1,1239 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CUwqGGwd.js","assets/index-BS4GpQRH.js"])))=>i.map(i=>d[i]); -var ZS=Object.defineProperty;var JS=(i,e,t)=>e in i?ZS(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var S=(i,e,t)=>JS(i,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))s(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function t(n){const r={};return n.integrity&&(r.integrity=n.integrity),n.referrerPolicy&&(r.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?r.credentials="include":n.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(n){if(n.ep)return;n.ep=!0;const r=t(n);fetch(n.href,r)}})();/** -* @vue/shared v3.5.41 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function jm(i){const e=Object.create(null);for(const t of i.split(","))e[t]=1;return t=>t in e}const Lt={},Go=[],on=()=>{},Ay=()=>!1,Uh=i=>i.charCodeAt(0)===111&&i.charCodeAt(1)===110&&(i.charCodeAt(2)>122||i.charCodeAt(2)<97),$h=i=>i.startsWith("onUpdate:"),ps=Object.assign,Hm=(i,e)=>{const t=i.indexOf(e);t>-1&&i.splice(t,1)},QS=Object.prototype.hasOwnProperty,Pt=(i,e)=>QS.call(i,e),We=Array.isArray,jo=i=>Tl(i)==="[object Map]",fa=i=>Tl(i)==="[object Set]",Xp=i=>Tl(i)==="[object Date]",it=i=>typeof i=="function",Yt=i=>typeof i=="string",si=i=>typeof i=="symbol",kt=i=>i!==null&&typeof i=="object",Ey=i=>(kt(i)||it(i))&&it(i.then)&&it(i.catch),Iy=Object.prototype.toString,Tl=i=>Iy.call(i),eM=i=>Tl(i).slice(8,-1),Ry=i=>Tl(i)==="[object Object]",Xh=i=>Yt(i)&&i!=="NaN"&&i[0]!=="-"&&""+parseInt(i,10)===i,Wa=jm(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Vh=i=>{const e=Object.create(null);return(t=>e[t]||(e[t]=i(t)))},tM=/-\w/g,Ai=Vh(i=>i.replace(tM,e=>e.slice(1).toUpperCase())),sM=/\B([A-Z])/g,Tr=Vh(i=>i.replace(sM,"-$1").toLowerCase()),Py=Vh(i=>i.charAt(0).toUpperCase()+i.slice(1)),Mu=Vh(i=>i?`on${Py(i)}`:""),Qi=(i,e)=>!Object.is(i,e),Tc=(i,...e)=>{for(let t=0;t{Object.defineProperty(i,e,{configurable:!0,enumerable:!1,writable:s,value:t})},Yh=i=>{const e=parseFloat(i);return isNaN(e)?i:e},iM=i=>{const e=Yt(i)?Number(i):NaN;return isNaN(e)?i:e};let Vp;const Gh=()=>Vp||(Vp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Vt(i){if(We(i)){const e={};for(let t=0;t{if(t){const s=t.split(rM);s.length>1&&(e[s[0].trim()]=s[1].trim())}}),e}function Ae(i){let e="";if(Yt(i))e=i;else if(We(i))for(let t=0;tma(t,e))}const Oy=i=>!!(i&&i.__v_isRef===!0),ye=i=>Yt(i)?i:i==null?"":We(i)||kt(i)&&(i.toString===Iy||!it(i.toString))?Oy(i)?ye(i.value):JSON.stringify(i,Ly,2):String(i),Ly=(i,e)=>Oy(e)?Ly(i,e.value):jo(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[s,n],r)=>(t[Tu(s,r)+" =>"]=n,t),{})}:fa(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>Tu(t))}:si(e)?Tu(e):kt(e)&&!We(e)&&!Ry(e)?String(e):e,Tu=(i,e="")=>{var t;return si(i)?`Symbol(${(t=i.description)!=null?t:e})`:i};/** -* @vue/reactivity v3.5.41 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let ds;class By{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&ds&&(ds.active?(this.parent=ds,this.index=(ds.scopes||(ds.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){const s=this.scopes.slice();for(e=0,t=s.length;e0&&--this._on===0){if(ds===this)ds=this.prevScope;else{let e=ds;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,s;for(t=0,s=this.effects.length;t0)return;if(qa){let e=qa;for(qa=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let i;for(;za;){let e=za;for(za=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(s){i||(i=s)}e=t}}if(i)throw i}function Vy(i){for(let e=i.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Yy(i){let e,t=i.depsTail,s=t;for(;s;){const n=s.prevDep;s.version===-1?(s===t&&(t=n),Km(s),dM(s)):e=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=n}i.deps=e,i.depsTail=t}function yf(i){for(let e=i.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Gy(e.dep.computed)||e.dep.version!==e.version))return!0;return!!i._dirty}function Gy(i){if(i.flags&4&&!(i.flags&16)||(i.flags&=-17,i.globalVersion===al)||(i.globalVersion=al,!i.isSSR&&i.flags&128&&(!i.deps&&!i._dirty||!yf(i))))return;i.flags|=2;const e=i.dep,t=Dt,s=Ei;Dt=i,Ei=!0;try{Vy(i);const n=i.fn(i._value);(e.version===0||Qi(n,i._value))&&(i.flags|=128,i._value=n,e.version++)}catch(n){throw e.version++,n}finally{Dt=t,Ei=s,Yy(i),i.flags&=-3}}function Km(i,e=!1){const{dep:t,prevSub:s,nextSub:n}=i;if(s&&(s.nextSub=n,i.prevSub=void 0),n&&(n.prevSub=s,i.nextSub=void 0),t.subs===i&&(t.subs=s,!s&&t.computed)){t.computed.flags&=-5;for(let r=t.computed.deps;r;r=r.nextDep)Km(r,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function dM(i){const{prevDep:e,nextDep:t}=i;e&&(e.nextDep=t,i.prevDep=void 0),t&&(t.prevDep=e,i.nextDep=void 0)}let Ei=!0;const jy=[];function $n(){jy.push(Ei),Ei=!1}function Xn(){const i=jy.pop();Ei=i===void 0?!0:i}function Yp(i){const{cleanup:e}=i;if(i.cleanup=void 0,e){const t=Dt;Dt=void 0;try{e()}finally{Dt=t}}}let al=0;class fM{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Zm{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Dt||!Ei||Dt===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Dt)t=this.activeLink=new fM(Dt,this),Dt.deps?(t.prevDep=Dt.depsTail,Dt.depsTail.nextDep=t,Dt.depsTail=t):Dt.deps=Dt.depsTail=t,Hy(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const s=t.nextDep;s.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=s),t.prevDep=Dt.depsTail,t.nextDep=void 0,Dt.depsTail.nextDep=t,Dt.depsTail=t,Dt.deps===t&&(Dt.deps=s)}return t}trigger(e){this.version++,al++,this.notify(e)}notify(e){zm();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{qm()}}}function Hy(i){if(i.dep.sc++,i.sub.flags&4){const e=i.dep.computed;if(e&&!i.dep.subs){e.flags|=20;for(let s=e.deps;s;s=s.nextDep)Hy(s)}const t=i.dep.subs;t!==i&&(i.prevSub=t,t&&(t.nextSub=i)),i.dep.subs=i}}const Vc=new WeakMap,so=Symbol(""),xf=Symbol(""),ll=Symbol("");function ks(i,e,t){if(Ei&&Dt){let s=Vc.get(i);s||Vc.set(i,s=new Map);let n=s.get(t);n||(s.set(t,n=new Zm),n.map=s,n.key=t),n.track()}}function Cn(i,e,t,s,n,r){const o=Vc.get(i);if(!o){al++;return}const a=l=>{l&&l.trigger()};if(zm(),e==="clear")o.forEach(a);else{const l=We(i),c=l&&Xh(t);if(l&&t==="length"){const h=Number(s);o.forEach((u,d)=>{(d==="length"||d===ll||!si(d)&&d>=h)&&a(u)})}else switch((t!==void 0||o.has(void 0))&&a(o.get(t)),c&&a(o.get(ll)),e){case"add":l?c&&a(o.get("length")):(a(o.get(so)),jo(i)&&a(o.get(xf)));break;case"delete":l||(a(o.get(so)),jo(i)&&a(o.get(xf)));break;case"set":jo(i)&&a(o.get(so));break}}qm()}function mM(i,e){const t=Vc.get(i);return t&&t.get(e)}function Mo(i){const e=St(i);return e===i?e:(ks(e,"iterate",ll),ti(i)?e:e.map(Fi))}function jh(i){return ks(i=St(i),"iterate",ll),i}function qi(i,e){return Vn(i)?ra(Bn(i)?Fi(e):e):Fi(e)}const pM={__proto__:null,[Symbol.iterator](){return Cu(this,Symbol.iterator,i=>qi(this,i))},concat(...i){return Mo(this).concat(...i.map(e=>We(e)?Mo(e):e))},entries(){return Cu(this,"entries",i=>(i[1]=qi(this,i[1]),i))},every(i,e){return pn(this,"every",i,e,void 0,arguments)},filter(i,e){return pn(this,"filter",i,e,t=>t.map(s=>qi(this,s)),arguments)},find(i,e){return pn(this,"find",i,e,t=>qi(this,t),arguments)},findIndex(i,e){return pn(this,"findIndex",i,e,void 0,arguments)},findLast(i,e){return pn(this,"findLast",i,e,t=>qi(this,t),arguments)},findLastIndex(i,e){return pn(this,"findLastIndex",i,e,void 0,arguments)},forEach(i,e){return pn(this,"forEach",i,e,void 0,arguments)},includes(...i){return Au(this,"includes",i)},indexOf(...i){return Au(this,"indexOf",i)},join(i){return Mo(this).join(i)},lastIndexOf(...i){return Au(this,"lastIndexOf",i)},map(i,e){return pn(this,"map",i,e,void 0,arguments)},pop(){return Ca(this,"pop")},push(...i){return Ca(this,"push",i)},reduce(i,...e){return Gp(this,"reduce",i,e)},reduceRight(i,...e){return Gp(this,"reduceRight",i,e)},shift(){return Ca(this,"shift")},some(i,e){return pn(this,"some",i,e,void 0,arguments)},splice(...i){return Ca(this,"splice",i)},toReversed(){return Mo(this).toReversed()},toSorted(i){return Mo(this).toSorted(i)},toSpliced(...i){return Mo(this).toSpliced(...i)},unshift(...i){return Ca(this,"unshift",i)},values(){return Cu(this,"values",i=>qi(this,i))}};function Cu(i,e,t){const s=jh(i),n=s[e]();return s!==i&&!ti(i)&&(n._next=n.next,n.next=()=>{const r=n._next();return r.done||(r.value=t(r.value)),r}),n}const gM=Array.prototype;function pn(i,e,t,s,n,r){const o=jh(i),a=o!==i&&!ti(i),l=o[e];if(l!==gM[e]){const u=l.apply(i,r);return a?Fi(u):u}let c=t;o!==i&&(a?c=function(u,d){return t.call(this,qi(i,u),d,i)}:t.length>2&&(c=function(u,d){return t.call(this,u,d,i)}));const h=l.call(o,c,s);return a&&n?n(h):h}function Gp(i,e,t,s){const n=jh(i),r=n!==i&&!ti(i);let o=t,a=!1;n!==i&&(r?(a=s.length===0,o=function(c,h,u){return a&&(a=!1,c=qi(i,c)),t.call(this,c,qi(i,h),u,i)}):t.length>3&&(o=function(c,h,u){return t.call(this,c,h,u,i)}));const l=n[e](o,...s);return a?qi(i,l):l}function Au(i,e,t){const s=St(i);ks(s,"iterate",ll);const n=s[e](...t);return(n===-1||n===!1)&&Hh(t[0])?(t[0]=St(t[0]),s[e](...t)):n}function Ca(i,e,t=[]){$n(),zm();const s=St(i)[e].apply(i,t);return qm(),Xn(),s}const vM=jm("__proto__,__v_isRef,__isVue"),Wy=new Set(Object.getOwnPropertyNames(Symbol).filter(i=>i!=="arguments"&&i!=="caller").map(i=>Symbol[i]).filter(si));function yM(i){si(i)||(i=String(i));const e=St(this);return ks(e,"has",i),e.hasOwnProperty(i)}class zy{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,s){if(t==="__v_skip")return e.__v_skip;const n=this._isReadonly,r=this._isShallow;if(t==="__v_isReactive")return!n;if(t==="__v_isReadonly")return n;if(t==="__v_isShallow")return r;if(t==="__v_raw")return s===(n?r?EM:Jy:r?Zy:Ky).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(s)?e:void 0;const o=We(e);if(!n){let l;if(o&&(l=pM[t]))return l;if(t==="hasOwnProperty")return yM}const a=Reflect.get(e,t,Gt(e)?e:s);if((si(t)?Wy.has(t):vM(t))||(n||ks(e,"get",t),r))return a;if(Gt(a)){const l=o&&Xh(t)?a:a.value;return n&&kt(l)?wf(l):l}return kt(a)?n?wf(a):mo(a):a}}class qy extends zy{constructor(e=!1){super(!1,e)}set(e,t,s,n){let r=e[t];const o=We(e)&&Xh(t);if(!this._isShallow){const c=Vn(r);if(!ti(s)&&!Vn(s)&&(r=St(r),s=St(s)),!o&&Gt(r)&&!Gt(s))return c||(r.value=s),!0}const a=o?Number(t)i,$l=i=>Reflect.getPrototypeOf(i);function MM(i,e,t){return function(...s){const n=this.__v_raw,r=St(n),o=jo(r),a=i==="entries"||i===Symbol.iterator&&o,l=i==="keys"&&o,c=n[i](...s),h=t?bf:e?ra:Fi;return!e&&ks(r,"iterate",l?xf:so),ps(Object.create(c),{next(){const{value:u,done:d}=c.next();return d?{value:u,done:d}:{value:a?[h(u[0]),h(u[1])]:h(u),done:d}}})}}function Xl(i){return function(...e){return i==="delete"?!1:i==="clear"?void 0:this}}function TM(i,e){const t={get(n){const r=this.__v_raw,o=St(r),a=St(n);i||(Qi(n,a)&&ks(o,"get",n),ks(o,"get",a));const{has:l}=$l(o),c=e?bf:i?ra:Fi;if(l.call(o,n))return c(r.get(n));if(l.call(o,a))return c(r.get(a));r!==o&&r.get(n)},get size(){const n=this.__v_raw;return!i&&ks(St(n),"iterate",so),n.size},has(n){const r=this.__v_raw,o=St(r),a=St(n);return i||(Qi(n,a)&&ks(o,"has",n),ks(o,"has",a)),n===a?r.has(n):r.has(n)||r.has(a)},forEach(n,r){const o=this,a=o.__v_raw,l=St(a),c=e?bf:i?ra:Fi;return!i&&ks(l,"iterate",so),a.forEach((h,u)=>n.call(r,c(h),c(u),o))}};return ps(t,i?{add:Xl("add"),set:Xl("set"),delete:Xl("delete"),clear:Xl("clear")}:{add(n){const r=St(this),o=$l(r),a=St(n),l=!e&&!ti(n)&&!Vn(n)?a:n;return o.has.call(r,l)||Qi(n,l)&&o.has.call(r,n)||Qi(a,l)&&o.has.call(r,a)||(r.add(l),Cn(r,"add",l,l)),this},set(n,r){!e&&!ti(r)&&!Vn(r)&&(r=St(r));const o=St(this),{has:a,get:l}=$l(o);let c=a.call(o,n);c||(n=St(n),c=a.call(o,n));const h=l.call(o,n);return o.set(n,r),c?Qi(r,h)&&Cn(o,"set",n,r):Cn(o,"add",n,r),this},delete(n){const r=St(this),{has:o,get:a}=$l(r);let l=o.call(r,n);l||(n=St(n),l=o.call(r,n)),a&&a.call(r,n);const c=r.delete(n);return l&&Cn(r,"delete",n,void 0),c},clear(){const n=St(this),r=n.size!==0,o=n.clear();return r&&Cn(n,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(n=>{t[n]=MM(n,i,e)}),t}function Jm(i,e){const t=TM(i,e);return(s,n,r)=>n==="__v_isReactive"?!i:n==="__v_isReadonly"?i:n==="__v_raw"?s:Reflect.get(Pt(t,n)&&n in s?t:s,n,r)}const _M={get:Jm(!1,!1)},CM={get:Jm(!1,!0)},AM={get:Jm(!0,!1)};const Ky=new WeakMap,Zy=new WeakMap,Jy=new WeakMap,EM=new WeakMap;function IM(i){switch(i){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function mo(i){return Vn(i)?i:Qm(i,!1,bM,_M,Ky)}function RM(i){return Qm(i,!1,SM,CM,Zy)}function wf(i){return Qm(i,!0,wM,AM,Jy)}function Qm(i,e,t,s,n){if(!kt(i)||i.__v_raw&&!(e&&i.__v_isReactive)||i.__v_skip||!Object.isExtensible(i))return i;const r=n.get(i);if(r)return r;const o=IM(eM(i));if(o===0)return i;const a=new Proxy(i,o===2?s:t);return n.set(i,a),a}function Bn(i){return Vn(i)?Bn(i.__v_raw):!!(i&&i.__v_isReactive)}function Vn(i){return!!(i&&i.__v_isReadonly)}function ti(i){return!!(i&&i.__v_isShallow)}function Hh(i){return i?!!i.__v_raw:!1}function St(i){const e=i&&i.__v_raw;return e?St(e):i}function ur(i){return!Pt(i,"__v_skip")&&Object.isExtensible(i)&&ky(i,"__v_skip",!0),i}const Fi=i=>kt(i)?mo(i):i,ra=i=>kt(i)?wf(i):i;function Gt(i){return i?i.__v_isRef===!0:!1}function Fe(i){return PM(i,!1)}function PM(i,e){return Gt(i)?i:new kM(i,e)}class kM{constructor(e,t){this.dep=new Zm,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:St(e),this._value=t?e:Fi(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,s=this.__v_isShallow||ti(e)||Vn(e);e=s?e:St(e),Qi(e,t)&&(this._rawValue=e,this._value=s?e:Fi(e),this.dep.trigger())}}function R(i){return Gt(i)?i.value:i}const FM={get:(i,e,t)=>e==="__v_raw"?i:R(Reflect.get(i,e,t)),set:(i,e,t,s)=>{const n=i[e];return Gt(n)&&!Gt(t)?(n.value=t,!0):Reflect.set(i,e,t,s)}};function Qy(i){return Bn(i)?i:new Proxy(i,FM)}function OM(i){const e=We(i)?new Array(i.length):{};for(const t in i)e[t]=BM(i,t);return e}class LM{constructor(e,t,s){this._object=e,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=si(t)?t:String(t),this._raw=St(e);let n=!0,r=e;if(!We(e)||si(this._key)||!Xh(this._key))do n=!Hh(r)||ti(r);while(n&&(r=r.__v_raw));this._shallow=n}get value(){let e=this._object[this._key];return this._shallow&&(e=R(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&Gt(this._raw[this._key])){const t=this._object[this._key];if(Gt(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return mM(this._raw,this._key)}}function BM(i,e,t){return new LM(i,e,t)}class NM{constructor(e,t,s){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Zm(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=al-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Dt!==this)return Xy(this,!0),!0}get value(){const e=this.dep.track();return Gy(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function DM(i,e,t=!1){let s,n;return it(i)?s=i:(s=i.get,n=i.set),new NM(s,n,t)}const Vl={},Yc=new WeakMap;let $r;function UM(i,e=!1,t=$r){if(t){let s=Yc.get(t);s||Yc.set(t,s=[]),s.push(i)}}function $M(i,e,t=Lt){const{immediate:s,deep:n,once:r,scheduler:o,augmentJob:a,call:l}=t,c=M=>n?M:ti(M)||n===!1||n===0?An(M,1):An(M);let h,u,d,f,p=!1,m=!1;if(Gt(i)?(u=()=>i.value,p=ti(i)):Bn(i)?(u=()=>c(i),p=!0):We(i)?(m=!0,p=i.some(M=>Bn(M)||ti(M)),u=()=>i.map(M=>{if(Gt(M))return M.value;if(Bn(M))return c(M);if(it(M))return l?l(M,2):M()})):it(i)?e?u=l?()=>l(i,2):i:u=()=>{if(d){$n();try{d()}finally{Xn()}}const M=$r;$r=h;try{return l?l(i,3,[f]):i(f)}finally{$r=M}}:u=on,e&&n){const M=u,C=n===!0?1/0:n;u=()=>An(M(),C)}const g=Dy(),v=()=>{h.stop(),g&&g.active&&Hm(g.effects,h)};if(r&&e){const M=e;e=(...C)=>{const w=M(...C);return v(),w}}let y=m?new Array(i.length).fill(Vl):Vl;const x=M=>{if(!(!(h.flags&1)||!h.dirty&&!M))if(e){const C=h.run();if(M||n||p||(m?C.some((w,b)=>Qi(w,y[b])):Qi(C,y))){d&&d();const w=$r;$r=h;try{const b=[C,y===Vl?void 0:m&&y[0]===Vl?[]:y,f];y=C,l?l(e,3,b):e(...b)}finally{$r=w}}}else h.run()};return a&&a(x),h=new Uy(u),h.scheduler=o?()=>o(x,!1):x,f=M=>UM(M,!1,h),d=h.onStop=()=>{const M=Yc.get(h);if(M){if(l)l(M,4);else for(const C of M)C();Yc.delete(h)}},e?s?x(!0):y=h.run():o?o(x.bind(null,!0),!0):h.run(),v.pause=h.pause.bind(h),v.resume=h.resume.bind(h),v.stop=v,v}function An(i,e=1/0,t){if(e<=0||!kt(i)||i.__v_skip||(t=t||new Map,(t.get(i)||0)>=e))return i;if(t.set(i,e),e--,Gt(i))An(i.value,e,t);else if(We(i))for(let s=0;s{An(s,e,t)});else if(Ry(i)){for(const s in i)An(i[s],e,t);for(const s of Object.getOwnPropertySymbols(i))Object.prototype.propertyIsEnumerable.call(i,s)&&An(i[s],e,t)}return i}/** -* @vue/runtime-core v3.5.41 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function _l(i,e,t,s){try{return s?i(...s):i()}catch(n){Wh(n,e,t)}}function pi(i,e,t,s){if(it(i)){const n=_l(i,e,t,s);return n&&Ey(n)&&n.catch(r=>{Wh(r,e,t)}),n}if(We(i)){const n=[];for(let r=0;r>>1,n=$s[s],r=cl(n);r=cl(t)?$s.push(i):$s.splice(VM(e),0,i),i.flags|=1,tx()}}function tx(){Gc||(Gc=ex.then(ix))}function YM(i){if(!We(i))sr&&i.id===-1?sr.splice(ko+1,0,i):i.flags&1||(Ho.push(i),i.flags|=1);else for(let e=0;ecl(t)-cl(s));if(Ho.length=0,sr){for(let t=0;ti.id==null?i.flags&2?-1:1/0:i.id;function ix(i){try{for(Gi=0;Gi<$s.length;Gi++){const e=$s[Gi];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),_l(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;Gi<$s.length;Gi++){const e=$s[Gi];e&&(e.flags&=-2)}Gi=-1,$s.length=0,sx(),Gc=null,($s.length||Ho.length)&&ix()}}let Ls=null,nx=null;function jc(i){const e=Ls;return Ls=i,nx=i&&i.type.__scopeId||null,e}function qh(i,e=Ls,t){if(!e||i._n)return i;const s=(...n)=>{s._d&&qc(-1);const r=jc(e),o=Nn.length;let a;try{a=i(...n)}finally{for(let l=Nn.length;l>o;l--)rp();jc(r),s._d&&qc(1)}return a};return s._n=!0,s._c=!0,s._d=!0,s}function ce(i,e){if(Ls===null)return i;const t=tu(Ls),s=i.dirs||(i.dirs=[]);for(let n=0;n1)return t&&it(e)?e.call(s&&s.proxy):e}}function GM(){return!!(op()||io)}const jM=Symbol.for("v-scx"),HM=()=>Wo(jM);function Fo(i,e){return tp(i,null,e)}function cs(i,e,t){return tp(i,e,t)}function tp(i,e,t=Lt){const{immediate:s,deep:n,flush:r,once:o}=t,a=ps({},t),l=e&&s||!e&&r!=="post";let c;if(ml){if(r==="sync"){const f=HM();c=f.__watcherHandles||(f.__watcherHandles=[])}else if(!l){const f=()=>{};return f.stop=on,f.resume=on,f.pause=on,f}}const h=Xs;a.call=(f,p,m)=>pi(f,h,p,m);let u=!1;r==="post"?a.scheduler=f=>{Ns(f,h&&h.suspense)}:r!=="sync"&&(u=!0,a.scheduler=(f,p)=>{p?f():ep(f)}),a.augmentJob=f=>{e&&(f.flags|=4),u&&(f.flags|=2,h&&(f.id=h.uid,f.i=h))};const d=$M(i,e,a);return ml&&(c?c.push(d):l&&d()),d}function WM(i,e,t){const s=this.proxy,n=Yt(i)?i.includes(".")?ox(s,i):()=>s[i]:i.bind(s,s);let r;it(e)?r=e:(r=e.handler,t=e);const o=Al(this),a=tp(n,r.bind(s),t);return o(),a}function ox(i,e){const t=e.split(".");return()=>{let s=i;for(let n=0;ni.__isTeleport,Hr=i=>i&&(i.disabled||i.disabled===""),zM=i=>i&&(i.defer||i.defer===""),Hp=i=>typeof SVGElement<"u"&&i instanceof SVGElement,Wp=i=>typeof MathMLElement=="function"&&i instanceof MathMLElement,Sf=(i,e)=>{const t=i&&i.to;return Yt(t)?e?e(t):null:t},qM={name:"Teleport",__isTeleport:!0,process(i,e,t,s,n,r,o,a,l,c){const{mc:h,pc:u,pbc:d,o:{insert:f,querySelector:p,createText:m,createComment:g,parentNode:v}}=c,y=Hr(e.props);let{dynamicChildren:x}=e;const M=(b,_,E)=>{b.shapeFlag&16&&h(b.children,_,E,n,r,o,a,l)},C=(b=e)=>{const _=Hr(b.props),E=b.target=Sf(b.props,p),F=Mf(E,b,m,f);E&&(o!=="svg"&&Hp(E)?o="svg":o!=="mathml"&&Wp(E)&&(o="mathml"),n&&n.isCE&&(n.ce._teleportTargets||(n.ce._teleportTargets=new Set)).add(E),_||(M(b,E,F),Ba(b,!1)))},w=b=>{const _=()=>{if(Jn.get(b)===_){if(Jn.delete(b),Hr(b.props)){const E=v(b.el)||t;M(b,E,b.anchor),Ba(b,!0)}C(b)}};Jn.set(b,_),Ns(_,r)};if(i==null){const b=e.el=m(""),_=e.anchor=m("");if(f(b,t,s),f(_,t,s),zM(e.props)||r&&r.pendingBranch){w(e);return}y&&(M(e,t,_),Ba(e,!0)),C()}else{e.el=i.el;const b=e.anchor=i.anchor,_=Jn.get(i);if(_){_.flags|=8,Jn.delete(i),w(e);return}e.targetStart=i.targetStart;const E=e.target=i.target,F=e.targetAnchor=i.targetAnchor,I=Hr(i.props),k=I?t:E,B=I?b:F;if(o==="svg"||Hp(E)?o="svg":(o==="mathml"||Wp(E))&&(o="mathml"),x?(d(i.dynamicChildren,x,k,n,r,o,a),np(i,e,!0)):l||u(i,e,k,B,n,r,o,a,!1),y)I?e.props&&i.props&&e.props.to!==i.props.to&&(e.props.to=i.props.to):Yl(e,t,b,c,1);else if((e.props&&e.props.to)!==(i.props&&i.props.to)){const D=Sf(e.props,p);D&&(e.target=D,Yl(e,D,null,c,0))}else I&&Yl(e,E,F,c,1);Ba(e,y)}},remove(i,e,t,{um:s,o:{remove:n}},r){const{shapeFlag:o,children:a,anchor:l,targetStart:c,targetAnchor:h,target:u,props:d}=i,f=Hr(d),p=r||!f,m=Jn.get(i);if(m&&(m.flags|=8,Jn.delete(i)),u&&(n(c),n(h)),r&&n(l),!m&&(f||u)&&o&16)for(let g=0;g{i.isMounted=!0}),po(()=>{i.isUnmounting=!0}),i}const oi=[Function,Array],lx={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:oi,onEnter:oi,onAfterEnter:oi,onEnterCancelled:oi,onBeforeLeave:oi,onLeave:oi,onAfterLeave:oi,onLeaveCancelled:oi,onBeforeAppear:oi,onAppear:oi,onAfterAppear:oi,onAppearCancelled:oi},cx=i=>{const e=i.subTree;return e.component?cx(e.component):e},QM={name:"BaseTransition",props:lx,setup(i,{slots:e}){const t=op(),s=JM();return()=>{const n=e.default&&dx(e.default(),!0),r=n&&n.length?hx(n):t.subTree?xe():void 0;if(!r)return;const o=St(i),{mode:a}=o;if(s.isLeaving)return Eu(r);const l=Hc(r);if(!l)return Eu(r);let c=Tf(l,o,s,t,u=>c=u);l.type!==Os&&hl(l,c);let h=t.subTree&&Hc(t.subTree);if(h&&h.type!==Os&&!Wr(h,l)&&cx(t).type!==Os){let u=Tf(h,o,s,t);if(hl(h,u),a==="out-in"&&l.type!==Os)return s.isLeaving=!0,u.afterLeave=()=>{s.isLeaving=!1,t.job.flags&8||t.update(),delete u.afterLeave,h=void 0},Eu(r);a==="in-out"&&l.type!==Os?u.delayLeave=(d,f,p)=>{const m=ux(s,h);m[String(h.key)]=h,d[hi]=()=>{f(),d[hi]=void 0,delete c.delayedLeave,h=void 0},c.delayedLeave=()=>{p(),delete c.delayedLeave,h=void 0}}:h=void 0}else h&&(h=void 0);return r}}};function hx(i){let e=i[0];if(i.length>1){for(const t of i)if(t.type!==Os){e=t;break}}return e}const eT=QM;function ux(i,e){const{leavingVNodes:t}=i;let s=t.get(e.type);return s||(s=Object.create(null),t.set(e.type,s)),s}function Tf(i,e,t,s,n){const{appear:r,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:h,onEnterCancelled:u,onBeforeLeave:d,onLeave:f,onAfterLeave:p,onLeaveCancelled:m,onBeforeAppear:g,onAppear:v,onAfterAppear:y,onAppearCancelled:x}=e,M=String(i.key),C=ux(t,i),w=(E,F)=>{E&&pi(E,s,9,F)},b=(E,F)=>{const I=F[1];w(E,F),We(E)?E.every(k=>k.length<=1)&&I():E.length<=1&&I()},_={mode:o,persisted:a,beforeEnter(E){let F=l;if(!t.isMounted)if(r)F=g||l;else return;E[hi]&&E[hi](!0);const I=C[M];I&&Wr(i,I)&&I.el[hi]&&I.el[hi](),w(F,[E])},enter(E){if(C[M]===i)return;let F=c,I=h,k=u;if(!t.isMounted)if(r)F=v||c,I=y||h,k=x||u;else return;let B=!1;E[Aa]=X=>{B||(B=!0,X?w(k,[E]):w(I,[E]),_.delayedLeave&&_.delayedLeave(),E[Aa]=void 0)};const D=E[Aa].bind(null,!1);F?b(F,[E,D]):D()},leave(E,F){const I=String(i.key);if(E[Aa]&&E[Aa](!0),t.isUnmounting)return F();w(d,[E]);let k=!1;E[hi]=D=>{k||(k=!0,F(),D?w(m,[E]):w(p,[E]),E[hi]=void 0,C[I]===i&&delete C[I])};const B=E[hi].bind(null,!1);C[I]=i,f?b(f,[E,B]):B()},clone(E){const F=Tf(E,e,t,s,n);return n&&n(F),F}};return _}function Eu(i){if(Zh(i))return i=wr(i),i.children=null,i}function Hc(i){if(!Zh(i))return Kh(i.type)&&i.children?hx(i.children):i;if(i.component)return i.component.subTree;const{shapeFlag:e,children:t}=i;if(t){if(e&16)return t[0];if(e&32&&it(t.default))return t.default()}}function hl(i,e){if(i.shapeFlag&6&&i.component){i.transition=e;const t=i.component.subTree;hl(Kh(t.type)&&Hc(t)||t,e)}else i.shapeFlag&128?(i.ssContent.transition=e.clone(i.ssContent),i.ssFallback.transition=e.clone(i.ssFallback)):i.transition=e}function dx(i,e=!1,t){let s=[],n=0;for(let r=0;r1)for(let r=0;rKa(m,e&&(We(e)?e[g]:e),t,s,n));return}if(zo(s)&&!n){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Ka(i,e,t,s.component.subTree);return}const r=s.shapeFlag&4?tu(s.component):s.el,o=n?null:r,{i:a,r:l}=i,c=e&&e.r,h=a.refs===Lt?a.refs={}:a.refs,u=a.setupState,d=St(u),f=u===Lt?Ay:m=>zp(h,m)?!1:Pt(d,m),p=(m,g)=>!(g&&zp(h,g));if(c!=null&&c!==l){if(qp(e),Yt(c))h[c]=null,f(c)&&(u[c]=null);else if(Gt(c)){const m=e;p(c,m.k)&&(c.value=null),m.k&&(h[m.k]=null)}}if(it(l))_l(l,a,12,[o,h]);else{const m=Yt(l),g=Gt(l);if(m||g){const v=()=>{if(i.f){const y=m?f(l)?u[l]:h[l]:p()||!i.k?l.value:h[i.k];if(n)We(y)&&Hm(y,r);else if(We(y))y.includes(r)||y.push(r);else if(m)h[l]=[r],f(l)&&(u[l]=h[l]);else{const x=[r];p(l,i.k)&&(l.value=x),i.k&&(h[i.k]=x)}}else m?(h[l]=o,f(l)&&(u[l]=o)):g&&(p(l,i.k)&&(l.value=o),i.k&&(h[i.k]=o))};if(o){const y=()=>{v(),Wc.delete(i)};y.id=-1,Wc.set(i,y),Ns(y,t)}else qp(i),v()}}}function qp(i){const e=Wc.get(i);e&&(e.flags|=8,Wc.delete(i))}Gh().requestIdleCallback;Gh().cancelIdleCallback;const zo=i=>!!i.type.__asyncLoader,Zh=i=>i.type.__isKeepAlive;function tT(i,e){mx(i,"a",e)}function sT(i,e){mx(i,"da",e)}function mx(i,e,t=Xs){const s=i.__wdc||(i.__wdc=()=>{let n=t;for(;n;){if(n.isDeactivated)return;n=n.parent}return i()});if(Jh(e,s,t),t){let n=t.parent;for(;n&&n.parent;)Zh(n.parent.vnode)&&iT(s,e,t,n),n=n.parent}}function iT(i,e,t,s){const n=Jh(e,i,s,!0);Cl(()=>{Hm(s[e],n)},t)}function Jh(i,e,t=Xs,s=!1){if(t){const n=t[i]||(t[i]=[]),r=e.__weh||(e.__weh=(...o)=>{$n();const a=Al(t),l=pi(e,t,i,o);return a(),Xn(),l});return s?n.unshift(r):n.push(r),r}}const Wn=i=>(e,t=Xs)=>{(!ml||i==="sp")&&Jh(i,(...s)=>e(...s),t)},nT=Wn("bm"),Oi=Wn("m"),rT=Wn("bu"),oT=Wn("u"),po=Wn("bum"),Cl=Wn("um"),aT=Wn("sp"),lT=Wn("rtg"),cT=Wn("rtc");function hT(i,e=Xs){Jh("ec",i,e)}const uT=Symbol.for("v-ndc");function Ft(i,e,t,s){let n;const r=t,o=We(i);if(o||Yt(i)){const a=o&&Bn(i);let l=!1,c=!1;a&&(l=!ti(i),c=Vn(i),i=jh(i)),n=new Array(i.length);for(let h=0,u=i.length;he(a,l,void 0,r));else{const a=Object.keys(i);n=new Array(a.length);for(let l=0,c=a.length;l0;return z(),At(Ce,null,[be("slot",c,s)],h?-2:64)}let o=i[e];o&&o._c&&(o._d=!1);const a=Nn.length;z();let l;try{const c=o&&px(o(t)),h=t.key||r||c&&c.key;l=At(Ce,{key:(h&&!si(h)?h:`_${e}`)+(!c&&s?"_fb":"")},c||(s?s():[]),c&&i._===1?64:-2)}catch(c){for(let h=Nn.length;h>a;h--)rp();throw c}finally{o&&o._c&&(o._d=!0)}return l}function px(i){return i.some(e=>dl(e)?!(e.type===Os||e.type===Ce&&!px(e.children)):!0)?i:null}const _f=i=>i?Ox(i)?tu(i):_f(i.parent):null,Za=ps(Object.create(null),{$:i=>i,$el:i=>i.vnode.el,$data:i=>i.data,$props:i=>i.props,$attrs:i=>i.attrs,$slots:i=>i.slots,$refs:i=>i.refs,$parent:i=>_f(i.parent),$root:i=>_f(i.root),$host:i=>i.ce,$emit:i=>i.emit,$options:i=>vx(i),$forceUpdate:i=>i.f||(i.f=()=>{ep(i.update)}),$nextTick:i=>i.n||(i.n=zh.bind(i.proxy)),$watch:i=>WM.bind(i)}),Iu=(i,e)=>i!==Lt&&!i.__isScriptSetup&&Pt(i,e),fT={get({_:i},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:s,data:n,props:r,accessCache:o,type:a,appContext:l}=i;if(e[0]!=="$"){const d=o[e];if(d!==void 0)switch(d){case 1:return s[e];case 2:return n[e];case 4:return t[e];case 3:return r[e]}else{if(Iu(s,e))return o[e]=1,s[e];if(n!==Lt&&Pt(n,e))return o[e]=2,n[e];if(Pt(r,e))return o[e]=3,r[e];if(t!==Lt&&Pt(t,e))return o[e]=4,t[e];Cf&&(o[e]=0)}}const c=Za[e];let h,u;if(c)return e==="$attrs"&&ks(i.attrs,"get",""),c(i);if((h=a.__cssModules)&&(h=h[e]))return h;if(t!==Lt&&Pt(t,e))return o[e]=4,t[e];if(u=l.config.globalProperties,Pt(u,e))return u[e]},set({_:i},e,t){const{data:s,setupState:n,ctx:r}=i;return Iu(n,e)?(n[e]=t,!0):s!==Lt&&Pt(s,e)?(s[e]=t,!0):Pt(i.props,e)||e[0]==="$"&&e.slice(1)in i?!1:(r[e]=t,!0)},has({_:{data:i,setupState:e,accessCache:t,ctx:s,appContext:n,props:r,type:o}},a){let l;return!!(t[a]||i!==Lt&&a[0]!=="$"&&Pt(i,a)||Iu(e,a)||Pt(r,a)||Pt(s,a)||Pt(Za,a)||Pt(n.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(i,e,t){return t.get!=null?i._.accessCache[e]=0:Pt(t,"value")&&this.set(i,e,t.value,null),Reflect.defineProperty(i,e,t)}};function Kp(i){return We(i)?i.reduce((e,t)=>(e[t]=null,e),{}):i}let Cf=!0;function mT(i){const e=vx(i),t=i.proxy,s=i.ctx;Cf=!1,e.beforeCreate&&Zp(e.beforeCreate,i,"bc");const{data:n,computed:r,methods:o,watch:a,provide:l,inject:c,created:h,beforeMount:u,mounted:d,beforeUpdate:f,updated:p,activated:m,deactivated:g,beforeDestroy:v,beforeUnmount:y,destroyed:x,unmounted:M,render:C,renderTracked:w,renderTriggered:b,errorCaptured:_,serverPrefetch:E,expose:F,inheritAttrs:I,components:k,directives:B,filters:D}=e;if(c&&pT(c,s,null),o)for(const U in o){const A=o[U];it(A)&&(s[U]=A.bind(t))}if(n){const U=n.call(t,t);kt(U)&&(i.data=mo(U))}if(Cf=!0,r)for(const U in r){const A=r[U],P=it(A)?A.bind(t,t):it(A.get)?A.get.bind(t,t):on,O=!it(A)&&it(A.set)?A.set.bind(t):on,L=De({get:P,set:O});Object.defineProperty(s,U,{enumerable:!0,configurable:!0,get:()=>L.value,set:$=>L.value=$})}if(a)for(const U in a)gx(a[U],s,t,U);if(l){const U=it(l)?l.call(t):l;Reflect.ownKeys(U).forEach(A=>{rx(A,U[A])})}h&&Zp(h,i,"c");function N(U,A){We(A)?A.forEach(P=>U(P.bind(t))):A&&U(A.bind(t))}if(N(nT,u),N(Oi,d),N(rT,f),N(oT,p),N(tT,m),N(sT,g),N(hT,_),N(cT,w),N(lT,b),N(po,y),N(Cl,M),N(aT,E),We(F))if(F.length){const U=i.exposed||(i.exposed={});F.forEach(A=>{Object.defineProperty(U,A,{get:()=>t[A],set:P=>t[A]=P,enumerable:!0})})}else i.exposed||(i.exposed={});C&&i.render===on&&(i.render=C),I!=null&&(i.inheritAttrs=I),k&&(i.components=k),B&&(i.directives=B),E&&fx(i)}function pT(i,e,t=on){We(i)&&(i=Af(i));for(const s in i){const n=i[s];let r;kt(n)?"default"in n?r=Wo(n.from||s,n.default,!0):r=Wo(n.from||s):r=Wo(n),Gt(r)?Object.defineProperty(e,s,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[s]=r}}function Zp(i,e,t){pi(We(i)?i.map(s=>s.bind(e.proxy)):i.bind(e.proxy),e,t)}function gx(i,e,t,s){let n=s.includes(".")?ox(t,s):()=>t[s];if(Yt(i)){const r=e[i];it(r)&&cs(n,r)}else if(it(i))cs(n,i.bind(t));else if(kt(i))if(We(i))i.forEach(r=>gx(r,e,t,s));else{const r=it(i.handler)?i.handler.bind(t):e[i.handler];it(r)&&cs(n,r,i)}}function vx(i){const e=i.type,{mixins:t,extends:s}=e,{mixins:n,optionsCache:r,config:{optionMergeStrategies:o}}=i.appContext,a=r.get(e);let l;return a?l=a:!n.length&&!t&&!s?l=e:(l={},n.length&&n.forEach(c=>zc(l,c,o,!0)),zc(l,e,o)),kt(e)&&r.set(e,l),l}function zc(i,e,t,s=!1){const{mixins:n,extends:r}=e;r&&zc(i,r,t,!0),n&&n.forEach(o=>zc(i,o,t,!0));for(const o in e)if(!(s&&o==="expose")){const a=gT[o]||t&&t[o];i[o]=a?a(i[o],e[o]):e[o]}return i}const gT={data:Jp,props:Qp,emits:Qp,methods:Na,computed:Na,beforeCreate:Bs,created:Bs,beforeMount:Bs,mounted:Bs,beforeUpdate:Bs,updated:Bs,beforeDestroy:Bs,beforeUnmount:Bs,destroyed:Bs,unmounted:Bs,activated:Bs,deactivated:Bs,errorCaptured:Bs,serverPrefetch:Bs,components:Na,directives:Na,watch:yT,provide:Jp,inject:vT};function Jp(i,e){return e?i?function(){return ps(it(i)?i.call(this,this):i,it(e)?e.call(this,this):e)}:e:i}function vT(i,e){return Na(Af(i),Af(e))}function Af(i){if(We(i)){const e={};for(let t=0;te==="modelValue"||e==="model-value"?i.modelModifiers:i[`${e}Modifiers`]||i[`${Ai(e)}Modifiers`]||i[`${Tr(e)}Modifiers`];function ST(i,e,...t){if(i.isUnmounted)return;const s=i.vnode.props||Lt;let n=t;const r=e.startsWith("update:"),o=r&&wT(s,e.slice(7));o&&(o.trim&&(n=t.map(h=>Yt(h)?h.trim():h)),o.number&&(n=t.map(Yh)));let a,l=s[a=Mu(e)]||s[a=Mu(Ai(e))];!l&&r&&(l=s[a=Mu(Tr(e))]),l&&pi(l,i,6,n);const c=s[a+"Once"];if(c){if(!i.emitted)i.emitted={};else if(i.emitted[a])return;i.emitted[a]=!0,pi(c,i,6,n)}}const MT=new WeakMap;function xx(i,e,t=!1){const s=t?MT:e.emitsCache,n=s.get(i);if(n!==void 0)return n;const r=i.emits;let o={},a=!1;if(!it(i)){const l=c=>{const h=xx(c,e,!0);h&&(a=!0,ps(o,h))};!t&&e.mixins.length&&e.mixins.forEach(l),i.extends&&l(i.extends),i.mixins&&i.mixins.forEach(l)}return!r&&!a?(kt(i)&&s.set(i,null),null):(We(r)?r.forEach(l=>o[l]=null):ps(o,r),kt(i)&&s.set(i,o),o)}function Qh(i,e){return!i||!Uh(e)?!1:(e=e.slice(2),e=e==="Once"?e:e.replace(/Once$/,""),Pt(i,e[0].toLowerCase()+e.slice(1))||Pt(i,Tr(e))||Pt(i,e))}function eg(i){const{type:e,vnode:t,proxy:s,withProxy:n,propsOptions:[r],slots:o,attrs:a,emit:l,render:c,renderCache:h,props:u,data:d,setupState:f,ctx:p,inheritAttrs:m}=i,g=jc(i);let v,y;try{if(t.shapeFlag&4){const M=n||s,C=M;v=Ki(c.call(C,M,h,u,f,d,p)),y=a}else{const M=e;v=Ki(M.length>1?M(u,{attrs:a,slots:o,emit:l}):M(u,null)),y=e.props?a:TT(a)}}catch(M){Nn.length=0,Wh(M,i,1),v=be(Os)}let x=v;if(y&&m!==!1){const M=Object.keys(y),{shapeFlag:C}=x;M.length&&C&7&&(r&&M.some($h)&&(y=_T(y,r)),x=wr(x,y,!1,!0))}if(t.dirs&&(x=wr(x,null,!1,!0),x.dirs=x.dirs?x.dirs.concat(t.dirs):t.dirs),t.transition){const M=Kh(x.type)&&Hc(x)||x;hl(M,t.transition)}return v=x,jc(g),v}const TT=i=>{let e;for(const t in i)(t==="class"||t==="style"||Uh(t))&&((e||(e={}))[t]=i[t]);return e},_T=(i,e)=>{const t={};for(const s in i)(!$h(s)||!(s.slice(9)in e))&&(t[s]=i[s]);return t};function CT(i,e,t){const{props:s,children:n,component:r}=i,{props:o,children:a,patchFlag:l}=e,c=r.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&l>=0){if(l&1024)return!0;if(l&16)return s?tg(s,o,c):!!o;if(l&8){const h=e.dynamicProps;for(let u=0;uObject.create(wx),Mx=i=>Object.getPrototypeOf(i)===wx;function ET(i,e,t,s=!1){const n={},r=Sx();i.propsDefaults=Object.create(null),Tx(i,e,n,r);for(const o in i.propsOptions[0])o in n||(n[o]=void 0);t?i.props=s?n:RM(n):i.type.props?i.props=n:i.props=r,i.attrs=r}function IT(i,e,t,s){const{props:n,attrs:r,vnode:{patchFlag:o}}=i,a=St(n),[l]=i.propsOptions;let c=!1;if((s||o>0)&&!(o&16)){if(o&8){const h=i.vnode.dynamicProps;for(let u=0;u{l=!0;const[d,f]=_x(u,e,!0);ps(o,d),f&&a.push(...f)};!t&&e.mixins.length&&e.mixins.forEach(h),i.extends&&h(i.extends),i.mixins&&i.mixins.forEach(h)}if(!r&&!l)return kt(i)&&s.set(i,Go),Go;if(We(r))for(let h=0;hi==="_"||i==="_ctx"||i==="$stable",ip=i=>We(i)?i.map(Ki):[Ki(i)],PT=(i,e,t)=>{if(e._n)return e;const s=qh((...n)=>ip(e(...n)),t);return s._c=!1,s},Cx=(i,e,t)=>{const s=i._ctx;for(const n in i){if(sp(n))continue;const r=i[n];if(it(r))e[n]=PT(n,r,s);else if(r!=null){const o=ip(r);e[n]=()=>o}}},Ax=(i,e)=>{const t=ip(e);i.slots.default=()=>t},Ex=(i,e,t)=>{for(const s in e)(t||!sp(s))&&(i[s]=e[s])},kT=(i,e,t)=>{const s=i.slots=Sx();if(i.vnode.shapeFlag&32){const n=e._;n?(Ex(s,e,t),t&&ky(s,"_",n,!0)):Cx(e,s)}else e&&Ax(i,e)},FT=(i,e,t)=>{const{vnode:s,slots:n}=i;let r=!0,o=Lt;if(s.shapeFlag&32){const a=e._;a?t&&a===1?r=!1:Ex(n,e,t):(r=!e.$stable,Cx(e,n)),o=e}else e&&(Ax(i,e),o={default:1});if(r)for(const a in n)!sp(a)&&o[a]==null&&delete n[a]},Ns=DT;function OT(i){return LT(i)}function LT(i,e){const t=Gh();t.__VUE__=!0;const{insert:s,remove:n,patchProp:r,createElement:o,createText:a,createComment:l,setText:c,setElementText:h,parentNode:u,nextSibling:d,setScopeId:f=on,insertStaticContent:p}=i,m=(Y,W,H,G=null,q=null,se=null,ue=void 0,ne=null,de=!!W.dynamicChildren)=>{if(Y===W)return;Y&&!Wr(Y,W)&&(G=re(Y),$(Y,q,se,!0),Y=null),W.patchFlag===-2&&(de=!1,W.dynamicChildren=null);const{type:le,ref:Re,shapeFlag:we}=W;switch(le){case eu:g(Y,W,H,G);break;case Os:v(Y,W,H,G);break;case _c:Y==null&&y(W,H,G,ue);break;case Ce:k(Y,W,H,G,q,se,ue,ne,de);break;default:we&1?C(Y,W,H,G,q,se,ue,ne,de):we&6?B(Y,W,H,G,q,se,ue,ne,de):(we&64||we&128)&&le.process(Y,W,H,G,q,se,ue,ne,de,he)}Re!=null&&q?Ka(Re,Y&&Y.ref,se,W||Y,!W):Re==null&&Y&&Y.ref!=null&&Ka(Y.ref,null,se,Y,!0)},g=(Y,W,H,G)=>{if(Y==null)s(W.el=a(W.children),H,G);else{const q=W.el=Y.el;W.children!==Y.children&&c(q,W.children)}},v=(Y,W,H,G)=>{Y==null?s(W.el=l(W.children||""),H,G):W.el=Y.el},y=(Y,W,H,G)=>{[Y.el,Y.anchor]=p(Y.children,W,H,G,Y.el,Y.anchor)},x=({el:Y,anchor:W},H,G)=>{let q;for(;Y&&Y!==W;)q=d(Y),s(Y,H,G),Y=q;s(W,H,G)},M=({el:Y,anchor:W})=>{let H;for(;Y&&Y!==W;)H=d(Y),n(Y),Y=H;n(W)},C=(Y,W,H,G,q,se,ue,ne,de)=>{if(W.type==="svg"?ue="svg":W.type==="math"&&(ue="mathml"),Y==null)w(W,H,G,q,se,ue,ne,de);else{const le=Y.el&&Y.el._isVueCE?Y.el:null;try{le&&le._beginPatch(),E(Y,W,q,se,ue,ne,de)}finally{le&&le._endPatch()}}},w=(Y,W,H,G,q,se,ue,ne)=>{let de,le;const{props:Re,shapeFlag:we,transition:me,dirs:Ue}=Y;if(de=Y.el=o(Y.type,se,Re&&Re.is,Re),we&8?h(de,Y.children):we&16&&_(Y.children,de,null,G,q,Ru(Y,se),ue,ne),Ue&&Pr(Y,null,G,"created"),b(de,Y,Y.scopeId,ue,G),Re){for(const qe in Re)qe!=="value"&&!Wa(qe)&&r(de,qe,null,Re[qe],se,G);"value"in Re&&r(de,"value",null,Re.value,se),(le=Re.onVnodeBeforeMount)&&Di(le,G,Y)}Ue&&Pr(Y,null,G,"beforeMount");const Je=BT(q,me);Je&&me.beforeEnter(de),s(de,W,H),((le=Re&&Re.onVnodeMounted)||Je||Ue)&&Ns(()=>{try{le&&Di(le,G,Y),Je&&me.enter(de),Ue&&Pr(Y,null,G,"mounted")}finally{}},q)},b=(Y,W,H,G,q)=>{if(H&&f(Y,H),G)for(let se=0;se{for(let le=de;le{const ne=W.el=Y.el;let{patchFlag:de,dynamicChildren:le,dirs:Re}=W;de|=Y.patchFlag&16;const we=Y.props||Lt,me=W.props||Lt;let Ue;if(H&&kr(H,!1),(Ue=me.onVnodeBeforeUpdate)&&Di(Ue,H,W,Y),Re&&Pr(W,Y,H,"beforeUpdate"),H&&kr(H,!0),le&&(!Y.dynamicChildren||Y.dynamicChildren.length!==le.length)&&(de=0,ue=!1,le=null),(we.innerHTML&&me.innerHTML==null||we.textContent&&me.textContent==null)&&h(ne,""),le?F(Y.dynamicChildren,le,ne,H,G,Ru(W,q),se):ue||A(Y,W,ne,null,H,G,Ru(W,q),se,!1),de>0){if(de&16)I(ne,we,me,H,q);else if(de&2&&we.class!==me.class&&r(ne,"class",null,me.class,q),de&4&&r(ne,"style",we.style,me.style,q),de&8){const Je=W.dynamicProps;for(let qe=0;qe{Ue&&Di(Ue,H,W,Y),Re&&Pr(W,Y,H,"updated")},G)},F=(Y,W,H,G,q,se,ue)=>{for(let ne=0;ne{if(W!==H){if(W!==Lt)for(const se in W)!Wa(se)&&!(se in H)&&r(Y,se,W[se],null,q,G);for(const se in H){if(Wa(se))continue;const ue=H[se],ne=W[se];ue!==ne&&se!=="value"&&r(Y,se,ne,ue,q,G)}"value"in H&&r(Y,"value",W.value,H.value,q)}},k=(Y,W,H,G,q,se,ue,ne,de)=>{const le=W.el=Y?Y.el:a(""),Re=W.anchor=Y?Y.anchor:a("");let{patchFlag:we,dynamicChildren:me,slotScopeIds:Ue}=W;Ue&&(ne=ne?ne.concat(Ue):Ue),Y==null?(s(le,H,G),s(Re,H,G),_(W.children||[],H,Re,q,se,ue,ne,de)):we>0&&we&64&&me&&Y.dynamicChildren&&Y.dynamicChildren.length===me.length?(F(Y.dynamicChildren,me,H,q,se,ue,ne),(W.key!=null||q&&W===q.subTree)&&np(Y,W,!0)):A(Y,W,H,Re,q,se,ue,ne,de)},B=(Y,W,H,G,q,se,ue,ne,de)=>{W.slotScopeIds=ne,Y==null?W.shapeFlag&512?q.ctx.activate(W,H,G,ue,de):D(W,H,G,q,se,ue,de):X(Y,W,de)},D=(Y,W,H,G,q,se,ue)=>{const ne=Y.component=GT(Y,G,q);if(Zh(Y)&&(ne.ctx.renderer=he),jT(ne,!1,ue),ne.asyncDep){if(q&&q.registerDep(ne,N,ue),!Y.el){const de=ne.subTree=be(Os);v(null,de,W,H),Y.placeholder=de.el}}else N(ne,Y,W,H,q,se,ue)},X=(Y,W,H)=>{const G=W.component=Y.component;if(CT(Y,W,H))if(G.asyncDep&&!G.asyncResolved){U(G,W,H);return}else G.next=W,G.update();else W.el=Y.el,G.vnode=W},N=(Y,W,H,G,q,se,ue)=>{const ne=()=>{if(Y.isMounted){let{next:we,bu:me,u:Ue,parent:Je,vnode:qe}=Y;{const Te=Ix(Y);if(Te){we&&(we.el=qe.el,U(Y,we,ue)),Te.asyncDep.then(()=>{Ns(()=>{Y.isUnmounted||le()},q)});return}}let Ze=we,Be;kr(Y,!1),we?(we.el=qe.el,U(Y,we,ue)):we=qe,me&&Tc(me),(Be=we.props&&we.props.onVnodeBeforeUpdate)&&Di(Be,Je,we,qe),kr(Y,!0);const Me=eg(Y),nt=Y.subTree;Y.subTree=Me,m(nt,Me,u(nt.el),re(nt),Y,q,se),we.el=Me.el,Ze===null&&AT(Y,Me.el),Ue&&Ns(Ue,q),(Be=we.props&&we.props.onVnodeUpdated)&&Ns(()=>Di(Be,Je,we,qe),q)}else{let we;const{el:me,props:Ue}=W,{bm:Je,m:qe,parent:Ze,root:Be,type:Me}=Y,nt=zo(W);kr(Y,!1),Je&&Tc(Je),!nt&&(we=Ue&&Ue.onVnodeBeforeMount)&&Di(we,Ze,W),kr(Y,!0);{Be.ce&&Be.ce._hasShadowRoot()&&Be.ce._injectChildStyle(Me,Y.parent?Y.parent.type:void 0);const Te=Y.subTree=eg(Y);m(null,Te,H,G,Y,q,se),W.el=Te.el}if(qe&&Ns(qe,q),!nt&&(we=Ue&&Ue.onVnodeMounted)){const Te=W;Ns(()=>Di(we,Ze,Te),q)}(W.shapeFlag&256||Ze&&zo(Ze.vnode)&&Ze.vnode.shapeFlag&256)&&Y.a&&Ns(Y.a,q),Y.isMounted=!0,W=H=G=null}};Y.scope.on();const de=Y.effect=new Uy(ne);Y.scope.off();const le=Y.update=de.run.bind(de),Re=Y.job=de.runIfDirty.bind(de);Re.i=Y,Re.id=Y.uid,de.scheduler=()=>ep(Re),kr(Y,!0),le()},U=(Y,W,H)=>{W.component=Y;const G=Y.vnode.props;Y.vnode=W,Y.next=null,IT(Y,W.props,G,H),FT(Y,W.children,H),$n(),jp(Y),Xn()},A=(Y,W,H,G,q,se,ue,ne,de=!1)=>{const le=Y&&Y.children,Re=Y?Y.shapeFlag:0,we=W.children,{patchFlag:me,shapeFlag:Ue}=W;if(me>0){if(me&128){O(le,we,H,G,q,se,ue,ne,de);return}else if(me&256){P(le,we,H,G,q,se,ue,ne,de);return}}Ue&8?(Re&16&&ie(le,q,se),we!==le&&h(H,we)):Re&16?Ue&16?O(le,we,H,G,q,se,ue,ne,de):ie(le,q,se,!0):(Re&8&&h(H,""),Ue&16&&_(we,H,G,q,se,ue,ne,de))},P=(Y,W,H,G,q,se,ue,ne,de)=>{Y=Y||Go,W=W||Go;const le=Y.length,Re=W.length,we=Math.min(le,Re);let me;for(me=0;meRe?ie(Y,q,se,!0,!1,we):_(W,H,G,q,se,ue,ne,de,we)},O=(Y,W,H,G,q,se,ue,ne,de)=>{let le=0;const Re=W.length;let we=Y.length-1,me=Re-1;for(;le<=we&&le<=me;){const Ue=Y[le],Je=W[le]=de?_n(W[le]):Ki(W[le]);if(Wr(Ue,Je))m(Ue,Je,H,null,q,se,ue,ne,de);else break;le++}for(;le<=we&&le<=me;){const Ue=Y[we],Je=W[me]=de?_n(W[me]):Ki(W[me]);if(Wr(Ue,Je))m(Ue,Je,H,null,q,se,ue,ne,de);else break;we--,me--}if(le>we){if(le<=me){const Ue=me+1,Je=Ueme)for(;le<=we;)$(Y[le],q,se,!0),le++;else{const Ue=le,Je=le,qe=new Map;for(le=Je;le<=me;le++){const xt=W[le]=de?_n(W[le]):Ki(W[le]);xt.key!=null&&qe.set(xt.key,le)}let Ze,Be=0;const Me=me-Je+1;let nt=!1,Te=0;const vs=new Array(Me);for(le=0;le=Me){$(xt,q,se,!0);continue}let te;if(xt.key!=null)te=qe.get(xt.key);else for(Ze=Je;Ze<=me;Ze++)if(vs[Ze-Je]===0&&Wr(xt,W[Ze])){te=Ze;break}te===void 0?$(xt,q,se,!0):(vs[te-Je]=le+1,te>=Te?Te=te:nt=!0,m(xt,W[te],H,null,q,se,ue,ne,de),Be++)}const Ct=nt?NT(vs):Go;for(Ze=Ct.length-1,le=Me-1;le>=0;le--){const xt=Je+le,te=W[xt],oe=W[xt+1],lt=xt+1{const{el:se,type:ue,transition:ne,children:de,shapeFlag:le}=Y;if(le&6){L(Y.component.subTree,W,H,G);return}if(le&128){Y.suspense.move(W,H,G);return}if(le&64){ue.move(Y,W,H,he);return}if(ue===Ce){s(se,W,H);for(let we=0;wene.enter(se),q));else{const{leave:we,delayLeave:me,afterLeave:Ue}=ne,Je=()=>{Y.ctx.isUnmounted?n(se):s(se,W,H)},qe=()=>{const Ze=se._isLeaving||!!se[hi];se._isLeaving&&se[hi](!0),ne.persisted&&!Ze?Je():we(se,()=>{Je(),Ue&&Ue()})};me?me(se,Je,qe):qe()}else s(se,W,H)},$=(Y,W,H,G=!1,q=!1)=>{const{type:se,props:ue,ref:ne,children:de,dynamicChildren:le,shapeFlag:Re,patchFlag:we,dirs:me,cacheIndex:Ue,memo:Je}=Y;if(we===-2&&(q=!1),ne!=null&&($n(),Ka(ne,null,H,Y,!0),Xn()),Ue!=null&&(W.renderCache[Ue]=void 0),Re&256){W.ctx.deactivate(Y);return}const qe=Re&1&&me,Ze=!zo(Y);let Be;if(Ze&&(Be=ue&&ue.onVnodeBeforeUnmount)&&Di(Be,W,Y),Re&6)K(Y.component,H,G);else{if(Re&128){Y.suspense.unmount(H,G);return}qe&&Pr(Y,null,W,"beforeUnmount"),Re&64?Y.type.remove(Y,W,H,he,G):le&&!le.hasOnce&&(se!==Ce||we>0&&we&64)?ie(le,W,H,!1,!0):(se===Ce&&we&384||!q&&Re&16)&&ie(de,W,H),G&&V(Y)}const Me=Je!=null&&Ue==null;(Ze&&(Be=ue&&ue.onVnodeUnmounted)||qe||Me)&&Ns(()=>{Be&&Di(Be,W,Y),qe&&Pr(Y,null,W,"unmounted"),Me&&(Y.el=null)},H)},V=Y=>{const{type:W,el:H,anchor:G,transition:q}=Y;if(W===Ce){j(H,G);return}if(W===_c){M(Y);return}const se=()=>{n(H),q&&!q.persisted&&q.afterLeave&&q.afterLeave()};if(Y.shapeFlag&1&&q&&!q.persisted){const{leave:ue,delayLeave:ne}=q,de=()=>ue(H,se);ne?ne(Y.el,se,de):de()}else se()},j=(Y,W)=>{let H;for(;Y!==W;)H=d(Y),n(Y),Y=H;n(W)},K=(Y,W,H)=>{const{bum:G,scope:q,job:se,subTree:ue,um:ne,m:de,a:le}=Y;ig(de),ig(le),G&&Tc(G),q.stop(),se&&(se.flags|=8,$(ue,Y,W,H)),ne&&Ns(ne,W),Ns(()=>{Y.isUnmounted=!0},W)},ie=(Y,W,H,G=!1,q=!1,se=0)=>{for(let ue=se;ue{if(Y.shapeFlag&6)return re(Y.component.subTree);if(Y.shapeFlag&128)return Y.suspense.next();const W=d(Y.anchor||Y.el),H=W&&W[ax];return H?d(H):W};let pe=!1;const ge=(Y,W,H)=>{let G;Y==null?W._vnode&&($(W._vnode,null,null,!0),G=W._vnode.component):m(W._vnode||null,Y,W,null,null,null,H),W._vnode=Y,pe||(pe=!0,jp(G),sx(),pe=!1)},he={p:m,um:$,m:L,r:V,mt:D,mc:_,pc:A,pbc:F,n:re,o:i};return{render:ge,hydrate:void 0,createApp:bT(ge)}}function Ru({type:i,props:e},t){return t==="svg"&&i==="foreignObject"||t==="mathml"&&i==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function kr({effect:i,job:e},t){t?(i.flags|=32,e.flags|=4):(i.flags&=-33,e.flags&=-5)}function BT(i,e){return(!i||i&&!i.pendingBranch)&&e&&!e.persisted}function np(i,e,t=!1){const s=i.children,n=e.children;if(We(s)&&We(n))for(let r=0;r>1,i[t[a]]0&&(e[s]=t[r-1]),t[r]=s)}}for(r=t.length,o=t[r-1];r-- >0;)t[r]=o,o=e[o];return t}function Ix(i){const e=i.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:Ix(e)}function ig(i){if(i)for(let e=0;ei.__isSuspense;function DT(i,e){e&&e.pendingBranch?We(i)?e.effects.push(...i):e.effects.push(i):YM(i)}const Ce=Symbol.for("v-fgt"),eu=Symbol.for("v-txt"),Os=Symbol.for("v-cmt"),_c=Symbol.for("v-stc"),Nn=[];let ei=null;function z(i=!1){Nn.push(ei=i?null:[])}function rp(){Nn.pop(),ei=Nn[Nn.length-1]||null}let ul=1;function qc(i,e=!1){ul+=i,i<0&&ei&&e&&(ei.hasOnce=!0)}function kx(i){return i.dynamicChildren=ul>0?ei||Go:null,rp(),ul>0&&ei&&ei.push(i),i}function J(i,e,t,s,n,r){return kx(T(i,e,t,s,n,r,!0))}function At(i,e,t,s,n){return kx(be(i,e,t,s,n,!0))}function dl(i){return i?i.__v_isVNode===!0:!1}function Wr(i,e){return i.type===e.type&&i.key===e.key}const Fx=({key:i})=>i??null,Cc=({ref:i,ref_key:e,ref_for:t})=>(typeof i=="number"&&(i=""+i),i!=null?Yt(i)||Gt(i)||it(i)?{i:Ls,r:i,k:e,f:!!t}:i:null);function T(i,e=null,t=null,s=0,n=null,r=i===Ce?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:i,props:e,key:e&&Fx(e),ref:e&&Cc(e),scopeId:nx,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:s,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:Ls};return a?(Kc(l,t),r&128&&i.normalize(l)):t&&(l.shapeFlag|=Yt(t)?8:16),ul>0&&!o&&ei&&(l.patchFlag>0||r&6)&&l.patchFlag!==32&&ei.push(l),l}const be=UT;function UT(i,e=null,t=null,s=0,n=null,r=!1){if((!i||i===uT)&&(i=Os),dl(i)){const a=wr(i,e,!0);return t&&Kc(a,t),ul>0&&!r&&ei&&(a.shapeFlag&6?ei[ei.indexOf(i)]=a:ei.push(a)),a.patchFlag=-2,a}if(qT(i)&&(i=i.__vccOpts),e){e=$T(e);let{class:a,style:l}=e;a&&!Yt(a)&&(e.class=Ae(a)),kt(l)&&(Hh(l)&&!We(l)&&(l=ps({},l)),e.style=Vt(l))}const o=Yt(i)?1:Px(i)?128:Kh(i)?64:kt(i)?4:it(i)?2:0;return T(i,e,t,s,n,o,r,!0)}function $T(i){return i?Hh(i)||Mx(i)?ps({},i):i:null}function wr(i,e,t=!1,s=!1){const{props:n,ref:r,patchFlag:o,children:a,transition:l}=i,c=e?XT(n||{},e):n,h={__v_isVNode:!0,__v_skip:!0,type:i.type,props:c,key:c&&Fx(c),ref:e&&e.ref?t&&r?We(r)?r.concat(Cc(e)):[r,Cc(e)]:Cc(e):r,scopeId:i.scopeId,slotScopeIds:i.slotScopeIds,children:a,target:i.target,targetStart:i.targetStart,targetAnchor:i.targetAnchor,staticCount:i.staticCount,shapeFlag:i.shapeFlag,patchFlag:e&&i.type!==Ce?o===-1?16:o|16:o,dynamicProps:i.dynamicProps,dynamicChildren:i.dynamicChildren,appContext:i.appContext,dirs:i.dirs,transition:l,component:i.component,suspense:i.suspense,ssContent:i.ssContent&&wr(i.ssContent),ssFallback:i.ssFallback&&wr(i.ssFallback),placeholder:i.placeholder,el:i.el,anchor:i.anchor,ctx:i.ctx,ce:i.ce};return l&&s&&hl(h,l.clone(h)),h}function gt(i=" ",e=0){return be(eu,null,i,e)}function Qs(i,e){const t=be(_c,null,i);return t.staticCount=e,t}function xe(i="",e=!1){return e?(z(),At(Os,null,i)):be(Os,null,i)}function Ki(i){return i==null||typeof i=="boolean"?be(Os):We(i)?be(Ce,null,i.slice()):dl(i)?_n(i):be(eu,null,String(i))}function _n(i){return i.el===null&&i.patchFlag!==-1||i.memo?i:wr(i)}function Kc(i,e){let t=0;const{shapeFlag:s}=i;if(e==null)e=null;else if(We(e))t=16;else if(typeof e=="object")if(s&65){const n=e.default;n&&(n._c&&(n._d=!1),Kc(i,n()),n._c&&(n._d=!0));return}else{t=32;const n=e._;!n&&!Mx(e)?e._ctx=Ls:n===3&&Ls&&(Ls.slots._===1?e._=1:(e._=2,i.patchFlag|=1024))}else if(it(e)){if(s&65){Kc(i,{default:e});return}e={default:e,_ctx:Ls},t=32}else e=String(e),s&64?(t=16,e=[gt(e)]):t=8;i.children=e,i.shapeFlag|=t}function XT(...i){const e={};for(let t=0;tXs||Ls;let Zc,fl;{const i=Gh(),e=(t,s)=>{let n;return(n=i[t])||(n=i[t]=[]),n.push(s),r=>{n.length>1?n.forEach(o=>o(r)):n[0](r)}};Zc=e("__VUE_INSTANCE_SETTERS__",t=>Xs=t),fl=e("__VUE_SSR_SETTERS__",t=>ml=t)}const Al=i=>{const e=Xs;return Zc(i),i.scope.on(),()=>{i.scope.off(),Zc(e)}},ng=()=>{Xs&&Xs.scope.off(),Zc(null)};function Ox(i){return i.vnode.shapeFlag&4}let ml=!1;function jT(i,e=!1,t=!1){e&&fl(e);const{props:s,children:n}=i.vnode,r=Ox(i);ET(i,s,r,e),kT(i,n,t||e);const o=r?HT(i,e):void 0;return e&&fl(!1),o}function HT(i,e){const t=i.type;i.accessCache=Object.create(null),i.proxy=new Proxy(i.ctx,fT);const{setup:s}=t;if(s){$n();const n=i.setupContext=s.length>1?zT(i):null,r=Al(i),o=_l(s,i,0,[i.props,n]),a=Ey(o);if(Xn(),r(),(a||i.sp)&&!zo(i)&&fx(i),a){if(o.then(ng,ng),e)return o.then(l=>{fl(!0);try{rg(i,l,e)}finally{fl(!1)}}).catch(l=>{Wh(l,i,0)});i.asyncDep=o}else rg(i,o)}else Lx(i)}function rg(i,e,t){it(e)?i.type.__ssrInlineRender?i.ssrRender=e:i.render=e:kt(e)&&(i.setupState=Qy(e)),Lx(i)}function Lx(i,e,t){const s=i.type;i.render||(i.render=s.render||on);{const n=Al(i);$n();try{mT(i)}finally{Xn(),n()}}}const WT={get(i,e){return ks(i,"get",""),i[e]}};function zT(i){const e=t=>{i.exposed=t||{}};return{attrs:new Proxy(i.attrs,WT),slots:i.slots,emit:i.emit,expose:e}}function tu(i){return i.exposed?i.exposeProxy||(i.exposeProxy=new Proxy(Qy(ur(i.exposed)),{get(e,t){if(t in e)return e[t];if(t in Za)return Za[t](i)},has(e,t){return t in e||t in Za}})):i.proxy}function qT(i){return it(i)&&"__vccOpts"in i}const De=(i,e)=>DM(i,e,ml);function KT(i,e,t){try{qc(-1);const s=arguments.length;return s===2?kt(e)&&!We(e)?dl(e)?be(i,null,[e]):be(i,e):be(i,null,e):(s>3?t=Array.prototype.slice.call(arguments,2):s===3&&dl(t)&&(t=[t]),be(i,e,t))}finally{qc(1)}}const ZT="3.5.41";/** -* @vue/runtime-dom v3.5.41 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let If;const og=typeof window<"u"&&window.trustedTypes;if(og)try{If=og.createPolicy("vue",{createHTML:i=>i})}catch{}const Bx=If?i=>If.createHTML(i):i=>i,JT="http://www.w3.org/2000/svg",QT="http://www.w3.org/1998/Math/MathML",bn=typeof document<"u"?document:null,ag=bn&&bn.createElement("template"),e_={insert:(i,e,t)=>{e.insertBefore(i,t||null)},remove:i=>{const e=i.parentNode;e&&e.removeChild(i)},createElement:(i,e,t,s)=>{const n=e==="svg"?bn.createElementNS(JT,i):e==="mathml"?bn.createElementNS(QT,i):t?bn.createElement(i,{is:t}):bn.createElement(i);return i==="select"&&s&&s.multiple!=null&&n.setAttribute("multiple",s.multiple),n},createText:i=>bn.createTextNode(i),createComment:i=>bn.createComment(i),setText:(i,e)=>{i.nodeValue=e},setElementText:(i,e)=>{i.textContent=e},parentNode:i=>i.parentNode,nextSibling:i=>i.nextSibling,querySelector:i=>bn.querySelector(i),setScopeId(i,e){i.setAttribute(e,"")},insertStaticContent(i,e,t,s,n,r){const o=t?t.previousSibling:e.lastChild;if(n&&(n===r||n.nextSibling))for(;e.insertBefore(n.cloneNode(!0),t),!(n===r||!(n=n.nextSibling)););else{ag.innerHTML=Bx(s==="svg"?`${i}`:s==="mathml"?`${i}`:i);const a=ag.content;if(s==="svg"||s==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},qn="transition",Ea="animation",pl=Symbol("_vtc"),Nx={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},t_=ps({},lx,Nx),s_=i=>(i.displayName="Transition",i.props=t_,i),i_=s_((i,{slots:e})=>KT(eT,n_(i),e)),Fr=(i,e=[])=>{We(i)?i.forEach(t=>t(...e)):i&&i(...e)},lg=i=>i?We(i)?i.some(e=>e.length>1):i.length>1:!1;function n_(i){const e={};for(const k in i)k in Nx||(e[k]=i[k]);if(i.css===!1)return e;const{name:t="v",type:s,duration:n,enterFromClass:r=`${t}-enter-from`,enterActiveClass:o=`${t}-enter-active`,enterToClass:a=`${t}-enter-to`,appearFromClass:l=r,appearActiveClass:c=o,appearToClass:h=a,leaveFromClass:u=`${t}-leave-from`,leaveActiveClass:d=`${t}-leave-active`,leaveToClass:f=`${t}-leave-to`}=i,p=r_(n),m=p&&p[0],g=p&&p[1],{onBeforeEnter:v,onEnter:y,onEnterCancelled:x,onLeave:M,onLeaveCancelled:C,onBeforeAppear:w=v,onAppear:b=y,onAppearCancelled:_=x}=e,E=(k,B,D,X)=>{k._enterCancelled=X,Or(k,B?h:a),Or(k,B?c:o),D&&D()},F=(k,B)=>{k._isLeaving=!1,Or(k,u),Or(k,f),Or(k,d),B&&B()},I=k=>(B,D)=>{const X=k?b:y,N=()=>E(B,k,D);Fr(X,[B,N]),cg(()=>{Or(B,k?l:r),gn(B,k?h:a),lg(X)||hg(B,s,m,N)})};return ps(e,{onBeforeEnter(k){Fr(v,[k]),gn(k,r),gn(k,o)},onBeforeAppear(k){Fr(w,[k]),gn(k,l),gn(k,c)},onEnter:I(!1),onAppear:I(!0),onLeave(k,B){k._isLeaving=!0;const D=()=>F(k,B);gn(k,u),k._enterCancelled?(gn(k,d),fg(k)):(fg(k),gn(k,d)),cg(()=>{k._isLeaving&&(Or(k,u),gn(k,f),lg(M)||hg(k,s,g,D))}),Fr(M,[k,D])},onEnterCancelled(k){E(k,!1,void 0,!0),Fr(x,[k])},onAppearCancelled(k){E(k,!0,void 0,!0),Fr(_,[k])},onLeaveCancelled(k){F(k),Fr(C,[k])}})}function r_(i){if(i==null)return null;if(kt(i))return[Pu(i.enter),Pu(i.leave)];{const e=Pu(i);return[e,e]}}function Pu(i){return iM(i)}function gn(i,e){e.split(/\s+/).forEach(t=>t&&i.classList.add(t)),(i[pl]||(i[pl]=new Set)).add(e)}function Or(i,e){e.split(/\s+/).forEach(s=>s&&i.classList.remove(s));const t=i[pl];t&&(t.delete(e),t.size||(i[pl]=void 0))}function cg(i){requestAnimationFrame(()=>{requestAnimationFrame(i)})}let o_=0;function hg(i,e,t,s){const n=i._endId=++o_,r=()=>{n===i._endId&&s()};if(t!=null)return setTimeout(r,t);const{type:o,timeout:a,propCount:l}=a_(i,e);if(!o)return s();const c=o+"end";let h=0;const u=()=>{i.removeEventListener(c,d),r()},d=f=>{f.target===i&&++h>=l&&u()};setTimeout(()=>{h(t[p]||"").split(", "),n=s(`${qn}Delay`),r=s(`${qn}Duration`),o=ug(n,r),a=s(`${Ea}Delay`),l=s(`${Ea}Duration`),c=ug(a,l);let h=null,u=0,d=0;e===qn?o>0&&(h=qn,u=o,d=r.length):e===Ea?c>0&&(h=Ea,u=c,d=l.length):(u=Math.max(o,c),h=u>0?o>c?qn:Ea:null,d=h?h===qn?r.length:l.length:0);const f=h===qn&&/\b(?:transform|all)(?:,|$)/.test(s(`${qn}Property`).toString());return{type:h,timeout:u,propCount:d,hasTransform:f}}function ug(i,e){for(;i.lengthdg(t)+dg(i[s])))}function dg(i){return i==="auto"?0:Number(i.slice(0,-1).replace(",","."))*1e3}function fg(i){return(i?i.ownerDocument:document).body.offsetHeight}function l_(i,e,t){const s=i[pl];s&&(e=(e?[e,...s]:[...s]).join(" ")),e==null?i.removeAttribute("class"):t?i.setAttribute("class",e):i.className=e}const Jc=Symbol("_vod"),Dx=Symbol("_vsh"),Ss={name:"show",beforeMount(i,{value:e},{transition:t}){i[Jc]=i.style.display==="none"?"":i.style.display,t&&e?t.beforeEnter(i):Ia(i,e)},mounted(i,{value:e},{transition:t}){t&&e&&t.enter(i)},updated(i,{value:e,oldValue:t},{transition:s}){!e!=!t&&(s?e?(s.beforeEnter(i),Ia(i,!0),s.enter(i)):s.leave(i,()=>{Ia(i,!1)}):Ia(i,e))},beforeUnmount(i,{value:e}){Ia(i,e)}};function Ia(i,e){i.style.display=e?i[Jc]:"none",i[Dx]=!e}const c_=Symbol(""),h_=/(?:^|;)\s*display\s*:/;function u_(i,e,t){const s=i.style,n=Yt(t);let r=!1;if(t&&!n){if(e)if(Yt(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();t[a]==null&&Da(s,a,"")}else for(const o in e)t[o]==null&&Da(s,o,"");for(const o in t){o==="display"&&(r=!0);const a=t[o];a!=null?f_(i,o,!Yt(e)&&e?e[o]:void 0,a)||Da(s,o,a):Da(s,o,"")}}else if(n){if(e!==t){const o=s[c_];o&&(t+=";"+o),s.cssText=t,r=h_.test(t)}}else e&&i.removeAttribute("style");Jc in i&&(i[Jc]=r?s.display:"",i[Dx]&&(s.display="none"))}const mg=/\s*!important$/;function Da(i,e,t){if(We(t))t.forEach(s=>Da(i,e,s));else if(t==null&&(t=""),e.startsWith("--"))i.setProperty(e,t);else{const s=d_(i,e);mg.test(t)?i.setProperty(Tr(s),t.replace(mg,""),"important"):i[s]=t}}const pg=["Webkit","Moz","ms"],ku={};function d_(i,e){const t=ku[e];if(t)return t;let s=Ai(e);if(s!=="filter"&&s in i)return ku[e]=s;s=Py(s);for(let n=0;nFu||(x_.then(()=>Fu=0),Fu=Date.now());function w_(i,e){const t=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=t.attached)return;const n=t.value;if(We(n)){const r=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{r.call(s),s._stopped=!0};const o=n.slice(),a=[s];for(let l=0;li.charCodeAt(0)===111&&i.charCodeAt(1)===110&&i.charCodeAt(2)>96&&i.charCodeAt(2)<123,S_=(i,e,t,s,n,r)=>{const o=n==="svg";e==="class"?l_(i,s,o):e==="style"?u_(i,t,s):Uh(e)?$h(e)||p_(i,e,t,s,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):M_(i,e,s,o))?(yg(i,e,s),!i.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&vg(i,e,s,o,r,e!=="value")):i._isVueCE&&(T_(i,e)||i._def.__asyncLoader&&(/[A-Z]/.test(e)||!Yt(s)))?yg(i,Ai(e),s,r,e):(e==="true-value"?i._trueValue=s:e==="false-value"&&(i._falseValue=s),vg(i,e,s,o))};function M_(i,e,t,s){if(s)return!!(e==="innerHTML"||e==="textContent"||e in i&&bg(e)&&it(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&i.tagName==="IFRAME"||e==="form"||e==="list"&&i.tagName==="INPUT"||e==="type"&&i.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const n=i.tagName;if(n==="IMG"||n==="VIDEO"||n==="CANVAS"||n==="SOURCE")return!1}return bg(e)&&Yt(t)?!1:e in i}function T_(i,e){const t=i._def.props;if(!t)return!1;const s=Ai(e);return Array.isArray(t)?t.some(n=>Ai(n)===s):Object.keys(t).some(n=>Ai(n)===s)}const oa=i=>{const e=i.props["onUpdate:modelValue"]||!1;return We(e)?t=>Tc(e,t):e};function __(i){i.target.composing=!0}function wg(i){const e=i.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const tn=Symbol("_assign"),Gl=Symbol("_initialValue");function Ou(i,e,t){return e&&(i=i.trim()),t&&(i=Yh(i)),i}const je={created(i,{modifiers:{lazy:e,trim:t,number:s}},n){i.parentNode&&(i.type==="text"?i[Gl]=i.defaultValue.replace(/[\r\n]/g,""):i.type==="textarea"&&(i[Gl]=i.defaultValue.replace(/\r\n?/g,` -`))),i[tn]=oa(n);const r=s||n.props&&n.props.type==="number";ar(i,e?"change":"input",o=>{o.target.composing||i[tn](Ou(i.value,t,r))}),(t||r)&&ar(i,"change",()=>{i.value=Ou(i.value,t,r)}),e||(ar(i,"compositionstart",__),ar(i,"compositionend",wg),ar(i,"change",wg))},mounted(i,{value:e,modifiers:{trim:t,number:s}}){const n=e??"",r=i[Gl];delete i[Gl],r!==void 0&&(i.type==="text"||i.type==="textarea")&&i.value!==r?i[tn](Ou(i.value,t,s)):i.value=n},beforeUpdate(i,{value:e,oldValue:t,modifiers:{lazy:s,trim:n,number:r}},o){if(i[tn]=oa(o),i.composing)return;const a=(r||i.type==="number")&&!/^0\d/.test(i.value)?Yh(i.value):i.value,l=e??"";if(a===l)return;const c=i.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===i&&i.type!=="range"&&(s&&e===t||n&&i.value.trim()===l)||(i.value=l)}},yt={deep:!0,created(i,e,t){i[tn]=oa(t),ar(i,"change",()=>{const s=i._modelValue,n=gl(i),r=i.checked,o=i[tn];if(We(s)){const a=Wm(s,n),l=a!==-1;if(r&&!l)o(s.concat(n));else if(!r&&l){const c=[...s];c.splice(a,1),o(c)}}else if(fa(s)){const a=new Set(s);r?a.add(n):a.delete(n),o(a)}else o(Ux(i,r))})},mounted:Sg,beforeUpdate(i,e,t){i[tn]=oa(t),Sg(i,e,t)}};function Sg(i,{value:e,oldValue:t},s){i._modelValue=e;let n;if(We(e))n=Wm(e,s.props.value)>-1;else if(fa(e))n=e.has(s.props.value);else{if(e===t)return;n=ma(e,Ux(i,!0))}i.checked!==n&&(i.checked=n)}const _t={deep:!0,created(i,{value:e,modifiers:{number:t}},s){i._modelValue=e,ar(i,"change",()=>{const n=Array.prototype.filter.call(i.options,r=>r.selected).map(r=>t?Yh(gl(r)):gl(r));i[tn](i.multiple?fa(i._modelValue)?new Set(n):n:n[0]),i._assigning=!0,zh(()=>{i._assigning=!1})}),i[tn]=oa(s)},mounted(i,{value:e}){Mg(i,e)},beforeUpdate(i,{value:e},t){i._modelValue=e,i[tn]=oa(t)},updated(i,{value:e}){i._assigning||Mg(i,e)}};function Mg(i,e){const t=i.multiple,s=We(e);if(!(t&&!s&&!fa(e))){for(let n=0,r=i.options.length;nString(c)===String(a)):o.selected=Wm(e,a)>-1}else o.selected=e.has(a);else if(ma(gl(o),e)){i.selectedIndex!==n&&(i.selectedIndex=n);return}}!t&&i.selectedIndex!==-1&&(i.selectedIndex=-1)}}function gl(i){return"_value"in i?i._value:i.value}function Ux(i,e){const t=e?"_trueValue":"_falseValue";return t in i?i[t]:e}const C_=["ctrl","shift","alt","meta"],A_={stop:i=>i.stopPropagation(),prevent:i=>i.preventDefault(),self:i=>i.target!==i.currentTarget,ctrl:i=>!i.ctrlKey,shift:i=>!i.shiftKey,alt:i=>!i.altKey,meta:i=>!i.metaKey,left:i=>"button"in i&&i.button!==0,middle:i=>"button"in i&&i.button!==1,right:i=>"button"in i&&i.button!==2,exact:(i,e)=>C_.some(t=>i[`${t}Key`]&&!e.includes(t))},Ke=(i,e)=>{if(!i)return i;const t=i._withMods||(i._withMods={}),s=e.join(".");return t[s]||(t[s]=((n,...r)=>{for(let o=0;o{const t=i._withKeys||(i._withKeys={}),s=e.join(".");return t[s]||(t[s]=(n=>{if(!("key"in n))return;const r=Tr(n.key);if(e.some(o=>o===r||E_[o]===r))return i(n)}))},I_=ps({patchProp:S_},e_);let Tg;function R_(){return Tg||(Tg=OT(I_))}const P_=((...i)=>{const e=R_().createApp(...i),{mount:t}=e;return e.mount=s=>{const n=F_(s);if(!n)return;const r=e._component;!it(r)&&!r.render&&!r.template&&(r.template=n.innerHTML),n.nodeType===1&&(n.textContent="");const o=t(n,!1,k_(n));return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),o},e});function k_(i){if(i instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&i instanceof MathMLElement)return"mathml"}function F_(i){return Yt(i)?document.querySelector(i):i}/*! - * pinia v4.0.3 - * (c) 2026 Eduardo San Martin Morote - * @license MIT - */let $x;const su=i=>$x=i,Xx=Symbol();function _g(i){return i&&typeof i=="object"&&Object.prototype.toString.call(i)==="[object Object]"&&typeof i.toJSON!="function"}function O_(){const i=Ny(!0),e=i.run(()=>Fe({}));let t=[],s=[];const n=ur({install(r){su(n),n._a=r,r.provide(Xx,n),r.config.globalProperties.$pinia=n,s.forEach(o=>t.push(o)),s=[]},use(r){return this._a?t.push(r):s.push(r),this},_p:t,_a:null,_e:i,_s:new Map,state:e});return n}const Rf=()=>{};function Cg(i,e,t,s=Rf){i.add(e);const n=()=>{i.delete(e)&&s()};return!t&&Dy()&&uM(n),n}function To(i,...e){i.forEach(t=>{t(...e)})}const L_=i=>i(),Ag=Symbol(),Lu=Symbol();function Pf(i,e){i instanceof Map&&e instanceof Map?e.forEach((t,s)=>i.set(s,t)):i instanceof Set&&e instanceof Set&&e.forEach(i.add,i);for(const t in e){if(!Object.hasOwn(e,t))continue;const s=e[t],n=i[t];_g(n)&&_g(s)&&Object.hasOwn(i,t)&&!Gt(s)&&!Bn(s)?i[t]=Pf(n,s):i[t]=s}return i}const B_=Symbol();function N_(i){return!i||typeof i!="object"||!Object.hasOwn(i,B_)}const{assign:Qn}=Object;function D_(i){return!!(Gt(i)&&i.effect)}function U_(i,e,t,s){const{state:n,actions:r,getters:o}=e,a=t.state.value[i];let l;function c(){a||(t.state.value[i]=n?n():{});const h=OM(t.state.value[i]);return Qn(h,r,Object.keys(o||{}).reduce((u,d)=>(u[d]=ur(De(()=>{su(t);const f=t._s.get(i);return o[d].call(f,f)})),u),{}))}return l=Vx(i,c,e,t,s,!0),l}function Vx(i,e,t={},s,n,r){let o;const a=Qn({actions:{}},t),l={deep:!0};let c,h,u=new Set,d=new Set,f;const p=s.state.value[i];!r&&!p&&(s.state.value[i]={});let m;function g(b){let _;c=h=!1,typeof b=="function"?(b(s.state.value[i]),_={type:"patch function",storeId:i,events:f}):(Pf(s.state.value[i],b),_={type:"patch object",payload:b,storeId:i,events:f});const E=m=Symbol();zh().then(()=>{m===E&&(c=!0)}),h=!0,To(u,_,s.state.value[i])}const v=r?function(){const{state:_}=t,E=_?_():{};this.$patch(F=>{Qn(F,E)})}:Rf;function y(){o.stop(),u.clear(),d.clear(),s._s.delete(i)}const x=(b,_="")=>{if(Ag in b)return b[Lu]=_,b;const E=function(){su(s);const F=Array.from(arguments),I=new Set,k=new Set;function B(N){I.add(N)}function D(N){k.add(N)}To(d,{args:F,name:E[Lu],store:C,after:B,onError:D});let X;try{X=b.apply(this&&this.$id===i?this:C,F)}catch(N){throw To(k,N),N}return X instanceof Promise?X.then(N=>(To(I,N),N)).catch(N=>(To(k,N),Promise.reject(N))):(To(I,X),X)};return E[Ag]=!0,E[Lu]=_,E},M={_p:s,$id:i,$onAction:Cg.bind(null,d),$patch:g,$reset:v,$subscribe(b,_={}){if(u.has(b))return Rf;const E=Cg(u,b,_.detached,()=>F()),F=o.run(()=>cs(()=>s.state.value[i],I=>{(_.flush==="sync"?h:c)&&b({storeId:i,type:"direct",events:f},I)},Qn({},l,_)));return E},$dispose:y},C=mo(M);s._s.set(i,C);const w=(s._a&&s._a.runWithContext||L_)(()=>s._e.run(()=>(o=Ny()).run(()=>e({action:x}))));for(const b in w){const _=w[b];Gt(_)&&!D_(_)||Bn(_)?r||(p&&N_(_)&&(Gt(_)?_.value=p[b]:((_ instanceof Set||_ instanceof Map)&&_.clear(),Pf(_,p[b]))),s.state.value[i][b]=_):typeof _=="function"&&(w[b]=x(_,b),a.actions[b]=_)}return Qn(C,w),Qn(St(C),w),Object.defineProperty(C,"$state",{get:()=>s.state.value[i],set:b=>{g(_=>{Qn(_,b)})}}),s._p.forEach(b=>{const _=o.run(()=>b({store:C,app:s._a,pinia:s,options:a}));Qn(C,_)}),p&&r&&t.hydrate&&t.hydrate(C.$state,p),c=!0,h=!0,C}/*! #__NO_SIDE_EFFECTS__ */function $_(i,e,t){let s;const n=typeof e=="function";s=n?t:e;function r(o,a){const l=GM();return o=o||(l?Wo(Xx,null):null),o&&su(o),o=$x,o._s.has(i)||(n?Vx(i,e,s,o):U_(i,s,o)),o._s.get(i)}return r.$id=i,r}var go=(i=>(i[i.WEBGL_LEGACY=0]="WEBGL_LEGACY",i[i.WEBGL=1]="WEBGL",i[i.WEBGL2=2]="WEBGL2",i))(go||{}),Yx=(i=>(i[i.UNKNOWN=0]="UNKNOWN",i[i.WEBGL=1]="WEBGL",i[i.CANVAS=2]="CANVAS",i))(Yx||{}),kf=(i=>(i[i.COLOR=16384]="COLOR",i[i.DEPTH=256]="DEPTH",i[i.STENCIL=1024]="STENCIL",i))(kf||{}),He=(i=>(i[i.NORMAL=0]="NORMAL",i[i.ADD=1]="ADD",i[i.MULTIPLY=2]="MULTIPLY",i[i.SCREEN=3]="SCREEN",i[i.OVERLAY=4]="OVERLAY",i[i.DARKEN=5]="DARKEN",i[i.LIGHTEN=6]="LIGHTEN",i[i.COLOR_DODGE=7]="COLOR_DODGE",i[i.COLOR_BURN=8]="COLOR_BURN",i[i.HARD_LIGHT=9]="HARD_LIGHT",i[i.SOFT_LIGHT=10]="SOFT_LIGHT",i[i.DIFFERENCE=11]="DIFFERENCE",i[i.EXCLUSION=12]="EXCLUSION",i[i.HUE=13]="HUE",i[i.SATURATION=14]="SATURATION",i[i.COLOR=15]="COLOR",i[i.LUMINOSITY=16]="LUMINOSITY",i[i.NORMAL_NPM=17]="NORMAL_NPM",i[i.ADD_NPM=18]="ADD_NPM",i[i.SCREEN_NPM=19]="SCREEN_NPM",i[i.NONE=20]="NONE",i[i.SRC_OVER=0]="SRC_OVER",i[i.SRC_IN=21]="SRC_IN",i[i.SRC_OUT=22]="SRC_OUT",i[i.SRC_ATOP=23]="SRC_ATOP",i[i.DST_OVER=24]="DST_OVER",i[i.DST_IN=25]="DST_IN",i[i.DST_OUT=26]="DST_OUT",i[i.DST_ATOP=27]="DST_ATOP",i[i.ERASE=26]="ERASE",i[i.SUBTRACT=28]="SUBTRACT",i[i.XOR=29]="XOR",i))(He||{}),sn=(i=>(i[i.POINTS=0]="POINTS",i[i.LINES=1]="LINES",i[i.LINE_LOOP=2]="LINE_LOOP",i[i.LINE_STRIP=3]="LINE_STRIP",i[i.TRIANGLES=4]="TRIANGLES",i[i.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",i[i.TRIANGLE_FAN=6]="TRIANGLE_FAN",i))(sn||{}),_e=(i=>(i[i.RGBA=6408]="RGBA",i[i.RGB=6407]="RGB",i[i.RG=33319]="RG",i[i.RED=6403]="RED",i[i.RGBA_INTEGER=36249]="RGBA_INTEGER",i[i.RGB_INTEGER=36248]="RGB_INTEGER",i[i.RG_INTEGER=33320]="RG_INTEGER",i[i.RED_INTEGER=36244]="RED_INTEGER",i[i.ALPHA=6406]="ALPHA",i[i.LUMINANCE=6409]="LUMINANCE",i[i.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",i[i.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",i[i.DEPTH_STENCIL=34041]="DEPTH_STENCIL",i))(_e||{}),qo=(i=>(i[i.TEXTURE_2D=3553]="TEXTURE_2D",i[i.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",i[i.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",i[i.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",i[i.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",i[i.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",i[i.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",i))(qo||{}),$e=(i=>(i[i.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",i[i.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",i[i.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",i[i.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",i[i.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",i[i.UNSIGNED_INT=5125]="UNSIGNED_INT",i[i.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",i[i.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",i[i.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",i[i.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",i[i.BYTE=5120]="BYTE",i[i.SHORT=5122]="SHORT",i[i.INT=5124]="INT",i[i.FLOAT=5126]="FLOAT",i[i.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",i[i.HALF_FLOAT=36193]="HALF_FLOAT",i))($e||{}),Ne=(i=>(i[i.FLOAT=0]="FLOAT",i[i.INT=1]="INT",i[i.UINT=2]="UINT",i))(Ne||{}),Ci=(i=>(i[i.NEAREST=0]="NEAREST",i[i.LINEAR=1]="LINEAR",i))(Ci||{}),Ii=(i=>(i[i.CLAMP=33071]="CLAMP",i[i.REPEAT=10497]="REPEAT",i[i.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",i))(Ii||{}),gi=(i=>(i[i.OFF=0]="OFF",i[i.POW2=1]="POW2",i[i.ON=2]="ON",i[i.ON_MANUAL=3]="ON_MANUAL",i))(gi||{}),bs=(i=>(i[i.NPM=0]="NPM",i[i.UNPACK=1]="UNPACK",i[i.PMA=2]="PMA",i[i.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",i[i.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",i[i.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",i))(bs||{}),Zi=(i=>(i[i.NO=0]="NO",i[i.YES=1]="YES",i[i.AUTO=2]="AUTO",i[i.BLEND=0]="BLEND",i[i.CLEAR=1]="CLEAR",i[i.BLIT=2]="BLIT",i))(Zi||{}),ap=(i=>(i[i.AUTO=0]="AUTO",i[i.MANUAL=1]="MANUAL",i))(ap||{}),fi=(i=>(i.LOW="lowp",i.MEDIUM="mediump",i.HIGH="highp",i))(fi||{}),us=(i=>(i[i.NONE=0]="NONE",i[i.SCISSOR=1]="SCISSOR",i[i.STENCIL=2]="STENCIL",i[i.SPRITE=3]="SPRITE",i[i.COLOR=4]="COLOR",i))(us||{}),ls=(i=>(i[i.NONE=0]="NONE",i[i.LOW=2]="LOW",i[i.MEDIUM=4]="MEDIUM",i[i.HIGH=8]="HIGH",i))(ls||{}),an=(i=>(i[i.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",i[i.ARRAY_BUFFER=34962]="ARRAY_BUFFER",i[i.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",i))(an||{});const X_={createCanvas:(i,e)=>{const t=document.createElement("canvas");return t.width=i,t.height=e,t},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(i,e)=>fetch(i,e),parseXML:i=>new DOMParser().parseFromString(i,"text/xml")},Le={ADAPTER:X_,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var Bu=/iPhone/i,Eg=/iPod/i,Ig=/iPad/i,Rg=/\biOS-universal(?:.+)Mac\b/i,Nu=/\bAndroid(?:.+)Mobile\b/i,Pg=/Android/i,_o=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,jl=/Silk/i,vn=/Windows Phone/i,kg=/\bWindows(?:.+)ARM\b/i,Fg=/BlackBerry/i,Og=/BB10/i,Lg=/Opera Mini/i,Bg=/\b(CriOS|Chrome)(?:.+)Mobile/i,Ng=/Mobile(?:.+)Firefox\b/i,Dg=function(i){return typeof i<"u"&&i.platform==="MacIntel"&&typeof i.maxTouchPoints=="number"&&i.maxTouchPoints>1&&typeof MSStream>"u"};function V_(i){return function(e){return e.test(i)}}function Ug(i){var e={userAgent:"",platform:"",maxTouchPoints:0};!i&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof i=="string"?e.userAgent=i:i&&i.userAgent&&(e={userAgent:i.userAgent,platform:i.platform,maxTouchPoints:i.maxTouchPoints||0});var t=e.userAgent,s=t.split("[FBAN");typeof s[1]<"u"&&(t=s[0]),s=t.split("Twitter"),typeof s[1]<"u"&&(t=s[0]);var n=V_(t),r={apple:{phone:n(Bu)&&!n(vn),ipod:n(Eg),tablet:!n(Bu)&&(n(Ig)||Dg(e))&&!n(vn),universal:n(Rg),device:(n(Bu)||n(Eg)||n(Ig)||n(Rg)||Dg(e))&&!n(vn)},amazon:{phone:n(_o),tablet:!n(_o)&&n(jl),device:n(_o)||n(jl)},android:{phone:!n(vn)&&n(_o)||!n(vn)&&n(Nu),tablet:!n(vn)&&!n(_o)&&!n(Nu)&&(n(jl)||n(Pg)),device:!n(vn)&&(n(_o)||n(jl)||n(Nu)||n(Pg))||n(/\bokhttp\b/i)},windows:{phone:n(vn),tablet:n(kg),device:n(vn)||n(kg)},other:{blackberry:n(Fg),blackberry10:n(Og),opera:n(Lg),firefox:n(Ng),chrome:n(Bg),device:n(Fg)||n(Og)||n(Lg)||n(Ng)||n(Bg)},any:!1,phone:!1,tablet:!1};return r.any=r.apple.device||r.android.device||r.windows.device||r.other.device,r.phone=r.apple.phone||r.android.phone||r.windows.phone,r.tablet=r.apple.tablet||r.android.tablet||r.windows.tablet,r}const Y_=Ug.default??Ug,In=Y_(globalThis.navigator);Le.RETINA_PREFIX=/@([0-9\.]+)x/;Le.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Qc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gx(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function G_(i){if(Object.prototype.hasOwnProperty.call(i,"__esModule"))return i;var e=i.default;if(typeof e=="function"){var t=function s(){return this instanceof s?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(s){var n=Object.getOwnPropertyDescriptor(i,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return i[s]}})}),t}var Du={exports:{}},$g;function j_(){return $g||($g=1,(function(i){var e=Object.prototype.hasOwnProperty,t="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(t=!1));function n(l,c,h){this.fn=l,this.context=c,this.once=h||!1}function r(l,c,h,u,d){if(typeof h!="function")throw new TypeError("The listener must be a function");var f=new n(h,u||l,d),p=t?t+c:c;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],f]:l._events[p].push(f):(l._events[p]=f,l._eventsCount++),l}function o(l,c){--l._eventsCount===0?l._events=new s:delete l._events[c]}function a(){this._events=new s,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],h,u;if(this._eventsCount===0)return c;for(u in h=this._events)e.call(h,u)&&c.push(t?u.slice(1):u);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(h)):c},a.prototype.listeners=function(c){var h=t?t+c:c,u=this._events[h];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,f=u.length,p=new Array(f);d80*A){V=K=N[0],j=ie=N[1];for(var he=A;heK&&(K=re),pe>ie&&(ie=pe);ge=Math.max(K-V,ie-j),ge=ge!==0?32767/ge:0}return s(L,$,A,V,j,ge,0),$}function e(N,U,A,P,O){var L,$;if(O===X(N,U,A,P)>0)for(L=U;L=U;L-=P)$=k(L,N[L],N[L+1],$);return $&&M($,$.next)&&(B($),$=$.next),$}function t(N,U){if(!N)return N;U||(U=N);var A=N,P;do if(P=!1,!A.steiner&&(M(A,A.next)||x(A.prev,A,A.next)===0)){if(B(A),A=U=A.prev,A===A.next)break;P=!0}else A=A.next;while(P||A!==U);return U}function s(N,U,A,P,O,L,$){if(N){!$&&L&&f(N,P,O,L);for(var V=N,j,K;N.prev!==N.next;){if(j=N.prev,K=N.next,L?r(N,P,O,L):n(N)){U.push(j.i/A|0),U.push(N.i/A|0),U.push(K.i/A|0),B(N),N=K.next,V=K.next;continue}if(N=K,N===V){$?$===1?(N=o(t(N),U,A),s(N,U,A,P,O,L,2)):$===2&&a(N,U,A,P,O,L):s(t(N),U,A,P,O,L,1);break}}}}function n(N){var U=N.prev,A=N,P=N.next;if(x(U,A,P)>=0)return!1;for(var O=U.x,L=A.x,$=P.x,V=U.y,j=A.y,K=P.y,ie=OL?O>$?O:$:L>$?L:$,ge=V>j?V>K?V:K:j>K?j:K,he=P.next;he!==U;){if(he.x>=ie&&he.x<=pe&&he.y>=re&&he.y<=ge&&v(O,V,L,j,$,K,he.x,he.y)&&x(he.prev,he,he.next)>=0)return!1;he=he.next}return!0}function r(N,U,A,P){var O=N.prev,L=N,$=N.next;if(x(O,L,$)>=0)return!1;for(var V=O.x,j=L.x,K=$.x,ie=O.y,re=L.y,pe=$.y,ge=Vj?V>K?V:K:j>K?j:K,Y=ie>re?ie>pe?ie:pe:re>pe?re:pe,W=m(ge,he,U,A,P),H=m(fe,Y,U,A,P),G=N.prevZ,q=N.nextZ;G&&G.z>=W&&q&&q.z<=H;){if(G.x>=ge&&G.x<=fe&&G.y>=he&&G.y<=Y&&G!==O&&G!==$&&v(V,ie,j,re,K,pe,G.x,G.y)&&x(G.prev,G,G.next)>=0||(G=G.prevZ,q.x>=ge&&q.x<=fe&&q.y>=he&&q.y<=Y&&q!==O&&q!==$&&v(V,ie,j,re,K,pe,q.x,q.y)&&x(q.prev,q,q.next)>=0))return!1;q=q.nextZ}for(;G&&G.z>=W;){if(G.x>=ge&&G.x<=fe&&G.y>=he&&G.y<=Y&&G!==O&&G!==$&&v(V,ie,j,re,K,pe,G.x,G.y)&&x(G.prev,G,G.next)>=0)return!1;G=G.prevZ}for(;q&&q.z<=H;){if(q.x>=ge&&q.x<=fe&&q.y>=he&&q.y<=Y&&q!==O&&q!==$&&v(V,ie,j,re,K,pe,q.x,q.y)&&x(q.prev,q,q.next)>=0)return!1;q=q.nextZ}return!0}function o(N,U,A){var P=N;do{var O=P.prev,L=P.next.next;!M(O,L)&&C(O,P,P.next,L)&&E(O,L)&&E(L,O)&&(U.push(O.i/A|0),U.push(P.i/A|0),U.push(L.i/A|0),B(P),B(P.next),P=N=L),P=P.next}while(P!==N);return t(P)}function a(N,U,A,P,O,L){var $=N;do{for(var V=$.next.next;V!==$.prev;){if($.i!==V.i&&y($,V)){var j=I($,V);$=t($,$.next),j=t(j,j.next),s($,U,A,P,O,L,0),s(j,U,A,P,O,L,0);return}V=V.next}$=$.next}while($!==N)}function l(N,U,A,P){var O=[],L,$,V,j,K;for(L=0,$=U.length;L<$;L++)V=U[L]*P,j=L<$-1?U[L+1]*P:N.length,K=e(N,V,j,P,!1),K===K.next&&(K.steiner=!0),O.push(g(K));for(O.sort(c),L=0;L=A.next.y&&A.next.y!==A.y){var V=A.x+(O-A.y)*(A.next.x-A.x)/(A.next.y-A.y);if(V<=P&&V>L&&(L=V,$=A.x=A.x&&A.x>=K&&P!==A.x&&v(O$.x||A.x===$.x&&d($,A)))&&($=A,re=pe)),A=A.next;while(A!==j);return $}function d(N,U){return x(N.prev,N,U.prev)<0&&x(U.next,N,N.next)<0}function f(N,U,A,P){var O=N;do O.z===0&&(O.z=m(O.x,O.y,U,A,P)),O.prevZ=O.prev,O.nextZ=O.next,O=O.next;while(O!==N);O.prevZ.nextZ=null,O.prevZ=null,p(O)}function p(N){var U,A,P,O,L,$,V,j,K=1;do{for(A=N,N=null,L=null,$=0;A;){for($++,P=A,V=0,U=0;U0||j>0&&P;)V!==0&&(j===0||!P||A.z<=P.z)?(O=A,A=A.nextZ,V--):(O=P,P=P.nextZ,j--),L?L.nextZ=O:N=O,O.prevZ=L,L=O;A=P}L.nextZ=null,K*=2}while($>1);return N}function m(N,U,A,P,O){return N=(N-A)*O|0,U=(U-P)*O|0,N=(N|N<<8)&16711935,N=(N|N<<4)&252645135,N=(N|N<<2)&858993459,N=(N|N<<1)&1431655765,U=(U|U<<8)&16711935,U=(U|U<<4)&252645135,U=(U|U<<2)&858993459,U=(U|U<<1)&1431655765,N|U<<1}function g(N){var U=N,A=N;do(U.x=(N-$)*(L-V)&&(N-$)*(P-V)>=(A-$)*(U-V)&&(A-$)*(L-V)>=(O-$)*(P-V)}function y(N,U){return N.next.i!==U.i&&N.prev.i!==U.i&&!_(N,U)&&(E(N,U)&&E(U,N)&&F(N,U)&&(x(N.prev,N,U.prev)||x(N,U.prev,U))||M(N,U)&&x(N.prev,N,N.next)>0&&x(U.prev,U,U.next)>0)}function x(N,U,A){return(U.y-N.y)*(A.x-U.x)-(U.x-N.x)*(A.y-U.y)}function M(N,U){return N.x===U.x&&N.y===U.y}function C(N,U,A,P){var O=b(x(N,U,A)),L=b(x(N,U,P)),$=b(x(A,P,N)),V=b(x(A,P,U));return!!(O!==L&&$!==V||O===0&&w(N,A,U)||L===0&&w(N,P,U)||$===0&&w(A,N,P)||V===0&&w(A,U,P))}function w(N,U,A){return U.x<=Math.max(N.x,A.x)&&U.x>=Math.min(N.x,A.x)&&U.y<=Math.max(N.y,A.y)&&U.y>=Math.min(N.y,A.y)}function b(N){return N>0?1:N<0?-1:0}function _(N,U){var A=N;do{if(A.i!==N.i&&A.next.i!==N.i&&A.i!==U.i&&A.next.i!==U.i&&C(A,A.next,N,U))return!0;A=A.next}while(A!==N);return!1}function E(N,U){return x(N.prev,N,N.next)<0?x(N,U,N.next)>=0&&x(N,N.prev,U)>=0:x(N,U,N.prev)<0||x(N,N.next,U)<0}function F(N,U){var A=N,P=!1,O=(N.x+U.x)/2,L=(N.y+U.y)/2;do A.y>L!=A.next.y>L&&A.next.y!==A.y&&O<(A.next.x-A.x)*(L-A.y)/(A.next.y-A.y)+A.x&&(P=!P),A=A.next;while(A!==N);return P}function I(N,U){var A=new D(N.i,N.x,N.y),P=new D(U.i,U.x,U.y),O=N.next,L=U.prev;return N.next=U,U.prev=N,A.next=O,O.prev=A,P.next=A,A.prev=P,L.next=P,P.prev=L,P}function k(N,U,A,P){var O=new D(N,U,A);return P?(O.next=P.next,O.prev=P,P.next.prev=O,P.next=O):(O.prev=O,O.next=O),O}function B(N){N.next.prev=N.prev,N.prev.next=N.next,N.prevZ&&(N.prevZ.nextZ=N.nextZ),N.nextZ&&(N.nextZ.prevZ=N.prevZ)}function D(N,U,A){this.i=N,this.x=U,this.y=A,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}i.deviation=function(N,U,A,P){var O=U&&U.length,L=O?U[0]*A:N.length,$=Math.abs(X(N,0,L,A));if(O)for(var V=0,j=U.length;V0&&(P+=N[O-1].length,A.holes.push(P))}return A},Hl.exports}var z_=W_();const q_=Gx(z_);var Lr={},Ua={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var K_=Ua.exports,Vg;function Z_(){return Vg||(Vg=1,(function(i,e){(function(t){var s=e&&!e.nodeType&&e,n=i&&!i.nodeType&&i,r=typeof Qc=="object"&&Qc;(r.global===r||r.window===r||r.self===r)&&(t=r);var o,a=2147483647,l=36,c=1,h=26,u=38,d=700,f=72,p=128,m="-",g=/^xn--/,v=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},M=l-c,C=Math.floor,w=String.fromCharCode,b;function _(O){throw new RangeError(x[O])}function E(O,L){for(var $=O.length,V=[];$--;)V[$]=L(O[$]);return V}function F(O,L){var $=O.split("@"),V="";$.length>1&&(V=$[0]+"@",O=$[1]),O=O.replace(y,".");var j=O.split("."),K=E(j,L).join(".");return V+K}function I(O){for(var L=[],$=0,V=O.length,j,K;$=55296&&j<=56319&&$65535&&(L-=65536,$+=w(L>>>10&1023|55296),L=56320|L&1023),$+=w(L),$}).join("")}function B(O){return O-48<10?O-22:O-65<26?O-65:O-97<26?O-97:l}function D(O,L){return O+22+75*(O<26)-((L!=0)<<5)}function X(O,L,$){var V=0;for(O=$?C(O/d):O>>1,O+=C(O/L);O>M*h>>1;V+=l)O=C(O/M);return C(V+(M+1)*O/(O+u))}function N(O){var L=[],$=O.length,V,j=0,K=p,ie=f,re,pe,ge,he,fe,Y,W,H,G;for(re=O.lastIndexOf(m),re<0&&(re=0),pe=0;pe=128&&_("not-basic"),L.push(O.charCodeAt(pe));for(ge=re>0?re+1:0;ge<$;){for(he=j,fe=1,Y=l;ge>=$&&_("invalid-input"),W=B(O.charCodeAt(ge++)),(W>=l||W>C((a-j)/fe))&&_("overflow"),j+=W*fe,H=Y<=ie?c:Y>=ie+h?h:Y-ie,!(WC(a/G)&&_("overflow"),fe*=G;V=L.length+1,ie=X(j-he,V,he==0),C(j/V)>a-K&&_("overflow"),K+=C(j/V),j%=V,L.splice(j++,0,K)}return k(L)}function U(O){var L,$,V,j,K,ie,re,pe,ge,he,fe,Y=[],W,H,G,q;for(O=I(O),W=O.length,L=p,$=0,K=f,ie=0;ie=L&&feC((a-$)/H)&&_("overflow"),$+=(re-L)*H,L=re,ie=0;iea&&_("overflow"),fe==L){for(pe=$,ge=l;he=ge<=K?c:ge>=K+h?h:ge-K,!(pe-1e3&&te<1e3||w.call(/e/,oe))return oe;var lt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof te=="number"){var It=te<0?-F(-te):F(te);if(It!==te){var Rt=String(It),tt=y.call(oe,Rt.length+1);return x.call(Rt,lt,"$&_")+"."+x.call(x.call(tt,/([0-9]{3})/g,"$&_"),/_$/,"")}}return x.call(oe,lt,"$&_")}var P=e2,O=P.custom,L=H(O)?O:null,$={__proto__:null,double:'"',single:"'"},V={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};$u=function te(oe,lt,It,Rt){var tt=lt||{};if(se(tt,"quoteStyle")&&!se($,tt.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(se(tt,"maxStringLength")&&(typeof tt.maxStringLength=="number"?tt.maxStringLength<0&&tt.maxStringLength!==1/0:tt.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var ni=se(tt,"customInspect")?tt.customInspect:!0;if(typeof ni!="boolean"&&ni!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(se(tt,"indent")&&tt.indent!==null&&tt.indent!==" "&&!(parseInt(tt.indent,10)===tt.indent&&tt.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(se(tt,"numericSeparator")&&typeof tt.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var rs=tt.numericSeparator;if(typeof oe>"u")return"undefined";if(oe===null)return"null";if(typeof oe=="boolean")return oe?"true":"false";if(typeof oe=="string")return qe(oe,tt);if(typeof oe=="number"){if(oe===0)return 1/0/oe>0?"0":"-0";var ss=String(oe);return rs?A(oe,ss):ss}if(typeof oe=="bigint"){var Tt=String(oe)+"n";return rs?A(oe,Tt):Tt}var vi=typeof tt.depth>"u"?5:tt.depth;if(typeof It>"u"&&(It=0),It>=vi&&vi>0&&typeof oe=="object")return re(oe)?"[Array]":"[Object]";var As=vs(tt,It);if(typeof Rt>"u")Rt=[];else if(de(Rt,oe)>=0)return"[Circular]";function os(zn,So,Su){if(So&&(Rt=E.call(Rt),Rt.push(So)),Su){var Ul={depth:tt.depth};return se(tt,"quoteStyle")&&(Ul.quoteStyle=tt.quoteStyle),te(zn,Ul,It+1,Rt)}return te(zn,tt,It+1,Rt)}if(typeof oe=="function"&&!ge(oe)){var fn=ne(oe),ri=xt(oe,os);return"[Function"+(fn?": "+fn:" (anonymous)")+"]"+(ri.length>0?" { "+_.call(ri,", ")+" }":"")}if(H(oe)){var Bi=D?x.call(String(oe),/^(Symbol\(.*\))_[^)]*$/,"$1"):B.call(oe);return typeof oe=="object"&&!D?Be(Bi):Bi}if(Je(oe)){for(var Ni="<"+C.call(String(oe.nodeName)),Er=oe.attributes||[],Ir=0;Ir",Ni}if(re(oe)){if(oe.length===0)return"[]";var xa=xt(oe,os);return As&&!Te(xa)?"["+Ct(xa,As)+"]":"[ "+_.call(xa,", ")+" ]"}if(he(oe)){var ba=xt(oe,os);return!("cause"in Error.prototype)&&"cause"in oe&&!N.call(oe,"cause")?"{ ["+String(oe)+"] "+_.call(b.call("[cause]: "+os(oe.cause),ba),", ")+" }":ba.length===0?"["+String(oe)+"]":"{ ["+String(oe)+"] "+_.call(ba,", ")+" }"}if(typeof oe=="object"&&ni){if(L&&typeof oe[L]=="function"&&P)return P(oe,{depth:vi-It});if(ni!=="symbol"&&typeof oe.inspect=="function")return oe.inspect()}if(le(oe)){var Bl=[];return s&&s.call(oe,function(zn,So){Bl.push(os(So,oe,!0)+" => "+os(zn,oe))}),nt("Map",t.call(oe),Bl,As)}if(me(oe)){var Nl=[];return a&&a.call(oe,function(zn){Nl.push(os(zn,oe))}),nt("Set",o.call(oe),Nl,As)}if(Re(oe))return Me("WeakMap");if(Ue(oe))return Me("WeakSet");if(we(oe))return Me("WeakRef");if(Y(oe))return Be(os(Number(oe)));if(G(oe))return Be(os(I.call(oe)));if(W(oe))return Be(p.call(oe));if(fe(oe))return Be(os(String(oe)));if(typeof window<"u"&&oe===window)return"{ [object Window] }";if(typeof globalThis<"u"&&oe===globalThis||typeof Qc<"u"&&oe===Qc)return"{ [object globalThis] }";if(!pe(oe)&&!ge(oe)){var wa=xt(oe,os),Sa=U?U(oe)===Object.prototype:oe instanceof Object||oe.constructor===Object,Ma=oe instanceof Object?"":"null prototype",Dl=!Sa&&X&&Object(oe)===oe&&X in oe?y.call(ue(oe),8,-1):Ma?"Object":"",wu=Sa||typeof oe.constructor!="function"?"":oe.constructor.name?oe.constructor.name+" ":"",Ta=wu+(Dl||Ma?"["+_.call(b.call([],Dl||[],Ma||[]),": ")+"] ":"");return wa.length===0?Ta+"{}":As?Ta+"{"+Ct(wa,As)+"}":Ta+"{ "+_.call(wa,", ")+" }"}return String(oe)};function j(te,oe,lt){var It=lt.quoteStyle||oe,Rt=$[It];return Rt+te+Rt}function K(te){return x.call(String(te),/"/g,""")}function ie(te){return!X||!(typeof te=="object"&&(X in te||typeof te[X]<"u"))}function re(te){return ue(te)==="[object Array]"&&ie(te)}function pe(te){return ue(te)==="[object Date]"&&ie(te)}function ge(te){return ue(te)==="[object RegExp]"&&ie(te)}function he(te){return ue(te)==="[object Error]"&&ie(te)}function fe(te){return ue(te)==="[object String]"&&ie(te)}function Y(te){return ue(te)==="[object Number]"&&ie(te)}function W(te){return ue(te)==="[object Boolean]"&&ie(te)}function H(te){if(D)return te&&typeof te=="object"&&te instanceof Symbol;if(typeof te=="symbol")return!0;if(!te||typeof te!="object"||!B)return!1;try{return B.call(te),!0}catch{}return!1}function G(te){if(!te||typeof te!="object"||!I)return!1;try{return I.call(te),!0}catch{}return!1}var q=Object.prototype.hasOwnProperty||function(te){return te in this};function se(te,oe){return q.call(te,oe)}function ue(te){return m.call(te)}function ne(te){if(te.name)return te.name;var oe=v.call(g.call(te),/^function\s*([\w$]+)/);return oe?oe[1]:null}function de(te,oe){if(te.indexOf)return te.indexOf(oe);for(var lt=0,It=te.length;ltoe.maxStringLength){var lt=te.length-oe.maxStringLength,It="... "+lt+" more character"+(lt>1?"s":"");return qe(y.call(te,0,oe.maxStringLength),oe)+It}var Rt=V[oe.quoteStyle||"single"];Rt.lastIndex=0;var tt=x.call(x.call(te,Rt,"\\$1"),/[\x00-\x1f]/g,Ze);return j(tt,"single",oe)}function Ze(te){var oe=te.charCodeAt(0),lt={8:"b",9:"t",10:"n",12:"f",13:"r"}[oe];return lt?"\\"+lt:"\\x"+(oe<16?"0":"")+M.call(oe.toString(16))}function Be(te){return"Object("+te+")"}function Me(te){return te+" { ? }"}function nt(te,oe,lt,It){var Rt=It?Ct(lt,It):_.call(lt,", ");return te+" ("+oe+") {"+Rt+"}"}function Te(te){for(var oe=0;oe=0)return!1;return!0}function vs(te,oe){var lt;if(te.indent===" ")lt=" ";else if(typeof te.indent=="number"&&te.indent>0)lt=_.call(Array(te.indent+1)," ");else return null;return{base:lt,prev:_.call(Array(oe+1),lt)}}function Ct(te,oe){if(te.length===0)return"";var lt=` -`+oe.prev+oe.base;return lt+_.call(te,","+lt)+` -`+oe.prev}function xt(te,oe){var lt=re(te),It=[];if(lt){It.length=te.length;for(var Rt=0;Rt"u"||!b?i:b(Uint8Array),D={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?i:ArrayBuffer,"%ArrayIteratorPrototype%":w&&b?b([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":k,"%AsyncGenerator%":k,"%AsyncGeneratorFunction%":k,"%AsyncIteratorPrototype%":k,"%Atomics%":typeof Atomics>"u"?i:Atomics,"%BigInt%":typeof BigInt>"u"?i:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?i:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?i:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":s,"%Float16Array%":typeof Float16Array>"u"?i:Float16Array,"%Float32Array%":typeof Float32Array>"u"?i:Float32Array,"%Float64Array%":typeof Float64Array>"u"?i:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?i:FinalizationRegistry,"%Function%":g,"%GeneratorFunction%":k,"%Int8Array%":typeof Int8Array>"u"?i:Int8Array,"%Int16Array%":typeof Int16Array>"u"?i:Int16Array,"%Int32Array%":typeof Int32Array>"u"?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":w&&b?b(b([][Symbol.iterator]())):i,"%JSON%":typeof JSON=="object"?JSON:i,"%Map%":typeof Map>"u"?i:Map,"%MapIteratorPrototype%":typeof Map>"u"||!w||!b?i:b(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":y,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?i:Promise,"%Proxy%":typeof Proxy>"u"?i:Proxy,"%RangeError%":n,"%ReferenceError%":r,"%Reflect%":typeof Reflect>"u"?i:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?i:Set,"%SetIteratorPrototype%":typeof Set>"u"||!w||!b?i:b(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":w&&b?b(""[Symbol.iterator]()):i,"%Symbol%":w?Symbol:i,"%SyntaxError%":o,"%ThrowTypeError%":C,"%TypedArray%":B,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?i:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?i:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?i:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?i:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?i:WeakMap,"%WeakRef%":typeof WeakRef>"u"?i:WeakRef,"%WeakSet%":typeof WeakSet>"u"?i:WeakSet,"%Function.prototype.call%":I,"%Function.prototype.apply%":F,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":_,"%Math.abs%":c,"%Math.floor%":h,"%Math.max%":u,"%Math.min%":d,"%Math.pow%":f,"%Math.round%":p,"%Math.sign%":m,"%Reflect.getPrototypeOf%":E};if(b)try{null.error}catch(ge){var X=b(b(ge));D["%Error.prototype%"]=X}var N=function ge(he){var fe;if(he==="%AsyncFunction%")fe=v("async function () {}");else if(he==="%GeneratorFunction%")fe=v("function* () {}");else if(he==="%AsyncGeneratorFunction%")fe=v("async function* () {}");else if(he==="%AsyncGenerator%"){var Y=ge("%AsyncGeneratorFunction%");Y&&(fe=Y.prototype)}else if(he==="%AsyncIteratorPrototype%"){var W=ge("%AsyncGenerator%");W&&b&&(fe=b(W.prototype))}return D[he]=fe,fe},U={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},A=nu(),P=T2(),O=A.call(I,Array.prototype.concat),L=A.call(F,Array.prototype.splice),$=A.call(I,String.prototype.replace),V=A.call(I,String.prototype.slice),j=A.call(I,RegExp.prototype.exec),K=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ie=/\\(\\)?/g,re=function(he){var fe=V(he,0,1),Y=V(he,-1);if(fe==="%"&&Y!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(Y==="%"&&fe!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var W=[];return $(he,K,function(H,G,q,se){W[W.length]=q?$(se,ie,"$1"):G||H}),W},pe=function(he,fe){var Y=he,W;if(P(U,Y)&&(W=U[Y],Y="%"+W[0]+"%"),P(D,Y)){var H=D[Y];if(H===k&&(H=N(Y)),typeof H>"u"&&!fe)throw new a("intrinsic "+he+" exists, but is not available. Please file an issue!");return{alias:W,name:Y,value:H}}throw new o("intrinsic "+he+" does not exist!")};return bd=function(he,fe){if(typeof he!="string"||he.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof fe!="boolean")throw new a('"allowMissing" argument must be a boolean');if(j(/^%?[^%]*%?$/,he)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Y=re(he),W=Y.length>0?Y[0]:"",H=pe("%"+W+"%",fe),G=H.name,q=H.value,se=!1,ue=H.alias;ue&&(W=ue[0],L(Y,O([0,1],ue)));for(var ne=1,de=!0;ne=Y.length){var me=y(q,le);de=!!me,de&&"get"in me&&!("originalValue"in me.get)?q=me.get:q=q[le]}else de=P(q,le),q=q[le];de&&!se&&(D[G]=q)}}return q},bd}var wd,_0;function Jx(){if(_0)return wd;_0=1;var i=cp(),e=Zx(),t=e([i("%String.prototype.indexOf%")]);return wd=function(n,r){var o=i(n,!!r);return typeof o=="function"&&t(n,".prototype.")>-1?e([o]):o},wd}var Sd,C0;function Qx(){if(C0)return Sd;C0=1;var i=cp(),e=Jx(),t=iu(),s=pa(),n=i("%Map%",!0),r=e("Map.prototype.get",!0),o=e("Map.prototype.set",!0),a=e("Map.prototype.has",!0),l=e("Map.prototype.delete",!0),c=e("Map.prototype.size",!0);return Sd=!!n&&function(){var u,d={assert:function(f){if(!d.has(f))throw new s("Side channel does not contain "+t(f))},delete:function(f){if(u){var p=l(u,f);return c(u)===0&&(u=void 0),p}return!1},get:function(f){if(u)return r(u,f)},has:function(f){return u?a(u,f):!1},set:function(f,p){u||(u=new n),o(u,f,p)}};return d},Sd}var Md,A0;function _2(){if(A0)return Md;A0=1;var i=cp(),e=Jx(),t=iu(),s=Qx(),n=pa(),r=i("%WeakMap%",!0),o=e("WeakMap.prototype.get",!0),a=e("WeakMap.prototype.set",!0),l=e("WeakMap.prototype.has",!0),c=e("WeakMap.prototype.delete",!0);return Md=r?function(){var u,d,f={assert:function(p){if(!f.has(p))throw new n("Side channel does not contain "+t(p))},delete:function(p){if(r&&p&&(typeof p=="object"||typeof p=="function")){if(u)return c(u,p)}else if(s&&d)return d.delete(p);return!1},get:function(p){return r&&p&&(typeof p=="object"||typeof p=="function")&&u?o(u,p):d&&d.get(p)},has:function(p){return r&&p&&(typeof p=="object"||typeof p=="function")&&u?l(u,p):!!d&&d.has(p)},set:function(p,m){r&&p&&(typeof p=="object"||typeof p=="function")?(u||(u=new r),a(u,p,m)):s&&(d||(d=s()),d.set(p,m))}};return f}:s,Md}var Td,E0;function eb(){if(E0)return Td;E0=1;var i=pa(),e=iu(),t=t2(),s=Qx(),n=_2(),r=n||s||t;return Td=function(){var a,l={assert:function(c){if(!l.has(c)){var h=c&&Object(c)===c?"the given object key":e(c);throw new i("Side channel does not contain "+h)}},delete:function(c){return!!a&&a.delete(c)},get:function(c){return a&&a.get(c)},has:function(c){return!!a&&a.has(c)},set:function(c,h){a||(a=r()),a.set(c,h)}};return l},Td}var _d,I0;function hp(){if(I0)return _d;I0=1;var i=String.prototype.replace,e=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return _d={default:t.RFC3986,formatters:{RFC1738:function(s){return i.call(s,e,"+")},RFC3986:function(s){return String(s)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},_d}var Cd,R0;function tb(){if(R0)return Cd;R0=1;var i=hp(),e=eb(),t=Wx(),s=Object.prototype.hasOwnProperty,n=Array.isArray,r=e(),o=function(E,F){return r.set(E,F),E},a=function(E){return r.has(E)},l=function(E){return r.get(E)},c=function(E,F){r.set(E,F)},h=(function(){for(var _=[],E=0;E<256;++E)_[_.length]="%"+((E<16?"0":"")+E.toString(16)).toUpperCase();return _})(),u=function(E){for(;E.length>1;){var F=E.pop(),I=F.obj[F.prop];if(n(I)){for(var k=[],B=0;B=I.arrayLimit){if(I.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+I.arrayLimit+" element"+(I.arrayLimit===1?"":"s")+" allowed in an array.");return o(d(E.concat(F),I),k)}E[k]=F}else if(E&&typeof E=="object")if(a(E)){var B=l(E)+1;E[B]=F,c(E,B)}else{if(I&&I.strictMerge)return[E,F];(I&&(I.plainObjects||I.allowPrototypes)||!s.call(Object.prototype,F))&&(E[F]=!0)}else return[E,F];return E}if(!E||typeof E!="object"){if(a(F)){for(var D=Object.keys(F),X=I&&I.plainObjects?{__proto__:null,0:E}:{0:E},N=0;NI.arrayLimit){if(I.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+I.arrayLimit+" element"+(I.arrayLimit===1?"":"s")+" allowed in an array.");return o(d(A,I),A.length-1)}return A}var P=E;if(n(E)&&!n(F)&&(P=d(E,I)),n(E)&&n(F)){if(F.forEach(function(O,L){if(s.call(E,L)){var $=E[L];$&&typeof $=="object"&&O&&typeof O=="object"?E[L]=_($,O,I):E[E.length]=O}else E[L]=O}),I&&typeof I.arrayLimit=="number"&&E.length>I.arrayLimit){if(I.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+I.arrayLimit+" element"+(I.arrayLimit===1?"":"s")+" allowed in an array.");return o(d(E,I),E.length-1)}return E}return Object.keys(F).reduce(function(O,L){var $=F[L];if(s.call(O,L)?f(O,L,_(O[L],$,I)):f(O,L,$),a(F)&&!a(O)&&o(O,l(F)),a(O)){var V=parseInt(L,10);String(V)===L&&V>=0&&V>l(O)&&c(O,V)}return O},P)},m=function(E,F){return Object.keys(F).reduce(function(I,k){return f(I,k,F[k]),I},E)},g=function(_,E,F){var I=_.replace(/\+/g," ");if(F==="iso-8859-1")return I.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(I)}catch{return I}},v=1024,y=function(E,F,I,k,B){if(E.length===0)return E;var D=E;if(typeof E=="symbol"?D=Symbol.prototype.toString.call(E):typeof E!="string"&&(D=String(E)),I==="iso-8859-1")return escape(D).replace(/%u[0-9a-f]{4}/gi,function($){return"%26%23"+parseInt($.slice(2),16)+"%3B"});for(var X="",N=0;N=v?D.slice(N,N+v):D;if(N+v=55296&&A<=56319&&(U=U.slice(0,-1),N-=1)}for(var P=[],O=0;O=48&&L<=57||L>=65&&L<=90||L>=97&&L<=122||B===i.RFC1738&&(L===40||L===41)){P[P.length]=U.charAt(O);continue}if(L<128){P[P.length]=h[L];continue}if(L<2048){P[P.length]=h[192|L>>6]+h[128|L&63];continue}if(L<55296||L>=57344){P[P.length]=h[224|L>>12]+h[128|L>>6&63]+h[128|L&63];continue}O+=1,L=65536+((L&1023)<<10|U.charCodeAt(O)&1023),P[P.length]=h[240|L>>18]+h[128|L>>12&63]+h[128|L>>6&63]+h[128|L&63]}X+=P.join("")}return X},x=function(E){for(var F=[{obj:{o:E},prop:"o"}],I=e(),k=0;kI){if(B)throw new RangeError("Array limit exceeded. Only "+I+" element"+(I===1?"":"s")+" allowed in an array.");return o(d(X,{plainObjects:k}),X.length-1)}return X},b=function(E,F){if(n(E)){for(var I=[],k=0;k"u"&&(O=0)}if(typeof E=="function"?A=E(v,A):A instanceof Date?A=k(A):y==="comma"&&r(A)&&(A=e.maybeMap(A,function(G){return G instanceof Date?k(G):G})),A===null){if(C)return D(_&&!X?_(v,h.encoder,N,"key",B):v);A=""}if(u(A)||e.isBuffer(A)){if(_){var V=X?v:_(v,h.encoder,N,"key",B);return[D(V)+"="+D(_(A,h.encoder,N,"value",B))]}return[D(v)+"="+D(String(A))]}var j=[];if(typeof A>"u")return j;var K;if(y==="comma"&&r(A))X&&_&&(A=e.maybeMap(A,function(G){return G==null?G:_(G)})),K=[{value:A.length>0?A.join(",")||null:void 0}];else if(r(E))K=E;else{var ie=Object.keys(A);K=F?ie.sort(F):ie}var re=b?String(v).replace(/\./g,"%2E"):String(v),pe=x&&r(A)&&A.length===1?re+"[]":re;if(M&&r(A)&&A.length===0)return pe+"[]";for(var ge=0;ge"u"?g.encodeDotInKeys===!0?!0:h.allowDots:!!g.allowDots;return{addQueryPrefix:typeof g.addQueryPrefix=="boolean"?g.addQueryPrefix:h.addQueryPrefix,allowDots:w,allowEmptyArrays:typeof g.allowEmptyArrays=="boolean"?!!g.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:C,charset:v,charsetSentinel:typeof g.charsetSentinel=="boolean"?g.charsetSentinel:h.charsetSentinel,commaRoundTrip:!!g.commaRoundTrip,delimiter:typeof g.delimiter>"u"?h.delimiter:g.delimiter,encode:typeof g.encode=="boolean"?g.encode:h.encode,encodeDotInKeys:typeof g.encodeDotInKeys=="boolean"?g.encodeDotInKeys:h.encodeDotInKeys,encoder:typeof g.encoder=="function"?g.encoder:h.encoder,encodeValuesOnly:typeof g.encodeValuesOnly=="boolean"?g.encodeValuesOnly:h.encodeValuesOnly,filter:M,format:y,formatter:x,serializeDate:typeof g.serializeDate=="function"?g.serializeDate:h.serializeDate,skipNulls:typeof g.skipNulls=="boolean"?g.skipNulls:h.skipNulls,sort:typeof g.sort=="function"?g.sort:null,strictNullHandling:typeof g.strictNullHandling=="boolean"?g.strictNullHandling:h.strictNullHandling}};return Ad=function(m,g){var v=m,y=p(g),x,M;typeof y.filter=="function"?(M=y.filter,v=M("",v)):r(y.filter)&&(M=y.filter,x=M);var C=[];if(typeof v!="object"||v===null)return"";var w=n[y.arrayFormat],b=w==="comma"&&y.commaRoundTrip;x||(x=Object.keys(v)),y.sort&&x.sort(y.sort);for(var _=i(),E=0;E"u"||F===null)){var I=v[F];y.skipNulls&&I===null||a(C,f(I,F,w,b,y.allowEmptyArrays,y.strictNullHandling,y.skipNulls,y.encodeDotInKeys,y.encode?y.encoder:null,y.filter,y.sort,y.allowDots,y.serializeDate,y.format,y.formatter,y.encodeValuesOnly,y.charset,_))}}var k=C.join(y.delimiter),B=y.addQueryPrefix===!0?"?":"";return y.charsetSentinel&&(y.charset==="iso-8859-1"?B+="utf8=%26%2310003%3B"+y.delimiter:B+="utf8=%E2%9C%93"+y.delimiter),k.length>0?B+k:""},Ad}var Ed,k0;function A2(){if(k0)return Ed;k0=1;var i=tb(),e=Object.prototype.hasOwnProperty,t=Array.isArray,s={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:i.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},n=function(f){return f.replace(/&#(\d+);/g,function(p,m){return String.fromCharCode(parseInt(m,10))})},r=function(f,p,m,g){if(f&&typeof f=="string"&&p.comma&&f.indexOf(",")>-1){if(g&&p.throwOnLimitExceeded)for(var v=0,y=f.indexOf(",");y>-1;){if(v+=1,v>=p.arrayLimit)throw new RangeError("Array limit exceeded. Only "+p.arrayLimit+" element"+(p.arrayLimit===1?"":"s")+" allowed in an array.");y=f.indexOf(",",y+1)}return f.split(",")}if(p.throwOnLimitExceeded&&m>=p.arrayLimit)throw new RangeError("Array limit exceeded. Only "+p.arrayLimit+" element"+(p.arrayLimit===1?"":"s")+" allowed in an array.");return f},o="utf8=%26%2310003%3B",a="utf8=%E2%9C%93",l=function(p,m){var g={__proto__:null},v=m.ignoreQueryPrefix?p.replace(/^\?/,""):p;v=v.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var y=m.parameterLimit===1/0?void 0:m.parameterLimit,x=v.split(m.delimiter,m.throwOnLimitExceeded&&typeof y<"u"?y+1:y);if(m.throwOnLimitExceeded&&typeof y<"u"&&x.length>y)throw new RangeError("Parameter limit exceeded. Only "+y+" parameter"+(y===1?"":"s")+" allowed.");var M=-1,C,w=m.charset;if(m.charsetSentinel)for(C=0;C-1&&(I=t(I)?[I]:I),m.comma&&t(I)&&I.length>m.arrayLimit&&(I=i.combine([],I,m.arrayLimit,m.plainObjects,m.throwOnLimitExceeded)),F!==null){var k=e.call(g,F);k&&(m.duplicates==="combine"||b.indexOf("[]=")>-1)?g[F]=i.combine(g[F],I,m.arrayLimit,m.plainObjects,m.throwOnLimitExceeded):(!k||m.duplicates==="last")&&(g[F]=I)}}return g},c=function(f,p,m,g){var v=0;if(f.length>0&&f[f.length-1]==="[]"){var y=f.slice(0,-1).join("");v=Array.isArray(p)&&p[y]?p[y].length:0}for(var x=g?p:r(p,m,v),M=f.length-1;M>=0;--M){var C,w=f[M];if(w==="[]"&&m.parseArrays)i.isOverflow(x)?C=x:C=m.allowEmptyArrays&&(x===""||m.strictNullHandling&&x===null)?[]:i.combine([],x,m.arrayLimit,m.plainObjects,m.throwOnLimitExceeded);else{C=m.plainObjects?{__proto__:null}:{};var b=w.charAt(0)==="["&&w.charAt(w.length-1)==="]"?w.slice(1,-1):w,_=m.decodeDotInKeys?b.replace(/%2E/g,"."):b,E=parseInt(_,10),F=!isNaN(E)&&w!==_&&String(E)===_&&E>=0&&m.parseArrays;if(!m.parseArrays&&_==="")C={0:x};else if(F&&E=0?g.slice(0,y):g;if(x){if(!m.plainObjects&&e.call(Object.prototype,x)&&!m.allowPrototypes)return;v[v.length]=x}for(var M=g.length,C=y,w=0;C>=0&&w=0){if(m.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+m.depth+" and strictDepth is true");v[v.length]="["+g.slice(C)+"]"}return v},u=function(p,m,g,v){if(p){var y=h(p,g);if(y)return c(y,m,g,v)}},d=function(p){if(!p)return s;if(typeof p.allowEmptyArrays<"u"&&typeof p.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof p.decodeDotInKeys<"u"&&typeof p.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(p.decoder!==null&&typeof p.decoder<"u"&&typeof p.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof p.charset<"u"&&p.charset!=="utf-8"&&p.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof p.throwOnLimitExceeded<"u"&&typeof p.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var m=typeof p.charset>"u"?s.charset:p.charset,g=typeof p.duplicates>"u"?s.duplicates:p.duplicates;if(g!=="combine"&&g!=="first"&&g!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var v=typeof p.allowDots>"u"?p.decodeDotInKeys===!0?!0:s.allowDots:!!p.allowDots;return{allowDots:v,allowEmptyArrays:typeof p.allowEmptyArrays=="boolean"?!!p.allowEmptyArrays:s.allowEmptyArrays,allowPrototypes:typeof p.allowPrototypes=="boolean"?p.allowPrototypes:s.allowPrototypes,allowSparse:typeof p.allowSparse=="boolean"?p.allowSparse:s.allowSparse,arrayLimit:typeof p.arrayLimit=="number"?p.arrayLimit:s.arrayLimit,charset:m,charsetSentinel:typeof p.charsetSentinel=="boolean"?p.charsetSentinel:s.charsetSentinel,comma:typeof p.comma=="boolean"?p.comma:s.comma,decodeDotInKeys:typeof p.decodeDotInKeys=="boolean"?p.decodeDotInKeys:s.decodeDotInKeys,decoder:typeof p.decoder=="function"?p.decoder:s.decoder,delimiter:typeof p.delimiter=="string"||i.isRegExp(p.delimiter)?p.delimiter:s.delimiter,depth:typeof p.depth=="number"||p.depth===!1?+p.depth:s.depth,duplicates:g,ignoreQueryPrefix:p.ignoreQueryPrefix===!0,interpretNumericEntities:typeof p.interpretNumericEntities=="boolean"?p.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:typeof p.parameterLimit=="number"?p.parameterLimit:s.parameterLimit,parseArrays:p.parseArrays!==!1,plainObjects:typeof p.plainObjects=="boolean"?p.plainObjects:s.plainObjects,strictDepth:typeof p.strictDepth=="boolean"?!!p.strictDepth:s.strictDepth,strictMerge:typeof p.strictMerge=="boolean"?!!p.strictMerge:s.strictMerge,strictNullHandling:typeof p.strictNullHandling=="boolean"?p.strictNullHandling:s.strictNullHandling,throwOnLimitExceeded:typeof p.throwOnLimitExceeded=="boolean"?p.throwOnLimitExceeded:!1}};return Ed=function(f,p){var m=d(p);if(f===""||f===null||typeof f>"u")return m.plainObjects?{__proto__:null}:{};for(var g=typeof f=="string"?l(f,m):f,v=m.plainObjects?{__proto__:null}:{},y=Object.keys(g),x=0;x",'"',"`"," ","\r",` -`," "],o=["{","}","|","\\","^","`"].concat(r),a=["'"].concat(o),l=["%","/","?",";","#"].concat(a),c=["/","?","#"],h=255,u=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},p={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=E2();function v(C,w,b){if(C&&typeof C=="object"&&C instanceof e)return C;var _=new e;return _.parse(C,w,b),_}e.prototype.parse=function(C,w,b){if(typeof C!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof C);var _=C.indexOf("?"),E=_!==-1&&_127?ie+="x":ie+=K[re];if(!ie.match(u)){var ge=V.slice(0,A),he=V.slice(A+1),fe=K.match(d);fe&&(ge.push(fe[1]),he.unshift(fe[2])),he.length&&(k="/"+he.join(".")+k),this.hostname=ge.join(".");break}}}this.hostname.length>h?this.hostname="":this.hostname=this.hostname.toLowerCase(),$||(this.hostname=i.toASCII(this.hostname));var Y=this.port?":"+this.port:"",W=this.hostname||"";this.host=W+Y,this.href+=this.host,$&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),k[0]!=="/"&&(k="/"+k))}if(!f[X])for(var A=0,j=a.length;A0?b.host.split("@"):!1;ie&&(b.auth=ie.shift(),b.hostname=ie.shift(),b.host=b.hostname)}return b.search=C.search,b.query=C.query,(b.pathname!==null||b.search!==null)&&(b.path=(b.pathname?b.pathname:"")+(b.search?b.search:"")),b.href=b.format(),b}if(!V.length)return b.pathname=null,b.search?b.path="/"+b.search:b.path=null,b.href=b.format(),b;for(var re=V.slice(-1)[0],pe=(b.host||C.host||V.length>1)&&(re==="."||re==="..")||re==="",ge=0,he=V.length;he>=0;he--)re=V[he],re==="."?V.splice(he,1):re===".."?(V.splice(he,1),ge++):ge&&(V.splice(he,1),ge--);if(!L&&!$)for(;ge--;ge)V.unshift("..");L&&V[0]!==""&&(!V[0]||V[0].charAt(0)!=="/")&&V.unshift(""),pe&&V.join("/").substr(-1)!=="/"&&V.push("");var fe=V[0]===""||V[0]&&V[0].charAt(0)==="/";if(K){b.hostname=fe?"":V.length?V.shift():"",b.host=b.hostname;var ie=b.host&&b.host.indexOf("@")>0?b.host.split("@"):!1;ie&&(b.auth=ie.shift(),b.hostname=ie.shift(),b.host=b.hostname)}return L=L||b.host&&V.length,L&&!fe&&V.unshift(""),V.length>0?b.pathname=V.join("/"):(b.pathname=null,b.path=null),(b.pathname!==null||b.search!==null)&&(b.path=(b.pathname?b.pathname:"")+(b.search?b.search:"")),b.auth=C.auth||b.auth,b.slashes=b.slashes||C.slashes,b.href=b.format(),b},e.prototype.parseHost=function(){var C=this.host,w=s.exec(C);w&&(w=w[0],w!==":"&&(this.port=w.substr(1)),C=C.substr(0,C.length-w.length)),C&&(this.hostname=C)},Lr.parse=v,Lr.resolve=x,Lr.resolveObject=M,Lr.format=y,Lr.Url=e,Lr}I2();const L0={};function ht(i,e,t=3){if(L0[e])return;let s=new Error().stack;typeof s>"u"?console.warn("PixiJS Deprecation Warning: ",`${e} -Deprecated since v${i}`):(s=s.split(` -`).splice(t).join(` -`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${e} -Deprecated since v${i}`),console.warn(s),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${e} -Deprecated since v${i}`),console.warn(s))),L0[e]=!0}function yi(i){if(typeof i!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(i)}`)}function Ra(i){return i.split("?")[0].split("#")[0]}function R2(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function P2(i,e,t){return i.replace(new RegExp(R2(e),"g"),t)}function k2(i,e){let t="",s=0,n=-1,r=0,o=-1;for(let a=0;a<=i.length;++a){if(a2){const l=t.lastIndexOf("/");if(l!==t.length-1){l===-1?(t="",s=0):(t=t.slice(0,l),s=t.length-1-t.lastIndexOf("/")),n=a,r=0;continue}}else if(t.length===2||t.length===1){t="",s=0,n=a,r=0;continue}}}else t.length>0?t+=`/${i.slice(n+1,a)}`:t=i.slice(n+1,a),s=a-n-1;n=a,r=0}else o===46&&r!==-1?++r:r=-1}return t}const ts={toPosix(i){return P2(i,"\\","/")},isUrl(i){return/^https?:/.test(this.toPosix(i))},isDataUrl(i){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(i)},isBlobUrl(i){return i.startsWith("blob:")},hasProtocol(i){return/^[^/:]+:/.test(this.toPosix(i))},getProtocol(i){yi(i),i=this.toPosix(i);const e=/^file:\/\/\//.exec(i);if(e)return e[0];const t=/^[^/:]+:\/{0,2}/.exec(i);return t?t[0]:""},toAbsolute(i,e,t){if(yi(i),this.isDataUrl(i)||this.isBlobUrl(i))return i;const s=Ra(this.toPosix(e??Le.ADAPTER.getBaseUrl())),n=Ra(this.toPosix(t??this.rootname(s)));return i=this.toPosix(i),i.startsWith("/")?ts.join(n,i.slice(1)):this.isAbsolute(i)?i:this.join(s,i)},normalize(i){if(yi(i),i.length===0)return".";if(this.isDataUrl(i)||this.isBlobUrl(i))return i;i=this.toPosix(i);let e="";const t=i.startsWith("/");this.hasProtocol(i)&&(e=this.rootname(i),i=i.slice(e.length));const s=i.endsWith("/");return i=k2(i),i.length>0&&s&&(i+="/"),t?`/${i}`:e+i},isAbsolute(i){return yi(i),i=this.toPosix(i),this.hasProtocol(i)?!0:i.startsWith("/")},join(...i){if(i.length===0)return".";let e;for(let t=0;t0)if(e===void 0)e=s;else{const n=i[t-1]??"";this.joinExtensions.includes(this.extname(n).toLowerCase())?e+=`/../${s}`:e+=`/${s}`}}return e===void 0?".":this.normalize(e)},dirname(i){if(yi(i),i.length===0)return".";i=this.toPosix(i);let e=i.charCodeAt(0);const t=e===47;let s=-1,n=!0;const r=this.getProtocol(i),o=i;i=i.slice(r.length);for(let a=i.length-1;a>=1;--a)if(e=i.charCodeAt(a),e===47){if(!n){s=a;break}}else n=!1;return s===-1?t?"/":this.isUrl(o)?r+i:r:t&&s===1?"//":r+i.slice(0,s)},rootname(i){yi(i),i=this.toPosix(i);let e="";if(i.startsWith("/")?e="/":e=this.getProtocol(i),this.isUrl(i)){const t=i.indexOf("/",e.length);t!==-1?e=i.slice(0,t):e=i,e.endsWith("/")||(e+="/")}return e},basename(i,e){yi(i),e&&yi(e),i=Ra(this.toPosix(i));let t=0,s=-1,n=!0,r;if(e!==void 0&&e.length>0&&e.length<=i.length){if(e.length===i.length&&e===i)return"";let o=e.length-1,a=-1;for(r=i.length-1;r>=0;--r){const l=i.charCodeAt(r);if(l===47){if(!n){t=r+1;break}}else a===-1&&(n=!1,a=r+1),o>=0&&(l===e.charCodeAt(o)?--o===-1&&(s=r):(o=-1,s=a))}return t===s?s=a:s===-1&&(s=i.length),i.slice(t,s)}for(r=i.length-1;r>=0;--r)if(i.charCodeAt(r)===47){if(!n){t=r+1;break}}else s===-1&&(n=!1,s=r+1);return s===-1?"":i.slice(t,s)},extname(i){yi(i),i=Ra(this.toPosix(i));let e=-1,t=0,s=-1,n=!0,r=0;for(let o=i.length-1;o>=0;--o){const a=i.charCodeAt(o);if(a===47){if(!n){t=o+1;break}continue}s===-1&&(n=!1,s=o+1),a===46?e===-1?e=o:r!==1&&(r=1):e!==-1&&(r=-1)}return e===-1||s===-1||r===0||r===1&&e===s-1&&e===t+1?"":i.slice(e,s)},parse(i){yi(i);const e={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return e;i=Ra(this.toPosix(i));let t=i.charCodeAt(0);const s=this.isAbsolute(i);let n;e.root=this.rootname(i),s||this.hasProtocol(i)?n=1:n=0;let r=-1,o=0,a=-1,l=!0,c=i.length-1,h=0;for(;c>=n;--c){if(t=i.charCodeAt(c),t===47){if(!l){o=c+1;break}continue}a===-1&&(l=!1,a=c+1),t===46?r===-1?r=c:h!==1&&(h=1):r!==-1&&(h=-1)}return r===-1||a===-1||h===0||h===1&&r===a-1&&r===o+1?a!==-1&&(o===0&&s?e.base=e.name=i.slice(1,a):e.base=e.name=i.slice(o,a)):(o===0&&s?(e.name=i.slice(1,r),e.base=i.slice(1,a)):(e.name=i.slice(o,r),e.base=i.slice(o,a)),e.ext=i.slice(r,a)),e.dir=this.dirname(i),e},sep:"/",delimiter:":",joinExtensions:[".html"]};let Rd;async function F2(){return Rd??(Rd=(async()=>{var r;const i=document.createElement("canvas").getContext("webgl");if(!i)return bs.UNPACK;const e=await new Promise(o=>{const a=document.createElement("video");a.onloadeddata=()=>o(a),a.onerror=()=>o(null),a.autoplay=!1,a.crossOrigin="anonymous",a.preload="auto",a.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",a.load()});if(!e)return bs.UNPACK;const t=i.createTexture();i.bindTexture(i.TEXTURE_2D,t);const s=i.createFramebuffer();i.bindFramebuffer(i.FRAMEBUFFER,s),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,t,0),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.NONE),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e);const n=new Uint8Array(4);return i.readPixels(0,0,1,1,i.RGBA,i.UNSIGNED_BYTE,n),i.deleteFramebuffer(s),i.deleteTexture(t),(r=i.getExtension("WEBGL_lose_context"))==null||r.loseContext(),n[0]<=n[3]?bs.PMA:bs.UNPACK})()),Rd}let Pd;function O2(){return typeof Pd>"u"&&(Pd=(function(){var e;const i={stencil:!0,failIfMajorPerformanceCaveat:Le.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!Le.ADAPTER.getWebGLRenderingContext())return!1;const t=Le.ADAPTER.createCanvas();let s=t.getContext("webgl",i)||t.getContext("experimental-webgl",i);const n=!!((e=s==null?void 0:s.getContextAttributes())!=null&&e.stencil);if(s){const r=s.getExtension("WEBGL_lose_context");r&&r.loseContext()}return s=null,n}catch{return!1}})()),Pd}var L2={grad:.9,turn:360,rad:360/(2*Math.PI)},yn=function(i){return typeof i=="string"?i.length>0:typeof i=="number"},xs=function(i,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*i)/t+0},mi=function(i,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),i>t?t:i>e?i:e},sb=function(i){return(i=isFinite(i)?i%360:0)>0?i:i+360},B0=function(i){return{r:mi(i.r,0,255),g:mi(i.g,0,255),b:mi(i.b,0,255),a:mi(i.a)}},kd=function(i){return{r:xs(i.r),g:xs(i.g),b:xs(i.b),a:xs(i.a,3)}},B2=/^#([0-9a-f]{3,8})$/i,Wl=function(i){var e=i.toString(16);return e.length<2?"0"+e:e},ib=function(i){var e=i.r,t=i.g,s=i.b,n=i.a,r=Math.max(e,t,s),o=r-Math.min(e,t,s),a=o?r===e?(t-s)/o:r===t?2+(s-e)/o:4+(e-t)/o:0;return{h:60*(a<0?a+6:a),s:r?o/r*100:0,v:r/255*100,a:n}},nb=function(i){var e=i.h,t=i.s,s=i.v,n=i.a;e=e/360*6,t/=100,s/=100;var r=Math.floor(e),o=s*(1-t),a=s*(1-(e-r)*t),l=s*(1-(1-e+r)*t),c=r%6;return{r:255*[s,a,o,o,l,s][c],g:255*[l,s,s,a,o,o][c],b:255*[o,o,l,s,s,a][c],a:n}},N0=function(i){return{h:sb(i.h),s:mi(i.s,0,100),l:mi(i.l,0,100),a:mi(i.a)}},D0=function(i){return{h:xs(i.h),s:xs(i.s),l:xs(i.l),a:xs(i.a,3)}},U0=function(i){return nb((t=(e=i).s,{h:e.h,s:(t*=((s=e.l)<50?s:100-s)/100)>0?2*t/(s+t)*100:0,v:s+t,a:e.a}));var e,t,s},Ja=function(i){return{h:(e=ib(i)).h,s:(n=(200-(t=e.s))*(s=e.v)/100)>0&&n<200?t*s/100/(n<=100?n:200-n)*100:0,l:n/2,a:e.a};var e,t,s,n},N2=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,D2=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,U2=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,$2=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ff={string:[[function(i){var e=B2.exec(i);return e?(i=e[1]).length<=4?{r:parseInt(i[0]+i[0],16),g:parseInt(i[1]+i[1],16),b:parseInt(i[2]+i[2],16),a:i.length===4?xs(parseInt(i[3]+i[3],16)/255,2):1}:i.length===6||i.length===8?{r:parseInt(i.substr(0,2),16),g:parseInt(i.substr(2,2),16),b:parseInt(i.substr(4,2),16),a:i.length===8?xs(parseInt(i.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(i){var e=U2.exec(i)||$2.exec(i);return e?e[2]!==e[4]||e[4]!==e[6]?null:B0({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(i){var e=N2.exec(i)||D2.exec(i);if(!e)return null;var t,s,n=N0({h:(t=e[1],s=e[2],s===void 0&&(s="deg"),Number(t)*(L2[s]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return U0(n)},"hsl"]],object:[[function(i){var e=i.r,t=i.g,s=i.b,n=i.a,r=n===void 0?1:n;return yn(e)&&yn(t)&&yn(s)?B0({r:Number(e),g:Number(t),b:Number(s),a:Number(r)}):null},"rgb"],[function(i){var e=i.h,t=i.s,s=i.l,n=i.a,r=n===void 0?1:n;if(!yn(e)||!yn(t)||!yn(s))return null;var o=N0({h:Number(e),s:Number(t),l:Number(s),a:Number(r)});return U0(o)},"hsl"],[function(i){var e=i.h,t=i.s,s=i.v,n=i.a,r=n===void 0?1:n;if(!yn(e)||!yn(t)||!yn(s))return null;var o=(function(a){return{h:sb(a.h),s:mi(a.s,0,100),v:mi(a.v,0,100),a:mi(a.a)}})({h:Number(e),s:Number(t),v:Number(s),a:Number(r)});return nb(o)},"hsv"]]},$0=function(i,e){for(var t=0;t=.5},i.prototype.toHex=function(){return e=kd(this.rgba),t=e.r,s=e.g,n=e.b,o=(r=e.a)<1?Wl(xs(255*r)):"","#"+Wl(t)+Wl(s)+Wl(n)+o;var e,t,s,n,r,o},i.prototype.toRgb=function(){return kd(this.rgba)},i.prototype.toRgbString=function(){return e=kd(this.rgba),t=e.r,s=e.g,n=e.b,(r=e.a)<1?"rgba("+t+", "+s+", "+n+", "+r+")":"rgb("+t+", "+s+", "+n+")";var e,t,s,n,r},i.prototype.toHsl=function(){return D0(Ja(this.rgba))},i.prototype.toHslString=function(){return e=D0(Ja(this.rgba)),t=e.h,s=e.s,n=e.l,(r=e.a)<1?"hsla("+t+", "+s+"%, "+n+"%, "+r+")":"hsl("+t+", "+s+"%, "+n+"%)";var e,t,s,n,r},i.prototype.toHsv=function(){return e=ib(this.rgba),{h:xs(e.h),s:xs(e.s),v:xs(e.v),a:xs(e.a,3)};var e},i.prototype.invert=function(){return Ui({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},i.prototype.saturate=function(e){return e===void 0&&(e=.1),Ui(Fd(this.rgba,e))},i.prototype.desaturate=function(e){return e===void 0&&(e=.1),Ui(Fd(this.rgba,-e))},i.prototype.grayscale=function(){return Ui(Fd(this.rgba,-1))},i.prototype.lighten=function(e){return e===void 0&&(e=.1),Ui(X0(this.rgba,e))},i.prototype.darken=function(e){return e===void 0&&(e=.1),Ui(X0(this.rgba,-e))},i.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},i.prototype.alpha=function(e){return typeof e=="number"?Ui({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):xs(this.rgba.a,3);var t},i.prototype.hue=function(e){var t=Ja(this.rgba);return typeof e=="number"?Ui({h:e,s:t.s,l:t.l,a:t.a}):xs(t.h)},i.prototype.isEqual=function(e){return this.toHex()===Ui(e).toHex()},i})(),Ui=function(i){return i instanceof Of?i:new Of(i)},V0=[],V2=function(i){i.forEach(function(e){V0.indexOf(e)<0&&(e(Of,Ff),V0.push(e))})};function Y2(i,e){var t={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},s={};for(var n in t)s[t[n]]=n;var r={};i.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,l,c=s[this.toHex()];if(c)return c;if(o!=null&&o.closest){var h=this.toRgb(),u=1/0,d="black";if(!r.length)for(var f in t)r[f]=new i(t[f]).toRgb();for(var p in t){var m=(a=h,l=r[p],Math.pow(a.r-l.r,2)+Math.pow(a.g-l.g,2)+Math.pow(a.b-l.b,2));mn===t[r]);if(e!==null&&t!==null){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(o=>e[o]===t[o])}return e===t}toRgba(){const[e,t,s,n]=this._components;return{r:e,g:t,b:s,a:n}}toRgb(){const[e,t,s]=this._components;return{r:e,g:t,b:s}}toRgbaString(){const[e,t,s]=this.toUint8RgbArray();return`rgba(${e},${t},${s},${this.alpha})`}toUint8RgbArray(e){const[t,s,n]=this._components;return e=e??[],e[0]=Math.round(t*255),e[1]=Math.round(s*255),e[2]=Math.round(n*255),e}toRgbArray(e){e=e??[];const[t,s,n]=this._components;return e[0]=t,e[1]=s,e[2]=n,e}toNumber(){return this._int}toLittleEndianNumber(){const e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(e){const[t,s,n,r]=Ac.temp.setValue(e)._components;return this._components[0]*=t,this._components[1]*=s,this._components[2]*=n,this._components[3]*=r,this.refreshInt(),this._value=null,this}premultiply(e,t=!0){return t&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this.refreshInt(),this._value=null,this}toPremultiplied(e,t=!0){if(e===1)return(255<<24)+this._int;if(e===0)return t?0:this._int;let s=this._int>>16&255,n=this._int>>8&255,r=this._int&255;return t&&(s=s*e+.5|0,n=n*e+.5|0,r=r*e+.5|0),(e*255<<24)+(s<<16)+(n<<8)+r}toHex(){const e=this._int.toString(16);return`#${"000000".substring(0,6-e.length)+e}`}toHexa(){const e=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-e.length)+e}setAlpha(e){return this._components[3]=this._clamp(e),this}round(e){const[t,s,n]=this._components;return this._components[0]=Math.round(t*e)/e,this._components[1]=Math.round(s*e)/e,this._components[2]=Math.round(n*e)/e,this.refreshInt(),this._value=null,this}toArray(e){e=e??[];const[t,s,n,r]=this._components;return e[0]=t,e[1]=s,e[2]=n,e[3]=r,e}normalize(e){let t,s,n,r;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){const o=e;t=(o>>16&255)/255,s=(o>>8&255)/255,n=(o&255)/255,r=1}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[t,s,n,r=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[t,s,n,r=255]=e,t/=255,s/=255,n/=255,r/=255;else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){const a=Ac.HEX_PATTERN.exec(e);a&&(e=`#${a[2]}`)}const o=Ui(e);o.isValid()&&({r:t,g:s,b:n,a:r}=o.rgba,t/=255,s/=255,n/=255)}if(t!==void 0)this._components[0]=t,this._components[1]=s,this._components[2]=n,this._components[3]=r,this.refreshInt();else throw new Error(`Unable to convert color ${e}`)}refreshInt(){this._clamp(this._components);const[e,t,s]=this._components;this._int=(e*255<<16)+(t*255<<8)+(s*255|0)}_clamp(e,t=0,s=1){return typeof e=="number"?Math.min(Math.max(e,t),s):(e.forEach((n,r)=>{e[r]=Math.min(Math.max(n,t),s)}),e)}};Oo.shared=new Oo,Oo.temp=new Oo,Oo.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let Et=Oo;function G2(i){return ht("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),Et.shared.setValue(i).toHex()}function j2(i){return ht("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),Et.shared.setValue(i).toNumber()}function H2(){const i=[],e=[];for(let s=0;s<32;s++)i[s]=s,e[s]=s;i[He.NORMAL_NPM]=He.NORMAL,i[He.ADD_NPM]=He.ADD,i[He.SCREEN_NPM]=He.SCREEN,e[He.NORMAL]=He.NORMAL_NPM,e[He.ADD]=He.ADD_NPM,e[He.SCREEN]=He.SCREEN_NPM;const t=[];return t.push(e),t.push(i),t}const rb=H2();function ob(i,e){return rb[e?1:0][i]}function W2(i,e=null){const t=i*6;if(e=e||new Uint16Array(t),e.length!==t)throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${t}`);for(let s=0,n=0;s>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1}function Y0(i){return!(i&i-1)&&!!i}function G0(i){let e=(i>65535?1:0)<<4;i>>>=e;let t=(i>255?1:0)<<3;return i>>>=t,e|=t,t=(i>15?1:0)<<2,i>>>=t,e|=t,t=(i>3?1:0)<<1,i>>>=t,e|=t,e|i>>1}function Ko(i,e,t){const s=i.length;let n;if(e>=s||t===0)return;t=e+t>s?s-e:t;const r=s-t;for(n=e;n(i.Renderer="renderer",i.Application="application",i.RendererSystem="renderer-webgl-system",i.RendererPlugin="renderer-webgl-plugin",i.CanvasRendererSystem="renderer-canvas-system",i.CanvasRendererPlugin="renderer-canvas-plugin",i.Asset="asset",i.LoadParser="load-parser",i.ResolveParser="resolve-parser",i.CacheParser="cache-parser",i.DetectionParser="detection-parser",i))(ke||{});const Bf=i=>{if(typeof i=="function"||typeof i=="object"&&i.extension){if(!i.extension)throw new Error("Extension class must have an extension object");i={...typeof i.extension!="object"?{type:i.extension}:i.extension,ref:i}}if(typeof i=="object")i={...i};else throw new Error("Invalid extension type");return typeof i.type=="string"&&(i.type=[i.type]),i},q0=(i,e)=>Bf(i).priority??e,Xe={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...i){return i.map(Bf).forEach(e=>{e.type.forEach(t=>{var s,n;return(n=(s=this._removeHandlers)[t])==null?void 0:n.call(s,e)})}),this},add(...i){return i.map(Bf).forEach(e=>{e.type.forEach(t=>{var r,o;const s=this._addHandlers,n=this._queue;s[t]?(r=s[t])==null||r.call(s,e):(n[t]=n[t]||[],(o=n[t])==null||o.push(e))})}),this},handle(i,e,t){var o;const s=this._addHandlers,n=this._removeHandlers;if(s[i]||n[i])throw new Error(`Extension type ${i} already has a handler`);s[i]=e,n[i]=t;const r=this._queue;return r[i]&&((o=r[i])==null||o.forEach(a=>e(a)),delete r[i]),this},handleByMap(i,e){return this.handle(i,t=>{t.name&&(e[t.name]=t.ref)},t=>{t.name&&delete e[t.name]})},handleByList(i,e,t=-1){return this.handle(i,s=>{e.includes(s.ref)||(e.push(s.ref),e.sort((n,r)=>q0(r,t)-q0(n,t)))},s=>{const n=e.indexOf(s.ref);n!==-1&&e.splice(n,1)})}};class Nf{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(e){return this[`${e}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(e){switch(e){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}}const Q2=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(` -`);function eC(i){let e="";for(let t=0;t0&&(e+=` -else `),t=0;--s){const n=Df[s];if(n.test&&n.test(i,t))return new n(i,e)}throw new Error("Unrecognized source type to auto-detect Resource")}class Ri{constructor(e){this.items=[],this._name=e,this._aliasCount=0}emit(e,t,s,n,r,o,a,l){if(arguments.length>8)throw new Error("max arguments reached");const{name:c,items:h}=this;this._aliasCount++;for(let u=0,d=h.length;u0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this}remove(e){const t=this.items.indexOf(e);return t!==-1&&(this.ensureNonAliasedItems(),this.items.splice(t,1)),this}contains(e){return this.items.includes(e)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items.length=0,this._name=""}get empty(){return this.items.length===0}get name(){return this._name}}Object.defineProperties(Ri.prototype,{dispatch:{value:Ri.prototype.emit},run:{value:Ri.prototype.emit}});class vl{constructor(e=0,t=0){this._width=e,this._height=t,this.destroyed=!1,this.internal=!1,this.onResize=new Ri("setRealSize"),this.onUpdate=new Ri("update"),this.onError=new Ri("onError")}bind(e){this.onResize.add(e),this.onUpdate.add(e),this.onError.add(e),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(e){this.onResize.remove(e),this.onUpdate.remove(e),this.onError.remove(e)}resize(e,t){(e!==this._width||t!==this._height)&&(this._width=e,this._height=t,this.onResize.emit(e,t))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(e,t,s){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(e,t){return!1}}class ru extends vl{constructor(e,t){const{width:s,height:n}=t||{};if(!s||!n)throw new Error("BufferResource width or height invalid");super(s,n),this.data=e,this.unpackAlignment=t.unpackAlignment??4}upload(e,t,s){const n=e.gl;n.pixelStorei(n.UNPACK_ALIGNMENT,this.unpackAlignment),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.alphaMode===bs.UNPACK);const r=t.realWidth,o=t.realHeight;return s.width===r&&s.height===o?n.texSubImage2D(t.target,0,0,0,r,o,t.format,s.type,this.data):(s.width=r,s.height=o,n.texImage2D(t.target,0,s.internalFormat,r,o,0,t.format,s.type,this.data)),!0}dispose(){this.data=null}static test(e){return e===null||e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}}const sC={scaleMode:Ci.NEAREST,alphaMode:bs.NPM},Uf=class Lo extends El{constructor(e=null,t=null){super(),t=Object.assign({},Lo.defaultOptions,t);const{alphaMode:s,mipmap:n,anisotropicLevel:r,scaleMode:o,width:a,height:l,wrapMode:c,format:h,type:u,target:d,resolution:f,resourceOptions:p}=t;e&&!(e instanceof vl)&&(e=lb(e,p),e.internal=!0),this.resolution=f||Le.RESOLUTION,this.width=Math.round((a||0)*this.resolution)/this.resolution,this.height=Math.round((l||0)*this.resolution)/this.resolution,this._mipmap=n,this.anisotropicLevel=r,this._wrapMode=c,this._scaleMode=o,this.format=h,this.type=u,this.target=d,this.alphaMode=s,this.uid=co(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=a>0&&l>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(e)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)}setStyle(e,t){let s;return e!==void 0&&e!==this.scaleMode&&(this.scaleMode=e,s=!0),t!==void 0&&t!==this.mipmap&&(this.mipmap=t,s=!0),s&&this.dirtyStyleId++,this}setSize(e,t,s){return s=s||this.resolution,this.setRealSize(e*s,t*s,s)}setRealSize(e,t,s){return this.resolution=s||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(t)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=Y0(this.realWidth)&&Y0(this.realHeight)}setResolution(e){const t=this.resolution;return t===e?this:(this.resolution=e,this.valid&&(this.width=Math.round(this.width*t)/e,this.height=Math.round(this.height*t)/e,this.emit("update",this)),this._refreshPOT(),this)}setResource(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}onError(e){this.emit("error",this,e)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Kn[this.cacheId],delete $i[this.cacheId],this.cacheId=null),this.valid=!1,this.dispose(),Lo.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(e,t,s=Le.STRICT_TEXTURE_CACHE){const n=typeof e=="string";let r=null;if(n)r=e;else{if(!e._pixiId){const a=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e._pixiId=`${a}_${co()}`}r=e._pixiId}let o=Kn[r];if(n&&s&&!o)throw new Error(`The cacheId "${r}" does not exist in BaseTextureCache.`);return o||(o=new Lo(e,t),o.cacheId=r,Lo.addToCache(o,r)),o}static fromBuffer(e,t,s,n){e=e||new Float32Array(t*s*4);const r=new ru(e,{width:t,height:s,...n==null?void 0:n.resourceOptions});let o,a;return e instanceof Float32Array?(o=_e.RGBA,a=$e.FLOAT):e instanceof Int32Array?(o=_e.RGBA_INTEGER,a=$e.INT):e instanceof Uint32Array?(o=_e.RGBA_INTEGER,a=$e.UNSIGNED_INT):e instanceof Int16Array?(o=_e.RGBA_INTEGER,a=$e.SHORT):e instanceof Uint16Array?(o=_e.RGBA_INTEGER,a=$e.UNSIGNED_SHORT):e instanceof Int8Array?(o=_e.RGBA,a=$e.BYTE):(o=_e.RGBA,a=$e.UNSIGNED_BYTE),r.internal=!0,new Lo(r,Object.assign({},sC,{type:a,format:o},n))}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),Kn[t]&&Kn[t]!==e&&console.warn(`BaseTexture added to the cache with an id [${t}] that already had an entry`),Kn[t]=e)}static removeFromCache(e){if(typeof e=="string"){const t=Kn[e];if(t){const s=t.textureCacheIds.indexOf(e);return s>-1&&t.textureCacheIds.splice(s,1),delete Kn[e],t}}else if(e!=null&&e.textureCacheIds){for(let t=0;t1){for(let u=0;u(i[i.POLY=0]="POLY",i[i.RECT=1]="RECT",i[i.CIRC=2]="CIRC",i[i.ELIP=3]="ELIP",i[i.RREC=4]="RREC",i))(Cs||{});class vt{constructor(e=0,t=0){this.x=0,this.y=0,this.x=e,this.y=t}clone(){return new vt(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,t=e){return this.x=e,this.y=t,this}}vt.prototype.toString=function(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`};const zl=[new vt,new vt,new vt,new vt];class ot{constructor(e=0,t=0,s=0,n=0){this.x=Number(e),this.y=Number(t),this.width=Number(s),this.height=Number(n),this.type=Cs.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new ot(0,0,0,0)}clone(){return new ot(this.x,this.y,this.width,this.height)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}contains(e,t){return this.width<=0||this.height<=0?!1:e>=this.x&&e=this.y&&te.right?e.right:this.right)<=_)return!1;const E=this.ye.bottom?e.bottom:this.bottom)>E}const s=this.left,n=this.right,r=this.top,o=this.bottom;if(n<=s||o<=r)return!1;const a=zl[0].set(e.left,e.top),l=zl[1].set(e.left,e.bottom),c=zl[2].set(e.right,e.top),h=zl[3].set(e.right,e.bottom);if(c.x<=a.x||l.y<=a.y)return!1;const u=Math.sign(t.a*t.d-t.b*t.c);if(u===0||(t.apply(a,a),t.apply(l,l),t.apply(c,c),t.apply(h,h),Math.max(a.x,l.x,c.x,h.x)<=s||Math.min(a.x,l.x,c.x,h.x)>=n||Math.max(a.y,l.y,c.y,h.y)<=r||Math.min(a.y,l.y,c.y,h.y)>=o))return!1;const d=u*(l.y-a.y),f=u*(a.x-l.x),p=d*s+f*r,m=d*n+f*r,g=d*s+f*o,v=d*n+f*o;if(Math.max(p,m,g,v)<=d*a.x+f*a.y||Math.min(p,m,g,v)>=d*h.x+f*h.y)return!1;const y=u*(a.y-c.y),x=u*(c.x-a.x),M=y*s+x*r,C=y*n+x*r,w=y*s+x*o,b=y*n+x*o;return!(Math.max(M,C,w,b)<=y*a.x+x*a.y||Math.min(M,C,w,b)>=y*h.x+x*h.y)}pad(e=0,t=e){return this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this}fit(e){const t=Math.max(this.x,e.x),s=Math.min(this.x+this.width,e.x+e.width),n=Math.max(this.y,e.y),r=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(s-t,0),this.y=n,this.height=Math.max(r-n,0),this}ceil(e=1,t=.001){const s=Math.ceil((this.x+this.width-t)*e)/e,n=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=s-this.x,this.height=n-this.y,this}enlarge(e){const t=Math.min(this.x,e.x),s=Math.max(this.x+this.width,e.x+e.width),n=Math.min(this.y,e.y),r=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=s-t,this.y=n,this.height=r-n,this}}ot.prototype.toString=function(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class ou{constructor(e=0,t=0,s=0){this.x=e,this.y=t,this.radius=s,this.type=Cs.CIRC}clone(){return new ou(this.x,this.y,this.radius)}contains(e,t){if(this.radius<=0)return!1;const s=this.radius*this.radius;let n=this.x-e,r=this.y-t;return n*=n,r*=r,n+r<=s}getBounds(){return new ot(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}}ou.prototype.toString=function(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`};class au{constructor(e=0,t=0,s=0,n=0){this.x=e,this.y=t,this.width=s,this.height=n,this.type=Cs.ELIP}clone(){return new au(this.x,this.y,this.width,this.height)}contains(e,t){if(this.width<=0||this.height<=0)return!1;let s=(e-this.x)/this.width,n=(t-this.y)/this.height;return s*=s,n*=n,s+n<=1}getBounds(){return new ot(this.x-this.width,this.y-this.height,this.width,this.height)}}au.prototype.toString=function(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class no{constructor(...e){let t=Array.isArray(e[0])?e[0]:e;if(typeof t[0]!="number"){const s=[];for(let n=0,r=t.length;nt!=h>t&&e<(c-a)*((t-l)/(h-l))+a&&(s=!s)}return s}}no.prototype.toString=function(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((i,e)=>`${i}, ${e}`,"")}]`};class lu{constructor(e=0,t=0,s=0,n=0,r=20){this.x=e,this.y=t,this.width=s,this.height=n,this.radius=r,this.type=Cs.RREC}clone(){return new lu(this.x,this.y,this.width,this.height,this.radius)}contains(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){const s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+s&&t<=this.y+this.height-s||e>=this.x+s&&e<=this.x+this.width-s)return!0;let n=e-(this.x+s),r=t-(this.y+s);const o=s*s;if(n*n+r*r<=o||(n=e-(this.x+this.width-s),n*n+r*r<=o)||(r=t-(this.y+this.height-s),n*n+r*r<=o)||(n=e-(this.x+s),n*n+r*r<=o))return!0}return!1}}lu.prototype.toString=function(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`};class Ot{constructor(e=1,t=0,s=0,n=1,r=0,o=0){this.array=null,this.a=e,this.b=t,this.c=s,this.d=n,this.tx=r,this.ty=o}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,t,s,n,r,o){return this.a=e,this.b=t,this.c=s,this.d=n,this.tx=r,this.ty=o,this}toArray(e,t){this.array||(this.array=new Float32Array(9));const s=t||this.array;return e?(s[0]=this.a,s[1]=this.b,s[2]=0,s[3]=this.c,s[4]=this.d,s[5]=0,s[6]=this.tx,s[7]=this.ty,s[8]=1):(s[0]=this.a,s[1]=this.c,s[2]=this.tx,s[3]=this.b,s[4]=this.d,s[5]=this.ty,s[6]=0,s[7]=0,s[8]=1),s}apply(e,t){t=t||new vt;const s=e.x,n=e.y;return t.x=this.a*s+this.c*n+this.tx,t.y=this.b*s+this.d*n+this.ty,t}applyInverse(e,t){t=t||new vt;const s=1/(this.a*this.d+this.c*-this.b),n=e.x,r=e.y;return t.x=this.d*s*n+-this.c*s*r+(this.ty*this.c-this.tx*this.d)*s,t.y=this.a*s*r+-this.b*s*n+(-this.ty*this.a+this.tx*this.b)*s,t}translate(e,t){return this.tx+=e,this.ty+=t,this}scale(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this}rotate(e){const t=Math.cos(e),s=Math.sin(e),n=this.a,r=this.c,o=this.tx;return this.a=n*t-this.b*s,this.b=n*s+this.b*t,this.c=r*t-this.d*s,this.d=r*s+this.d*t,this.tx=o*t-this.ty*s,this.ty=o*s+this.ty*t,this}append(e){const t=this.a,s=this.b,n=this.c,r=this.d;return this.a=e.a*t+e.b*n,this.b=e.a*s+e.b*r,this.c=e.c*t+e.d*n,this.d=e.c*s+e.d*r,this.tx=e.tx*t+e.ty*n+this.tx,this.ty=e.tx*s+e.ty*r+this.ty,this}setTransform(e,t,s,n,r,o,a,l,c){return this.a=Math.cos(a+c)*r,this.b=Math.sin(a+c)*r,this.c=-Math.sin(a-l)*o,this.d=Math.cos(a-l)*o,this.tx=e-(s*this.a+n*this.c),this.ty=t-(s*this.b+n*this.d),this}prepend(e){const t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const s=this.a,n=this.c;this.a=s*e.a+this.b*e.c,this.b=s*e.b+this.b*e.d,this.c=n*e.a+this.d*e.c,this.d=n*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this}decompose(e){const t=this.a,s=this.b,n=this.c,r=this.d,o=e.pivot,a=-Math.atan2(-n,r),l=Math.atan2(s,t),c=Math.abs(a+l);return c<1e-5||Math.abs(sh-c)<1e-5?(e.rotation=l,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=a,e.skew.y=l),e.scale.x=Math.sqrt(t*t+s*s),e.scale.y=Math.sqrt(n*n+r*r),e.position.x=this.tx+(o.x*t+o.y*n),e.position.y=this.ty+(o.x*s+o.y*r),e}invert(){const e=this.a,t=this.b,s=this.c,n=this.d,r=this.tx,o=e*n-t*s;return this.a=n/o,this.b=-t/o,this.c=-s/o,this.d=e/o,this.tx=(s*this.ty-n*r)/o,this.ty=-(e*this.ty-t*r)/o,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new Ot;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}static get IDENTITY(){return new Ot}static get TEMP_MATRIX(){return new Ot}}Ot.prototype.toString=function(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`};const Xr=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Vr=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Yr=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Gr=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Xf=[],hb=[],ql=Math.sign;function hC(){for(let i=0;i<16;i++){const e=[];Xf.push(e);for(let t=0;t<16;t++){const s=ql(Xr[i]*Xr[t]+Yr[i]*Vr[t]),n=ql(Vr[i]*Xr[t]+Gr[i]*Vr[t]),r=ql(Xr[i]*Yr[t]+Yr[i]*Gr[t]),o=ql(Vr[i]*Yr[t]+Gr[i]*Gr[t]);for(let a=0;a<16;a++)if(Xr[a]===s&&Vr[a]===n&&Yr[a]===r&&Gr[a]===o){e.push(a);break}}}for(let i=0;i<16;i++){const e=new Ot;e.set(Xr[i],Vr[i],Yr[i],Gr[i],0,0),hb.push(e)}}hC();const Wt={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:i=>Xr[i],uY:i=>Vr[i],vX:i=>Yr[i],vY:i=>Gr[i],inv:i=>i&8?i&15:-i&7,add:(i,e)=>Xf[i][e],sub:(i,e)=>Xf[i][Wt.inv(e)],rotate180:i=>i^4,isVertical:i=>(i&3)===2,byDirection:(i,e)=>Math.abs(i)*2<=Math.abs(e)?e>=0?Wt.S:Wt.N:Math.abs(e)*2<=Math.abs(i)?i>0?Wt.E:Wt.W:e>0?i>0?Wt.SE:Wt.SW:i>0?Wt.NE:Wt.NW,matrixAppendRotationInv:(i,e,t=0,s=0)=>{const n=hb[Wt.inv(e)];n.tx=t,n.ty=s,i.append(n)}};class Rn{constructor(e,t,s=0,n=0){this._x=s,this._y=n,this.cb=e,this.scope=t}clone(e=this.cb,t=this.scope){return new Rn(e,t,this._x,this._y)}set(e=0,t=e){return(this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this.cb.call(this.scope)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))}}Rn.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=${this.scope}]`};const Vf=class{constructor(){this.worldTransform=new Ot,this.localTransform=new Ot,this.position=new Rn(this.onChange,this,0,0),this.scale=new Rn(this.onChange,this,1,1),this.pivot=new Rn(this.onChange,this,0,0),this.skew=new Rn(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}updateLocalTransform(){const i=this.localTransform;this._localID!==this._currentLocalID&&(i.a=this._cx*this.scale.x,i.b=this._sx*this.scale.x,i.c=this._cy*this.scale.y,i.d=this._sy*this.scale.y,i.tx=this.position.x-(this.pivot.x*i.a+this.pivot.y*i.c),i.ty=this.position.y-(this.pivot.x*i.b+this.pivot.y*i.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(i){const e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==i._worldID){const t=i.worldTransform,s=this.worldTransform;s.a=e.a*t.a+e.b*t.c,s.b=e.a*t.b+e.b*t.d,s.c=e.c*t.a+e.d*t.c,s.d=e.c*t.b+e.d*t.d,s.tx=e.tx*t.a+e.ty*t.c+t.tx,s.ty=e.tx*t.b+e.ty*t.d+t.ty,this._parentID=i._worldID,this._worldID++}}setFromMatrix(i){i.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(i){this._rotation!==i&&(this._rotation=i,this.updateSkew())}};Vf.IDENTITY=new Vf;let up=Vf;up.prototype.toString=function(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`};var uC=`varying vec2 vTextureCoord; - -uniform sampler2D uSampler; - -void main(void){ - gl_FragColor *= texture2D(uSampler, vTextureCoord); -}`,dC=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void){ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -} -`;function Z0(i,e,t){const s=i.createShader(e);return i.shaderSource(s,t),i.compileShader(s),s}function Xd(i){const e=new Array(i);for(let t=0;ti.type==="float"&&i.size===1&&!i.isArray,code:i=>` - if(uv["${i}"] !== ud["${i}"].value) - { - ud["${i}"].value = uv["${i}"] - gl.uniform1f(ud["${i}"].location, uv["${i}"]) - } - `},{test:(i,e)=>(i.type==="sampler2D"||i.type==="samplerCube"||i.type==="sampler2DArray")&&i.size===1&&!i.isArray&&(e==null||e.castToBaseTexture!==void 0),code:i=>`t = syncData.textureCount++; - - renderer.texture.bind(uv["${i}"], t); - - if(ud["${i}"].value !== t) - { - ud["${i}"].value = t; - gl.uniform1i(ud["${i}"].location, t); -; // eslint-disable-line max-len - }`},{test:(i,e)=>i.type==="mat3"&&i.size===1&&!i.isArray&&e.a!==void 0,code:i=>` - gl.uniformMatrix3fv(ud["${i}"].location, false, uv["${i}"].toArray(true)); - `,codeUbo:i=>` - var ${i}_matrix = uv.${i}.toArray(true); - - data[offset] = ${i}_matrix[0]; - data[offset+1] = ${i}_matrix[1]; - data[offset+2] = ${i}_matrix[2]; - - data[offset + 4] = ${i}_matrix[3]; - data[offset + 5] = ${i}_matrix[4]; - data[offset + 6] = ${i}_matrix[5]; - - data[offset + 8] = ${i}_matrix[6]; - data[offset + 9] = ${i}_matrix[7]; - data[offset + 10] = ${i}_matrix[8]; - `},{test:(i,e)=>i.type==="vec2"&&i.size===1&&!i.isArray&&e.x!==void 0,code:i=>` - cv = ud["${i}"].value; - v = uv["${i}"]; - - if(cv[0] !== v.x || cv[1] !== v.y) - { - cv[0] = v.x; - cv[1] = v.y; - gl.uniform2f(ud["${i}"].location, v.x, v.y); - }`,codeUbo:i=>` - v = uv.${i}; - - data[offset] = v.x; - data[offset+1] = v.y; - `},{test:i=>i.type==="vec2"&&i.size===1&&!i.isArray,code:i=>` - cv = ud["${i}"].value; - v = uv["${i}"]; - - if(cv[0] !== v[0] || cv[1] !== v[1]) - { - cv[0] = v[0]; - cv[1] = v[1]; - gl.uniform2f(ud["${i}"].location, v[0], v[1]); - } - `},{test:(i,e)=>i.type==="vec4"&&i.size===1&&!i.isArray&&e.width!==void 0,code:i=>` - cv = ud["${i}"].value; - v = uv["${i}"]; - - if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) - { - cv[0] = v.x; - cv[1] = v.y; - cv[2] = v.width; - cv[3] = v.height; - gl.uniform4f(ud["${i}"].location, v.x, v.y, v.width, v.height) - }`,codeUbo:i=>` - v = uv.${i}; - - data[offset] = v.x; - data[offset+1] = v.y; - data[offset+2] = v.width; - data[offset+3] = v.height; - `},{test:(i,e)=>i.type==="vec4"&&i.size===1&&!i.isArray&&e.red!==void 0,code:i=>` - cv = ud["${i}"].value; - v = uv["${i}"]; - - if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) - { - cv[0] = v.red; - cv[1] = v.green; - cv[2] = v.blue; - cv[3] = v.alpha; - gl.uniform4f(ud["${i}"].location, v.red, v.green, v.blue, v.alpha) - }`,codeUbo:i=>` - v = uv.${i}; - - data[offset] = v.red; - data[offset+1] = v.green; - data[offset+2] = v.blue; - data[offset+3] = v.alpha; - `},{test:(i,e)=>i.type==="vec3"&&i.size===1&&!i.isArray&&e.red!==void 0,code:i=>` - cv = ud["${i}"].value; - v = uv["${i}"]; - - if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.a) - { - cv[0] = v.red; - cv[1] = v.green; - cv[2] = v.blue; - - gl.uniform3f(ud["${i}"].location, v.red, v.green, v.blue) - }`,codeUbo:i=>` - v = uv.${i}; - - data[offset] = v.red; - data[offset+1] = v.green; - data[offset+2] = v.blue; - `},{test:i=>i.type==="vec4"&&i.size===1&&!i.isArray,code:i=>` - cv = ud["${i}"].value; - v = uv["${i}"]; - - if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - cv[3] = v[3]; - - gl.uniform4f(ud["${i}"].location, v[0], v[1], v[2], v[3]) - }`}],fC={float:` - if (cv !== v) - { - cu.value = v; - gl.uniform1f(location, v); - }`,vec2:` - if (cv[0] !== v[0] || cv[1] !== v[1]) - { - cv[0] = v[0]; - cv[1] = v[1]; - - gl.uniform2f(location, v[0], v[1]) - }`,vec3:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - - gl.uniform3f(location, v[0], v[1], v[2]) - }`,vec4:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - cv[3] = v[3]; - - gl.uniform4f(location, v[0], v[1], v[2], v[3]); - }`,int:` - if (cv !== v) - { - cu.value = v; - - gl.uniform1i(location, v); - }`,ivec2:` - if (cv[0] !== v[0] || cv[1] !== v[1]) - { - cv[0] = v[0]; - cv[1] = v[1]; - - gl.uniform2i(location, v[0], v[1]); - }`,ivec3:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - - gl.uniform3i(location, v[0], v[1], v[2]); - }`,ivec4:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - cv[3] = v[3]; - - gl.uniform4i(location, v[0], v[1], v[2], v[3]); - }`,uint:` - if (cv !== v) - { - cu.value = v; - - gl.uniform1ui(location, v); - }`,uvec2:` - if (cv[0] !== v[0] || cv[1] !== v[1]) - { - cv[0] = v[0]; - cv[1] = v[1]; - - gl.uniform2ui(location, v[0], v[1]); - }`,uvec3:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - - gl.uniform3ui(location, v[0], v[1], v[2]); - }`,uvec4:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - cv[3] = v[3]; - - gl.uniform4ui(location, v[0], v[1], v[2], v[3]); - }`,bool:` - if (cv !== v) - { - cu.value = v; - gl.uniform1i(location, v); - }`,bvec2:` - if (cv[0] != v[0] || cv[1] != v[1]) - { - cv[0] = v[0]; - cv[1] = v[1]; - - gl.uniform2i(location, v[0], v[1]); - }`,bvec3:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - - gl.uniform3i(location, v[0], v[1], v[2]); - }`,bvec4:` - if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) - { - cv[0] = v[0]; - cv[1] = v[1]; - cv[2] = v[2]; - cv[3] = v[3]; - - gl.uniform4i(location, v[0], v[1], v[2], v[3]); - }`,mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:` - if (cv !== v) - { - cu.value = v; - - gl.uniform1i(location, v); - }`,samplerCube:` - if (cv !== v) - { - cu.value = v; - - gl.uniform1i(location, v); - }`,sampler2DArray:` - if (cv !== v) - { - cu.value = v; - - gl.uniform1i(location, v); - }`},mC={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function pC(i,e){var s;const t=[` - var v = null; - var cv = null; - var cu = null; - var t = 0; - var gl = renderer.gl; - `];for(const n in i.uniforms){const r=e[n];if(!r){((s=i.uniforms[n])==null?void 0:s.group)===!0&&(i.uniforms[n].ubo?t.push(` - renderer.shader.syncUniformBufferGroup(uv.${n}, '${n}'); - `):t.push(` - renderer.shader.syncUniformGroup(uv.${n}, syncData); - `));continue}const o=i.uniforms[n];let a=!1;for(let l=0;l=go.WEBGL2&&(e=i.getContext("webgl2",{})),e||(e=i.getContext("webgl",{})||i.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),Co=e}return Co}let Kl;function vC(){if(!Kl){Kl=fi.MEDIUM;const i=gC();if(i&&i.getShaderPrecisionFormat){const e=i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT);e&&(Kl=e.precision?fi.HIGH:fi.MEDIUM)}}return Kl}function J0(i,e){const t=i.getShaderSource(e).split(` -`).map((c,h)=>`${h}: ${c}`),s=i.getShaderInfoLog(e),n=s.split(` -`),r={},o=n.map(c=>parseFloat(c.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(c=>c&&!r[c]?(r[c]=!0,!0):!1),a=[""];o.forEach(c=>{t[c-1]=`%c${t[c-1]}%c`,a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const l=t.join(` -`);a[0]=l,console.error(s),console.groupCollapsed("click to view full shader code"),console.warn(...a),console.groupEnd()}function yC(i,e,t,s){i.getProgramParameter(e,i.LINK_STATUS)||(i.getShaderParameter(t,i.COMPILE_STATUS)||J0(i,t),i.getShaderParameter(s,i.COMPILE_STATUS)||J0(i,s),console.error("PixiJS Error: Could not initialize shader."),i.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",i.getProgramInfoLog(e)))}const xC={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function fb(i){return xC[i]}let Zl=null;const Q0={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function mb(i,e){if(!Zl){const t=Object.keys(Q0);Zl={};for(let s=0;s0&&(t+=` -else `),sthis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)}buildTexturesAndDrawCalls(){const{_bufferedTextures:e,maxTextures:t}=this,s=wi._textureArrayPool,n=this.renderer.batch,r=this._tempBoundTextures,o=this.renderer.textureGC.count;let a=++Qe._globalBatch,l=0,c=s[0],h=0;n.copyBoundTextures(r,t);for(let u=0;u=t&&(n.boundArray(c,r,a,t),this.buildDrawCalls(c,h,u),h=u,c=s[++l],++a),d._batchEnabled=a,d.touched=o,c.elements[c.count++]=d)}c.count>0&&(n.boundArray(c,r,a,t),this.buildDrawCalls(c,h,this._bufferSize),++l,++a);for(let u=0;u0);for(let m=0;m=0;--n)e[n]=s[n]||null,e[n]&&(e[n]._batchLocation=n)}boundArray(e,t,s,n){const{elements:r,ids:o,count:a}=e;let l=0;for(let c=0;c=0&&u=go.WEBGL2&&(s=e.getContext("webgl2",t)),s)this.webGLVersion=2;else if(this.webGLVersion=1,s=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),!s)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=s,this.getExtensions(),this.gl}getExtensions(){const{gl:e}=this,t={loseContext:e.getExtension("WEBGL_lose_context"),anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc"),bptc:e.getExtension("EXT_texture_compression_bptc")};this.webGLVersion===1?Object.assign(this.extensions,t,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})}handleContextLost(e){e.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this.renderer.view;this.renderer=null,e.removeEventListener!==void 0&&(e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(e){const t=e.getContextAttributes(),s="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;s&&(this.webGLVersion=2),t&&!t.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const n=s||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=n,n||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}nh.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},nh.extension={type:ke.RendererSystem,name:"context"};Xe.add(nh);class Hf{constructor(e,t){if(this.width=Math.round(e),this.height=Math.round(t),!this.width||!this.height)throw new Error("Framebuffer width or height is zero");this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Ri("disposeFramebuffer"),this.multisample=ls.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(e=0,t){return this.colorTextures[e]=t||new Qe(null,{scaleMode:Ci.NEAREST,resolution:1,mipmap:gi.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(e){return this.depthTexture=e||new Qe(null,{scaleMode:Ci.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:gi.OFF,format:_e.DEPTH_COMPONENT,type:$e.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(e,t){if(e=Math.round(e),t=Math.round(t),!e||!t)throw new Error("Framebuffer width and height must not be zero");if(!(e===this.width&&t===this.height)){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(let s=0;s{const n=this.source;this.url=n.src;const r=()=>{this.destroyed||(n.onload=null,n.onerror=null,this.update(),this._load=null,this.createBitmap?t(this.process()):t(this))};n.complete&&n.src?r():(n.onload=r,n.onerror=o=>{s(o),this.onError.emit(o)})}),this._load)}process(){const e=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);const t=globalThis.createImageBitmap,s=!e.crossOrigin||e.crossOrigin==="anonymous";return this._process=fetch(e.src,{mode:s?"cors":"no-cors"}).then(n=>n.blob()).then(n=>t(n,0,0,e.width,e.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===bs.UNPACK?"premultiply":"none"})).then(n=>this.destroyed?Promise.reject():(this.bitmap=n,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(e,t,s){if(typeof this.alphaMode=="number"&&(t.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(e,t,s);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(e,t,s,this.bitmap),!this.preserveBitmap){let n=!0;const r=t._glTextures;for(const o in r){const a=r[o];if(a!==s&&a.dirtyId!==t.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(e){return typeof HTMLImageElement<"u"&&(typeof e=="string"||e instanceof HTMLImageElement)}}class dp{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(e,t,s){const n=t.width,r=t.height;if(s){const o=e.width/2/n,a=e.height/2/r,l=e.x/n+o,c=e.y/r+a;s=Wt.add(s,Wt.NW),this.x0=l+o*Wt.uX(s),this.y0=c+a*Wt.uY(s),s=Wt.add(s,2),this.x1=l+o*Wt.uX(s),this.y1=c+a*Wt.uY(s),s=Wt.add(s,2),this.x2=l+o*Wt.uX(s),this.y2=c+a*Wt.uY(s),s=Wt.add(s,2),this.x3=l+o*Wt.uX(s),this.y3=c+a*Wt.uY(s)}else this.x0=e.x/n,this.y0=e.y/r,this.x1=(e.x+e.width)/n,this.y1=e.y/r,this.x2=(e.x+e.width)/n,this.y2=(e.y+e.height)/r,this.x3=e.x/n,this.y3=(e.y+e.height)/r;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}}dp.prototype.toString=function(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`};const sv=new dp;function Ql(i){i.destroy=function(){},i.on=function(){},i.once=function(){},i.emit=function(){}}let ze=class Nt extends El{constructor(e,t,s,n,r,o,a){if(super(),this.noFrame=!1,t||(this.noFrame=!0,t=new ot(0,0,1,1)),e instanceof Nt&&(e=e.baseTexture),this.baseTexture=e,this._frame=t,this.trim=n,this.valid=!1,this.destroyed=!1,this._uvs=sv,this.uvMatrix=null,this.orig=s||t,this._rotate=Number(r||0),r===!0)this._rotate=2;else if(this._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=o?new vt(o.x,o.y):new vt(0,0),this.defaultBorders=a,this._updateID=0,this.textureCacheIds=[],e.valid?this.noFrame?e.valid&&this.onBaseTextureUpdated(e):this.frame=t:e.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&e.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(e){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=e.width,this._frame.height=e.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(e){if(this.baseTexture){if(e){const{resource:t}=this.baseTexture;t!=null&&t.url&&$i[t.url]&&Nt.removeFromCache(t.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,Nt.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}clone(){var n;const e=this._frame.clone(),t=this._frame===this.orig?e:this.orig.clone(),s=new Nt(this.baseTexture,!this.noFrame&&e,t,(n=this.trim)==null?void 0:n.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(s._frame=e),s}updateUvs(){this._uvs===sv&&(this._uvs=new dp),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(e,t={},s=Le.STRICT_TEXTURE_CACHE){const n=typeof e=="string";let r=null;if(n)r=e;else if(e instanceof Qe){if(!e.cacheId){const a=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e.cacheId=`${a}-${co()}`,Qe.addToCache(e,e.cacheId)}r=e.cacheId}else{if(!e._pixiId){const a=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e._pixiId=`${a}_${co()}`}r=e._pixiId}let o=$i[r];if(n&&s&&!o)throw new Error(`The cacheId "${r}" does not exist in TextureCache.`);return!o&&!(e instanceof Qe)?(t.resolution||(t.resolution=Yn(e)),o=new Nt(new Qe(e,t)),o.baseTexture.cacheId=r,Qe.addToCache(o.baseTexture,r),Nt.addToCache(o,r)):!o&&e instanceof Qe&&(o=new Nt(e),Nt.addToCache(o,r)),o}static fromURL(e,t){const s=Object.assign({autoLoad:!1},t==null?void 0:t.resourceOptions),n=Nt.from(e,Object.assign({resourceOptions:s},t),!1),r=n.baseTexture.resource;return n.baseTexture.valid?Promise.resolve(n):r.load().then(()=>Promise.resolve(n))}static fromBuffer(e,t,s,n){return new Nt(Qe.fromBuffer(e,t,s,n))}static fromLoader(e,t,s,n){const r=new Qe(e,Object.assign({scaleMode:Qe.defaultOptions.scaleMode,resolution:Yn(t)},n)),{resource:o}=r;o instanceof yb&&(o.url=t);const a=new Nt(r);return s||(s=t),Qe.addToCache(a.baseTexture,s),Nt.addToCache(a,s),s!==t&&(Qe.addToCache(a.baseTexture,t),Nt.addToCache(a,t)),a.baseTexture.valid?Promise.resolve(a):new Promise(l=>{a.baseTexture.once("loaded",()=>l(a))})}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),$i[t]&&$i[t]!==e&&console.warn(`Texture added to the cache with an id [${t}] that already had an entry`),$i[t]=e)}static removeFromCache(e){if(typeof e=="string"){const t=$i[e];if(t){const s=t.textureCacheIds.indexOf(e);return s>-1&&t.textureCacheIds.splice(s,1),delete $i[e],t}}else if(e!=null&&e.textureCacheIds){for(let t=0;tthis.baseTexture.width,a=s+r>this.baseTexture.height;if(o||a){const l=o&&a?"and":"or",c=`X: ${t} + ${n} = ${t+n} > ${this.baseTexture.width}`,h=`Y: ${s} + ${r} = ${s+r} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${c} ${l} ${h}`)}this.valid=n&&r&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=e),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(e){this._rotate=e,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return Nt._EMPTY||(Nt._EMPTY=new Nt(new Qe),Ql(Nt._EMPTY),Ql(Nt._EMPTY.baseTexture)),Nt._EMPTY}static get WHITE(){if(!Nt._WHITE){const e=Le.ADAPTER.createCanvas(16,16),t=e.getContext("2d");e.width=16,e.height=16,t.fillStyle="white",t.fillRect(0,0,16,16),Nt._WHITE=new Nt(Qe.from(e)),Ql(Nt._WHITE),Ql(Nt._WHITE.baseTexture)}return Nt._WHITE}};class vo extends ze{constructor(e,t){super(e,t),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(e){this.framebuffer.multisample=e}resize(e,t,s=!0){const n=this.baseTexture.resolution,r=Math.round(e*n)/n,o=Math.round(t*n)/n;this.valid=r>0&&o>0,this._frame.width=this.orig.width=r,this._frame.height=this.orig.height=o,s&&this.baseTexture.resize(r,o),this.updateUvs()}setResolution(e){const{baseTexture:t}=this;t.resolution!==e&&(t.setResolution(e),this.resize(t.width,t.height,!1))}static create(e){return new vo(new vb(e))}}class xb{constructor(e){this.texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(e,t,s=ls.NONE){const n=new vb(Object.assign({width:e,height:t,resolution:1,multisample:s},this.textureOptions));return new vo(n)}getOptimalTexture(e,t,s=1,n=ls.NONE){let r;e=Math.max(Math.ceil(e*s-1e-6),1),t=Math.max(Math.ceil(t*s-1e-6),1),!this.enableFullScreen||e!==this._pixelsWidth||t!==this._pixelsHeight?(e=eh(e),t=eh(t),r=((e&65535)<<16|t&65535)>>>0,n>1&&(r+=n*4294967296)):r=n>1?-n:-1,this.texturePool[r]||(this.texturePool[r]=[]);let o=this.texturePool[r].pop();return o||(o=this.createTexture(e,t,n)),o.filterPoolKey=r,o.setResolution(s),o}getFilterTexture(e,t,s){const n=this.getOptimalTexture(e.width,e.height,t||e.resolution,s||ls.NONE);return n.filterFrame=e.filterFrame,n}returnTexture(e){const t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)}returnFilterTexture(e){this.returnTexture(e)}clear(e){if(e=e!==!1,e)for(const t in this.texturePool){const s=this.texturePool[t];if(s)for(let n=0;n0&&e.height>0;for(const t in this.texturePool){if(!(Number(t)<0))continue;const s=this.texturePool[t];if(s)for(let n=0;n1&&(h=this.getOptimalFilterTexture(c.width,c.height,t.resolution),h.filterFrame=c.filterFrame),s[u].apply(this,c,h,Zi.CLEAR,t);const d=c;c=h,h=d}s[u].apply(this,c,l.renderTexture,Zi.BLEND,t),u>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(c),this.returnFilterTexture(h)}t.clear(),this.statePool.push(t)}bindAndClear(e,t=Zi.CLEAR){const{renderTexture:s,state:n}=this.renderer;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e==null?void 0:e.filterFrame){const o=this.tempRect;o.x=0,o.y=0,o.width=e.filterFrame.width,o.height=e.filterFrame.height,s.bind(e,e.filterFrame,o)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?s.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const r=n.stateId&1||this.forceClear;(t===Zi.CLEAR||t===Zi.BLIT&&r)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(e,t,s,n){const r=this.renderer;r.state.set(e.state),this.bindAndClear(s,n),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,r.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),r.geometry.bind(this.quadUv),r.geometry.draw(sn.TRIANGLES)):(r.geometry.bind(this.quad),r.geometry.draw(sn.TRIANGLE_STRIP))}calculateSpriteMatrix(e,t){const{sourceFrame:s,destinationFrame:n}=this.activeState,{orig:r}=t._texture,o=e.set(n.width,0,0,n.height,s.x,s.y),a=t.worldTransform.copyTo(Ot.TEMP_MATRIX);return a.invert(),o.prepend(a),o.scale(1/r.width,1/r.height),o.translate(t.anchor.x,t.anchor.y),o}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(e,t,s=1,n=ls.NONE){return this.texturePool.getOptimalTexture(e,t,s,n)}getFilterTexture(e,t,s){if(typeof e=="number"){const r=e;e=t,t=r}e=e||this.activeState.renderTexture;const n=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,s||ls.NONE);return n.filterFrame=e.filterFrame,n}returnFilterTexture(e){this.texturePool.returnTexture(e)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(e,t){const s=ec[0],n=ec[1],r=ec[2],o=ec[3];s.set(t.left,t.top),n.set(t.left,t.bottom),r.set(t.right,t.top),o.set(t.right,t.bottom),e.apply(s,s),e.apply(n,n),e.apply(r,r),e.apply(o,o);const a=Math.min(s.x,n.x,r.x,o.x),l=Math.min(s.y,n.y,r.y,o.y),c=Math.max(s.x,n.x,r.x,o.x),h=Math.max(s.y,n.y,r.y,o.y);t.x=a,t.y=l,t.width=c-a,t.height=h-l}roundFrame(e,t,s,n,r){if(!(e.width<=0||e.height<=0||s.width<=0||s.height<=0)){if(r){const{a:o,b:a,c:l,d:c}=r;if((Math.abs(a)>1e-4||Math.abs(l)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(c)>1e-4))return}r=r?Vd.copyFrom(r):Vd.identity(),r.translate(-s.x,-s.y).scale(n.width/s.width,n.height/s.height).translate(n.x,n.y),this.transformAABB(r,e),e.ceil(t),this.transformAABB(r.invert(),e)}}}wb.extension={type:ke.RendererSystem,name:"filter"};Xe.add(wb);class PC{constructor(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=ls.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const kC=new ot;class Sb{constructor(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new Hf(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new ot,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let t=this.renderer.context.extensions.drawBuffers,s=this.renderer.context.extensions.depthTexture;Le.PREFER_ENV===go.WEBGL_LEGACY&&(t=null,s=null),t?e.drawBuffers=n=>t.drawBuffersWEBGL(n):(this.hasMRT=!1,e.drawBuffers=()=>{}),s||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)}bind(e,t,s=0){const{gl:n}=this;if(e){const r=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,n.bindFramebuffer(n.FRAMEBUFFER,r.framebuffer)),r.mipLevel!==s&&(e.dirtyId++,e.dirtyFormat++,r.mipLevel=s),r.dirtyId!==e.dirtyId&&(r.dirtyId=e.dirtyId,r.dirtyFormat!==e.dirtyFormat?(r.dirtyFormat=e.dirtyFormat,r.dirtySize=e.dirtySize,this.updateFramebuffer(e,s)):r.dirtySize!==e.dirtySize&&(r.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(let o=0;o>s,a=t.height>>s,l=o/t.width;this.setViewport(t.x*l,t.y*l,o,a)}else{const o=e.width>>s,a=e.height>>s;this.setViewport(0,0,o,a)}}else this.current&&(this.current=null,n.bindFramebuffer(n.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(e,t,s,n){const r=this.viewport;e=Math.round(e),t=Math.round(t),s=Math.round(s),n=Math.round(n),(r.width!==s||r.height!==n||r.x!==e||r.y!==t)&&(r.x=e,r.y=t,r.width=s,r.height=n,this.gl.viewport(e,t,s,n))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(e,t,s,n,r=kf.COLOR|kf.DEPTH){const{gl:o}=this;o.clearColor(e,t,s,n),o.clear(r)}initFramebuffer(e){const{gl:t}=this,s=new PC(t.createFramebuffer());return s.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=s,this.managedFramebuffers.push(e),e.disposeRunner.add(this),s}resizeFramebuffer(e){const{gl:t}=this,s=e.glFramebuffers[this.CONTEXT_UID];if(s.stencil){t.bindRenderbuffer(t.RENDERBUFFER,s.stencil);let o;this.renderer.context.webGLVersion===1?o=t.DEPTH_STENCIL:e.depth&&e.stencil?o=t.DEPTH24_STENCIL8:e.depth?o=t.DEPTH_COMPONENT24:o=t.STENCIL_INDEX8,s.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,s.multisample,o,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,o,e.width,e.height)}const n=e.colorTextures;let r=n.length;t.drawBuffers||(r=Math.min(r,1));for(let o=0;o1&&this.canMultisampleFramebuffer(e)?n.msaaBuffer=n.msaaBuffer||s.createRenderbuffer():n.msaaBuffer&&(s.deleteRenderbuffer(n.msaaBuffer),n.msaaBuffer=null,n.blitFramebuffer&&(n.blitFramebuffer.dispose(),n.blitFramebuffer=null));const a=[];for(let l=0;l1&&s.drawBuffers(a),e.depthTexture&&this.writeDepthTexture){const l=e.depthTexture;this.renderer.texture.bind(l,0),s.framebufferTexture2D(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.TEXTURE_2D,l._glTextures[this.CONTEXT_UID].texture,t)}if((e.stencil||e.depth)&&!(e.depthTexture&&this.writeDepthTexture)){n.stencil=n.stencil||s.createRenderbuffer();let l,c;this.renderer.context.webGLVersion===1?(l=s.DEPTH_STENCIL_ATTACHMENT,c=s.DEPTH_STENCIL):e.depth&&e.stencil?(l=s.DEPTH_STENCIL_ATTACHMENT,c=s.DEPTH24_STENCIL8):e.depth?(l=s.DEPTH_ATTACHMENT,c=s.DEPTH_COMPONENT24):(l=s.STENCIL_ATTACHMENT,c=s.STENCIL_INDEX8),s.bindRenderbuffer(s.RENDERBUFFER,n.stencil),n.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,n.multisample,c,e.width,e.height):s.renderbufferStorage(s.RENDERBUFFER,c,e.width,e.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,l,s.RENDERBUFFER,n.stencil)}else n.stencil&&(s.deleteRenderbuffer(n.stencil),n.stencil=null)}canMultisampleFramebuffer(e){return this.renderer.context.webGLVersion!==1&&e.colorTextures.length<=1&&!e.depthTexture}detectSamples(e){const{msaaSamples:t}=this;let s=ls.NONE;if(e<=1||t===null)return s;for(let n=0;n=0&&this.managedFramebuffers.splice(r,1),e.disposeRunner.remove(this),t||(n.deleteFramebuffer(s.framebuffer),s.msaaBuffer&&n.deleteRenderbuffer(s.msaaBuffer),s.stencil&&n.deleteRenderbuffer(s.stencil)),s.blitFramebuffer&&this.disposeFramebuffer(s.blitFramebuffer,t)}disposeAll(e){const t=this.managedFramebuffers;this.managedFramebuffers=[];for(let s=0;ss.createVertexArrayOES(),e.bindVertexArray=n=>s.bindVertexArrayOES(n),e.deleteVertexArray=n=>s.deleteVertexArrayOES(n)):(this.hasVao=!1,e.createVertexArray=()=>null,e.bindVertexArray=()=>null,e.deleteVertexArray=()=>null)}if(t.webGLVersion!==2){const s=e.getExtension("ANGLE_instanced_arrays");s?(e.vertexAttribDivisor=(n,r)=>s.vertexAttribDivisorANGLE(n,r),e.drawElementsInstanced=(n,r,o,a,l)=>s.drawElementsInstancedANGLE(n,r,o,a,l),e.drawArraysInstanced=(n,r,o,a)=>s.drawArraysInstancedANGLE(n,r,o,a)):this.hasInstance=!1}this.canUseUInt32ElementIndex=t.webGLVersion===2||!!t.extensions.uint32ElementIndex}bind(e,t){t=t||this.renderer.shader.shader;const{gl:s}=this;let n=e.glVertexArrayObjects[this.CONTEXT_UID],r=!1;n||(this.managedGeometries[e.id]=e,e.disposeRunner.add(this),e.glVertexArrayObjects[this.CONTEXT_UID]=n={},r=!0);const o=n[t.program.id]||this.initGeometryVao(e,t,r);this._activeGeometry=e,this._activeVao!==o&&(this._activeVao=o,this.hasVao?s.bindVertexArray(o):this.activateVao(e,t.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const e=this._activeGeometry,t=this.renderer.buffer;for(let s=0;s"u"?.5:t,this.isSimple=!1}get texture(){return this._texture}set texture(e){this._texture=e,this._textureID=-1}multiplyUvs(e,t){t===void 0&&(t=e);const s=this.mapCoord;for(let n=0;n0?this.maskStack[this.maskStack.length-1]._colorMask:15;s!==t&&this.renderer.gl.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)}destroy(){this.renderer=null}}Tb.extension={type:ke.RendererSystem,name:"mask"};Xe.add(Tb);class _b{constructor(e){this.renderer=e,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(e){const{gl:t}=this.renderer,s=this.getStackLength();this.maskStack=e;const n=this.getStackLength();n!==s&&(n===0?t.disable(this.glConst):(t.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const nv=new Ot,rv=[],Cb=class Ec extends _b{constructor(e){super(e),this.glConst=Le.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._scissorCounter:0}calcScissorRect(e){if(e._scissorRectLocal)return;const t=e._scissorRect,{maskObject:s}=e,{renderer:n}=this,r=n.renderTexture,o=s.getBounds(!0,rv.pop()??new ot);this.roundFrameToPixels(o,r.current?r.current.resolution:n.resolution,r.sourceFrame,r.destinationFrame,n.projection.transform),t&&o.fit(t),e._scissorRectLocal=o}static isMatrixRotated(e){if(!e)return!1;const{a:t,b:s,c:n,d:r}=e;return(Math.abs(s)>1e-4||Math.abs(n)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(r)>1e-4)}testScissor(e){const{maskObject:t}=e;if(!t.isFastRect||!t.isFastRect()||Ec.isMatrixRotated(t.worldTransform)||Ec.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);const s=e._scissorRectLocal;return s.width>0&&s.height>0}roundFrameToPixels(e,t,s,n,r){Ec.isMatrixRotated(r)||(r=r?nv.copyFrom(r):nv.identity(),r.translate(-s.x,-s.y).scale(n.width/s.width,n.height/s.height).translate(n.x,n.y),this.renderer.filter.transformAABB(r,e),e.fit(n),e.x=Math.round(e.x*t),e.y=Math.round(e.y*t),e.width=Math.round(e.width*t),e.height=Math.round(e.height*t))}push(e){e._scissorRectLocal||this.calcScissorRect(e);const{gl:t}=this.renderer;e._scissorRect||t.enable(t.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()}pop(e){const{gl:t}=this.renderer;e&&rv.push(e._scissorRectLocal),this.getStackLength()>0?this._useCurrent():t.disable(t.SCISSOR_TEST)}_useCurrent(){const e=this.maskStack[this.maskStack.length-1]._scissorRect;let t;this.renderer.renderTexture.current?t=e.y:t=this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,t,e.width,e.height)}};Cb.extension={type:ke.RendererSystem,name:"scissor"};let NC=Cb;Xe.add(NC);class Ab extends _b{constructor(e){super(e),this.glConst=Le.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0}push(e){const t=e.maskObject,{gl:s}=this.renderer,n=e._stencilCounter;n===0&&(this.renderer.framebuffer.forceStencil(),s.clearStencil(0),s.clear(s.STENCIL_BUFFER_BIT),s.enable(s.STENCIL_TEST)),e._stencilCounter++;const r=e._colorMask;r!==0&&(e._colorMask=0,s.colorMask(!1,!1,!1,!1)),s.stencilFunc(s.EQUAL,n,4294967295),s.stencilOp(s.KEEP,s.KEEP,s.INCR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,r!==0&&(e._colorMask=r,s.colorMask((r&1)!==0,(r&2)!==0,(r&4)!==0,(r&8)!==0)),this._useCurrent()}pop(e){const t=this.renderer.gl;if(this.getStackLength()===0)t.disable(t.STENCIL_TEST);else{const s=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,n=s?s._colorMask:15;n!==0&&(s._colorMask=0,t.colorMask(!1,!1,!1,!1)),t.stencilOp(t.KEEP,t.KEEP,t.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,n!==0&&(s._colorMask=n,t.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)),this._useCurrent()}}_useCurrent(){const e=this.renderer.gl;e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)}}Ab.extension={type:ke.RendererSystem,name:"stencil"};Xe.add(Ab);class Eb{constructor(e){this.renderer=e,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return ht("7.0.0","renderer.plugins.extract has moved to renderer.extract"),e.extract}},prepare:{enumerable:!1,get(){return ht("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),e.prepare}},interaction:{enumerable:!1,get(){return ht("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),e.events}}})}init(){const e=this.rendererPlugins;for(const t in e)this.plugins[t]=new e[t](this.renderer)}destroy(){for(const e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null}}Eb.extension={type:[ke.RendererSystem,ke.CanvasRendererSystem],name:"_plugin"};Xe.add(Eb);class Ib{constructor(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Ot,this.transform=null}update(e,t,s,n){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,s,n),this.transform&&this.projectionMatrix.append(this.transform);const r=this.renderer;r.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,r.globalUniforms.update(),r.shader.shader&&r.shader.syncUniformGroup(r.shader.shader.uniforms.globals)}calculateProjection(e,t,s,n){const r=this.projectionMatrix,o=n?-1:1;r.identity(),r.a=1/t.width*2,r.d=o*(1/t.height*2),r.tx=-1-t.x*r.a,r.ty=-o-t.y*r.d}setTransform(e){}destroy(){this.renderer=null}}Ib.extension={type:ke.RendererSystem,name:"projection"};Xe.add(Ib);const DC=new up,ov=new ot;class Rb{constructor(e){this.renderer=e,this._tempMatrix=new Ot}generateTexture(e,t){const{region:s,...n}=t||{},r=(s==null?void 0:s.copyTo(ov))||e.getLocalBounds(ov,!0),o=n.resolution||this.renderer.resolution;r.width=Math.max(r.width,1/o),r.height=Math.max(r.height,1/o),n.width=r.width,n.height=r.height,n.resolution=o,n.multisample??(n.multisample=this.renderer.multisample);const a=vo.create(n);this._tempMatrix.tx=-r.x,this._tempMatrix.ty=-r.y;const l=e.transform;return e.transform=DC,this.renderer.render(e,{renderTexture:a,transform:this._tempMatrix,skipUpdateTransform:!!e.parent,blit:!0}),e.transform=l,a}destroy(){}}Rb.extension={type:[ke.RendererSystem,ke.CanvasRendererSystem],name:"textureGenerator"};Xe.add(Rb);const Br=new ot,ka=new ot;class Pb{constructor(e){this.renderer=e,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new ot,this.destinationFrame=new ot,this.viewportFrame=new ot}contextChange(){var t;const e=(t=this.renderer)==null?void 0:t.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(e&&e.alpha&&e.premultipliedAlpha)}bind(e=null,t,s){const n=this.renderer;this.current=e;let r,o,a;e?(r=e.baseTexture,a=r.resolution,t||(Br.width=e.frame.width,Br.height=e.frame.height,t=Br),s||(ka.x=e.frame.x,ka.y=e.frame.y,ka.width=t.width,ka.height=t.height,s=ka),o=r.framebuffer):(a=n.resolution,t||(Br.width=n._view.screen.width,Br.height=n._view.screen.height,t=Br),s||(s=Br,s.width=t.width,s.height=t.height));const l=this.viewportFrame;l.x=s.x*a,l.y=s.y*a,l.width=s.width*a,l.height=s.height*a,e||(l.y=n.view.height-(l.y+l.height)),l.ceil(),this.renderer.framebuffer.bind(o,l),this.renderer.projection.update(s,t,a,!o),e?this.renderer.mask.setMaskStack(r.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(s)}clear(e,t){const s=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,n=Et.shared.setValue(e||s);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&n.premultiply(n.alpha);const r=this.destinationFrame,o=this.current?this.current.baseTexture:this.renderer._view.screen,a=r.width!==o.width||r.height!==o.height;if(a){let{x:l,y:c,width:h,height:u}=this.viewportFrame;l=Math.round(l),c=Math.round(c),h=Math.round(h),u=Math.round(u),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(l,c,h,u)}this.renderer.framebuffer.clear(n.red,n.green,n.blue,n.alpha,t),a&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}Pb.extension={type:ke.RendererSystem,name:"renderTexture"};Xe.add(Pb);class UC{constructor(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function $C(i,e){const t={},s=e.getProgramParameter(i,e.ACTIVE_ATTRIBUTES);for(let n=0;nc>h?1:-1);for(let c=0;c({data:r,offset:0,dataLen:0,dirty:0}));let t=0,s=0,n=0;for(let r=0;r1&&(t=Math.max(t,16)*o.data.size),o.dataLen=t,s%t!==0&&s<16){const a=s%t%16;s+=a,n+=a}s+t>16?(n=Math.ceil(n/16)*16,o.offset=n,n+=t,s=t):(o.offset=n,s+=t,n+=t)}return n=Math.ceil(n/16)*16,{uboElements:e,size:n}}function HC(i,e){const t=[];for(const s in i)e[s]&&t.push(e[s]);return t.sort((s,n)=>s.index-n.index),t}function WC(i,e){if(!i.autoManage)return{size:0,syncFunc:YC};const t=HC(i.uniforms,e),{uboElements:s,size:n}=jC(t),r=[` - var v = null; - var v2 = null; - var cv = null; - var t = 0; - var gl = renderer.gl - var index = 0; - var data = buffer.data; - `];for(let o=0;o1){const u=fb(a.data.type),d=Math.max(kb[a.data.type]/16,1),f=u/d,p=(4-f%4)%4;r.push(` - cv = ud.${c}.value; - v = uv.${c}; - offset = ${a.offset/4}; - - t = 0; - - for(var i=0; i < ${a.data.size*d}; i++) - { - for(var j = 0; j < ${f}; j++) - { - data[offset++] = v[t++]; - } - offset += ${p}; - } - - `)}else{const u=GC[a.data.type];r.push(` - cv = ud.${c}.value; - v = uv.${c}; - offset = ${a.offset/4}; - ${u}; - `)}}return r.push(` - renderer.buffer.update(buffer); - `),{size:n,syncFunc:new Function("ud","uv","renderer","syncData","buffer",r.join(` -`))}}let zC=0;const tc={textureCount:0,uboCount:0};class Fb{constructor(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=zC++}systemCheck(){if(!bC())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(e){this.gl=e,this.reset()}bind(e,t){e.disposeRunner.add(this),e.uniforms.globals=this.renderer.globalUniforms;const s=e.program,n=s.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==s&&(this.program=s,this.gl.useProgram(n.program)),t||(tc.textureCount=0,tc.uboCount=0,this.syncUniformGroup(e.uniformGroup,tc)),n}setUniforms(e){const t=this.shader.program,s=t.glPrograms[this.renderer.CONTEXT_UID];t.syncUniforms(s.uniformData,e,this.renderer)}syncUniformGroup(e,t){const s=this.getGlProgram();(!e.static||e.dirtyId!==s.uniformDirtyGroups[e.id])&&(s.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,s,t))}syncUniforms(e,t,s){(e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e))(t.uniformData,e.uniforms,this.renderer,s)}createSyncGroups(e){const t=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[t]||(this.cache[t]=pC(e,this.shader.program.uniformData)),e.syncUniforms[this.shader.program.id]=this.cache[t],e.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(e,t){const s=this.getGlProgram();if(!e.static||e.dirtyId!==0||!s.uniformGroups[e.id]){e.dirtyId=0;const n=s.uniformGroups[e.id]||this.createSyncBufferGroup(e,s,t);e.buffer.update(),n(s.uniformData,e.uniforms,this.renderer,tc,e.buffer)}this.renderer.buffer.bindBufferBase(e.buffer,s.uniformBufferBindings[t])}createSyncBufferGroup(e,t,s){const{gl:n}=this.renderer;this.renderer.buffer.bind(e.buffer);const r=this.gl.getUniformBlockIndex(t.program,s);t.uniformBufferBindings[s]=this.shader.uniformBindCount,n.uniformBlockBinding(t.program,r,this.shader.uniformBindCount),this.shader.uniformBindCount++;const o=this.getSignature(e,this.shader.program.uniformData,"ubo");let a=this._uboCache[o];if(a||(a=this._uboCache[o]=WC(e,this.shader.program.uniformData)),e.autoManage){const l=new Float32Array(a.size/4);e.buffer.update(l)}return t.uniformGroups[e.id]=a.syncFunc,t.uniformGroups[e.id]}getSignature(e,t,s){const n=e.uniforms,r=[`${s}-`];for(const o in n)r.push(o),t[o]&&r.push(t[o].type);return r.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(e){const t=this.gl,s=e.program,n=VC(t,s);return s.glPrograms[this.renderer.CONTEXT_UID]=n,n}reset(){this.program=null,this.shader=null}disposeShader(e){this.shader===e&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}Fb.extension={type:ke.RendererSystem,name:"shader"};Xe.add(Fb);class rh{constructor(e){this.renderer=e}run(e){const{renderer:t}=this;t.runners.init.emit(t.options),e.hello&&console.log(`PixiJS 7.4.3 - ${t.rendererLogId} - https://pixijs.com`),t.resize(t.screen.width,t.screen.height)}destroy(){}}rh.defaultOptions={hello:!1},rh.extension={type:[ke.RendererSystem,ke.CanvasRendererSystem],name:"startup"};Xe.add(rh);function qC(i,e=[]){return e[He.NORMAL]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.ADD]=[i.ONE,i.ONE],e[He.MULTIPLY]=[i.DST_COLOR,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.SCREEN]=[i.ONE,i.ONE_MINUS_SRC_COLOR,i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.OVERLAY]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.DARKEN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.LIGHTEN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.COLOR_DODGE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.COLOR_BURN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.HARD_LIGHT]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.SOFT_LIGHT]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.DIFFERENCE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.EXCLUSION]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.HUE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.SATURATION]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.COLOR]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.LUMINOSITY]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.NONE]=[0,0],e[He.NORMAL_NPM]=[i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.ADD_NPM]=[i.SRC_ALPHA,i.ONE,i.ONE,i.ONE],e[He.SCREEN_NPM]=[i.SRC_ALPHA,i.ONE_MINUS_SRC_COLOR,i.ONE,i.ONE_MINUS_SRC_ALPHA],e[He.SRC_IN]=[i.DST_ALPHA,i.ZERO],e[He.SRC_OUT]=[i.ONE_MINUS_DST_ALPHA,i.ZERO],e[He.SRC_ATOP]=[i.DST_ALPHA,i.ONE_MINUS_SRC_ALPHA],e[He.DST_OVER]=[i.ONE_MINUS_DST_ALPHA,i.ONE],e[He.DST_IN]=[i.ZERO,i.SRC_ALPHA],e[He.DST_OUT]=[i.ZERO,i.ONE_MINUS_SRC_ALPHA],e[He.DST_ATOP]=[i.ONE_MINUS_DST_ALPHA,i.SRC_ALPHA],e[He.XOR]=[i.ONE_MINUS_DST_ALPHA,i.ONE_MINUS_SRC_ALPHA],e[He.SUBTRACT]=[i.ONE,i.ONE,i.ONE,i.ONE,i.FUNC_REVERSE_SUBTRACT,i.FUNC_ADD],e}const KC=0,ZC=1,JC=2,QC=3,eA=4,tA=5,Ob=class Wf{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=He.NONE,this._blendEq=!1,this.map=[],this.map[KC]=this.setBlend,this.map[ZC]=this.setOffset,this.map[JC]=this.setCullFace,this.map[QC]=this.setDepthTest,this.map[eA]=this.setFrontFace,this.map[tA]=this.setDepthMask,this.checks=[],this.defaultState=new un,this.defaultState.blend=!0}contextChange(e){this.gl=e,this.blendModes=qC(e),this.set(this.defaultState),this.reset()}set(e){if(e=e||this.defaultState,this.stateId!==e.data){let t=this.stateId^e.data,s=0;for(;t;)t&1&&this.map[s].call(this,!!(e.data&1<>1,s++;this.stateId=e.data}for(let t=0;te.systems[n]),s=[...t,...Object.keys(e.systems).filter(n=>!t.includes(n))];for(const n of s)this.addSystem(e.systems[n],n)}addRunners(...e){e.forEach(t=>{this.runners[t]=new Ri(t)})}addSystem(e,t){const s=new e(this);if(this[t])throw new Error(`Whoops! The name "${t}" is already in use`);this[t]=s,this._systemsHash[t]=s;for(const n in this.runners)this.runners[n].add(s);return this}emitWithCustomOptions(e,t){const s=Object.keys(this._systemsHash);e.items.forEach(n=>{const r=s.find(o=>this._systemsHash[o]===n);n[e.name](t[r])})}destroy(){Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash={}}}const Va=class Ic{constructor(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=Ic.defaultMaxIdle,this.checkCountMax=Ic.defaultCheckCountMax,this.mode=Ic.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==ap.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const e=this.renderer.texture,t=e.managedTextures;let s=!1;for(let n=0;nthis.maxIdle&&(e.destroyTexture(r,!0),t[n]=null,s=!0)}if(s){let n=0;for(let r=0;r=0;n--)this.unload(e.children[n])}destroy(){this.renderer=null}};Va.defaultMode=ap.AUTO,Va.defaultMaxIdle=3600,Va.defaultCheckCountMax=600,Va.extension={type:ke.RendererSystem,name:"textureGC"};let jr=Va;Xe.add(jr);class Gd{constructor(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=$e.UNSIGNED_BYTE,this.internalFormat=_e.RGBA,this.samplerType=0}}function nA(i){let e;return"WebGL2RenderingContext"in globalThis&&i instanceof globalThis.WebGL2RenderingContext?e={[i.RGB]:Ne.FLOAT,[i.RGBA]:Ne.FLOAT,[i.ALPHA]:Ne.FLOAT,[i.LUMINANCE]:Ne.FLOAT,[i.LUMINANCE_ALPHA]:Ne.FLOAT,[i.R8]:Ne.FLOAT,[i.R8_SNORM]:Ne.FLOAT,[i.RG8]:Ne.FLOAT,[i.RG8_SNORM]:Ne.FLOAT,[i.RGB8]:Ne.FLOAT,[i.RGB8_SNORM]:Ne.FLOAT,[i.RGB565]:Ne.FLOAT,[i.RGBA4]:Ne.FLOAT,[i.RGB5_A1]:Ne.FLOAT,[i.RGBA8]:Ne.FLOAT,[i.RGBA8_SNORM]:Ne.FLOAT,[i.RGB10_A2]:Ne.FLOAT,[i.RGB10_A2UI]:Ne.FLOAT,[i.SRGB8]:Ne.FLOAT,[i.SRGB8_ALPHA8]:Ne.FLOAT,[i.R16F]:Ne.FLOAT,[i.RG16F]:Ne.FLOAT,[i.RGB16F]:Ne.FLOAT,[i.RGBA16F]:Ne.FLOAT,[i.R32F]:Ne.FLOAT,[i.RG32F]:Ne.FLOAT,[i.RGB32F]:Ne.FLOAT,[i.RGBA32F]:Ne.FLOAT,[i.R11F_G11F_B10F]:Ne.FLOAT,[i.RGB9_E5]:Ne.FLOAT,[i.R8I]:Ne.INT,[i.R8UI]:Ne.UINT,[i.R16I]:Ne.INT,[i.R16UI]:Ne.UINT,[i.R32I]:Ne.INT,[i.R32UI]:Ne.UINT,[i.RG8I]:Ne.INT,[i.RG8UI]:Ne.UINT,[i.RG16I]:Ne.INT,[i.RG16UI]:Ne.UINT,[i.RG32I]:Ne.INT,[i.RG32UI]:Ne.UINT,[i.RGB8I]:Ne.INT,[i.RGB8UI]:Ne.UINT,[i.RGB16I]:Ne.INT,[i.RGB16UI]:Ne.UINT,[i.RGB32I]:Ne.INT,[i.RGB32UI]:Ne.UINT,[i.RGBA8I]:Ne.INT,[i.RGBA8UI]:Ne.UINT,[i.RGBA16I]:Ne.INT,[i.RGBA16UI]:Ne.UINT,[i.RGBA32I]:Ne.INT,[i.RGBA32UI]:Ne.UINT,[i.DEPTH_COMPONENT16]:Ne.FLOAT,[i.DEPTH_COMPONENT24]:Ne.FLOAT,[i.DEPTH_COMPONENT32F]:Ne.FLOAT,[i.DEPTH_STENCIL]:Ne.FLOAT,[i.DEPTH24_STENCIL8]:Ne.FLOAT,[i.DEPTH32F_STENCIL8]:Ne.FLOAT}:e={[i.RGB]:Ne.FLOAT,[i.RGBA]:Ne.FLOAT,[i.ALPHA]:Ne.FLOAT,[i.LUMINANCE]:Ne.FLOAT,[i.LUMINANCE_ALPHA]:Ne.FLOAT,[i.DEPTH_STENCIL]:Ne.FLOAT},e}function rA(i){let e;return"WebGL2RenderingContext"in globalThis&&i instanceof globalThis.WebGL2RenderingContext?e={[$e.UNSIGNED_BYTE]:{[_e.RGBA]:i.RGBA8,[_e.RGB]:i.RGB8,[_e.RG]:i.RG8,[_e.RED]:i.R8,[_e.RGBA_INTEGER]:i.RGBA8UI,[_e.RGB_INTEGER]:i.RGB8UI,[_e.RG_INTEGER]:i.RG8UI,[_e.RED_INTEGER]:i.R8UI,[_e.ALPHA]:i.ALPHA,[_e.LUMINANCE]:i.LUMINANCE,[_e.LUMINANCE_ALPHA]:i.LUMINANCE_ALPHA},[$e.BYTE]:{[_e.RGBA]:i.RGBA8_SNORM,[_e.RGB]:i.RGB8_SNORM,[_e.RG]:i.RG8_SNORM,[_e.RED]:i.R8_SNORM,[_e.RGBA_INTEGER]:i.RGBA8I,[_e.RGB_INTEGER]:i.RGB8I,[_e.RG_INTEGER]:i.RG8I,[_e.RED_INTEGER]:i.R8I},[$e.UNSIGNED_SHORT]:{[_e.RGBA_INTEGER]:i.RGBA16UI,[_e.RGB_INTEGER]:i.RGB16UI,[_e.RG_INTEGER]:i.RG16UI,[_e.RED_INTEGER]:i.R16UI,[_e.DEPTH_COMPONENT]:i.DEPTH_COMPONENT16},[$e.SHORT]:{[_e.RGBA_INTEGER]:i.RGBA16I,[_e.RGB_INTEGER]:i.RGB16I,[_e.RG_INTEGER]:i.RG16I,[_e.RED_INTEGER]:i.R16I},[$e.UNSIGNED_INT]:{[_e.RGBA_INTEGER]:i.RGBA32UI,[_e.RGB_INTEGER]:i.RGB32UI,[_e.RG_INTEGER]:i.RG32UI,[_e.RED_INTEGER]:i.R32UI,[_e.DEPTH_COMPONENT]:i.DEPTH_COMPONENT24},[$e.INT]:{[_e.RGBA_INTEGER]:i.RGBA32I,[_e.RGB_INTEGER]:i.RGB32I,[_e.RG_INTEGER]:i.RG32I,[_e.RED_INTEGER]:i.R32I},[$e.FLOAT]:{[_e.RGBA]:i.RGBA32F,[_e.RGB]:i.RGB32F,[_e.RG]:i.RG32F,[_e.RED]:i.R32F,[_e.DEPTH_COMPONENT]:i.DEPTH_COMPONENT32F},[$e.HALF_FLOAT]:{[_e.RGBA]:i.RGBA16F,[_e.RGB]:i.RGB16F,[_e.RG]:i.RG16F,[_e.RED]:i.R16F},[$e.UNSIGNED_SHORT_5_6_5]:{[_e.RGB]:i.RGB565},[$e.UNSIGNED_SHORT_4_4_4_4]:{[_e.RGBA]:i.RGBA4},[$e.UNSIGNED_SHORT_5_5_5_1]:{[_e.RGBA]:i.RGB5_A1},[$e.UNSIGNED_INT_2_10_10_10_REV]:{[_e.RGBA]:i.RGB10_A2,[_e.RGBA_INTEGER]:i.RGB10_A2UI},[$e.UNSIGNED_INT_10F_11F_11F_REV]:{[_e.RGB]:i.R11F_G11F_B10F},[$e.UNSIGNED_INT_5_9_9_9_REV]:{[_e.RGB]:i.RGB9_E5},[$e.UNSIGNED_INT_24_8]:{[_e.DEPTH_STENCIL]:i.DEPTH24_STENCIL8},[$e.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[_e.DEPTH_STENCIL]:i.DEPTH32F_STENCIL8}}:e={[$e.UNSIGNED_BYTE]:{[_e.RGBA]:i.RGBA,[_e.RGB]:i.RGB,[_e.ALPHA]:i.ALPHA,[_e.LUMINANCE]:i.LUMINANCE,[_e.LUMINANCE_ALPHA]:i.LUMINANCE_ALPHA},[$e.UNSIGNED_SHORT_5_6_5]:{[_e.RGB]:i.RGB},[$e.UNSIGNED_SHORT_4_4_4_4]:{[_e.RGBA]:i.RGBA},[$e.UNSIGNED_SHORT_5_5_5_1]:{[_e.RGBA]:i.RGBA}},e}class Lb{constructor(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Qe,this.hasIntegerTextures=!1}contextChange(){const e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=rA(e),this.samplerTypes=nA(e);const t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=t;for(let n=0;n=0;--r){const o=t[r];o&&o._glTextures[n].samplerType!==Ne.FLOAT&&this.renderer.texture.unbind(o)}}initTexture(e){const t=new Gd(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),t}initTextureType(e,t){var s;t.internalFormat=((s=this.internalFormats[e.type])==null?void 0:s[e.format])??e.format,t.samplerType=this.samplerTypes[t.internalFormat]??Ne.FLOAT,this.webGLVersion===2&&e.type===$e.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type}updateTexture(e){var n;const t=e._glTextures[this.CONTEXT_UID];if(!t)return;const s=this.renderer;if(this.initTextureType(e,t),(n=e.resource)==null?void 0:n.upload(s,e,t))t.samplerType!==Ne.FLOAT&&(this.hasIntegerTextures=!0);else{const r=e.realWidth,o=e.realHeight,a=s.gl;(t.width!==r||t.height!==o||t.dirtyId<0)&&(t.width=r,t.height=o,a.texImage2D(e.target,0,t.internalFormat,r,o,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}destroyTexture(e,t){const{gl:s}=this;if(e=e.castToBaseTexture(),e._glTextures[this.CONTEXT_UID]&&(this.unbind(e),s.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){const n=this.managedTextures.indexOf(e);n!==-1&&Ko(this.managedTextures,n,1)}}updateTextureStyle(e){var s;const t=e._glTextures[this.CONTEXT_UID];t&&((e.mipmap===gi.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?t.mipmap=!1:t.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?t.wrapMode=Ii.CLAMP:t.wrapMode=e.wrapMode,(s=e.resource)!=null&&s.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)}setStyle(e,t){const s=this.gl;if(t.mipmap&&e.mipmap!==gi.ON_MANUAL&&s.generateMipmap(e.target),s.texParameteri(e.target,s.TEXTURE_WRAP_S,t.wrapMode),s.texParameteri(e.target,s.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){s.texParameteri(e.target,s.TEXTURE_MIN_FILTER,e.scaleMode===Ci.LINEAR?s.LINEAR_MIPMAP_LINEAR:s.NEAREST_MIPMAP_NEAREST);const n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===Ci.LINEAR){const r=Math.min(e.anisotropicLevel,s.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));s.texParameterf(e.target,n.TEXTURE_MAX_ANISOTROPY_EXT,r)}}else s.texParameteri(e.target,s.TEXTURE_MIN_FILTER,e.scaleMode===Ci.LINEAR?s.LINEAR:s.NEAREST);s.texParameteri(e.target,s.TEXTURE_MAG_FILTER,e.scaleMode===Ci.LINEAR?s.LINEAR:s.NEAREST)}destroy(){this.renderer=null}}Lb.extension={type:ke.RendererSystem,name:"texture"};Xe.add(Lb);class Bb{constructor(e){this.renderer=e}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){const{gl:t,CONTEXT_UID:s}=this,n=e._glTransformFeedbacks[s]||this.createGLTransformFeedback(e);t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,n)}unbind(){const{gl:e}=this;e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(e,t){const{gl:s,renderer:n}=this;t&&n.shader.bind(t),s.beginTransformFeedback(e)}endTransformFeedback(){const{gl:e}=this;e.endTransformFeedback()}createGLTransformFeedback(e){const{gl:t,renderer:s,CONTEXT_UID:n}=this,r=t.createTransformFeedback();e._glTransformFeedbacks[n]=r,t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,r);for(let o=0;o(i[i.INTERACTION=50]="INTERACTION",i[i.HIGH=25]="HIGH",i[i.NORMAL=0]="NORMAL",i[i.LOW=-25]="LOW",i[i.UTILITY=-50]="UTILITY",i))(ho||{});class jd{constructor(e,t=null,s=0,n=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=e,this.context=t,this.priority=s,this.once=n}match(e,t=null){return this.fn===e&&this.context===t}emit(e){this.fn&&(this.context?this.fn.call(this.context,e):this.fn(e));const t=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),t}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this}destroy(e=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const t=this.next;return this.next=e?null:t,this.previous=null,t}}const Nb=class Zs{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new jd(null,null,1/0),this.deltaMS=1/Zs.targetFPMS,this.elapsedMS=1/Zs.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(e,t,s=ho.NORMAL){return this._addListener(new jd(e,t,s))}addOnce(e,t,s=ho.NORMAL){return this._addListener(new jd(e,t,s,!0))}_addListener(e){let t=this._head.next,s=this._head;if(!t)e.connect(s);else{for(;t;){if(e.priority>t.priority){e.connect(s);break}s=t,t=t.next}e.previous||e.connect(s)}return this._startIfPossible(),this}remove(e,t){let s=this._head.next;for(;s;)s.match(e,t)?s=s.destroy():s=s.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){const r=e-this._lastFrame|0;if(r{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?Gs.shared:new Gs,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}Db.extension=ke.Application;Xe.add(Db);const Ub=[];Xe.handleByList(ke.Renderer,Ub);function oA(i){for(const e of Ub)if(e.test(i))return new e(i);throw new Error("Unable to auto-detect a suitable renderer.")}var aA=`attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -void main(void) -{ - gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vTextureCoord = aTextureCoord; -}`,lA=`attribute vec2 aVertexPosition; - -uniform mat3 projectionMatrix; - -varying vec2 vTextureCoord; - -uniform vec4 inputSize; -uniform vec4 outputFrame; - -vec4 filterVertexPosition( void ) -{ - vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; - - return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); -} - -vec2 filterTextureCoord( void ) -{ - return aVertexPosition * (outputFrame.zw * inputSize.zw); -} - -void main(void) -{ - gl_Position = filterVertexPosition(); - vTextureCoord = filterTextureCoord(); -} -`;const cA=aA,$b=lA;class Xb{constructor(e){this.renderer=e}contextChange(e){let t;if(this.renderer.context.webGLVersion===1){const s=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,s)}else{const s=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,s)}t>=ls.HIGH?this.multisample=ls.HIGH:t>=ls.MEDIUM?this.multisample=ls.MEDIUM:t>=ls.LOW?this.multisample=ls.LOW:this.multisample=ls.NONE}destroy(){}}Xb.extension={type:ke.RendererSystem,name:"_multisample"};Xe.add(Xb);class hA{constructor(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class Vb{constructor(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){const{gl:t,CONTEXT_UID:s}=this,n=e._glBuffers[s]||this.createGLBuffer(e);t.bindBuffer(e.type,n.buffer)}unbind(e){const{gl:t}=this;t.bindBuffer(e,null)}bindBufferBase(e,t){const{gl:s,CONTEXT_UID:n}=this;if(this.boundBufferBases[t]!==e){const r=e._glBuffers[n]||this.createGLBuffer(e);this.boundBufferBases[t]=e,s.bindBufferBase(s.UNIFORM_BUFFER,t,r.buffer)}}bindBufferRange(e,t,s){const{gl:n,CONTEXT_UID:r}=this;s=s||0;const o=e._glBuffers[r]||this.createGLBuffer(e);n.bindBufferRange(n.UNIFORM_BUFFER,t||0,o.buffer,s*256,256)}update(e){const{gl:t,CONTEXT_UID:s}=this,n=e._glBuffers[s]||this.createGLBuffer(e);if(e._updateID!==n.updateID)if(n.updateID=e._updateID,t.bindBuffer(e.type,n.buffer),n.byteLength>=e.data.byteLength)t.bufferSubData(e.type,0,e.data);else{const r=e.static?t.STATIC_DRAW:t.DYNAMIC_DRAW;n.byteLength=e.data.byteLength,t.bufferData(e.type,e.data,r)}}dispose(e,t){if(!this.managedBuffers[e.id])return;delete this.managedBuffers[e.id];const s=e._glBuffers[this.CONTEXT_UID],n=this.gl;e.disposeRunner.remove(this),s&&(t||n.deleteBuffer(s.buffer),delete e._glBuffers[this.CONTEXT_UID])}disposeAll(e){const t=Object.keys(this.managedBuffers);for(let s=0;st.resource).filter(t=>t).map(t=>t.load());return this._load=Promise.all(e).then(()=>{const{realWidth:t,realHeight:s}=this.items[0];return this.resize(t,s),this.update(),Promise.resolve(this)}),this._load}}class uA extends Gb{constructor(e,t){const{width:s,height:n}=t||{};let r,o;Array.isArray(e)?(r=e,o=e.length):o=e,super(o,{width:s,height:n}),r&&this.initFromArray(r,t)}addBaseTextureAt(e,t){if(e.resource)this.addResourceAt(e.resource,t);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(e){super.bind(e),e.target=qo.TEXTURE_2D_ARRAY}upload(e,t,s){const{length:n,itemDirtyIds:r,items:o}=this,{gl:a}=e;s.dirtyId<0&&a.texImage3D(a.TEXTURE_2D_ARRAY,0,s.internalFormat,this._width,this._height,n,0,t.format,s.type,null);for(let l=0;l0)if(e.resource)this.addResourceAt(e.resource,t);else throw new Error("CubeResource does not support copying of renderTexture.");else e.target=qo.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this}upload(e,t,s){const n=this.itemDirtyIds;for(let r=0;r{if(this.url===null){e(this);return}try{const s=await Le.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const n=await s.blob();if(this.destroyed)return;const r=await createImageBitmap(n,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===bs.UNPACK?"premultiply":"none"});if(this.destroyed){r.close();return}this.source=r,this.update(),e(this)}catch(s){if(this.destroyed)return;t(s),this.onError.emit(s)}}),this._load)}upload(e,t,s){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(t.alphaMode=this.alphaMode),super.upload(e,t,s)):(this.load(),!1)}dispose(){this.ownsImageBitmap&&this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof e=="string"||e instanceof ImageBitmap)}static get EMPTY(){return $o._EMPTY=$o._EMPTY??Le.ADAPTER.createCanvas(0,0),$o._EMPTY}}const qf=class Pc extends Gn{constructor(e,t){t=t||{},super(Le.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=e,this.scale=t.scale||1,this._overrideWidth=t.width,this._overrideHeight=t.height,this._resolve=null,this._crossorigin=t.crossorigin,this._load=null,t.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(e=>{if(this._resolve=()=>{this.update(),e(this)},Pc.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){const e=new Image;Gn.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=t=>{this._resolve&&(e.onerror=null,this.onError.emit(t))},e.onload=()=>{if(!this._resolve)return;const t=e.width,s=e.height;if(!t||!s)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let n=t*this.scale,r=s*this.scale;(this._overrideWidth||this._overrideHeight)&&(n=this._overrideWidth||this._overrideHeight/s*t,r=this._overrideHeight||this._overrideWidth/t*s),n=Math.round(n),r=Math.round(r);const o=this.source;o.width=n,o.height=r,o._pixiId=`canvas_${co()}`,o.getContext("2d").drawImage(e,0,0,t,s,0,0,n,r),this._resolve(),this._resolve=null}}static getSize(e){const t=Pc.SVG_SIZE.exec(e),s={};return t&&(s[t[1]]=Math.round(parseFloat(t[3])),s[t[5]]=Math.round(parseFloat(t[7]))),s}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(e,t){return t==="svg"||typeof e=="string"&&e.startsWith("data:image/svg+xml")||typeof e=="string"&&Pc.SVG_XML.test(e)}};qf.SVG_XML=/^(<\?xml[^?]+\?>)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;let Kf=qf;class mA extends Gn{constructor(e){super(e)}static test(e){return!!globalThis.VideoFrame&&e instanceof globalThis.VideoFrame}}const Zf=class Jf extends Gn{constructor(e,t){if(t=t||{},!(e instanceof HTMLVideoElement)){const s=document.createElement("video");t.autoLoad!==!1&&s.setAttribute("preload","auto"),t.playsinline!==!1&&(s.setAttribute("webkit-playsinline",""),s.setAttribute("playsinline","")),t.muted===!0&&(s.setAttribute("muted",""),s.muted=!0),t.loop===!0&&s.setAttribute("loop",""),t.autoPlay!==!1&&s.setAttribute("autoplay",""),typeof e=="string"&&(e=[e]);const n=e[0].src||e[0];Gn.crossOrigin(s,n,t.crossorigin);for(let r=0;r{this.valid?t(this):(this._resolve=t,this._reject=s,e.load())}),this._load}_onError(e){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){const e=this.source;return!e.paused&&!e.ended}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}_onCanPlay(){const e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);const t=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!t&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()}dispose(){this._configureAutoUpdate();const e=this.source;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.source.requestVideoFrameCallback?(this._isConnectedToTicker&&(Gs.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(Gs.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Gs.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e,t){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||Jf.TYPES.includes(t)}};Zf.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],Zf.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let Hb=Zf;Df.push($o,yb,dA,Hb,mA,Kf,ru,fA,uA);class yl{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(e){return this.minX>this.maxX||this.minY>this.maxY?ot.EMPTY:(e=e||new ot(0,0,1,1),e.x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)}addPoint(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)}addPointMatrix(e,t){const{a:s,b:n,c:r,d:o,tx:a,ty:l}=e,c=s*t.x+r*t.y+a,h=n*t.x+o*t.y+l;this.minX=Math.min(this.minX,c),this.maxX=Math.max(this.maxX,c),this.minY=Math.min(this.minY,h),this.maxY=Math.max(this.maxY,h)}addQuad(e){let t=this.minX,s=this.minY,n=this.maxX,r=this.maxY,o=e[0],a=e[1];t=on?o:n,r=a>r?a:r,o=e[2],a=e[3],t=on?o:n,r=a>r?a:r,o=e[4],a=e[5],t=on?o:n,r=a>r?a:r,o=e[6],a=e[7],t=on?o:n,r=a>r?a:r,this.minX=t,this.minY=s,this.maxX=n,this.maxY=r}addFrame(e,t,s,n,r){this.addFrameMatrix(e.worldTransform,t,s,n,r)}addFrameMatrix(e,t,s,n,r){const o=e.a,a=e.b,l=e.c,c=e.d,h=e.tx,u=e.ty;let d=this.minX,f=this.minY,p=this.maxX,m=this.maxY,g=o*t+l*s+h,v=a*t+c*s+u;d=gp?g:p,m=v>m?v:m,g=o*n+l*s+h,v=a*n+c*s+u,d=gp?g:p,m=v>m?v:m,g=o*t+l*r+h,v=a*t+c*r+u,d=gp?g:p,m=v>m?v:m,g=o*n+l*r+h,v=a*n+c*r+u,d=gp?g:p,m=v>m?v:m,this.minX=d,this.minY=f,this.maxX=p,this.maxY=m}addVertexData(e,t,s){let n=this.minX,r=this.minY,o=this.maxX,a=this.maxY;for(let l=t;lo?c:o,a=h>a?h:a}this.minX=n,this.minY=r,this.maxX=o,this.maxY=a}addVertices(e,t,s,n){this.addVerticesMatrix(e.worldTransform,t,s,n)}addVerticesMatrix(e,t,s,n,r=0,o=r){const a=e.a,l=e.b,c=e.c,h=e.d,u=e.tx,d=e.ty;let f=this.minX,p=this.minY,m=this.maxX,g=this.maxY;for(let v=s;vn?e.maxX:n,this.maxY=e.maxY>r?e.maxY:r}addBoundsMask(e,t){const s=e.minX>t.minX?e.minX:t.minX,n=e.minY>t.minY?e.minY:t.minY,r=e.maxXc?r:c,this.maxY=o>h?o:h}}addBoundsMatrix(e,t){this.addFrameMatrix(t,e.minX,e.minY,e.maxX,e.maxY)}addBoundsArea(e,t){const s=e.minX>t.x?e.minX:t.x,n=e.minY>t.y?e.minY:t.y,r=e.maxXc?r:c,this.maxY=o>h?o:h}}pad(e=0,t=e){this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t)}addFramePad(e,t,s,n,r,o){e-=r,t-=o,s+=r,n+=o,this.minX=this.minXs?this.maxX:s,this.minY=this.minYn?this.maxY:n}}class Kt extends El{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new up,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new yl,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(e){const t=Object.keys(e);for(let s=0;s1)for(let t=0;tthis.children.length)throw new Error(`${e}addChildAt: The index ${t} supplied is out of bounds ${this.children.length}`);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),this.emit("childAdded",e,this,t),e}swapChildren(e,t){if(e===t)return;const s=this.getChildIndex(e),n=this.getChildIndex(t);this.children[s]=t,this.children[n]=e,this.onChildrenChange(s=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);const s=this.getChildIndex(e);Ko(this.children,s,1),this.children.splice(t,0,e),this.onChildrenChange(t)}getChildAt(e){if(e<0||e>=this.children.length)throw new Error(`getChildAt: Index (${e}) does not exist.`);return this.children[e]}removeChild(...e){if(e.length>1)for(let t=0;t0&&r<=n){o=this.children.splice(s,r);for(let a=0;a1&&this.children.sort(vA),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let e=0,t=this.children.length;e0&&t.height>0))return;let s,n;this.cullArea?(s=this.cullArea,n=this.worldTransform):this._render!==Qf.prototype._render&&(s=this.getBounds(!0));const r=e.projection.transform;if(r&&(n?(n=gA.copyFrom(n),n.prepend(r)):n=r),s&&t.intersects(s,n))this._render(e);else if(this.cullArea)return;for(let o=0,a=this.children.length;o=n&&Fa.x=r&&Fa.y=t&&(o=i-a-1),l=l.replace("%value%",e[o].toString()),n+=l,n+=` -`}return s=s.replace("%blur%",n),s=s.replace("%size%",i.toString()),s}const _A=` - attribute vec2 aVertexPosition; - - uniform mat3 projectionMatrix; - - uniform float strength; - - varying vec2 vBlurTexCoords[%size%]; - - uniform vec4 inputSize; - uniform vec4 outputFrame; - - vec4 filterVertexPosition( void ) - { - vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; - - return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); - } - - vec2 filterTextureCoord( void ) - { - return aVertexPosition * (outputFrame.zw * inputSize.zw); - } - - void main(void) - { - gl_Position = filterVertexPosition(); - - vec2 textureCoord = filterTextureCoord(); - %blur% - }`;function CA(i,e){const t=Math.ceil(i/2);let s=_A,n="",r;e?r="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":r="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(let o=0;o 0.0) { - c.rgb /= c.a; - } - - vec4 result; - - result.r = (m[0] * c.r); - result.r += (m[1] * c.g); - result.r += (m[2] * c.b); - result.r += (m[3] * c.a); - result.r += m[4]; - - result.g = (m[5] * c.r); - result.g += (m[6] * c.g); - result.g += (m[7] * c.b); - result.g += (m[8] * c.a); - result.g += m[9]; - - result.b = (m[10] * c.r); - result.b += (m[11] * c.g); - result.b += (m[12] * c.b); - result.b += (m[13] * c.a); - result.b += m[14]; - - result.a = (m[15] * c.r); - result.a += (m[16] * c.g); - result.a += (m[17] * c.b); - result.a += (m[18] * c.a); - result.a += m[19]; - - vec3 rgb = mix(c.rgb, result.rgb, uAlpha); - - // Premultiply alpha again. - rgb *= result.a; - - gl_FragColor = vec4(rgb, result.a); -} -`;class tm extends Ys{constructor(){const e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};super($b,EA,e),this.alpha=1}_loadMatrix(e,t=!1){let s=e;t&&(this._multiply(s,this.uniforms.m,e),s=this._colorMatrix(s)),this.uniforms.m=s}_multiply(e,t,s){return e[0]=t[0]*s[0]+t[1]*s[5]+t[2]*s[10]+t[3]*s[15],e[1]=t[0]*s[1]+t[1]*s[6]+t[2]*s[11]+t[3]*s[16],e[2]=t[0]*s[2]+t[1]*s[7]+t[2]*s[12]+t[3]*s[17],e[3]=t[0]*s[3]+t[1]*s[8]+t[2]*s[13]+t[3]*s[18],e[4]=t[0]*s[4]+t[1]*s[9]+t[2]*s[14]+t[3]*s[19]+t[4],e[5]=t[5]*s[0]+t[6]*s[5]+t[7]*s[10]+t[8]*s[15],e[6]=t[5]*s[1]+t[6]*s[6]+t[7]*s[11]+t[8]*s[16],e[7]=t[5]*s[2]+t[6]*s[7]+t[7]*s[12]+t[8]*s[17],e[8]=t[5]*s[3]+t[6]*s[8]+t[7]*s[13]+t[8]*s[18],e[9]=t[5]*s[4]+t[6]*s[9]+t[7]*s[14]+t[8]*s[19]+t[9],e[10]=t[10]*s[0]+t[11]*s[5]+t[12]*s[10]+t[13]*s[15],e[11]=t[10]*s[1]+t[11]*s[6]+t[12]*s[11]+t[13]*s[16],e[12]=t[10]*s[2]+t[11]*s[7]+t[12]*s[12]+t[13]*s[17],e[13]=t[10]*s[3]+t[11]*s[8]+t[12]*s[13]+t[13]*s[18],e[14]=t[10]*s[4]+t[11]*s[9]+t[12]*s[14]+t[13]*s[19]+t[14],e[15]=t[15]*s[0]+t[16]*s[5]+t[17]*s[10]+t[18]*s[15],e[16]=t[15]*s[1]+t[16]*s[6]+t[17]*s[11]+t[18]*s[16],e[17]=t[15]*s[2]+t[16]*s[7]+t[17]*s[12]+t[18]*s[17],e[18]=t[15]*s[3]+t[16]*s[8]+t[17]*s[13]+t[18]*s[18],e[19]=t[15]*s[4]+t[16]*s[9]+t[17]*s[14]+t[18]*s[19]+t[19],e}_colorMatrix(e){const t=new Float32Array(e);return t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,t}brightness(e,t){const s=[e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0];this._loadMatrix(s,t)}tint(e,t){const[s,n,r]=Et.shared.setValue(e).toArray(),o=[s,0,0,0,0,0,n,0,0,0,0,0,r,0,0,0,0,0,1,0];this._loadMatrix(o,t)}greyscale(e,t){const s=[e,e,e,0,0,e,e,e,0,0,e,e,e,0,0,0,0,0,1,0];this._loadMatrix(s,t)}blackAndWhite(e){const t=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(t,e)}hue(e,t){e=(e||0)/180*Math.PI;const s=Math.cos(e),n=Math.sin(e),r=Math.sqrt,o=1/3,a=r(o),l=s+(1-s)*o,c=o*(1-s)-a*n,h=o*(1-s)+a*n,u=o*(1-s)+a*n,d=s+o*(1-s),f=o*(1-s)-a*n,p=o*(1-s)-a*n,m=o*(1-s)+a*n,g=s+o*(1-s),v=[l,c,h,0,0,u,d,f,0,0,p,m,g,0,0,0,0,0,1,0];this._loadMatrix(v,t)}contrast(e,t){const s=(e||0)+1,n=-.5*(s-1),r=[s,0,0,0,n,0,s,0,0,n,0,0,s,0,n,0,0,0,1,0];this._loadMatrix(r,t)}saturate(e=0,t){const s=e*2/3+1,n=(s-1)*-.5,r=[s,n,n,0,0,n,s,n,0,0,n,n,s,0,0,0,0,0,1,0];this._loadMatrix(r,t)}desaturate(){this.saturate(-1)}negative(e){const t=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(t,e)}sepia(e){const t=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(t,e)}technicolor(e){const t=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(t,e)}polaroid(e){const t=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(t,e)}toBGR(e){const t=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(t,e)}kodachrome(e){const t=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(t,e)}browni(e){const t=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(t,e)}vintage(e){const t=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(t,e)}colorTone(e,t,s,n,r){e=e||.2,t=t||.15,s=s||16770432,n=n||3375104;const o=Et.shared,[a,l,c]=o.setValue(s).toArray(),[h,u,d]=o.setValue(n).toArray(),f=[.3,.59,.11,0,0,a,l,c,e,0,h,u,d,t,0,a-h,l-u,c-d,0,0];this._loadMatrix(f,r)}night(e,t){e=e||.1;const s=[e*-2,-e,0,0,0,-e,0,e,0,0,0,e,e*2,0,0,0,0,0,1,0];this._loadMatrix(s,t)}predator(e,t){const s=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(s,t)}lsd(e){const t=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(t,e)}reset(){const e=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(e,!1)}get matrix(){return this.uniforms.m}set matrix(e){this.uniforms.m=e}get alpha(){return this.uniforms.uAlpha}set alpha(e){this.uniforms.uAlpha=e}}tm.prototype.grayscale=tm.prototype.greyscale;var IA=`varying vec2 vFilterCoord; -varying vec2 vTextureCoord; - -uniform vec2 scale; -uniform mat2 rotation; -uniform sampler2D uSampler; -uniform sampler2D mapSampler; - -uniform highp vec4 inputSize; -uniform vec4 inputClamp; - -void main(void) -{ - vec4 map = texture2D(mapSampler, vFilterCoord); - - map -= 0.5; - map.xy = scale * inputSize.zw * (rotation * map.xy); - - gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw)); -} -`,RA=`attribute vec2 aVertexPosition; - -uniform mat3 projectionMatrix; -uniform mat3 filterMatrix; - -varying vec2 vTextureCoord; -varying vec2 vFilterCoord; - -uniform vec4 inputSize; -uniform vec4 outputFrame; - -vec4 filterVertexPosition( void ) -{ - vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; - - return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); -} - -vec2 filterTextureCoord( void ) -{ - return aVertexPosition * (outputFrame.zw * inputSize.zw); -} - -void main(void) -{ - gl_Position = filterVertexPosition(); - vTextureCoord = filterTextureCoord(); - vFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy; -} -`;class PA extends Ys{constructor(e,t){const s=new Ot;e.renderable=!1,super(RA,IA,{mapSampler:e._texture,filterMatrix:s,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=s,t==null&&(t=20),this.scale=new vt(t,t)}apply(e,t,s,n){this.uniforms.filterMatrix=e.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;const r=this.maskSprite.worldTransform,o=Math.sqrt(r.a*r.a+r.b*r.b),a=Math.sqrt(r.c*r.c+r.d*r.d);o!==0&&a!==0&&(this.uniforms.rotation[0]=r.a/o,this.uniforms.rotation[1]=r.b/o,this.uniforms.rotation[2]=r.c/a,this.uniforms.rotation[3]=r.d/a),e.applyFilter(this,t,s,n)}get map(){return this.uniforms.mapSampler}set map(e){this.uniforms.mapSampler=e}}var kA=`varying vec2 v_rgbNW; -varying vec2 v_rgbNE; -varying vec2 v_rgbSW; -varying vec2 v_rgbSE; -varying vec2 v_rgbM; - -varying vec2 vFragCoord; -uniform sampler2D uSampler; -uniform highp vec4 inputSize; - - -/** - Basic FXAA implementation based on the code on geeks3d.com with the - modification that the texture2DLod stuff was removed since it's - unsupported by WebGL. - - -- - - From: - https://github.com/mitsuhiko/webgl-meincraft - - Copyright (c) 2011 by Armin Ronacher. - - Some rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * The names of the contributors may not be used to endorse or - promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FXAA_REDUCE_MIN -#define FXAA_REDUCE_MIN (1.0/ 128.0) -#endif -#ifndef FXAA_REDUCE_MUL -#define FXAA_REDUCE_MUL (1.0 / 8.0) -#endif -#ifndef FXAA_SPAN_MAX -#define FXAA_SPAN_MAX 8.0 -#endif - -//optimized version for mobile, where dependent -//texture reads can be a bottleneck -vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP, - vec2 v_rgbNW, vec2 v_rgbNE, - vec2 v_rgbSW, vec2 v_rgbSE, - vec2 v_rgbM) { - vec4 color; - vec3 rgbNW = texture2D(tex, v_rgbNW).xyz; - vec3 rgbNE = texture2D(tex, v_rgbNE).xyz; - vec3 rgbSW = texture2D(tex, v_rgbSW).xyz; - vec3 rgbSE = texture2D(tex, v_rgbSE).xyz; - vec4 texColor = texture2D(tex, v_rgbM); - vec3 rgbM = texColor.xyz; - vec3 luma = vec3(0.299, 0.587, 0.114); - float lumaNW = dot(rgbNW, luma); - float lumaNE = dot(rgbNE, luma); - float lumaSW = dot(rgbSW, luma); - float lumaSE = dot(rgbSE, luma); - float lumaM = dot(rgbM, luma); - float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE))); - float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE))); - - mediump vec2 dir; - dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE)); - dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE)); - - float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) * - (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN); - - float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce); - dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX), - max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX), - dir * rcpDirMin)) * inverseVP; - - vec3 rgbA = 0.5 * ( - texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz + - texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz); - vec3 rgbB = rgbA * 0.5 + 0.25 * ( - texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz + - texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz); - - float lumaB = dot(rgbB, luma); - if ((lumaB < lumaMin) || (lumaB > lumaMax)) - color = vec4(rgbA, texColor.a); - else - color = vec4(rgbB, texColor.a); - return color; -} - -void main() { - - vec4 color; - - color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM); - - gl_FragColor = color; -} -`,FA=` -attribute vec2 aVertexPosition; - -uniform mat3 projectionMatrix; - -varying vec2 v_rgbNW; -varying vec2 v_rgbNE; -varying vec2 v_rgbSW; -varying vec2 v_rgbSE; -varying vec2 v_rgbM; - -varying vec2 vFragCoord; - -uniform vec4 inputSize; -uniform vec4 outputFrame; - -vec4 filterVertexPosition( void ) -{ - vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; - - return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); -} - -void texcoords(vec2 fragCoord, vec2 inverseVP, - out vec2 v_rgbNW, out vec2 v_rgbNE, - out vec2 v_rgbSW, out vec2 v_rgbSE, - out vec2 v_rgbM) { - v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP; - v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP; - v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP; - v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP; - v_rgbM = vec2(fragCoord * inverseVP); -} - -void main(void) { - - gl_Position = filterVertexPosition(); - - vFragCoord = aVertexPosition * outputFrame.zw; - - texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM); -} -`;class OA extends Ys{constructor(){super(FA,kA)}}var LA=`precision highp float; - -varying vec2 vTextureCoord; -varying vec4 vColor; - -uniform float uNoise; -uniform float uSeed; -uniform sampler2D uSampler; - -float rand(vec2 co) -{ - return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); -} - -void main() -{ - vec4 color = texture2D(uSampler, vTextureCoord); - float randomValue = rand(gl_FragCoord.xy * uSeed); - float diff = (randomValue - 0.5) * uNoise; - - // Un-premultiply alpha before applying the color matrix. See issue #3539. - if (color.a > 0.0) { - color.rgb /= color.a; - } - - color.r += diff; - color.g += diff; - color.b += diff; - - // Premultiply alpha again. - color.rgb *= color.a; - - gl_FragColor = color; -} -`;class BA extends Ys{constructor(e=.5,t=Math.random()){super($b,LA,{uNoise:0,uSeed:0}),this.noise=e,this.seed=t}get noise(){return this.uniforms.uNoise}set noise(e){this.uniforms.uNoise=e}get seed(){return this.uniforms.uSeed}set seed(e){this.uniforms.uSeed=e}}const av={AlphaFilter:wA,BlurFilter:AA,BlurFilterPass:em,ColorMatrixFilter:tm,DisplacementFilter:PA,FXAAFilter:OA,NoiseFilter:BA};Object.entries(av).forEach(([i,e])=>{Object.defineProperty(av,i,{get(){return ht("7.1.0",`filters.${i} has moved to ${i}`),e}})});class NA{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e}addTickerListener(){this.tickerAdded||!this.domElement||(Gs.system.add(this.tickerUpdate,this,ho.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&(Gs.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)}pointerMoved(){this._didMove=!0}update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const e=this.events.rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType==="touch"||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:e.clientX,clientY:e.clientY}))}tickerUpdate(e){this._deltaTime+=e,!(this._deltaTimes.priority-n.priority)}dispatchEvent(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.dispatch.emit(t||e.type,e)}mapEvent(e){if(!this.rootTarget)return;const t=this.mappingTable[e.type];if(t)for(let s=0,n=t.length;s=0;n--)if(e.currentTarget=s[n],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,s=this._allInteractiveElements){if(s.length===0)return;e.eventPhase=e.BUBBLING_PHASE;const n=Array.isArray(t)?t:[t];for(let r=s.length-1;r>=0;r--)n.forEach(o=>{e.currentTarget=s[r],this.notifyTarget(e,o)})}propagationPath(e){const t=[e];for(let s=0;s=0;u--){const d=h[u],f=this.hitTestMoveRecursive(d,this._isInteractive(t)?t:d.eventMode,s,n,r,o||r(e,s));if(f){if(f.length>0&&!f[f.length-1].parent)continue;const p=e.isInteractive();(f.length>0||p)&&(p&&this._allInteractiveElements.push(e),f.push(e)),this._hitElements.length===0&&(this._hitElements=f),a=!0}}}const l=this._isInteractive(t),c=e.isInteractive();return l&&c&&this._allInteractiveElements.push(e),o||this._hitElements.length>0?null:a?this._hitElements:l&&!r(e,s)&&n(e,s)?c?[e]:[]:null}hitTestRecursive(e,t,s,n,r){if(this._interactivePrune(e)||r(e,s))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(lr.pauseUpdate=!1),e.interactiveChildren&&e.children){const l=e.children;for(let c=l.length-1;c>=0;c--){const h=l[c],u=this.hitTestRecursive(h,this._isInteractive(t)?t:h.eventMode,s,n,r);if(u){if(u.length>0&&!u[u.length-1].parent)continue;const d=e.isInteractive();return(u.length>0||d)&&u.push(e),u}}}const o=this._isInteractive(t),a=e.isInteractive();return o&&n(e,s)?a?[e]:[]:null}_isInteractive(e){return e==="static"||e==="dynamic"}_interactivePrune(e){return!!(!e||e.isMask||!e.visible||!e.renderable||e.eventMode==="none"||e.eventMode==="passive"&&!e.interactiveChildren||e.isMask)}hitPruneFn(e,t){var s;if(e.hitArea&&(e.worldTransform.applyInverse(t,Hd),!e.hitArea.contains(Hd.x,Hd.y)))return!0;if(e._mask){const n=e._mask.isMaskData?e._mask.maskObject:e._mask;if(n&&!((s=n.containsPoint)!=null&&s.call(n,t)))return!0}return!1}hitTestFn(e,t){return e.eventMode==="passive"?!1:e.hitArea?!0:e.containsPoint?e.containsPoint(t):!1}notifyTarget(e,t){var r,o;t=t??e.type;const s=`on${t}`;(o=(r=e.currentTarget)[s])==null||o.call(r,e);const n=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?`${t}capture`:t;this.notifyListeners(e,n),e.eventPhase===e.AT_TARGET&&this.notifyListeners(e,t)}mapPointerDown(e){if(!(e instanceof Si)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.createPointerEvent(e);if(this.dispatchEvent(t,"pointerdown"),t.pointerType==="touch")this.dispatchEvent(t,"touchstart");else if(t.pointerType==="mouse"||t.pointerType==="pen"){const n=t.button===2;this.dispatchEvent(t,n?"rightdown":"mousedown")}const s=this.trackingData(e.pointerId);s.pressTargetsByButton[e.button]=t.composedPath(),this.freeEvent(t)}mapPointerMove(e){var l,c;if(!(e instanceof Si)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const t=this.createPointerEvent(e);this._isPointerMoveEvent=!1;const s=t.pointerType==="mouse"||t.pointerType==="pen",n=this.trackingData(e.pointerId),r=this.findMountedTarget(n.overTargets);if(((l=n.overTargets)==null?void 0:l.length)>0&&r!==t.target){const h=e.type==="mousemove"?"mouseout":"pointerout",u=this.createPointerEvent(e,h,r);if(this.dispatchEvent(u,"pointerout"),s&&this.dispatchEvent(u,"mouseout"),!t.composedPath().includes(r)){const d=this.createPointerEvent(e,"pointerleave",r);for(d.eventPhase=d.AT_TARGET;d.target&&!t.composedPath().includes(d.target);)d.currentTarget=d.target,this.notifyTarget(d),s&&this.notifyTarget(d,"mouseleave"),d.target=d.target.parent;this.freeEvent(d)}this.freeEvent(u)}if(r!==t.target){const h=e.type==="mousemove"?"mouseover":"pointerover",u=this.clonePointerEvent(t,h);this.dispatchEvent(u,"pointerover"),s&&this.dispatchEvent(u,"mouseover");let d=r==null?void 0:r.parent;for(;d&&d!==this.rootTarget.parent&&d!==t.target;)d=d.parent;if(!d||d===this.rootTarget.parent){const f=this.clonePointerEvent(t,"pointerenter");for(f.eventPhase=f.AT_TARGET;f.target&&f.target!==r&&f.target!==this.rootTarget.parent;)f.currentTarget=f.target,this.notifyTarget(f),s&&this.notifyTarget(f,"mouseenter"),f.target=f.target.parent;this.freeEvent(f)}this.freeEvent(u)}const o=[],a=this.enableGlobalMoveEvents??!0;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(t,"pointermove"),a&&o.push("globalpointermove"),t.pointerType==="touch"&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),a&&o.push("globaltouchmove")),s&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),a&&o.push("globalmousemove"),this.cursor=(c=t.target)==null?void 0:c.cursor),o.length>0&&this.all(t,o),this._allInteractiveElements.length=0,this._hitElements.length=0,n.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){var o;if(!(e instanceof Si)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),s=this.createPointerEvent(e),n=s.pointerType==="mouse"||s.pointerType==="pen";this.dispatchEvent(s,"pointerover"),n&&this.dispatchEvent(s,"mouseover"),s.pointerType==="mouse"&&(this.cursor=(o=s.target)==null?void 0:o.cursor);const r=this.clonePointerEvent(s,"pointerenter");for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==this.rootTarget.parent;)r.currentTarget=r.target,this.notifyTarget(r),n&&this.notifyTarget(r,"mouseenter"),r.target=r.target.parent;t.overTargets=s.composedPath(),this.freeEvent(s),this.freeEvent(r)}mapPointerOut(e){if(!(e instanceof Si)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId);if(t.overTargets){const s=e.pointerType==="mouse"||e.pointerType==="pen",n=this.findMountedTarget(t.overTargets),r=this.createPointerEvent(e,"pointerout",n);this.dispatchEvent(r),s&&this.dispatchEvent(r,"mouseout");const o=this.createPointerEvent(e,"pointerleave",n);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),s&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;t.overTargets=null,this.freeEvent(r),this.freeEvent(o)}this.cursor=null}mapPointerUp(e){if(!(e instanceof Si)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=performance.now(),s=this.createPointerEvent(e);if(this.dispatchEvent(s,"pointerup"),s.pointerType==="touch")this.dispatchEvent(s,"touchend");else if(s.pointerType==="mouse"||s.pointerType==="pen"){const a=s.button===2;this.dispatchEvent(s,a?"rightup":"mouseup")}const n=this.trackingData(e.pointerId),r=this.findMountedTarget(n.pressTargetsByButton[e.button]);let o=r;if(r&&!s.composedPath().includes(r)){let a=r;for(;a&&!s.composedPath().includes(a);){if(s.currentTarget=a,this.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch")this.notifyTarget(s,"touchendoutside");else if(s.pointerType==="mouse"||s.pointerType==="pen"){const l=s.button===2;this.notifyTarget(s,l?"rightupoutside":"mouseupoutside")}a=a.parent}delete n.pressTargetsByButton[e.button],o=a}if(o){const a=this.clonePointerEvent(s,"click");a.target=o,a.path=null,n.clicksByButton[e.button]||(n.clicksByButton[e.button]={clickCount:0,target:a.target,timeStamp:t});const l=n.clicksByButton[e.button];if(l.target===a.target&&t-l.timeStamp<200?++l.clickCount:l.clickCount=1,l.target=a.target,l.timeStamp=t,a.detail=l.clickCount,a.pointerType==="mouse"){const c=a.button===2;this.dispatchEvent(a,c?"rightclick":"click")}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a)}this.freeEvent(s)}mapPointerUpOutside(e){if(!(e instanceof Si)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),s=this.findMountedTarget(t.pressTargetsByButton[e.button]),n=this.createPointerEvent(e);if(s){let r=s;for(;r;)n.currentTarget=r,this.notifyTarget(n,"pointerupoutside"),n.pointerType==="touch"?this.notifyTarget(n,"touchendoutside"):(n.pointerType==="mouse"||n.pointerType==="pen")&&this.notifyTarget(n,n.button===2?"rightupoutside":"mouseupoutside"),r=r.parent;delete t.pressTargetsByButton[e.button]}this.freeEvent(n)}mapWheel(e){if(!(e instanceof Jo)){console.warn("EventBoundary cannot map a non-wheel event as a wheel event");return}const t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t)}findMountedTarget(e){if(!e)return null;let t=e[0];for(let s=1;s(s==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=n),t[s]=n,!0)}),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOverOut=this.onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{view:t,resolution:s}=this.renderer;this.setTargetElement(t),this.resolution=s,im._defaultEventMode=e.eventMode??"auto",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){this.setTargetElement(null),this.renderer=null}setCursor(e){e=e||"default";let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this.currentCursor===e)return;this.currentCursor=e;const s=this.cursorStyles[e];if(s)switch(typeof s){case"string":t&&(this.domElement.style.cursor=s);break;case"function":s(e);break;case"object":t&&Object.assign(this.domElement.style,s);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this.rootPointerEvent}onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this.normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let s=0,n=t.length;s0&&(t=e.composedPath()[0]);const s=t!==this.domElement?"outside":"",n=this.normalizeToPointerData(e);for(let r=0,o=n.length;r"u"&&(r.button=0),typeof r.buttons>"u"&&(r.buttons=1),typeof r.isPrimary>"u"&&(r.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof r.width>"u"&&(r.width=r.radiusX||1),typeof r.height>"u"&&(r.height=r.radiusY||1),typeof r.tiltX>"u"&&(r.tiltX=0),typeof r.tiltY>"u"&&(r.tiltY=0),typeof r.pointerType>"u"&&(r.pointerType="touch"),typeof r.pointerId>"u"&&(r.pointerId=r.identifier||0),typeof r.pressure>"u"&&(r.pressure=r.force||.5),typeof r.twist>"u"&&(r.twist=0),typeof r.tangentialPressure>"u"&&(r.tangentialPressure=0),typeof r.layerX>"u"&&(r.layerX=r.offsetX=r.clientX),typeof r.layerY>"u"&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,r.type=e.type,t.push(r)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){const s=e;typeof s.isPrimary>"u"&&(s.isPrimary=!0),typeof s.width>"u"&&(s.width=1),typeof s.height>"u"&&(s.height=1),typeof s.tiltX>"u"&&(s.tiltX=0),typeof s.tiltY>"u"&&(s.tiltY=0),typeof s.pointerType>"u"&&(s.pointerType="mouse"),typeof s.pointerId>"u"&&(s.pointerId=XA),typeof s.pressure>"u"&&(s.pressure=.5),typeof s.twist>"u"&&(s.twist=0),typeof s.tangentialPressure>"u"&&(s.tangentialPressure=0),s.isNormalized=!0,t.push(s)}else t.push(e);return t}normalizeWheelEvent(e){const t=this.rootWheelEvent;return this.transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this.transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=VA[e.type]||e.type),e}transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}};sm.extension={name:"events",type:[ke.RendererSystem,ke.CanvasRendererSystem]},sm.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let nm=sm;Xe.add(nm);function lv(i){return i==="dynamic"||i==="static"}const YA={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,_internalInteractive:void 0,get interactive(){return this._internalInteractive??lv(nm.defaultEventMode)},set interactive(i){ht("7.2.0","Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),this._internalInteractive=i,this.eventMode=i?"static":"auto"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??nm.defaultEventMode},set eventMode(i){this._internalInteractive=lv(i),this._internalEventMode=i},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(i,e,t){const s=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof t=="object"?t.signal:void 0,r=typeof t=="object"?t.once===!0:!1,o=typeof e=="function"?void 0:e;i=s?`${i}capture`:i;const a=typeof e=="function"?e:e.handleEvent,l=this;n&&n.addEventListener("abort",()=>{l.off(i,a,o)}),r?l.once(i,a,o):l.on(i,a,o)},removeEventListener(i,e,t){const s=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof e=="function"?void 0:e;i=s?`${i}capture`:i,e=typeof e=="function"?e:e.handleEvent,this.off(i,e,n)},dispatchEvent(i){if(!(i instanceof Il))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return i.defaultPrevented=!1,i.path=null,i.target=this,i.manager.dispatchEvent(i),!i.defaultPrevented}};Kt.mixin(YA);const GA={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};Kt.mixin(GA);const jA=9,sc=100,HA=0,WA=0,cv=2,hv=1,zA=-1e3,qA=-1e3,KA=2;class qb{constructor(e){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(In.tablet||In.phone)&&this.createTouchHook();const t=document.createElement("div");t.style.width=`${sc}px`,t.style.height=`${sc}px`,t.style.position="absolute",t.style.top=`${HA}px`,t.style.left=`${WA}px`,t.style.zIndex=cv.toString(),this.div=t,this.renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}createTouchHook(){const e=document.createElement("button");e.style.width=`${hv}px`,e.style.height=`${hv}px`,e.style.position="absolute",e.style.top=`${zA}px`,e.style.left=`${qA}px`,e.style.zIndex=KA.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this.activate(),this.destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}activate(){var e;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),(e=this.renderer.view.parentNode)==null||e.appendChild(this.div))}deactivate(){var e;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),(e=this.div.parentNode)==null||e.removeChild(this.div))}updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&e.isInteractive()&&(e._accessibleActive||this.addChild(e),e.renderId=this.renderId);const t=e.children;if(t)for(let s=0;s title : ${e.title}
tabIndex: ${e.tabIndex}`}capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:s}=this.renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>s&&(e.height=s-e.y)}addChild(e){let t=this.pool.pop();t||(t=document.createElement("button"),t.style.width=`${sc}px`,t.style.height=`${sc}px`,t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=cv.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`displayObject ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this.updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex}_dispatchEvent(e,t){const{displayObject:s}=e.target,n=this.renderer.events.rootBoundary,r=Object.assign(new Il(n),{target:s});n.rootTarget=this.renderer.lastObjectRendered,t.forEach(o=>n.dispatchEvent(r,o))}_onClick(e){this._dispatchEvent(e,["click","pointertap","tap"])}_onFocus(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive"),this._dispatchEvent(e,["mouseover"])}_onFocusOut(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite"),this._dispatchEvent(e,["mouseout"])}_onKeyDown(e){e.keyCode===jA&&this.activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this.deactivate()}destroy(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null}}qb.extension={name:"accessibility",type:[ke.RendererPlugin,ke.CanvasRendererPlugin]};Xe.add(qb);const Kb=class rm{constructor(e){this.stage=new gs,e=Object.assign({forceCanvas:!1},e),this.renderer=oA(e),rm._plugins.forEach(t=>{t.init.call(this,e)})}render(){this.renderer.render(this.stage)}get view(){var e;return(e=this.renderer)==null?void 0:e.view}get screen(){var e;return(e=this.renderer)==null?void 0:e.screen}destroy(e,t){const s=rm._plugins.slice(0);s.reverse(),s.forEach(n=>{n.destroy.call(this)}),this.stage.destroy(t),this.stage=null,this.renderer.destroy(e),this.renderer=null}};Kb._plugins=[];let Zb=Kb;Xe.handleByList(ke.Application,Zb._plugins);class Jb{static init(e){Object.defineProperty(this,"resizeTo",{set(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this.cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this.cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this.cancelResize();let t,s;if(this._resizeTo===globalThis.window)t=globalThis.innerWidth,s=globalThis.innerHeight;else{const{clientWidth:n,clientHeight:r}=this._resizeTo;t=n,s=r}this.renderer.resize(t,s),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}Jb.extension=ke.Application;Xe.add(Jb);const uv={loader:ke.LoadParser,resolver:ke.ResolveParser,cache:ke.CacheParser,detection:ke.DetectionParser};Xe.handle(ke.Asset,i=>{const e=i.ref;Object.entries(uv).filter(([t])=>!!e[t]).forEach(([t,s])=>Xe.add(Object.assign(e[t],{extension:e[t].extension??s})))},i=>{const e=i.ref;Object.keys(uv).filter(t=>!!e[t]).forEach(t=>Xe.remove(e[t]))});class ZA{constructor(e,t=!1){this._loader=e,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=t}add(e){e.forEach(t=>{this._assetList.push(t)}),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=!0;const e=[],t=Math.min(this._assetList.length,this._maxConcurrent);for(let s=0;s(Array.isArray(i)||(i=[i]),e?i.map(s=>typeof s=="string"||t?e(s):s):i),lh=(i,e)=>{const t=e.split("?")[1];return t&&(i+=`?${t}`),i};function Qb(i,e,t,s,n){const r=e[t];for(let o=0;o{const o=r.substring(1,r.length-1).split(",");n.push(o)}),Qb(i,n,0,t,s)}else s.push(i);return s}const ch=i=>!Array.isArray(i);class QA{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(e){return this._cache.has(e)}get(e){const t=this._cache.get(e);return t||console.warn(`[Assets] Asset id ${e} was not found in the Cache`),t}set(e,t){const s=Ti(e);let n;for(let a=0;a{n[a]=t}));const r=Object.keys(n),o={cacheKeys:r,keys:s};if(s.forEach(a=>{this._cacheMap.set(a,o)}),r.forEach(a=>{const l=n?n[a]:t;this._cache.has(a)&&this._cache.get(a)!==l&&console.warn("[Cache] already has key:",a),this._cache.set(a,n[a])}),t instanceof ze){const a=t;s.forEach(l=>{a.baseTexture!==ze.EMPTY.baseTexture&&Qe.addToCache(a.baseTexture,l),ze.addToCache(a,l)})}}remove(e){if(!this._cacheMap.has(e)){console.warn(`[Assets] Asset id ${e} was not found in the Cache`);return}const t=this._cacheMap.get(e);t.cacheKeys.forEach(s=>{this._cache.delete(s)}),t.keys.forEach(s=>{this._cacheMap.delete(s)})}get parsers(){return this._parsers}}const zr=new QA;class eE{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(e,t,s)=>(this._parsersValidated=!1,e[t]=s,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(e,t){const s={promise:null,parser:null};return s.promise=(async()=>{var o,a;let n=null,r=null;if(t.loadParser&&(r=this._parserHash[t.loadParser],r||console.warn(`[Assets] specified load parser "${t.loadParser}" not found while loading ${e}`)),!r){for(let l=0;l({alias:[c],src:c})),a=o.length,l=o.map(async c=>{const h=ts.toAbsolute(c.src);if(!n[c.src])try{this.promiseCache[h]||(this.promiseCache[h]=this._getLoadPromiseAndParser(h,c)),n[c.src]=await this.promiseCache[h].promise,t&&t(++s/a)}catch(u){throw delete this.promiseCache[h],delete n[c.src],new Error(`[Loader.load] Failed to load ${h}. -${u}`)}});return await Promise.all(l),r?n[o[0].src]:n}async unload(e){const t=Ti(e,s=>({alias:[s],src:s})).map(async s=>{var o,a;const n=ts.toAbsolute(s.src),r=this.promiseCache[n];if(r){const l=await r.promise;delete this.promiseCache[n],(a=(o=r.parser)==null?void 0:o.unload)==null||a.call(o,l,s,this)}});await Promise.all(t)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter(e=>e.name).reduce((e,t)=>(e[t.name]&&console.warn(`[Assets] loadParser name conflict "${t.name}"`),{...e,[t.name]:t}),{})}}var ii=(i=>(i[i.Low=0]="Low",i[i.Normal=1]="Normal",i[i.High=2]="High",i))(ii||{});const tE=".json",sE="application/json",iE={extension:{type:ke.LoadParser,priority:ii.Low},name:"loadJson",test(i){return ga(i,sE)||qs(i,tE)},async load(i){return await(await Le.ADAPTER.fetch(i)).json()}};Xe.add(iE);const nE=".txt",rE="text/plain",oE={name:"loadTxt",extension:{type:ke.LoadParser,priority:ii.Low},test(i){return ga(i,rE)||qs(i,nE)},async load(i){return await(await Le.ADAPTER.fetch(i)).text()}};Xe.add(oE);const aE=["normal","bold","100","200","300","400","500","600","700","800","900"],lE=[".ttf",".otf",".woff",".woff2"],cE=["font/ttf","font/otf","font/woff","font/woff2"],hE=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function uE(i){const e=ts.extname(i),t=ts.basename(i,e).replace(/(-|_)/g," ").toLowerCase().split(" ").map(r=>r.charAt(0).toUpperCase()+r.slice(1));let s=t.length>0;for(const r of t)if(!r.match(hE)){s=!1;break}let n=t.join(" ");return s||(n=`"${n.replace(/[\\"]/g,"\\$&")}"`),n}const dE=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;function fE(i){return dE.test(i)?i:encodeURI(i)}const mE={extension:{type:ke.LoadParser,priority:ii.Low},name:"loadWebFont",test(i){return ga(i,cE)||qs(i,lE)},async load(i,e){var s,n,r;const t=Le.ADAPTER.getFontFaceSet();if(t){const o=[],a=((s=e.data)==null?void 0:s.family)??uE(i),l=((r=(n=e.data)==null?void 0:n.weights)==null?void 0:r.filter(h=>aE.includes(h)))??["normal"],c=e.data??{};for(let h=0;hLe.ADAPTER.getFontFaceSet().delete(e))}};Xe.add(mE);const pE=`(function() { - "use strict"; - const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII="; - async function checkImageBitmap() { - try { - if (typeof createImageBitmap != "function") - return !1; - const imageBlob = await (await fetch(WHITE_PNG)).blob(), imageBitmap = await createImageBitmap(imageBlob); - return imageBitmap.width === 1 && imageBitmap.height === 1; - } catch { - return !1; - } - } - checkImageBitmap().then((result) => { - self.postMessage(result); - }); -})(); -`;let Qo=null,om=class{constructor(){Qo||(Qo=URL.createObjectURL(new Blob([pE],{type:"application/javascript"}))),this.worker=new Worker(Qo)}};om.revokeObjectURL=function(){Qo&&(URL.revokeObjectURL(Qo),Qo=null)};const gE=`(function() { - "use strict"; - async function loadImageBitmap(url) { - const response = await fetch(url); - if (!response.ok) - throw new Error(\`[WorkerManager.loadImageBitmap] Failed to fetch \${url}: \${response.status} \${response.statusText}\`); - const imageBlob = await response.blob(); - return await createImageBitmap(imageBlob); - } - self.onmessage = async (event) => { - try { - const imageBitmap = await loadImageBitmap(event.data.data[0]); - self.postMessage({ - data: imageBitmap, - uuid: event.data.uuid, - id: event.data.id - }, [imageBitmap]); - } catch (e) { - self.postMessage({ - error: e, - uuid: event.data.uuid, - id: event.data.id - }); - } - }; -})(); -`;let ea=null;class e1{constructor(){ea||(ea=URL.createObjectURL(new Blob([gE],{type:"application/javascript"}))),this.worker=new Worker(ea)}}e1.revokeObjectURL=function(){ea&&(URL.revokeObjectURL(ea),ea=null)};let dv=0,Wd;class vE{constructor(){this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}isImageBitmapSupported(){return this._isImageBitmapSupported!==void 0?this._isImageBitmapSupported:(this._isImageBitmapSupported=new Promise(e=>{const{worker:t}=new om;t.addEventListener("message",s=>{t.terminate(),om.revokeObjectURL(),e(s.data)})}),this._isImageBitmapSupported)}loadImageBitmap(e){return this._run("loadImageBitmap",[e])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){Wd===void 0&&(Wd=navigator.hardwareConcurrency||4);let e=this.workerPool.pop();return!e&&this._createdWorkers{this.complete(t.data),this.returnWorker(t.target),this.next()})),e}returnWorker(e){this.workerPool.push(e)}complete(e){e.error!==void 0?this.resolveHash[e.uuid].reject(e.error):this.resolveHash[e.uuid].resolve(e.data),this.resolveHash[e.uuid]=null}async _run(e,t){await this._initWorkers();const s=new Promise((n,r)=>{this.queue.push({id:e,arguments:t,resolve:n,reject:r})});return this.next(),s}next(){if(!this.queue.length)return;const e=this.getWorker();if(!e)return;const t=this.queue.pop(),s=t.id;this.resolveHash[dv]={resolve:t.resolve,reject:t.reject},e.postMessage({data:t.arguments,uuid:dv++,id:s})}}const fv=new vE;function Rl(i,e,t){i.resource.internal=!0;const s=new ze(i),n=()=>{delete e.promiseCache[t],zr.has(t)&&zr.remove(t)};return s.baseTexture.once("destroyed",()=>{t in e.promiseCache&&(console.warn("[Assets] A BaseTexture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the BaseTexture."),n())}),s.once("destroyed",()=>{i.destroyed||(console.warn("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),n())}),s}const yE=[".jpeg",".jpg",".png",".webp",".avif"],xE=["image/jpeg","image/png","image/webp","image/avif"];async function bE(i){const e=await Le.ADAPTER.fetch(i);if(!e.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${i}: ${e.status} ${e.statusText}`);const t=await e.blob();return await createImageBitmap(t)}const hu={name:"loadTextures",extension:{type:ke.LoadParser,priority:ii.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(i){return ga(i,xE)||qs(i,yE)},async load(i,e,t){var a;const s=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap;let n;s?this.config.preferWorkers&&await fv.isImageBitmapSupported()?n=await fv.loadImageBitmap(i):n=await bE(i):n=await new Promise((l,c)=>{const h=new Image;h.crossOrigin=this.config.crossOrigin,h.src=i,h.complete?l(h):(h.onload=()=>l(h),h.onerror=u=>c(u))});const r={...e.data};r.resolution??(r.resolution=Yn(i)),s&&((a=r.resourceOptions)==null?void 0:a.ownsImageBitmap)===void 0&&(r.resourceOptions={...r.resourceOptions},r.resourceOptions.ownsImageBitmap=!0);const o=new Qe(n,r);return o.resource.src=i,Rl(o,t,i)},unload(i){i.destroy(!0)}};Xe.add(hu);const wE=".svg",SE="image/svg+xml",ME={extension:{type:ke.LoadParser,priority:ii.High},name:"loadSVG",test(i){return ga(i,SE)||qs(i,wE)},async testParse(i){return Kf.test(i)},async parse(i,e,t){var r;const s=new Kf(i,(r=e==null?void 0:e.data)==null?void 0:r.resourceOptions);await s.load();const n=new Qe(s,{resolution:Yn(i),...e==null?void 0:e.data});return n.resource.src=e.src,Rl(n,t,e.src)},async load(i,e){return(await Le.ADAPTER.fetch(i)).text()},unload:hu.unload};Xe.add(ME);const TE=[".mp4",".m4v",".webm",".ogv"],_E=["video/mp4","video/webm","video/ogg"],CE={name:"loadVideo",extension:{type:ke.LoadParser,priority:ii.High},config:{defaultAutoPlay:!0,defaultUpdateFPS:0,defaultLoop:!1,defaultMuted:!1,defaultPlaysinline:!0},test(i){return ga(i,_E)||qs(i,TE)},async load(i,e,t){var o;let s;const n=await(await Le.ADAPTER.fetch(i)).blob(),r=URL.createObjectURL(n);try{const a={autoPlay:this.config.defaultAutoPlay,updateFPS:this.config.defaultUpdateFPS,loop:this.config.defaultLoop,muted:this.config.defaultMuted,playsinline:this.config.defaultPlaysinline,...(o=e==null?void 0:e.data)==null?void 0:o.resourceOptions,autoLoad:!0},l=new Hb(r,a);await l.load();const c=new Qe(l,{alphaMode:await F2(),resolution:Yn(i),...e==null?void 0:e.data});c.resource.src=i,s=Rl(c,t,i),s.baseTexture.once("destroyed",()=>{URL.revokeObjectURL(r)})}catch(a){throw URL.revokeObjectURL(r),a}return s},unload(i){i.destroy(!0)}};Xe.add(CE);class AE{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(e,t)=>`${e}${this._bundleIdConnector}${t}`,extractAssetIdFromBundle:(e,t)=>t.replace(`${e}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...e){e.forEach(t=>{this._preferredOrder.push(t),t.priority||(t.priority=Object.keys(t.params))}),this._resolverHash={}}set basePath(e){this._basePath=e}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(e){if(typeof e=="string")this._defaultSearchParams=e;else{const t=e;this._defaultSearchParams=Object.keys(t).map(s=>`${encodeURIComponent(s)}=${encodeURIComponent(t[s])}`).join("&")}}getAlias(e){const{alias:t,name:s,src:n,srcs:r}=e;return Ti(t||s||n||r,o=>typeof o=="string"?o:Array.isArray(o)?o.map(a=>(a==null?void 0:a.src)??(a==null?void 0:a.srcs)??a):o!=null&&o.src||o!=null&&o.srcs?o.src??o.srcs:o,!0)}addManifest(e){this._manifest&&console.warn("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=e,e.bundles.forEach(t=>{this.addBundle(t.name,t.assets)})}addBundle(e,t){const s=[];Array.isArray(t)?t.forEach(n=>{const r=n.src??n.srcs,o=n.alias??n.name;let a;if(typeof o=="string"){const l=this._createBundleAssetId(e,o);s.push(l),a=[o,l]}else{const l=o.map(c=>this._createBundleAssetId(e,c));s.push(...l),a=[...o,...l]}this.add({...n,alias:a,src:r})}):Object.keys(t).forEach(n=>{const r=[n,this._createBundleAssetId(e,n)];if(typeof t[n]=="string")this.add({alias:r,src:t[n]});else if(Array.isArray(t[n]))this.add({alias:r,src:t[n]});else{const o=t[n],a=o.src??o.srcs;this.add({...o,alias:r,src:Array.isArray(a)?a:[a]})}s.push(...r)}),this._bundles[e]=s}add(e,t,s,n,r){const o=[];typeof e=="string"||Array.isArray(e)&&typeof e[0]=="string"?(ht("7.2.0",`Assets.add now uses an object instead of individual parameters. -Please use Assets.add({ alias, src, data, format, loadParser }) instead.`),o.push({alias:e,src:t,data:s,format:n,loadParser:r})):Array.isArray(e)?o.push(...e):o.push(e);let a;a=l=>{this.hasKey(l)&&console.warn(`[Resolver] already has key: ${l} overwriting`)},Ti(o).forEach(l=>{const{src:c,srcs:h}=l;let{data:u,format:d,loadParser:f}=l;const p=Ti(c||h).map(v=>typeof v=="string"?JA(v):Array.isArray(v)?v:[v]),m=this.getAlias(l);Array.isArray(m)?m.forEach(a):a(m);const g=[];p.forEach(v=>{v.forEach(y=>{let x={};if(typeof y!="object"){x.src=y;for(let M=0;M{this._assetMap[v]=g})})}resolveBundle(e){const t=ch(e);e=Ti(e);const s={};return e.forEach(n=>{const r=this._bundles[n];if(r){const o=this.resolve(r),a={};for(const l in o){const c=o[l];a[this._extractAssetIdFromBundle(n,l)]=c}s[n]=a}}),t?s[e[0]]:s}resolveUrl(e){const t=this.resolve(e);if(typeof e!="string"){const s={};for(const n in t)s[n]=t[n].src;return s}return t.src}resolve(e){const t=ch(e);e=Ti(e);const s={};return e.forEach(n=>{if(!this._resolverHash[n])if(this._assetMap[n]){let r=this._assetMap[n];const o=r[0],a=this._getPreferredOrder(r);a==null||a.priority.forEach(l=>{a.params[l].forEach(c=>{const h=r.filter(u=>u[l]?u[l]===c:!1);h.length&&(r=h)})}),this._resolverHash[n]=r[0]??o}else this._resolverHash[n]=this.buildResolvedAsset({alias:[n],src:n},{});s[n]=this._resolverHash[n]}),t?s[e[0]]:s}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let t=0;tr.params.format.includes(s.format));if(n)return n}return this._preferredOrder[0]}_appendDefaultSearchParams(e){if(!this._defaultSearchParams)return e;const t=/\?/.test(e)?"&":"?";return`${e}${t}${this._defaultSearchParams}`}buildResolvedAsset(e,t){const{aliases:s,data:n,loadParser:r,format:o}=t;return(this._basePath||this._rootPath)&&(e.src=ts.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=s??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...n||{},...e.data},e.loadParser=r??e.loadParser,e.format=o??e.format??ts.extname(e.src).slice(1),e.srcs=e.src,e.name=e.alias,e}}class EE{constructor(){this._detections=[],this._initialized=!1,this.resolver=new AE,this.loader=new eE,this.cache=zr,this._backgroundLoader=new ZA(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(e={}){var r,o;if(this._initialized){console.warn("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");return}if(this._initialized=!0,e.defaultSearchParams&&this.resolver.setDefaultSearchParams(e.defaultSearchParams),e.basePath&&(this.resolver.basePath=e.basePath),e.bundleIdentifier&&this.resolver.setBundleIdentifier(e.bundleIdentifier),e.manifest){let a=e.manifest;typeof a=="string"&&(a=await this.load(a)),this.resolver.addManifest(a)}const t=((r=e.texturePreference)==null?void 0:r.resolution)??1,s=typeof t=="number"?[t]:t,n=await this._detectFormats({preferredFormats:(o=e.texturePreference)==null?void 0:o.format,skipDetections:e.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:n,resolution:s}}),e.preferences&&this.setPreferences(e.preferences)}add(e,t,s,n,r){this.resolver.add(e,t,s,n,r)}async load(e,t){this._initialized||await this.init();const s=ch(e),n=Ti(e).map(a=>{if(typeof a!="string"){const l=this.resolver.getAlias(a);return l.some(c=>!this.resolver.hasKey(c))&&this.add(a),Array.isArray(l)?l[0]:l}return this.resolver.hasKey(a)||this.add({alias:a,src:a}),a}),r=this.resolver.resolve(n),o=await this._mapLoadToResolve(r,t);return s?o[n[0]]:o}addBundle(e,t){this.resolver.addBundle(e,t)}async loadBundle(e,t){this._initialized||await this.init();let s=!1;typeof e=="string"&&(s=!0,e=[e]);const n=this.resolver.resolveBundle(e),r={},o=Object.keys(n);let a=0,l=0;const c=()=>{t==null||t(++a/l)},h=o.map(u=>{const d=n[u];return l+=Object.keys(d).length,this._mapLoadToResolve(d,c).then(f=>{r[u]=f})});return await Promise.all(h),s?r[e[0]]:r}async backgroundLoad(e){this._initialized||await this.init(),typeof e=="string"&&(e=[e]);const t=this.resolver.resolve(e);this._backgroundLoader.add(Object.values(t))}async backgroundLoadBundle(e){this._initialized||await this.init(),typeof e=="string"&&(e=[e]);const t=this.resolver.resolveBundle(e);Object.values(t).forEach(s=>{this._backgroundLoader.add(Object.values(s))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(e){if(typeof e=="string")return zr.get(e);const t={};for(let s=0;s{const c=r[a.src],h=[a.src];a.alias&&h.push(...a.alias),o[n[l]]=c,zr.set(h,c)}),o}async unload(e){this._initialized||await this.init();const t=Ti(e).map(n=>typeof n!="string"?n.src:n),s=this.resolver.resolve(t);await this._unloadFromResolved(s)}async unloadBundle(e){this._initialized||await this.init(),e=Ti(e);const t=this.resolver.resolveBundle(e),s=Object.keys(t).map(n=>this._unloadFromResolved(t[n]));await Promise.all(s)}async _unloadFromResolved(e){const t=Object.values(e);t.forEach(s=>{zr.remove(s.src)}),await this.loader.unload(t)}async _detectFormats(e){let t=[];e.preferredFormats&&(t=Array.isArray(e.preferredFormats)?e.preferredFormats:[e.preferredFormats]);for(const s of e.detections)e.skipDetections||await s.test()?t=await s.add(t):e.skipDetections||(t=await s.remove(t));return t=t.filter((s,n)=>t.indexOf(s)===n),t}get detections(){return this._detections}get preferWorkers(){return hu.config.preferWorkers}set preferWorkers(e){ht("7.2.0","Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead."),this.setPreferences({preferWorkers:e})}setPreferences(e){this.loader.parsers.forEach(t=>{t.config&&Object.keys(t.config).filter(s=>s in e).forEach(s=>{t.config[s]=e[s]})})}}const rn=new EE;Xe.handleByList(ke.LoadParser,rn.loader.parsers).handleByList(ke.ResolveParser,rn.resolver.parsers).handleByList(ke.CacheParser,rn.cache.parsers).handleByList(ke.DetectionParser,rn.detections);const IE={extension:ke.CacheParser,test:i=>Array.isArray(i)&&i.every(e=>e instanceof ze),getCacheableAssets:(i,e)=>{const t={};return i.forEach(s=>{e.forEach((n,r)=>{t[s+(r===0?"":r+1)]=n})}),t}};Xe.add(IE);async function t1(i){if("Image"in globalThis)return new Promise(e=>{const t=new Image;t.onload=()=>{e(!0)},t.onerror=()=>{e(!1)},t.src=i});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{const e=await(await fetch(i)).blob();await createImageBitmap(e)}catch{return!1}return!0}return!1}const RE={extension:{type:ke.DetectionParser,priority:1},test:async()=>t1("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async i=>[...i,"avif"],remove:async i=>i.filter(e=>e!=="avif")};Xe.add(RE);const PE={extension:{type:ke.DetectionParser,priority:0},test:async()=>t1("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async i=>[...i,"webp"],remove:async i=>i.filter(e=>e!=="webp")};Xe.add(PE);const mv=["png","jpg","jpeg"],kE={extension:{type:ke.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async i=>[...i,...mv],remove:async i=>i.filter(e=>!mv.includes(e))};Xe.add(kE);const FE="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function pp(i){return FE?!1:document.createElement("video").canPlayType(i)!==""}const OE={extension:{type:ke.DetectionParser,priority:0},test:async()=>pp("video/webm"),add:async i=>[...i,"webm"],remove:async i=>i.filter(e=>e!=="webm")};Xe.add(OE);const LE={extension:{type:ke.DetectionParser,priority:0},test:async()=>pp("video/mp4"),add:async i=>[...i,"mp4","m4v"],remove:async i=>i.filter(e=>e!=="mp4"&&e!=="m4v")};Xe.add(LE);const BE={extension:{type:ke.DetectionParser,priority:0},test:async()=>pp("video/ogg"),add:async i=>[...i,"ogv"],remove:async i=>i.filter(e=>e!=="ogv")};Xe.add(BE);const NE={extension:ke.ResolveParser,test:hu.test,parse:i=>{var e;return{resolution:parseFloat(((e=Le.RETINA_PREFIX.exec(i))==null?void 0:e[1])??"1"),format:ts.extname(i).slice(1),src:i}}};Xe.add(NE);var ws=(i=>(i[i.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",i[i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",i[i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",i[i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",i[i.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",i[i.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",i[i.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",i[i.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",i[i.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",i[i.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",i[i.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",i[i.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",i[i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",i[i.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",i[i.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",i[i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",i[i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",i[i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",i[i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",i[i.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",i[i.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",i[i.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35987]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",i[i.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",i[i.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",i[i.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",i[i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",i[i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",i[i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",i))(ws||{});const hh={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,35840:.5,35842:.5,35841:.25,35843:.25,36196:.5,35986:.5,35987:1,34798:1,37808:1,36492:1,36493:1,36494:1,36495:1};let Xi,No;function pv(){No={bptc:Xi.getExtension("EXT_texture_compression_bptc"),astc:Xi.getExtension("WEBGL_compressed_texture_astc"),etc:Xi.getExtension("WEBGL_compressed_texture_etc"),s3tc:Xi.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:Xi.getExtension("WEBGL_compressed_texture_s3tc_srgb"),pvrtc:Xi.getExtension("WEBGL_compressed_texture_pvrtc")||Xi.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:Xi.getExtension("WEBGL_compressed_texture_etc1"),atc:Xi.getExtension("WEBGL_compressed_texture_atc")}}const DE={extension:{type:ke.DetectionParser,priority:2},test:async()=>{const i=Le.ADAPTER.createCanvas().getContext("webgl");return i?(Xi=i,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async i=>{No||pv();const e=[];for(const t in No)No[t]&&e.push(t);return[...e,...i]},remove:async i=>(No||pv(),i.filter(e=>!(e in No)))};Xe.add(DE);class UE extends ru{constructor(e,t={width:1,height:1,autoLoad:!0}){let s,n;typeof e=="string"?(s=e,n=new Uint8Array):(s=null,n=e),super(n,t),this.origin=s,this.buffer=n?new Nf(n):null,this._load=null,this.loaded=!1,this.origin!==null&&t.autoLoad!==!1&&this.load(),this.origin===null&&this.buffer&&(this._load=Promise.resolve(this),this.loaded=!0,this.onBlobLoaded(this.buffer.rawBinaryData))}onBlobLoaded(e){}load(){return this._load?this._load:(this._load=fetch(this.origin).then(e=>e.blob()).then(e=>e.arrayBuffer()).then(e=>(this.data=new Uint32Array(e),this.buffer=new Nf(e),this.loaded=!0,this.onBlobLoaded(e),this.update(),this)),this._load)}}class ro extends UE{constructor(e,t){super(e,t),this.format=t.format,this.levels=t.levels||1,this._width=t.width,this._height=t.height,this._extension=ro._formatToExtension(this.format),(t.levelBuffers||this.buffer)&&(this._levelBuffers=t.levelBuffers||ro._createLevelBuffers(e instanceof Uint8Array?e:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(e,t,s){const n=e.gl;if(!e.context.extensions[this._extension])throw new Error(`${this._extension} textures are not supported on the current machine`);if(!this._levelBuffers)return!1;n.pixelStorei(n.UNPACK_ALIGNMENT,4);for(let r=0,o=this.levels;r=33776&&e<=33779)return"s3tc";if(e>=35916&&e<=35919)return"s3tc_sRGB";if(e>=37488&&e<=37497)return"etc";if(e>=35840&&e<=35843)return"pvrtc";if(e===36196)return"etc1";if(e===35986||e===35987||e===34798)return"atc";if(e>=36492&&e<=36495)return"bptc";if(e===37808)return"astc";throw new Error(`Invalid (compressed) texture format given: ${e}`)}static _createLevelBuffers(e,t,s,n,r,o,a){const l=new Array(s);let c=e.byteOffset,h=o,u=a,d=h+n-1&~(n-1),f=u+r-1&~(r-1),p=d*f*hh[t];for(let m=0;m1?h:d,levelHeight:s>1?u:f,levelBuffer:new Uint8Array(e.buffer,c,p)},c+=p,h=h>>1||1,u=u>>1||1,d=h+n-1&~(n-1),f=u+r-1&~(r-1),p=d*f*hh[t];return l}}const zd=4,ic=124,$E=32,gv=20,XE=542327876,nc={HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},VE={FOURCC:2},rc={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3},YE=1,GE=2,jE=4,HE=64,WE=512,zE=131072,qE=827611204,KE=861165636,ZE=894720068,JE=808540228,QE=4,eI={[qE]:ws.COMPRESSED_RGBA_S3TC_DXT1_EXT,[KE]:ws.COMPRESSED_RGBA_S3TC_DXT3_EXT,[ZE]:ws.COMPRESSED_RGBA_S3TC_DXT5_EXT},tI={70:ws.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:ws.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:ws.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:ws.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:ws.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:ws.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:ws.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:ws.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:ws.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,96:ws.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,95:ws.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,98:ws.COMPRESSED_RGBA_BPTC_UNORM_EXT,99:ws.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT};function sI(i){const e=new Uint32Array(i);if(e[0]!==XE)throw new Error("Invalid DDS file magic word");const t=new Uint32Array(i,0,ic/Uint32Array.BYTES_PER_ELEMENT),s=t[nc.HEIGHT],n=t[nc.WIDTH],r=t[nc.MIPMAP_COUNT],o=new Uint32Array(i,nc.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,$E/Uint32Array.BYTES_PER_ELEMENT),a=o[YE];if(a&jE){const l=o[VE.FOURCC];if(l!==JE){const y=eI[l],x=zd+ic,M=new Uint8Array(i,x);return[new ro(M,{format:y,width:n,height:s,levels:r})]}const c=zd+ic,h=new Uint32Array(e.buffer,c,gv/Uint32Array.BYTES_PER_ELEMENT),u=h[rc.DXGI_FORMAT],d=h[rc.RESOURCE_DIMENSION],f=h[rc.MISC_FLAG],p=h[rc.ARRAY_SIZE],m=tI[u];if(m===void 0)throw new Error(`DDSParser cannot parse texture data with DXGI format ${u}`);if(f===QE)throw new Error("DDSParser does not support cubemap textures");if(d===6)throw new Error("DDSParser does not supported 3D texture data");const g=new Array,v=zd+ic+gv;if(p===1)g.push(new Uint8Array(i,v));else{const y=hh[m];let x=0,M=n,C=s;for(let b=0;b>>1,C=C>>>1}let w=v;for(let b=0;bnew ro(y,{format:m,width:n,height:s,levels:r}))}throw a&HE?new Error("DDSParser does not support uncompressed texture data."):a&WE?new Error("DDSParser does not supported YUV uncompressed texture data."):a&zE?new Error("DDSParser does not support single-channel (lumninance) texture data!"):a&GE?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}const vv=[171,75,84,88,32,49,49,187,13,10,26,10],iI=67305985,xi={ENDIANNESS:12,GL_TYPE:16,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},am=64,yv={[$e.UNSIGNED_BYTE]:1,[$e.UNSIGNED_SHORT]:2,[$e.INT]:4,[$e.UNSIGNED_INT]:4,[$e.FLOAT]:4,[$e.HALF_FLOAT]:8},nI={[_e.RGBA]:4,[_e.RGB]:3,[_e.RG]:2,[_e.RED]:1,[_e.LUMINANCE]:1,[_e.LUMINANCE_ALPHA]:2,[_e.ALPHA]:1},rI={[$e.UNSIGNED_SHORT_4_4_4_4]:2,[$e.UNSIGNED_SHORT_5_5_5_1]:2,[$e.UNSIGNED_SHORT_5_6_5]:2};function oI(i,e,t=!1){const s=new DataView(e);if(!aI(i,s))return null;const n=s.getUint32(xi.ENDIANNESS,!0)===iI,r=s.getUint32(xi.GL_TYPE,n),o=s.getUint32(xi.GL_FORMAT,n),a=s.getUint32(xi.GL_INTERNAL_FORMAT,n),l=s.getUint32(xi.PIXEL_WIDTH,n),c=s.getUint32(xi.PIXEL_HEIGHT,n)||1,h=s.getUint32(xi.PIXEL_DEPTH,n)||1,u=s.getUint32(xi.NUMBER_OF_ARRAY_ELEMENTS,n)||1,d=s.getUint32(xi.NUMBER_OF_FACES,n),f=s.getUint32(xi.NUMBER_OF_MIPMAP_LEVELS,n),p=s.getUint32(xi.BYTES_OF_KEY_VALUE_DATA,n);if(c===0||h!==1)throw new Error("Only 2D textures are supported");if(d!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(u!==1)throw new Error("WebGL does not support array textures");const m=4,g=4,v=l+3&-4,y=c+3&-4,x=new Array(u);let M=l*c;r===0&&(M=v*y);let C;if(r!==0?yv[r]?C=yv[r]*nI[o]:C=rI[r]:C=hh[a],C===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const w=t?cI(s,p,n):null;let b=M*C,_=l,E=c,F=v,I=y,k=am+p;for(let B=0;B1||r!==0?_:F,levelHeight:f>1||r!==0?E:I,levelBuffer:new Uint8Array(e,X,b)},X+=b}k+=D+4,k=k%4!==0?k+4-k%4:k,_=_>>1||1,E=E>>1||1,F=_+m-1&-4,I=E+g-1&-4,b=F*I*C}return r!==0?{uncompressed:x.map(B=>{let D=B[0].levelBuffer,X=!1;return r===$e.FLOAT?D=new Float32Array(B[0].levelBuffer.buffer,B[0].levelBuffer.byteOffset,B[0].levelBuffer.byteLength/4):r===$e.UNSIGNED_INT?(X=!0,D=new Uint32Array(B[0].levelBuffer.buffer,B[0].levelBuffer.byteOffset,B[0].levelBuffer.byteLength/4)):r===$e.INT&&(X=!0,D=new Int32Array(B[0].levelBuffer.buffer,B[0].levelBuffer.byteOffset,B[0].levelBuffer.byteLength/4)),{resource:new ru(D,{width:B[0].levelWidth,height:B[0].levelHeight}),type:r,format:X?lI(o):o}}),kvData:w}:{compressed:x.map(B=>new ro(null,{format:a,width:l,height:c,levels:f,levelBuffers:B})),kvData:w}}function aI(i,e){for(let t=0;te-n){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let l=0;for(;l{const o=new Qe(r,{mipmap:gi.OFF,alphaMode:bs.NO_PREMULTIPLIED_ALPHA,resolution:Yn(i),...e.data});return Rl(o,t,i)});return n.length===1?n[0]:n},unload(i){Array.isArray(i)?i.forEach(e=>e.destroy(!0)):i.destroy(!0)}};Xe.add(hI);const uI={extension:{type:ke.LoadParser,priority:ii.High},name:"loadKTX",test(i){return qs(i,".ktx")},async load(i,e,t){const s=await(await Le.ADAPTER.fetch(i)).arrayBuffer(),{compressed:n,uncompressed:r,kvData:o}=oI(i,s),a=n??r,l={mipmap:gi.OFF,alphaMode:bs.NO_PREMULTIPLIED_ALPHA,resolution:Yn(i),...e.data},c=a.map(h=>{a===r&&Object.assign(l,{type:h.type,format:h.format});const u=h.resource??h,d=new Qe(u,l);return d.ktxKeyValueData=o,Rl(d,t,i)});return c.length===1?c[0]:c},unload(i){Array.isArray(i)?i.forEach(e=>e.destroy(!0)):i.destroy(!0)}};Xe.add(uI);const dI=["s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"],fI={extension:ke.ResolveParser,test:i=>{const e=ts.extname(i).slice(1);return["basis","ktx","dds"].includes(e)},parse:i=>{var s,n;const e=i.split("."),t=e.pop();if(["ktx","dds"].includes(t)){const r=e.pop();if(dI.includes(r))return{resolution:parseFloat(((s=Le.RETINA_PREFIX.exec(i))==null?void 0:s[1])??"1"),format:r,src:i}}return{resolution:parseFloat(((n=Le.RETINA_PREFIX.exec(i))==null?void 0:n[1])??"1"),format:t,src:i}}};Xe.add(fI);const oc=new ot,mI=4,s1=class Ga{constructor(e){this.renderer=e,this._rendererPremultipliedAlpha=!1}contextChange(){var t;const e=(t=this.renderer)==null?void 0:t.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(e&&e.alpha&&e.premultipliedAlpha)}async image(e,t,s,n){const r=new Image;return r.src=await this.base64(e,t,s,n),r}async base64(e,t,s,n){const r=this.canvas(e,n);if(r.toBlob!==void 0)return new Promise((o,a)=>{r.toBlob(l=>{if(!l){a(new Error("ICanvas.toBlob failed!"));return}const c=new FileReader;c.onload=()=>o(c.result),c.onerror=a,c.readAsDataURL(l)},t,s)});if(r.toDataURL!==void 0)return r.toDataURL(t,s);if(r.convertToBlob!==void 0){const o=await r.convertToBlob({type:t,quality:s});return new Promise((a,l)=>{const c=new FileReader;c.onload=()=>a(c.result),c.onerror=l,c.readAsDataURL(o)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e,t){const{pixels:s,width:n,height:r,flipY:o,premultipliedAlpha:a}=this._rawPixels(e,t);o&&Ga._flipY(s,n,r),a&&Ga._unpremultiplyAlpha(s);const l=new q2(n,r,1),c=new ImageData(new Uint8ClampedArray(s.buffer),n,r);return l.context.putImageData(c,0,0),l.canvas}pixels(e,t){const{pixels:s,width:n,height:r,flipY:o,premultipliedAlpha:a}=this._rawPixels(e,t);return o&&Ga._flipY(s,n,r),a&&Ga._unpremultiplyAlpha(s),s}_rawPixels(e,t){const s=this.renderer;if(!s)throw new Error("The Extract has already been destroyed");let n,r=!1,o=!1,a,l=!1;e&&(e instanceof vo?a=e:(a=s.generateTexture(e,{region:t,resolution:s.resolution,multisample:s.multisample}),l=!0,t&&(oc.width=t.width,oc.height=t.height,t=oc)));const c=s.gl;if(a){if(n=a.baseTexture.resolution,t=t??a.frame,r=!1,o=a.baseTexture.alphaMode>0&&a.baseTexture.format===_e.RGBA,!l){s.renderTexture.bind(a);const f=a.framebuffer.glFramebuffers[s.CONTEXT_UID];f.blitFramebuffer&&s.framebuffer.bind(f.blitFramebuffer)}}else n=s.resolution,t||(t=oc,t.width=s.width/n,t.height=s.height/n),r=!0,o=this._rendererPremultipliedAlpha,s.renderTexture.bind();const h=Math.max(Math.round(t.width*n),1),u=Math.max(Math.round(t.height*n),1),d=new Uint8Array(mI*h*u);return c.readPixels(Math.round(t.x*n),Math.round(t.y*n),h,u,c.RGBA,c.UNSIGNED_BYTE,d),l&&(a==null||a.destroy(!0)),{pixels:d,width:h,height:u,flipY:r,premultipliedAlpha:o}}destroy(){this.renderer=null}static _flipY(e,t,s){const n=t<<2,r=s>>1,o=new Uint8Array(n);for(let a=0;a=0&&a>=0&&n>=0&&r>=0)){e.length=0;return}const l=Math.ceil(2.3*Math.sqrt(o+a)),c=l*8+(n?4:0)+(r?4:0);if(e.length=c,c===0)return;if(l===0){e.length=8,e[0]=e[6]=t+n,e[1]=e[3]=s+r,e[2]=e[4]=t-n,e[5]=e[7]=s-r;return}let h=0,u=l*4+(n?2:0)+2,d=u,f=c;{const p=n+o,m=r,g=t+p,v=t-p,y=s+m;if(e[h++]=g,e[h++]=y,e[--u]=y,e[--u]=v,r){const x=s-m;e[d++]=v,e[d++]=x,e[--f]=x,e[--f]=g}}for(let p=1;p0||e&&s<=0){const n=t/2;for(let r=n+n%2;r=6){xv(t,!1);const o=[];for(let c=0;c=0&&r>=0&&o.push(t,s,t+n,s,t+n,s+r,t,s+r)},triangulate(i,e){const t=i.points,s=e.points;if(t.length===0)return;const n=s.length/2;s.push(t[0],t[1],t[2],t[3],t[6],t[7],t[4],t[5]),e.indices.push(n,n+1,n+2,n+1,n+2,n+3)}},vI={build(i){uh.build(i)},triangulate(i,e){uh.triangulate(i,e)}};var ci=(i=>(i.MITER="miter",i.BEVEL="bevel",i.ROUND="round",i))(ci||{}),fr=(i=>(i.BUTT="butt",i.ROUND="round",i.SQUARE="square",i))(fr||{});const aa={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(i,e=20){if(!this.adaptive||!i||isNaN(i))return e;let t=Math.ceil(i/this.maxLength);return tthis.maxSegments&&(t=this.maxSegments),t}};class bv{static curveTo(e,t,s,n,r,o){const a=o[o.length-2],l=o[o.length-1]-t,c=a-e,h=n-t,u=s-e,d=Math.abs(l*u-c*h);if(d<1e-8||r===0)return(o[o.length-2]!==e||o[o.length-1]!==t)&&o.push(e,t),null;const f=l*l+c*c,p=h*h+u*u,m=l*h+c*u,g=r*Math.sqrt(f)/d,v=r*Math.sqrt(p)/d,y=g*m/f,x=v*m/p,M=g*u+v*c,C=g*h+v*l,w=c*(v+y),b=l*(v+y),_=u*(g+x),E=h*(g+x),F=Math.atan2(b-C,w-M),I=Math.atan2(E-C,_-M);return{cx:M+e,cy:C+t,radius:r,startAngle:F,endAngle:I,anticlockwise:c*h>u*l}}static arc(e,t,s,n,r,o,a,l,c){const h=a-o,u=aa._segmentsCount(Math.abs(h)*r,Math.ceil(Math.abs(h)/sh)*40),d=h/(u*2),f=d*2,p=Math.cos(d),m=Math.sin(d),g=u-1,v=g%1/g;for(let y=0;y<=g;++y){const x=y+v*y,M=d+o+f*x,C=Math.cos(M),w=-Math.sin(M);c.push((p*C+m*w)*r+s,(p*-w+m*C)*r+n)}}}class yI{constructor(){this.reset()}begin(e,t,s){this.reset(),this.style=e,this.start=t,this.attribStart=s}end(e,t){this.attribSize=t-this.attribStart,this.size=e-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class gp{static curveLength(e,t,s,n,r,o,a,l){let c=0,h=0,u=0,d=0,f=0,p=0,m=0,g=0,v=0,y=0,x=0,M=e,C=t;for(let w=1;w<=10;++w)h=w/10,u=h*h,d=u*h,f=1-h,p=f*f,m=p*f,g=m*e+3*p*h*s+3*f*u*r+d*a,v=m*t+3*p*h*n+3*f*u*o+d*l,y=M-g,x=C-v,M=g,C=v,c+=Math.sqrt(y*y+x*x);return c}static curveTo(e,t,s,n,r,o,a){const l=a[a.length-2],c=a[a.length-1];a.length-=2;const h=aa._segmentsCount(gp.curveLength(l,c,e,t,s,n,r,o));let u=0,d=0,f=0,p=0,m=0;a.push(l,c);for(let g=1,v=0;g<=h;++g)v=g/h,u=1-v,d=u*u,f=d*u,p=v*v,m=p*v,a.push(f*l+3*d*v*e+3*u*p*s+m*r,f*c+3*d*v*t+3*u*p*n+m*o)}}function wv(i,e,t,s,n,r,o,a){const l=i-t*n,c=e-s*n,h=i+t*r,u=e+s*r;let d,f;o?(d=s,f=-t):(d=-s,f=t);const p=l+d,m=c+f,g=h+d,v=u+f;return a.push(p,m,g,v),2}function Nr(i,e,t,s,n,r,o,a){const l=t-i,c=s-e;let h=Math.atan2(l,c),u=Math.atan2(n-i,r-e);a&&hu&&(u+=Math.PI*2);let d=h;const f=u-h,p=Math.abs(f),m=Math.sqrt(l*l+c*c),g=(15*p*Math.sqrt(m)/Math.PI>>0)+1,v=f/g;if(d+=v,a){o.push(i,e,t,s);for(let y=1,x=d;y=0&&(r.join===ci.ROUND?d+=Nr(x,M,x-b*B,M-_*B,x-E*B,M-F*B,h,!1)+4:d+=2,h.push(x-E*D,M-F*D,x+E*B,M+F*B));continue}const K=(-b+v)*(-_+M)-(-b+x)*(-_+y),ie=(-E+C)*(-F+M)-(-E+x)*(-F+w),re=(A*ie-O*K)/V,pe=(L*K-P*ie)/V,ge=(re-x)*(re-x)+(pe-M)*(pe-M),he=x+(re-x)*B,fe=M+(pe-M)*B,Y=x-(re-x)*D,W=M-(pe-M)*D,H=Math.min(A*A+P*P,O*O+L*L),G=j?B:D,q=H+G*G*m,se=ge<=q;let ue=r.join;if(ue===ci.MITER&&ge/m>g&&(ue=ci.BEVEL),se)switch(ue){case ci.MITER:{h.push(he,fe,Y,W);break}case ci.BEVEL:{j?h.push(he,fe,x+b*D,M+_*D,he,fe,x+E*D,M+F*D):h.push(x-b*B,M-_*B,Y,W,x-E*B,M-F*B,Y,W),d+=2;break}case ci.ROUND:{j?(h.push(he,fe,x+b*D,M+_*D),d+=Nr(x,M,x+b*D,M+_*D,x+E*D,M+F*D,h,!0)+4,h.push(he,fe,x+E*D,M+F*D)):(h.push(x-b*B,M-_*B,Y,W),d+=Nr(x,M,x-b*B,M-_*B,x-E*B,M-F*B,h,!1)+4,h.push(x-E*B,M-F*B,Y,W));break}}else{switch(h.push(x-b*B,M-_*B,x+b*D,M+_*D),ue){case ci.MITER:{j?h.push(Y,W,Y,W):h.push(he,fe,he,fe),d+=2;break}case ci.ROUND:{j?d+=Nr(x,M,x+b*D,M+_*D,x+E*D,M+F*D,h,!0)+2:d+=Nr(x,M,x-b*B,M-_*B,x-E*B,M-F*B,h,!1)+2;break}}h.push(x-E*B,M-F*B,x+E*D,M+F*D),d+=2}}v=s[(u-2)*2],y=s[(u-2)*2+1],x=s[(u-1)*2],M=s[(u-1)*2+1],b=-(y-M),_=v-x,I=Math.sqrt(b*b+_*_),b/=I,_/=I,b*=p,_*=p,h.push(x-b*B,M-_*B,x+b*D,M+_*D),l||(r.cap===fr.ROUND?d+=Nr(x-b*(B-D)*.5,M-_*(B-D)*.5,x-b*B,M-_*B,x+b*D,M+_*D,h,!1)+2:r.cap===fr.SQUARE&&(d+=wv(x,M,b,_,B,D,!1,h)));const X=e.indices,N=aa.epsilon*aa.epsilon;for(let U=f;U0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(e,t=null,s=null,n=null){const r=new dh(e,t,s,n);return this.graphicsData.push(r),this.dirty++,this}drawHole(e,t=null){if(!this.graphicsData.length)return null;const s=new dh(e,null,null,t),n=this.graphicsData[this.graphicsData.length-1];return s.lineStyle=n.lineStyle,n.holes.push(s),this.dirty++,this}destroy(){super.destroy();for(let e=0;e0&&(s=this.batches[this.batches.length-1],n=s.style);for(let l=this.shapeIndex;l65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&a===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=a?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(e,t){return!(!e||!t||e.texture.baseTexture!==t.texture.baseTexture||e.color+e.alpha!==t.color+t.alpha||!!e.native!=!!t.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let e=0,t=this.graphicsData.length;e65535*2)return!1;const e=this.batches;for(let t=0;t0&&(n=ac.pop(),n||(n=new $f,n.texArray=new Gf),this.drawCalls.push(n)),n.start=h,n.size=0,n.texArray.count=0,n.type=c),m.touched=1,m._batchEnabled=e,m._batchLocation=r,m.wrapMode=Ii.REPEAT,n.texArray.elements[n.texArray.count++]=m,r++)),n.size+=d.size,h+=d.size,a=m._batchLocation,this.addColors(t,p.color,p.alpha,d.attribSize,d.attribStart),this.addTextureIds(s,a,d.attribSize,d.attribStart)}Qe._globalBatch=e,this.packAttributes()}packAttributes(){const e=this.points,t=this.uvs,s=this.colors,n=this.textureIds,r=new ArrayBuffer(e.length*3*4),o=new Float32Array(r),a=new Uint32Array(r);let l=0;for(let c=0;c0&&e.alpha>0;return s?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:s},e)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const e=this.currentPath.points,t=this.currentPath.points.length;t>2&&(this.drawShape(this.currentPath),this.currentPath=new no,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new no,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(e,t){return this.startPoly(),this.currentPath.points[0]=e,this.currentPath.points[1]=t,this}lineTo(e,t){this.currentPath||this.moveTo(0,0);const s=this.currentPath.points,n=s[s.length-2],r=s[s.length-1];return(n!==e||r!==t)&&s.push(e,t),this}_initCurve(e=0,t=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[e,t]):this.moveTo(e,t)}quadraticCurveTo(e,t,s,n){this._initCurve();const r=this.currentPath.points;return r.length===0&&this.moveTo(0,0),vp.curveTo(e,t,s,n,r),this}bezierCurveTo(e,t,s,n,r,o){return this._initCurve(),gp.curveTo(e,t,s,n,r,o,this.currentPath.points),this}arcTo(e,t,s,n,r){this._initCurve(e,t);const o=this.currentPath.points,a=bv.curveTo(e,t,s,n,r,o);if(a){const{cx:l,cy:c,radius:h,startAngle:u,endAngle:d,anticlockwise:f}=a;this.arc(l,c,h,u,d,f)}return this}arc(e,t,s,n,r,o=!1){if(n===r)return this;if(!o&&r<=n?r+=sh:o&&n<=r&&(n+=sh),r-n===0)return this;const a=e+Math.cos(n)*s,l=t+Math.sin(n)*s,c=this._geometry.closePointEps;let h=this.currentPath?this.currentPath.points:null;if(h){const u=Math.abs(h[h.length-2]-a),d=Math.abs(h[h.length-1]-l);u0;return s?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:s},e)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(e,t,s,n){return this.drawShape(new ot(e,t,s,n))}drawRoundedRect(e,t,s,n,r){return this.drawShape(new lu(e,t,s,n,r))}drawCircle(e,t,s){return this.drawShape(new ou(e,t,s))}drawEllipse(e,t,s,n){return this.drawShape(new au(e,t,s,n))}drawPolygon(...e){let t,s=!0;const n=e[0];n.points?(s=n.closeStroke,t=n.points):Array.isArray(e[0])?t=e[0]:t=e;const r=new no(t);return r.closeStroke=s,this.drawShape(r),this}drawShape(e){return this._holeMode?this._geometry.drawHole(e,this._matrix):this._geometry.drawShape(e,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const e=this._geometry.graphicsData;return e.length===1&&e[0].shape.type===Cs.RECT&&!e[0].matrix&&!e[0].holes.length&&!(e[0].lineStyle.visible&&e[0].lineStyle.width)}_render(e){this.finishPoly();const t=this._geometry;t.updateBatches(),t.batchable?(this.batchDirty!==t.batchDirty&&this._populateBatches(),this._renderBatched(e)):(e.batch.flush(),this._renderDirect(e))}_populateBatches(){const e=this._geometry,t=this.blendMode,s=e.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=e.batchDirty,this.batches.length=s,this.vertexData=new Float32Array(e.points);for(let n=0;ns&&!e.autoResize&&(o=s);let a=e._buffers;a||(a=e._buffers=this.generateBuffers(e));const l=t[0]._texture.baseTexture,c=l.alphaMode>0;this.state.blendMode=ob(e.blendMode,c),r.state.set(this.state);const h=r.gl,u=e.worldTransform.copyTo(this.tempMatrix);u.prepend(r.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=Et.shared.setValue(e.tintRgb).premultiply(e.worldAlpha,c).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=l,this.renderer.shader.bind(this.shader);let d=!1;for(let f=0,p=0;fn&&(m=n),p>=a.length&&a.push(this._generateOneMoreBuffer(e));const g=a[p];g.uploadDynamic(t,f,m);const v=e._bufferUpdateIDs[p]||0;d=d||g._updateID0);n[o]=c,n[o+r]=c,n[o+r*2]=c,n[o+r*3]=c,o+=r*4}}destroy(){super.destroy(),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null}}l1.extension={name:"particle",type:ke.RendererPlugin};Xe.add(l1);var du=(i=>(i[i.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",i[i.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",i))(du||{});const lc={willReadFrequently:!0},Vi=class Ye{static get experimentalLetterSpacingSupported(){let e=Ye._experimentalLetterSpacingSupported;if(e!==void 0){const t=Le.ADAPTER.getCanvasRenderingContext2D().prototype;e=Ye._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t}return e}constructor(e,t,s,n,r,o,a,l,c){this.text=e,this.style=t,this.width=s,this.height=n,this.lines=r,this.lineWidths=o,this.lineHeight=a,this.maxLineWidth=l,this.fontProperties=c}static measureText(e,t,s,n=Ye._canvas){s=s??t.wordWrap;const r=t.toFontString(),o=Ye.measureFont(r);o.fontSize===0&&(o.fontSize=t.fontSize,o.ascent=t.fontSize);const a=n.getContext("2d",lc);a.font=r;const l=(s?Ye.wordWrap(e,t,n):e).split(/(?:\r\n|\r|\n)/),c=new Array(l.length);let h=0;for(let p=0;p0&&(n?r-=t:r+=(Ye.graphemeSegmenter(e).length-1)*t),r}static wordWrap(e,t,s=Ye._canvas){const n=s.getContext("2d",lc);let r=0,o="",a="";const l=Object.create(null),{letterSpacing:c,whiteSpace:h}=t,u=Ye.collapseSpaces(h),d=Ye.collapseNewlines(h);let f=!u;const p=t.wordWrapWidth+c,m=Ye.tokenize(e);for(let g=0;gp)if(o!==""&&(a+=Ye.addLine(o),o="",r=0),Ye.canBreakWords(v,t.breakWords)){const x=Ye.wordWrapSplit(v);for(let M=0;Mp&&(a+=Ye.addLine(o),f=!1,o="",r=0),o+=C,r+=_}}else{o.length>0&&(a+=Ye.addLine(o),o="",r=0);const x=g===m.length-1;a+=Ye.addLine(v,!x),f=!1,o="",r=0}else y+r>p&&(f=!1,a+=Ye.addLine(o),o="",r=0),(o.length>0||!Ye.isBreakingSpace(v)||f)&&(o+=v,r+=y)}return a+=Ye.addLine(o,!1),a}static addLine(e,t=!0){return e=Ye.trimRight(e),e=t?`${e} -`:e,e}static getFromCache(e,t,s,n){let r=s[e];return typeof r!="number"&&(r=Ye._measureText(e,t,n)+t,s[e]=r),r}static collapseSpaces(e){return e==="normal"||e==="pre-line"}static collapseNewlines(e){return e==="normal"}static trimRight(e){if(typeof e!="string")return"";for(let t=e.length-1;t>=0;t--){const s=e[t];if(!Ye.isBreakingSpace(s))break;e=e.slice(0,-1)}return e}static isNewline(e){return typeof e!="string"?!1:Ye._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,t){return typeof e!="string"?!1:Ye._breakingSpaces.includes(e.charCodeAt(0))}static tokenize(e){const t=[];let s="";if(typeof e!="string")return t;for(let n=0;na;--d){for(let m=0;m{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const i=new Intl.Segmenter;return e=>[...i.segment(e)].map(t=>t.segment)}return i=>[...i]})(),Vi.experimentalLetterSpacing=!1,Vi._fonts={},Vi._newlines=[10,13],Vi._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let nr=Vi;const EI=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],c1=class ja{constructor(e){this.styleID=0,this.reset(),Qd(this,e,e)}clone(){const e={};return Qd(e,this,ja.defaultStyle),new ja(e)}reset(){Qd(this,ja.defaultStyle,ja.defaultStyle)}get align(){return this._align}set align(e){this._align!==e&&(this._align=e,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(e){const t=Jd(e);this._dropShadowColor!==t&&(this._dropShadowColor=t,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)}get fill(){return this._fill}set fill(e){const t=Jd(e);this._fill!==t&&(this._fill=t,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(e){II(this._fillGradientStops,e)||(this._fillGradientStops=e,this.styleID++)}get fontFamily(){return this._fontFamily}set fontFamily(e){this.fontFamily!==e&&(this._fontFamily=e,this.styleID++)}get fontSize(){return this._fontSize}set fontSize(e){this._fontSize!==e&&(this._fontSize=e,this.styleID++)}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.styleID++)}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant!==e&&(this._fontVariant=e,this.styleID++)}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.styleID++)}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.styleID++)}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.styleID++)}get leading(){return this._leading}set leading(e){this._leading!==e&&(this._leading=e,this.styleID++)}get lineJoin(){return this._lineJoin}set lineJoin(e){this._lineJoin!==e&&(this._lineJoin=e,this.styleID++)}get miterLimit(){return this._miterLimit}set miterLimit(e){this._miterLimit!==e&&(this._miterLimit=e,this.styleID++)}get padding(){return this._padding}set padding(e){this._padding!==e&&(this._padding=e,this.styleID++)}get stroke(){return this._stroke}set stroke(e){const t=Jd(e);this._stroke!==t&&(this._stroke=t,this.styleID++)}get strokeThickness(){return this._strokeThickness}set strokeThickness(e){this._strokeThickness!==e&&(this._strokeThickness=e,this.styleID++)}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline!==e&&(this._textBaseline=e,this.styleID++)}get trim(){return this._trim}set trim(e){this._trim!==e&&(this._trim=e,this.styleID++)}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.styleID++)}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap!==e&&(this._wordWrap=e,this.styleID++)}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.styleID++)}toFontString(){const e=typeof this.fontSize=="number"?`${this.fontSize}px`:this.fontSize;let t=this.fontFamily;Array.isArray(this.fontFamily)||(t=this.fontFamily.split(","));for(let s=t.length-1;s>=0;s--){let n=t[s].trim();!/([\"\'])[^\'\"]+\1/.test(n)&&!EI.includes(n)&&(n=`"${n}"`),t[s]=n}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${e} ${t.join(",")}`}};c1.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:du.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let Sr=c1;function Jd(i){const e=Et.shared,t=s=>{const n=e.setValue(s);return n.alpha===1?n.toHex():n.toRgbaString()};return Array.isArray(i)?i.map(t):t(i)}function II(i,e){if(!Array.isArray(i)||!Array.isArray(e)||i.length!==e.length)return!1;for(let t=0;t0&&p>m&&(g=(m+p)/2);const v=m+d,y=s.lineHeight*(f+1);let x=v;f+10}}function kI(i,e){var s;let t=!1;if((s=i==null?void 0:i._textures)!=null&&s.length){for(let n=0;n{this.queue&&this.prepareItems()},this.registerFindHook(NI),this.registerFindHook(DI),this.registerFindHook(kI),this.registerFindHook(FI),this.registerFindHook(OI),this.registerUploadHook(LI),this.registerUploadHook(BI)}upload(e){return new Promise(t=>{e&&this.add(e),this.queue.length?(this.completes.push(t),this.ticking||(this.ticking=!0,Gs.system.addOnce(this.tick,this,ho.UTILITY))):t()})}tick(){setTimeout(this.delayedTick,0)}prepareItems(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){const e=this.queue[0];let t=!1;if(e&&!e._destroyed){for(let s=0,n=this.uploadHooks.length;s=0;t--)this.add(e.children[t]);return this}destroy(){this.ticking&&Gs.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null}};u1.uploadsPerFrame=4;let hm=u1;Object.defineProperties(Le,{UPLOADS_PER_FRAME:{get(){return hm.uploadsPerFrame},set(i){ht("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),hm.uploadsPerFrame=i}}});function f1(i,e){return e instanceof Qe?(e._glTextures[i.CONTEXT_UID]||i.texture.bind(e),!0):!1}function UI(i,e){if(!(e instanceof Ds))return!1;const{geometry:t}=e;e.finishPoly(),t.updateBatches();const{batches:s}=t;for(let n=0;n1?ki.from(VI,XI,t):ki.from(Cv,YI,t)}render(e){const t=this.renderer,s=this.quad;let n=s.vertices;n[0]=n[6]=e._width*-e.anchor.x,n[1]=n[3]=e._height*-e.anchor.y,n[2]=n[4]=e._width*(1-e.anchor.x),n[5]=n[7]=e._height*(1-e.anchor.y);const r=e.uvRespectAnchor?e.anchor.x:0,o=e.uvRespectAnchor?e.anchor.y:0;n=s.uvs,n[0]=n[6]=-r,n[1]=n[3]=-o,n[2]=n[4]=1-r,n[5]=n[7]=1-o,s.invalidate();const a=e._texture,l=a.baseTexture,c=l.alphaMode>0,h=e.tileTransform.localTransform,u=e.uvMatrix;let d=l.isPowerOfTwo&&a.frame.width===l.width&&a.frame.height===l.height;d&&(l._glTextures[t.CONTEXT_UID]?d=l.wrapMode!==Ii.CLAMP:l.wrapMode===Ii.CLAMP&&(l.wrapMode=Ii.REPEAT));const f=d?this.simpleShader:this.shader,p=a.width,m=a.height,g=e._width,v=e._height;cc.set(h.a*p/g,h.b*p/v,h.c*m/g,h.d*m/v,h.tx/g,h.ty/v),cc.invert(),d?cc.prepend(u.mapCoord):(f.uniforms.uMapCoord=u.mapCoord.toArray(!0),f.uniforms.uClampFrame=u.uClampFrame,f.uniforms.uClampOffset=u.uClampOffset),f.uniforms.uTransform=cc.toArray(!0),f.uniforms.uColor=Et.shared.setValue(e.tint).premultiply(e.worldAlpha,c).toArray(f.uniforms.uColor),f.uniforms.translationMatrix=e.transform.worldTransform.toArray(!0),f.uniforms.uSampler=a,t.shader.bind(f),t.geometry.bind(s),this.state.blendMode=ob(e.blendMode,c),t.state.set(this.state),t.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}p1.extension={name:"tilingSprite",type:ke.RendererPlugin};Xe.add(p1);const g1=class Ha{constructor(e,t,s){this.linkedSheets=[],(e instanceof Qe||e instanceof ze)&&(e={texture:e,data:t,resolutionFilename:s});const{texture:n,data:r,resolutionFilename:o=null,cachePrefix:a=""}=e;this.cachePrefix=a,this._texture=n instanceof ze?n:null,this.baseTexture=n instanceof Qe?n:this._texture.baseTexture,this.textures={},this.animations={},this.data=r;const l=this.baseTexture.resource;this.resolution=this._updateResolution(o||(l?l.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}_updateResolution(e=null){const{scale:t}=this.data.meta;let s=Yn(e,null);return s===null&&(s=typeof t=="number"?t:parseFloat(t??"1")),s!==1&&this.baseTexture.setResolution(s),s}parse(){return new Promise(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=Ha.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(e){let t=e;const s=Ha.BATCH_SIZE;for(;t-e{this._batchIndex*Ha.BATCH_SIZE{s[n]=e}),Object.keys(e.textures).forEach(n=>{s[`${e.cachePrefix}${n}`]=e.textures[n]}),!t){const n=ts.dirname(i[0]);e.linkedSheets.forEach((r,o)=>{Object.assign(s,v1([`${n}/${e.data.meta.related_multi_packs[o]}`],r,!0))})}return s}const HI={extension:ke.Asset,cache:{test:i=>i instanceof Av,getCacheableAssets:(i,e)=>v1(i,e,!1)},resolver:{test:i=>{const e=i.split("?")[0].split("."),t=e.pop(),s=e.pop();return t==="json"&&jI.includes(s)},parse:i=>{var t;const e=i.split(".");return{resolution:parseFloat(((t=Le.RETINA_PREFIX.exec(i))==null?void 0:t[1])??"1"),format:e[e.length-2],src:i}}},loader:{name:"spritesheetLoader",extension:{type:ke.LoadParser,priority:ii.Normal},async testParse(i,e){return ts.extname(e.src).toLowerCase()===".json"&&!!i.frames},async parse(i,e,t){var h,u;const{texture:s,imageFilename:n,cachePrefix:r}=(e==null?void 0:e.data)??{};let o=ts.dirname(e.src);o&&o.lastIndexOf("/")!==o.length-1&&(o+="/");let a;if(s&&s.baseTexture)a=s;else{const d=lh(o+(n??i.meta.image),e.src);a=(await t.load([d]))[d]}const l=new Av({texture:a.baseTexture,data:i,resolutionFilename:e.src,cachePrefix:r});await l.parse();const c=(h=i==null?void 0:i.meta)==null?void 0:h.related_multi_packs;if(Array.isArray(c)){const d=[];for(const p of c){if(typeof p!="string")continue;let m=o+p;(u=e.data)!=null&&u.ignoreMultiPack||(m=lh(m,e.src),d.push(t.load({src:m,data:{ignoreMultiPack:!0}})))}const f=await Promise.all(d);l.linkedSheets=f,f.forEach(p=>{p.linkedSheets=[l].concat(l.linkedSheets.filter(m=>m!==p))})}return l},unload(i){i.destroy(!0)}}};Xe.add(HI);class mh{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class Fc{static test(e){return typeof e=="string"&&e.startsWith("info face=")}static parse(e){const t=e.match(/^[a-z]+\s+.+$/gm),s={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const r in t){const o=t[r].match(/^[a-z]+/gm)[0],a=t[r].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),l={};for(const c in a){const h=a[c].split("="),u=h[0],d=h[1].replace(/"/gm,""),f=parseFloat(d),p=isNaN(f)?d:f;l[u]=p}s[o].push(l)}const n=new mh;return s.info.forEach(r=>n.info.push({face:r.face,size:parseInt(r.size,10)})),s.common.forEach(r=>n.common.push({lineHeight:parseInt(r.lineHeight,10)})),s.page.forEach(r=>n.page.push({id:parseInt(r.id,10),file:r.file})),s.char.forEach(r=>n.char.push({id:parseInt(r.id,10),page:parseInt(r.page,10),x:parseInt(r.x,10),y:parseInt(r.y,10),width:parseInt(r.width,10),height:parseInt(r.height,10),xoffset:parseInt(r.xoffset,10),yoffset:parseInt(r.yoffset,10),xadvance:parseInt(r.xadvance,10)})),s.kerning.forEach(r=>n.kerning.push({first:parseInt(r.first,10),second:parseInt(r.second,10),amount:parseInt(r.amount,10)})),s.distanceField.forEach(r=>n.distanceField.push({distanceRange:parseInt(r.distanceRange,10),fieldType:r.fieldType})),n}}class um{static test(e){const t=e;return typeof e!="string"&&"getElementsByTagName"in e&&t.getElementsByTagName("page").length&&t.getElementsByTagName("info")[0].getAttribute("face")!==null}static parse(e){const t=new mh,s=e.getElementsByTagName("info"),n=e.getElementsByTagName("common"),r=e.getElementsByTagName("page"),o=e.getElementsByTagName("char"),a=e.getElementsByTagName("kerning"),l=e.getElementsByTagName("distanceField");for(let c=0;c")?um.test(Le.ADAPTER.parseXML(e)):!1}static parse(e){return um.parse(Le.ADAPTER.parseXML(e))}}const ef=[Fc,um,dm];function WI(i){for(let e=0;e=l-F*o){if(m===0)throw new Error(`[BitmapFont] textureHeight ${l}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${b}')`);--w,g=null,v=null,y=null,m=0,p=0,x=0;continue}if(x=Math.max(F+_.fontProperties.descent,x),I*o+p>=d){if(p===0)throw new Error(`[BitmapFont] textureWidth ${a}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${b}')`);--w,m+=x*o,m=Math.ceil(m),p=0,x=0;continue}qI(g,v,_,p,m,o,u);const k=Oc(_.text);f.char.push({id:k,page:M.length-1,x:p/o,y:m/o,width:I,height:F,xoffset:0,yoffset:0,xadvance:E-(u.dropShadow?u.dropShadowDistance:0)-(u.stroke?u.strokeThickness:0)}),p+=(I+2*r)*o,p=Math.ceil(p)}if(!(s!=null&&s.skipKerning))for(let w=0,b=h.length;w 0.99) {\r - alpha = 1.0;\r - }\r -\r - // Gamma correction for coverage-like alpha\r - float luma = dot(uColor.rgb, vec3(0.299, 0.587, 0.114));\r - float gamma = mix(1.0, 1.0 / 2.2, luma);\r - float coverage = pow(uColor.a * alpha, gamma); \r -\r - // NPM Textures, NPM outputs\r - gl_FragColor = vec4(uColor.rgb, coverage);\r -}\r -`,JI=`// Mesh material default fragment\r -attribute vec2 aVertexPosition;\r -attribute vec2 aTextureCoord;\r -\r -uniform mat3 projectionMatrix;\r -uniform mat3 translationMatrix;\r -uniform mat3 uTextureMatrix;\r -\r -varying vec2 vTextureCoord;\r -\r -void main(void)\r -{\r - gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r -\r - vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r -}\r -`;const Ev=[],Iv=[],Rv=[],QI=class x1 extends gs{constructor(e,t={}){super();const{align:s,tint:n,maxWidth:r,letterSpacing:o,fontName:a,fontSize:l}=Object.assign({},x1.styleDefaults,t);if(!tr.available[a])throw new Error(`Missing BitmapFont "${a}"`);this._activePagesMeshData=[],this._textWidth=0,this._textHeight=0,this._align=s,this._tintColor=new Et(n),this._font=void 0,this._fontName=a,this._fontSize=l,this.text=e,this._maxWidth=r,this._maxLineHeight=0,this._letterSpacing=o,this._anchor=new Rn(()=>{this.dirty=!0},this,0,0),this._roundPixels=Le.ROUND_PIXELS,this.dirty=!0,this._resolution=Le.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){var I;const e=tr.available[this._fontName],t=this.fontSize,s=t/e.size,n=new vt,r=[],o=[],a=[],l=this._text.replace(/(?:\r\n|\r)/g,` -`)||" ",c=y1(l),h=this._maxWidth*e.size/t,u=e.distanceFieldType==="none"?Ev:Iv;let d=null,f=0,p=0,m=0,g=-1,v=0,y=0,x=0,M=0;for(let k=0;k0&&n.x>h&&(++y,Ko(r,1+g-y,1+k-g),k=g,g=-1,o.push(v),a.push(r.length>0?r[r.length-1].prevSpaces:0),p=Math.max(p,v),m++,n.x=0,n.y+=e.lineHeight,d=null,M=0)}const C=c[c.length-1];C!=="\r"&&C!==` -`&&(/(?:\s)/.test(C)&&(f=v),o.push(f),p=Math.max(p,f),a.push(-1));const w=[];for(let k=0;k<=m;k++){let B=0;this._align==="right"?B=p-o[k]:this._align==="center"?B=(p-o[k])/2:this._align==="justify"&&(B=a[k]<0?0:(p-o[k])/a[k]),w.push(B)}const b=r.length,_={},E=[],F=this._activePagesMeshData;u.push(...F);for(let k=0;k6*D)||B.vertices.lengtht[n.mesh.texture.baseTexture.uid]).forEach(n=>{n.mesh.texture=ze.EMPTY});for(const n in t)t[n].destroy(),delete t[n];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(e)}};QI.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};const eR=[".xml",".fnt"],tR={extension:{type:ke.LoadParser,priority:ii.Normal},name:"loadBitmapFont",test(i){return eR.includes(ts.extname(i).toLowerCase())},async testParse(i){return Fc.test(i)||dm.test(i)},async parse(i,e,t){const s=Fc.test(i)?Fc.parse(i):dm.parse(i),{src:n}=e,{page:r}=s,o=[];for(let c=0;ca[c]);return tr.install(s,l,!0)},async load(i,e){return(await Le.ADAPTER.fetch(i)).text()},unload(i){i.destroy()}};Xe.add(tR);const fm=class Do extends Sr{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(e){return new Do(Object.keys(Do.defaultOptions).reduce((t,s)=>({...t,[s]:e[s]}),{}))}cleanFonts(){this._fonts.length>0&&(this._fonts.forEach(e=>{URL.revokeObjectURL(e.src),e.refs--,e.refs===0&&(e.fontFace&&document.fonts.delete(e.fontFace),delete Do.availableFonts[e.originalUrl])}),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(e,t={}){const{availableFonts:s}=Do;if(s[e]){const n=s[e];return this._fonts.push(n),n.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return Le.ADAPTER.fetch(e).then(n=>n.blob()).then(async n=>new Promise((r,o)=>{const a=URL.createObjectURL(n),l=new FileReader;l.onload=()=>r([a,l.result]),l.onerror=o,l.readAsDataURL(n)})).then(async([n,r])=>{const o=Object.assign({family:ts.basename(e,ts.extname(e)),weight:"normal",style:"normal",display:"auto",src:n,dataSrc:r,refs:1,originalUrl:e,fontFace:null},t);s[e]=o,this._fonts.push(o),this.styleID++;const a=new FontFace(o.family,`url(${o.src})`,{weight:o.weight,style:o.style,display:o.display});o.fontFace=a,await a.load(),document.fonts.add(a),await document.fonts.ready,this.styleID++,this.fontsDirty=!0})}addOverride(...e){const t=e.filter(s=>!this._overrides.includes(s));t.length>0&&(this._overrides.push(...t),this.styleID++)}removeOverride(...e){const t=e.filter(s=>this._overrides.includes(s));t.length>0&&(this._overrides=this._overrides.filter(s=>!t.includes(s)),this.styleID++)}toCSS(e){return[`transform: scale(${e})`,"transform-origin: top left","display: inline-block",`color: ${this.normalizeColor(this.fill)}`,`font-size: ${this.fontSize}px`,`font-family: ${this.fontFamily}`,`font-weight: ${this.fontWeight}`,`font-style: ${this.fontStyle}`,`font-variant: ${this.fontVariant}`,`letter-spacing: ${this.letterSpacing}px`,`text-align: ${this.align}`,`padding: ${this.padding}px`,`white-space: ${this.whiteSpace}`,...this.lineHeight?[`line-height: ${this.lineHeight}px`]:[],...this.wordWrap?[`word-wrap: ${this.breakWords?"break-all":"break-word"}`,`max-width: ${this.wordWrapWidth}px`]:[],...this.strokeThickness?[`-webkit-text-stroke-width: ${this.strokeThickness}px`,`-webkit-text-stroke-color: ${this.normalizeColor(this.stroke)}`,`text-stroke-width: ${this.strokeThickness}px`,`text-stroke-color: ${this.normalizeColor(this.stroke)}`,"paint-order: stroke"]:[],...this.dropShadow?[this.dropShadowToCSS()]:[],...this._overrides].join(";")}toGlobalCSS(){return this._fonts.reduce((e,t)=>`${e} - @font-face { - font-family: "${t.family}"; - src: url('${t.dataSrc}'); - font-weight: ${t.weight}; - font-style: ${t.style}; - font-display: ${t.display}; - }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(e){this._stylesheet!==e&&(this._stylesheet=e,this.styleID++)}normalizeColor(e){return Array.isArray(e)&&(e=j2(e)),typeof e=="number"?G2(e):e}dropShadowToCSS(){let e=this.normalizeColor(this.dropShadowColor);const t=this.dropShadowAlpha,s=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),n=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);e.startsWith("#")&&t<1&&(e+=(t*255|0).toString(16).padStart(2,"0"));const r=`${s}px ${n}px`;return this.dropShadowBlur>0?`text-shadow: ${r} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${r} ${e}`}reset(){Object.assign(this,Do.defaultOptions)}onBeforeDraw(){const{fontsDirty:e}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&e?new Promise(t=>setTimeout(t,100)):Promise.resolve()}get isSafari(){const{userAgent:e}=Le.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(e)}set fillGradientStops(e){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(e){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(e){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(e){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(e){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(e){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(e){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};fm.availableFonts={},fm.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let tf=fm;const hc=class Uo extends _r{constructor(e="",t={}){super(ze.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const s=new Image,n=ze.from(s,{scaleMode:Le.SCALE_MODE,resourceOptions:{autoLoad:!1}});n.orig=new ot,n.trim=new ot,this.texture=n;const r="http://www.w3.org/2000/svg",o="http://www.w3.org/1999/xhtml",a=document.createElementNS(r,"svg"),l=document.createElementNS(r,"foreignObject"),c=document.createElementNS(o,"div"),h=document.createElementNS(o,"style");l.setAttribute("width","10000"),l.setAttribute("height","10000"),l.style.overflow="hidden",a.appendChild(l),this.maxWidth=Uo.defaultMaxWidth,this.maxHeight=Uo.defaultMaxHeight,this._domElement=c,this._styleElement=h,this._svgRoot=a,this._foreignObject=l,this._foreignObject.appendChild(h),this._foreignObject.appendChild(c),this._image=s,this._loadImage=new Image,this._autoResolution=Uo.defaultAutoResolution,this._resolution=Uo.defaultResolution??Le.RESOLUTION,this.text=e,this.style=t}measureText(e){var h,u;const{text:t,style:s,resolution:n}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);Object.assign(this._domElement,{innerHTML:t,style:s.toCSS(n)}),this._styleElement.textContent=s.toGlobalCSS(),document.body.appendChild(this._svgRoot);const r=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:o,height:a}=r;(o>this.maxWidth||a>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const l=Math.min(this.maxWidth,Math.ceil(o)),c=Math.min(this.maxHeight,Math.ceil(a));return this._svgRoot.setAttribute("width",l.toString()),this._svgRoot.setAttribute("height",c.toString()),t!==this._text&&(this._domElement.innerHTML=this._text),s!==this._style&&(Object.assign(this._domElement,{style:(h=this._style)==null?void 0:h.toCSS(n)}),this._styleElement.textContent=(u=this._style)==null?void 0:u.toGlobalCSS()),{width:l+s.padding*2,height:c+s.padding*2}}async updateText(e=!0){const{style:t,_image:s,_loadImage:n}=this;if(this.localStyleID!==t.styleID&&(this.dirty=!0,this.localStyleID=t.styleID),!this.dirty&&e)return;const{width:r,height:o}=this.measureText();s.width=n.width=Math.ceil(Math.max(1,r)),s.height=n.height=Math.ceil(Math.max(1,o)),this._updateID++;const a=this._updateID;await new Promise(l=>{n.onload=async()=>{if(a/gi,"

").replace(/
/gi,"
").replace(/ /gi," ")}};hc.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},hc.defaultMaxWidth=2024,hc.defaultMaxHeight=2024,hc.defaultAutoResolution=!0;function ph(i,e){const t=Math.max(0,Number(i)||0),s=Math.max(0,Number(e)||0);return{inner:Math.min(t,s),outer:Math.max(t,s)}}function b1(i){const e=Math.max(0,Number(i.outerRectW)||0),t=Math.max(0,Number(i.outerRectH)||0);return{innerW:Math.min(e,Math.max(0,Number(i.innerRectW)||0)),innerH:Math.min(t,Math.max(0,Number(i.innerRectH)||0)),outerW:e,outerH:t}}function sR(i,e,t,s,n){if(i==="random")return n();const r=Math.max(1,Math.round(t)),o=Math.max(0,Math.round(e))%r;return s?o/r:r<=1?.5:o/(r-1)}function Pv(i,e,t,s){const n=Math.sqrt(i*i+s()*(e*e-i*i));return{x:Math.cos(t)*n,y:-Math.sin(t)*n,radialAngle:-t*180/Math.PI}}function iR(i,e){const{innerW:t,innerH:s,outerW:n,outerH:r}=b1(i),o=Math.max(0,(n-t)/2),a=Math.max(0,(r-s)/2),l=o*r,c=t*a,h=l*2+c*2;if(h<=0){const p=n*2+r*2;if(p<=0)return{x:0,y:0,radialAngle:0};let m=e()*p,g,v;return mt?0:i==="linear"?1-e/t:i==="inverse"?Math.min(10,t/Math.max(e,t*.1)):1}function lR(i,e,t,s,n,r,o){const a=i-t,l=e-s,c=Math.hypot(a,l);if(c<=1e-4||c>r)return{x:0,y:0};const h=n*w1(o,c,r)*10;return{x:-l/c*h,y:a/c*h}}function cR(i,e,t){const s=i.rotation*Math.PI/180,n=Math.cos(s),r=Math.sin(s),o=Math.max(1e-4,Math.abs(i.scaleX??1)),a=Math.max(1e-4,Math.abs(i.scaleY??1)),l=e-i.x,c=t-i.y,h=(n*l+r*c)/o,u=(-r*l+n*c)/a,d=(w,b,_,E)=>{const F=_/o,I=E/a,k=Math.max(1e-4,Math.hypot(F,I)),B=F/k,D=I/k,X=n*B-r*D,N=r*B+n*D;return{x:i.x+n*w*o-r*b*a+X*.05,y:i.y+r*w*o+n*b*a+N*.05,nx:X,ny:N}};if(i.shape==="circle"){const w=Math.max(.001,i.radius),b=Math.hypot(h,u);if(b>=w)return null;const _=b>1e-4?h/b:1,E=b>1e-4?u/b:0;return d(_*w,E*w,_,E)}if(i.shape==="ellipse"){const w=Math.max(.001,i.radiusX),b=Math.max(.001,i.radiusY),_=Math.hypot(h/w,u/b);if(_>=1)return null;const E=_>1e-4?1/_:1,F=_>1e-4?h*E:w,I=_>1e-4?u*E:0,k=Math.max(1e-4,Math.hypot(F/(w*w),I/(b*b)));return d(F,I,F/(w*w)/k,I/(b*b)/k)}if(i.shape==="rect"){const w=Math.max(.001,i.width*.5),b=Math.max(.001,i.height*.5);if(Math.abs(h)>=w||Math.abs(u)>=b)return null;const _=w-Math.abs(h),E=b-Math.abs(u);if(_=0?1:-1;return d(I*w,u,I,0)}const F=u>=0?1:-1;return d(h,F*b,0,F)}const f=Math.max(3,Math.min(16,Math.round(i.sides||(i.shape==="custom"?5:6)))),p=Math.max(.001,i.width*.5),m=Math.max(.001,i.height*.5),g=Array.from({length:f},(w,b)=>{const _=Math.PI*.5+b/f*Math.PI*2;return{x:Math.cos(_)*p,y:Math.sin(_)*m}});let v=!1;for(let w=0,b=g.length-1;wu!=E.y>u&&h<(E.x-_.x)*(u-_.y)/(E.y-_.y)+_.x&&(v=!v)}if(!v)return null;let y=g[0].x,x=g[0].y,M=1/0;for(let w=0;w>>0^Math.imul(e+1,2654435761)^t)>>>0;return s^=s>>>16,s=Math.imul(s,2146121005),s^=s>>>15,s=Math.imul(s,2221713035),s^=s>>>16,(s>>>0)/4294967296}function Eo(i,e,t,s,n){return i==="fixed"?e:i==="curve"?Ms(e,t,en(s,n)):Ms(e,t,n)}function sf(i,e,t,s,n,r){return i==="curve"?Ms(e,t,en(s,n)):i==="random"?r:e}function Ov(i,e,t,s,n){const r=1-n;return r*r*r*i+3*r*r*n*e+3*r*n*n*t+n*n*n*s}function en(i,e,t="线性"){if(!Array.isArray(i)||i.length===0)return 1;const s=[...i].sort((n,r)=>n.x-r.x);if(e<=s[0].x)return s[0].y;if(e>=s[s.length-1].x)return s[s.length-1].y;for(let n=0;n=s[n].x&&e<=s[n+1].x){const r=s[n],o=s[n+1],a=o.x-r.x||1;if(t!=="贝塞尔")return Ms(r.y,o.y,(e-r.x)/a);const l=r.x+(r.outX??a/3),c=r.y+(r.outY??(o.y-r.y)/3),h=o.x+(o.inX??-a/3),u=o.y+(o.inY??-(o.y-r.y)/3);let d=0,f=1;for(let p=0;p<14;p++){const m=(d+f)/2;Ov(r.x,l,h,o.x,m)>>0;return function(){e|=0,e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}function ta(i){let e=i.replace("#","");return e.length===3&&(e=e.split("").map(t=>t+t).join("")),parseInt(e,16)}function uR(i,e,t){const s=Lv(i),n=Lv(e),r=Math.round(s[0]+(n[0]-s[0])*t),o=Math.round(s[1]+(n[1]-s[1])*t),a=Math.round(s[2]+(n[2]-s[2])*t);return r<<16|o<<8|a}function mm(i,e){if(!Array.isArray(i)||i.length===0)return 16777215;const t=[...i].sort((s,n)=>s.position-n.position);if(e<=t[0].position)return ta(t[0].color);if(e>=t[t.length-1].position)return ta(t[t.length-1].color);for(let s=0;sr.position)continue;const o=(e-n.position)/Math.max(1e-4,r.position-n.position);return uR(n.color,r.color,o)}return ta(t[t.length-1].color)}function Lv(i){let e=i.replace("#","");e.length===3&&(e=e.split("").map(s=>s+s).join(""));const t=parseInt(e,16);return[t>>16&255,t>>8&255,t&255]}function dR(){return{sprite:null,boneName:"",mesh:null,meshSignature:"",history:[],bones:[],skinWeights:[],currentWidth:0,currentAlpha:0,currentColor:16777215,resourceId:1,enabled:!1,sampledLength:100,sampledWidth:100}}function Lc(i){i.history.length=0,i.bones.length=0,i.mesh&&(i.mesh.visible=!1)}class fR{constructor(e){S(this,"container");this.container=e}ensureMesh(e,t,s){const n=t.trailResources.find(g=>g.id===e.resourceId)||t.trailResources[0],r=(n==null?void 0:n.texture)||ze.EMPTY,o=Number(n==null?void 0:n.rotation)||0,a=Math.max(2,Math.min(16,Math.round(t.trailGridRows))),l=Math.max(2,Math.min(32,Math.round(t.trailGridCols))),c=Math.max(2,Math.min(16,Math.round((n==null?void 0:n.boneCount)??3))),h=`${a}:${l}:${c}:${(n==null?void 0:n.id)??0}:${o}`;if(e.mesh&&e.meshSignature===h)return e.mesh.texture!==r&&(e.mesh.texture=r),e.mesh;e.mesh&&(this.container.removeChild(e.mesh),e.mesh.destroy()),e.meshSignature&&e.meshSignature!==h&&(e.history.length=0,e.bones.length=0);const u=new Float32Array(a*l*2),d=new Float32Array(a*l*2),f=[],p=[];for(let g=0;g.05?e.history.unshift({x:t,y:s}):(r.x=t,r.y=s);const o=Math.max(1,n)*1.5;let a=0,l=e.history.length;for(let c=1;c=o||c>=239){l=c+1;break}e.history.length>l&&(e.history.length=l)}sampleBones(e,t,s){const n=Math.max(2,Math.min(16,Math.round(s))),r=e.history,o=[];if(!r.length)return o;let a=0;for(let c=1;c=h&&g>1e-4){const v=(h-u)/g;d={x:Ms(p.x,m.x,v),y:Ms(p.y,m.y,v)};break}u+=g}o.push({boneName:`${e.boneName}_trail_${c}`,x:d.x,y:d.y,rotation:0})}for(let c=0;c1){const c=o[0].rotation,u=(o[o.length-1].rotation-c+540)%360-180;for(let d=0;dh.id===s.resourceId)||t.trailResources[0];if(!(r!=null&&r.texture)||s.bones.length<2){n.visible=!1;return}e.resourceId=r.id,n.texture!==r.texture&&(n.texture=r.texture);const o=Math.max(2,Math.min(16,Math.round(t.trailGridRows))),a=Math.max(2,Math.min(32,Math.round(t.trailGridCols))),l=n.vertices,c=[];for(let h=0;h.5&&s.alpha>0}update(e,t,s,n,r,o,a){if(e.sprite=a,e.boneName=s,!t.trail||!e.enabled||e.sampledLength<=0||e.sampledWidth<=0){Lc(e);return}this.ensureMesh(e,t,a);const l=t.trailResources.find(f=>f.id===e.resourceId)||t.trailResources[0];this.appendPoint(e,n,r,e.sampledLength);const c=l!=null&&l.lifeLengthEnabled?Math.max(0,en(l.lifeLengthCurve,o)):1,h=Math.max(0,e.sampledLength)*c;e.bones=this.sampleBones(e,h,(l==null?void 0:l.boneCount)??3),e.bones[0]&&(e.bones[0].x=n,e.bones[0].y=r);const u=(l==null?void 0:l.widthMode)==="particle"?(Math.abs(a.scale.x)+Math.abs(a.scale.y))*.5:1;e.currentWidth=Math.max(0,e.sampledWidth)*u,e.currentAlpha=(l==null?void 0:l.alphaMode)==="particle"?a.alpha:(l==null?void 0:l.alphaMode)==="curve"?en(l.alphaCurve,o):(l==null?void 0:l.alpha)??1,e.currentColor=(l==null?void 0:l.colorMode)==="particle"?a.tint:(l==null?void 0:l.colorMode)==="curve"?mm(l.colorGradient,o):ta((l==null?void 0:l.color)||"#ffffff");const d={bones:e.bones.map(f=>({...f})),activeBoneCount:e.bones.length,width:e.currentWidth,alpha:Math.min(1,Math.max(0,e.currentAlpha)),colorHex:e.currentColor,resourceId:e.resourceId};return this.skinMesh(e,t,d),d}applyState(e,t,s,n){var r;e.sprite=s,e.resourceId=n.resourceId??((r=t.trailResources[0])==null?void 0:r.id)??1,e.bones=n.bones.map(o=>({...o})),e.currentWidth=n.width,e.currentAlpha=n.alpha,this.skinMesh(e,t,n)}drawDebug(e,t,s,n){if(e.clear(),!t||!s.trail)return;const r=Math.max(2,Math.min(16,Math.round(s.trailGridRows))),o=Math.max(2,Math.min(32,Math.round(s.trailGridCols)));e.lineStyle(1,3790847,.72);for(const a of n){const l=a.mesh;if(!(l!=null&&l.visible))continue;const c=l.vertices,h=(u,d)=>{const f=(u*r+d)*2;return{x:c[f],y:c[f+1]}};for(let u=0;ur.texture||r.sequenceFrames.some(o=>o.texture));if(!t.length)return mR(i.texture);const s=t.reduce((r,o)=>r+Math.max(0,o.weight),0);if(s<=0)return t[Math.floor(e()*t.length)];let n=e()*s;for(const r of t)if(n-=Math.max(0,r.weight),n<=0)return r;return t[t.length-1]}function vR(i,e){const t=i.trailResources.filter(r=>r.texture);if(!t.length)return i.trailResources[0]||pR();const s=t.reduce((r,o)=>r+Math.max(0,o.weight),0);if(s<=0)return t[Math.min(t.length-1,Math.floor(e*t.length))];let n=e*s;for(const r of t)if(n-=Math.max(0,r.weight),n<=0)return r;return t[t.length-1]}function Bv(i,e){if(i.imageMode!=="sequence"||i.sequenceFrames.length<=1)return{index:0,visible:!0};const t=Math.min(120,Math.max(1,Number(i.sequenceFps)||30)),s=Math.max(0,Math.floor(Math.max(0,e)*t)),n=i.sequenceFrames.length-1;return i.sequencePlayback==="once-hide"?{index:Math.min(n,s),visible:s<=n}:i.sequencePlayback==="once-hold"?{index:Math.min(n,s),visible:!0}:i.sequencePlayback==="loop-reverse"?{index:n-s%i.sequenceFrames.length,visible:!0}:{index:s%i.sequenceFrames.length,visible:!0}}function rf(i,e,t){var s;return i.imageMode==="sequence"&&i.sequenceFrames.length?((s=i.sequenceFrames[Math.max(0,Math.min(i.sequenceFrames.length-1,t))])==null?void 0:s.texture)||i.texture||e:i.texture||e}function bl(){return{texture:null,imageResources:[{id:1,texture:null,textureName:"star",textureFolder:"",previewUrl:"/images/star.png",imageMode:"fixed",sequencePlayback:"loop-forward",sequenceFps:30,sequenceFrames:[],weight:100,locked:!1,scale:1,anchorX:.5,anchorY:.5,colorMode:"fixed",colorStart:"#ffffff",colorEnd:"#ff4d4d",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],blend:"normal",independentAlpha:"off",alpha:1,alphaCurveMode:"跟随导出",alphaCurve:[{x:0,y:0},{x:.1,y:1},{x:.9,y:1},{x:1,y:0}]}],imageWeightVersion:1,name:"ParticleSystem1",mode:"stream",rate:20,streamBehavior:"normal",loopDurationFrames:30,generateLoopStartAnimation:!1,loopStartUseCustomDuration:!1,loopStartDurationFrames:30,generateLoopEndAnimation:!1,loopEndUseCustomDuration:!1,loopEndDurationFrames:30,burstCount:50,burstLoop:!1,delay:0,duration:1,shape:"point",showShape:!0,shapeRangeVersion:1,innerRadius:0,outerRadius:30,innerRectW:0,innerRectH:0,outerRectW:60,outerRectH:40,spawnPathId:0,spawnPathDistribution:"fixed",radius:30,rectW:60,rectH:40,centerX:0,centerY:0,rootRotation:0,rootScaleX:1,rootScaleY:1,renderLayerMode:"top",renderLayerSpineId:0,renderLayerSlotName:"",renderLayerSlotPosition:"above",renderLayerFollowAttachment:!1,emissionAngleMode:"random",direction:0,spread:360,coneDirection:90,coneAngle:60,lifeMin:.6,lifeMax:1.8,lifeMode:"random",lifeCurve:[{x:0,y:0},{x:1,y:1}],speedMin:30,speedMax:140,speedMode:"random",speedCurve:[{x:0,y:0},{x:1,y:1}],scaleMin:.3,scaleMax:.8,scaleMode:"random",scaleAxisMode:"uniform",scaleYMin:.3,scaleYMax:.8,scaleCurve:[{x:0,y:0},{x:1,y:1}],scaleYCurve:[{x:0,y:0},{x:1,y:1}],scaleEndRatio:.3,initialRotationMode:"random",initialRotationMin:0,initialRotationMax:360,initialRotationCurve:[{x:0,y:0},{x:1,y:1}],alpha:.9,alphaEnd:0,rotationSpeedMin:-180,rotationSpeedMax:180,speedOverLifeEnabled:!1,speedOverLifeMode:"fixed",speedOverLifeMin:1,speedOverLifeMax:1,speedOverLifeCurve:[{x:0,y:1},{x:1,y:1}],scaleOverLifeEnabled:!1,scaleOverLifeMode:"curve",scaleOverLifeAxisMode:"uniform",scaleOverLifeMin:0,scaleOverLifeMax:1,scaleYOverLifeMin:0,scaleYOverLifeMax:1,scaleOverLifeCurve:[{x:0,y:1},{x:1,y:1}],scaleYOverLifeCurve:[{x:0,y:1},{x:1,y:1}],rotationOverLifeEnabled:!1,rotationOverLifeMode:"random",rotationOverLifeCurve:[{x:0,y:0},{x:1,y:1}],gravity:980,gravityMode:"fixed",gravityMin:980,gravityMax:980,gravityDirection:-90,gravityCurve:[{x:0,y:1},{x:1,y:1}],damping:0,seed:0,colorStart:"#ffffff",colorEnd:"#ff4d4d",colorOverLife:!1,blend:"add",alphaMode:"curve",curveMode:"线性",alphaCurve:[{x:0,y:0},{x:.2,y:1},{x:.8,y:1},{x:1,y:0}],textureName:"star",textureFolder:"",alphaScale:1,anchorX:.5,anchorY:.5,independentAlpha:"off",offsetX:0,offsetY:0,noise:!1,noiseAmt:30,noiseRange:100,noiseSpeed:1,useGravity:!1,wind:!1,windX:0,windY:0,windMode:"fixed",windMin:100,windMax:100,windDirection:0,windCurve:[{x:0,y:1},{x:1,y:1}],forceField:!1,forceStrength:10,forceRadius:100,forceCenterX:0,forceCenterY:0,forceFalloff:"linear",showForceFieldShape:!0,vortex:!1,vortexStrength:10,vortexRadius:100,vortexCenterX:0,vortexCenterY:0,vortexFalloff:"linear",showVortexShape:!0,attraction:!1,attractionCenterX:200,attractionCenterY:0,attractionRadius:20,attractionDuration:.5,attractionDelay:.1,attractionDelayMode:"particle",attractionPath:"curve",showAttractionShape:!0,trail:!1,trailConfigVersion:3,trailResources:[{id:1,texture:null,textureName:"trail",previewUrl:"/images/trail.png",weight:100,locked:!1,rotation:0,colorMode:"particle",color:"#ffffff",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],blend:"normal",alphaMode:"particle",alpha:1,alphaCurve:[{x:0,y:1},{x:1,y:1}],boneCount:3,trailRatio:100,lengthMode:"fixed",length:100,lengthMin:100,lengthMax:100,widthSizeMode:"fixed",width:100,widthMin:100,widthMax:100,widthMode:"particle",lifeLengthEnabled:!1,lifeLengthCurve:[{x:0,y:1},{x:1,y:1}],shapeEnabled:!1,shapeCurve:[{x:0,y:1},{x:1,y:1}]}],trailResourceVersion:6,trailTexture:null,trailTextureName:"trail",trailPreviewUrl:"/images/trail.png",trailColorMode:"particle",trailColor:"#ffffff",trailColorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],trailAlphaMode:"particle",trailAlpha:1,trailAlphaCurve:[{x:0,y:1},{x:1,y:1}],trailBoneCount:3,trailLength:100,trailWidth:100,trailWidthMode:"particle",trailLifeLengthEnabled:!1,trailLifeLengthCurve:[{x:0,y:1},{x:1,y:1}],trailShapeEnabled:!1,trailShapeCurve:[{x:0,y:1},{x:1,y:1}],trailGridRows:4,trailGridCols:4,collision:!1,collisionColliderIds:[],pathFollow:!1,emitterFollow:!1,emitterFollowMode:"none",emitterFollowPathId:0,emitterFollowSpineId:0,emitterFollowBoneName:"",emitterFollowBoneOffsetX:0,emitterFollowBoneOffsetY:0,emitterFollowBoneRotation:0,emitterFollowBoneScaleX:1,emitterFollowBoneScaleY:1,emitterAngleMode:"fixed",emitterFollowCurve:[{x:0,y:0},{x:1,y:1}],emitterFollowDuration:2,emitterFollowSpace:"world",emitterFollowDirection:"forward",emitterFollowOffset:0}}function Dn(i){var F;const e=bl(),t=i,s=t.shapeRangeVersion!==1,n=Number(t.radius),r=Number(t.rectW),o=Number(t.rectH),a=Number(t.direction),l=Number(t.spread),c=t.shape,h=t.imageWeightVersion!==1,u=t.loopDurationFrames==null,d=t.gravityMode==null,f=Number(t.gravity),p=t.windMode==null,m=Number(t.windX),g=Number(t.windY),v=t.forceFalloff==null,y=Number(t.forceStrength),x=t.trailConfigVersion!==3,M=!Array.isArray(t.trailResources),C=t.trailResourceVersion!==6,w=t.trailTexture,b=String(t.trailTextureName||"trail"),_=String(t.trailPreviewUrl||"/images/trail.png").replace("/trails/trail.png","/images/trail.png");for(const[I,k]of Object.entries(e))t[I]!==void 0&&t[I]!==null||(t[I]=Array.isArray(k)?k.map(B=>typeof B=="object"&&B!==null?{...B}:B):k);s&&(i.innerRadius=0,i.outerRadius=Math.max(0,Number.isFinite(n)?n:e.outerRadius),i.innerRectW=0,i.innerRectH=0,i.outerRectW=Math.max(0,Number.isFinite(r)?r:e.outerRectW),i.outerRectH=Math.max(0,Number.isFinite(o)?o:e.outerRectH),i.coneDirection=Number.isFinite(a)?a:90,i.emissionAngleMode=Number.isFinite(l)&&l>0?"random":"fixed",c==="cone"&&(i.spread=Math.max(0,Number(i.coneAngle)||0)),i.shapeRangeVersion=1),i.shape==="orbit"&&(i.shape="path"),["fixed","random","radial","path-normal","path-tangent"].includes(i.emissionAngleMode)||(i.emissionAngleMode="fixed"),!["circle","rect","cone"].includes(i.shape)&&i.emissionAngleMode==="radial"&&(i.emissionAngleMode="fixed"),i.shape!=="path"&&(i.emissionAngleMode==="path-normal"||i.emissionAngleMode==="path-tangent")&&(i.emissionAngleMode="fixed"),i.spawnPathId=Math.max(0,Math.round(Number(i.spawnPathId)||0)),i.spawnPathDistribution!=="fixed"&&i.spawnPathDistribution!=="random"&&(i.spawnPathDistribution="fixed"),i.renderLayerMode!=="top"&&i.renderLayerMode!=="slot"&&(i.renderLayerMode="top"),i.renderLayerSpineId=Math.max(0,Math.round(Number(i.renderLayerSpineId)||0)),typeof i.renderLayerSlotName!="string"&&(i.renderLayerSlotName=""),i.renderLayerSlotPosition!=="above"&&i.renderLayerSlotPosition!=="below"&&(i.renderLayerSlotPosition="above"),typeof i.renderLayerFollowAttachment!="boolean"&&(i.renderLayerFollowAttachment=!1),i.innerRadius=Math.max(0,Number(i.innerRadius)||0),i.outerRadius=Math.max(i.innerRadius,Number(i.outerRadius)||0),i.innerRectW=Math.max(0,Number(i.innerRectW)||0),i.innerRectH=Math.max(0,Number(i.innerRectH)||0),i.outerRectW=Math.max(i.innerRectW,Number(i.outerRectW)||0),i.outerRectH=Math.max(i.innerRectH,Number(i.outerRectH)||0);const E=Array.from(new Set((Array.isArray(i.collisionColliderIds)?i.collisionColliderIds:[]).map(I=>Math.round(Number(I))).filter(I=>Number.isFinite(I)&&I>0)));(E.length!==i.collisionColliderIds.length||E.some((I,k)=>I!==i.collisionColliderIds[k]))&&(i.collisionColliderIds=E),i.streamBehavior!=="normal"&&i.streamBehavior!=="loop"&&(i.streamBehavior="normal"),(u||!Number.isFinite(i.loopDurationFrames))&&(i.loopDurationFrames=Math.ceil(Math.max(1/30,Number(i.duration)||1)*30)),i.loopDurationFrames=Math.min(1800,Math.max(1,Math.ceil(i.loopDurationFrames))),typeof i.generateLoopStartAnimation!="boolean"&&(i.generateLoopStartAnimation=!1),typeof i.generateLoopEndAnimation!="boolean"&&(i.generateLoopEndAnimation=!1),typeof i.loopStartUseCustomDuration!="boolean"&&(i.loopStartUseCustomDuration=!1),typeof i.loopEndUseCustomDuration!="boolean"&&(i.loopEndUseCustomDuration=!1),i.loopStartDurationFrames=Math.min(1800,Math.max(1,Math.ceil(Number(i.loopStartDurationFrames)||30))),i.loopEndDurationFrames=Math.min(1800,Math.max(1,Math.ceil(Number(i.loopEndDurationFrames)||30))),(!Array.isArray(i.imageResources)||i.imageResources.length===0)&&(i.imageResources=bl().imageResources);for(const I of i.imageResources){!I.texture&&i.texture&&(I.texture=i.texture),I.textureName||(I.textureName="star"),I.previewUrl==="/particles/star.png"&&(I.previewUrl="/images/star.png"),I.previewUrl||(I.previewUrl=I.textureName==="star"?"/images/star.png":""),I.imageMode!=="fixed"&&I.imageMode!=="sequence"&&(I.imageMode="fixed"),I.sequencePlayback==="once"?I.sequencePlayback="once-hold":I.sequencePlayback==="loop"?I.sequencePlayback="loop-forward":["once-hide","once-hold","loop-forward","loop-reverse"].includes(I.sequencePlayback)||(I.sequencePlayback="loop-forward"),Number.isFinite(I.sequenceFps)||(I.sequenceFps=30),I.sequenceFps=Math.min(120,Math.max(1,Number(I.sequenceFps)||30)),Array.isArray(I.sequenceFrames)||(I.sequenceFrames=[]);for(const k of I.sequenceFrames)typeof k.name!="string"&&(k.name=""),typeof k.previewUrl!="string"&&(k.previewUrl=""),k.texture===void 0&&(k.texture=null);Number.isFinite(I.weight)||(I.weight=100),typeof I.locked!="boolean"&&(I.locked=!1),Number.isFinite(I.scale)||(I.scale=1),Number.isFinite(I.anchorX)||(I.anchorX=.5),Number.isFinite(I.anchorY)||(I.anchorY=.5),I.colorMode!=="fixed"&&I.colorMode!=="random"&&I.colorMode!=="lifetime"&&(I.colorMode=i.colorOverLife?"lifetime":"fixed"),I.colorStart||(I.colorStart=i.colorStart||"#ffffff"),I.colorEnd||(I.colorEnd=i.colorEnd||I.colorStart),(!Array.isArray(I.colorGradient)||I.colorGradient.length<2)&&(I.colorGradient=[{position:0,color:I.colorStart},{position:1,color:I.colorEnd}]),Object.prototype.hasOwnProperty.call(mr,I.blend)||(I.blend=i.blend||"normal"),["off","fixed","curve"].includes(I.independentAlpha)||(I.independentAlpha=i.independentAlpha||"off"),Number.isFinite(I.alpha)||(I.alpha=Number.isFinite(i.alphaScale)?i.alphaScale:1),["跟随导出","线性","贝塞尔"].includes(I.alphaCurveMode)||(I.alphaCurveMode=i.curveMode||"跟随导出"),(!Array.isArray(I.alphaCurve)||I.alphaCurve.length<2)&&(I.alphaCurve=(i.alphaCurve||[{x:0,y:1},{x:1,y:1}]).map(k=>({...k})))}if(i.imageResources.length===1)i.imageResources[0].weight=100,i.imageResources[0].locked=!1;else if(h){const I=100/i.imageResources.length;i.imageResources.forEach((k,B)=>{k.weight=B===i.imageResources.length-1?100-I*(i.imageResources.length-1):I,k.locked=!1})}if(i.imageWeightVersion=1,d){const I=Number.isFinite(f)&&f!==0?f:980;i.gravity=I,i.gravityMin=I,i.gravityMax=I}if(p){const I=Number.isFinite(m)&&Number.isFinite(g)&&(m!==0||g!==0);i.windMin=I?Math.hypot(m,g):100,i.windMax=i.windMin,i.windDirection=I?Math.atan2(-g,m)*180/Math.PI:0}v&&(i.forceStrength=Number.isFinite(y)&&y!==0?y:10),x&&(i.trailConfigVersion=3,i.trailAlphaCurve=[{x:0,y:1},{x:1,y:1}],i.trailLifeLengthCurve=[{x:0,y:1},{x:1,y:1}],i.trailShapeCurve=[{x:0,y:1},{x:1,y:1}],i.trailGridRows=4,i.trailGridCols=4),(M||!i.trailResources.length)&&(i.trailResources=[{id:1,texture:w||null,textureName:b,previewUrl:_,weight:100,locked:!1,rotation:0,colorMode:i.trailColorMode,color:i.trailColor,colorGradient:i.trailColorGradient.map(I=>({...I})),blend:"normal",alphaMode:i.trailAlphaMode,alpha:i.trailAlpha,alphaCurve:i.trailAlphaCurve.map(I=>({...I})),boneCount:i.trailBoneCount,trailRatio:100,lengthMode:"fixed",length:i.trailLength,lengthMin:i.trailLength,lengthMax:i.trailLength,widthSizeMode:"fixed",width:i.trailWidth,widthMin:i.trailWidth,widthMax:i.trailWidth,widthMode:i.trailWidthMode,lifeLengthEnabled:i.trailLifeLengthEnabled,lifeLengthCurve:i.trailLifeLengthCurve.map(I=>({...I})),shapeEnabled:i.trailShapeEnabled,shapeCurve:i.trailShapeCurve.map(I=>({...I}))}]);for(const I of i.trailResources)I.textureName||(I.textureName="trail"),I.previewUrl==="/trails/trail.png"&&(I.previewUrl="/images/trail.png"),I.previewUrl||(I.previewUrl="/images/trail.png"),Number.isFinite(I.weight)||(I.weight=100),typeof I.locked!="boolean"&&(I.locked=!1),Number.isFinite(I.rotation)||(I.rotation=0),["particle","fixed","curve"].includes(I.colorMode)||(I.colorMode=i.trailColorMode||"particle"),I.color||(I.color=i.trailColor||"#ffffff"),(!Array.isArray(I.colorGradient)||I.colorGradient.length<2)&&(I.colorGradient=(i.trailColorGradient||[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}]).map(k=>({...k}))),Object.prototype.hasOwnProperty.call(mr,I.blend)||(I.blend="normal"),["particle","fixed","curve"].includes(I.alphaMode)||(I.alphaMode=i.trailAlphaMode||"particle"),Number.isFinite(I.alpha)||(I.alpha=Number.isFinite(i.trailAlpha)?i.trailAlpha:1),(!Array.isArray(I.alphaCurve)||I.alphaCurve.length<2)&&(I.alphaCurve=(i.trailAlphaCurve||[{x:0,y:1},{x:1,y:1}]).map(k=>({...k}))),Number.isFinite(I.boneCount)||(I.boneCount=Number.isFinite(i.trailBoneCount)?i.trailBoneCount:3),Number.isFinite(I.trailRatio)||(I.trailRatio=100),I.trailRatio=Math.min(100,Math.max(0,I.trailRatio)),["fixed","random"].includes(I.lengthMode)||(I.lengthMode="fixed"),Number.isFinite(I.length)||(I.length=Number.isFinite(i.trailLength)?i.trailLength:100),Number.isFinite(I.lengthMin)||(I.lengthMin=I.length),Number.isFinite(I.lengthMax)||(I.lengthMax=I.length),["fixed","random"].includes(I.widthSizeMode)||(I.widthSizeMode="fixed"),Number.isFinite(I.width)||(I.width=Number.isFinite(i.trailWidth)?i.trailWidth:100),Number.isFinite(I.widthMin)||(I.widthMin=I.width),Number.isFinite(I.widthMax)||(I.widthMax=I.width),["particle","fixed"].includes(I.widthMode)||(I.widthMode=i.trailWidthMode||"particle"),typeof I.lifeLengthEnabled!="boolean"&&(I.lifeLengthEnabled=!!i.trailLifeLengthEnabled),(!Array.isArray(I.lifeLengthCurve)||I.lifeLengthCurve.length<2)&&(I.lifeLengthCurve=(i.trailLifeLengthCurve||[{x:0,y:1},{x:1,y:1}]).map(k=>({...k}))),typeof I.shapeEnabled!="boolean"&&(I.shapeEnabled=!!i.trailShapeEnabled),(!Array.isArray(I.shapeCurve)||I.shapeCurve.length<2)&&(I.shapeCurve=(i.trailShapeCurve||[{x:0,y:1},{x:1,y:1}]).map(k=>({...k})));if(i.trailResources.length===1&&(i.trailResources[0].weight=100,i.trailResources[0].locked=!1),C)for(const I of i.trailResources)I.alphaCurve=((F=I.alphaCurve)==null?void 0:F.length)>=2?I.alphaCurve:[{x:0,y:1},{x:1,y:1}];return i.trailResourceVersion=6,i}class Nv extends gs{constructor(t,s=oR){super();S(this,"pool",[]);S(this,"cfg");S(this,"accumulator",0);S(this,"burstTimer",0);S(this,"_spawnSerial",0);S(this,"_elapsed",0);S(this,"_attractionEnabledAt",0);S(this,"_attractionWasEnabled",!1);S(this,"states",[]);S(this,"rng",Math.random);S(this,"_lastSeed",-1);S(this,"trailDebugGfx",new Ds);S(this,"trail");S(this,"colliders",[]);S(this,"followSpawnX",0);S(this,"followSpawnY",0);S(this,"followSpawnAngle",0);S(this,"spawnPathSampler",null);S(this,"spawnPathClosed",!1);S(this,"followExportCurveMode","线性");S(this,"simulationTransform",null);this.cfg=Dn(t),this.trail=new fR(this),this._ensurePool(s),this.addChild(this.trailDebugGfx)}setFollowExportCurveMode(t){this.followExportCurveMode=t}resolveCurveMode(t){return t==="跟随导出"?this.followExportCurveMode:t}reseed(){const t=this.cfg.seed;t!==this._lastSeed&&(this._lastSeed=t,this.rng=nf(t>>>0))}_ensurePool(t){for(;this.pool.length=n.delay),o=s==="force"||s==="normal"&&(n.mode==="burst"||this._elapsed=1;)this.accumulator-=1,this.spawnOne();else this.burstTimer+=t,n.burstLoop?this.burstTimer>=1&&(this.burstTimer=0,this.emitBurst()):t>0&&this.burstTimer<=t&&this.emitBurst();const a=[];for(let p=0;p0){const A=Math.max(1e-4,Math.abs(n.rootScaleX)),P=Math.max(1e-4,Math.abs(n.rootScaleY)),O=-(((l=this.simulationTransform)==null?void 0:l.rotation)??n.rootRotation)*Math.PI/180,L=Math.cos(O),$=Math.sin(O),V=((c=this.simulationTransform)==null?void 0:c.centerX)??n.centerX,j=((h=this.simulationTransform)==null?void 0:h.centerY)??n.centerY,K=V+L*A*m.x-$*P*m.y,ie=-j+$*A*m.x+L*P*m.y,re=K,pe=-ie,ge=n.forceCenterX-re,he=n.forceCenterY-pe,fe=Math.hypot(ge,he);if(fe>1e-4&&fe<=n.forceRadius){const Y=w1(n.forceFalloff,fe,n.forceRadius),W=n.forceStrength*Y*10,H=ge/fe*W,G=he/fe*W,q=H,se=-G;m.vx+=(L*q+$*se)/A*t,m.vy+=(-$*q+L*se)/P*t}}if(!m.collisionPaused&&n.vortex&&n.vortexStrength!==0&&n.vortexRadius>0){const A=Dr(n,m.x,m.y,this.simulationTransform),P=lR(A.x,A.y,n.vortexCenterX,n.vortexCenterY,n.vortexStrength,n.vortexRadius,n.vortexFalloff),O=Fv(n,P.x,P.y,this.simulationTransform);m.vx+=O.x*t,m.vy+=O.y*t}if(!m.collisionPaused&&n.damping>0){const A=Math.max(0,1-n.damping*t);m.vx*=A,m.vy*=A}if(m.collisionPaused)m.vx=0,m.vy=0;else if(m.x+=m.vx*t,m.y+=m.vy*t,this.applyColliders(m,p))continue;if(n.attraction&&!m.collisionPaused){const A=m.maxLife-m.life;if(n.attractionDelayMode==="particle"?A>=Math.max(0,n.attractionDelay):this._elapsed-this._attractionEnabledAt>=Math.max(0,n.attractionDelay)){const O=Dr(n,m.x,m.y,this.simulationTransform),L=n.attractionCenterX,$=n.attractionCenterY,V=Math.max(0,n.attractionRadius);if(!m.attractionActive){if(Math.hypot(L-O.x,$-O.y)<=V){this.kill(p);continue}m.attractionActive=!0,m.attractionElapsed=0,m.attractionStartWorldX=O.x,m.attractionStartWorldY=O.y}m.attractionElapsed+=t;const j=Math.max(1e-4,n.attractionDuration),K=Math.min(1,m.attractionElapsed/j);let ie=Ms(m.attractionStartWorldX,L,K),re=Ms(m.attractionStartWorldY,$,K);if(n.attractionPath==="curve"){const he=L-m.attractionStartWorldX,fe=$-m.attractionStartWorldY,Y=Math.hypot(he,fe);if(Y>1e-4){const W=Y*.25*m.attractionCurveSide,H=(m.attractionStartWorldX+L)*.5-fe/Y*W,G=(m.attractionStartWorldY+$)*.5+he/Y*W,q=1-K;ie=q*q*m.attractionStartWorldX+2*q*K*H+K*K*L,re=q*q*m.attractionStartWorldY+2*q*K*G+K*K*$}}const pe=Math.hypot(L-ie,$-re);if(K>=1||pe<=V){this.kill(p);continue}const ge=kv(n,ie,re,this.simulationTransform);m.x=ge.x,m.y=ge.y,m.vx=0,m.vy=0}}const v=g,y=m.sprite,x=n.imageResources.find(A=>A.id===m.resourceId);if(x){const A=Bv(x,m.maxLife-m.life);m.imageFrameIndex=A.index,y.texture=rf(x,n.texture,m.imageFrameIndex),y.visible=A.visible}if(n.speedOverLifeEnabled){const A=uc(sf(n.speedOverLifeMode,n.speedOverLifeMin,n.speedOverLifeMax,n.speedOverLifeCurve,v,m.speedScaleTarget),1),P=m.speedScale===0?A:A/m.speedScale;m.vx*=P,m.vy*=P,m.speedScale=A}let M=m.rotationSpeed;n.rotationOverLifeEnabled&&n.rotationOverLifeMode==="curve"&&(M=Ms(n.rotationSpeedMin,n.rotationSpeedMax,en(n.rotationOverLifeCurve,v))),m.rotation+=M*t;let C=m.x,w=m.y;if(n.noise&&n.noiseAmt>0&&n.noiseRange>0&&n.noiseSpeed>0){const A=m.maxLife-m.life,P=Math.max(0,n.noiseRange)*Math.min(1,Math.max(0,n.noiseAmt)/100)*.5,O=A*Math.max(0,n.noiseSpeed)*Math.PI*2;C+=(Math.sin(m.noisePhaseX+O)-Math.sin(m.noisePhaseX))*P,w+=(Math.sin(m.noisePhaseY+O*.83)-Math.sin(m.noisePhaseY))*P}y.x=C,y.y=w,y.rotation=-m.rotation*Math.PI/180;let b=1,_=1;n.scaleOverLifeEnabled&&(b=sf(n.scaleOverLifeMode,n.scaleOverLifeMin,n.scaleOverLifeMax,n.scaleOverLifeCurve,v,m.scaleOverLifeX),_=n.scaleOverLifeAxisMode==="separate"?sf(n.scaleOverLifeMode,n.scaleYOverLifeMin,n.scaleYOverLifeMax,n.scaleYOverLifeCurve,v,m.scaleOverLifeY):b),y.scale.set(uc(m.scaleStartX*b,1),uc(m.scaleStartY*_,1));const E=n.alphaMode==="curve"?en(n.alphaCurve,v,this.resolveCurveMode(n.curveMode))*n.alphaScale:n.alpha*n.alphaScale;y.alpha=uc((x==null?void 0:x.independentAlpha)==="fixed"?x.alpha:(x==null?void 0:x.independentAlpha)==="curve"?en(x.alphaCurve,v,this.resolveCurveMode(x.alphaCurveMode)):E,1);const F=(x==null?void 0:x.colorStart)||"#ffffff",I=(x==null?void 0:x.colorMode)==="lifetime"?mm(x.colorGradient,v):(x==null?void 0:x.colorMode)==="random"?m.colorSample:ta(F);y.tint=I,y.blendMode=mr[(x==null?void 0:x.blend)||"normal"];const k=this.trail.update(m.trail,n,m.boneName,C,w,v,y),B=Dr(n,C,w,this.simulationTransform),D=((u=this.simulationTransform)==null?void 0:u.rotation)??n.rootRotation,X=Math.abs(((d=this.simulationTransform)==null?void 0:d.scaleX)??n.rootScaleX),N=Math.abs(((f=this.simulationTransform)==null?void 0:f.scaleY)??n.rootScaleY),U=k?{...k,bones:k.bones.map(A=>{const P=Dr(n,A.x,A.y,this.simulationTransform);return{...A,worldX:P.x,worldY:P.y,worldRotation:D-A.rotation}})}:void 0;a.push({boneName:m.boneName,spawnId:m.spawnId,x:C,y:w,rotation:m.rotation,scaleX:y.scale.x,scaleY:y.scale.y,worldX:B.x,worldY:B.y,worldRotation:D+m.rotation,worldScaleX:y.scale.x*X,worldScaleY:y.scale.y*N,alpha:y.alpha,colorHex:I,resourceId:m.resourceId,imageFrameIndex:m.imageFrameIndex,imageVisible:y.visible,trailState:U,active:!0})}return this.states=a,a}drawTrailMeshDebug(t){this.trail.drawDebug(this.trailDebugGfx,t,this.cfg,this.pool.map(s=>s.trail))}emitBurst(){for(let t=0;t0&&this.spawnPathSampler){const a=this.estimatedEmissionCount(),l=sR(t.spawnPathDistribution,this._spawnSerial,a,this.spawnPathClosed,this.rng),c=this.spawnPathSampler(l);if(c)return{...this.applyFollowToOrigin(c.x+s,c.y+n),radialAngle:0,pathAngle:c.angle}}const r=nR(t,this.rng);return{...this.applyFollowToOrigin(s+r.x,n+r.y),radialAngle:r.radialAngle}}estimatedEmissionCount(){const t=this.cfg;return t.mode==="burst"?Math.max(1,Math.round(t.burstCount)):Math.max(1,Math.floor(t.rate*(t.streamBehavior==="loop"?Math.max(1,t.loopDurationFrames)/30:Math.max(0,t.duration))))}applyFollowToOrigin(t,s){const n=this.followSpawnAngle*Math.PI/180,r=Math.cos(n),o=Math.sin(n);return{x:this.followSpawnX+r*t-o*s,y:this.followSpawnY+o*t+r*s}}spawnOne(){const t=this.cfg;let s=this.pool.findIndex(M=>!M.active);if(s===-1)return;const n=this.spawnOrigin(),{x:r,y:o}=n,a=Eo(t.lifeMode,t.lifeMin,t.lifeMax,t.lifeCurve,this.rng()),l=Eo(t.speedMode,t.speedMin,t.speedMax,t.speedCurve,this.rng()),c=rR(t,n,this.followSpawnAngle,this.rng),h=this.pool[s],u=gR(t,this.rng),d=this._spawnSerial++;h.spawnId=d;const f=vR(t,Ur(t.seed,d,1540483477));h.noisePhaseX=Ur(t.seed,d,1757159915)*Math.PI*2,h.noisePhaseY=Ur(t.seed,d,48610963)*Math.PI*2,h.gravityStrength=t.useGravity&&t.gravityMode==="random"?Ms(t.gravityMin,t.gravityMax,this.rng()):t.gravityMin,h.windStrength=t.wind&&t.windMode==="random"?Ms(t.windMin,t.windMax,this.rng()):t.windMin,h.attractionActive=!1,h.attractionElapsed=0,h.collisionPaused=!1,h.attractionCurveSide=Ur(t.seed,d,2738958700)<.5?-1:1,h.trail.history.length=0,h.trail.bones.length=0,h.trail.currentWidth=0,h.trail.currentAlpha=0,h.trail.currentColor=16777215,h.trail.resourceId=f.id;const p=Math.min(100,Math.max(0,Number(f.trailRatio)||0)),m=t.mode==="burst"?Math.max(0,Math.round(t.burstCount)):Math.max(0,Math.floor(t.rate*(t.streamBehavior==="loop"?Math.max(1,t.loopDurationFrames)/30:Math.max(0,t.duration)))),g=p>0&&m===1&&d===0,v=Ur(t.seed,d,668265261)*100,y=(M,C,w,b,_)=>{if(M!=="random")return Math.max(0,Number(C)||0);const E=Math.max(0,Math.min(Number(w)||0,Number(b)||0)),F=Math.max(0,Math.max(Number(w)||0,Number(b)||0));return Ms(E,F,Ur(t.seed,d,_))};h.trail.sampledLength=y(f.lengthMode,f.length,f.lengthMin,f.lengthMax,374761393),h.trail.sampledWidth=y(f.widthSizeMode,f.width,f.widthMin,f.widthMax,3550635116),h.trail.enabled=t.trail&&(g||v0&&h.trail.sampledWidth>0,h.trail.mesh&&(h.trail.mesh.visible=!1),h.active=!0,h.life=a,h.maxLife=a,h.x=r,h.y=o,h.trail.enabled&&h.trail.history.push({x:r,y:o}),h.vx=Math.cos(c)*l,h.vy=Math.sin(c)*l,h.scaleStartX=Eo(t.scaleMode,t.scaleMin,t.scaleMax,t.scaleCurve,this.rng())*u.scale,h.scaleStartY=t.scaleAxisMode==="separate"?Eo(t.scaleMode,t.scaleYMin,t.scaleYMax,t.scaleYCurve,this.rng())*u.scale:h.scaleStartX,h.alphaStart=t.alpha,h.alphaEnd=t.alphaEnd,h.rotation=t.initialRotationMode==="direction"?-Math.atan2(h.vy,h.vx)*180/Math.PI+t.initialRotationMin:Eo(t.initialRotationMode,t.initialRotationMin,t.initialRotationMax,t.initialRotationCurve,this.rng()),h.rotationSpeed=t.rotationOverLifeEnabled?Eo(t.rotationOverLifeMode,t.rotationSpeedMin,t.rotationSpeedMax,t.rotationOverLifeCurve,this.rng()):0,h.speedScale=1,h.speedScaleTarget=t.speedOverLifeMode==="random"?Ms(t.speedOverLifeMin,t.speedOverLifeMax,this.rng()):t.speedOverLifeMin,h.scaleOverLifeX=t.scaleOverLifeMode==="random"?Ms(t.scaleOverLifeMin,t.scaleOverLifeMax,this.rng()):t.scaleOverLifeMin,h.scaleOverLifeY=t.scaleOverLifeMode==="random"?Ms(t.scaleYOverLifeMin,t.scaleYOverLifeMax,this.rng()):t.scaleYOverLifeMin,h.resourceId=u.id,h.colorSample=u.colorMode==="random"?mm(u.colorGradient,Ur(t.seed,d,2654435769)):ta(u.colorStart);const x=Bv(u,0);h.imageFrameIndex=x.index,h.sprite.texture=rf(u,t.texture,x.index),h.sprite.anchor.set(u.anchorX,u.anchorY),h.sprite.blendMode=mr[u.blend],h.sprite.tint=h.colorSample,h.sprite.visible=!0}kill(t){const s=this.pool[t];s.active=!1,s.sprite.visible=!1,Lc(s.trail)}clear(){for(const t of this.pool)t.active=!1,t.sprite.visible=!1,Lc(t.trail)}get activeCount(){let t=0;for(const s of this.pool)s.active&&t++;return t}capture(){const t=[];for(const s of this.pool)s.active&&t.push({boneName:s.boneName,spawnId:s.spawnId,x:s.sprite.x,y:s.sprite.y,rotation:s.rotation,scaleX:s.sprite.scale.x,scaleY:s.sprite.scale.y,...this.captureWorldTransform(s),alpha:s.sprite.alpha,colorHex:s.sprite.tint,resourceId:s.resourceId,imageFrameIndex:s.imageFrameIndex,imageVisible:s.sprite.visible,active:!0,trailState:this.cfg.trail&&s.trail.bones.length?{bones:s.trail.bones.map(n=>{var o;const r=Dr(this.cfg,n.x,n.y,this.simulationTransform);return{...n,worldX:r.x,worldY:r.y,worldRotation:(((o=this.simulationTransform)==null?void 0:o.rotation)??this.cfg.rootRotation)-n.rotation}}),activeBoneCount:s.trail.bones.length,width:s.trail.currentWidth,alpha:s.trail.currentAlpha,colorHex:s.trail.currentColor,resourceId:s.trail.resourceId}:void 0});return t}captureWorldTransform(t){var r,o,a;const s=Dr(this.cfg,t.sprite.x,t.sprite.y,this.simulationTransform),n=((r=this.simulationTransform)==null?void 0:r.rotation)??this.cfg.rootRotation;return{worldX:s.x,worldY:s.y,worldRotation:n+t.rotation,worldScaleX:t.sprite.scale.x*Math.abs(((o=this.simulationTransform)==null?void 0:o.scaleX)??this.cfg.rootScaleX),worldScaleY:t.sprite.scale.y*Math.abs(((a=this.simulationTransform)==null?void 0:a.scaleY)??this.cfg.rootScaleY)}}apply(t){const s=new Map;for(const n of t)s.set(n.boneName,n);for(const n of this.pool){const r=s.get(n.boneName);if(!r){n.active=!1,n.sprite.visible=!1,n.trail.mesh&&(n.trail.mesh.visible=!1);continue}n.active=r.active;const o=n.sprite;if(o.visible=r.active&&r.imageVisible!==!1,o.x=r.x,o.y=r.y,o.rotation=-r.rotation*Math.PI/180,o.scale.set(r.scaleX,r.scaleY),o.alpha=r.alpha,o.tint=r.colorHex,r.resourceId!=null){const a=this.cfg.imageResources.find(l=>l.id===r.resourceId);a&&(n.imageFrameIndex=r.imageFrameIndex??0,o.texture=rf(a,this.cfg.texture,n.imageFrameIndex),o.anchor.set(a.anchorX,a.anchorY),o.blendMode=mr[a.blend])}this.cfg.trail&&r.trailState?this.trail.applyState(n.trail,this.cfg,n.sprite,r.trailState):n.trail.mesh&&(n.trail.mesh.visible=!1)}}reset(){for(const t of this.pool)t.active=!1,t.sprite.visible=!1,Lc(t.trail);this.accumulator=0,this.burstTimer=0,this._spawnSerial=0,this._elapsed=0,this._attractionEnabledAt=0,this._attractionWasEnabled=!1,this._lastSeed=this.cfg.seed,this.rng=nf(this.cfg.seed>>>0)}restartEmissionCycle(){this.accumulator=0,this.burstTimer=0,this._spawnSerial=0,this._elapsed=0,this._attractionEnabledAt=0,this._attractionWasEnabled=this.cfg.attraction,this._lastSeed=this.cfg.seed,this.rng=nf(this.cfg.seed>>>0)}}const uo=new Map,oo=new Map;function yR(i){return[...uo.values()].some(e=>e===i)}function S1(i){if(!(yR(i)||(oo.get(i)||0)>0)){oo.delete(i);for(const e of i.textures)e.destroy(!0)}}function xR(i){const e=oo.get(i)||0;e>1?oo.set(i,e-1):oo.delete(i),S1(i)}function bR(i){return uo.get(i)||null}function fu(i,e){Pl(i),uo.set(i,e)}function wR(i){const e=uo.get(i);return e?(oo.set(e,(oo.get(e)||0)+1),e):null}function SR(i,e){const t=uo.get(i);return t?(fu(e,t),!0):!1}function Pl(i){const e=uo.get(i);e&&(uo.delete(i),S1(e))}function $t(i){if(Array.isArray(i))return i.map(e=>$t(e));if(i&&typeof i=="object"){const e=Object.getPrototypeOf(i);if(e===Object.prototype||e===null){const t={};for(const[s,n]of Object.entries(i))t[s]=$t(n);return t}}return i}const M1=["3.8","4.0","4.1","4.2","4.3"];function gh(i){const e=String(i||"").trim();return M1.find(t=>e===t||e.startsWith(`${t}.`))||null}function pm(){return M1.join(" / ")}function MR(i){return i==="4.3"?"4.3":"4.2"}function wp(){return{imagesPath:"./images/",spineVersion:"4.2",keyframeCurve:"bezier",fps:30,omitFps:!1,integerFrameAlignment:!0,bonePool:!0,excludeEmptyAnimations:!1,fileName:"SpineParticle.json"}}function T1(i){const e=Object.assign(wp(),i||{});return e.imagesPath=String(e.imagesPath||"./images/"),e.spineVersion=gh(e.spineVersion)||"4.2",e.keyframeCurve=e.keyframeCurve==="bezier"?"bezier":"linear",e.fps=Math.min(240,Math.max(1,Math.round(Number(e.fps)||30))),e.omitFps=e.omitFps===!0,e.integerFrameAlignment=e.integerFrameAlignment!==!1,e.bonePool=e.bonePool!==!1,e.excludeEmptyAnimations=e.excludeEmptyAnimations===!0,e.fileName=String(e.fileName||"SpineParticle.json"),e}const gm=30;function Bc(i,e=1){return Math.min(1800,Math.max(1,Math.ceil(Number(i)||e)))}function _1(i,e=30){const t=Math.max(0,Number(i.lifeMin)||0),s=Math.max(0,Number(i.lifeMax)||0),n=i.lifeMode==="fixed"?t:Math.max(t,s);return Bc(Math.ceil(n*Math.max(1,e)),gm)}function pr(i,e=30){const t=Bc(i.loopDurationFrames),s=_1(i,e),n=i.generateLoopStartAnimation?i.loopStartUseCustomDuration?Bc(i.loopStartDurationFrames,gm):s:0,r=i.generateLoopEndAnimation?i.loopEndUseCustomDuration?Bc(i.loopEndDurationFrames,gm):s:0;return{start:n,loop:t,end:r,total:n+t+r}}function Sp(i,e){const t=pr(i,e),n=Math.max(0,Math.ceil(Math.max(0,Number(i.delay)||0)*Math.max(1,e)))+t.start;return{start:n,end:n+t.loop}}const TR=.001;function _R(i,e){const t=Math.max(1,Number(e)||30),n=Math.max(0,Number(i)||0)*t+TR*t;return Math.max(0,Math.floor(n))}function Nc(i,e,t){const s=Math.max(1,Math.floor(t)-1),n=Math.min(s-1,Math.max(0,Math.floor(Number(i)||0))),r=Math.min(s,Math.max(n+1,Math.floor(Number(e)||s)));return{start:n,end:r}}function CR(i,e,t){const s=Math.max(1,e-1),n=Math.max(1,t-1),r=i.end>=s?n:i.end;return Nc(i.start,r,t)}let dc=1,fc=1,mc=1,pc=1;function gc(i,e){const t=new Set(e),s=`${i} Copy`;if(!t.has(s))return s;let n=2;for(;t.has(`${s} ${n}`);)n++;return`${s} ${n}`}const yo=$_("particle",{state:()=>({editor:{viewScale:1,viewX:0,viewY:0},systems:[],colliders:[],paths:[],spines:[],activeId:0,activeObjectType:"particle",activeObjectId:0,timeline:{playing:!0,loop:!0,frame:0,totalFrames:60,playbackStart:0,playbackEnd:59,fps:30,recorded:!1,animation:"animation",animations:["animation"]},settings:{parameterPanelOnRight:!0,tickEnabled:!1,axisFontSize:12,tickWidth:1,showAxisLabels:!0,axisColor:"#7a86ad",undoLimit:20,backgroundX:0,backgroundY:0,backgroundOpacity:1,backgroundImageName:"",backgroundImageData:"",showEmitter:!0,showBones:!1,bonePointDrawSize:1,boneAxisDrawSize:2,showSkinMesh:!1,showGrid:!0,exportSettings:wp()}}),getters:{activeSystemCount:i=>i.systems.length},actions:{syncSceneSequences(){dc=Math.max(dc,...this.systems.map(i=>i.id+1),1),fc=Math.max(fc,...this.colliders.map(i=>i.id+1),1),mc=Math.max(mc,...this.paths.map(i=>i.id+1),1),pc=Math.max(pc,...this.spines.map(i=>i.id+1),1)},addSystem(i){const e=bl();i!=null&&i.config&&Object.assign(e,i.config);const t=new Set(this.systems.map(r=>r.config.name));if(t.has(e.name)){let r=0;for(const a of this.systems){const l=/^ParticleSystem(\d+)$/.exec(a.config.name);l&&(r=Math.max(r,parseInt(l[1],10)))}e.name=`ParticleSystem${r+1}`;let o=2;for(;t.has(e.name);)e.name=`ParticleSystem${r+o}`,o++}const s=this.timeline.animations.includes(this.timeline.animation)?this.timeline.animation:this.timeline.animations[0]||"animation",n={id:dc++,visible:!0,animation:s,config:e};return this.systems.push(n),this.activeId=n.id,this.activeObjectType="particle",this.activeObjectId=n.id,n},removeSystem(i){var s;const e=this.systems.findIndex(n=>n.id===i);e>=0&&this.systems.splice(e,1),this.activeId===i&&(this.activeId=((s=this.systems[0])==null?void 0:s.id)??0);const t=this.systems.find(n=>n.id===this.activeId);if(t&&(this.timeline.animation=t.animation),this.activeObjectType==="particle"&&this.activeObjectId===i){const n=this.systems[0];this.activeObjectId=(n==null?void 0:n.id)??0}},selectSystem(i){this.activeId=i,this.activeObjectType="particle",this.activeObjectId=i;const e=this.systems.find(t=>t.id===i);e&&(this.timeline.animation=e.animation)},setSystemAnimation(i,e){if(!this.timeline.animations.includes(e))return;const t=this.systems.find(s=>s.id===i);t&&(t.animation=e,this.timeline.animation=e)},addAnimation(){const i=new Set(this.timeline.animations);let e=2,t=`animation${e}`;for(;i.has(t);)t=`animation${++e}`;this.timeline.animations.push(t),this.timeline.animation=t;const s=this.systems.find(n=>n.id===this.activeId);return s&&(s.animation=t),t},renameAnimation(i,e){const t=e.trim(),s=this.timeline.animations.indexOf(i);if(s<0||!t||t!==i&&this.timeline.animations.includes(t))return!1;this.timeline.animations[s]=t;for(const n of this.systems)n.animation===i&&(n.animation=t);return this.timeline.animation===i&&(this.timeline.animation=t),!0},removeAnimation(i){if(this.timeline.animations.length<=1)return!1;const e=this.timeline.animations.indexOf(i);if(e<0)return!1;this.timeline.animations.splice(e,1);const t=this.timeline.animations[Math.min(e,this.timeline.animations.length-1)];for(const s of this.systems)s.animation===i&&(s.animation=t);return this.timeline.animation===i&&(this.timeline.animation=t),!0},addCollider(){const i=fc++,e={id:i,name:`Collider${i}`,visible:!0,shape:"circle",enabled:!0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,radius:50,radiusX:70,radiusY:45,width:120,height:80,sides:6,response:"physics",elasticity:.8,friction:.3,followPath:!1,followPathId:0,followDuration:2,followPathRotation:!1,followCurveMode:"跟随导出",followCurve:[{x:0,y:0},{x:1,y:1}]};return this.colliders.push(e),this.activeObjectType="collision",this.activeObjectId=e.id,e},addPath(){const i=mc++,e={id:i,name:`Path${i}`,visible:!0,enabled:!0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,closed:!1,color:"#ff933e",preset:"",points:[]};return this.paths.push(e),this.activeObjectType="path",this.activeObjectId=e.id,e},addSpine(){const i=pc++,e={id:i,name:`SpineSkeleton${i}`,enabled:!0,visible:!0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,timeOffset:0,skeletonFileName:"",atlasFileName:"",textureFileNames:[],dataVersion:"",sourceBundle:null,selectedAnimation:"",selectedBone:"",selectedSlot:"",animations:[],bones:[],slots:[],assetVersion:0,status:"empty",error:""};return this.spines.push(e),this.activeObjectType="spine",this.activeObjectId=e.id,e},duplicateSelectedObject(){const i=this.activeObjectId;if(!i)return null;if(this.activeObjectType==="particle"){const s=this.systems.find(r=>r.id===i);if(!s)return null;const n=$t(s);return n.id=dc++,n.config.name=gc(s.config.name,this.systems.map(r=>r.config.name)),n.frames=void 0,this.systems.push(n),this.activeId=n.id,this.activeObjectId=n.id,this.timeline.animation=n.animation,n}if(this.activeObjectType==="collision"){const s=this.colliders.find(r=>r.id===i);if(!s)return null;const n=$t(s);return n.id=fc++,n.name=gc(s.name,this.colliders.map(r=>r.name)),this.colliders.push(n),this.activeObjectId=n.id,n}if(this.activeObjectType==="path"){const s=this.paths.find(r=>r.id===i);if(!s)return null;const n=$t(s);return n.id=mc++,n.name=gc(s.name,this.paths.map(r=>r.name)),this.paths.push(n),this.activeObjectId=n.id,n}const e=this.spines.find(s=>s.id===i);if(!e)return null;const t=$t(e);return t.id=pc++,t.name=gc(e.name,this.spines.map(s=>s.name)),t.selectedBone="",t.selectedSlot="",SR(e.id,t.id),this.spines.push(t),this.activeObjectId=t.id,t},selectSceneObject(i,e){if(this.activeObjectType=i,this.activeObjectId=e,i==="particle"){this.activeId=e;const t=this.systems.find(s=>s.id===e);t&&(this.timeline.animation=t.animation)}},removeCollider(i){var t;const e=this.colliders.findIndex(s=>s.id===i);e>=0&&this.colliders.splice(e,1);for(const s of this.systems){const n=Dn(s.config);n.collisionColliderIds=n.collisionColliderIds.filter(r=>r!==i)}if(this.activeObjectType==="collision"&&this.activeObjectId===i){const s=this.systems[0];this.activeObjectType=s?"particle":"collision",this.activeObjectId=(s==null?void 0:s.id)??((t=this.colliders[0])==null?void 0:t.id)??0}},removePath(i){var t;const e=this.paths.findIndex(s=>s.id===i);if(e>=0&&this.paths.splice(e,1),this.activeObjectType==="path"&&this.activeObjectId===i){const s=this.systems[0];this.activeObjectType=s?"particle":"path",this.activeObjectId=(s==null?void 0:s.id)??((t=this.paths[0])==null?void 0:t.id)??0}},removeSpine(i){Pl(i);const e=this.spines.findIndex(t=>t.id===i);if(e>=0&&this.spines.splice(e,1),this.activeObjectType==="spine"&&this.activeObjectId===i){const t=this.systems[0],s=this.colliders[0],n=this.paths[0],r=this.spines[0];t?(this.activeObjectType="particle",this.activeObjectId=t.id,this.activeId=t.id):s?(this.activeObjectType="collision",this.activeObjectId=s.id):n?(this.activeObjectType="path",this.activeObjectId=n.id):(this.activeObjectType="spine",this.activeObjectId=(r==null?void 0:r.id)??0)}this.recalcTotalFrames()},play(){const i=Nc(this.timeline.playbackStart,this.timeline.playbackEnd,this.timeline.totalFrames);(this.timeline.frame=i.end)&&(this.timeline.frame=i.start),this.timeline.playing=!0},pause(){this.timeline.playing=!1},togglePlay(){this.timeline.playing?this.pause():this.play()},toStart(){this.timeline.frame=this.timeline.playbackStart},previousFrame(){this.timeline.playing=!1,this.timeline.frame=Math.max(this.timeline.playbackStart,this.timeline.frame-1)},nextFrame(){this.timeline.playing=!1,this.timeline.frame=Math.min(this.timeline.playbackEnd,this.timeline.frame+1)},toEnd(){this.timeline.playing=!1,this.timeline.frame=this.timeline.playbackEnd},toggleLoop(){this.timeline.loop=!this.timeline.loop},setFrame(i){this.timeline.frame=Math.max(0,Math.min(i,this.timeline.totalFrames-1))},setPlaybackStart(i){const e=Nc(i,this.timeline.playbackEnd,this.timeline.totalFrames);this.timeline.playbackStart=e.start,this.timeline.playbackEnd=e.end,this.timeline.framee.end&&(this.timeline.frame=e.end)},recalcTotalFrames(){const i=this.timeline.fps||30;let e=0;for(const r of this.systems){const o=r.config,a=Math.max(0,Number(o.lifeMin)||0),l=Math.max(0,Number(o.lifeMax)||0),c=o.lifeMode==="fixed"?a:Math.max(a,l),h=o.mode==="stream"?o.streamBehavior==="loop"?Math.max(1/i,Math.ceil(Math.max(1,Number(o.loopDurationFrames)||1))/i):Math.max(1/i,Number(o.duration)||0):0;let u=Math.max(0,Number(o.delay)||0)+h+c;o.mode==="stream"&&o.streamBehavior==="loop"&&(u=Math.max(0,Number(o.delay)||0)+pr(o,i).total/i),u>e&&(e=u)}for(const r of this.spines){const o=r.animations.find(l=>l.name===r.selectedAnimation);if(!o)continue;const a=Math.max(0,Number(r.timeOffset)||0)+Math.max(0,o.duration||0);a>e&&(e=a)}for(const r of this.colliders){if(!r.followPath||!r.followPathId)continue;const o=Math.max(0,Number(r.followDuration)||0);o>e&&(e=o)}const t=this.timeline.totalFrames,s=Math.max(2,_R(e,i)+1);this.timeline.totalFrames=s;const n=CR({start:this.timeline.playbackStart,end:this.timeline.playbackEnd},t,s);return this.timeline.playbackStart=n.start,this.timeline.playbackEnd=n.end,this.timeline.frame>=s&&(this.timeline.frame=s-1),s}}}),C1="SpineParticle.SystemSettings",A1=1,of="SpineParticle.SystemSettings.v1";function Oa(i,e,t,s){const n=Number(i);return Math.min(t,Math.max(e,Number.isFinite(n)?n:s))}function AR(i){return{parameterPanelOnRight:i.parameterPanelOnRight,undoLimit:i.undoLimit,showEmitter:i.showEmitter,showBones:i.showBones,bonePointDrawSize:i.bonePointDrawSize,boneAxisDrawSize:i.boneAxisDrawSize,showSkinMesh:i.showSkinMesh,tickEnabled:i.tickEnabled,axisFontSize:i.axisFontSize,tickWidth:i.tickWidth,showAxisLabels:i.showAxisLabels,axisColor:i.axisColor}}function ER(i,e){const t=n=>i[n]==null?!!e[n]:i[n]===!0,s=typeof i.axisColor=="string"&&/^#[0-9a-f]{6}$/i.test(i.axisColor)?i.axisColor:e.axisColor;return{parameterPanelOnRight:t("parameterPanelOnRight"),undoLimit:Math.round(Oa(i.undoLimit,1,200,e.undoLimit)),showEmitter:t("showEmitter"),showBones:t("showBones"),bonePointDrawSize:Oa(i.bonePointDrawSize,.1,10,e.bonePointDrawSize),boneAxisDrawSize:Oa(i.boneAxisDrawSize,.1,10,e.boneAxisDrawSize),showSkinMesh:t("showSkinMesh"),tickEnabled:t("tickEnabled"),axisFontSize:Math.round(Oa(i.axisFontSize,8,40,e.axisFontSize)),tickWidth:Oa(i.tickWidth,1,5,e.tickWidth),showAxisLabels:t("showAxisLabels"),axisColor:s}}function IR(i){let e;try{e=JSON.parse(i)}catch{throw new Error("系统设置缓存不是有效的 JSON")}const t=e;if(t.format!==C1)throw new Error("不是 Spine粒子编辑器系统设置缓存");if(t.version!==A1)throw new Error(`暂不支持系统配置版本:${t.version??"未知"}`);if(!t.settings||typeof t.settings!="object")throw new Error("系统设置缓存缺少 settings");return t}function RR(i,e){Object.assign(i.settings,ER(e,i.settings))}let vc=null;function PR(i){vc==null||vc();try{const e=localStorage.getItem(of);e&&RR(i,IR(e).settings)}catch{try{localStorage.removeItem(of)}catch{}}vc=cs(()=>AR(i.settings),e=>{const t={format:C1,version:A1,savedAt:new Date().toISOString(),settings:e};try{localStorage.setItem(of,JSON.stringify(t))}catch{}},{deep:!0})}function kR(i,e=0){if(i<=0)return 1;const t=Math.pow(10,Math.floor(Math.log10(i))),s=[1,2,5,10,20,50,100];let n=1;for(const r of s)if(r*t>=i){n=r*t;break}return Math.max(n,e)}function FR(i,e,t,s,n){if(!t)return;const r=t;r.clear();const o=i.settings;if(!o.tickEnabled){for(const b of n)b.visible=!1;return}const a=0,l=0,c=e.screen.width/i.editor.viewScale,h=e.screen.height/i.editor.viewScale,u=+("0x"+o.axisColor.replace("#",""));r.lineStyle(1.5,u,.35),r.moveTo(-c,l),r.lineTo(c,l),r.moveTo(a,-h),r.lineTo(a,h);const d=i.editor.viewScale,f=kR(50/d),p=c,m=h,g=Math.max(1,o.tickWidth);if(o.tickEnabled){for(let b=0;b<=c;b+=f){const _=Math.round(b/f)*f;_!==0&&(r.lineStyle(g,u,.25),r.moveTo(_,l-4),r.lineTo(_,l+4),r.moveTo(-_,l-4),r.lineTo(-_,l+4))}for(let b=0;b<=h;b+=f)Math.round(b/f)*f!==0&&(r.lineStyle(g,u,.25),r.moveTo(a-4,b),r.lineTo(a+4,b),r.moveTo(a-4,-b),r.lineTo(a+4,-b))}const v=e.screen.width/2+i.editor.viewX,y=e.screen.height*.5+i.editor.viewY,x=o.axisFontSize,M=+("0x"+o.axisColor.replace("#",""));for(;n.length<64;){const b=new bp("",{fontFamily:"monospace",fontSize:x,fill:M});b.anchor.set(.5,.5),s.addChild(b),n.push(b)}let C=0;const w=o.showAxisLabels&&o.tickEnabled;for(let b=0;b<=c;b+=f){const _=Math.round(b/f)*f;if(_===0||!w||_>p)continue;const E=n[C++];if(!E)break;E.style.fontSize=x,E.text=String(_),E.position.set(v+_*d,y+9),E.visible=!0;const F=n[C++];if(!F)break;F.style.fontSize=x,F.text=String(-_),F.position.set(v-_*d,y+9),F.visible=!0}for(let b=0;b<=h;b+=f){const _=Math.round(b/f)*f;if(_===0||!w||_>m)continue;const E=n[C++];if(!E)break;E.style.fontSize=x,E.text=String(_),E.position.set(v+8,y-b*d),E.visible=!0;const F=n[C++];if(!F)break;F.style.fontSize=x,F.text=String(-_),F.position.set(v+8,y+b*d),F.visible=!0}for(;Cy.id===i.activeId);if(!n||n.visible===!1)return;const r=n.config;if(!r.showShape)return;const o=e.get(n.id),a=(o==null?void 0:o.x)??r.centerX??0,l=-((o==null?void 0:o.y)??r.centerY??0),c=r.shape;if(c==="point"||c==="path")return;const h=r.rootScaleX??1,u=r.rootScaleY??1,d=-((o==null?void 0:o.rotation)??r.rootRotation??0)*Math.PI/180,f=Math.cos(d),p=Math.sin(d),m=r.offsetX??0,g=r.offsetY??0,v=(y,x)=>{const M=y+m,C=-x-g,w=M*h,b=C*u;return[a+w*f-b*p,l+(w*p+b*f)]};if(c==="circle"){const y=ph(r.innerRadius,r.outerRadius);s.lineStyle(2,3991658,.7);const x=48;for(const M of[y.outer,y.inner])if(!(M<=0))for(let C=0;C<=x;C++){const w=C/x*Math.PI*2,[b,_]=v(Math.cos(w)*M,Math.sin(w)*M);C===0?s.moveTo(b,_):s.lineTo(b,_)}}else if(c==="rect"){const y=b1(r);s.lineStyle(2,4885759,.7);for(const[x,M]of[[y.outerW,y.outerH],[y.innerW,y.innerH]]){if(x<=0||M<=0)continue;const C=x/2,w=M/2,b=v(-C,-w),_=v(C,-w),E=v(C,w),F=v(-C,w);s.moveTo(b[0],b[1]),s.lineTo(_[0],_[1]),s.lineTo(E[0],E[1]),s.lineTo(F[0],F[1]),s.lineTo(b[0],b[1])}}else if(c==="cone"){const y=ph(r.innerRadius,r.outerRadius),x=r.coneAngle/2*Math.PI/180,M=r.coneDirection*Math.PI/180,C=v(Math.cos(M-x)*y.inner,Math.sin(M-x)*y.inner),w=v(Math.cos(M+x)*y.inner,Math.sin(M+x)*y.inner),b=v(Math.cos(M-x)*y.outer,Math.sin(M-x)*y.outer),_=v(Math.cos(M+x)*y.outer,Math.sin(M+x)*y.outer);s.lineStyle(2,3991658,.7),s.moveTo(C[0],C[1]),s.lineTo(b[0],b[1]),s.moveTo(w[0],w[1]),s.lineTo(_[0],_[1]),s.lineStyle(1,3991658,.5);const E=24;for(const F of[y.outer,y.inner])if(!(F<=0))for(let I=0;I<=E;I++){const k=M-x+2*x*I/E,[B,D]=v(Math.cos(k)*F,Math.sin(k)*F);I===0?s.moveTo(B,D):s.lineTo(B,D)}}}function BR(i,e){if(!e)return;const t=e;t.clear();const s=i.systems.find(l=>l.id===i.activeId);if((s==null?void 0:s.visible)===!1)return;const n=s==null?void 0:s.config;if(!(n!=null&&n.forceField)||!n.showForceFieldShape||n.forceRadius<=0)return;const r=n.forceCenterX,o=-n.forceCenterY,a=n.forceStrength>=0?5818367:16739194;t.lineStyle(2,a,.85),t.beginFill(a,.08),t.drawCircle(r,o,n.forceRadius),t.endFill(),t.lineStyle(1,a,.7),t.moveTo(r-9,o),t.lineTo(r+9,o),t.moveTo(r,o-9),t.lineTo(r,o+9),t.beginFill(a,.95),t.drawCircle(r,o,4),t.endFill()}function NR(i,e){if(!e)return;const t=e;t.clear();const s=i.systems.find(u=>u.id===i.activeId);if((s==null?void 0:s.visible)===!1)return;const n=s==null?void 0:s.config;if(!(n!=null&&n.vortex)||!n.showVortexShape||n.vortexRadius<=0)return;const r=n.vortexCenterX,o=-n.vortexCenterY,a=n.vortexStrength>=0?12156159:16753228;t.lineStyle(2,a,.9),t.beginFill(a,.07),t.drawCircle(r,o,n.vortexRadius),t.endFill(),t.beginFill(a,.95),t.drawCircle(r,o,4),t.endFill();const l=r+Math.min(n.vortexRadius*.65,50),c=n.vortexStrength>=0?-1:1,h=o+c*14;t.lineStyle(2,a,.9),t.moveTo(l,o+c*-8),t.lineTo(l,h),t.moveTo(l,h),t.lineTo(l-4,h-c*5),t.moveTo(l,h),t.lineTo(l+4,h-c*5)}function DR(i,e){if(!e)return;const t=e;t.clear();const s=i.systems.find(c=>c.id===i.activeId);if((s==null?void 0:s.visible)===!1)return;const n=s==null?void 0:s.config;if(!(n!=null&&n.attraction)||!n.showAttractionShape)return;const r=n.attractionCenterX,o=-n.attractionCenterY,a=Math.max(0,n.attractionRadius),l=16731487;a>0&&(t.lineStyle(2,l,.95),t.beginFill(l,.09),t.drawCircle(r,o,a),t.endFill()),t.lineStyle(1,l,.85),t.moveTo(r-10,o),t.lineTo(r+10,o),t.moveTo(r,o-10),t.lineTo(r,o+10),t.beginFill(l,1),t.drawCircle(r,o,a>0?4:6),t.endFill()}function UR(i,e,t){const s=i.rotation*Math.PI/180,n=Math.cos(s),r=Math.sin(s),o=Math.max(1e-4,Math.abs(i.scaleX??1)),a=Math.max(1e-4,Math.abs(i.scaleY??1));return{x:i.x+n*e*o-r*t*a,y:i.y+r*e*o+n*t*a}}function Io(i,e,t){const s=i.rotation*Math.PI/180,n=Math.cos(s),r=Math.sin(s),o=Math.max(1e-4,Math.abs(i.scaleX??1)),a=Math.max(1e-4,Math.abs(i.scaleY??1)),l=e-i.x,c=t-i.y;return{x:(n*l+r*c)/o,y:(-r*l+n*c)/a}}function E1(i,e,t="linear"){if(!i.length)return e;const s=[...i].sort((n,r)=>n.x-r.x);if(e<=s[0].x)return s[0].y;for(let n=1;nc.id===a.emitterFollowSpineId);!l||l.visible===!1||n.set(`${a.emitterFollowSpineId}:${a.emitterFollowBoneName}`,{spineId:a.emitterFollowSpineId,boneName:a.emitterFollowBoneName})}for(const o of n.values()){const a=e==null?void 0:e.getBoneWorldTransform(o.spineId,o.boneName);if(!a)continue;const l=a.x,c=-a.y;s.lineStyle(2,12881151,.95),s.beginFill(12881151,.2),s.drawCircle(l,c,8),s.endFill(),s.beginFill(15919103,1),s.drawCircle(l,c,3.5),s.endFill()}}function XR(i,e,t){if(!t)return;const s=t;if(s.clear(),!i.value)return;const n=e();if(!n)return;const r=n.x,o=-n.y,a=n.scaleX,l=n.scaleY,c=-n.rotation*Math.PI/180,h=Math.cos(c),u=Math.sin(c),d=(m,g)=>{const v=m*a,y=-g*l;return[r+v*h-y*u,o+(v*u+y*h)]},f=(m,g,v,y)=>{const x=d(m,g),M=d(v,y);s.moveTo(x[0],x[1]),s.lineTo(M[0],M[1])},p=26;if(s.lineStyle(2,3526911,.9),s.beginFill(3526911,.25),s.drawCircle(r,o,6),s.endFill(),i.value==="translate")s.lineStyle(2,3526911,.9),f(-p,0,p,0),f(0,-p,0,p),f(p-6,-4,p,0),f(p,0,p-6,4),f(-20,-4,-p,0),f(-p,0,-20,4),f(-4,p-6,0,p),f(0,p,4,p-6),f(-4,-20,0,-p),f(0,-p,4,-20);else if(i.value==="rotate"){s.lineStyle(2,3526911,.8);const m=48;for(let y=0;y<=m;y++){const x=y/m*Math.PI*2,[M,C]=d(Math.cos(x)*p,Math.sin(x)*p);y===0?s.moveTo(M,C):s.lineTo(M,C)}const[g,v]=d(0,p);s.beginFill(3526911,.95),s.drawCircle(g,v,4),s.endFill()}else if(i.value==="scale"){s.lineStyle(2,3526911,.9);const g=[[-p,-p],[p,-p],[p,p],[-p,p]].map(([v,y])=>d(v,y));s.moveTo(g[0][0],g[0][1]),s.lineTo(g[1][0],g[1][1]),s.lineTo(g[2][0],g[2][1]),s.lineTo(g[3][0],g[3][1]),s.lineTo(g[0][0],g[0][1]),s.beginFill(3526911,.9);for(const v of g)s.drawRect(v[0]-3,v[1]-3,6,6);s.endFill()}}function VR(i,e=16777215){const t=Number.parseInt(i.replace("#",""),16);return Number.isFinite(t)?t:e}function YR(i,e,t){if(!t)return;const s=t;s.clear();for(const n of e){if(n.visible===!1)continue;const r=i.activeObjectType==="collision"&&i.activeObjectId===n.id,o=n.enabled?r?16735858:13911899:5792116,a=n.rotation*Math.PI/180,l=Math.cos(a),c=Math.sin(a),h=Math.max(1e-4,Math.abs(n.scaleX??1)),u=Math.max(1e-4,Math.abs(n.scaleY??1)),d=(m,g)=>({x:n.x+l*m*h-c*g*u,y:-(n.y+c*m*h+l*g*u)});let f=[];if(n.shape==="circle"||n.shape==="ellipse"){const m=n.shape==="circle"?n.radius:n.radiusX,g=n.shape==="circle"?n.radius:n.radiusY;f=Array.from({length:49},(v,y)=>{const x=y/48*Math.PI*2;return d(Math.cos(x)*m,Math.sin(x)*g)})}else if(n.shape==="rect"){const m=n.width*.5,g=n.height*.5;f=[d(-m,-g),d(m,-g),d(m,g),d(-m,g),d(-m,-g)]}else{const m=Math.max(3,Math.min(16,Math.round(n.sides)));f=Array.from({length:m+1},(g,v)=>{const y=Math.PI*.5+v%m/m*Math.PI*2;return d(Math.cos(y)*n.width*.5,Math.sin(y)*n.height*.5)})}if(!f.length)continue;s.lineStyle(r?2.5:1.5,o,n.enabled?.95:.45),s.beginFill(o,r?.12:.055),s.moveTo(f[0].x,f[0].y);for(let m=1;mo.id===i.activeObjectId):null,r=(n==null?void 0:n.config.shape)==="path"&&!n.config.showShape?n.config.spawnPathId:0;for(const o of i.paths){if(o.id===r||o.visible===!1||!o.enabled||!o.points.length)continue;const a=i.activeObjectType==="path"&&i.activeObjectId===o.id,l=VR(o.color,16749374),c=(f,p)=>{const m=UR(o,f,p);return{x:m.x,y:-m.y}},h=o.points[0],u=c(h.x,h.y);s.lineStyle(a?2.5:1.8,l,a?1:.75),s.moveTo(u.x,u.y);const d=o.closed?o.points.length:o.points.length-1;for(let f=0;f{const m=c(f.x,f.y),g=c(f.x+f.inX,f.y+f.inY),v=c(f.x+f.outX,f.y+f.outY),y=Math.hypot(f.inX,f.inY)>.01,x=Math.hypot(f.outX,f.outY)>.01;s.lineStyle(1,11121867,.65),y&&(s.moveTo(m.x,m.y),s.lineTo(g.x,g.y)),x&&(s.moveTo(m.x,m.y),s.lineTo(v.x,v.y)),y&&(s.beginFill(14015724,.95),s.drawCircle(g.x,g.y,3),s.endFill()),x&&(s.beginFill(14015724,.95),s.drawCircle(v.x,v.y,3),s.endFill()),s.beginFill(e.has(p)?16777215:l,1),s.lineStyle(1.5,e.has(p)?6126847:16777215,.95),s.drawCircle(m.x,m.y,e.has(p)?5:4),s.endFill()})}}function jR(i,e,t,s){var o;const n=Number.isFinite(e.worldX)&&Number.isFinite(e.worldY),r=Number.isFinite(e.worldRotation);i.push({boneName:e.boneName,x:n?e.worldX:e.x,y:n?-e.worldY:e.y,rotation:r?-e.worldRotation:-e.rotation,parentX:t,parentY:s}),(o=e.trailState)!=null&&o.bones.length&&e.trailState.bones.forEach(a=>{const l=Number.isFinite(a.worldX)&&Number.isFinite(a.worldY),c=Number.isFinite(a.worldRotation);i.push({boneName:a.boneName,x:l?a.worldX:a.x,y:l?-a.worldY:a.y,rotation:c?-a.worldRotation:a.rotation,parentX:t,parentY:s,trail:!0})})}function Uv(i,e,t,s,n,r,o,a){const l=r*.62,c=e+s*r,h=t+n*r,u=Math.max(2.5,r*.32),d=Math.max(1.7,r*.22),f=c-s*u,p=h-n*u,m=-n,g=s;i.lineStyle(o,a,.95),i.moveTo(e-s*l,t-n*l),i.lineTo(f,p),i.lineStyle(0),i.beginFill(a,.95),i.drawPolygon([c,h,f+m*d,p+g*d,f-m*d,p-g*d]),i.endFill()}function HR(i,e,t){if(!t)return;const s=t;if(s.clear(),!e.settings.showBones)return;const n=0,r=0,o=Math.max(.25,Math.abs(e.editor.viewScale)||1),a=Math.min(10,Math.max(.1,Number(e.settings.bonePointDrawSize)||1)),l=Math.min(10,Math.max(.1,Number(e.settings.boneAxisDrawSize)||2)),c=2.5*a/o,h=4.5*l/o,u=Math.max(.65,l*.625)/o;for(const d of i){const f=d.trail?16731533:16747610;s.lineStyle(1,f,d.trail?.65:.35),s.moveTo(d.parentX??n,d.parentY??r),s.lineTo(d.x,d.y);const p=d.rotation*Math.PI/180,m=Math.cos(p),g=Math.sin(p);Uv(s,d.x,d.y,m,g,h,u,15684432),Uv(s,d.x,d.y,g,-m,h,u,5622123),s.beginFill(f,.9),s.drawCircle(d.x,d.y,c),s.endFill()}}function Rs(i){return i.map(e=>({...e,trailState:e.trailState?{...e.trailState,bones:e.trailState.bones.map(t=>({...t}))}:void 0}))}function WR(i){const e=new Map;for(const s of i)for(const n of s)e.has(n.boneName)||e.set(n.boneName,Rs([n])[0]);const t=[...e.keys()].sort((s,n)=>{const r=Number(s.replace(/^p_/,"")),o=Number(n.replace(/^p_/,""));return Number.isFinite(r)&&Number.isFinite(o)?r-o:s.localeCompare(n)});for(let s=0;s[r.boneName,r]));i[s]=t.map(r=>{const o=n.get(r);return o||{...Rs([e.get(r)])[0],alpha:0,imageVisible:!1,trailState:void 0,active:!0}})}}function zR(i){i.length<2||(i[i.length-1]=Rs(i[0]))}function qR(i,e){const t=Math.max(0,i.length-1),s=[];for(let n=0;n<=e;n++){const r=Math.min(t,Math.round(n/e*t));s.push(Rs(i[r]||[]))}return s}function af(i){return`${i.boneName}:${i.spawnId??"legacy"}`}function $v(i){return{...Rs([i])[0],alpha:0,imageVisible:!1,trailState:void 0,active:!0}}function KR(i,e,t,s){const n=Math.min(i.length,s+1),r=i.slice(Math.max(0,i.length-n)),o=new Map;for(const c of e){if(c.imageVisible===!1||c.alpha<=0)continue;const h=af(c),u=new Map;let d=!1;for(let f=r.length-1;f>=0;f--){const p=r[f].find(m=>af(m)===h);if(p)d=!0,u.set(f,p);else if(d)break}o.set(h,u)}const a=Math.max(0,r.length-1),l=[];for(let c=0;c<=t;c++){const h=Math.min(a,Math.round(c/t*a));l.push(e.map(u=>{var f;if(u.imageVisible===!1||u.alpha<=0)return Rs([u])[0];const d=(f=o.get(af(u)))==null?void 0:f.get(h);return d?Rs([d])[0]:$v(u)}))}return l[0]=l[0].map($v),l[l.length-1]=Rs(e),l}function Xv(i,e){const t=i.length?1:0;for(let s=t;s{const x=y?[[]]:[];e.reset();for(let M=0;M0&&e.restartEmissionCycle();for(let C=0;C0;M++)e.update(r,"off"),y.push(e.capture());(v=y[y.length-1])!=null&&v.length&&y.push([]),Xv(u,qR(y,a.end))}const g=Rs(u[u.length-1]||[]);for(u.length>s&&(u.length=s);u.length{var a;return String(((a=o==null?void 0:o.data)==null?void 0:a.name)||"")}):null}catch{return null}}getSlotLocalMatrix(e,t){var o,a,l;const s=(o=this.entries.get(e))==null?void 0:o.spine,n=(l=(a=s==null?void 0:s.skeleton)==null?void 0:a.findSlot)==null?void 0:l.call(a,t),r=n==null?void 0:n.bone;return r!=null&&r.active?new Ot(r.a,r.c,-r.b,-r.d,r.worldX,r.worldY):null}getSlotParentMatrix(e,t,s){const n=this.getSlotLocalMatrix(e,t);if(!n)return null;const r=-s.rotation*Math.PI/180,o=Math.cos(r),a=Math.sin(r);return new Ot(o*s.scaleX,a*s.scaleX,-a*s.scaleY,o*s.scaleY,s.x,-s.y).append(n)}attachSlotObject(e,t,s,n){var o;const r=(o=this.entries.get(e))==null?void 0:o.spine;if(!(r!=null&&r.addSlotObject))return!1;try{return r.addSlotObject(t,s,{followAttachmentTimeline:n}),!0}catch{return!1}}detachSlotObject(e,t,s){var r,o;const n=(r=this.entries.get(e))==null?void 0:r.spine;try{(o=n==null?void 0:n.removeSlotObject)==null||o.call(n,t,s)}catch{}}destroyEntry(e){var t,s;try{(s=(t=e.spine)==null?void 0:t.removeSlotObjects)==null||s.call(t)}catch{}this.container.removeChild(e.root),e.root.destroy({children:!0})}sync(e,t,s){var n;for(const[r,o]of this.entries)e.some(a=>a.id===r)||(this.destroyEntry(o),this.entries.delete(r));for(const r of e){const o=bR(r.id);let a=this.entries.get(r.id);if(a&&a.assetVersion!==r.assetVersion&&!o&&(this.destroyEntry(a),this.entries.delete(r.id),a=void 0),(!a||a.assetVersion!==r.assetVersion)&&o){a&&this.destroyEntry(a);const d=new gs,f=new o.SpineClass({skeletonData:o.skeletonData,autoUpdate:!1,darkTint:!1});o.skeletonData.defaultSkin&&f.skeleton.setSkin(o.skeletonData.defaultSkin),o.runtimeVersion==="4.3"?f.skeleton.setupPoseSlots():f.skeleton.setSlotsToSetupPose(),d.addChild(f),this.container.addChild(d),a={root:d,spine:f,runtimeVersion:o.runtimeVersion,assetVersion:r.assetVersion,animation:""},this.entries.set(r.id,a)}if(!a)continue;const l=a.root,c=a.spine,h=r.visible!==!1&&r.enabled;l.visible=h,l.renderable=h,l.position.set(r.x,-r.y),l.rotation=-r.rotation*Math.PI/180,l.scale.set(r.scaleX,r.scaleY),a.animation!==r.selectedAnimation&&(a.animation=r.selectedAnimation,a.runtimeVersion==="4.3"?c.skeleton.setupPose():c.skeleton.setToSetupPose(),c.state.clearTracks(),a.animation&&c.state.setAnimation(0,a.animation,!1));const u=a.runtimeVersion==="4.3"?c.state.getTrack(0):c.state.getCurrent(0);if(u){const d=((n=r.animations.find(p=>p.name===r.selectedAnimation))==null?void 0:n.duration)||0,f=Math.max(0,t/Math.max(1,s)-r.timeOffset);u.trackTime=d>0?Math.min(f,d):f}c.update(0)}}getBoneWorldTransform(e,t){const s=this.entries.get(e),n=s==null?void 0:s.spine.skeleton.findBone(t);if(!s||!n||!n.active)return null;const r=s.runtimeVersion==="4.3"?n.appliedPose:n,o=s.root,a=Math.cos(o.rotation),l=Math.sin(o.rotation),c=a*o.scale.x,h=-l*o.scale.y,u=l*o.scale.x,d=a*o.scale.y,f=c*r.a+h*r.c,p=c*r.b+h*r.d,m=u*r.a+d*r.c,g=u*r.b+d*r.d,v=o.position.x+c*r.worldX+h*r.worldY,y=o.position.y+u*r.worldX+d*r.worldY;return{x:v,y:-y,rotation:-Math.atan2(m,f)*180/Math.PI,scaleX:Math.max(1e-4,Math.hypot(f,m)),scaleY:Math.max(1e-4,Math.hypot(p,g))}}destroy(){for(const e of this.entries.values())this.destroyEntry(e);this.entries.clear(),this.container.removeFromParent(),this.container.destroy({children:!0})}}let I1=class{constructor(){S(this,"entries",{});S(this,"size",0)}add(e){let t=this.entries[e];return this.entries[e]=!0,t?!1:(this.size++,!0)}addAll(e){let t=this.size;for(var s=0,n=e.length;s1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(e,t){e.r=((t&4278190080)>>>24)/255,e.g=((t&16711680)>>>16)/255,e.b=((t&65280)>>>8)/255,e.a=(t&255)/255}static rgb888ToColor(e,t){e.r=((t&16711680)>>>16)/255,e.g=((t&65280)>>>8)/255,e.b=(t&255)/255}toRgb888(){const e=t=>("0"+(t*255).toString(16)).slice(-2);return+("0x"+e(this.r)+e(this.g)+e(this.b))}static fromString(e,t=new Is){return t.setFromString(e)}},S(Is,"WHITE",new Is(1,1,1,1)),S(Is,"RED",new Is(1,0,0,1)),S(Is,"GREEN",new Is(0,1,0,1)),S(Is,"BLUE",new Is(0,0,1,1)),S(Is,"MAGENTA",new Is(1,0,1,1)),Is);var es;let Ie=(es=class{static clamp(e,t,s){return es?s:e}static cosDeg(e){return Math.cos(e*es.degRad)}static sinDeg(e){return Math.sin(e*es.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*es.degRad}static signum(e){return e>0?1:e<0?-1:0}static toInt(e){return e>0?Math.floor(e):Math.ceil(e)}static cbrt(e){let t=Math.pow(Math.abs(e),.3333333333333333);return e<0?-t:t}static randomTriangular(e,t){return es.randomTriangularWith(e,t,(e+t)*.5)}static randomTriangularWith(e,t,s){let n=Math.random(),r=t-e;return n<=(s-e)/r?e+Math.sqrt(n*r*(s-e)):t-Math.sqrt((1-n)*r*(t-s))}static isPowerOfTwo(e){return e&&(e&e-1)===0}},S(es,"PI",3.1415927),S(es,"PI2",es.PI*2),S(es,"invPI2",1/es.PI2),S(es,"radiansToDegrees",180/es.PI),S(es,"radDeg",es.radiansToDegrees),S(es,"degreesToRadians",es.PI/180),S(es,"degRad",es.degreesToRadians),es);var _i;let Pe=(_i=class{static arrayCopy(e,t,s,n,r){for(let o=t,a=n;o=t?e:_i.setArraySize(e,t,s)}static newArray(e,t){let s=new Array(e);for(let n=0;n0?this.items.pop():this.instantiator()}free(e){e.reset&&e.reset(),this.items.push(e)}freeAll(e){for(let t=0;t>1)*a;let l=t.bone.skeleton,c=t.deform,h=this.vertices,u=this.bones;if(!u){c.length>0&&(h=c);let m=t.bone,g=m.worldX,v=m.worldY,y=m.a,x=m.b,M=m.c,C=m.d;for(let w=s,b=o;b=this.regions.length&&(s=this.regions.length-1);let n=this.regions[s];t.region!=n&&(t.region=n,t.updateRegion())}getPath(e,t){let s=e,n=(this.start+t).toString();for(let r=this.digits-n.length;r>0;r--)s+="0";return s+=n,s}static nextID(){return On._nextID++}},S(On,"_nextID",0),On);var Ts;(function(i){i[i.hold=0]="hold",i[i.once=1]="once",i[i.loop=2]="loop",i[i.pingpong=3]="pingpong",i[i.onceReverse=4]="onceReverse",i[i.loopReverse=5]="loopReverse",i[i.pingpongReverse=6]="pingpongReverse"})(Ts||(Ts={}));const k1=[Ts.hold,Ts.once,Ts.loop,Ts.pingpong,Ts.onceReverse,Ts.loopReverse,Ts.pingpongReverse];let Mp=class{constructor(e,t,s){S(this,"name");S(this,"timelines",[]);S(this,"timelineIds",new I1);S(this,"duration");if(!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(t),this.duration=s}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e,this.timelineIds.clear();for(var t=0;t0&&(t%=this.duration));let c=this.timelines;for(let h=0,u=c.length;ht)return n-1;return s-1}static search(e,t,s){let n=e.length;for(let r=s;rt)return r-s;return n-s}},dn=class extends Xt{constructor(t,s,n){super(t,n);S(this,"curves");this.curves=Pe.newFloatArray(t+s*18),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let s=this.getFrameCount()+t*18;if(this.curves.length>s){let n=Pe.newFloatArray(s);Pe.arrayCopy(this.curves,0,n,0,s),this.curves=n}}setBezier(t,s,n,r,o,a,l,c,h,u,d){let f=this.curves,p=this.getFrameCount()+t*18;n==0&&(f[s]=2+p);let m=(r-a*2+c)*.03,g=(o-l*2+h)*.03,v=((a-c)*3-r+u)*.006,y=((l-h)*3-o+d)*.006,x=m*2+v,M=g*2+y,C=(a-r)*.3+m+v*.16666667,w=(l-o)*.3+g+y*.16666667,b=r+C,_=o+w;for(let E=p+18;pt){let h=this.frames[s],u=this.frames[s+n];return u+(t-h)/(o[r]-h)*(o[r+1]-u)}let a=r+18;for(r+=2;r=t){let h=o[r-2],u=o[r-1];return u+(t-h)/(o[r]-h)*(o[r+1]-u)}s+=this.getFrameEntries();let l=o[a-2],c=o[a-1];return c+(t-l)/(this.frames[s]-l)*(this.frames[s+n]-c)}},Li=class extends dn{constructor(e,t,s){super(e,t,[s])}getFrameEntries(){return 2}setFrame(e,t,s){e<<=1,this.frames[e]=t,this.frames[e+1]=s}getCurveValue(e){let t=this.frames,s=t.length-2;for(let r=2;r<=s;r+=2)if(t[r]>e){s=r-2;break}let n=this.curves[s>>1];switch(n){case 0:let r=t[s],o=t[s+1];return o+(e-r)/(t[s+2]-r)*(t[s+2+1]-o);case 1:return t[s+1]}return this.getBezierValue(e,s,1,n-2)}getRelativeValue(e,t,s,n,r){if(e>2];switch(g){case 0:let v=h[m];d=h[m+1],f=h[m+2],p=h[m+3];let y=(n-v)/(h[m+4]-v);d+=(h[m+4+1]-d)*y,f+=(h[m+4+2]-f)*y,p+=(h[m+4+3]-p)*y;break;case 1:d=h[m+1],f=h[m+2],p=h[m+3];break;default:d=this.getBezierValue(n,m,1,g-2),f=this.getBezierValue(n,m,2,g+18-2),p=this.getBezierValue(n,m,3,g+36-2)}if(o==1)u.r=d,u.g=f,u.b=p;else{if(a==ve.setup){let v=c.data.color;u.r=v.r,u.g=v.g,u.b=v.b}u.r+=(d-u.r)*o,u.g+=(f-u.g)*o,u.b+=(p-u.b)*o}}},j1=class extends Li{constructor(t,s,n){super(t,s,at.alpha+"|"+n);S(this,"slotIndex",0);this.slotIndex=n}apply(t,s,n,r,o,a,l){let c=t.slots[this.slotIndex];if(!c.bone.active)return;let h=c.color;if(n>3];switch(C){case 0:let w=h[M];f=h[M+1],p=h[M+2],m=h[M+3],g=h[M+4],v=h[M+5],y=h[M+6],x=h[M+7];let b=(n-w)/(h[M+8]-w);f+=(h[M+8+1]-f)*b,p+=(h[M+8+2]-p)*b,m+=(h[M+8+3]-m)*b,g+=(h[M+8+4]-g)*b,v+=(h[M+8+5]-v)*b,y+=(h[M+8+6]-y)*b,x+=(h[M+8+7]-x)*b;break;case 1:f=h[M+1],p=h[M+2],m=h[M+3],g=h[M+4],v=h[M+5],y=h[M+6],x=h[M+7];break;default:f=this.getBezierValue(n,M,1,C-2),p=this.getBezierValue(n,M,2,C+18-2),m=this.getBezierValue(n,M,3,C+36-2),g=this.getBezierValue(n,M,4,C+54-2),v=this.getBezierValue(n,M,5,C+72-2),y=this.getBezierValue(n,M,6,C+90-2),x=this.getBezierValue(n,M,7,C+108-2)}if(o==1)u.set(f,p,m,g),d.r=v,d.g=y,d.b=x;else{if(a==ve.setup){u.setFromColor(c.data.color);let w=c.data.darkColor;d.r=w.r,d.g=w.g,d.b=w.b}u.add((f-u.r)*o,(p-u.g)*o,(m-u.b)*o,(g-u.a)*o),d.r+=(v-d.r)*o,d.g+=(y-d.g)*o,d.b+=(x-d.b)*o}}},W1=class extends dn{constructor(t,s,n){super(t,s,[at.rgb+"|"+n,at.rgb2+"|"+n]);S(this,"slotIndex",0);this.slotIndex=n}getFrameEntries(){return 7}setFrame(t,s,n,r,o,a,l,c){t*=7,this.frames[t]=s,this.frames[t+1]=n,this.frames[t+2]=r,this.frames[t+3]=o,this.frames[t+4]=a,this.frames[t+5]=l,this.frames[t+6]=c}apply(t,s,n,r,o,a,l){let c=t.slots[this.slotIndex];if(!c.bone.active)return;let h=this.frames,u=c.color,d=c.darkColor;if(nt){let c=this.frames[s];return n[r+1]*(t-c)/(n[r]-c)}let o=r+18;for(r+=2;r=t){let c=n[r-2],h=n[r-1];return h+(t-c)/(n[r]-c)*(n[r+1]-h)}let a=n[o-2],l=n[o-1];return l+(1-l)*(t-a)/(this.frames[s+this.getFrameEntries()]-a)}apply(t,s,n,r,o,a,l){let c=t.slots[this.slotIndex];if(!c.bone.active)return;let h=c.getAttachment();if(!h||!(h instanceof jn)||h.timelineAttachment!=this.attachment)return;let u=c.deform;u.length==0&&(a=ve.setup);let d=this.vertices,f=d[0].length,p=this.frames;if(n=p[p.length-1]){let M=d[p.length-1];if(o==1)if(a==ve.add){let C=h;if(C.bones)for(let w=0;wn)this.apply(t,s,Number.MAX_VALUE,r,o,a,l),s=-1;else if(s>=c[h-1])return;if(n0&&c[u-1]==d;)u--}for(;u=c[u];u++)r.push(this.events[u])}},S(Qr,"propertyIds",[""+at.event]),Qr);var eo;let Qa=(eo=class extends Xt{constructor(t){super(t,eo.propertyIds);S(this,"drawOrders");this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,s,n){this.frames[t]=s,this.drawOrders[t]=n}apply(t,s,n,r,o,a,l){if(l==Fs.mixOut){a==ve.setup&&Pe.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}if(n>2];switch(m){case 0:let g=h[p];u=h[p+1],d=h[p+2],f=h[p+3];let v=(n-g)/(h[p+4]-g);u+=(h[p+4+1]-u)*v,d+=(h[p+4+2]-d)*v,f+=(h[p+4+3]-f)*v;break;case 1:u=h[p+1],d=h[p+2],f=h[p+3];break;default:u=this.getBezierValue(n,p,1,m-2),d=this.getBezierValue(n,p,2,m+18-2),f=this.getBezierValue(n,p,3,m+36-2)}if(a==ve.setup){let g=c.data;c.mixRotate=g.mixRotate+(u-g.mixRotate)*o,c.mixX=g.mixX+(d-g.mixX)*o,c.mixY=g.mixY+(f-g.mixY)*o}else c.mixRotate+=(u-c.mixRotate)*o,c.mixX+=(d-c.mixX)*o,c.mixY+=(f-c.mixY)*o}},xo=class extends Li{constructor(t,s,n,r){super(t,s,r+"|"+n);S(this,"constraintIndex",0);this.constraintIndex=n}apply(t,s,n,r,o,a,l){let c;if(this.constraintIndex==-1){const h=n>=this.frames[0]?this.getCurveValue(n):0;for(const u of t.physicsConstraints)u.active&&this.global(u.data)&&this.set(u,this.getAbsoluteValue2(n,o,a,this.get(u),this.setup(u),h))}else c=t.physicsConstraints[this.constraintIndex],c.active&&this.set(c,this.getAbsoluteValue(n,o,a,this.get(c),this.setup(c)))}},ew=class extends xo{constructor(e,t,s){super(e,t,s,at.physicsConstraintInertia)}setup(e){return e.data.inertia}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}},tw=class extends xo{constructor(e,t,s){super(e,t,s,at.physicsConstraintStrength)}setup(e){return e.data.strength}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}},sw=class extends xo{constructor(e,t,s){super(e,t,s,at.physicsConstraintDamping)}setup(e){return e.data.damping}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}},iw=class extends xo{constructor(e,t,s){super(e,t,s,at.physicsConstraintMass)}setup(e){return 1/e.data.massInverse}get(e){return 1/e.massInverse}set(e,t){e.massInverse=1/t}global(e){return e.massGlobal}},nw=class extends xo{constructor(e,t,s){super(e,t,s,at.physicsConstraintWind)}setup(e){return e.data.wind}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}},rw=class extends xo{constructor(e,t,s){super(e,t,s,at.physicsConstraintGravity)}setup(e){return e.data.gravity}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}},ow=class extends xo{constructor(e,t,s){super(e,t,s,at.physicsConstraintMix)}setup(e){return e.data.mix}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}};var to;let aw=(to=class extends Xt{constructor(t,s){super(t,to.propertyIds);S(this,"constraintIndex");this.constraintIndex=s}getFrameCount(){return this.frames.length}setFrame(t,s){this.frames[t]=s}apply(t,s,n,r,o,a,l){let c;if(this.constraintIndex!=-1&&(c=t.physicsConstraints[this.constraintIndex],!c.active))return;const h=this.frames;if(s>n)this.apply(t,s,Number.MAX_VALUE,[],o,a,l),s=-1;else if(s>=h[h.length-1])return;if(!(n=h[Xt.search1(h,s)+1]))if(c!=null)c.reset();else for(const u of t.physicsConstraints)u.active&&u.reset()}},S(to,"propertyIds",[at.physicsConstraintReset.toString()]),to);var Us;let lw=(Us=class extends Xt{constructor(t,s,n){super(t,[at.sequence+"|"+s+"|"+n.sequence.id]);S(this,"slotIndex");S(this,"attachment");this.slotIndex=s,this.attachment=n}getFrameEntries(){return Us.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,s,n,r,o){let a=this.frames;t*=Us.ENTRIES,a[t]=s,a[t+Us.MODE]=n|r<<4,a[t+Us.DELAY]=o}apply(t,s,n,r,o,a,l){let c=t.slots[this.slotIndex];if(!c.bone.active)return;let h=c.attachment,u=this.attachment;if(h!=u&&(!(h instanceof jn)||h.timelineAttachment!=u))return;if(l==Fs.mixOut){a==ve.setup&&(c.sequenceIndex=-1);return}let d=this.frames;if(n>4,y=this.attachment.sequence.regions.length,x=k1[m&15];if(x!=Ts.hold)switch(v+=(n-p)/g+1e-5|0,x){case Ts.once:v=Math.min(y-1,v);break;case Ts.loop:v%=y;break;case Ts.pingpong:{let M=(y<<1)-2;v=M==0?0:v%M,v>=y&&(v=M-v);break}case Ts.onceReverse:v=Math.max(y-1-v,0);break;case Ts.loopReverse:v=y-1-v%y;break;case Ts.pingpongReverse:{let M=(y<<1)-2;v=M==0?0:(v+y-1)%M,v>=y&&(v=M-v)}}c.sequenceIndex=v}},S(Us,"ENTRIES",3),S(Us,"MODE",1),S(Us,"DELAY",2),Us);var Ln;let JR=(Ln=class{constructor(e){S(this,"data");S(this,"tracks",new Array);S(this,"timeScale",1);S(this,"unkeyedState",0);S(this,"events",new Array);S(this,"listeners",new Array);S(this,"queue",new eP(this));S(this,"propertyIDs",new I1);S(this,"animationsChanged",!1);S(this,"trackEntryPool",new vh(()=>new QR));this.data=e}static emptyAnimation(){return Ln._emptyAnimation}update(e){e*=this.timeScale;let t=this.tracks;for(let s=0,n=t.length;s0){if(r.delay-=o,r.delay>0)continue;o=-r.delay,r.delay=0}let a=r.next;if(a){let l=r.trackLast-a.delay;if(l>=0){for(a.delay=0,a.trackTime+=r.timeScale==0?0:(l/r.timeScale+e)*a.timeScale,r.trackTime+=o,this.setCurrent(s,a,!0);a.mixingFrom;)a.mixTime+=e,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){t[s]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,e)){let l=r.mixingFrom;for(r.mixingFrom=null,l&&(l.mixingTo=null);l;)this.queue.end(l),l=l.mixingFrom}r.trackTime+=o}this.queue.drain()}updateMixingFrom(e,t){let s=e.mixingFrom;if(!s)return!0;let n=this.updateMixingFrom(s,t);return s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast,e.nextTrackLast!=-1&&e.mixTime>=e.mixDuration?((s.totalAlpha==0||e.mixDuration==0)&&(e.mixingFrom=s.mixingFrom,s.mixingFrom!=null&&(s.mixingFrom.mixingTo=e),e.interruptAlpha=s.interruptAlpha,this.queue.end(s)),n):(s.trackTime+=t*s.timeScale,e.mixTime+=t,!1)}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let t=this.events,s=this.tracks,n=!1;for(let d=0,f=s.length;d0)continue;n=!0;let m=d==0?ve.first:p.mixBlend,g=p.alpha;p.mixingFrom?g*=this.applyMixingFrom(p,e,m):p.trackTime>=p.trackEnd&&!p.next&&(g=0);let v=g>=p.alphaAttachmentThreshold,y=p.animationLast,x=p.getAnimationTime(),M=x,C=t;p.reverse&&(M=p.animation.duration-M,C=null);let w=p.animation.timelines,b=w.length;if(d==0&&g==1||m==ve.add){d==0&&(v=!0);for(let _=0;_1&&(r=1),s!=ve.first&&(s=n.mixBlend));let o=r=n.alphaAttachmentThreshold):(a&&C instanceof Qa&&b==ve.setup&&(w=Fs.mixIn),C.apply(t,d,p,m,_,b,w))}}return e.mixDuration>0&&this.queueEvents(n,f),this.events.length=0,n.nextAnimationLast=f,n.nextTrackLast=n.trackTime,r}applyAttachmentTimeline(e,t,s,n,r){var o=t.slots[e.slotIndex];o.bone.active&&(s=0,x=m>=0;Math.abs(g)<=90&&Ie.signum(g)!=Ie.signum(p)&&(Math.abs(m-v)>180?(f+=360*Ie.signum(m),x=y):v!=0?f-=360*Ie.signum(m):x=y),x!=y&&(f+=360*Ie.signum(m)),o[a]=f}o[a+1]=p,c.rotation=u+f*n}queueEvents(e,t){let s=e.animationStart,n=e.animationEnd,r=n-s,o=e.trackLast%r,a=this.events,l=0,c=a.length;for(;ln||this.queue.event(e,u)}let h=!1;if(e.loop)if(r==0)h=!0;else{const u=Math.floor(e.trackTime/r);h=u>0&&u>Math.floor(e.trackLast/r)}else h=t>=n&&e.animationLast=this.tracks.length)return;let t=this.tracks[e];if(!t)return;this.queue.end(t),this.clearNext(t);let s=t;for(;;){let n=s.mixingFrom;if(!n)break;this.queue.end(n),s.mixingFrom=null,s.mixingTo=null,s=n}this.tracks[t.trackIndex]=null,this.queue.drain()}setCurrent(e,t,s){let n=this.expandToIndex(e);this.tracks[e]=t,t.previous=null,n&&(s&&this.queue.interrupt(n),t.mixingFrom=n,n.mixingTo=t,t.mixTime=0,n.mixingFrom&&n.mixDuration>0&&(t.interruptAlpha*=Math.min(1,n.mixTime/n.mixDuration)),n.timelinesRotation.length=0),this.queue.start(t)}setAnimation(e,t,s=!1){let n=this.data.skeletonData.findAnimation(t);if(!n)throw new Error("Animation not found: "+t);return this.setAnimationWith(e,n,s)}setAnimationWith(e,t,s=!1){if(!t)throw new Error("animation cannot be null.");let n=!0,r=this.expandToIndex(e);r&&(r.nextTrackLast==-1?(this.tracks[e]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,n=!1):this.clearNext(r));let o=this.trackEntry(e,t,s,r);return this.setCurrent(e,o,n),this.queue.drain(),o}addAnimation(e,t,s=!1,n=0){let r=this.data.skeletonData.findAnimation(t);if(!r)throw new Error("Animation not found: "+t);return this.addAnimationWith(e,r,s,n)}addAnimationWith(e,t,s=!1,n=0){if(!t)throw new Error("animation cannot be null.");let r=this.expandToIndex(e);if(r)for(;r.next;)r=r.next;let o=this.trackEntry(e,t,s,r);return r?(r.next=o,o.previous=r,n<=0&&(n=Math.max(n+r.getTrackComplete()-o.mixDuration,0))):(this.setCurrent(e,o,!0),this.queue.drain(),n<0&&(n=0)),o.delay=n,o}setEmptyAnimation(e,t=0){let s=this.setAnimationWith(e,Ln.emptyAnimation(),!1);return s.mixDuration=t,s.trackEnd=t,s}addEmptyAnimation(e,t=0,s=0){let n=this.addAnimationWith(e,Ln.emptyAnimation(),!1,s);return s<=0&&(n.delay=Math.max(n.delay+n.mixDuration-t,0)),n.mixDuration=t,n.trackEnd=t,n}setEmptyAnimations(e=0){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let s=0,n=this.tracks.length;s0){r[l]=tP,o[l]=u;continue e}break}r[l]=cf}}}getCurrent(e){return e>=this.tracks.length?null:this.tracks[e]}addListener(e){if(!e)throw new Error("listener cannot be null.");this.listeners.push(e)}removeListener(e){let t=this.listeners.indexOf(e);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},S(Ln,"_emptyAnimation",new Mp("",[],0)),Ln),QR=class{constructor(){S(this,"animation",null);S(this,"previous",null);S(this,"next",null);S(this,"mixingFrom",null);S(this,"mixingTo",null);S(this,"listener",null);S(this,"trackIndex",0);S(this,"loop",!1);S(this,"holdPrevious",!1);S(this,"reverse",!1);S(this,"shortestRotation",!1);S(this,"eventThreshold",0);S(this,"mixAttachmentThreshold",0);S(this,"alphaAttachmentThreshold",0);S(this,"mixDrawOrderThreshold",0);S(this,"animationStart",0);S(this,"animationEnd",0);S(this,"animationLast",0);S(this,"nextAnimationLast",0);S(this,"delay",0);S(this,"trackTime",0);S(this,"trackLast",0);S(this,"nextTrackLast",0);S(this,"trackEnd",0);S(this,"timeScale",0);S(this,"alpha",0);S(this,"mixTime",0);S(this,"_mixDuration",0);S(this,"interruptAlpha",0);S(this,"totalAlpha",0);S(this,"mixBlend",ve.replace);S(this,"timelineMode",new Array);S(this,"timelineHoldMix",new Array);S(this,"timelinesRotation",new Array)}get mixDuration(){return this._mixDuration}set mixDuration(e){this._mixDuration=e}setMixDurationWithDelay(e,t){this._mixDuration=e,t<=0&&(this.previous!=null?t=Math.max(t+this.previous.getTrackComplete()-e,0):t=0),this.delay=t}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let e=this.animationEnd-this.animationStart;return e==0?this.animationStart:this.trackTime%e+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(e){this.animationLast=e,this.nextAnimationLast=e}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let e=this.animationEnd-this.animationStart;if(e!=0){if(this.loop)return e*(1+(this.trackTime/e|0));if(this.trackTime=0}},eP=class{constructor(e){S(this,"objects",[]);S(this,"drainDisabled",!1);S(this,"animState");this.animState=e}start(e){this.objects.push(js.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(js.interrupt),this.objects.push(e)}end(e){this.objects.push(js.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(js.dispose),this.objects.push(e)}complete(e){this.objects.push(js.complete),this.objects.push(e)}event(e,t){this.objects.push(js.event),this.objects.push(e),this.objects.push(t)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let e=this.objects;for(let t=0;t{h.width=parseInt(s[1]),h.height=parseInt(s[2])},n.format=()=>{},n.filter=h=>{h.minFilter=Pe.enumValue(ys,s[1]),h.magFilter=Pe.enumValue(ys,s[2])},n.repeat=h=>{s[1].indexOf("x")!=-1&&(h.uWrap=Un.Repeat),s[1].indexOf("y")!=-1&&(h.vWrap=Un.Repeat)},n.pma=h=>{h.pma=s[1]=="true"};var r={};r.xy=h=>{h.x=parseInt(s[1]),h.y=parseInt(s[2])},r.size=h=>{h.width=parseInt(s[1]),h.height=parseInt(s[2])},r.bounds=h=>{h.x=parseInt(s[1]),h.y=parseInt(s[2]),h.width=parseInt(s[3]),h.height=parseInt(s[4])},r.offset=h=>{h.offsetX=parseInt(s[1]),h.offsetY=parseInt(s[2])},r.orig=h=>{h.originalWidth=parseInt(s[1]),h.originalHeight=parseInt(s[2])},r.offsets=h=>{h.offsetX=parseInt(s[1]),h.offsetY=parseInt(s[2]),h.originalWidth=parseInt(s[3]),h.originalHeight=parseInt(s[4])},r.rotate=h=>{let u=s[1];u=="true"?h.degrees=90:u!="false"&&(h.degrees=parseInt(u))},r.index=h=>{h.index=parseInt(s[1])};let o=t.readLine();for(;o&&o.trim().length==0;)o=t.readLine();for(;!(!o||o.trim().length==0||t.readEntry(s,o)==0);)o=t.readLine();let a=null,l=null,c=null;for(;o!==null;)if(o.trim().length==0)a=null,o=t.readLine();else if(a){let h=new fw(a,o);for(;;){let u=t.readEntry(s,o=t.readLine());if(u==0)break;let d=r[s[0]];if(d)d(h);else{l||(l=[]),c||(c=[]),l.push(s[0]);let f=[];for(let p=0;p0&&c&&c.length>0&&(h.names=l,h.values=c,l=null,c=null),h.u=h.x/a.width,h.v=h.y/a.height,h.degrees==90?(h.u2=(h.x+h.height)/a.width,h.v2=(h.y+h.width)/a.height):(h.u2=(h.x+h.width)/a.width,h.v2=(h.y+h.height)/a.height),this.regions.push(h)}else{for(a=new aP(o.trim());t.readEntry(s,o=t.readLine())!=0;){let h=n[s[0]];h&&h(a)}this.pages.push(a)}}findRegion(e){for(let t=0;t=this.lines.length?null:this.lines[this.index++]}readEntry(e,t){if(!t||(t=t.trim(),t.length==0))return 0;let s=t.indexOf(":");if(s==-1)return 0;e[0]=t.substr(0,s).trim();for(let n=1,r=s+1;;n++){let o=t.indexOf(",",r);if(o==-1)return e[n]=t.substr(r).trim(),n;if(e[n]=t.substr(r,o-r).trim(),r=o+1,n==4)return 4}}},aP=class{constructor(e){S(this,"name");S(this,"minFilter",ys.Nearest);S(this,"magFilter",ys.Nearest);S(this,"uWrap",Un.ClampToEdge);S(this,"vWrap",Un.ClampToEdge);S(this,"texture",null);S(this,"width",0);S(this,"height",0);S(this,"pma",!1);S(this,"regions",new Array);this.name=e}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap);for(let t of this.regions)t.texture=e}},fw=class extends rP{constructor(t,s){super();S(this,"page");S(this,"name");S(this,"x",0);S(this,"y",0);S(this,"offsetX",0);S(this,"offsetY",0);S(this,"originalWidth",0);S(this,"originalHeight",0);S(this,"index",0);S(this,"degrees",0);S(this,"names",null);S(this,"values",null);this.page=t,this.name=s,t.regions.push(this)}},kl=class vm extends jn{constructor(t,s){super(t);S(this,"region",null);S(this,"path");S(this,"regionUVs",[]);S(this,"uvs",[]);S(this,"triangles",[]);S(this,"color",new rt(1,1,1,1));S(this,"width",0);S(this,"height",0);S(this,"hullLength",0);S(this,"edges",[]);S(this,"parentMesh",null);S(this,"sequence",null);S(this,"tempColor",new rt(0,0,0,0));this.path=s}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;(!this.uvs||this.uvs.length!=t.length)&&(this.uvs=Pe.newFloatArray(t.length));let s=this.uvs,n=this.uvs.length,r=this.region.u,o=this.region.v,a=0,l=0;if(this.region instanceof fw){let c=this.region,h=c.page,u=h.width,d=h.height;switch(c.degrees){case 90:r-=(c.originalHeight-c.offsetY-c.height)/u,o-=(c.originalWidth-c.offsetX-c.width)/d,a=c.originalHeight/u,l=c.originalWidth/d;for(let f=0;f= 0.");if(!t)throw new Error("name cannot be null.");this.index=e,this.name=t,this.parent=s}};var qt;(function(i){i[i.Normal=0]="Normal",i[i.OnlyTranslation=1]="OnlyTranslation",i[i.NoRotationOrReflection=2]="NoRotationOrReflection",i[i.NoScale=3]="NoScale",i[i.NoScaleOrReflection=4]="NoScaleOrReflection"})(qt||(qt={}));let Hv=class{constructor(e,t,s){S(this,"data");S(this,"skeleton");S(this,"parent",null);S(this,"children",new Array);S(this,"x",0);S(this,"y",0);S(this,"rotation",0);S(this,"scaleX",0);S(this,"scaleY",0);S(this,"shearX",0);S(this,"shearY",0);S(this,"ax",0);S(this,"ay",0);S(this,"arotation",0);S(this,"ascaleX",0);S(this,"ascaleY",0);S(this,"ashearX",0);S(this,"ashearY",0);S(this,"a",0);S(this,"b",0);S(this,"c",0);S(this,"d",0);S(this,"worldY",0);S(this,"worldX",0);S(this,"inherit",qt.Normal);S(this,"sorted",!1);S(this,"active",!1);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=t,this.parent=s,this.setToSetupPose()}isActive(){return this.active}update(e){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(e,t,s,n,r,o,a){this.ax=e,this.ay=t,this.arotation=s,this.ascaleX=n,this.ascaleY=r,this.ashearX=o,this.ashearY=a;let l=this.parent;if(!l){let f=this.skeleton;const p=f.scaleX,m=f.scaleY,g=(s+o)*Ie.degRad,v=(s+90+a)*Ie.degRad;this.a=Math.cos(g)*n*p,this.b=Math.cos(v)*r*p,this.c=Math.sin(g)*n*m,this.d=Math.sin(v)*r*m,this.worldX=e*p+f.x,this.worldY=t*m+f.y;return}let c=l.a,h=l.b,u=l.c,d=l.d;switch(this.worldX=c*e+h*t+l.worldX,this.worldY=u*e+d*t+l.worldY,this.inherit){case qt.Normal:{const f=(s+o)*Ie.degRad,p=(s+90+a)*Ie.degRad,m=Math.cos(f)*n,g=Math.cos(p)*r,v=Math.sin(f)*n,y=Math.sin(p)*r;this.a=c*m+h*v,this.b=c*g+h*y,this.c=u*m+d*v,this.d=u*g+d*y;return}case qt.OnlyTranslation:{const f=(s+o)*Ie.degRad,p=(s+90+a)*Ie.degRad;this.a=Math.cos(f)*n,this.b=Math.cos(p)*r,this.c=Math.sin(f)*n,this.d=Math.sin(p)*r;break}case qt.NoRotationOrReflection:{let f=1/this.skeleton.scaleX,p=1/this.skeleton.scaleY;c*=f,u*=p;let m=c*c+u*u,g=0;m>1e-4?(m=Math.abs(c*d*p-h*f*u)/m,h=u*m,d=c*m,g=Math.atan2(u,c)*Ie.radDeg):(c=0,u=0,g=90-Math.atan2(d,h)*Ie.radDeg);const v=(s+o-g)*Ie.degRad,y=(s+a-g+90)*Ie.degRad,x=Math.cos(v)*n,M=Math.cos(y)*r,C=Math.sin(v)*n,w=Math.sin(y)*r;this.a=c*x-h*C,this.b=c*M-h*w,this.c=u*x+d*C,this.d=u*M+d*w;break}case qt.NoScale:case qt.NoScaleOrReflection:{s*=Ie.degRad;const f=Math.cos(s),p=Math.sin(s);let m=(c*f+h*p)/this.skeleton.scaleX,g=(u*f+d*p)/this.skeleton.scaleY,v=Math.sqrt(m*m+g*g);v>1e-5&&(v=1/v),m*=v,g*=v,v=Math.sqrt(m*m+g*g),this.inherit==qt.NoScale&&c*d-h*u<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(v=-v),s=Math.PI/2+Math.atan2(g,m);const y=Math.cos(s)*v,x=Math.sin(s)*v;o*=Ie.degRad,a=(90+a)*Ie.degRad;const M=Math.cos(o)*n,C=Math.cos(a)*r,w=Math.sin(o)*n,b=Math.sin(a)*r;this.a=m*M+y*w,this.b=m*C+y*b,this.c=g*M+x*w,this.d=g*C+x*b;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let e=this.data;this.x=e.x,this.y=e.y,this.rotation=e.rotation,this.scaleX=e.scaleX,this.scaleY=e.scaleY,this.shearX=e.shearX,this.shearY=e.shearY,this.inherit=e.inherit}updateAppliedTransform(){let e=this.parent;if(!e){this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*Ie.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*Ie.radDeg;return}let t=e.a,s=e.b,n=e.c,r=e.d,o=1/(t*r-s*n),a=r*o,l=s*o,c=n*o,h=t*o,u=this.worldX-e.worldX,d=this.worldY-e.worldY;this.ax=u*a-d*l,this.ay=d*h-u*c;let f,p,m,g;if(this.inherit==qt.OnlyTranslation)f=this.a,p=this.b,m=this.c,g=this.d;else{switch(this.inherit){case qt.NoRotationOrReflection:{let C=Math.abs(t*r-s*n)/(t*t+n*n);s=-n*this.skeleton.scaleX*C/this.skeleton.scaleY,r=t*this.skeleton.scaleY*C/this.skeleton.scaleX,o=1/(t*r-s*n),a=r*o,l=s*o;break}case qt.NoScale:case qt.NoScaleOrReflection:let v=Ie.cosDeg(this.rotation),y=Ie.sinDeg(this.rotation);t=(t*v+s*y)/this.skeleton.scaleX,n=(n*v+r*y)/this.skeleton.scaleY;let x=Math.sqrt(t*t+n*n);x>1e-5&&(x=1/x),t*=x,n*=x,x=Math.sqrt(t*t+n*n),this.inherit==qt.NoScale&&o<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(x=-x);let M=Ie.PI/2+Math.atan2(n,t);s=Math.cos(M)*x,r=Math.sin(M)*x,o=1/(t*r-s*n),a=r*o,l=s*o,c=n*o,h=t*o}f=a*this.a-l*this.c,p=a*this.b-l*this.d,m=h*this.c-c*this.a,g=h*this.d-c*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+m*m),this.ascaleX>1e-4){let v=f*g-p*m;this.ascaleY=v/this.ascaleX,this.ashearY=-Math.atan2(f*p+m*g,v)*Ie.radDeg,this.arotation=Math.atan2(m,f)*Ie.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,p)*Ie.radDeg}getWorldRotationX(){return Math.atan2(this.c,this.a)*Ie.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*Ie.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}worldToLocal(e){let t=1/(this.a*this.d-this.b*this.c),s=e.x-this.worldX,n=e.y-this.worldY;return e.x=s*this.d*t-n*this.b*t,e.y=n*this.a*t-s*this.c*t,e}localToWorld(e){let t=e.x,s=e.y;return e.x=t*this.a+s*this.b+this.worldX,e.y=t*this.c+s*this.d+this.worldY,e}worldToParent(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.worldToLocal(e)}parentToWorld(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.localToWorld(e)}worldToLocalRotation(e){let t=Ie.sinDeg(e),s=Ie.cosDeg(e);return Math.atan2(this.a*t-this.c*s,this.d*s-this.b*t)*Ie.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let t=Ie.sinDeg(e),s=Ie.cosDeg(e);return Math.atan2(s*this.c+t*this.d,s*this.a+t*this.b)*Ie.radDeg}rotateWorld(e){e*=Ie.degRad;const t=Math.sin(e),s=Math.cos(e),n=this.a,r=this.b;this.a=s*n-t*this.c,this.b=s*r-t*this.d,this.c=t*n+s*this.c,this.d=t*r+s*this.d}},pu=class{constructor(e,t,s){S(this,"name");S(this,"order");S(this,"skinRequired");this.name=e,this.order=t,this.skinRequired=s}},yw=class{constructor(e,t){S(this,"data");S(this,"intValue",0);S(this,"floatValue",0);S(this,"stringValue",null);S(this,"time",0);S(this,"volume",0);S(this,"balance",0);if(!t)throw new Error("data cannot be null.");this.time=e,this.data=t}},xw=class{constructor(e){S(this,"name");S(this,"intValue",0);S(this,"floatValue",0);S(this,"stringValue",null);S(this,"audioPath",null);S(this,"volume",0);S(this,"balance",0);this.name=e}},lP=class{constructor(e,t){S(this,"data");S(this,"bones");S(this,"target");S(this,"bendDirection",0);S(this,"compress",!1);S(this,"stretch",!1);S(this,"mix",1);S(this,"softness",0);S(this,"active",!1);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let n=0;n180?f-=360:f<-180&&(f+=360);let g=e.ascaleX,v=e.ascaleY;if(n||r){switch(e.inherit){case qt.NoScale:case qt.NoScaleOrReflection:p=t-e.worldX,m=s-e.worldY}const y=e.data.length*g;if(y>1e-4){const x=p*p+m*m;if(n&&xy*y){const M=(Math.sqrt(x)/y-1)*a+1;g*=M,o&&(v*=M)}}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+f*a,g,v,e.ashearX,e.ashearY)}apply2(e,t,s,n,r,o,a,l,c){if(e.inherit!=qt.Normal||t.inherit!=qt.Normal)return;let h=e.ax,u=e.ay,d=e.ascaleX,f=e.ascaleY,p=d,m=f,g=t.ascaleX,v=0,y=0,x=0;d<0?(d=-d,v=180,x=-1):(v=0,x=1),f<0&&(f=-f,x=-x),g<0?(g=-g,y=180):y=0;let M=t.ax,C=0,w=0,b=0,_=e.a,E=e.b,F=e.c,I=e.d,k=Math.abs(d-f)<=1e-4;!k||o?(C=0,w=_*M+e.worldX,b=F*M+e.worldY):(C=t.ay,w=_*M+E*C+e.worldX,b=F*M+I*C+e.worldY);let B=e.parent;if(!B)throw new Error("IK parent must itself have a parent.");_=B.a,E=B.b,F=B.c,I=B.d;let D=_*I-E*F,X=w-B.worldX,N=b-B.worldY;D=Math.abs(D)<=1e-4?0:1/D;let U=(X*I-N*E)*D-h,A=(N*_-X*F)*D-u,P=Math.sqrt(U*U+A*A),O=t.data.length*g,L,$;if(P<1e-4){this.apply1(e,s,n,!1,o,!1,c),t.updateWorldTransformWith(M,C,0,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY);return}X=s-B.worldX,N=n-B.worldY;let V=(X*I-N*E)*D-h,j=(N*_-X*F)*D-u,K=V*V+j*j;if(l!=0){l*=d*(g+1)*.5;let pe=Math.sqrt(K),ge=pe-P-O*d+l;if(ge>0){let he=Math.min(1,ge/(l*2))-1;he=(ge-l*(1-he*he))/pe,V-=he*V,j-=he*j,K=V*V+j*j}}e:if(k){O*=d;let pe=(K-P*P-O*O)/(2*P*O);pe<-1?(pe=-1,$=Math.PI*r):pe>1?(pe=1,$=0,o&&(_=(Math.sqrt(K)/(P+O)-1)*c+1,p*=_,a&&(m*=_))):$=Math.acos(pe)*r,_=P+O*pe,E=O*Math.sin($),L=Math.atan2(j*_-V*E,V*_+j*E)}else{_=d*O,E=f*O;let pe=_*_,ge=E*E,he=Math.atan2(j,V);F=ge*P*P+pe*K-pe*ge;let fe=-2*ge*P,Y=ge-pe;if(I=fe*fe-4*Y*F,I>=0){let le=Math.sqrt(I);fe<0&&(le=-le),le=-(fe+le)*.5;let Re=le/Y,we=F/le,me=Math.abs(Re)=0){N=Math.sqrt(Re)*r,L=he-Math.atan2(N,me),$=Math.atan2(N/f,(me-P)/d);break e}}let W=Ie.PI,H=P-_,G=H*H,q=0,se=0,ue=P+_,ne=ue*ue,de=0;F=-_*P/(pe-ge),F>=-1&&F<=1&&(F=Math.acos(F),X=_*Math.cos(F)+P,N=E*Math.sin(F),I=X*X+N*N,Ine&&(se=F,ne=I,ue=X,de=N)),K<=(G+ne)*.5?(L=he-Math.atan2(q*r,H),$=W*r):(L=he-Math.atan2(de*r,ue),$=se*r)}let ie=Math.atan2(C,M)*x,re=e.arotation;L=(L-ie)*Ie.radDeg+v-re,L>180?L-=360:L<-180&&(L+=360),e.updateWorldTransformWith(h,u,re+L*c,p,m,0,0),re=t.arotation,$=(($+ie)*Ie.radDeg-t.ashearX)*x+y-re,$>180?$-=360:$<-180&&($+=360),t.updateWorldTransformWith(M,C,re+$*c,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY)}},bw=class extends pu{constructor(t){super(t,0,!1);S(this,"bones",new Array);S(this,"_target",null);S(this,"bendDirection",0);S(this,"compress",!1);S(this,"stretch",!1);S(this,"uniform",!1);S(this,"mix",0);S(this,"softness",0)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},ww=class extends pu{constructor(t){super(t,0,!1);S(this,"bones",new Array);S(this,"_target",null);S(this,"positionMode",ln.Fixed);S(this,"spacingMode",fs.Fixed);S(this,"rotateMode",ao.Chain);S(this,"offsetRotation",0);S(this,"position",0);S(this,"spacing",0);S(this,"mixRotate",0);S(this,"mixX",0);S(this,"mixY",0)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}};var ln;(function(i){i[i.Fixed=0]="Fixed",i[i.Percent=1]="Percent"})(ln||(ln={}));var fs;(function(i){i[i.Length=0]="Length",i[i.Fixed=1]="Fixed",i[i.Percent=2]="Percent",i[i.Proportional=3]="Proportional"})(fs||(fs={}));var ao;(function(i){i[i.Tangent=0]="Tangent",i[i.Chain=1]="Chain",i[i.ChainScale=2]="ChainScale"})(ao||(ao={}));var Ps;let cP=(Ps=class{constructor(e,t){S(this,"data");S(this,"bones");S(this,"target");S(this,"position",0);S(this,"spacing",0);S(this,"mixRotate",0);S(this,"mixX",0);S(this,"mixY",0);S(this,"spaces",new Array);S(this,"positions",new Array);S(this,"world",new Array);S(this,"curves",new Array);S(this,"lengths",new Array);S(this,"segments",new Array);S(this,"active",!1);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let n=0,r=e.bones.length;n0){M=u/M*p;for(let w=1;w0?Ie.degRad:-.01745329277777778}for(let M=0,C=3;M0){let I=w.a,k=w.b,B=w.c,D=w.d,X=0,N=0,U=0;if(a?X=m[C-1]:d[M+1]==0?X=m[C+2]:X=Math.atan2(F,E),X-=Math.atan2(B,I),x){N=Math.cos(X),U=Math.sin(X);let A=w.data.length;g+=(A*(N*I-U*B)-E)*s,v+=(A*(U*I+N*B)-F)*s}else X+=y;X>Ie.PI?X-=Ie.PI2:X<-3.1415927&&(X+=Ie.PI2),X*=s,N=Math.cos(X),U=Math.sin(X),w.a=N*I-U*B,w.b=N*k-U*D,w.c=U*I+N*B,w.d=U*k+N*D}w.updateAppliedTransform()}}computeWorldPositions(e,t,s){let n=this.target,r=this.position,o=this.spaces,a=Pe.setArraySize(this.positions,t*3+2),l=this.world,c=e.closed,h=e.worldVerticesLength,u=h/6,d=Ps.NONE;if(!e.constantSpeed){let A=e.lengths;u-=c?1:2;let P=A[u];this.data.positionMode==ln.Percent&&(r*=P);let O;switch(this.data.spacingMode){case fs.Percent:O=P;break;case fs.Proportional:O=P/t;break;default:O=1}l=Pe.setArraySize(this.world,8);for(let L=0,$=0,V=0;LP){d!=Ps.AFTER&&(d=Ps.AFTER,e.computeWorldVertices(n,h-6,4,l,0,2)),this.addAfterPosition(K-P,l,0,a,$);continue}for(;;V++){let ie=A[V];if(!(K>ie)){if(V==0)K/=ie;else{let re=A[V-1];K=(K-re)/(ie-re)}break}}V!=d&&(d=V,c&&V==u?(e.computeWorldVertices(n,h-4,4,l,0,2),e.computeWorldVertices(n,0,4,l,4,2)):e.computeWorldVertices(n,V*6+2,8,l,0,2)),this.addCurvePosition(K,l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],a,$,s||L>0&&j==0)}return a}c?(h+=2,l=Pe.setArraySize(this.world,h),e.computeWorldVertices(n,2,h-4,l,0,2),e.computeWorldVertices(n,0,2,l,h-4,2),l[h-2]=l[0],l[h-1]=l[1]):(u--,h-=4,l=Pe.setArraySize(this.world,h),e.computeWorldVertices(n,2,h,l,0,2));let f=Pe.setArraySize(this.curves,u),p=0,m=l[0],g=l[1],v=0,y=0,x=0,M=0,C=0,w=0,b=0,_=0,E=0,F=0,I=0,k=0,B=0,D=0;for(let A=0,P=2;Ap){this.addAfterPosition(V-p,l,h-4,a,P);continue}for(;;O++){let j=f[O];if(!(V>j)){if(O==0)V/=j;else{let K=f[O-1];V=(V-K)/(j-K)}break}}if(O!=d){d=O;let j=O*6;for(m=l[j],g=l[j+1],v=l[j+2],y=l[j+3],x=l[j+4],M=l[j+5],C=l[j+6],w=l[j+7],b=(m-v*2+x)*.03,_=(g-y*2+M)*.03,E=((v-x)*3-m+C)*.006,F=((y-M)*3-g+w)*.006,I=b*2+E,k=_*2+F,B=(v-m)*.3+b+E*.16666667,D=(y-g)*.3+_+F*.16666667,U=Math.sqrt(B*B+D*D),N[0]=U,j=1;j<8;j++)B+=I,D+=k,I+=E,k+=F,U+=Math.sqrt(B*B+D*D),N[j]=U;B+=I,D+=k,U+=Math.sqrt(B*B+D*D),N[8]=U,B+=I+E,D+=k+F,U+=Math.sqrt(B*B+D*D),N[9]=U,L=0}for(V*=U;;L++){let j=N[L];if(!(V>j)){if(L==0)V/=j;else{let K=N[L-1];V=L+(V-K)/(j-K)}break}}this.addCurvePosition(V*.1,m,g,v,y,x,M,C,w,a,P,s||A>0&&$==0)}return a}addBeforePosition(e,t,s,n,r){let o=t[s],a=t[s+1],l=t[s+2]-o,c=t[s+3]-a,h=Math.atan2(c,l);n[r]=o+e*Math.cos(h),n[r+1]=a+e*Math.sin(h),n[r+2]=h}addAfterPosition(e,t,s,n,r){let o=t[s+2],a=t[s+3],l=o-t[s],c=a-t[s+1],h=Math.atan2(c,l);n[r]=o+e*Math.cos(h),n[r+1]=a+e*Math.sin(h),n[r+2]=h}addCurvePosition(e,t,s,n,r,o,a,l,c,h,u,d){if(e==0||isNaN(e)){h[u]=t,h[u+1]=s,h[u+2]=Math.atan2(r-s,n-t);return}let f=e*e,p=f*e,m=1-e,g=m*m,v=g*m,y=m*e,x=y*3,M=m*x,C=x*e,w=t*v+n*M+o*C+l*p,b=s*v+r*M+a*C+c*p;h[u]=w,h[u+1]=b,d&&(e<.001?h[u+2]=Math.atan2(r-s,n-t):h[u+2]=Math.atan2(b-(s*g+r*y*2+a*f),w-(t*g+n*y*2+o*f)))}},S(Ps,"NONE",-1),S(Ps,"BEFORE",-2),S(Ps,"AFTER",-3),S(Ps,"epsilon",1e-5),Ps),hP=class{constructor(e,t){S(this,"data");S(this,"_bone",null);S(this,"inertia",0);S(this,"strength",0);S(this,"damping",0);S(this,"massInverse",0);S(this,"wind",0);S(this,"gravity",0);S(this,"mix",0);S(this,"_reset",!0);S(this,"ux",0);S(this,"uy",0);S(this,"cx",0);S(this,"cy",0);S(this,"tx",0);S(this,"ty",0);S(this,"xOffset",0);S(this,"xVelocity",0);S(this,"yOffset",0);S(this,"yVelocity",0);S(this,"rotateOffset",0);S(this,"rotateVelocity",0);S(this,"scaleOffset",0);S(this,"scaleVelocity",0);S(this,"active",!1);S(this,"skeleton");S(this,"remaining",0);S(this,"lastTime",0);this.data=e,this.skeleton=t,this.bone=t.bones[e.bone.index],this.inertia=e.inertia,this.strength=e.strength,this.damping=e.damping,this.massInverse=e.massInverse,this.wind=e.wind,this.gravity=e.gravity,this.mix=e.mix}set bone(e){this._bone=e}get bone(){if(this._bone)return this._bone;throw new Error("Bone not set.")}reset(){this.remaining=0,this.lastTime=this.skeleton.time,this._reset=!0,this.xOffset=0,this.xVelocity=0,this.yOffset=0,this.yVelocity=0,this.rotateOffset=0,this.rotateVelocity=0,this.scaleOffset=0,this.scaleVelocity=0}setToSetupPose(){const e=this.data;this.inertia=e.inertia,this.strength=e.strength,this.damping=e.damping,this.massInverse=e.massInverse,this.wind=e.wind,this.gravity=e.gravity,this.mix=e.mix}isActive(){return this.active}update(e){const t=this.mix;if(t==0)return;const s=this.data.x>0,n=this.data.y>0,r=this.data.rotate>0||this.data.shearX>0,o=this.data.scaleX>0,a=this.bone,l=a.data.length;switch(e){case cr.none:return;case cr.reset:this.reset();case cr.update:const c=this.skeleton,h=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=h,this.lastTime=c.time;const u=a.worldX,d=a.worldY;if(this._reset)this._reset=!1,this.ux=u,this.uy=d;else{let f=this.remaining,p=this.inertia,m=this.data.step,g=this.skeleton.data.referenceScale,v=-1,y=this.data.limit*h,x=y*Math.abs(c.scaleY);if(y*=Math.abs(c.scaleX),s||n){if(s){const M=(this.ux-u)*p;this.xOffset+=M>y?y:M<-y?-y:M,this.ux=u}if(n){const M=(this.uy-d)*p;this.yOffset+=M>x?x:M<-x?-x:M,this.uy=d}if(f>=m){v=Math.pow(this.damping,60*m);const M=this.massInverse*m,C=this.strength,w=this.wind*g*c.scaleX,b=this.gravity*g*c.scaleY;do s&&(this.xVelocity+=(w-this.xOffset*C)*M,this.xOffset+=this.xVelocity*m,this.xVelocity*=v),n&&(this.yVelocity-=(b+this.yOffset*C)*M,this.yOffset+=this.yVelocity*m,this.yVelocity*=v),f-=m;while(f>=m)}s&&(a.worldX+=this.xOffset*t*this.data.x),n&&(a.worldY+=this.yOffset*t*this.data.y)}if(r||o){let M=Math.atan2(a.c,a.a),C=0,w=0,b=0,_=this.cx-a.worldX,E=this.cy-a.worldY;if(_>y?_=y:_<-y&&(_=-y),E>x?E=x:E<-x&&(E=-x),r){b=(this.data.rotate+this.data.shearX)*t;let F=Math.atan2(E+this.ty,_+this.tx)-M-this.rotateOffset*b;this.rotateOffset+=(F-Math.ceil(F*Ie.invPI2-.5)*Ie.PI2)*p,F=this.rotateOffset*b+M,C=Math.cos(F),w=Math.sin(F),o&&(F=l*a.getWorldScaleX(),F>0&&(this.scaleOffset+=(_*C+E*w)*p/F))}else{C=Math.cos(M),w=Math.sin(M);const F=l*a.getWorldScaleX();F>0&&(this.scaleOffset+=(_*C+E*w)*p/F)}if(f=this.remaining,f>=m){v==-1&&(v=Math.pow(this.damping,60*m));const F=this.massInverse*m,I=this.strength,k=this.wind,B=Cp.yDown?-this.gravity:this.gravity,D=l/g;for(;;)if(f-=m,o&&(this.scaleVelocity+=(k*C-B*w-this.scaleOffset*I)*F,this.scaleOffset+=this.scaleVelocity*m,this.scaleVelocity*=v),r){if(this.rotateVelocity-=((k*w+B*C)*D+this.rotateOffset*I)*F,this.rotateOffset+=this.rotateVelocity*m,this.rotateVelocity*=v,f0){let f=0;this.data.rotate>0&&(f=c*this.data.rotate,h=Math.sin(f),u=Math.cos(f),d=a.b,a.b=u*d-h*a.d,a.d=h*d+u*a.d),f+=c*this.data.shearX,h=Math.sin(f),u=Math.cos(f),d=a.a,a.a=u*d-h*a.c,a.c=h*d+u*a.c}else c*=this.data.rotate,h=Math.sin(c),u=Math.cos(c),d=a.a,a.a=u*d-h*a.c,a.c=h*d+u*a.c,d=a.b,a.b=u*d-h*a.d,a.d=h*d+u*a.d}if(o){const c=1+this.scaleOffset*t*this.data.scaleX;a.a*=c,a.c*=c}e!=cr.pose&&(this.tx=l*a.a,this.ty=l*a.c),a.updateAppliedTransform()}translate(e,t){this.ux-=e,this.uy-=t,this.cx-=e,this.cy-=t}rotate(e,t,s){const n=s*Ie.degRad,r=Math.cos(n),o=Math.sin(n),a=this.cx-e,l=this.cy-t;this.translate(a*r-l*o-a,a*o+l*r-l)}},uP=class{constructor(e,t){S(this,"data");S(this,"bone");S(this,"color");S(this,"darkColor",null);S(this,"attachment",null);S(this,"attachmentState",0);S(this,"sequenceIndex",-1);S(this,"deform",new Array);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("bone cannot be null.");this.data=e,this.bone=t,this.color=new rt,this.darkColor=e.darkColor?new rt:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(e){this.attachment!=e&&((!(e instanceof jn)||!(this.attachment instanceof jn)||e.timelineAttachment!=this.attachment.timelineAttachment)&&(this.deform.length=0),this.attachment=e,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}},dP=class{constructor(e,t){S(this,"data");S(this,"bones");S(this,"target");S(this,"mixRotate",0);S(this,"mixX",0);S(this,"mixY",0);S(this,"mixScaleX",0);S(this,"mixScaleY",0);S(this,"mixShearY",0);S(this,"temp",new yh);S(this,"active",!1);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let n=0;n0?Ie.degRad:-.01745329277777778,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let v=0,y=g.length;vIe.PI?_-=Ie.PI2:_<-3.1415927&&(_+=Ie.PI2),_*=e;let E=Math.cos(_),F=Math.sin(_);x.a=E*M-F*w,x.b=E*C-F*b,x.c=F*M+E*w,x.d=F*C+E*b}if(a){let M=this.temp;l.localToWorld(M.set(this.data.offsetX,this.data.offsetY)),x.worldX+=(M.x-x.worldX)*t,x.worldY+=(M.y-x.worldY)*s}if(n!=0){let M=Math.sqrt(x.a*x.a+x.c*x.c);M!=0&&(M=(M+(Math.sqrt(c*c+u*u)-M+this.data.offsetScaleX)*n)/M),x.a*=M,x.c*=M}if(r!=0){let M=Math.sqrt(x.b*x.b+x.d*x.d);M!=0&&(M=(M+(Math.sqrt(h*h+d*d)-M+this.data.offsetScaleY)*r)/M),x.b*=M,x.d*=M}if(o>0){let M=x.b,C=x.d,w=Math.atan2(C,M),b=Math.atan2(d,h)-Math.atan2(u,c)-(w-Math.atan2(x.c,x.a));b>Ie.PI?b-=Ie.PI2:b<-3.1415927&&(b+=Ie.PI2),b=w+(b+m)*o;let _=Math.sqrt(M*M+C*C);x.b=Math.cos(b)*_,x.d=Math.sin(b)*_}x.updateAppliedTransform()}}applyRelativeWorld(){let e=this.mixRotate,t=this.mixX,s=this.mixY,n=this.mixScaleX,r=this.mixScaleY,o=this.mixShearY,a=t!=0||s!=0,l=this.target,c=l.a,h=l.b,u=l.c,d=l.d,f=c*d-h*u>0?Ie.degRad:-.01745329277777778,p=this.data.offsetRotation*f,m=this.data.offsetShearY*f,g=this.bones;for(let v=0,y=g.length;vIe.PI?_-=Ie.PI2:_<-3.1415927&&(_+=Ie.PI2),_*=e;let E=Math.cos(_),F=Math.sin(_);x.a=E*M-F*w,x.b=E*C-F*b,x.c=F*M+E*w,x.d=F*C+E*b}if(a){let M=this.temp;l.localToWorld(M.set(this.data.offsetX,this.data.offsetY)),x.worldX+=M.x*t,x.worldY+=M.y*s}if(n!=0){let M=(Math.sqrt(c*c+u*u)-1+this.data.offsetScaleX)*n+1;x.a*=M,x.c*=M}if(r!=0){let M=(Math.sqrt(h*h+d*d)-1+this.data.offsetScaleY)*r+1;x.b*=M,x.d*=M}if(o>0){let M=Math.atan2(d,h)-Math.atan2(u,c);M>Ie.PI?M-=Ie.PI2:M<-3.1415927&&(M+=Ie.PI2);let C=x.b,w=x.d;M=Math.atan2(w,C)+(M-Ie.PI/2+m)*o;let b=Math.sqrt(C*C+w*w);x.b=Math.cos(M)*b,x.d=Math.sin(M)*b}x.updateAppliedTransform()}}applyAbsoluteLocal(){let e=this.mixRotate,t=this.mixX,s=this.mixY,n=this.mixScaleX,r=this.mixScaleY,o=this.mixShearY,a=this.target,l=this.bones;for(let c=0,h=l.length;ct.data.name==e)??null}findTransformConstraint(e){if(!e)throw new Error("constraintName cannot be null.");return this.transformConstraints.find(t=>t.data.name==e)??null}findPathConstraint(e){if(!e)throw new Error("constraintName cannot be null.");return this.pathConstraints.find(t=>t.data.name==e)??null}findPhysicsConstraint(e){if(e==null)throw new Error("constraintName cannot be null.");return this.physicsConstraints.find(t=>t.data.name==e)??null}getBoundsRect(e){let t=new yh,s=new yh;return this.getBounds(t,s,void 0,e),{x:t.x,y:t.y,width:s.x,height:s.y}}getBounds(e,t,s=new Array(2),n=null){if(!e)throw new Error("offset cannot be null.");if(!t)throw new Error("size cannot be null.");let r=this.drawOrder,o=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY;for(let h=0,u=r.length;h=n.length&&(n.length=e+1),n[e]||(n[e]={}),n[e][t]=s}addSkin(e){for(let n=0;n= 0.");if(!t)throw new Error("name cannot be null.");if(!s)throw new Error("boneData cannot be null.");this.index=e,this.name=t,this.boneData=s}};var gr;(function(i){i[i.Normal=0]="Normal",i[i.Additive=1]="Additive",i[i.Multiply=2]="Multiply",i[i.Screen=3]="Screen"})(gr||(gr={}));let Tw=class extends pu{constructor(t){super(t,0,!1);S(this,"bones",new Array);S(this,"_target",null);S(this,"mixRotate",0);S(this,"mixX",0);S(this,"mixY",0);S(this,"mixScaleX",0);S(this,"mixScaleY",0);S(this,"mixShearY",0);S(this,"offsetRotation",0);S(this,"offsetX",0);S(this,"offsetY",0);S(this,"offsetScaleX",0);S(this,"offsetScaleY",0);S(this,"offsetShearY",0);S(this,"relative",!1);S(this,"local",!1)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},bm=class{constructor(e){S(this,"scale",1);S(this,"attachmentLoader");S(this,"linkedMeshes",new Array);this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,s=new bh;s.name="";let n=new fP(e),r=n.readInt32(),o=n.readInt32();s.hash=o==0&&r==0?null:o.toString(16)+r.toString(16),s.version=n.readString(),s.x=n.readFloat(),s.y=n.readFloat(),s.width=n.readFloat(),s.height=n.readFloat(),s.referenceScale=n.readFloat()*t;let a=n.readBoolean();a&&(s.fps=n.readFloat(),s.imagesPath=n.readString(),s.audioPath=n.readString());let l=0;l=n.readInt(!0);for(let h=0;h>1&3,f.rotateMode=p>>3&3,(p&128)!=0&&(f.offsetRotation=n.readFloat()),f.position=n.readFloat(),f.positionMode==ln.Fixed&&(f.position*=t),f.spacing=n.readFloat(),(f.spacingMode==fs.Length||f.spacingMode==fs.Fixed)&&(f.spacing*=t),f.mixRotate=n.readFloat(),f.mixX=n.readFloat(),f.mixY=n.readFloat(),s.pathConstraints.push(f)}l=n.readInt(!0);for(let h=0,u;h>4,e.readFloat())}n.push(w);break}}}}}let o=e.readInt(!0);if(o>0){let c=new Qa(o),h=s.slots.length;for(let u=0;u=0;y--)p[y]=-1;let m=Pe.newArray(h-f,0),g=0,v=0;for(let y=0;y=0;y--)p[y]==-1&&(p[y]=m[--v]);c.setFrame(u,d,p)}n.push(c)}let a=e.readInt(!0);if(a>0){let c=new _p(a);for(let h=0;h>>1^-(s&1)}readStringRef(){let e=this.readInt(!0);return e==0?null:this.strings[e-1]}readString(){let e=this.readInt(!0);switch(e){case 0:return null;case 1:return""}e--;let t="";for(let s=0;s>4){case 12:case 13:t+=String.fromCharCode((n&31)<<6|this.readByte()&63),s+=2;break;case 14:t+=String.fromCharCode((n&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),s+=3;break;default:t+=String.fromCharCode(n),s++}}return t}readFloat(){let e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!=0}},mP=class{constructor(e,t,s,n,r){S(this,"parent");S(this,"skinIndex");S(this,"slotIndex");S(this,"mesh");S(this,"inheritTimeline");this.mesh=e,this.skinIndex=t,this.slotIndex=s,this.parent=n,this.inheritTimeline=r}},pP=class{constructor(e=null,t=null,s=0){S(this,"bones");S(this,"vertices");S(this,"length");this.bones=e,this.vertices=t,this.length=s}};var wn;(function(i){i[i.Region=0]="Region",i[i.BoundingBox=1]="BoundingBox",i[i.Mesh=2]="Mesh",i[i.LinkedMesh=3]="LinkedMesh",i[i.Path=4]="Path",i[i.Point=5]="Point",i[i.Clipping=6]="Clipping"})(wn||(wn={}));function Es(i,e,t){let s=i.readFloat(),n=i.readFloat()*t;for(let r=0,o=0,a=e.getFrameCount()-1;e.setFrame(r,s,n),r!=a;r++){let l=i.readFloat(),c=i.readFloat()*t;switch(i.readByte()){case ji:e.setStepped(r);break;case Hi:ut(i,e,o++,r,0,s,l,n,c,t)}s=l,n=c}return e}function hf(i,e,t){let s=i.readFloat(),n=i.readFloat()*t,r=i.readFloat()*t;for(let o=0,a=0,l=e.getFrameCount()-1;e.setFrame(o,s,n,r),o!=l;o++){let c=i.readFloat(),h=i.readFloat()*t,u=i.readFloat()*t;switch(i.readByte()){case ji:e.setStepped(o);break;case Hi:ut(i,e,a++,o,0,s,c,n,h,t),ut(i,e,a++,o,1,s,c,r,u,t)}s=c,n=h,r=u}return e}function ut(i,e,t,s,n,r,o,a,l,c){e.setBezier(t,s,n,r,a,i.readFloat(),i.readFloat()*c,i.readFloat(),i.readFloat()*c,o,l)}const gP=0,vP=1,yP=2,xP=3,bP=4,wP=5,SP=6,MP=7,TP=8,_P=9,CP=10,AP=0,EP=1,IP=2,RP=3,PP=4,kP=5,FP=0,OP=1,LP=0,BP=1,NP=2,DP=0,UP=1,$P=2,XP=4,VP=5,YP=6,GP=7,jP=8,ji=1,Hi=2;class Hs{constructor(){S(this,"convexPolygons",new Array);S(this,"convexPolygonsIndices",new Array);S(this,"indicesArray",new Array);S(this,"isConcaveArray",new Array);S(this,"triangles",new Array);S(this,"polygonPool",new vh(()=>new Array));S(this,"polygonIndicesPool",new vh(()=>new Array))}triangulate(e){let t=e,s=e.length>>1,n=this.indicesArray;n.length=0;for(let a=0;a3;){let a=s-1,l=0,c=1;for(;;){e:if(!r[l]){let d=n[a]<<1,f=n[l]<<1,p=n[c]<<1,m=t[d],g=t[d+1],v=t[f],y=t[f+1],x=t[p],M=t[p+1];for(let C=(c+1)%s;C!=a;C=(C+1)%s){if(!r[C])continue;let w=n[C]<<1,b=t[w],_=t[w+1];if(Hs.positiveArea(x,M,m,g,b,_)&&Hs.positiveArea(m,g,v,y,b,_)&&Hs.positiveArea(v,y,x,M,b,_))break e}break}if(c==0){do{if(!r[l])break;l--}while(l>0);break}a=l,l=c,c=(c+1)%s}o.push(n[(s+l-1)%s]),o.push(n[l]),o.push(n[(l+1)%s]),n.splice(l,1),r.splice(l,1),s--;let h=(s+l-1)%s,u=l==s?0:l;r[h]=Hs.isConcave(h,s,t,n),r[u]=Hs.isConcave(u,s,t,n)}return s==3&&(o.push(n[2]),o.push(n[0]),o.push(n[1])),o}decompose(e,t){let s=e,n=this.convexPolygons;this.polygonPool.freeAll(n),n.length=0;let r=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(r),r.length=0;let o=this.polygonIndicesPool.obtain();o.length=0;let a=this.polygonPool.obtain();a.length=0;let l=-1,c=0;for(let h=0,u=t.length;h0?(n.push(a),r.push(o)):(this.polygonPool.free(a),this.polygonIndicesPool.free(o)),a=this.polygonPool.obtain(),a.length=0,a.push(m),a.push(g),a.push(v),a.push(y),a.push(x),a.push(M),o=this.polygonIndicesPool.obtain(),o.length=0,o.push(d),o.push(f),o.push(p),c=Hs.winding(m,g,v,y,x,M),l=d)}a.length>0&&(n.push(a),r.push(o));for(let h=0,u=n.length;h=0;h--)a=n[h],a.length==0&&(n.splice(h,1),this.polygonPool.free(a),o=r[h],r.splice(h,1),this.polygonIndicesPool.free(o));return n}static isConcave(e,t,s,n){let r=n[(t+e-1)%t]<<1,o=n[e]<<1,a=n[(e+1)%t]<<1;return!this.positiveArea(s[r],s[r+1],s[o],s[o+1],s[a],s[a+1])}static positiveArea(e,t,s,n,r,o){return e*(o-n)+s*(t-o)+r*(n-t)>=0}static winding(e,t,s,n,r,o){let a=s-e,l=n-t;return r*l-o*a+a*t-e*l>=0?1:-1}}class wh{constructor(){S(this,"triangulator",new Hs);S(this,"clippingPolygon",new Array);S(this,"clipOutput",new Array);S(this,"clippedVertices",new Array);S(this,"clippedUVs",new Array);S(this,"clippedTriangles",new Array);S(this,"scratch",new Array);S(this,"clipAttachment",null);S(this,"clippingPolygons",null)}clipStart(e,t){if(this.clipAttachment)return 0;this.clipAttachment=t;let s=t.worldVerticesLength,n=Pe.setArraySize(this.clippingPolygon,s);t.computeWorldVertices(e,0,s,n,0,2);let r=this.clippingPolygon;wh.makeClockwise(r);let o=this.clippingPolygons=this.triangulator.decompose(r,this.triangulator.triangulate(r));for(let a=0,l=o.length;a>1,w=this.clipOutput,b=Pe.setArraySize(r,x+C*2);for(let E=0;E>1,$=this.clipOutput,V=Pe.setArraySize(c,D+L*f);for(let K=0;K>1,P=this.clipOutput,O=Pe.setArraySize(o,I+A*2),L=Pe.setArraySize(a,I+A*2);for(let V=0;V=2?(u=l,l=this.scratch):u=this.scratch,u.length=0,u.push(e),u.push(t),u.push(s),u.push(n),u.push(r),u.push(o),u.push(e),u.push(t),l.length=0;let d=a.length-4,f=a;for(let p=0;;p+=2){let m=f[p],g=f[p+1],v=m-f[p+2],y=g-f[p+3],x=l.length,M=u;for(let w=0,b=u.length-2;wv*(g-I),B=y*(m-_)-v*(g-E);if(B>0){if(k){l.push(F),l.push(I);continue}let D=F-_,X=I-E,N=B/(D*y-X*v);if(N>=0&&N<=1)l.push(_+D*N),l.push(E+X*N);else{l.push(F),l.push(I);continue}}else if(k){let D=F-_,X=I-E,N=B/(D*y-X*v);if(N>=0&&N<=1)l.push(_+D*N),l.push(E+X*N),l.push(F),l.push(I);else{l.push(F),l.push(I);continue}}h=!0}if(x==l.length)return c.length=0,!0;if(l.push(l[0]),l.push(l[1]),p==d)break;let C=l;l=u,l.length=0,u=C}if(c!=l){c.length=0;for(let p=0,m=l.length-2;p>1;c0){let h=s.findPhysicsConstraint(a);if(!h)throw new Error("Physics constraint not found: "+a);c=s.physicsConstraints.indexOf(h)}for(let h in l){let u=l[h],d=u[0];if(!d)continue;let f=u.length;if(h=="reset"){const m=new aw(f,c);for(let g=0;d!=null;d=u[g+1],g++)m.setFrame(g,ee(d,"time",0));r.push(m);continue}let p;if(h=="inertia")p=new ew(f,f,c);else if(h=="strength")p=new tw(f,f,c);else if(h=="damping")p=new sw(f,f,c);else if(h=="mass")p=new iw(f,f,c);else if(h=="wind")p=new nw(f,f,c);else if(h=="gravity")p=new rw(f,f,c);else if(h=="mix")p=new ow(f,f,c);else continue;r.push(bi(u,p,0,1))}}if(e.attachments)for(let a in e.attachments){let l=e.attachments[a],c=s.findSkin(a);if(!c)throw new Error("Skin not found: "+a);for(let h in l){let u=l[h],d=s.findSlot(h);if(!d)throw new Error("Slot not found: "+h);let f=d.index;for(let p in u){let m=u[p],g=c.getAttachment(f,p);for(let v in m){let y=m[v],x=y[0];if(x){if(v=="deform"){let M=g.bones,C=g.vertices,w=M?C.length/3*2:C.length,b=new z1(y.length,y.length,f,g),_=ee(x,"time",0);for(let E=0,F=0;;E++){let I,k=ee(x,"vertices",null);if(!k)I=M?Pe.newFloatArray(w):C;else{I=Pe.newFloatArray(w);let N=ee(x,"offset",0);if(Pe.arrayCopy(k,0,I,N,k.length),n!=1)for(let U=N,A=U+k.length;U=0;v--)d[v]==-1&&(d[v]=p[--g])}a.setFrame(c,ee(u,"time",0),d)}r.push(a)}if(e.events){let a=new _p(e.events.length),l=0;for(let c=0;c"u"&&(Math.fround=(function(i){return function(e){return i[0]=e,i[0]}})(new Float32Array(1)));if(typeof window<"u"&&window.PIXI){let i=window.require;window.require=e=>{if(i)return i(e);if(e.startsWith("@pixi/"))return window.PIXI}}const Mn=class Mn extends nP{constructor(t){super(t.resource.source);S(this,"texture");this.texture=ze.from(t)}static from(t){return Mn.textureMap.has(t)?Mn.textureMap.get(t):new Mn(t)}setFilters(t,s){this.texture.baseTexture.scaleMode=Mn.toPixiTextureFilter(t),this.texture.baseTexture.mipmap=Mn.toPixiMipMap(t)}setWraps(t,s){this.texture.baseTexture.wrapMode=Mn.toPixiTextureWrap(t)}dispose(){this.texture.destroy()}static toPixiTextureFilter(t){switch(t){case ys.Nearest:case ys.MipMapNearestLinear:case ys.MipMapNearestNearest:return Ci.NEAREST;case ys.Linear:case ys.MipMapLinearLinear:case ys.MipMapLinearNearest:return Ci.LINEAR;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiMipMap(t){switch(t){case ys.Nearest:case ys.Linear:return gi.OFF;case ys.MipMapNearestLinear:case ys.MipMapNearestNearest:case ys.MipMapLinearLinear:case ys.MipMapLinearNearest:return gi.ON;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiTextureWrap(t){switch(t){case Un.ClampToEdge:return Ii.CLAMP;case Un.MirroredRepeat:return Ii.MIRRORED_REPEAT;case Un.Repeat:return Ii.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(t)}`)}}static toPixiBlending(t){switch(t){case gr.Normal:return He.NORMAL;case gr.Additive:return He.ADD;case gr.Multiply:return He.MULTIPLY;case gr.Screen:return He.SCREEN;default:throw new Error(`Unknown blendMode: ${String(t)}`)}}};S(Mn,"textureMap",new Map);let fo=Mn;const Tn=class Tn extends xl{constructor(){const t=new xp;t.getBuffer("aVertexPosition").static=!1,t.getBuffer("aTextureCoord").static=!1;const s=new fh(ze.EMPTY);super(t,s);S(this,"name","");S(this,"warnedTwoTint",!1)}updateFromSpineData(t,s,n,r,o,a,l,c){var v,y;this.texture=t.texture;const h=o/(c?12:8)*2,u=this.geometry.getBuffer("aTextureCoord");((v=u.data)==null?void 0:v.length)!==h&&(u.data=new Float32Array(h));const d=this.geometry.getBuffer("aVertexPosition");((y=d.data)==null?void 0:y.length)!==h&&(d.data=new Float32Array(h));let f=0,p=u.data,m=d.data;for(let x=0;xnew wm);S(this,"beforeUpdateWorldTransforms",()=>{});S(this,"afterUpdateWorldTransforms",()=>{});S(this,"_autoUpdate",!1);S(this,"_ticker",Gs.shared);S(this,"meshesCache",new Map);S(this,"lightColor",new rt);S(this,"darkColor",new rt);S(this,"_boundsProvider");S(this,"_boundsPoint",new vt);S(this,"_boundsSpineID",-1);S(this,"_boundsSpineDirty",!0);S(this,"slotsObject",new Map);S(this,"verticesCache",Pe.newFloatArray(1024));S(this,"clippingSlotToPixiMasks",{});S(this,"currentClippingSlot");const n=t instanceof bh?t:t.skeletonData;this.skeleton=new Cp(n);const r=new iP(n);this.state=new JR(r),(t==null?void 0:t.darkTint)!==void 0||(s==null?void 0:s.slotMeshFactory)===void 0?(this.darkTint=(t==null?void 0:t.darkTint)===void 0?this.skeleton.slots.some(o=>!!o.data.darkColor):t==null?void 0:t.darkTint,this.darkTint&&(this.slotMeshFactory=()=>new el)):this.initializeMeshFactory(s==null?void 0:s.slotMeshFactory),t!=null&&t.ticker&&(this._ticker=t.ticker),this.autoUpdate=(t==null?void 0:t.autoUpdate)??!0,this.boundsProvider=t.boundsProvider}get debug(){return this._debug}set debug(t){this._debug&&this._debug.unregisterSpine(this),t&&t.registerSpine(this),this._debug=t}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t&&!this._autoUpdate?this._ticker.add(this.internalUpdate,this):!t&&this._autoUpdate&&this._ticker.remove(this.internalUpdate,this),this._autoUpdate=t}get ticker(){return this._ticker}set ticker(t){t=t??Gs.shared,this._ticker!==t&&(this._autoUpdate&&(this._ticker.remove(this.internalUpdate,this),t.add(this.internalUpdate,this)),this._ticker=t)}get boundsProvider(){return this._boundsProvider}set boundsProvider(t){this._boundsProvider=t,t?(this._boundsSpineID=-1,this._boundsSpineDirty=!0,this.interactiveChildren=!1):(this.interactiveChildren=!0,this.hitArea=null),this.hasNeverUpdated||this.calculateBounds()}initializeMeshFactory(t){if(t){this.slotMeshFactory=t;const s=this.slotMeshFactory();s instanceof el&&(this.darkTint=!0),s.destroy()}else for(let s=0;snew el,this.darkTint=!0;break}}update(t){this.internalUpdate(0,t)}internalUpdate(t,s){this.hasNeverUpdated=!1;const n=s??this._ticker.deltaMS/1e3;this.state.update(n),this.state.apply(this.skeleton),this.beforeUpdateWorldTransforms(this),this.skeleton.update(n),this.skeleton.updateWorldTransform(cr.update),this.afterUpdateWorldTransforms(this)}updateTransform(){var t;this.renderMeshes(),this.sortChildren(),(t=this.debug)==null||t.renderDebug(this),super.updateTransform()}destroy(t){var s;this.autoUpdate&&(this.autoUpdate=!1),this._ticker=null;for(const[,n]of this.meshesCache)n==null||n.destroy();this.state.clearListeners(),this.debug=void 0,this.meshesCache.clear(),this.slotsObject.clear();for(let n in this.clippingSlotToPixiMasks)(s=this.clippingSlotToPixiMasks[n].mask)==null||s.destroy(),delete this.clippingSlotToPixiMasks[n];super.destroy(t)}resetMeshes(){for(const[,t]of this.meshesCache)t.zIndex=-1,t.visible=!1}_calculateBounds(){this.hasNeverUpdated&&(this.internalUpdate(0,0),this.renderMeshes())}hasMeshForSlot(t){return this.meshesCache.has(t)}getMeshForSlot(t){if(this.hasMeshForSlot(t)){let s=this.meshesCache.get(t);return s.visible=!0,s}else{let s=this.slotMeshFactory();return this.addChild(s),this.meshesCache.set(t,s),s}}getSlotFromRef(t){let s;if(typeof t=="number"?s=this.skeleton.slots[t]:typeof t=="string"?s=this.skeleton.findSlot(t):s=t,!s)throw new Error(`No slot found with the given slot reference: ${t}`);return s}addSlotObject(t,s,n){var a;let r=this.getSlotFromRef(t);const o=(a=this.slotsObject.get(r))==null?void 0:a.container;if(!(o&&o===s)){for(const[l,{container:c}]of this.slotsObject)if(l!==r&&c===s){this.removeSlotObject(l,s);break}o&&this.removeChild(o),this.slotsObject.set(r,{container:s,followAttachmentTimeline:(n==null?void 0:n.followAttachmentTimeline)||!1,followSlotColor:(n==null?void 0:n.followSlotColor)||!1}),this.addChild(s)}}getSlotObject(t){const s=this.slotsObject.get(this.getSlotFromRef(t));return s?s.container:void 0}removeSlotObject(t,s){var o;let n=this.getSlotFromRef(t),r=(o=this.slotsObject.get(n))==null?void 0:o.container;r&&(s&&s!==r||(this.removeChild(r),this.slotsObject.delete(n)))}removeSlotObjects(){for(const[,t]of this.slotsObject)t.container.removeFromParent();this.slotsObject.clear()}updateSlotObject(t,s,n){const{container:r,followAttachmentTimeline:o}=t,a=o?!!s.attachment:!0;if(r.visible=this.skeleton.drawOrder.includes(s)&&a,r.visible){let l=s.bone;const c=r.localTransform;c.a=l.a,c.b=l.c,c.c=-l.b,c.d=-l.d,c.tx=l.worldX,c.ty=l.worldY,r.transform.setFromMatrix(c),r.zIndex=n,r.alpha=this.skeleton.color.a*s.color.a,t.followSlotColor&&this.setSlotObjectTint(r,255*this.skeleton.color.r*s.color.r<<16|255*this.skeleton.color.g*s.color.g<<8|255*this.skeleton.color.b*s.color.b)}}setSlotObjectTint(t,s){const n=t;"tint"in n&&(n.tint=s);for(const r of n.children??[])this.setSlotObjectTint(r,s)}updateAndSetPixiMask(t,s){var a,l;const n=t.attachment;if(n&&n instanceof sa){const c=(a=this.clippingSlotToPixiMasks)[l=t.data.name]||(a[l]={slot:t,vertices:new Array});c.maskComputed=!1,this.currentClippingSlot=c;return}let r=this.currentClippingSlot;const o=this.slotsObject.get(t);if(r&&o){let c=r.mask;if(c||(c=zv.obtain(),r.mask=c,this.addChild(c)),!r.maskComputed){let h=r.slot,u=h.attachment;r.maskComputed=!0;const d=u.worldVerticesLength,f=r.vertices;u.computeWorldVertices(h,0,d,f,0,2),c.clear().lineStyle(0).beginFill(0).drawPolygon(f).endFill()}o.container.mask=c}else o!=null&&o.container.mask&&(o.container.mask=null);if(r&&r.slot.attachment.endSlot==t.data&&(this.currentClippingSlot=void 0),s){for(const c in this.clippingSlotToPixiMasks){const h=this.clippingSlotToPixiMasks[c];(!(h.slot.attachment instanceof sa)||!h.maskComputed)&&h.mask&&(this.removeChild(h.mask),zv.free(h.mask),h.mask=void 0)}this.currentClippingSlot=void 0}}renderMeshes(){var r,o;this.resetMeshes();let t=null,s=null;const n=this.skeleton.drawOrder;for(let a=0,l=n.length,c=0;a>1)*p,y>this.verticesCache.length&&(this.verticesCache=Pe.newFloatArray(y)),x.computeWorldVertices(h,0,x.worldVerticesLength,this.verticesCache,0,p),t=x.triangles,s=x.uvs,v=(o=x.region)==null?void 0:o.texture}else if(m instanceof sa){wt.clipper.clipStart(h,m);continue}else{this.hasMeshForSlot(h)&&(this.getMeshForSlot(h).visible=!1),wt.clipper.clipEndWithSlot(h);continue}if(v!=null){const M=h.bone.skeleton.color,C=h.color,w=M.a*C.a*g.a;this.lightColor.set(M.r*C.r*g.r,M.g*C.g*g.g,M.b*C.b*g.b,w),h.darkColor!=null?this.darkColor.set(h.darkColor.r,h.darkColor.g,h.darkColor.b,1):this.darkColor.set(0,0,0,1);let b,_,E,F;if(wt.clipper.isClipping())wt.clipper.clipTriangles(this.verticesCache,t,t.length,s,this.lightColor,this.darkColor,f),b=wt.clipper.clippedVertices,_=b.length,E=wt.clipper.clippedTriangles,F=E.length;else{const k=this.verticesCache;for(let B=2,D=0,X=y;Bnew Ds);Cp.yDown=!0;const yc="spineTextureAtlasLoader",JP={extension:ke.Asset,resolver:{test:i=>qs(i,".atlas"),parse:i=>{var t,s;const e=i.split(".");return{resolution:parseFloat(((s=(t=Le.RETINA_PREFIX)==null?void 0:t.exec(i))==null?void 0:s[1])??"1"),format:e[e.length-2],src:i}}},loader:{name:yc,extension:{type:ke.LoadParser,priority:ii.Normal,name:yc},test(i){return qs(i,".atlas")},async load(i){const e=await Le.ADAPTER.fetch(i);if(!e.ok)throw new Error(`[${yc}] Failed to fetch ${i}: ${e.status} ${e.statusText}`);return await e.text()},testParse(i,e){const t=qs(e.src,".atlas"),s=typeof i=="string",n=e.loadParser===yc;return Promise.resolve((t||n)&&s)},unload(i){i.dispose()},async parse(i,e,t){var l;const s=e.data||{};let n=ts.dirname(e.src);n&&n.lastIndexOf("/")!==n.length-1&&(n+="/");const r=new dw(i);if(s.images instanceof Qe||typeof s.images=="string"){const c=s.images;s.images={},s.images[r.pages[0].name]=c}const o=[];let a=!0;for(const c of t.parsers)if(c.name=="loadTextures"){a=(l=c.config)==null?void 0:l.preferCreateImageBitmap;break}rn.setPreferences({preferCreateImageBitmap:!1});for(const c of r.pages){const h=c.name,u=s!=null&&s.images?s.images[h]:void 0;if(u instanceof Qe)c.setTexture(fo.from(u));else{const d=u??ts.normalize([...n.split(ts.sep),h].join(ts.sep)),f={src:lh(d,e.src),data:{...s.imageMetadata,alphaMode:c.pma?bs.PMA:bs.UNPACK}},p=t.load(f).then(m=>{c.setTexture(fo.from(m.baseTexture))});o.push(p)}}return await Promise.all(o),rn.setPreferences({preferCreateImageBitmap:a}),r}}};Xe.add(JP);const xc="spineSkeletonLoader";function QP(i){return i.hasOwnProperty("bones")}function ek(i){return i instanceof Uint8Array}const tk={extension:ke.Asset,loader:{name:xc,extension:{type:ke.LoadParser,priority:ii.Normal,name:xc},test(i){return qs(i,".skel")},async load(i){const e=await Le.ADAPTER.fetch(i);if(!e.ok)throw new Error(`[${xc}] Failed to fetch ${i}: ${e.status} ${e.statusText}`);return new Uint8Array(await e.arrayBuffer())},testParse(i,e){const t=qs(e.src,".json")&&QP(i),s=qs(e.src,".skel")&&ek(i),n=e.loadParser===xc;return Promise.resolve(t||s||n)}}};Xe.add(tk);class sk extends hn{constructor(t=!1){super();S(this,"_buffer");S(this,"_indexBuffer");this._buffer=new Ut(void 0,t,!1),this._indexBuffer=new Ut(void 0,t,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,$e.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,$e.FLOAT).addAttribute("aColor",this._buffer,4,!0,$e.UNSIGNED_BYTE).addAttribute("aDarkColor",this._buffer,4,!0,$e.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,$e.FLOAT).addIndex(this._indexBuffer)}}const ik=` -precision highp float; -attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; -attribute vec4 aColor; -attribute vec4 aDarkColor; -attribute float aTextureId; - -uniform mat3 projectionMatrix; -uniform mat3 translationMatrix; -uniform vec4 tint; - -varying vec2 vTextureCoord; -varying vec4 vColor; -varying vec4 vDarkColor; -varying float vTextureId; - -void main(void){ - gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - - vTextureCoord = aTextureCoord; - vTextureId = aTextureId; - vColor = aColor * tint; - vDarkColor = aDarkColor * tint; - -} -`,nk=` -varying vec2 vTextureCoord; -varying vec4 vColor; -varying vec4 vDarkColor; -varying float vTextureId; -uniform sampler2D uSamplers[%count%]; - -void main(void){ - vec4 color; - %forloop% - - - gl_FragColor.a = color.a * vColor.a; - gl_FragColor.rgb = ((color.a - 1.0) * vDarkColor.a + 1.0 - color.rgb) * vDarkColor.rgb + color.rgb * vColor.rgb; -} -`;class _w extends ir{constructor(e){super(e),this.shaderGenerator=new pb(ik,nk),this.geometryClass=sk,this.vertexSize=7}packInterleavedGeometry(e,t,s,n,r){const{uint32View:o,float32View:a}=t,l=n/this.vertexSize,c=e.uvs,h=e.indices,u=e.vertexData,d=e._texture.baseTexture._batchLocation,f=Math.min(e.worldAlpha,1),p=Et.shared.setValue(e._tintRGB).toPremultiplied(f,!0),m=Et.shared.setValue(e._darkTintRGB).premultiply(f,!0).toPremultiplied(1,!1);for(let g=0;g0){let o=function(c){return Promise.all(c.map(h=>Promise.resolve(h).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));n=o(t.map(c=>{if(c=ck(c),c in qv)return;qv[c]=!0;const h=c.endsWith(".css"),u=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${u}`))return;const d=document.createElement("link");if(d.rel=h?"stylesheet":lk,h||(d.as="script"),d.crossOrigin="",d.href=c,l&&d.setAttribute("nonce",l),document.head.appendChild(d),h)return new Promise((f,p)=>{d.addEventListener("load",f),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return n.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})};async function Aw(){const[i,e]=await Promise.all([Kv(()=>import("./index-BS4GpQRH.js"),[]),Kv(()=>import("./index-CUwqGGwd.js"),__vite__mapDeps([0,1]))]);return{core:i,pixi:e}}async function hk(i,e,t){const{core:s,pixi:n}=await Aw(),r=new s.TextureAtlas(e);return Ap(r,t,n.SpineTexture),{skeletonData:new s.SkeletonJson(new s.AtlasAttachmentLoader(r)).readSkeletonData(i),SpineClass:n.Spine}}async function uk(i,e,t){const{core:s,pixi:n}=await Aw(),r=new s.TextureAtlas(e);return Ap(r,t,n.SpineTexture),{skeletonData:new s.SkeletonBinary(new s.AtlasAttachmentLoader(r)).readSkeletonData(i),SpineClass:n.Spine}}function hr(i,e,t){const s=Number(i[e]);return Number.isFinite(s)?s:t}function zs(i,e,t,s){i[e]==null&&(i[e]=hr(i,t,s))}function Ep(i,e,t){if(typeof i.curve!="number")return;const s=hr(i,"time",0),r=hr(e,"time",0)-s,o=i.curve,a=hr(i,"c2",0),l=hr(i,"c3",1),c=hr(i,"c4",1);i.curve=t.flatMap(([h,u])=>[s+r*o,h+(u-h)*a,s+r*l,h+(u-h)*c]),delete i.c2,delete i.c3,delete i.c4}function vr(i,e){if(Array.isArray(i))for(let t=0;t[hr(s,r,o),hr(n,r,o)]))}}function dk(i){if(Array.isArray(i))for(let e=0;eNumber.parseInt(s.slice(r,r+2),16)/255);return e?n:n.slice(0,3)}function Zv(i,e){if(Array.isArray(i))for(let t=0;t[a,o[l]]))}}function fk(i){for(const e of i.bones||[])e.inherit==null&&e.transform!=null&&(e.inherit=e.transform);for(const e of i.transform||[])zs(e,"mixRotate","rotateMix",1),zs(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX),zs(e,"mixScaleX","scaleMix",1),e.mixScaleY==null&&(e.mixScaleY=e.mixScaleX),zs(e,"mixShearY","shearMix",1);for(const e of i.path||[])zs(e,"mixRotate","rotateMix",1),zs(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX)}function mk(i){for(const e of i.skins||[])for(const t of Object.values(e.attachments||{}))for(const s of Object.values(t||{}))s.parent!=null&&s.timelines==null&&s.deform!=null&&(s.timelines=s.deform)}function pk(i){for(const e of Object.values(i.slots||{}))e.color&&!e.rgba&&(e.rgba=e.color,delete e.color),e.twoColor&&!e.rgba2&&(e.rgba2=e.twoColor,delete e.twoColor),Zv(e.rgba,!1),Zv(e.rgba2,!0)}function gk(i){for(const e of Object.values(i.bones||{})){for(const t of e.rotate||[])zs(t,"value","angle",0);vr(e.rotate,[{key:"value",fallback:0}]),vr(e.translate,[{key:"x",fallback:0},{key:"y",fallback:0}]),vr(e.scale,[{key:"x",fallback:1},{key:"y",fallback:1}]),vr(e.shear,[{key:"x",fallback:0},{key:"y",fallback:0}])}}function vk(i){for(const e of Object.values(i.ik||{}))vr(e,[{key:"mix",fallback:1},{key:"softness",fallback:0}])}function yk(i){for(const e of Object.values(i.transform||{})){for(const t of e)zs(t,"mixRotate","rotateMix",1),zs(t,"mixX","translateMix",1),t.mixY==null&&(t.mixY=t.mixX),zs(t,"mixScaleX","scaleMix",1),t.mixScaleY==null&&(t.mixScaleY=t.mixScaleX),zs(t,"mixShearY","shearMix",1);vr(e,[{key:"mixRotate",fallback:1},{key:"mixX",fallback:1},{key:"mixY",fallback:1},{key:"mixScaleX",fallback:1},{key:"mixScaleY",fallback:1},{key:"mixShearY",fallback:1}])}}function xk(i){for(const e of Object.values(i.path||{})){for(const s of["position","spacing"]){const n=e[s];for(const r of n||[])zs(r,"value",s,0);vr(n,[{key:"value",fallback:0}])}const t=e.mix;for(const s of t||[])zs(s,"mixRotate","rotateMix",1),zs(s,"mixX","translateMix",1),s.mixY==null&&(s.mixY=s.mixX);vr(t,[{key:"mixRotate",fallback:1},{key:"mixX",fallback:1},{key:"mixY",fallback:1}])}}function bk(i){if(!i.deform)return;const e=i.attachments||(i.attachments={});for(const[t,s]of Object.entries(i.deform)){const n=e[t]||(e[t]={});for(const[r,o]of Object.entries(s)){const a=n[r]||(n[r]={});for(const[l,c]of Object.entries(o)){const h=a[l]||(a[l]={});h.deform=c,dk(c)}}}delete i.deform}function Ew(i){fk(i),mk(i);for(const e of Object.values(i.animations||{}))pk(e),gk(e),vk(e),yk(e),xk(e),bk(e),!e.drawOrder&&e.draworder&&(e.drawOrder=e.draworder);return i}function wk(i){return i.replace(/\\/g,"/").split("/").pop()||i}async function Sk(i){const e=await Promise.all(i.map(async t=>{const s=URL.createObjectURL(t);try{return[wk(t.name).toLowerCase(),await ze.fromURL(s)]}finally{URL.revokeObjectURL(s)}}));return new Map(e)}function Mk(i){const e=new Map;return i.bones.map(t=>{var r;const s=((r=t.parent)==null?void 0:r.name)||null,n=s?(e.get(s)||0)+1:0;return e.set(t.name,n),{name:t.name,parent:s,depth:n}})}function Tk(i){return i.slots.map(e=>{var t;return{name:e.name,order:Number(e.index)||0,bone:((t=e.boneData)==null?void 0:t.name)||"",attachment:e.attachmentName||""}})}async function Iw(i,e,t){var o;if(!/\.(json|skel)$/i.test(i.name))throw new Error("Spine 数据仅支持 .json 或 .skel");if(!/\.atlas$/i.test(e.name))throw new Error("图集文件仅支持 .atlas");if(!t.length)throw new Error("请至少选择一张纹理图片");const s=await e.text(),n=await Sk(t),r=[...n.values()];try{let a,l,c=null,h;if(/\.skel$/i.test(i.name)){const u=await i.arrayBuffer();try{({skeletonData:a,SpineClass:l}=await uk(u,s,n)),h="4.3"}catch(d){try{({skeletonData:a,SpineClass:l}=ak(u,s,n)),h="4.2"}catch(f){const p=d instanceof Error?d.message:String(d),m=f instanceof Error?f.message:String(f);throw new Error(`Spine 二进制解析失败(4.3:${p};旧版:${m})`)}}c=gh(a.version)}else{let u;try{u=JSON.parse(await i.text())}catch{throw new Error("Spine JSON 文件格式无效")}if(c=gh((o=u==null?void 0:u.skeleton)==null?void 0:o.spine),!c)throw new Error(`Spine JSON 版本不受支持,仅支持 ${pm()}`);h=MR(c),c==="3.8"&&Ew(u);const d=h==="4.3"?await hk(u,s,n):ok(u,s,n);a=d.skeletonData,l=d.SpineClass}if(!c)throw new Error(`Spine 数据版本不受支持,仅支持 ${pm()}`);return{skeletonData:a,textures:r,runtimeVersion:h,SpineClass:l,dataVersion:c,animations:a.animations.map(u=>({name:u.name,duration:u.duration})),bones:Mk(a),slots:Tk(a)}}catch(a){for(const l of r)l.destroy(!0);throw a}}function Dc(i){return new Promise((e,t)=>{const s=new FileReader;s.onload=()=>e(String(s.result||"")),s.onerror=()=>t(s.error),s.readAsDataURL(i)})}async function _k(i,e,t){return{skeleton:{name:i.name,dataUrl:await Dc(i)},atlas:{name:e.name,dataUrl:await Dc(e)},textures:await Promise.all(t.map(async s=>({name:s.name,dataUrl:await Dc(s)})))}}async function df(i){const e=await fetch(i.dataUrl);if(!e.ok)throw new Error(`无法读取内嵌 Spine 文件:${i.name}`);return new File([await e.blob()],i.name)}async function Ck(i){return{skeleton:await df(i.skeleton),atlas:await df(i.atlas),textures:await Promise.all(i.textures.map(df))}}const Rw="SpineParticle.EditorConfig",Pw=1;function kw(i){return{backgroundX:i.backgroundX,backgroundY:i.backgroundY,backgroundOpacity:i.backgroundOpacity,backgroundImageName:i.backgroundImageName,backgroundImageData:i.backgroundImageData,showGrid:i.showGrid,exportSettings:$t(i.exportSettings)}}function Ak(i){return JSON.parse(JSON.stringify(i,(e,t)=>{if(!(e==="texture"||e==="trailTexture"||e==="frames"))return t}))}function Fw(i){const e=$t(i);return delete e.tags,delete e.selectedTag,e}function Ek(i){const e=kw(i.settings);return Ak({format:Rw,version:Pw,savedAt:new Date().toISOString(),editor:$t(i.editor),settings:e,timeline:{fps:i.timeline.fps,loop:i.timeline.loop,playbackStart:i.timeline.playbackStart,playbackEnd:i.timeline.playbackEnd,animations:[...i.timeline.animations]},selection:{type:i.activeObjectType,id:i.activeObjectId},scene:{systems:i.systems.map(t=>({...$t(t),frames:void 0})),colliders:i.colliders.map(Fw),paths:$t(i.paths),spines:$t(i.spines)}})}function Ik(){return`SpineParticle-${new Date().toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"").replace("T","-")}.json`}function Ow(i){const e=Ek(i),t=new Blob([JSON.stringify(e,null,2)],{type:"application/json;charset=utf-8"}),s=URL.createObjectURL(t),n=document.createElement("a");return n.href=s,n.download=Ik(),document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(s),0),e}function Lw(i){let e;try{e=JSON.parse(i)}catch{throw new Error("配置文件不是有效的 JSON")}const t=e;if(t.format!==Rw)throw new Error("不是 SpineParticle 编辑器配置文件");if(t.version!==Pw)throw new Error(`暂不支持配置版本:${t.version??"未知"}`);if(!t.scene||!Array.isArray(t.scene.systems)||!Array.isArray(t.scene.colliders)||!Array.isArray(t.scene.paths)||!Array.isArray(t.scene.spines))throw new Error("配置文件缺少完整场景数据");return t}async function Rk(i){const e=new Map,t=n=>{const r=n==="/particles/star.png"?"/images/star.png":n==="/trails/trail.png"?"/images/trail.png":n||"/images/star.png";let o=e.get(r);return o||(o=ze.fromURL(r).then(a=>ur(a)),e.set(r,o)),o},s=await t("/images/star.png");await Promise.all(i.map(async n=>{var o;const r=Dn(n.config);r.texture=s,await Promise.all(r.imageResources.map(async a=>{a.texture=await t(a.previewUrl||"/images/star.png"),await Promise.all(a.sequenceFrames.map(async l=>{l.texture=await t(l.previewUrl||a.previewUrl||"/images/star.png")}))})),await Promise.all(r.trailResources.map(async a=>{a.texture=await t(a.previewUrl||"/images/trail.png")})),r.trailTexture=((o=r.trailResources[0])==null?void 0:o.texture)||null,n.frames=[]}))}async function Pk(i){const e=new Map;try{for(const t of i){if(!t.sourceBundle)continue;const s=await Ck(t.sourceBundle);e.set(t.id,await Iw(s.skeleton,s.atlas,s.textures))}return e}catch(t){for(const s of e.values())for(const n of s.textures)n.destroy(!0);throw t}}function kk(i,e){const t=(e==null?void 0:e.type)||"particle",s=Number(e==null?void 0:e.id)||0;(t==="particle"?i.systems.some(r=>r.id===s):t==="collision"?i.colliders.some(r=>r.id===s):t==="path"?i.paths.some(r=>r.id===s):i.spines.some(r=>r.id===s))?i.selectSceneObject(t,s):i.systems[0]?i.selectSceneObject("particle",i.systems[0].id):i.colliders[0]?i.selectSceneObject("collision",i.colliders[0].id):i.paths[0]?i.selectSceneObject("path",i.paths[0].id):i.spines[0]?i.selectSceneObject("spine",i.spines[0].id):(i.activeObjectType="particle",i.activeObjectId=0,i.activeId=0)}async function Fk(i,e){var h,u,d,f,p,m,g;const t=Lw(JSON.stringify(e)),s=$t(t.scene.systems),n=t.scene.colliders.map(Fw),r=$t(t.scene.paths),o=$t(t.scene.spines);for(const v of o)v.sourceBundle==null&&(v.sourceBundle=null),v.dataVersion==null&&(v.dataVersion=""),Array.isArray(v.slots)||(v.slots=[]),typeof v.selectedBone!="string"&&(v.selectedBone=""),typeof v.selectedSlot!="string"&&(v.selectedSlot="");await Rk(s);const a=await Pk(o),l=new Map(i.spines.map(v=>[v.id,v.assetVersion]));for(const v of i.spines)Pl(v.id);i.systems=s,i.colliders=n,i.paths=r,i.spines=o,Object.assign(i.editor,$t(t.editor||{}));const c=t.settings;if(c)for(const v of["backgroundX","backgroundY","backgroundOpacity","backgroundImageName","backgroundImageData","showGrid"])Object.prototype.hasOwnProperty.call(c,v)&&(i.settings[v]=c[v]);i.settings.exportSettings=T1((h=t.settings)==null?void 0:h.exportSettings),i.settings.undoLimit=Math.min(200,Math.max(1,Math.round(Number(i.settings.undoLimit)||20))),i.timeline.fps=Math.max(1,Math.round(Number((u=t.timeline)==null?void 0:u.fps)||30)),i.timeline.loop=((d=t.timeline)==null?void 0:d.loop)!==!1,i.timeline.animations=Array.isArray((f=t.timeline)==null?void 0:f.animations)&&t.timeline.animations.length?[...new Set(t.timeline.animations.filter(v=>typeof v=="string"&&v.trim()).map(v=>v.trim()))]:["animation"];for(const v of i.spines){const y=a.get(v.id);if(v.assetVersion=Math.max(Number(v.assetVersion)||0,l.get(v.id)||0)+1,!y){v.status="empty",v.error=v.skeletonFileName?"配置未包含可复用的 Spine 原始资源":"",v.animations=[],v.bones=[],v.slots=[],v.selectedAnimation="";continue}fu(v.id,y),v.dataVersion=y.dataVersion,v.animations=y.animations,v.bones=y.bones,v.slots=y.slots,y.animations.some(x=>x.name===v.selectedAnimation)||(v.selectedAnimation=((p=y.animations[0])==null?void 0:p.name)||""),v.status="ready",v.error=""}i.syncSceneSequences(),kk(i,t.selection),i.timeline.playbackStart=Math.max(0,Math.floor(Number((m=t.timeline)==null?void 0:m.playbackStart)||0)),i.timeline.playbackEnd=Math.max(1,Math.floor(Number((g=t.timeline)==null?void 0:g.playbackEnd)||Number.MAX_SAFE_INTEGER)),i.timeline.frame=0,i.timeline.recorded=!1,i.timeline.playing=!0;for(const v of i.systems)i.timeline.animations.includes(v.animation)||(v.animation=i.timeline.animations[0]);return i.recalcTotalFrames(),i.timeline.frame=i.timeline.playbackStart,t}async function Bw(i,e){return Fk(i,Lw(e))}async function Ok(i,e){if(!/\.json$/i.test(e.name))throw new Error("请选择 .json 配置文件");return Bw(i,await e.text())}const gu=mo({undoCount:0});let Th=null,Pn=null,xr=[],La=null,kn=null,_h=!1;function Ip(i){return{systems:i.systems.map(t=>{const s=$t(t);return s.frames=void 0,s}),colliders:$t(i.colliders),paths:$t(i.paths),spines:$t(i.spines),animations:[...i.timeline.animations],settings:kw(i.settings)}}function Rp(i){return JSON.stringify(i,(e,t)=>e==="texture"||e==="trailTexture"?null:typeof t=="string"&&t.startsWith("data:")&&t.length>256?`${t.length}:${t.slice(0,96)}:${t.slice(-48)}`:t)}function Nw(i,e=Ip(i),t=Rp(e)){const s=new Map;for(const n of e.spines){const r=wR(n.id);r&&s.set(n.id,r)}return{data:e,signature:t,spineAssets:s}}function Ch(i){if(i){for(const e of i.spineAssets.values())xR(e);i.spineAssets.clear()}}function Dw(i){for(;xr.length>i;)Ch(xr.shift()||null);gu.undoCount=xr.length}function Uw(){const i=Th;if(!i||!Pn||_h)return;const e=Ip(i),t=Rp(e);t!==Pn.signature&&(xr.push(Pn),Pn=Nw(i,e,t),Dw(i.settings.undoLimit))}function Lk(){_h||(kn&&clearTimeout(kn),kn=setTimeout(()=>{kn=null,Uw()},250))}function Bk(i){const e=i.activeObjectId;return i.activeObjectType==="particle"?i.systems.some(t=>t.id===e):i.activeObjectType==="collision"?i.colliders.some(t=>t.id===e):i.activeObjectType==="path"?i.paths.some(t=>t.id===e):i.spines.some(t=>t.id===e)}function Nk(i){var t,s;if(!Bk(i)){const n=i.systems[0],r=i.colliders[0],o=i.paths[0],a=i.spines[0];n?(i.activeObjectType="particle",i.activeObjectId=n.id):r?(i.activeObjectType="collision",i.activeObjectId=r.id):o?(i.activeObjectType="path",i.activeObjectId=o.id):(i.activeObjectType="spine",i.activeObjectId=(a==null?void 0:a.id)||0)}const e=i.activeObjectType==="particle"?i.systems.find(n=>n.id===i.activeObjectId):i.systems.find(n=>n.id===i.activeId);i.activeId=(e==null?void 0:e.id)||((t=i.systems[0])==null?void 0:t.id)||0,i.timeline.animation=(e==null?void 0:e.animation)||((s=i.systems[0])==null?void 0:s.animation)||i.timeline.animations[0]||"animation"}function Dk(i,e){const t=Pn;_h=!0;try{for(const s of i.spines)Pl(s.id);i.systems=$t(e.data.systems),i.colliders=$t(e.data.colliders),i.paths=$t(e.data.paths),i.spines=$t(e.data.spines),i.timeline.animations=[...e.data.animations],Object.assign(i.settings,$t(e.data.settings));for(const[s,n]of e.spineAssets)fu(s,n);for(const s of i.systems)s.frames=[];i.timeline.recorded=!1,i.timeline.playing=!1,Nk(i),i.recalcTotalFrames(),Pn=e}finally{_h=!1,Ch(t)}}function Uk(i){if(!(Th===i&&La)){La==null||La(),kn&&clearTimeout(kn),Ch(Pn);for(const e of xr)Ch(e);xr=[],Th=i,Pn=Nw(i),gu.undoCount=0,La=cs(()=>Rp(Ip(i)),Lk,{flush:"post"})}}function $k(i,e){const t=Math.min(200,Math.max(1,Math.round(Number(e)||20)));i.settings.undoLimit=t,Dw(t)}function $w(){const i=Th;if(!i||!Pn)return!1;kn&&(clearTimeout(kn),kn=null),Uw();const e=xr.pop();return e?(Dk(i,e),gu.undoCount=xr.length,!0):!1}function Xk(i){const e=i instanceof HTMLElement?i:null;return!!(e!=null&&e.closest('input, textarea, select, [contenteditable="true"]'))}function Vk(i){function e(s){var r;const n=s.target instanceof Node?s.target:null;i.canvasFocused.value=!!n&&!!((r=i.canvasElement.value)!=null&&r.contains(n))}function t(s){const n=s.key.toLowerCase();if((s.ctrlKey||s.metaKey)&&!s.altKey&&n==="s"){s.preventDefault(),s.stopPropagation(),i.save();return}if((s.ctrlKey||s.metaKey)&&!s.altKey&&n==="z"){s.preventDefault(),s.stopPropagation(),i.undo();return}if(s.ctrlKey||s.metaKey||s.altKey||Xk(s.target))return;if(n==="d"){s.preventDefault(),i.togglePlay();return}if(n==="s"){s.preventDefault(),i.toStart();return}if(!i.canvasFocused.value)return;const r={q:"",w:"translate",e:"rotate",r:"scale"};n in r&&(s.preventDefault(),i.setTool(r[n]))}Oi(()=>{document.addEventListener("pointerdown",e,!0),window.addEventListener("keydown",t,!0)}),Cl(()=>{document.removeEventListener("pointerdown",e,!0),window.removeEventListener("keydown",t,!0)})}const Yk={class:"help-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"help-title"},Gk={class:"help-body"},jk=["aria-expanded"],Hk={class:"caret"},Wk={class:"help-module-body"},zk=["aria-expanded"],qk={class:"caret"},Kk={class:"help-module-body"},Zk=["aria-expanded"],Jk={class:"caret"},Qk={class:"help-module-body"},eF=["aria-expanded"],tF={class:"caret"},sF={class:"help-module-body"},iF=["aria-expanded"],nF={class:"caret"},rF={class:"help-module-body"},oF=["aria-expanded"],aF={class:"caret"},lF={class:"help-module-body"},cF=["aria-expanded"],hF={class:"caret"},uF={class:"help-module-body"},dF=["aria-expanded"],fF={class:"caret"},mF={class:"help-module-body"},pF=["aria-expanded"],gF={class:"caret"},vF={class:"help-module-body"},yF=Zt({__name:"HelpDialog",props:{show:{type:Boolean}},emits:["close"],setup(i,{emit:e}){const t=e,s=Fe(Array.from({length:9},()=>!1));function n(){t("close")}function r(o){o.key==="Escape"&&n()}return Oi(()=>window.addEventListener("keydown",r)),po(()=>window.removeEventListener("keydown",r)),(o,a)=>i.show?(z(),J("div",{key:0,class:"help-overlay",role:"presentation",onClick:Ke(n,["self"])},[T("section",Yk,[T("header",{class:"help-head"},[a[9]||(a[9]=T("div",null,[T("h2",{id:"help-title"},"使用说明"),T("p",null,"从创建粒子到保存、导出的快速入门")],-1)),T("button",{class:"help-close","aria-label":"关闭使用说明",title:"关闭 (Esc)",onClick:n},"✕")]),T("div",Gk,[a[37]||(a[37]=Qs('

快速开始

  1. 创建对象:在左侧“场景对象”中用 +粒子 / +碰撞 / +路径 / +Spine 添加场景对象。
  2. 编辑粒子:选中某个粒子系统,依次调整“发射模式 → 发射器形状 → 粒子属性 → 外观与资源 → 修改器”。
  3. 查看效果:底部时间轴可播放、暂停、逐帧或拖动;修改任意参数后会自动重新计算。
  4. 保存与导出:用“保存配置”保留工程;“导出 Spine Json / images 包 / .spine 包”输出成品。

每个模块组标题右侧的“重置”可把该组参数恢复默认;系统设置会自动保存在当前浏览器。

常用操作

小眼睛
单独显示/隐藏对象;隐藏的粒子系统不会被导出。
+Copy
完整复制当前选中对象,方便对比不同参数。
背景图
上传参考图并调整位置和透明度,只用于画布预览。
系统设置
管理界面布局、辅助显示、刻度等,自动存入浏览器。
撤销/重做
Ctrl+Z 撤回一步;可达成的步数在系统设置中调整。
Spine 骨骼
在层级树搜索并选择骨骼,可用于粒子发射器跟随。

快捷键

Ctrl/⌘+Z撤回上一步
Ctrl/⌘+S保存配置
Q拖动画布
W位移工具
E旋转工具
R缩放工具
D播放 / 暂停
S回到第一帧

Q / W / E / R 需先点击画布;光标位于输入框时,单键快捷键不会触发。

功能模块详解
',3)),T("section",{class:Ae(["help-section help-module",{open:s.value[0]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":s.value[0]?"true":"false",onClick:a[0]||(a[0]=l=>s.value[0]=!s.value[0])},[a[10]||(a[10]=T("span",{class:"mnum"},"1",-1)),a[11]||(a[11]=T("span",{class:"mtitle"},"配置管理",-1)),T("span",Hk,ye(s.value[0]?"▾":"▸"),1)],8,jk),ce(T("div",Wk,[...a[12]||(a[12]=[Qs('
保存配置
把当前全部场景对象和参数保存为工程 JSON 文件(也支持 Ctrl+S)。
加载配置
选择本地配置文件,恢复完整工程。
预设
从下拉中选择已保存的预设快速套用;点击下拉即可刷新列表。
范围
配置只含对象与参数,不含“系统设置”;系统设置单独存于浏览器。
',1)])],512),[[Ss,s.value[0]]])],2),T("section",{class:Ae(["help-section help-module",{open:s.value[1]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":s.value[1]?"true":"false",onClick:a[1]||(a[1]=l=>s.value[1]=!s.value[1])},[a[13]||(a[13]=T("span",{class:"mnum"},"2",-1)),a[14]||(a[14]=T("span",{class:"mtitle"},"场景对象",-1)),T("span",qk,ye(s.value[1]?"▾":"▸"),1)],8,zk),ce(T("div",Kk,[...a[15]||(a[15]=[Qs('
粒子
核心对象。可设名称、位置 X/Y、偏移、旋转、缩放 X/Y,以及“随机种子”——相同种子可精确复现同一次效果。
碰撞
圆形/椭圆/矩形/多边形/自定义;启用开关、碰撞响应(物理弹跳/暂停/销毁)、弹性与摩擦,还可沿某条路径移动并带进度曲线。
路径
贝塞尔路径,可双击新建/删除锚点、拖手柄调曲线;内置圆/方/多边形/星形预设,支持闭合与颜色。
Spine
加载 .json+.atlas+.png 预览骨骼动画,可查看/搜索骨骼层级树,用于粒子“发射器跟随”。
通用
每个对象都有小眼睛显隐;“+Copy”可以复制当前对象;隐藏的粒子系统不会进入导出。
',1)])],512),[[Ss,s.value[1]]])],2),T("section",{class:Ae(["help-section help-module",{open:s.value[2]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":s.value[2]?"true":"false",onClick:a[2]||(a[2]=l=>s.value[2]=!s.value[2])},[a[16]||(a[16]=T("span",{class:"mnum"},"3",-1)),a[17]||(a[17]=T("span",{class:"mtitle"},"发射模式",-1)),T("span",Jk,ye(s.value[2]?"▾":"▸"),1)],8,Zk),ce(T("div",Qk,[...a[18]||(a[18]=[Qs('
持续
按“每秒发射数量”持续喷射;再分“常规持续”(发射时长)与“循环持续”(三段式:开始循环 / 纯循环 / 结束循环,可自动或自定义帧长,做到无缝衔接)。
爆发
一次性发射“单次数量”颗粒子。
延迟时间
粒子条左端位置,表示发射开始前的等待时间。
注意
循环持续模式不支持骨骼跟随和路径跟随;开关时会把跟随设置恢复默认。
',1)])],512),[[Ss,s.value[2]]])],2),T("section",{class:Ae(["help-section help-module",{open:s.value[3]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":s.value[3]?"true":"false",onClick:a[3]||(a[3]=l=>s.value[3]=!s.value[3])},[a[19]||(a[19]=T("span",{class:"mnum"},"4",-1)),a[20]||(a[20]=T("span",{class:"mtitle"},"发射器形状",-1)),T("span",tF,ye(s.value[3]?"▾":"▸"),1)],8,eF),ce(T("div",sF,[...a[21]||(a[21]=[Qs('
形状
点 / 圆形 / 矩形 / 锥形 / 路径。
圆·锥
内半径与外半径,形成环形或锥形发射区;锥形额外有“锥形朝向”和“开口角度”。
矩形
“外框 − 内框”形成环带,可分别设置内外宽高。
路径
选一条场景路径作为出生线;出生分布可选等距固定或随机。
发射角度
固定 / 随机(基准角度 + 随机范围)/ 径向(圆、矩、锥中心向外)/ 垂直于路径 / 沿路径方向。
',1)])],512),[[Ss,s.value[3]]])],2),T("section",{class:Ae(["help-section help-module",{open:s.value[4]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":s.value[4]?"true":"false",onClick:a[4]||(a[4]=l=>s.value[4]=!s.value[4])},[a[22]||(a[22]=T("span",{class:"mnum"},"5",-1)),a[23]||(a[23]=T("span",{class:"mtitle"},"粒子属性",-1)),T("span",nF,ye(s.value[4]?"▾":"▸"),1)],8,iF),ce(T("div",rF,[...a[24]||(a[24]=[T("dl",{class:"help-list"},[T("div",null,[T("dt",null,"初始参数"),T("dd",null,"生命周期、速度、缩放(统一或 X/Y 分离)、初始旋转(可跟随发射方向)。每个属性支持固定 / 随机 / 曲线三种取值。")]),T("div",null,[T("dt",null,"生命周期变化"),T("dd",null,"速度倍率、缩放倍率(统一/分离)、旋转速度,均可用“生命周期 → 倍率”曲线控制。")]),T("div",null,[T("dt",null,"曲线含义"),T("dd",null,"横轴为粒子生命周期 0→1,纵轴为倍率或对应数值。")])],-1)])],512),[[Ss,s.value[4]]])],2),T("section",{class:Ae(["help-section help-module",{open:s.value[5]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":s.value[5]?"true":"false",onClick:a[5]||(a[5]=l=>s.value[5]=!s.value[5])},[a[25]||(a[25]=T("span",{class:"mnum"},"6",-1)),a[26]||(a[26]=T("span",{class:"mtitle"},"外观与资源",-1)),T("span",aF,ye(s.value[5]?"▾":"▸"),1)],8,oF),ce(T("div",lF,[...a[27]||(a[27]=[T("dl",{class:"help-list"},[T("div",null,[T("dt",null,"透明度"),T("dd",null,"曲线或固定;曲线模式可选“跟随导出 / 线性 / 贝塞尔”。")]),T("div",null,[T("dt",null,"图片资源"),T("dd",null,"“+”新增,可上传单图或序列帧;多张图片按权重随机。每张可调缩放、轴心、颜色(固定/随机/生命周期渐变)、混合模式(正常/相加/相乘/滤色)、独立透明度(关/固定/曲线)。")]),T("div",null,[T("dt",null,"序列帧"),T("dd",null,"播放方式:单次隐藏 / 单次定格 / 正向循环 / 反向循环,可设每秒帧数。")])],-1)])],512),[[Ss,s.value[5]]])],2),T("section",{class:Ae(["help-section help-module",{open:s.value[6]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":s.value[6]?"true":"false",onClick:a[6]||(a[6]=l=>s.value[6]=!s.value[6])},[a[28]||(a[28]=T("span",{class:"mnum"},"7",-1)),a[29]||(a[29]=T("span",{class:"mtitle"},"修改器",-1)),T("span",hF,ye(s.value[6]?"▾":"▸"),1)],8,cF),ce(T("div",uF,[...a[30]||(a[30]=[Qs('
移动噪声
强度、波动范围、时间流速,让粒子轨迹产生抖动。
重力 / 风力
固定或随机强度、方向,以及生命周期内强度曲线。
力场
中心 X/Y、强度(正吸负斥)、半径、衰减(恒定/线性/反比)。
吸附
延迟后把粒子吸到指定点,到达范围即死亡;可直线或曲线。
拖尾
独立拖尾图片(多资源按权重)、旋转、拖尾骨骼数、拖尾比例;长度/宽度可固定或随机并支持放大;可加生命周期长度曲线与形状曲线;颜色/透明度可跟随粒子、固定或曲线。
发射器跟随
跟随某条路径(局部/世界、正/反向、进度曲线),或跟随 Spine 骨骼(选中的骨骼 + 偏移)。
碰撞 + 阻尼
选择场景中已启用的碰撞对象参与,并设置速度阻尼。
',1)])],512),[[Ss,s.value[6]]])],2),T("section",{class:Ae(["help-section help-module",{open:s.value[7]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":s.value[7]?"true":"false",onClick:a[7]||(a[7]=l=>s.value[7]=!s.value[7])},[a[31]||(a[31]=T("span",{class:"mnum"},"8",-1)),a[32]||(a[32]=T("span",{class:"mtitle"},"导出设置",-1)),T("span",fF,ye(s.value[7]?"▾":"▸"),1)],8,dF),ce(T("div",mF,[...a[33]||(a[33]=[Qs('
图片路径
写入 Spine 的 images 路径,例如 ./images/。
Spine 版本
3.8 / 4.0 / 4.1 / 4.2 / 4.3。
关键帧曲线
线性或平滑贝塞尔;出生、死亡、突变仍使用阶跃关键帧。
导出 FPS
修改 FPS 会保持动画实际秒数不变;“不写 fps”只省略元数据。
其它
整数帧对齐、骨骼对象池、排除无内容动画。
导出按钮
“导出 Spine Json”生成骨骼动画文件;“导出 images 包”单独下载图片 ZIP;“导出 .spine 包”需要连接器。
',1)])],512),[[Ss,s.value[7]]])],2),T("section",{class:Ae(["help-section help-module help-connector",{open:s.value[8]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":s.value[8]?"true":"false",onClick:a[8]||(a[8]=l=>s.value[8]=!s.value[8])},[a[34]||(a[34]=T("span",{class:"mnum"},"9",-1)),a[35]||(a[35]=T("span",{class:"mtitle"},"连接器(Spine 连接器)使用说明",-1)),T("span",gF,ye(s.value[8]?"▾":"▸"),1)],8,pF),ce(T("div",vF,[...a[36]||(a[36]=[Qs('

连接器用于把网页生成的 JSON 和图片,调用你电脑上已安装并激活的 Spine,转换成可编辑的 .spine 工程。

前置
电脑已安装并激活 Spine;并已启动桌面版连接器APP。
网页端
导出区状态显示“连接器可用 · Spine 已就绪”后,点击“导出 .spine 包”。
首次授权
生产网站首次连接会显示“授权当前网站”;点击后在本机确认页核对完整来源(协议 + 域名 + 端口),再点“允许此网站”。授权一次后本机会保存白名单。本地 127.0.0.1:5173 默认允许。
路径设置
连接器自动检测 Spine 安装位置;检测不到时可在桌面窗口手动指定:Windows 选 Spine.com,macOS 选 Spine.app/Contents/MacOS/Spine。
下载结果
得到 ZIP 包,内含 .spine 工程和图片目录(如 images/star.png)。
版本
连接器按请求与 JSON 内的版本自动匹配 3.8~4.3,使用最新可用补丁。
安全
仅监听本机 127.0.0.1:27843;授权与白名单保存在连接器里;文件在临时目录转换后清理,并有大小限制。
',2)])],512),[[Ss,s.value[8]]])],2),a[38]||(a[38]=T("section",{class:"help-section help-export"},[T("h3",null,"配置与导出有什么区别?"),T("p",null,[T("b",null,"保存配置"),gt("会保存编辑器中的全部对象和参数,之后可以继续修改;"),T("b",null,"导出 Spine Json"),gt("只导出显示中的粒子系统,并把跟随、碰撞和拖尾结果烘焙为独立动画数据。")])],-1))])])])):xe("",!0)}}),Jt=(i,e)=>{const t=i.__vccOpts||i;for(const[s,n]of e)t[s]=n;return t},xF=Jt(yF,[["__scopeId","data-v-78204b9d"]]);function ia(i){const e=()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",e),window.removeEventListener("pointercancel",e)};window.addEventListener("pointermove",i),window.addEventListener("pointerup",e),window.addEventListener("pointercancel",e)}function ui(i,e,t){const s=i.holder.value,n=i.app(),r=s.getBoundingClientRect(),o=Math.max(1e-4,i.store.editor.viewScale),a=e-r.left,l=t-r.top;return{x:(a-n.screen.width/2-i.store.editor.viewX)/o,y:-(l-n.screen.height*.5-i.store.editor.viewY)/o}}function bF(i,e){const t=i.holder.value,s=i.app(),n=i.store,r=t.getBoundingClientRect(),o=e.clientX-r.left,a=e.clientY-r.top,l=e.deltaY<0?1.12:1/1.12,c=n.editor.viewScale,h=Math.max(.01,c*l),u=s.screen.width/2,d=s.screen.height*.5,f=n.editor.viewX,p=n.editor.viewY,m=(o-u-f)/c,g=(a-d-p)/c;n.editor.viewX=o-u-m*h,n.editor.viewY=a-d-g*h,n.editor.viewScale=h}function wF(i,e,t){const s=i.store,n=s.editor.viewX,r=s.editor.viewY;ia(o=>{s.editor.viewX=n+(o.clientX-e),s.editor.viewY=r+(o.clientY-t)})}function Xw(i,e){const t=Math.max(.01,i.store.editor.viewScale*e);i.store.editor.viewScale=t}function SF(i){Xw(i,1.2)}function MF(i){Xw(i,1/1.2)}function TF(i){i.store.editor.viewScale=1,i.store.editor.viewX=0,i.store.editor.viewY=0}function _F(i){i.store.editor.viewScale=1,i.store.editor.viewX=0,i.store.editor.viewY=0}function CF(i){i.store.settings.showGrid=!i.store.settings.showGrid}const AF={class:"topbar"},EF=["disabled"],IF={class:"tool-group"},RF={class:"tool-group"},PF={key:0,class:"background-panel"},kF=["disabled"],FF=["title"],OF={class:"background-position-row"},LF={class:"background-opacity-row"},BF={class:"zoom-pct"},NF=Zt({__name:"StageToolbar",props:{ctx:{},activeTool:{},showSettings:{type:Boolean},showHelp:{type:Boolean}},emits:["update:activeTool","update:showSettings","update:showHelp","clear-background","background-file"],setup(i,{emit:e}){const t=i,s=e,n=yo(),r=Fe(!1),o=Fe(null),a=De(()=>n.settings.backgroundImageName);function l(m){s("update:activeTool",t.activeTool===m?"":m)}function c(){r.value=!r.value,r.value&&s("update:showSettings",!1)}function h(){const m=!t.showSettings;s("update:showSettings",m),m&&(r.value=!1)}function u(){s("update:showHelp",!0),r.value=!1,s("update:showSettings",!1)}function d(m){s("background-file",m)}function f(m=!0){o.value&&(o.value.value=""),s("clear-background",m)}function p(){$w()}return(m,g)=>(z(),J("div",AF,[T("button",{class:"settings-btn",onClick:h,title:"系统设置"},"系统设置"),T("button",{class:"undo-btn",disabled:R(gu).undoCount===0,onClick:p,title:"撤回上一步 (Ctrl+Z)"},"↶",8,EF),T("div",IF,[T("button",{class:Ae(["tool-btn",{on:i.activeTool===""}]),onClick:g[0]||(g[0]=v=>l("")),title:"拖动画布 (Q)"},"✋",2),T("button",{class:Ae(["tool-btn",{on:i.activeTool==="translate"}]),onClick:g[1]||(g[1]=v=>l("translate")),title:"位移 (W)"},"✥",2),T("button",{class:Ae(["tool-btn",{on:i.activeTool==="rotate"}]),onClick:g[2]||(g[2]=v=>l("rotate")),title:"旋转 (E)"},"⟳",2),T("button",{class:Ae(["tool-btn",{on:i.activeTool==="scale"}]),onClick:g[3]||(g[3]=v=>l("scale")),title:"缩放 (R)"},"⤢",2)]),T("div",RF,[T("button",{class:"tool-btn",onClick:g[4]||(g[4]=v=>R(SF)(i.ctx)),title:"放大"},"+"),T("button",{class:"tool-btn",onClick:g[5]||(g[5]=v=>R(MF)(i.ctx)),title:"缩小"},"-"),T("button",{class:"tool-btn",onClick:g[6]||(g[6]=v=>R(TF)(i.ctx)),title:"适配画布"},"⤢"),T("button",{class:Ae(["tool-btn",{on:R(n).settings.showGrid}]),onClick:g[7]||(g[7]=v=>R(CF)(i.ctx)),title:"切换网格"},"▦",2),T("button",{class:"tool-btn",onClick:g[8]||(g[8]=v=>R(_F)(i.ctx)),title:"重置视图"},"⟳")]),T("div",{class:"background-menu",onClick:g[14]||(g[14]=Ke(()=>{},["stop"]))},[T("button",{class:Ae(["background-btn",{on:r.value}]),title:"背景图显示设置",onClick:c},"背景图",2),r.value?(z(),J("div",PF,[T("button",{class:"background-upload",onClick:g[9]||(g[9]=v=>{var y;return(y=o.value)==null?void 0:y.click()})},ye(a.value?"更换图像":"上传图像"),1),T("button",{class:"background-clear",disabled:!a.value,onClick:g[10]||(g[10]=v=>f())},"清除背景",8,kF),T("input",{ref_key:"backgroundFileInput",ref:o,class:"background-file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:d},null,544),T("div",{class:"background-file-name",title:a.value},ye(a.value||"未上传图像"),9,FF),T("div",OF,[T("label",null,[g[15]||(g[15]=T("span",null,"X",-1)),ce(T("input",{"onUpdate:modelValue":g[11]||(g[11]=v=>R(n).settings.backgroundX=v),type:"number",step:"1","aria-label":"背景图 X 偏移"},null,512),[[je,R(n).settings.backgroundX,void 0,{number:!0}]])]),T("label",null,[g[16]||(g[16]=T("span",null,"Y",-1)),ce(T("input",{"onUpdate:modelValue":g[12]||(g[12]=v=>R(n).settings.backgroundY=v),type:"number",step:"1","aria-label":"背景图 Y 偏移"},null,512),[[je,R(n).settings.backgroundY,void 0,{number:!0}]])])]),T("label",LF,[g[17]||(g[17]=T("span",null,"透明度",-1)),ce(T("input",{"onUpdate:modelValue":g[13]||(g[13]=v=>R(n).settings.backgroundOpacity=v),type:"range",min:"0",max:"1",step:"0.01","aria-label":"背景图透明度"},null,512),[[je,R(n).settings.backgroundOpacity,void 0,{number:!0}]]),T("b",null,ye(Math.round(R(n).settings.backgroundOpacity*100))+"%",1)])])):xe("",!0)]),T("button",{class:Ae(["help-btn",{on:i.showHelp}]),title:"查看使用说明",onClick:u},"使用说明",2),T("span",BF,ye(Math.round(R(n).editor.viewScale*100))+"%",1)]))}}),DF=Jt(NF,[["__scopeId","data-v-4749834a"]]),UF={key:0,class:"settings-panel"},$F={class:"sp-head"},XF={class:"sp-switch-row"},VF={class:"sp-switch-control"},YF={class:"sp-row"},GF={class:"sp-chk"},jF={class:"sp-chk"},HF={class:"sp-row"},WF={class:"sp-row"},zF={class:"sp-chk"},qF={class:"sp-chk"},KF={class:"sp-row"},ZF={class:"sp-row"},JF={class:"sp-row"},QF={class:"sp-hex"},e3={class:"sp-chk"},t3=Zt({__name:"StageSettingsPanel",props:{show:{type:Boolean}},emits:["close"],setup(i,{emit:e}){const t=e,s=yo();function n(o){$k(s,Number(o.target.value))}function r(){s.settings.bonePointDrawSize=Math.min(10,Math.max(.1,Number(s.settings.bonePointDrawSize)||1)),s.settings.boneAxisDrawSize=Math.min(10,Math.max(.1,Number(s.settings.boneAxisDrawSize)||2))}return(o,a)=>i.show?(z(),J("div",UF,[T("div",$F,[a[15]||(a[15]=gt("系统设置 ",-1)),T("button",{class:"sp-close",onClick:a[0]||(a[0]=l=>t("close"))},"✕")]),a[29]||(a[29]=T("div",{class:"sp-section-title"},"界面布局",-1)),T("label",XF,[a[17]||(a[17]=T("span",null,"参数面板位置",-1)),T("span",VF,[ce(T("input",{type:"checkbox","onUpdate:modelValue":a[1]||(a[1]=l=>R(s).settings.parameterPanelOnRight=l),"aria-label":"参数面板显示在右侧"},null,512),[[yt,R(s).settings.parameterPanelOnRight]]),a[16]||(a[16]=T("span",{class:"sp-switch-ui","aria-hidden":"true"},null,-1)),T("b",null,ye(R(s).settings.parameterPanelOnRight?"右侧":"左侧"),1)])]),a[30]||(a[30]=T("div",{class:"sp-divider"},null,-1)),a[31]||(a[31]=T("div",{class:"sp-section-title"},"操作历史",-1)),T("label",YF,[a[18]||(a[18]=T("span",null,"最大撤回步数",-1)),ce(T("input",{class:"sp-num sp-undo-limit",type:"number",min:"1",max:"200","onUpdate:modelValue":a[2]||(a[2]=l=>R(s).settings.undoLimit=l),"aria-label":"最大撤回步数",onChange:n},null,544),[[je,R(s).settings.undoLimit,void 0,{number:!0}]])]),a[32]||(a[32]=T("div",{class:"sp-divider"},null,-1)),a[33]||(a[33]=T("div",{class:"sp-section-title"},"画布辅助显示",-1)),T("label",GF,[ce(T("input",{type:"checkbox","onUpdate:modelValue":a[3]||(a[3]=l=>R(s).settings.showEmitter=l)},null,512),[[yt,R(s).settings.showEmitter]]),a[19]||(a[19]=gt("发射点",-1))]),T("label",jF,[ce(T("input",{type:"checkbox","onUpdate:modelValue":a[4]||(a[4]=l=>R(s).settings.showBones=l)},null,512),[[yt,R(s).settings.showBones]]),a[20]||(a[20]=gt("骨骼连线",-1))]),R(s).settings.showBones?(z(),J(Ce,{key:0},[T("label",HF,[a[21]||(a[21]=T("span",null,"骨骼点绘制大小",-1)),ce(T("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":a[5]||(a[5]=l=>R(s).settings.bonePointDrawSize=l),"aria-label":"骨骼点绘制大小",onChange:r},null,544),[[je,R(s).settings.bonePointDrawSize,void 0,{number:!0}]])]),T("label",WF,[a[22]||(a[22]=T("span",null,"坐标轴绘制大小",-1)),ce(T("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":a[6]||(a[6]=l=>R(s).settings.boneAxisDrawSize=l),"aria-label":"坐标轴绘制大小",onChange:r},null,544),[[je,R(s).settings.boneAxisDrawSize,void 0,{number:!0}]])])],64)):xe("",!0),T("label",zF,[ce(T("input",{type:"checkbox","onUpdate:modelValue":a[7]||(a[7]=l=>R(s).settings.showSkinMesh=l)},null,512),[[yt,R(s).settings.showSkinMesh]]),a[23]||(a[23]=gt("蒙皮网格",-1))]),a[34]||(a[34]=T("div",{class:"sp-divider"},null,-1)),T("label",qF,[ce(T("input",{type:"checkbox","onUpdate:modelValue":a[8]||(a[8]=l=>R(s).settings.tickEnabled=l)},null,512),[[yt,R(s).settings.tickEnabled]]),a[24]||(a[24]=gt("启用刻度",-1))]),R(s).settings.tickEnabled?(z(),J(Ce,{key:1},[T("label",KF,[a[25]||(a[25]=T("span",null,"刻度文字大小",-1)),ce(T("input",{type:"range",min:"8",max:"40",step:"1","onUpdate:modelValue":a[9]||(a[9]=l=>R(s).settings.axisFontSize=l)},null,512),[[je,R(s).settings.axisFontSize,void 0,{number:!0}]]),ce(T("input",{type:"number",min:"8",max:"40","onUpdate:modelValue":a[10]||(a[10]=l=>R(s).settings.axisFontSize=l),class:"sp-num"},null,512),[[je,R(s).settings.axisFontSize,void 0,{number:!0}]])]),T("label",ZF,[a[26]||(a[26]=T("span",null,"刻度线粗细",-1)),ce(T("input",{type:"range",min:"1",max:"5",step:"0.5","onUpdate:modelValue":a[11]||(a[11]=l=>R(s).settings.tickWidth=l)},null,512),[[je,R(s).settings.tickWidth,void 0,{number:!0}]]),ce(T("input",{type:"number",min:"1",max:"5","onUpdate:modelValue":a[12]||(a[12]=l=>R(s).settings.tickWidth=l),class:"sp-num"},null,512),[[je,R(s).settings.tickWidth,void 0,{number:!0}]])]),T("label",JF,[a[27]||(a[27]=T("span",null,"坐标轴颜色",-1)),ce(T("input",{type:"color","onUpdate:modelValue":a[13]||(a[13]=l=>R(s).settings.axisColor=l),class:"sp-colr"},null,512),[[je,R(s).settings.axisColor]]),T("span",QF,ye(R(s).settings.axisColor),1)]),T("label",e3,[ce(T("input",{type:"checkbox","onUpdate:modelValue":a[14]||(a[14]=l=>R(s).settings.showAxisLabels=l)},null,512),[[yt,R(s).settings.showAxisLabels]]),a[28]||(a[28]=gt("显示刻度数值",-1))])],64)):xe("",!0),a[35]||(a[35]=T("div",{class:"sp-cache-note"},"整个系统设置会自动保存到当前浏览器",-1))])):xe("",!0)}}),s3=Jt(t3,[["__scopeId","data-v-1bba85d9"]]);class ff{constructor(){S(this,"sprite",null);S(this,"texture",null);S(this,"loadVersion",0)}createSprite(e){const t=new _r(ze.EMPTY);return t.anchor.set(.5),t.visible=!1,e.addChild(t),this.sprite=t,t}applyTransform(e,t,s){this.sprite&&(this.sprite.position.set(Number(e)||0,-(Number(t)||0)),this.sprite.alpha=Math.min(1,Math.max(0,Number(s)||0)))}async syncTexture(e){const t=++this.loadVersion;if(!e){this.sprite&&(this.sprite.texture=ze.EMPTY,this.sprite.visible=!1),this.texture&&this.texture.destroy(!0),this.texture=null;return}try{const s=await ze.fromURL(e);if(t!==this.loadVersion||!this.sprite){s.destroy(!0);return}const n=this.texture;this.texture=s,this.sprite.texture=s,this.sprite.visible=!0,n&&n.destroy(!0)}catch(s){console.error("背景图恢复失败",s)}}static clearStoreBackground(e,t){e.settings.backgroundImageData="",e.settings.backgroundImageName="",t&&(e.settings.backgroundX=0,e.settings.backgroundY=0,e.settings.backgroundOpacity=1)}static async handleFileChange(e,t){var r;const s=t.target,n=(r=s.files)==null?void 0:r[0];if(n)try{e.settings.backgroundImageData=await Dc(n),e.settings.backgroundImageName=n.name}catch(o){console.error("背景图加载失败",o)}finally{s.value=""}}destroy(){this.loadVersion++,this.texture&&this.texture.destroy(!0),this.texture=null,this.sprite=null}}class i3{constructor(e){S(this,"selectedNodes",new Set);S(this,"suppressNextDoubleClick",!1);this.ctx=e}resetSelection(){this.selectedNodes.clear()}activePath(){const e=this.ctx.store;if(e.activeObjectType!=="path")return null;const t=e.paths.find(s=>s.id===e.activeObjectId)||null;return(t==null?void 0:t.visible)===!1?null:t}pathInsertIndex(e,t,s){if(e.points.length<2)return e.points.length;const n=e.closed?e.points.length:e.points.length-1;let r=e.points.length,o=1/0;for(let a=0;aMath.hypot(l.x-n.x,l.y-n.y)<=r);if(o>=0){t.points.splice(o,1),this.selectedNodes.clear();return}const a=this.pathInsertIndex(t,n.x,n.y);t.points.splice(a,0,{x:n.x,y:n.y,inX:0,inY:0,outX:0,outY:0}),this.selectedNodes.clear(),this.selectedNodes.add(a)}onPointerDown(e){const t=this.activePath();if(!t||!t.enabled)return!1;const s=ui(this.ctx,e.clientX,e.clientY),n=Io(t,s.x,s.y),r=9/Math.max(.01,this.ctx.store.editor.viewScale);if(e.detail>=2){if(t.points.findIndex(u=>Math.hypot(u.x-n.x,u.y-n.y)<=r)>=0)return!0;const c={x:n.x,y:n.y,inX:0,inY:0,outX:0,outY:0},h=this.pathInsertIndex(t,n.x,n.y);return t.points.splice(h,0,c),this.selectedNodes.clear(),this.selectedNodes.add(h),this.suppressNextDoubleClick=!0,ia(u=>{const d=ui(this.ctx,u.clientX,u.clientY),f=Io(t,d.x,d.y);c.outX=f.x-c.x,c.outY=f.y-c.y,c.inX=-c.outX,c.inY=-c.outY}),!0}let o=null;for(const l of this.selectedNodes){const c=t.points[l];c&&(Math.hypot(c.x+c.inX-n.x,c.y+c.inY-n.y)<=r&&(o={index:l,side:"in"}),Math.hypot(c.x+c.outX-n.x,c.y+c.outY-n.y)<=r&&(o={index:l,side:"out"}))}if(o){const l=t.points[o.index],c=o.side==="in"?Math.hypot(l.outX,l.outY):Math.hypot(l.inX,l.inY);return ia(u=>{const d=ui(this.ctx,u.clientX,u.clientY),f=Io(t,d.x,d.y),p=f.x-l.x,m=f.y-l.y;if(o.side==="in"?(l.inX=p,l.inY=m):(l.outX=p,l.outY=m),!u.altKey){const g=Math.max(1e-4,Math.hypot(p,m)),v=u.shiftKey?g:c;o.side==="in"?(l.outX=-p/g*v,l.outY=-m/g*v):(l.inX=-p/g*v,l.inY=-m/g*v)}}),!0}const a=t.points.findIndex(l=>Math.hypot(l.x-n.x,l.y-n.y)<=r);if(a>=0){if(e.altKey)return this.selectedNodes.delete(a),!0;e.ctrlKey||e.metaKey?this.selectedNodes.add(a):this.selectedNodes.has(a)||(this.selectedNodes.clear(),this.selectedNodes.add(a));const l=n,c=[...this.selectedNodes].map(u=>({index:u,x:t.points[u].x,y:t.points[u].y}));return ia(u=>{const d=ui(this.ctx,u.clientX,u.clientY),f=Io(t,d.x,d.y);for(const p of c)t.points[p.index].x=p.x+f.x-l.x,t.points[p.index].y=p.y+f.y-l.y}),!0}if(e.altKey&&!e.ctrlKey&&!e.metaKey)return this.selectedNodes.clear(),!0;if(e.ctrlKey||e.metaKey||e.altKey){const l=n,c=e.altKey,h=u=>{const d=ui(this.ctx,u.clientX,u.clientY),f=Io(t,d.x,d.y),p=Math.min(l.x,f.x),m=Math.max(l.x,f.x),g=Math.min(l.y,f.y),v=Math.max(l.y,f.y);t.points.forEach((y,x)=>{y.x>=p&&y.x<=m&&y.y>=g&&y.y<=v&&(c?this.selectedNodes.delete(x):this.selectedNodes.add(x))}),window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h)};return window.addEventListener("pointerup",h),window.addEventListener("pointercancel",h),!0}return!1}}class n3{constructor(e,t){this.ctx=e,this.getTool=t}onColliderPointerDown(e){const t=this.ctx.store;if(t.activeObjectType!=="collision")return!1;const s=t.colliders.find(y=>y.id===t.activeObjectId);if(!(s!=null&&s.enabled)||s.visible===!1)return!1;const n=ui(this.ctx,e.clientX,e.clientY),r=s.rotation*Math.PI/180,o=Math.cos(r),a=Math.sin(r),l=Math.max(1e-4,Math.abs(s.scaleX??1)),c=Math.max(1e-4,Math.abs(s.scaleY??1)),h=n.x-s.x,u=n.y-s.y,d=(o*h+a*u)/l,f=(-a*h+o*u)/c;if(!(s.shape==="circle"?Math.hypot(d,f)<=s.radius:s.shape==="ellipse"?Math.hypot(d/Math.max(1,s.radiusX),f/Math.max(1,s.radiusY))<=1:Math.abs(d)<=s.width*.5&&Math.abs(f)<=s.height*.5))return!1;const m=s.x,g=s.y,v=n;return ia(y=>{const x=ui(this.ctx,y.clientX,y.clientY);s.x=m+x.x-v.x,s.y=g+x.y-v.y}),!0}onForceFieldDown(e){const t=this.ctx.store.systems.find(h=>h.id===this.ctx.store.activeId);if((t==null?void 0:t.visible)===!1)return!1;const s=t==null?void 0:t.config;if(!(s!=null&&s.forceField)||!s.showForceFieldShape||s.forceRadius<=0)return!1;const n=ui(this.ctx,e.clientX,e.clientY);if(Math.hypot(n.x-s.forceCenterX,n.y-s.forceCenterY)>s.forceRadius)return!1;const o=s.forceCenterX,a=s.forceCenterY;this.ctx.holder.value&&(this.ctx.holder.value.style.cursor="grabbing");const l=h=>{const u=ui(this.ctx,h.clientX,h.clientY);s.forceCenterX=o+u.x-n.x,s.forceCenterY=a+u.y-n.y},c=()=>{this.ctx.holder.value&&(this.ctx.holder.value.style.cursor=""),window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",c),window.removeEventListener("pointercancel",c)};return window.addEventListener("pointermove",l),window.addEventListener("pointerup",c),window.addEventListener("pointercancel",c),e.preventDefault(),!0}onAttractionDown(e){const t=this.ctx.store.systems.find(u=>u.id===this.ctx.store.activeId);if((t==null?void 0:t.visible)===!1)return!1;const s=t==null?void 0:t.config;if(!(s!=null&&s.attraction)||!s.showAttractionShape)return!1;const n=ui(this.ctx,e.clientX,e.clientY),r=Math.max(s.attractionRadius,12/Math.max(1e-4,this.ctx.store.editor.viewScale));if(Math.hypot(n.x-s.attractionCenterX,n.y-s.attractionCenterY)>r)return!1;const a=s.attractionCenterX,l=s.attractionCenterY;this.ctx.holder.value&&(this.ctx.holder.value.style.cursor="grabbing");const c=u=>{const d=ui(this.ctx,u.clientX,u.clientY);s.attractionCenterX=a+d.x-n.x,s.attractionCenterY=l+d.y-n.y},h=()=>{this.ctx.holder.value&&(this.ctx.holder.value.style.cursor=""),window.removeEventListener("pointermove",c),window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h)};return window.addEventListener("pointermove",c),window.addEventListener("pointerup",h),window.addEventListener("pointercancel",h),e.preventDefault(),!0}selectedTransformTarget(){const e=this.ctx.store,t=e.activeObjectId;if(e.activeObjectType==="particle"){const r=e.systems.find(a=>a.id===t);if(!r||r.visible===!1)return null;const o=r.config;return{x:o.centerX,y:o.centerY,rotation:o.rootRotation,scaleX:o.rootScaleX??1,scaleY:o.rootScaleY??1,setPosition:(a,l)=>{o.centerX=a,o.centerY=l},setRotation:a=>{o.rootRotation=a},setScale:(a,l)=>{o.rootScaleX=a,o.rootScaleY=l}}}const n=(e.activeObjectType==="collision"?e.colliders:e.activeObjectType==="path"?e.paths:e.spines).find(r=>r.id===t);return!n||n.visible===!1?null:{x:Number(n.x)||0,y:Number(n.y)||0,rotation:Number(n.rotation)||0,scaleX:Math.max(.05,Number(n.scaleX)||1),scaleY:Math.max(.05,Number(n.scaleY)||1),setPosition:(r,o)=>{n.x=r,n.y=o},setRotation:r=>{n.rotation=r},setScale:(r,o)=>{n.scaleX=r,n.scaleY=o}}}onGizmoDown(e){const t=this.selectedTransformTarget();if(!t)return;const s=this.ctx.app(),n=this.ctx.store,r=n.editor.viewScale,o=this.ctx.holder.value.getBoundingClientRect(),a=o.left+s.screen.width/2+n.editor.viewX+t.x*r,l=o.top+s.screen.height*.5+n.editor.viewY+-t.y*r,c=e.clientX,h=e.clientY,u=this.getTool(),d=t.x,f=t.y,p=t.rotation,m=t.scaleX,g=t.scaleY,v=Math.hypot(c-a,h-l)||1,y=Math.atan2(h-l,c-a);ia(M=>{const C=(M.clientX-c)/r,w=(M.clientY-h)/r;if(u==="translate")t.setPosition(d+C,f-w);else if(u==="rotate"){const b=Math.atan2(M.clientY-l,M.clientX-a);t.setRotation(p-(b-y)*180/Math.PI)}else if(u==="scale"){const _=Math.hypot(M.clientX-a,M.clientY-l)/v;t.setScale(Math.max(.05,m*_),Math.max(.05,g*_))}})}}function Jv(i,e,t,s,n){const r=1-n;return r*r*r*i+3*r*r*n*e+3*r*n*n*t+n*n*n*s}function Qv(i,e,t){const s=i.rotation*Math.PI/180,n=Math.cos(s),r=Math.sin(s),o=Math.max(1e-4,Math.abs(i.scaleX??1)),a=Math.max(1e-4,Math.abs(i.scaleY??1));return{x:i.x+n*e*o-r*t*a,y:i.y+r*e*o+n*t*a}}function Pp(i,e){if(!i.points.length)return null;if(i.points.length===1)return{...Qv(i,i.points[0].x,i.points[0].y),angle:i.rotation};const t=i.closed?i.points.length:i.points.length-1,s=[];let n=0;for(let p=0;p0&&v===0)continue;const y=v/20,x=Jv(m.x,m.x+m.outX,g.x+g.inX,g.x,y),M=Jv(m.y,m.y+m.outY,g.y+g.inY,g.y,y),C=Qv(i,x,M),w=s[s.length-1];w&&(n+=Math.hypot(C.x-w.x,C.y-w.y)),s.push({...C,distance:n})}}const r=Math.min(1,Math.max(0,e))*n;let o=s.findIndex(p=>p.distance>=r);o<0&&(o=s.length-1);const a=s[o],l=s[Math.max(0,o-1)],c=s[Math.min(s.length-1,o+1)],h=l.distance,u=o>0?(r-h)/Math.max(1e-4,a.distance-h):0,d=l.x+(a.x-l.x)*Math.min(1,Math.max(0,u)),f=l.y+(a.y-l.y)*Math.min(1,Math.max(0,u));return{x:d,y:f,angle:Math.atan2(c.y-l.y,c.x-l.x)*180/Math.PI}}function r3(i,e,t){if(e.renderLayerMode!=="slot")return null;const s=i.find(o=>o.id===e.renderLayerSpineId&&o.enabled&&o.status==="ready");if(!s)return null;const n=s.slots||[],r=n.find(o=>o.name===e.renderLayerSlotName);if(!r)return null;if(e.renderLayerSlotPosition==="below"){let o="";if(t!=null&&t.length){const a=t.indexOf(r.name);if(a===0)return null;a>0&&(o=t[a-1])}if(!o){const a=n.filter(l=>l.orderc.order-l.order)[0];if(!a)return null;o=a.name}return{spineId:s.id,slotName:o,targetSlotName:r.name,followAttachment:!1}}return{spineId:s.id,slotName:r.name,targetSlotName:r.name,followAttachment:e.renderLayerFollowAttachment}}function Ah(i,e,t,s=Math.max(1e-4,Math.abs(i.rootScaleX)),n=Math.max(1e-4,Math.abs(i.rootScaleY))){const r=-i.rootRotation*Math.PI/180,o=Math.cos(r),a=Math.sin(r),l=e-i.centerX,c=-t+i.centerY;return{x:(o*l+a*c)/s,y:(-a*l+o*c)/n}}function o3(i,e,t){const s=Pp(e,t);if(!s)return null;const n=Ah(i,s.x,s.y),r=s.angle*Math.PI/180,o=Ah(i,s.x+Math.cos(r),s.y+Math.sin(r)),a=Math.atan2(o.y-n.y,o.x-n.x)*180/Math.PI;return{...n,angle:a}}function a3(i,e){return i.colliders.map(t=>{if(!t.followPath||!t.followPathId)return t;const s=i.paths.find(h=>h.id===t.followPathId&&h.enabled);if(!(s!=null&&s.points.length))return t;const n=Math.max(.05,Number(t.followDuration)||2),r=Math.min(1,Math.max(0,e/n)),o=Array.isArray(t.followCurve)?t.followCurve:[{x:0,y:0},{x:1,y:1}],a=t.followCurveMode==="跟随导出"?i.settings.exportSettings.keyframeCurve==="bezier"?"bezier":"linear":t.followCurveMode==="贝塞尔"?"bezier":"linear",l=Math.min(1,Math.max(0,E1(o,r,a))),c=Pp(s,l);return c?{...t,x:c.x,y:c.y,rotation:t.rotation+(t.followPathRotation?c.angle:0)}:t})}class l3{constructor(){S(this,"emitters",new Map);S(this,"configs",new Map);S(this,"slotGroups",new Map)}sync(e,t,s,n,r=null){for(const[a,l]of this.emitters){const c=e.systems.find(h=>h.id===a);(!c||this.configs.get(a)!==c.config)&&(l.removeFromParent(),l.destroy({children:!0}),this.emitters.delete(a),this.configs.delete(a))}for(const a of e.systems){s&&!a.config.texture&&(a.config.texture=s);const l=Dn(a.config);if(n)for(const h of l.trailResources)!h.texture&&(h.previewUrl==="/images/trail.png"||h.previewUrl==="/trails/trail.png")&&(h.texture=n);if(s)for(const h of l.imageResources)!h.texture&&h.textureName==="star"&&(h.texture=s);if(this.emitters.has(a.id))continue;const c=new Nv(a.config);t.addChild(c),this.emitters.set(a.id,c),this.configs.set(a.id,a.config)}const o=new Set;for(const a of e.systems){const l=this.emitters.get(a.id);if(!l)continue;const c=r&&a.config.renderLayerMode==="slot"?r.getDrawOrder(a.config.renderLayerSpineId):null,h=r3(e.spines,a.config,c),u=h&&r?this.ensureSlotGroup(h,r,a.config):null;u?(o.add(u.key),l.parent!==u.compensator&&u.compensator.addChild(l)):l.parent!==t&&t.addChild(l)}for(const[a,l]of[...this.slotGroups])if(!o.has(a)){for(const c of[...l.compensator.children])c instanceof Nv&&c.parent===l.compensator&&t.addChild(c);r==null||r.detachSlotObject(l.spineId,l.slotName,l.wrapper),l.wrapper.removeFromParent(),l.wrapper.removeChild(l.compensator),l.compensator.destroy(),l.wrapper.destroy(),this.slotGroups.delete(a)}}ensureSlotGroup(e,t,s){const n=`${e.spineId}:${e.targetSlotName}:${s.renderLayerSlotPosition}`;let r=this.slotGroups.get(n);if(!r){const o=new gs,a=new gs;o.addChild(a),r={key:n,spineId:e.spineId,slotName:e.slotName,wrapper:o,compensator:a,followAttachment:s.renderLayerFollowAttachment,attached:!1},this.slotGroups.set(n,r)}return(!r.attached||!r.wrapper.parent||r.slotName!==e.slotName)&&(r.wrapper.parent&&t.detachSlotObject(r.spineId,r.slotName,r.wrapper),r.slotName=e.slotName,r.attached=t.attachSlotObject(r.spineId,r.slotName,r.wrapper,e.followAttachment)),r.attached?r:null}updateRenderCompensation(e,t){if(t)for(const s of this.slotGroups.values()){if(!s.attached||!s.wrapper.parent)continue;const n=e.spines.find(o=>o.id===s.spineId);if(!n)continue;const r=t.getSlotParentMatrix(s.spineId,s.slotName,n);r&&(r.invert(),s.compensator.transform.setFromMatrix(r))}}destroy(e){for(const t of this.slotGroups.values()){for(const s of[...t.compensator.children])t.compensator.removeChild(s);t.wrapper.removeFromParent(),t.compensator.destroy(),t.wrapper.destroy()}this.slotGroups.clear();for(const[t,s]of this.emitters)s.removeFromParent(),s.destroy({children:!0}),this.emitters.delete(t),this.configs.delete(t)}}async function c3(){const[i,e]=await Promise.all([ze.fromURL("/images/star.png"),ze.fromURL("/images/trail.png")]);return{dotTex:i,trailTex:e}}function h3(i,e,t){for(const s of i.systems){s.config.texture=e;const n=Dn(s.config);if(t)for(const r of n.trailResources)!r.texture&&(r.previewUrl==="/images/trail.png"||r.previewUrl==="/trails/trail.png")&&(r.texture=t);for(const r of n.imageResources)!r.texture&&r.textureName==="star"&&(r.texture=e)}}const u3={class:"stage-wrap"},d3={key:0,class:"hud"},f3={class:"hud-number hud-system-count"},m3={class:"hud-number hud-particle-count"},p3=Zt({__name:"Stage",setup(i){const e=yo(),t=Fe(null),s=Fe(null),n=Fe(!1),r=Fe(!1),o=Fe(""),a=Fe(!1);e.settings.undoLimit>0||(e.settings.undoLimit=20),e.settings.parameterPanelOnRight==null&&(e.settings.parameterPanelOnRight=!0),Number.isFinite(e.settings.backgroundX)||(e.settings.backgroundX=0),Number.isFinite(e.settings.backgroundY)||(e.settings.backgroundY=0),Number.isFinite(e.settings.backgroundOpacity)||(e.settings.backgroundOpacity=1),e.settings.backgroundImageName==null&&(e.settings.backgroundImageName=""),e.settings.backgroundImageData==null&&(e.settings.backgroundImageData=""),e.settings.showEmitter==null&&(e.settings.showEmitter=!0),e.settings.showBones==null&&(e.settings.showBones=!1),e.settings.bonePointDrawSize>0||(e.settings.bonePointDrawSize=1),e.settings.boneAxisDrawSize>0||(e.settings.boneAxisDrawSize=2),e.settings.showSkinMesh==null&&(e.settings.showSkinMesh=!1),e.settings.showGrid==null&&(e.settings.showGrid=!0);let l=null,c=null,h=null,u=null,d=null,f=null,p=null,m=null,g=null,v=null,y=null,x=null,M=null,C=null,w=null,b=[],_=0,E=0,F=0,I=0,k=null,B=null;const D=new ff,X=new l3,N={store:e,holder:t,app:()=>l},U=new i3(N),A=new n3(N,()=>o.value);let P=[];const O=new Map;function L(){c=new gs,l.stage.addChild(c),C=new gs,l.stage.addChild(C),D.createSprite(c),M=new Ds,c.addChild(M),w=new ZR,c.addChild(w.container),u=new Ds,c.addChild(u),h=new Ds,c.addChild(h),f=new Ds,c.addChild(f),p=new Ds,c.addChild(p),m=new Ds,c.addChild(m),g=new Ds,c.addChild(g),v=new Ds,c.addChild(v),y=new Ds,c.addChild(y),x=new Ds,c.addChild(x),d=new Ds,c.addChild(d)}function $(fe){if(fe.button===0){if(o.value&&A.selectedTransformTarget()){A.onGizmoDown(fe);return}U.onPointerDown(fe)||A.onColliderPointerDown(fe)||A.onAttractionDown(fe)||A.onForceFieldDown(fe)||wF(N,fe.clientX,fe.clientY)}}function V(fe){U.onStageDoubleClick(fe)}function j(fe){bF(N,fe)}function K(fe=!0){ff.clearStoreBackground(e,fe)}async function ie(fe){await ff.handleFileChange(e,fe)}Vk({canvasElement:t,canvasFocused:a,undo:$w,save:()=>Ow(e),togglePlay:()=>e.togglePlay(),toStart:()=>e.toStart(),setTool:fe=>{o.value=fe}});function re(){c&&X.sync(e,c,k,B,w)}function pe(fe,Y,W,H){const G=Math.max(2,Math.floor(H)||2);if(fe.config.mode==="stream"&&fe.config.streamBehavior==="loop"){Vv(fe,Y,W,G);return}Y.reset();const q=1/Math.max(1,W),se=[];for(let ue=0;ue=Y)continue;const q=X.emitters.get(G.id);if(!q){W=!1;continue}pe(G,q,fe,Y)}W&&(e.timeline.recorded=!0)}function he(){var W,H,G,q;I=requestAnimationFrame(he);const fe=performance.now()/1e3;let Y=fe-_;if(_=fe,Y>.1&&(Y=.1),l&&c){c.scale.set(e.editor.viewScale),c.position.set(l.screen.width/2+e.editor.viewX,l.screen.height*.5+e.editor.viewY),D.applyTransform(e.settings.backgroundX,e.settings.backgroundY,e.settings.backgroundOpacity),FR(e,l,M,C,b);const se=Math.max(1,e.timeline.fps),ue=e.timeline.frame,ne=ue/se;w==null||w.sync(e.spines,ue,se),re(),X.updateRenderCompensation(e,w),P=a3(e,ne);for(const Be of e.systems){const Me=X.emitters.get(Be.id);if(!Me)continue;Me.setFollowExportCurveMode(e.settings.exportSettings.keyframeCurve==="bezier"?"贝塞尔":"线性");const nt=Be.visible!==!1;Me.visible=nt,Me.renderable=nt;const Te=Be.config;Me.scale.set(Te.rootScaleX,Te.rootScaleY);const vs=new Set(Te.collisionColliderIds);Me.setColliders(Te.collision?P.filter(Tt=>vs.has(Tt.id)):[]),Me.setEmitterFollowSpawn(0,0,0);let Ct={x:Te.centerX,y:Te.centerY,rotation:Te.rootRotation};const xt=Te.emitterFollow&&Te.emitterFollowMode==="bone"?e.spines.find(Tt=>Tt.id===Te.emitterFollowSpineId&&Tt.enabled&&Tt.status==="ready"):null,te=xt&&(w==null?void 0:w.getBoneWorldTransform(xt.id,Te.emitterFollowBoneName))||null,oe=Te.emitterFollow&&Te.emitterFollowMode==="path"?e.paths.find(Tt=>Tt.id===Te.emitterFollowPathId&&Tt.enabled):null,lt=Math.max(.05,Te.emitterFollowDuration),It=Math.min(1,Math.max(0,ne/lt)),Rt=Math.min(1,Math.max(0,E1(Te.emitterFollowCurve,It))),tt=Math.min(1,Math.max(0,Te.emitterFollowOffset)),ni=Te.emitterFollowDirection==="reverse"?(1-tt)*(1-Rt):tt+(1-tt)*Rt,rs=oe?Pp(oe,ni):null;if(te){const Tt=Te.emitterFollowBoneOffsetX,vi=Te.emitterFollowBoneOffsetY,As=te.x+Tt,os=te.y+vi,fn=Te.rootRotation+Te.emitterFollowBoneRotation,ri=Math.max(1e-4,Math.abs(Te.rootScaleX*Te.emitterFollowBoneScaleX)),Bi=Math.max(1e-4,Math.abs(Te.rootScaleY*Te.emitterFollowBoneScaleY));if(Ct={x:As,y:os,rotation:fn},Te.emitterFollowSpace==="local")Me.position.set(As,-os),Me.rotation=-fn*Math.PI/180,Me.scale.set(ri,Bi),Me.setSimulationTransform(As,os,fn,ri,Bi);else{Me.position.set(Te.centerX,-Te.centerY),Me.rotation=-Te.rootRotation*Math.PI/180,Me.scale.set(ri,Bi),Me.setSimulationTransform(Te.centerX,Te.centerY,Te.rootRotation,ri,Bi);const Ni=Ah(Te,As,os,ri,Bi),Er=-(fn-Te.rootRotation);Me.setEmitterFollowSpawn(Ni.x,Ni.y,Er)}}else if(rs){const Tt=rs.angle+(Te.emitterFollowDirection==="reverse"?180:0),vi=Te.emitterAngleMode==="direction"?Tt:Te.rootRotation;if(Ct={x:rs.x,y:rs.y,rotation:vi},Te.emitterFollowSpace==="local")Me.position.set(rs.x,-rs.y),Me.rotation=-vi*Math.PI/180,Me.setSimulationTransform(rs.x,rs.y,vi);else{Me.position.set(Te.centerX,-Te.centerY),Me.rotation=-Te.rootRotation*Math.PI/180,Me.setSimulationTransform(Te.centerX,Te.centerY,Te.rootRotation);const As=Ah(Te,rs.x,rs.y),os=Te.emitterAngleMode==="direction"?-(Tt-Te.rootRotation):0;Me.setEmitterFollowSpawn(As.x,As.y,os)}}else Me.position.set(Te.centerX,-Te.centerY),Me.rotation=-Te.rootRotation*Math.PI/180,Me.setSimulationTransform(Te.centerX,Te.centerY,Te.rootRotation);const ss=Te.shape==="path"&&Te.spawnPathId>0&&e.paths.find(Tt=>Tt.id===Te.spawnPathId&&Tt.enabled&&Tt.points.length>0)||null;Me.setSpawnPathSampler(ss?Tt=>o3(Te,ss,Tt):null,(ss==null?void 0:ss.closed)===!0),O.set(Be.id,Ct)}let de=0;const le=[],Re=e.settings.showBones&&e.activeObjectType==="particle"?e.activeObjectId:0,we=(Be,Me,nt)=>{!Be||Be.id!==Re||Be.visible===!1||jR(le,nt,Me.position.x,Me.position.y)},me=e.timeline,Ue=me.fps,Je=1/Math.max(1,Ue);let qe=F,Ze=0;if(me.playing?(E+=Y,Ze=Math.floor(E/Je),Ze>0&&(E-=Ze*Je)):(E=0,ge(Ue)),me.playing&&Ze>0)for(let Be=0;BeCt.id===e.activeId),nt=(Me==null?void 0:Me.config.mode)==="stream"&&Me.config.streamBehavior==="loop"?Sp(Me.config,Ue):null,vs=me.loop&&(nt==null?void 0:nt.start)===me.playbackStart&&nt.end===me.playbackEnd?me.playbackEnd-1:me.playbackEnd;if(me.frame>vs)if(me.loop)me.frame=me.playbackStart;else{me.frame=me.playbackEnd,me.playing=!1;break}}else{for(const Me of e.systems){const nt=X.emitters.get(Me.id);if(!nt)continue;Me.config.mode==="stream"&&Me.config.streamBehavior==="loop"?(W=Me.frames)!=null&&W.length||Vv(Me,nt,Ue,me.totalFrames):me.frame===0&&nt.reset()}for(const[Me,nt]of X.emitters){const Te=e.systems.find(oe=>oe.id===Me),vs=(Te==null?void 0:Te.config.mode)==="stream"&&Te.config.streamBehavior==="loop",Ct=vs?(H=Te.frames)==null?void 0:H[me.frame]:void 0,xt=me.frame===0&&!vs,te=xt?[]:Ct||nt.update(Je);if(xt?nt.apply([]):Ct&&nt.apply(Ct),(Te==null?void 0:Te.visible)!==!1)for(const oe of te)oe.active&&we(Te,nt,oe);de+=te.length}for(const Me of e.systems){if(!Me.config.texture)continue;Me.frames=Me.frames||[];const nt=X.emitters.get(Me.id);nt&&!(Me.config.mode==="stream"&&Me.config.streamBehavior==="loop")&&(Me.frames[me.frame]=nt.capture())}me.frame++,me.frame>=me.totalFrames&&(me.frame=me.playbackStart,me.recorded=!0)}else{me.playing||(qe=me.frame);for(const Be of e.systems){const Me=X.emitters.get(Be.id),nt=me.playing?F:me.frame,Te=(q=Be.frames)==null?void 0:q[nt],vs=Be.config.mode==="stream"&&Be.config.streamBehavior==="loop"&&!!Te;if((me.recorded||vs)&&Me&&Te){Me.apply(Te);for(const Ct of Te)Ct.active&&(we(Be,Me,Ct),de++)}else if(Me){const Ct=me.frame===0?[]:Me.update(0);if(me.frame===0&&Me.apply([]),Be.visible!==!1)for(const xt of Ct)xt.active&&we(Be,Me,xt);de+=Me.activeCount}}}F=qe,w==null||w.sync(e.spines,qe,Ue);for(const[,Be]of X.emitters)Be.drawTrailMeshDebug(e.settings.showSkinMesh);YR(e,P,v),GR(e,U.selectedNodes,y),$R(e,w,u),OR(e,O,h),LR(e,O,f),BR(e,p),NR(e,m),DR(e,g),XR(o,A.selectedTransformTarget.bind(A),x),HR(le,e,d),s.value&&(s.value.systems=e.systems.length,s.value.particles=de)}}return Oi(async()=>{const fe=t.value;l=new Zb({width:fe.clientWidth||800,height:fe.clientHeight||600,backgroundAlpha:0,antialias:!0}),fe.appendChild(l.view),L(),cs(()=>e.settings.backgroundImageData,W=>D.syncTexture(W),{immediate:!0});const Y=await c3();k=Y.dotTex,B=Y.trailTex,h3(e,k,B),s.value={systems:e.systems.length,particles:0},e.timeline.recorded=!1,e.timeline.frame=0,E=0,F=0,e.timeline.playing=!0,e.timeline.loop=!0;for(const W of e.systems)W.frames=[];e.recalcTotalFrames(),_=performance.now()/1e3,he(),cs(()=>e.systems.map(W=>JSON.stringify(W.config,(H,G)=>H==="texture"||H==="trailTexture"||H==="previewUrl"?void 0:G)).join("|")+`|colliders:${JSON.stringify(e.colliders)}|paths:${JSON.stringify(e.paths)}`,()=>{e.recalcTotalFrames(),e.timeline.recorded=!1,e.timeline.frame=0;for(const W of e.systems)W.frames=[];e.timeline.playing=!0,e.timeline.loop=!0}),Uk(e)}),Cl(()=>{cancelAnimationFrame(I),w==null||w.destroy(),w=null,D.destroy(),c&&l&&X.destroy(c),l&&(l.destroy(!0,{children:!0}),l=null)}),cs(()=>[e.activeObjectType,e.activeObjectId],()=>U.resetSelection()),(fe,Y)=>(z(),J("div",u3,[T("div",{ref_key:"holder",ref:t,class:Ae(["stage-holder",{grid:R(e).settings.showGrid}]),tabindex:"0",onWheel:Ke(j,["prevent"]),onPointerdown:$,onDblclick:Ke(V,["prevent"])},null,34),be(DF,{ctx:N,"active-tool":o.value,"show-settings":n.value,"show-help":r.value,"onUpdate:activeTool":Y[0]||(Y[0]=W=>o.value=W),"onUpdate:showSettings":Y[1]||(Y[1]=W=>n.value=W),"onUpdate:showHelp":Y[2]||(Y[2]=W=>r.value=W),onClearBackground:K,onBackgroundFile:ie},null,8,["active-tool","show-settings","show-help"]),be(s3,{show:n.value,onClose:Y[3]||(Y[3]=W=>n.value=!1)},null,8,["show"]),be(xF,{show:r.value,onClose:Y[4]||(Y[4]=W=>r.value=!1)},null,8,["show"]),s.value?(z(),J("div",d3,[Y[5]||(Y[5]=gt(" 系统: ",-1)),T("b",f3,ye(s.value.systems),1),Y[6]||(Y[6]=gt(" · 粒子(骨骼): ",-1)),T("b",m3,ye(s.value.particles),1),Y[7]||(Y[7]=gt(" · 根骨骼: ",-1)),Y[8]||(Y[8]=T("b",null,"root",-1)),Y[9]||(Y[9]=T("span",{class:"hud-tip"},"滚轮缩放 · 左键拖动画布",-1))])):xe("",!0)]))}}),g3=Jt(p3,[["__scopeId","data-v-38dbe6fc"]]),v3=[{x:0,y:0},{x:1,y:1}],Sm=[{x:0,y:1},{x:1,y:1}],y3=[{x:0,y:0},{x:.2,y:1},{x:.8,y:1},{x:1,y:0}],Mm=[{x:0,y:0},{x:.1,y:1},{x:.9,y:1},{x:1,y:0}],Tm=[{x:0,y:1},{x:1,y:1}],_m=[{x:0,y:1},{x:1,y:1}],Qt=mo({visible:!1,title:"",detail:"",progress:0,indeterminate:!1,failed:!1});let bc=0;function x3(i){return new Promise(e=>window.setTimeout(e,i))}function Vw(i,e){const t=++bc,s=performance.now();Object.assign(Qt,{visible:!0,title:i,detail:e,progress:0,indeterminate:!1,failed:!1});const n=(o,a)=>{t===bc&&(Qt.indeterminate=o==null,o!=null&&(Qt.progress=Math.min(100,Math.max(0,o))),a&&(Qt.detail=a))},r=async(o,a)=>{if(t!==bc)return;Qt.failed=o,Qt.indeterminate=!1,Qt.progress=o?Qt.progress:100,Qt.detail=a,await x3(Math.max(180,(o?850:450)-(performance.now()-s))),t===bc&&(Qt.visible=!1)};return{update:n,paint:()=>new Promise(o=>requestAnimationFrame(()=>o())),finish:(o="已完成")=>r(!1,o),fail:(o="操作失败")=>r(!0,o)}}async function b3(i,e){if(!i.body)return e(null),i.text();const t=Number(i.headers.get("content-length")),s=Number.isFinite(t)&&t>0,n=i.body.getReader(),r=new TextDecoder;let o=0,a="";for(e(s?0:null);;){const{done:l,value:c}=await n.read();if(l)break;o+=c.byteLength,a+=r.decode(c,{stream:!0}),e(s?Math.min(1,o/t):null)}return a+=r.decode(),s&&e(1),a}const w3="3.8";function di(i,e,t){i[e]==null&&i[t]!=null&&(i[e]=i[t]),delete i[t]}function Cm(i){if(!i||typeof i!="object")return;if(Array.isArray(i)){for(const t of i)Cm(t);return}const e=i;Array.isArray(e.curve)&&delete e.curve;for(const t of Object.values(e))Cm(t)}function S3(i){for(const e of i.bones)di(e,"transform","inherit");for(const e of i.transform||[])di(e,"rotateMix","mixRotate"),e.translateMix==null&&(e.translateMix=e.mixX??e.mixY),e.scaleMix==null&&(e.scaleMix=e.mixScaleX??e.mixScaleY),di(e,"shearMix","mixShearY"),delete e.mixX,delete e.mixY,delete e.mixScaleX,delete e.mixScaleY;for(const e of i.path||[])di(e,"rotateMix","mixRotate"),e.translateMix==null&&(e.translateMix=e.mixX??e.mixY),delete e.mixX,delete e.mixY;for(const e of i.skins)for(const t of Object.values(e.attachments||{}))for(const s of Object.values(t||{}))s.parent!=null&&di(s,"deform","timelines")}function M3(i){for(const e of Object.values(i.slots||{}))di(e,"color","rgba"),di(e,"twoColor","rgba2")}function T3(i){for(const e of Object.values(i.bones||{}))for(const t of e.rotate||[])di(t,"angle","value")}function _3(i){for(const e of Object.values(i.transform||{}))for(const t of e)di(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),t.scaleMix==null&&(t.scaleMix=t.mixScaleX??t.mixScaleY),di(t,"shearMix","mixShearY"),delete t.mixX,delete t.mixY,delete t.mixScaleX,delete t.mixScaleY}function C3(i){for(const e of Object.values(i.path||{})){for(const t of["position","spacing"])for(const s of e[t]||[])di(s,t,"value");for(const t of e.mix||[])di(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),delete t.mixX,delete t.mixY}}function A3(i){if(!i.attachments)return;const e=i.deform||(i.deform={});for(const[t,s]of Object.entries(i.attachments)){const n=e[t]||(e[t]={});for(const[r,o]of Object.entries(s)){const a=n[r]||(n[r]={});for(const[l,c]of Object.entries(o))c.deform&&(a[l]=c.deform)}}delete i.attachments}function E3(i){i.skeleton.spine=w3,S3(i);for(const e of Object.values(i.animations))M3(e),T3(e),_3(e),C3(e),A3(e);return Cm(i.animations),i}function I3(i,e,t,s,n=!1){if(n){let l=0;for(let c=0;c[...n].sort((a,l)=>a-l);let o=!0;for(;o;){o=!1;const a=r();for(let l=0;lf&&(f=m,d=p)}d>=0&&(n.add(d),o=!0)}}return r().map(a=>i[a])}function ey(i,e,t,s,n){const r=t-e+1;if(r<2)return 0;const o=n?e:t,a=n?e+1:t-1,l=n?e+2:t-2,c=Math.abs(i[a].frame-i[o].frame);if(r>=3&&c>0&&Math.abs(Math.abs(i[l].frame-i[a].frame)-c)<1e-6){const u=i[o].values[s],d=i[a].values[s],f=i[l].values[s];return n?(-3*u+4*d-f)/(2*c):(3*u-4*d+f)/(2*c)}const h=i[a].frame-i[o].frame;return h?(i[a].values[s]-i[o].values[s])/h:0}function ty(i,e,t){const s=i[t].frame-i[e].frame,n=[];for(let r=0;rd.values[r])),c=Math.max(...i.slice(e,t+1).map(d=>d.values[r])),h=o+ey(i,e,t,r,!0)*s/3,u=a-ey(i,e,t,r,!1)*s/3;n.push([Math.max(l,Math.min(c,h)),Math.max(l,Math.min(c,u))])}return{values:n}}function R3(i,e,t,s,n){const r=1-n;return r*r*r*i+3*r*r*n*e+3*r*n*n*t+n*n*n*s}function P3(i,e,t,s,n,r=!1){if(r){let c=0;for(let h=0;h[...n].sort((l,c)=>l-c);let o=!0;for(;o;){o=!1;const l=r();for(let c=0;cm&&(m=v,p=g)}p>=0&&(n.add(p),o=!0)}}const a=r();return{samples:a.map(l=>i[l]),controls:a.slice(0,-1).map((l,c)=>ty(i,l,a[c+1]))}}function k3(i){if(!i.length)return[];const e=[i[0]];for(let t=1;t180;)s-=360;for(;s-e[t-1]<-180;)s+=360;e.push(s)}return e}function ns(i){if(!Number.isFinite(i))return 0;const e=Math.round(i*1e5)/1e5;return Object.is(e,-0)?0:e}function F3(i,e,t,s){const n=Math.max(2,Math.min(16,Math.round(Number(i.trailGridRows)||2))),r=Math.max(2,Math.min(32,Math.round(Number(i.trailGridCols)||2))),o=Math.max(2,t.length),a=e.lengthMode==="random"?Math.max(1,Number(e.lengthMin)||0,Number(e.lengthMax)||0):Math.max(.001,Number(e.length)||100),l=e.widthSizeMode==="random"?Math.max(1,Number(e.widthMin)||0,Number(e.widthMax)||0):Math.max(.001,Number(e.width)||100),c=(Number(e.rotation)||0)*Math.PI/180,h=Math.cos(c),u=Math.sin(c),d=[],f=[],p=[],m=[],g=[];for(let x=0;x=0;x--)g.push({col:x,row:n-1});for(let x=n-2;x>=1;x--)g.push({col:0,row:x});const v=g.length;for(let x=1;x|\s]+/g,"_").replace(/^_+|_+$/g,"")||e}function jw(i,e){let t=i,s=2;for(;e.has(t);)t=`${i}_${s++}`;return e.add(t),t}function L3(i){return i.replace(/\.[^./\\]+$/,"")}function Hw(i,e){return L3([i,e].filter(Boolean).join("/").replace(/\\/g,"/").replace(/\/{2,}/g,"/").replace(/^\.\//,""))}function B3(i){var s,n;const e=Number(((s=i==null?void 0:i.orig)==null?void 0:s.width)??(i==null?void 0:i.width))||0,t=Number(((n=i==null?void 0:i.orig)==null?void 0:n.height)??(i==null?void 0:i.height))||0;return{width:e,height:t}}function Sc(i){return Math.round(Math.max(0,Math.min(1,i))*255).toString(16).padStart(2,"0")}function oy(i,e){return[(i>>16&255)/255,(i>>8&255)/255,(i&255)/255,Math.max(0,Math.min(1,e))]}function tl(i,e){return ns(i/e)}function N3(i,e){const t=i.config,s=t.lifeMode==="fixed"?Math.max(0,Number(t.lifeMin)||0):Math.max(0,Number(t.lifeMin)||0,Number(t.lifeMax)||0),n=Math.max(0,Number(t.delay)||0);let r;return t.mode!=="stream"?r=n+s:t.streamBehavior!=="loop"?r=n+Math.max(1/e,Number(t.duration)||0)+s:r=n+pr(t,e).total/e,Math.max(1,Math.ceil(r*e)+1)}function D3(i,e,t){const s=i.config;if(s.mode!=="stream"||s.streamBehavior!=="loop")return new Set;const n=Sp(s,e),r=Math.max(1,t)/Math.max(1,e);return new Set([Math.round(n.start*r),Math.round(n.end*r)])}function Eh(i,e){return e?i.boneName:`${i.spawnId??"legacy"}_${i.boneName}`}function U3(i,e,t,s){const n=new Set;for(const r of i)for(const o of r)n.add(Eh(o,e));return[...n].sort().map((r,o)=>({key:r,name:jw(`${s}_${o}`,t),states:i.map(a=>a.find(l=>Eh(l,e)===r)||null)}))}function ay(i,e){const t=new Set(e.states.map(s=>s==null?void 0:s.resourceId).filter(s=>typeof s=="number"));return i.config.imageResources.filter(s=>t.has(s.id))}function $3(i,e,t,s){const n=e*t/s,r=Math.min(i.states.length-1,Math.max(0,Math.floor(n))),o=Math.min(i.states.length-1,r+1),a=i.states[r],l=i.states[o];if(!a||!l||Eh(a,!0)!==Eh(l,!0)||a.spawnId!==l.spawnId)return a;const c=n-r;if(c<=1e-6)return a;const h=(d,f)=>(d??0)+((f??d??0)-(d??0))*c,u=a.trailState&&l.trailState&&a.trailState.resourceId===l.trailState.resourceId?{...a.trailState,width:h(a.trailState.width,l.trailState.width),alpha:h(a.trailState.alpha,l.trailState.alpha),bones:a.trailState.bones.map((d,f)=>{const p=l.trailState.bones[f]||d;return{...d,worldX:h(d.worldX??d.x,p.worldX??p.x),worldY:h(d.worldY??d.y,p.worldY??p.y),worldRotation:h(d.worldRotation??-d.rotation,p.worldRotation??-p.rotation)}})}:a.trailState;return{...a,worldX:h(a.worldX,l.worldX),worldY:h(a.worldY,l.worldY),worldRotation:h(a.worldRotation,l.worldRotation),worldScaleX:h(a.worldScaleX,l.worldScaleX),worldScaleY:h(a.worldScaleY,l.worldScaleY),alpha:h(a.alpha,l.alpha),trailState:u}}function ly(i,e){return!i||i==="跟随导出"?e.keyframeCurve:i==="贝塞尔"?"bezier":"linear"}function Po(i,e,t,s,n,r=new Set,o=new Set,a=n.keyframeCurve){if(!i.length)return[];const l=new Set(r);for(const u of o)l.add(u);const c=a==="bezier"&&n.spineVersion!=="3.8"?Gw(i,s,l,o):{samples:Yw(i,s,l,o),controls:[]},h=c.samples.map(u=>{const d={time:tl(u.frame,e)};return t.forEach((f,p)=>{d[f]=ns(u.values[p])}),o.has(u.frame)&&(d.curve="stepped"),d});for(let u=0;u0&&n&&e.add(t-1),s&&e.add(t))}return e}function V3(i){const e=new Set;for(let t=0;t0&&n&&e.add(t-1),s&&e.add(t))}return e}function j3(i,e){var s;if(!i.shapeEnabled||!((s=i.shapeCurve)!=null&&s.length))return 1;const t=[...i.shapeCurve].sort((n,r)=>n.x-r.x);if(e<=t[0].x)return Math.max(0,t[0].y);for(let n=1;n{(o!==r||s.has(a))&&(n.push(t(o,a)),r=o)}),n}function W3(i,e,t){const s=i.imageMode==="sequence"?i.sequenceFrames[e]:void 0,n=(s==null?void 0:s.name)||i.textureName||`image_${i.id}`,r=(s==null?void 0:s.texture)||i.texture,o=B3(r);(!o.width||!o.height)&&t.push({code:"missing-image",message:`图片“${n}”缺失或尺寸不可读,已保留路径。`});const a=o.width||1,l=o.height||1;return{path:Hw(i.textureFolder,n),x:ns((.5-i.anchorX)*a),y:ns((i.anchorY-.5)*l),width:ns(a),height:ns(l)}}function cy(i,e){const t=[];for(const n of e){const r=n.imageMode==="sequence"?Math.max(1,n.sequenceFrames.length):1;for(let o=0;o1;return new Map(t.map((n,r)=>[n,s?`${i}_${r}`:i]))}function z3(i,e,t,s,n=s.keyframeCurve,r=new Set,o=new Set){if(!i.length)return[];const a=new Set;for(let d=1;d({frame:f,values:d})),c=1/255,h=n==="bezier"&&s.spineVersion!=="3.8"?Gw(l,[c,c,c,.01],a,r):{samples:Yw(l,[c,c,c,.01],a,r),controls:[]},u=h.samples.map(d=>{const f={time:tl(d.frame,t),color:`${Sc(d.values[0])}${Sc(d.values[1])}${Sc(d.values[2])}${Sc(d.values[3])}`};return r.has(d.frame)&&(f.curve="stepped"),f});if(h.controls.length)for(let d=0;d({time:tl(p,n),name:f??null}),l);h.length&&(c.attachment=h);const u=z3(s,t,n,r,o,a,l);u.length&&(c.rgba=u)}function uy(i){var p;const e=i.settings,t=Math.max(1,Number(i.timeline.fps)||30),s=Math.max(1,Math.round(e.fps||30)),n=e.integerFrameAlignment?s:t,r=[],o=i.systems.filter(m=>m.visible!==!1),a={skeleton:{hash:"",spine:e.spineVersion,x:0,y:0,width:0,height:0,images:e.imagesPath||"./images/"},bones:[{name:"root"}],slots:[],skins:[{name:"default",attachments:{}}],animations:{}};e.omitFps||(a.skeleton.fps=s);const l=a.skins[0].attachments,c=new Set(["root"]),h=[...new Set([...i.timeline.animations.length?i.timeline.animations:["animation"],...o.map(m=>m.animation||"animation")])],u=new Map;for(const m of o){const g=Math.min(((p=m.frames)==null?void 0:p.length)||0,N3(m,t)),v=(m.frames||[]).slice(0,g);v.length||r.push({code:"empty-cache",message:`“${m.config.name}”没有可用帧缓存。`});const y=jw(O3(m.config.name,`system_${m.id}`),c);a.bones.push({name:y,parent:"root"});const x=U3(v,e.bonePool,c,y),M=Math.max(0,(g-1)/t),C=Math.max(1,Math.ceil(M*n)+1),w=D3(m,t,n),b=u.get(m.animation)||[];b.push({system:m,tracks:x,targetFrames:C,boundaryFrames:w,attachmentPrefix:y}),u.set(m.animation,b);for(const _ of x){a.bones.push({name:_.name,parent:y});const E=ay(m,_),F=new Set(E.map(X=>X.blend)),I=[],k=[];for(const X of F){const N=`${_.name}_${X}`;I.push(N),a.slots.push({name:N,bone:_.name,color:"ffffff00",blend:sy[X]});const U=l[N]||(l[N]={}),A=E.filter(O=>O.blend===X),P=cy(y,A);for(const O of A){const L=O.imageMode==="sequence"?Math.max(1,O.sequenceFrames.length):1;for(let $=0;${var $;return(($=L==null?void 0:L.trailState)==null?void 0:$.resourceId)===X.id}))continue;const N=Math.max(2,Math.min(16,Math.round(X.boneCount||3))),U=[];for(let L=0;La.bones.findIndex($=>$.name===L)),O=Hw("",X.textureName||`trail_${X.id}`);(l[A]||(l[A]={}))[`trail_${X.id}`]=F3(m.config,X,P,O),X.texture||r.push({code:"missing-image",message:`拖尾图片“${X.textureName||X.id}”缺失,已保留路径。`})}const B=new Set([...I,...k]),D=a.slots.filter(X=>B.has(String(X.name)));D.length&&(a.slots=a.slots.filter(X=>!D.includes(X)),a.slots.push(...D.filter(X=>k.includes(String(X.name))),...D.filter(X=>I.includes(String(X.name)))))}}for(const m of h){const g=u.get(m)||[],v={bones:{},slots:{}};let y=!1;for(const{system:x,tracks:M,targetFrames:C,boundaryFrames:w,attachmentPrefix:b}of g)for(const _ of M){const E=Array.from({length:C},(j,K)=>$3(_,K,t,n)),F=E.map(j=>!!(j!=null&&j.active)),I=[],k=[],B=[];E.forEach((j,K)=>{j!=null&&j.active&&(I.push({frame:K,values:[j.worldX??j.x,j.worldY??j.y]}),k.push(j.worldRotation??j.rotation),B.push({frame:K,values:[j.worldScaleX??j.scaleX,j.worldScaleY??j.scaleY]}))});const D=k3(k),X=I.map((j,K)=>({frame:j.frame,values:[D[K]??0]})),N=X3(E);for(const j of w)N.add(j);const U=V3(E),A={},P=Po(I,n,["x","y"],[iy,iy],e,N,U),O=Po(X,n,["value"],[ry],e,N,U),L=Po(B,n,["x","y"],[wc,wc],e,N,U);P.length&&(A.translate=P),O.length&&(A.rotate=O),L.length&&(A.scale=L),Object.keys(A).length&&(v.bones[_.name]=A,y=!0);const $=ay(x,_),V=new Set($.map(j=>j.blend));for(const j of V){const K=$.filter(Y=>Y.blend===j),ie=cy(b,K),re=[],pe=[];let ge=16777215;for(let Y=0;Yse.id===W.resourceId):void 0,G=!!W&&F[Y]&&W.imageVisible!==!1&&(H==null?void 0:H.blend)===j;W&&(H==null?void 0:H.blend)===j&&(ge=W.colorHex);const q=G?ie.get(`${H.id}_${W.imageFrameIndex??0}`):void 0;re.push(q??null),pe.push(oy(ge,G?W.alpha:0))}const he=K.filter(Y=>Y.independentAlpha==="curve").map(Y=>ly(Y.alphaCurveMode,e)),fe=he.length?he.includes("bezier")?"bezier":"linear":ly(x.config.alphaMode==="curve"?x.config.curveMode:void 0,e);hy(v,`${_.name}_${j}`,re,pe,n,e,fe,U,w),re.some(Boolean)&&(y=!0)}if(x.config.trail)for(const j of x.config.trailResources){const K=Math.max(2,Math.min(16,Math.round(j.boneCount||3))),ie=E.map(q=>{var se;return((se=q==null?void 0:q.trailState)==null?void 0:se.resourceId)===j.id?q.trailState:void 0}),re=ie.find(q=>!!q);if(!re)continue;const pe=G3(ie),ge=Y3(ie),he=j.widthSizeMode==="random"?Math.max(1,Number(j.widthMin)||0,Number(j.widthMax)||0):Math.max(.001,Number(j.width)||100);let fe=re;const Y=ie.map(q=>(q&&(fe=q),fe));for(let q=0;q{const Be=qe==null?void 0:qe.bones[Math.min(qe.bones.length-1,q)];if(!Be)return;const Me={x:Be.worldX??Be.x,y:Be.worldY??Be.y,rotation:Be.worldRotation??-Be.rotation};se.push({frame:Ze,values:[Me.x,Me.y]}),ue.push({frame:Ze,values:[Me.rotation]}),ne.push({frame:Ze,values:[1,Math.max(0,qe.width/he)*le]})});const Re=`${_.name}_trail_${j.id}_${q}`,we={},me=Po(se,n,["x","y"],[ny,ny],e,de,ge),Ue=Po(ue,n,["value"],[ry],e,de,ge),Je=Po(ne,n,["x","y"],[wc,wc],e,de,ge);me.length&&(we.translate=me),Ue.length&&(we.rotate=Ue),Je.length&&(we.scale=Je),Object.keys(we).length&&(v.bones[Re]=we)}const W=ie.map(()=>`trail_${j.id}`);let H=re.colorHex;const G=ie.map(q=>(q&&(H=q.colorHex),oy(H,q?q.alpha:0)));hy(v,`${_.name}_trail_${j.id}`,W,G,n,e,e.keyframeCurve,ge,w),y=!0}}(y||!e.excludeEmptyAnimations)&&(a.animations[m]=v)}!Object.keys(a.animations).length&&!e.excludeEmptyAnimations&&(a.animations.animation={bones:{},slots:{}});const d=e.spineVersion==="3.8"?E3(a):a,f=JSON.stringify(d,null,2);return{json:d,text:f,warnings:r,particleSystemCount:o.length,animationCount:Object.keys(d.animations).length,boneCount:d.bones.length}}function q3(i,e){const t=new Blob([i.text],{type:"application/json;charset=utf-8"}),s=URL.createObjectURL(t),n=document.createElement("a");n.href=s,n.download=/\.json$/i.test(e)?e:`${e||"SpineParticle"}.json`,n.style.display="none",document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(s),1e3)}class W6{constructor(){S(this,"array",[])}add(e){const t=this.contains(e);return this.array[e|0]=e|0,!t}contains(e){return this.array[e|0]!==void 0}remove(e){this.array[e|0]=void 0}clear(){this.array.length=0}}class K3{constructor(){S(this,"entries",{});S(this,"size",0)}add(e){const t=this.entries[e];return this.entries[e]=!0,t?!1:(this.size++,!0)}addAll(e){const t=this.size;for(let s=0,n=e.length;s1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(e,t){e.r=((t&4278190080)>>>24)/255,e.g=((t&16711680)>>>16)/255,e.b=((t&65280)>>>8)/255,e.a=(t&255)/255}static rgb888ToColor(e,t){e.r=((t&16711680)>>>16)/255,e.g=((t&65280)>>>8)/255,e.b=(t&255)/255}toRgb888(){const e=t=>`0${(t*255).toString(16)}`.slice(-2);return+`0x${e(this.r)}${e(this.g)}${e(this.b)}`}static fromString(e,t=new Js){return t.setFromString(e)}};S(Js,"WHITE",new Js(1,1,1,1)),S(Js,"RED",new Js(1,0,0,1)),S(Js,"GREEN",new Js(0,1,0,1)),S(Js,"BLUE",new Js(0,0,1,1)),S(Js,"MAGENTA",new Js(1,0,1,1));let st=Js;const Ht=class Ht{static clamp(e,t,s){return es?s:e}static cosDeg(e){return Math.cos(e*Ht.degRad)}static sinDeg(e){return Math.sin(e*Ht.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*Ht.radDeg}static signum(e){return e>0?1:e<0?-1:0}static toInt(e){return e>0?Math.floor(e):Math.ceil(e)}static cbrt(e){const t=Math.pow(Math.abs(e),.3333333333333333);return e<0?-t:t}static randomTriangular(e,t){return Ht.randomTriangularWith(e,t,(e+t)*.5)}static randomTriangularWith(e,t,s){const n=Math.random(),r=t-e;return n<=(s-e)/r?e+Math.sqrt(n*r*(s-e)):t-Math.sqrt((1-n)*r*(t-s))}static isPowerOfTwo(e){return e&&(e&e-1)===0}};S(Ht,"epsilon",1e-5),S(Ht,"epsilon2",Ht.epsilon*Ht.epsilon),S(Ht,"PI",3.1415927),S(Ht,"PI2",Ht.PI*2),S(Ht,"invPI2",1/Ht.PI2),S(Ht,"radiansToDegrees",180/Ht.PI),S(Ht,"radDeg",Ht.radiansToDegrees),S(Ht,"degreesToRadians",Ht.PI/180),S(Ht,"degRad",Ht.degreesToRadians);let Ee=Ht;const ai=class ai{apply(e,t,s){return t===void 0||s===void 0?this.applyInternal(e):e+(t-e)*this.applyInternal(s)}};S(ai,"linear",new class extends ai{applyInternal(e){return e}}),S(ai,"smooth",new class extends ai{applyInternal(e){return e*e*(3-2*e)}}),S(ai,"slowFast",new class extends ai{applyInternal(e){return e*e}}),S(ai,"fastSlow",new class extends ai{applyInternal(e){return(e-1)*(e-1)*-1+1}}),S(ai,"circle",new class extends ai{applyInternal(e){return e<=.5?(e*=2,(1-Math.sqrt(1-e*e))/2):(e--,e*=2,(Math.sqrt(1-e*e)+1)/2)}});let na=ai;class Z3 extends na{constructor(t){super();S(this,"power",2);this.power=t}applyInternal(t){return t<=.5?Math.pow(t*2,this.power)/2:Math.pow((t-1)*2,this.power)/(this.power%2===0?-2:2)+1}}class z6 extends Z3{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2===0?-1:1)+1}}const or=class or{static arrayCopy(e,t,s,n,r){for(let o=t,a=n;o=t?e:or.setArraySize(e,t,s)}static newArray(e,t){const s=[];for(let n=0;n0?this.items.pop():this.instantiator()}free(e){var t;(t=e.reset)==null||t.call(e),this.items.push(e)}freeAll(e){for(let t=0;tthis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=e,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}}class Z6{constructor(e=32){S(this,"values");S(this,"addedValues",0);S(this,"lastValue",0);S(this,"mean",0);S(this,"dirty",!0);this.values=new Array(e)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(e){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let e=0;for(let t=0;t{h.width=parseInt(s[1]),h.height=parseInt(s[2])},n.format=()=>{},n.filter=h=>{h.minFilter=Ge.enumValue(la,s[1]),h.magFilter=Ge.enumValue(la,s[2])},n.repeat=h=>{s[1].indexOf("x")!==-1&&(h.uWrap=ca.Repeat),s[1].indexOf("y")!==-1&&(h.vWrap=ca.Repeat)},n.pma=h=>{h.pma=s[1]==="true"};var r={};r.xy=h=>{h.x=parseInt(s[1]),h.y=parseInt(s[2])},r.size=h=>{h.width=parseInt(s[1]),h.height=parseInt(s[2])},r.bounds=h=>{h.x=parseInt(s[1]),h.y=parseInt(s[2]),h.width=parseInt(s[3]),h.height=parseInt(s[4])},r.offset=h=>{h.offsetX=parseInt(s[1]),h.offsetY=parseInt(s[2])},r.orig=h=>{h.originalWidth=parseInt(s[1]),h.originalHeight=parseInt(s[2])},r.offsets=h=>{h.offsetX=parseInt(s[1]),h.offsetY=parseInt(s[2]),h.originalWidth=parseInt(s[3]),h.originalHeight=parseInt(s[4])},r.rotate=h=>{const u=s[1];u==="true"?h.degrees=90:u!=="false"&&(h.degrees=parseInt(u))},r.index=h=>{h.index=parseInt(s[1])};let o=t.readLine();for(;o&&o.trim().length===0;)o=t.readLine();for(;!(!o||o.trim().length===0||t.readEntry(s,o)===0);)o=t.readLine();let a=null,l=null,c=null;for(;o!==null;)if(o.trim().length===0)a=null,o=t.readLine();else if(a){const h=new zw(a,o);for(;;){const u=t.readEntry(s,o=t.readLine());if(u===0)break;const d=r[s[0]];if(d)d(h);else{l||(l=[]),c||(c=[]),l.push(s[0]);const f=[];for(let p=0;p0&&c&&c.length>0&&(h.names=l,h.values=c,l=null,c=null),h.u=h.x/a.width,h.v=h.y/a.height,h.degrees===90?(h.u2=(h.x+h.height)/a.width,h.v2=(h.y+h.width)/a.height):(h.u2=(h.x+h.width)/a.width,h.v2=(h.y+h.height)/a.height),this.regions.push(h)}else{for(a=new tO(o.trim());t.readEntry(s,o=t.readLine())!==0;){const h=n[s[0]];h&&h(a)}this.pages.push(a)}}findRegion(e){for(let t=0;t=this.lines.length?null:this.lines[this.index++]}readEntry(e,t){if(!t||(t=t.trim(),t.length===0))return 0;const s=t.indexOf(":");if(s===-1)return 0;e[0]=t.substr(0,s).trim();for(let n=1,r=s+1;;n++){const o=t.indexOf(",",r);if(o===-1)return e[n]=t.substr(r).trim(),n;if(e[n]=t.substr(r,o-r).trim(),r=o+1,n===4)return 4}}}class tO{constructor(e){S(this,"name");S(this,"minFilter",la.Nearest);S(this,"magFilter",la.Nearest);S(this,"uWrap",ca.ClampToEdge);S(this,"vWrap",ca.ClampToEdge);S(this,"texture",null);S(this,"width",0);S(this,"height",0);S(this,"pma",!1);S(this,"regions",[]);this.name=e}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap);for(const t of this.regions)t.texture=e}}class zw extends Ww{constructor(t,s){super();S(this,"page");S(this,"name");S(this,"x",0);S(this,"y",0);S(this,"offsetX",0);S(this,"offsetY",0);S(this,"originalWidth",0);S(this,"originalHeight",0);S(this,"index",0);S(this,"degrees",0);S(this,"names",null);S(this,"values",null);this.page=t,this.name=s,t.regions.push(this)}}const Lh=class Lh{constructor(e){S(this,"name");S(this,"timelineAttachment");S(this,"timelineSlots",Lh.empty);if(!e)throw new Error("name cannot be null.");this.name=e,this.timelineAttachment=this}isTimelineActive(e,t,s){let n=e[t];if(n.bone.isActive()){const r=(s?n.getAppliedPose():n.getPose()).getAttachment();if(r!=null&&r.timelineAttachment===this)return!0}for(let r=0,o=this.timelineSlots.length;r>1)*l;const c=s.appliedPose.deform;let h=this.vertices;const u=this.bones;if(!u){c.length>0&&(h=c);const m=s.bone.appliedPose,g=m.worldX,v=m.worldY,y=m.a,x=m.b,M=m.c,C=m.d;for(let w=n,b=a;b=this.regions.length&&(t=this.regions.length-1),t}getUVs(e){return this.uvs[e]}hasPathSuffix(){return this.pathSuffix}getPath(e,t){if(!this.pathSuffix)return e;let s=e;const n=(this.start+t).toString();for(let r=this.digits-n.length;r>0;r--)s+="0";return s+=n,s}static nextID(){return Vo._nextID++}};S(Vo,"_nextID",0);let ua=Vo;var _s;(function(i){i[i.hold=0]="hold",i[i.once=1]="once",i[i.loop=2]="loop",i[i.pingpong=3]="pingpong",i[i.onceReverse=4]="onceReverse",i[i.loopReverse=5]="loopReverse",i[i.pingpongReverse=6]="pingpongReverse"})(_s||(_s={}));const qw=[_s.hold,_s.once,_s.loop,_s.pingpong,_s.onceReverse,_s.loopReverse,_s.pingpongReverse];class kp{constructor(e,t,s){S(this,"name");S(this,"timelines",[]);S(this,"timelineIds");S(this,"bones");S(this,"color",new st(1,1,1,1));S(this,"duration");if(!e)throw new Error("name cannot be null.");this.name=e,this.duration=s,this.timelineIds=new K3,this.bones=[],this.setTimelines(t)}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e;const t=e.length;this.timelineIds.clear(),this.bones.length=0;const s=new Set,n=e;for(let r=0;r0&&(t%=this.duration));const u=this.timelines;for(let d=0,f=u.length;dt)return r-s;return n-s}};function sO(i){return typeof i=="object"&&i!==null&&typeof i.slotIndex=="number"}class bo extends Bt{constructor(t,s,...n){super(t,...n);S(this,"curves");this.curves=Ge.newFloatArray(t+s*18),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){const s=this.getFrameCount()+t*18;if(this.curves.length>s){const n=Ge.newFloatArray(s);Ge.arrayCopy(this.curves,0,n,0,s),this.curves=n}}setBezier(t,s,n,r,o,a,l,c,h,u,d){const f=this.curves;let p=this.getFrameCount()+t*18;n===0&&(f[s]=2+p);const m=(r-a*2+c)*.03,g=(o-l*2+h)*.03,v=((a-c)*3-r+u)*.006,y=((l-h)*3-o+d)*.006;let x=m*2+v,M=g*2+y,C=(a-r)*.3+m+v*.16666667,w=(l-o)*.3+g+y*.16666667,b=r+C,_=o+w;for(let E=p+18;pt){const h=this.frames[s],u=this.frames[s+n];return u+(t-h)/(o[r]-h)*(o[r+1]-u)}const a=r+18;for(r+=2;r=t){const h=o[r-2],u=o[r-1];return u+(t-h)/(o[r]-h)*(o[r+1]-u)}s+=this.getFrameEntries();const l=o[a-2],c=o[a-1];return c+(t-l)/(this.frames[s]-l)*(this.frames[s+n]-c)}}class Fn extends bo{constructor(e,t,s){super(e,t,s)}getFrameEntries(){return 2}setFrame(e,t,s){e<<=1,this.frames[e]=t,this.frames[e+1]=s}getCurveValue(e){const t=this.frames;let s=t.length-2;for(let r=2;r<=s;r+=2)if(t[r]>e){s=r-2;break}const n=this.curves[s>>1];switch(n){case 0:{const r=t[s],o=t[s+1];return o+(e-r)/(t[s+2]-r)*(t[s+2+1]-o)}case 1:return t[s+1]}return this.getBezierValue(e,s,1,n-2)}getRelativeValue(e,t,s,n,r,o){if(e>2];switch(f){case 0:{const p=u[d];l=u[d+1],c=u[d+2],h=u[d+3];const m=(s-p)/(u[d+4]-p);l+=(u[d+4+1]-l)*m,c+=(u[d+4+2]-c)*m,h+=(u[d+4+3]-h)*m;break}case 1:l=u[d+1],c=u[d+2],h=u[d+3];break;default:l=this.getBezierValue(s,d,1,f-2),c=this.getBezierValue(s,d,2,f+18-2),h=this.getBezierValue(s,d,3,f+36-2)}if(n!==1)if(r===Ve.setup){const p=e.data.setupPose.color;l=p.r+(l-p.r)*n,c=p.g+(c-p.g)*n,h=p.b+(h-p.b)*n}else l=a.r+(l-a.r)*n,c=a.g+(c-a.g)*n,h=a.b+(h-a.b)*n;a.r=l<0?0:l>1?1:l,a.g=c<0?0:c>1?1:c,a.b=h<0?0:h>1?1:h}}class lS extends Fn{constructor(t,s,n){super(t,s,`${et.alpha}|${n}`);S(this,"slotIndex",0);this.slotIndex=n}apply(t,s,n,r,o,a,l,c,h){const u=t.slots[this.slotIndex];if(!u.bone.active)return;const d=(h?u.appliedPose:u.pose).color;let f=0;const p=this.frames;if(n1?1:f}}class cS extends vu{constructor(e,t,s){super(e,t,s,`${et.rgb}|${s}`,`${et.alpha}|${s}`,`${et.rgb2}|${s}`)}getFrameEntries(){return 8}setFrame(e,t,s,n,r,o,a,l,c){e<<=3,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=n,this.frames[e+3]=r,this.frames[e+4]=o,this.frames[e+5]=a,this.frames[e+6]=l,this.frames[e+7]=c}apply1(e,t,s,n,r,o){const a=t.color,l=t.darkColor;let c=0,h=0,u=0;const d=this.frames;if(s>3];switch(y){case 0:{const x=d[v];f=d[v+1],p=d[v+2],m=d[v+3],g=d[v+4],c=d[v+5],h=d[v+6],u=d[v+7];const M=(s-x)/(d[v+8]-x);f+=(d[v+8+1]-f)*M,p+=(d[v+8+2]-p)*M,m+=(d[v+8+3]-m)*M,g+=(d[v+8+4]-g)*M,c+=(d[v+8+5]-c)*M,h+=(d[v+8+6]-h)*M,u+=(d[v+8+7]-u)*M;break}case 1:f=d[v+1],p=d[v+2],m=d[v+3],g=d[v+4],c=d[v+5],h=d[v+6],u=d[v+7];break;default:f=this.getBezierValue(s,v,1,y-2),p=this.getBezierValue(s,v,2,y+18-2),m=this.getBezierValue(s,v,3,y+36-2),g=this.getBezierValue(s,v,4,y+54-2),c=this.getBezierValue(s,v,5,y+72-2),h=this.getBezierValue(s,v,6,y+90-2),u=this.getBezierValue(s,v,7,y+108-2)}if(n===1)a.set(f,p,m,g);else if(r===Ve.setup){const x=e.data.setupPose;let M=x.color;a.set(M.r+(f-M.r)*n,M.g+(p-M.g)*n,M.b+(m-M.b)*n,M.a+(g-M.a)*n),M=x.darkColor,c=M.r+(c-M.r)*n,h=M.g+(h-M.g)*n,u=M.b+(u-M.b)*n}else a.add((f-a.r)*n,(p-a.g)*n,(m-a.b)*n,(g-a.a)*n),c=l.r+(c-l.r)*n,h=l.g+(h-l.g)*n,u=l.b+(u-l.b)*n;l.r=c<0?0:c>1?1:c,l.g=h<0?0:h>1?1:h,l.b=u<0?0:u>1?1:u}}class hS extends vu{constructor(e,t,s){super(e,t,s,`${et.rgb}|${s}`,`${et.rgb2}|${s}`)}getFrameEntries(){return 7}setFrame(e,t,s,n,r,o,a,l){e*=7,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=n,this.frames[e+3]=r,this.frames[e+4]=o,this.frames[e+5]=a,this.frames[e+6]=l}apply1(e,t,s,n,r,o){const a=t.color,l=t.darkColor;let c=0,h=0,u=0,d=0,f=0,p=0;const m=this.frames;if(s1?1:c,a.g=h<0?0:h>1?1:h,a.b=u<0?0:u>1?1:u,l.r=d<0?0:d>1?1:d,l.g=f<0?0:f>1?1:f,l.b=p<0?0:p>1?1:p}}class sl extends Bt{constructor(t,s){super(t,`${et.attachment}|${s}`);S(this,"slotIndex",0);S(this,"attachmentNames");this.slotIndex=s,this.attachmentNames=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,s,n){this.frames[t]=s,this.attachmentNames[t]=n}apply(t,s,n,r,o,a,l,c,h){const u=t.slots[this.slotIndex];if(!u.bone.active)return;const d=h?u.appliedPose:u.pose;c||nt){const c=this.frames[s];return n[r+1]*(t-c)/(n[r]-c)}const o=r+18;for(r+=2;r=t){const c=n[r-2],h=n[r-1];return h+(t-c)/(n[r]-c)*(n[r+1]-h)}const a=n[o-2],l=n[o-1];return l+(1-l)*(t-a)/(this.frames[s+this.getFrameEntries()]-a)}apply(t,s,n,r,o,a,l,c,h){const u=t.slots;if(!this.attachment.isTimelineActive(u,this.slotIndex,h))return;const d=this.attachment.timelineSlots,f=this.frames;if(n=f[f.length-1])g=0,p=this.vertices[f.length-1],m=null;else{const y=Bt.search(f,n);g=this.getCurvePercent(n,y),p=this.vertices[y],m=this.vertices[y+1]}const v=this.vertices[0].length;this.applyToSlot(u[this.slotIndex],h,p,m,g,v,o,a,l);for(const y of d)this.applyToSlot(u[y],h,p,m,g,v,o,a,l)}applyBeforeFirst(t,s,n,r){if(!t.bone.active)return;const o=s?t.appliedPose:t.pose;if(o.attachment==null||o.attachment.timelineAttachment!==this.attachment)return;const a=o.deform;switch(a.length===0&&(r=Ve.setup),r){case Ve.setup:a.length=0;break;case Ve.first:{if(n===1){a.length=0;return}const l=this.vertices[0].length;a.length=l;const c=a,h=o.attachment;if(h.bones===null){const u=h.vertices;for(let d=0;d>4,h=l.attachment.sequence.regions.length;const u=qw[o&15];if(u!==_s.hold)switch(c+=(n-r)/a+1e-5|0,u){case _s.once:c=Math.min(h-1,c);break;case _s.loop:c%=h;break;case _s.pingpong:{const d=(h<<1)-2;c=d===0?0:c%d,c>=h&&(c=d-c);break}case _s.onceReverse:c=Math.max(h-1-c,0);break;case _s.loopReverse:c=h-1-c%h;break;case _s.pingpongReverse:{const d=(h<<1)-2;c=d===0?0:(c+h-1)%d,c>=h&&(c=d-c)}}l.sequenceIndex=c}};S(li,"ENTRIES",3),S(li,"MODE",1),S(li,"DELAY",2);let Ph=li;const Nh=class Nh extends Bt{constructor(t){super(t,...Nh.propertyIds);S(this,"events");this.events=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,s){this.frames[t]=s.time,this.events[t]=s}apply(t,s,n,r,o,a,l,c,h){if(!r)return;const u=this.frames,d=this.frames.length;if(s>n)this.apply(null,s,Number.MAX_VALUE,r,0,a,!1,!1,!1),s=-1;else if(s>=u[d-1])return;if(n0&&u[f-1]===p;)f--}for(;f=u[f];f++)r.push(this.events[f])}};S(Nh,"propertyIds",[`${et.event}`]);let Sl=Nh;const Yo=class Yo extends Bt{constructor(t){super(t,...Yo.propertyIds);S(this,"drawOrders");this.drawOrders=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,s,n){this.frames[t]=s,this.drawOrders[t]=n}apply(t,s,n,r,o,a,l,c,h){const u=h?t.drawOrder.appliedPose:t.drawOrder.pose,d=t.slots;if(c||n>2];switch(y){case 0:{const M=f[v];p=f[v+1],m=f[v+2],g=f[v+3];const C=(n-M)/(f[v+4]-M);p+=(f[v+4+1]-p)*C,m+=(f[v+4+2]-m)*C,g+=(f[v+4+3]-g)*C;break}case 1:p=f[v+1],m=f[v+2],g=f[v+3];break;default:p=this.getBezierValue(n,v,1,y-2),m=this.getBezierValue(n,v,2,y+18-2),g=this.getBezierValue(n,v,3,y+36-2)}const x=a===Ve.setup?u.data.setupPose:d;l?(d.mixRotate=x.mixRotate+p*o,d.mixX=x.mixX+m*o,d.mixY=x.mixY+g*o):(d.mixRotate=x.mixRotate+(p-x.mixRotate)*o,d.mixX=x.mixX+(m-x.mixX)*o,d.mixY=x.mixY+(g-x.mixY)*o)}}class Cr extends Fl{constructor(e,t,s,n){super(e,t,s,n)}apply(e,t,s,n,r,o,a,l,c){if(a&&!this.additive&&(a=!1),this.constraintIndex===-1){const h=s>=this.frames[0]?this.getCurveValue(s):0,u=e.physics;for(const d of u)if(d.active&&this.global(d.data)){const f=c?d.appliedPose:d.pose;this.set(f,this.getAbsoluteValue(s,r,o,a,this.get(f),this.get(d.data.setupPose),h))}}else{const h=e.constraints[this.constraintIndex];if(h.active){const u=c?h.appliedPose:h.pose;this.set(u,this.getAbsoluteValue(s,r,o,a,this.get(u),this.get(h.data.setupPose)))}}}}class vS extends Cr{constructor(e,t,s){super(e,t,s,et.physicsConstraintInertia)}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}}class yS extends Cr{constructor(e,t,s){super(e,t,s,et.physicsConstraintStrength)}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}}class xS extends Cr{constructor(e,t,s){super(e,t,s,et.physicsConstraintDamping)}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}}class bS extends Cr{constructor(e,t,s){super(e,t,s,et.physicsConstraintMass)}get(e){return 1/e.massInverse}set(e,t){e.massInverse=1/t}global(e){return e.massGlobal}}class wS extends Cr{constructor(e,t,s){super(e,t,s,et.physicsConstraintWind),this.additive=!0}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}}class SS extends Cr{constructor(e,t,s){super(e,t,s,et.physicsConstraintGravity),this.additive=!0}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}}class MS extends Cr{constructor(e,t,s){super(e,t,s,et.physicsConstraintMix)}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}}const Dh=class Dh extends Bt{constructor(t,s){super(t,...Dh.propertyIds);S(this,"constraintIndex");this.constraintIndex=s,this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,s){this.frames[t]=s}apply(t,s,n,r,o,a,l,c,h){let u;if(this.constraintIndex!==-1&&(u=t.constraints[this.constraintIndex],!u.active))return;const d=this.frames;if(s>n)this.apply(t,s,Number.MAX_VALUE,[],o,a,!1,!1,!1),s=-1;else if(s>=d[d.length-1])return;if(!(n=d[Bt.search(d,s)+1]))if(u!=null)u.reset(t);else for(const f of t.physics)f.active&&f.reset(t)}};S(Dh,"propertyIds",[et.physicsConstraintReset.toString()]);let kh=Dh;class TS extends Fl{constructor(e,t,s){super(e,t,s,et.sliderTime)}apply(e,t,s,n,r,o,a,l,c){const h=e.constraints[this.constraintIndex];if(h.active){const u=c?h.appliedPose:h.pose;u.time=this.getAbsoluteValue(s,r,o,a,u.time,h.data.setupPose.time)}}}class _S extends Fl{constructor(e,t,s){super(e,t,s,et.sliderMix),this.additive=!0}apply(e,t,s,n,r,o,a,l,c){const h=e.constraints[this.constraintIndex];if(h.active){const u=c?h.appliedPose:h.pose;u.mix=this.getAbsoluteValue(s,r,o,a,u.mix,h.data.setupPose.mix)}}}const rl=class rl{constructor(e){S(this,"data");S(this,"tracks",[]);S(this,"timeScale",1);S(this,"unkeyedState",0);S(this,"events",[]);S(this,"listeners",[]);S(this,"queue",new oO(this));S(this,"propertyIds",new Map);S(this,"animationsChanged",!1);S(this,"trackEntryPool",new J3(()=>new rO));this.data=e}update(e){e*=this.timeScale;const t=this.tracks;for(let s=0,n=t.length;s0){if(r.delay-=o,r.delay>0)continue;o=-r.delay,r.delay=0}let a=r.next;if(a){const l=r.trackLast-a.delay;if(l>=0){for(a.delay=0,a.trackTime+=r.timeScale===0?0:(l/r.timeScale+e)*a.timeScale,r.trackTime+=o,this.setTrack(s,a,!0);a.mixingFrom;)a.mixTime+=e,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){t[s]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,e)){let l=r.mixingFrom;for(r.mixingFrom=null,l&&(l.mixingTo=null);l;)this.queue.end(l),l=l.mixingFrom}r.trackTime+=o}this.queue.drain()}updateMixingFrom(e,t){const s=e.mixingFrom;if(!s)return!0;const n=this.updateMixingFrom(s,t);if(s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast,e.nextTrackLast!==-1&&e.mixTime>=e.mixDuration){if(s.totalAlpha===0||e.mixDuration===0){if(e.mixingFrom=s.mixingFrom,s.mixingFrom!=null&&(s.mixingFrom.mixingTo=e),s.totalAlpha===0)for(let r=e;r.mixingTo!=null;r=r.mixingTo)r.keepHold=!0;this.queue.end(s)}return n}return s.trackTime+=t*s.timeScale,e.mixTime+=t,!1}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();const t=this.events,s=this.tracks;let n=!1;for(let a=0,l=s.length;a0)continue;n=!0;let h=c.alpha;c.mixingFrom?h*=this.applyMixingFrom(c,e):c.trackTime>=c.trackEnd&&!c.next&&(h=0);let u=c.animationLast,d=c.getAnimationTime(),f=d,p=t;c.reverse&&(f=c.animation.duration-f,p=null);const m=c.animation.timelines,g=m.length;if(a===0&&h===1)for(let v=0;v=c.alphaAttachmentThreshold,x=c.additive,M=x||c.shortestRotation,C=!M&&c.timelinesRotation.length!==g<<1;C&&(c.timelinesRotation.length=g<<1);for(let w=0;w0?l/a:o,h=s.animation.timelines,u=h.length,d=s.timelineMode,f=s.timelineHoldMix,p=r=s.alphaAttachmentThreshold);else{const B=!m||!(E instanceof br)||I===Ve.current;E.apply(t,M,w,b,k,I,g,B,!1)}}return s.reverse&&r0&&this.queueEvents(s,C),this.events.length=0,s.nextAnimationLast=C,s.nextTrackLast=s.trackTime,r}applyAttachmentTimeline(e,t,s,n,r){const o=t.slots[e.slotIndex];if(!o.bone.active||!r&&o.attachmentState===this.unkeyedState+yy)return;let a=s=0,C=v>=0;Math.abs(y)<=90&&Ee.signum(y)!==Ee.signum(g)&&(Math.abs(v-x)>180?(m+=360*Ee.signum(v),C=M):x!==0?m-=360*Ee.signum(v):C=M),C!==M&&(m+=360*Ee.signum(v)),o[a]=m}o[a+1]=g,h.rotation=f+m*n}queueEvents(e,t){const s=e.animationStart,n=e.animationEnd,r=n-s,o=e.reverse;let a=e.trackLast%r;o&&(a=r-a);const l=this.events;let c=0,h=l.length;for(;c=s&&d.time<=n&&this.queue.event(e,d)}let u=!1;if(e.loop)if(r===0)u=!0;else{const d=Math.floor(e.trackTime/r);u=d>0&&d>Math.floor(e.trackLast/r)}else u=t>=n&&e.animationLast=s&&d.time<=n&&this.queue.event(e,d)}}eventsReverse(e,t,s){const n=e.animation.duration,r=n-t,o=n-s,a=e.animation.timelines;for(let l=0,c=e.animation.timelines.length;l=o){for(let p=0;p=r)break;this.events.push(u[p])}}else{for(let m=0;m=r);m++)this.events.push(u[m]);let p=0;for(;p=o);p++);for(;p= 0.");if(e>=this.tracks.length)return;const t=this.tracks[e];if(!t)return;this.queue.end(t),this.clearNext(t);let s=t;for(;;){const n=s.mixingFrom;if(!n)break;this.queue.end(n),s.mixingFrom=null,s.mixingTo=null,s=n}this.tracks[t.trackIndex]=null,this.queue.drain()}setTrack(e,t,s){const n=this.expandToIndex(e);this.tracks[e]=t,t.previous=null,n&&(n.next=null,s&&this.queue.interrupt(n),t.mixingFrom=n,n.mixingTo=t,t.mixTime=0,n.timelinesRotation.length=0),this.queue.start(t)}setAnimation(e,t,s=!1){return typeof t=="string"?this.setAnimation1(e,t,s):this.setAnimation2(e,t,s)}setAnimation1(e,t,s=!1){const n=this.data.skeletonData.findAnimation(t);if(!n)throw new Error(`Animation not found: ${t}`);return this.setAnimation2(e,n,s)}setAnimation2(e,t,s=!1){if(e<0)throw new Error("trackIndex must be >= 0.");if(!t)throw new Error("animation cannot be null.");let n=!0,r=this.expandToIndex(e);r&&(r.nextTrackLast===-1&&r.animation===t?(this.tracks[e]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,n=!1):this.clearNext(r));const o=this.trackEntry(e,t,s,r);return this.setTrack(e,o,n),this.queue.drain(),o}addAnimation(e,t,s=!1,n=0){return typeof t=="string"?this.addAnimation1(e,t,s,n):this.addAnimation2(e,t,s,n)}addAnimation1(e,t,s=!1,n=0){const r=this.data.skeletonData.findAnimation(t);if(!r)throw new Error(`Animation not found: ${t}`);return this.addAnimation2(e,r,s,n)}addAnimation2(e,t,s=!1,n=0){if(e<0)throw new Error("trackIndex must be >= 0.");if(!t)throw new Error("animation cannot be null.");let r=this.expandToIndex(e);if(r)for(;r.next;)r=r.next;const o=this.trackEntry(e,t,s,r);return r?(r.next=o,o.previous=r,n<=0&&(n=Math.max(n+r.getTrackComplete()-o.mixDuration,0))):(this.setTrack(e,o,!0),this.queue.drain(),n<0&&(n=0)),o.delay=n,o}setEmptyAnimation(e,t=0){const s=this.setAnimation(e,rl.emptyAnimation,!1);return s.mixDuration=t,s.trackEnd=t,s}addEmptyAnimation(e,t=0,s=0){const n=this.addAnimation(e,rl.emptyAnimation,!1,s);return s<=0&&(n.delay=Math.max(n.delay+n.mixDuration-t,0)),n.mixDuration=t,n.trackEnd=t,n}setEmptyAnimations(e=0){const t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let s=0,n=this.tracks.length;s0&&(o[d]=v);break}}l&&(g=g&~Mc|r[d]&Mc),r[d]=g}}from(e,t,s){const n=this.propertyIds;let r=aO;for(let o=0,a=s.length;o= 0.");return e>=this.tracks.length?null:this.tracks[e]}addListener(e){if(!e)throw new Error("listener cannot be null.");this.listeners.push(e)}removeListener(e){const t=this.listeners.indexOf(e);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}};S(rl,"emptyAnimation",new kp("",[],0));let fy=rl;class rO{constructor(){S(this,"animation",null);S(this,"previous",null);S(this,"next",null);S(this,"mixingFrom",null);S(this,"mixingTo",null);S(this,"listener",null);S(this,"trackIndex",0);S(this,"loop",!1);S(this,"additive",!1);S(this,"reverse",!1);S(this,"shortestRotation",!1);S(this,"keepHold",!1);S(this,"eventThreshold",0);S(this,"mixAttachmentThreshold",0);S(this,"alphaAttachmentThreshold",0);S(this,"mixDrawOrderThreshold",0);S(this,"animationStart",0);S(this,"animationEnd",0);S(this,"animationLast",0);S(this,"nextAnimationLast",0);S(this,"delay",0);S(this,"trackTime",0);S(this,"trackLast",0);S(this,"nextTrackLast",0);S(this,"trackEnd",0);S(this,"timeScale",0);S(this,"alpha",0);S(this,"mixTime",0);S(this,"mixDuration",0);S(this,"totalAlpha",0);S(this,"mixInterpolation",na.linear);S(this,"timelineMode",[]);S(this,"timelineHoldMix",[]);S(this,"timelinesRotation",[])}setMixDuration(e,t){this.mixDuration=e,t!==void 0&&(t<=0&&(t=this.previous==null?0:Math.max(t+this.previous.getTrackComplete()-e,0)),this.delay=t)}setMixInterpolation(e){if(!e)throw new Error("mixInterpolation cannot be null.");this.mixInterpolation=e}mix(){if(this.mixDuration===0)return 1;let e=this.mixTime/this.mixDuration;return e>=1?1:this.mixInterpolation===na.linear?e:(e=this.mixInterpolation.apply(e),e<0?0:e>1?1:e)}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.mixInterpolation=na.linear,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(!this.loop)return Math.min(this.trackTime+this.animationStart,this.animationEnd);const e=this.animationEnd-this.animationStart;return e===0?this.animationStart:this.trackTime%e+this.animationStart}setAnimationLast(e){this.animationLast=e,this.nextAnimationLast=e}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){const e=this.animationEnd-this.animationStart;if(e!==0){if(this.loop)return e*(1+(this.trackTime/e|0));if(this.trackTime=0}}class oO{constructor(e){S(this,"objects",[]);S(this,"drainDisabled",!1);S(this,"animState");this.animState=e}start(e){this.objects.push(Ws.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(Ws.interrupt),this.objects.push(e)}end(e){this.objects.push(Ws.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(Ws.dispose),this.objects.push(e)}complete(e){this.objects.push(Ws.complete),this.objects.push(e)}event(e,t){this.objects.push(Ws.event),this.objects.push(e),this.objects.push(t)}drain(){var e,t,s,n,r,o;if(!this.drainDisabled){this.drainDisabled=!0;for(let a=0;a= 0.");if(!s)throw new Error("name cannot be null.");this.index=t,this.parent=n}copy(t){const s=new xu(this.index,this.name,t);return s.length=this.length,s.setupPose.set(this.setupPose),s}}var zt;(function(i){i[i.Normal=0]="Normal",i[i.OnlyTranslation=1]="OnlyTranslation",i[i.NoRotationOrReflection=2]="NoRotationOrReflection",i[i.NoScale=3]="NoScale",i[i.NoScaleOrReflection=4]="NoScaleOrReflection"})(zt||(zt={}));class Am{constructor(){S(this,"bone");S(this,"x",0);S(this,"y",0);S(this,"rotation",0);S(this,"scaleX",0);S(this,"scaleY",0);S(this,"shearX",0);S(this,"shearY",0);S(this,"inherit",zt.Normal);S(this,"a",0);S(this,"b",0);S(this,"c",0);S(this,"d",0);S(this,"worldY",0);S(this,"worldX",0);S(this,"world",0);S(this,"local",0)}set(e){if(e==null)throw new Error("pose cannot be null.");this.x=e.x,this.y=e.y,this.rotation=e.rotation,this.scaleX=e.scaleX,this.scaleY=e.scaleY,this.shearX=e.shearX,this.shearY=e.shearY,this.inherit=e.inherit}setPosition(e,t){this.x=e,this.y=t}setScale(e,t){this.scaleX=e,this.scaleY=t===void 0?e:t}getInherit(){return this.inherit}setInherit(e){if(e==null)throw new Error("inherit cannot be null.");this.inherit=e}update(e,t){this.world!==e._update&&this.updateWorldTransform(e)}updateWorldTransform(e){this.local===e._update?this.updateLocalTransform(e):this.world=e._update;const t=this.rotation,s=this.scaleX,n=this.scaleY,r=this.shearX,o=this.shearY;if(!this.bone.parent){const d=e.scaleX,f=e.scaleY,p=(t+r)*Ee.degRad,m=(t+90+o)*Ee.degRad;this.a=Math.cos(p)*s*d,this.b=Math.cos(m)*n*d,this.c=Math.sin(p)*s*f,this.d=Math.sin(m)*n*f,this.worldX=this.x*d+e.x,this.worldY=this.y*f+e.y;return}const a=this.bone.parent.appliedPose;let l=a.a,c=a.b,h=a.c,u=a.d;switch(this.worldX=l*this.x+c*this.y+a.worldX,this.worldY=h*this.x+u*this.y+a.worldY,this.inherit){case zt.Normal:{const d=(t+r)*Ee.degRad,f=(t+90+o)*Ee.degRad,p=Math.cos(d)*s,m=Math.cos(f)*n,g=Math.sin(d)*s,v=Math.sin(f)*n;this.a=l*p+c*g,this.b=l*m+c*v,this.c=h*p+u*g,this.d=h*m+u*v;return}case zt.OnlyTranslation:{const d=e.scaleX,f=e.scaleY,p=(t+r)*Ee.degRad,m=(t+90+o)*Ee.degRad;this.a=Math.cos(p)*s*d,this.b=Math.cos(m)*n*d,this.c=Math.sin(p)*s*f,this.d=Math.sin(m)*n*f;break}case zt.NoRotationOrReflection:{const d=e.scaleX,f=e.scaleY,p=1/d,m=1/f;l*=p,h*=m;let g=l*l+h*h,v=0;g>Ee.epsilon2?(g=Math.abs(l*u*m-c*p*h)/g,c=h*g,u=l*g,v=t-Ee.atan2Deg(h,l)):(l=0,h=0,v=t-90+Ee.atan2Deg(u,c));const y=(v+r)*Ee.degRad,x=(v+o+90)*Ee.degRad,M=Math.cos(y)*s,C=Math.cos(x)*n,w=Math.sin(y)*s,b=Math.sin(x)*n;this.a=(l*M-c*w)*d,this.b=(l*C-c*b)*d,this.c=(h*M+u*w)*f,this.d=(h*C+u*b)*f;break}case zt.NoScale:case zt.NoScaleOrReflection:{const d=e.scaleX,f=e.scaleY,p=1/d,m=1/f,g=t*Ee.degRad,v=Math.cos(g),y=Math.sin(g);let x=(l*v+c*y)*p,M=(h*v+u*y)*m;const C=1/Math.sqrt(x*x+M*M);x*=C,M*=C;let w=-M,b=x;this.inherit===zt.NoScale&&l*u-c*h<0!=(d<0!=f<0)&&(w=-w,b=-b);const _=r*Ee.degRad,E=(90+o)*Ee.degRad,F=Math.cos(_)*s,I=Math.cos(E)*n,k=Math.sin(_)*s,B=Math.sin(E)*n;this.a=(x*F+w*k)*d,this.b=(x*I+w*B)*d,this.c=(M*F+b*k)*f,this.d=(M*I+b*B)*f;break}}}updateLocalTransform(e){this.local=0,this.world=e._update;const t=e.scaleX,s=e.scaleY;if(!this.bone.parent){const v=1/t,y=1/s;this.x=(this.worldX-e.x)*v,this.y=(this.worldY-e.y)*y,this.set5(this.a*v,this.b*v,this.c*y,this.d*y,0);return}const n=this.bone.parent.appliedPose;let r=n.a,o=n.b,a=n.c,l=n.d;const c=r*l-o*a,h=1/(r*l-o*a),u=l*h,d=o*h,f=a*h,p=r*h,m=this.worldX-n.worldX,g=this.worldY-n.worldY;switch(this.x=m*u-g*d,this.y=g*p-m*f,this.inherit){case zt.Normal:this.set5(u*this.a-d*this.c,u*this.b-d*this.d,p*this.c-f*this.a,p*this.d-f*this.b,0);break;case zt.OnlyTranslation:{const v=1/t,y=1/s;this.set5(this.a*v,this.b*v,this.c*y,this.d*y,0);break}case zt.NoRotationOrReflection:{const v=1/t,y=1/s;r*=v,a*=y;const x=this.a*v,M=this.b*v,C=this.c*y,w=this.d*y,b=1/(r*r+a*a),_=1/Math.abs(c*v*y);this.set5((r*x+a*C)*b,(r*M+a*w)*b,(r*C-a*x)*_,(r*w-a*M)*_,Ee.atan2Deg(a,r));break}case zt.NoScale:case zt.NoScaleOrReflection:{const v=1/t,y=1/s,x=this.a*v,M=this.b*v,C=this.c*y,w=this.d*y;let b=l*this.a-o*this.c,_=r*this.c-a*this.a;c<0&&(b=-b,_=-_);let E=Ee.atan2Deg(_,b);this.rotation=E,E*=Ee.degRad;const F=Math.cos(E),I=Math.sin(E);let k=(r*F+o*I)*v,B=(a*F+l*I)*y;const D=1/Math.sqrt(k*k+B*B);k*=D,B*=D;const X=this.inherit===zt.NoScale&&c<0!=(t<0!=s<0)?-1:1;this.set4(k*x+B*C,k*M+B*w,(k*C-B*x)*X,(k*w-B*M)*X)}}}set4(e,t,s,n){const r=e*e+s*s,o=t*t+n*n;r>Ee.epsilon2?(this.shearX=Ee.atan2Deg(s,e),this.scaleX=Math.sqrt(r)):(this.shearX=0,this.scaleX=0),this.scaleY=Math.sqrt(o),o>Ee.epsilon2?(this.shearY=Ee.atan2Deg(n,t),e*n-t*s<0?(this.scaleY=-this.scaleY,this.shearY+=90):this.shearY-=90,this.shearY>180?this.shearY-=360:this.shearY<=-180&&(this.shearY+=360)):this.shearY=0}set5(e,t,s,n,r){this.shearX=0;const o=e*e+s*s,a=t*t+n*n;if(o>Ee.epsilon2){const l=Ee.atan2Deg(s,e);this.rotation=l+r,this.scaleX=Math.sqrt(o),this.scaleY=Math.sqrt(a),a>Ee.epsilon2?(this.shearY=Ee.atan2Deg(n,t),e*n-t*s<0?(this.scaleY=-this.scaleY,this.shearY+=90-l):this.shearY-=90+l,this.shearY>180?this.shearY-=360:this.shearY<=-180&&(this.shearY+=360)):this.shearY=0}else this.scaleX=0,this.scaleY=Math.sqrt(a),this.shearY=0,this.rotation=a>Ee.epsilon2?Ee.atan2Deg(n,t)-90+r:r}validateLocalTransform(e){this.local===e._update&&this.updateLocalTransform(e)}modifyLocal(e){this.local===e._update&&this.updateLocalTransform(e),this.world=0,this.resetWorld(e,e._update)}modifyWorld(e){const t=e._update;this.local=t,this.world=t,this.resetWorld(e,t)}resetWorld(e,t){const s=this.bone.children;for(let n=0,r=s.length;n1&&t.constrained(this.bones[1].bone)}isSourceActive(){return this.target.active}static apply(t,s,n,r,o,a,l,c,h,u){typeof n=="number"?rr.apply1(t,s,n,r,o,a,l,c):rr.apply2(t,s,n,r,o,a,l,c,h,u)}static apply1(t,s,n,r,o,a,l,c){s.modifyLocal(t);const h=s.bone.parent.appliedPose;let u=h.a,d=h.b,f=h.c,p=h.d,m=-s.shearX-s.rotation,g=0,v=0;switch(s.inherit){case zt.OnlyTranslation:g=(n-s.worldX)*Ee.signum(t.scaleX),v=(r-s.worldY)*Ee.signum(t.scaleY);break;case zt.NoRotationOrReflection:{const y=Math.abs(u*p-d*f)/Math.max(Ee.epsilon,u*u+f*f),x=u/t.scaleX,M=f/t.scaleY;d=-M*y*t.scaleX,p=x*y*t.scaleY,m+=Ee.atan2Deg(M,x)}default:{const y=n-h.worldX,x=r-h.worldY,M=u*p-d*f;Math.abs(M)<=Ee.epsilon?(g=0,v=0):(g=(y*p-x*d)/M-s.x,v=(x*u-y*f)/M-s.y)}}if(m+=Ee.atan2Deg(v,g),s.scaleX<0&&(m+=180),m>180?m-=360:m<=-180&&(m+=360),s.rotation+=m*c,o||a){switch(s.inherit){case zt.NoScale:case zt.NoScaleOrReflection:g=n-s.worldX,v=r-s.worldY}const y=s.bone.data.length*s.scaleX;if(y>Ee.epsilon){const x=g*g+v*v;if(o&&xy*y){const M=(Math.sqrt(x)/y-1)*c+1;switch(s.scaleX*=M,l){case Vs.Uniform:s.scaleY*=M;break;case Vs.Volume:s.scaleY/=M<.7?.25+.642857*M:M}}}}}static apply2(t,s,n,r,o,a,l,c,h,u){if(s.inherit!==zt.Normal||n.inherit!==zt.Normal)return;s.modifyLocal(t),n.modifyLocal(t);let d=s.x,f=s.y,p=s.scaleX,m=s.scaleY,g=n.scaleX,v=0,y=0,x=0;p<0?(p=-p,v=180,x=-1):(v=0,x=1),m<0&&(m=-m,x=-x),g<0?(g=-g,y=180):y=0;let M=0,C=0,w=s.a,b=s.b,_=s.c,E=s.d;const F=Math.abs(p-m)<=Ee.epsilon;!F||l?(n.y=0,M=w*n.x+s.worldX,C=_*n.x+s.worldY):(M=w*n.x+b*n.y+s.worldX,C=_*n.x+E*n.y+s.worldY);const I=s.bone.parent.appliedPose;w=I.a,b=I.b,_=I.c,E=I.d;let k=w*E-b*_,B=M-I.worldX,D=C-I.worldY;k=Math.abs(k)<=Ee.epsilon?0:1/k;const X=(B*E-D*b)*k-d,N=(D*w-B*_)*k-f;let U=Math.sqrt(X*X+N*N),A=n.bone.data.length*g,P,O;if(U0){let re=Math.min(1,ie/(h*2))-1;re=(ie-h*(1-re*re))/K,L-=re*L,$-=re*$,V=L*L+$*$}}e:if(F){A*=p;let K=(V-U*U-A*A)/(2*U*A);if(K<-1)K=-1,O=Math.PI*a;else if(K>1){if(K=1,O=0,l)switch(w=(Math.sqrt(V)/(U+A)-1)*u+1,s.scaleX*=w,c){case Vs.Uniform:s.scaleY*=w;break;case Vs.Volume:s.scaleY/=w<.7?.25+.642857*w:w}}else O=Math.acos(K)*a;w=U+A*K,b=A*Math.sin(O),P=Math.atan2($*w-L*b,L*w+$*b)}else{w=p*A,b=m*A;const K=w*w,ie=b*b,re=Math.atan2($,L);_=ie*U*U+K*V-K*ie;const pe=-2*ie*U,ge=ie-K;if(E=pe*pe-4*ge*_,E>=0){let ue=Math.sqrt(E);pe<0&&(ue=-ue),ue=-(pe+ue)*.5;let ne=ue/ge,de=_/ue;const le=Math.abs(ne)=0){D=Math.sqrt(ne)*a,P=re-Math.atan2(D,le),O=Math.atan2(D/m,(le-U)/p);break e}}let he=Ee.PI,fe=U-w,Y=fe*fe,W=0,H=0,G=U+w,q=G*G,se=0;_=-w*U/(K-ie),_>=-1&&_<=1&&(_=Math.acos(_),B=w*Math.cos(_)+U,D=b*Math.sin(_),E=B*B+D*D,Eq&&(H=_,q=E,G=B,se=D)),V<=(Y+q)*.5?(P=re-Math.atan2(W*a,fe),O=he*a):(P=re-Math.atan2(se*a,G),O=H*a)}const j=Math.atan2(n.y,n.x)*x;P=(P-j)*Ee.radDeg+v-s.rotation,P>180?P-=360:P<=-180&&(P+=360),s.rotation+=P*u,O=((O+j)*Ee.radDeg-n.shearX)*x+y-n.rotation,O>180?O-=360:O<=-180&&(O+=360),n.rotation+=O*u}}class Uc extends Ll{constructor(t){super(t,new Em);S(this,"bones",[]);S(this,"_target",null);S(this,"_scaleYMode",Vs.None)}set target(t){this._target=t}get target(){if(!this._target)throw new Error("target cannot be null.");return this._target}set scaleYMode(t){this._scaleYMode=t}get scaleYMode(){if(this._scaleYMode==null)throw new Error("scaleYMode cannot be null.");return this._scaleYMode}create(t){return new rr(this,t)}}class Im{constructor(){S(this,"position",0);S(this,"spacing",0);S(this,"mixRotate",0);S(this,"mixX",0);S(this,"mixY",0)}set(e){this.position=e.position,this.spacing=e.spacing,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY}}class $c extends Ll{constructor(t){super(t,new Im);S(this,"bones",[]);S(this,"_slot",null);S(this,"positionMode",cn.Fixed);S(this,"spacingMode",ms.Fixed);S(this,"rotateMode",lo.Chain);S(this,"offsetRotation",0)}set slot(t){this._slot=t}get slot(){if(this._slot)return this._slot;throw new Error("SlotData not set.")}create(t){return new Rm(this,t)}}var cn;(function(i){i[i.Fixed=0]="Fixed",i[i.Percent=1]="Percent"})(cn||(cn={}));var ms;(function(i){i[i.Length=0]="Length",i[i.Fixed=1]="Fixed",i[i.Percent=2]="Percent",i[i.Proportional=3]="Proportional"})(ms||(ms={}));var lo;(function(i){i[i.Tangent=0]="Tangent",i[i.Chain=1]="Chain",i[i.ChainScale=2]="ChainScale"})(lo||(lo={}));const Mi=class Mi extends Ol{constructor(t,s){super(t,new Im,new Im);S(this,"data");S(this,"bones");S(this,"slot");S(this,"spaces",[]);S(this,"positions",[]);S(this,"world",[]);S(this,"curves",[]);S(this,"lengths",[]);S(this,"segments",[]);if(!s)throw new Error("skeleton cannot be null.");this.data=t,this.bones=[];for(const n of this.data.bones)this.bones.push(s.bones[n.index].constrainedPose);this.slot=s.slots[t.slot.index]}copy(t){var s=new Mi(this.data,t);return s.pose.set(this.pose),s}update(t,s){const n=this.slot.appliedPose.attachment;if(!(n instanceof Ml))return;const r=this.appliedPose,o=r.mixRotate,a=r.mixX,l=r.mixY;if(o===0&&a===0&&l===0)return;const c=this.data,h=c.rotateMode===lo.Tangent,u=c.rotateMode===lo.ChainScale,d=this.bones,f=d.length,p=h?f:f+1,m=Ge.setArraySize(this.spaces,p),g=u?this.lengths=Ge.setArraySize(this.lengths,f):[],v=r.spacing;switch(c.spacingMode){case ms.Percent:if(u)for(let b=0,_=p-1;b<_;b++){const E=d[b],F=E.bone.data.length,I=F*E.a,k=F*E.c;g[b]=Math.sqrt(I*I+k*k)}Ge.arrayFill(m,1,p,v);break;case ms.Proportional:{let b=0;for(let _=0,E=p-1;_0){b=p/b*v;for(let _=1;_0?Ee.degRad:-Ee.degRad}for(let b=0,_=3;b0){let D=E.a,X=E.b,N=E.c,U=E.d,A=0,P=0,O=0;if(h?A=y[_-1]:m[b+1]===0?A=y[_+2]:A=Math.atan2(B,k),A-=Math.atan2(N,D),w){P=Math.cos(A),O=Math.sin(A);const L=E.bone.data.length;x+=(L*(P*D-O*N)-k)*o,M+=(L*(O*D+P*N)-B)*o}else A+=C;A>Ee.PI?A-=Ee.PI2:A<-Ee.PI&&(A+=Ee.PI2),A*=o,P=Math.cos(A),O=Math.sin(A),E.a=P*D-O*N,E.b=P*X-O*U,E.c=O*D+P*N,E.d=O*X+P*U}}}computeWorldPositions(t,s,n,r){const o=this.slot;let a=this.appliedPose.position,l=this.spaces,c=Ge.setArraySize(this.positions,n*3+2),h=this.world;const u=s.closed;let d=s.worldVerticesLength,f=d/6,p=Mi.NONE;if(!s.constantSpeed){const O=s.lengths;f-=u?1:2;const L=O[f];this.data.positionMode===cn.Percent&&(a*=L);let $;switch(this.data.spacingMode){case ms.Percent:$=L;break;case ms.Proportional:$=L/n;break;default:$=1}h=Ge.setArraySize(this.world,8);for(let V=0,j=0,K=0;VL){p!==Mi.AFTER&&(p=Mi.AFTER,s.computeWorldVertices(t,o,d-6,4,h,0,2)),this.addAfterPosition(re-L,h,0,c,j);continue}for(;;K++){const pe=O[K];if(!(re>pe)){if(K===0)re/=pe;else{const ge=O[K-1];re=(re-ge)/(pe-ge)}break}}K!==p&&(p=K,u&&K===f?(s.computeWorldVertices(t,o,d-4,4,h,0,2),s.computeWorldVertices(t,o,0,4,h,4,2)):s.computeWorldVertices(t,o,K*6+2,8,h,0,2)),this.addCurvePosition(re,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],c,j,r||V>0&&ie===0)}return c}u?(d+=2,h=Ge.setArraySize(this.world,d),s.computeWorldVertices(t,o,2,d-4,h,0,2),s.computeWorldVertices(t,o,0,2,h,d-4,2),h[d-2]=h[0],h[d-1]=h[1]):(f--,d-=4,h=Ge.setArraySize(this.world,d),s.computeWorldVertices(t,o,2,d,h,0,2));const m=Ge.setArraySize(this.curves,f);let g=0,v=h[0],y=h[1],x=0,M=0,C=0,w=0,b=0,_=0,E=0,F=0,I=0,k=0,B=0,D=0,X=0,N=0;for(let O=0,L=2;Og){this.addAfterPosition(K-g,h,d-4,c,L);continue}for(;;$++){const ie=m[$];if(!(K>ie)){if($===0)K/=ie;else{const re=m[$-1];K=(K-re)/(ie-re)}break}}if($!==p){p=$;let ie=$*6;for(v=h[ie],y=h[ie+1],x=h[ie+2],M=h[ie+3],C=h[ie+4],w=h[ie+5],b=h[ie+6],_=h[ie+7],E=(v-x*2+C)*.03,F=(y-M*2+w)*.03,I=((x-C)*3-v+b)*.006,k=((M-w)*3-y+_)*.006,B=E*2+I,D=F*2+k,X=(x-v)*.3+E+I*.16666667,N=(M-y)*.3+F+k*.16666667,P=Math.sqrt(X*X+N*N),A[0]=P,ie=1;ie<8;ie++)X+=B,N+=D,B+=I,D+=k,P+=Math.sqrt(X*X+N*N),A[ie]=P;X+=B,N+=D,P+=Math.sqrt(X*X+N*N),A[8]=P,X+=B+I,N+=D+k,P+=Math.sqrt(X*X+N*N),A[9]=P,V=0}for(K*=P;;V++){const ie=A[V];if(!(K>ie)){if(V===0)K/=ie;else{const re=A[V-1];K=V+(K-re)/(ie-re)}break}}this.addCurvePosition(K*.1,v,y,x,M,C,w,b,_,c,L,r||O>0&&j===0)}return c}addBeforePosition(t,s,n,r,o){const a=s[n],l=s[n+1],c=s[n+2]-a,h=s[n+3]-l,u=Math.atan2(h,c);r[o]=a+t*Math.cos(u),r[o+1]=l+t*Math.sin(u),r[o+2]=u}addAfterPosition(t,s,n,r,o){const a=s[n+2],l=s[n+3],c=a-s[n],h=l-s[n+1],u=Math.atan2(h,c);r[o]=a+t*Math.cos(u),r[o+1]=l+t*Math.sin(u),r[o+2]=u}addCurvePosition(t,s,n,r,o,a,l,c,h,u,d,f){if(t===0||Number.isNaN(t)){u[d]=s,u[d+1]=n,u[d+2]=Math.atan2(o-n,r-s);return}const p=t*t,m=p*t,g=1-t,v=g*g,y=v*g,x=g*t,M=x*3,C=g*M,w=M*t,b=s*y+r*C+a*w+c*m,_=n*y+o*C+l*w+h*m;u[d]=b,u[d+1]=_,f&&(t<.001?u[d+2]=Math.atan2(o-n,r-s):u[d+2]=Math.atan2(_-(n*v+o*x*2+l*p),b-(s*v+r*x*2+a*p)))}sort(t){const s=this.slot.data.index,n=this.slot.bone;t.skin!=null&&this.sortPathSlot(t,t.skin,s,n),t.data.defaultSkin!=null&&t.data.defaultSkin!==t.skin&&this.sortPathSlot(t,t.data.defaultSkin,s,n),this.sortPath(t,this.slot.pose.attachment,n);const r=this.bones,o=this.bones.length;for(let a=0;a0,a=this.data.y>0,l=this.data.rotate>0||this.data.shearX>0,c=this.data.scaleX>0,h=this.bone;let u=h.bone.data.length,d=this.data.step,f=0;if(s!==qr.none){switch(h.modifyWorld(t),s){case qr.reset:this.reset(t);case qr.update:{const p=Math.max(t.time-this.lastTime,0),m=this.remaining;this.remaining+=p,this.lastTime=t.time;const g=h.worldX,v=h.worldY;if(this._reset)this._reset=!1,this.ux=g,this.uy=v;else{let y=this.remaining,x=n.inertia,M=t.data.referenceScale,C=-1,w=0,b=0,_=this.data.limit*p,E=_*Math.abs(t.scaleY);if(_*=Math.abs(t.scaleX),o||a){if(o){const F=(this.ux-g)*x;this.xOffset+=F>_?_:F<-_?-_:F,this.ux=g}if(a){const F=(this.uy-v)*x;this.yOffset+=F>E?E:F<-E?-E:F,this.uy=v}if(y>=d){const F=this.xOffset,I=this.yOffset;C=n.damping**(60*d),w=d*n.massInverse,b=n.strength;const k=M*n.wind,B=M*n.gravity,D=(k*t.windX+B*t.gravityX)*t.scaleX,X=(k*t.windY+B*t.gravityY)*t.scaleY;do o&&(this.xVelocity+=(D-this.xOffset*b)*w,this.xOffset+=this.xVelocity*d,this.xVelocity*=C),a&&(this.yVelocity-=(X+this.yOffset*b)*w,this.yOffset+=this.yVelocity*d,this.yVelocity*=C),y-=d;while(y>=d);this.xLag=this.xOffset-F,this.yLag=this.yOffset-I}f=Math.max(0,1-y/d),o&&(h.worldX+=(this.xOffset-this.xLag*f)*r*this.data.x),a&&(h.worldY+=(this.yOffset-this.yLag*f)*r*this.data.y)}if(l||c){let F=Math.atan2(h.c,h.a),I=0,k=0,B=0,D=this.cx-h.worldX,X=this.cy-h.worldY;if(D>_?D=_:D<-_&&(D=-_),X>E?X=E:X<-E&&(X=-E),y=this.remaining,l){B=(this.data.rotate+this.data.shearX)*r,f=this.rotateLag*Math.max(0,1-m/d);let N=Math.atan2(X+this.ty,D+this.tx)-F-(this.rotateOffset-f)*B;this.rotateOffset+=(N-Math.ceil(N*Ee.invPI2-.5)*Ee.PI2)*x,N=(this.rotateOffset-f)*B+F,I=Math.cos(N),k=Math.sin(N),c&&(N=u*h.getWorldScaleX(),N>0&&(this.scaleOffset+=(D*I+X*k)*x/N))}else{I=Math.cos(F),k=Math.sin(F);const N=u*h.getWorldScaleX()-this.scaleLag*Math.max(0,1-m/d);N>0&&(this.scaleOffset+=(D*I+X*k)*x/N)}if(y>=d){C===-1&&(C=n.damping**(60*d),w=d*n.massInverse,b=n.strength);const N=n.wind*t.windX+n.gravity*t.gravityX,U=(n.wind*t.windY+n.gravity*t.gravityY)*Fm.yDir,A=this.rotateOffset,P=this.scaleOffset,O=u/M;for(;;)if(y-=d,c&&(this.scaleVelocity+=(N*I-U*k-this.scaleOffset*b)*w,this.scaleOffset+=this.scaleVelocity*d,this.scaleVelocity*=C),l){if(this.rotateVelocity-=((N*k+U*I)*O+this.rotateOffset*b)*w,this.rotateOffset+=this.rotateVelocity*d,this.rotateVelocity*=C,y0){let y=0;this.data.rotate>0&&(y=p*this.data.rotate,m=Math.sin(y),g=Math.cos(y),v=h.b,h.b=g*v-m*h.d,h.d=m*v+g*h.d),y+=p*this.data.shearX,m=Math.sin(y),g=Math.cos(y),v=h.a,h.a=g*v-m*h.c,h.c=m*v+g*h.c}else p*=this.data.rotate,m=Math.sin(p),g=Math.cos(p),v=h.a,h.a=g*v-m*h.c,h.c=m*v+g*h.c,v=h.b,h.b=g*v-m*h.d,h.d=m*v+g*h.d}if(c){let p=1+(this.scaleOffset-this.scaleLag*f)*r*this.data.scaleX;switch(h.a*=p,h.c*=p,this.data.scaleYMode){case Vs.Uniform:h.b*=p,h.d*=p;break;case Vs.Volume:p=Math.abs(p),p=p>=.7?1/p:4-3.67347*p,h.b*=p,h.d*=p}}s!==qr.pose&&(this.tx=u*h.a,this.ty=u*h.c)}}sort(t){const s=this.bone.bone;t.sortBone(s),t._updateCache.push(this),t.sortReset(s.children),t.constrained(s)}isSourceActive(){return this.bone.bone.active}}class Xc extends Ll{constructor(t){super(t,new Pm);S(this,"_bone",null);S(this,"x",0);S(this,"y",0);S(this,"rotate",0);S(this,"scaleX",0);S(this,"shearX",0);S(this,"limit",0);S(this,"step",0);S(this,"inertiaGlobal",!1);S(this,"strengthGlobal",!1);S(this,"dampingGlobal",!1);S(this,"massGlobal",!1);S(this,"windGlobal",!1);S(this,"gravityGlobal",!1);S(this,"mixGlobal",!1);S(this,"_scaleYMode",Vs.None)}set bone(t){this._bone=t}get bone(){if(this._bone)return this._bone;throw new Error("BoneData not set.")}get scaleYMode(){return this._scaleYMode}set scaleYMode(t){if(t==null)throw new Error("scaleYMode cannot be null.");this._scaleYMode=t}create(t){return new bu(this,t)}}typeof Math.fround>"u"&&(Math.fround=(i=>e=>(i[0]=e,i[0]))(new Float32Array(1)));class Om{constructor(){S(this,"time",0);S(this,"mix",0)}set(e){this.time=e.time,this.mix=e.mix}}const ol=class ol extends Ol{constructor(t,s){super(t,new Om,new Om);S(this,"bone",null);if(!s)throw new Error("skeleton cannot be null.");t.bone!=null&&(this.bone=s.bones[t.bone.index])}copy(t){var s=new ol(this.data,t);return s.pose.set(this.pose),s}update(t,s){const n=this.appliedPose;if(n.mix===0)return;const r=this.data,o=r.animation,a=this.bone;if(a!==null){if(!a.active)return;r.local&&a.appliedPose.validateLocalTransform(t),n.time=r.offset+(r.property.value(t,a.appliedPose,r.local,ol.offsets)-r.property.offset)*r.scale,r.loop?n.time=o.duration+n.time%o.duration:n.time=Math.max(0,n.time)}const l=t.bones,c=o.bones;for(let h=0,u=o.bones.length;h=n.length&&(n.length=e+1),n[e]||(n[e]={}),n[e][t]=s}addSkin(e){for(let s=0;s= 0.");if(!n)throw new Error("boneData cannot be null.");this.index=t,this.boneData=n}}var Fh;(function(i){i[i.Normal=0]="Normal",i[i.Additive=1]="Additive",i[i.Multiply=2]="Multiply",i[i.Screen=3]="Screen"})(Fh||(Fh={}));class Nm{constructor(){S(this,"mixRotate",0);S(this,"mixX",0);S(this,"mixY",0);S(this,"mixScaleX",0);S(this,"mixScaleY",0);S(this,"mixShearY",0)}set(e){this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY}}class Up extends Ol{constructor(t,s){super(t,new Nm,new Nm);S(this,"bones");S(this,"source");if(!s)throw new Error("skeleton cannot be null.");this.bones=[];for(const r of t.bones)this.bones.push(s.bones[r.index].constrainedPose);const n=s.bones[t.source.index];if(n==null)throw new Error("source cannot be null.");this.source=n}copy(t){var s=new Up(this.data,t);return s.pose.set(this.pose),s}update(t,s){const n=this.appliedPose;if(n.mixRotate===0&&n.mixX===0&&n.mixY===0&&n.mixScaleX===0&&n.mixScaleY===0&&n.mixShearY===0)return;const r=this.data,o=r.localSource,a=r.localTarget,l=r.additive,c=r.clamp,h=r.offsets,u=this.source.appliedPose;o&&u.validateLocalTransform(t);const d=r.properties,f=r.properties.length,p=this.bones;for(let m=0,g=this.bones.length;m0?n[Mt.ROTATION]:-n[Mt.ROTATION]);return a<0&&(a+=360),a}}class PS extends ya{mix(e){return e.mixRotate}apply(e,t,s,n,r,o){if(r)s.rotation+=(o?n:n-s.rotation)*t.mixRotate;else{const a=e.scaleX,l=e.scaleY,c=1/a,h=1/l,u=s.a*c,d=s.b*c,f=s.c*h,p=s.d*h;n*=Ee.degRad,o||(n-=Math.atan2(f,u)),n>Ee.PI?n-=Ee.PI2:n<-Ee.PI&&(n+=Ee.PI2),n*=t.mixRotate;const m=Math.cos(n),g=Math.sin(n);s.a=(m*u-g*f)*a,s.b=(m*d-g*p)*a,s.c=(g*u+m*f)*l,s.d=(g*d+m*p)*l}}}class Um extends va{value(e,t,s,n){return s?t.x+n[Mt.X]:(n[Mt.X]*t.a+n[Mt.Y]*t.b+t.worldX)/e.scaleX}}class kS extends ya{mix(e){return e.mixX}apply(e,t,s,n,r,o){r?s.x+=(o?n:n-s.x)*t.mixX:(o||(n-=s.worldX/e.scaleX),s.worldX+=n*t.mixX*e.scaleX)}}class $m extends va{value(e,t,s,n){return s?t.y+n[Mt.Y]:(n[Mt.X]*t.c+n[Mt.Y]*t.d+t.worldY)/e.scaleY}}class FS extends ya{mix(e){return e.mixY}apply(e,t,s,n,r,o){r?s.y+=(o?n:n-s.y)*t.mixY:(o||(n-=s.worldY/e.scaleY),s.worldY+=n*t.mixY*e.scaleY)}}class Xm extends va{value(e,t,s,n){if(s)return t.scaleX+n[Mt.SCALEX];const r=t.a/e.scaleX,o=t.c/e.scaleY;return Math.sqrt(r*r+o*o)+n[Mt.SCALEX]}}class OS extends ya{mix(e){return e.mixScaleX}apply(e,t,s,n,r,o){if(r)o?s.scaleX*=1+(n-1)*t.mixScaleX:s.scaleX!==0&&(s.scaleX+=(n-s.scaleX)*t.mixScaleX);else if(o){const a=1+(n-1)*t.mixScaleX;s.a*=a,s.c*=a}else{let a=s.a/e.scaleX,l=s.c/e.scaleY,c=Math.sqrt(a*a+l*l);c!==0&&(c=1+(n-c)*t.mixScaleX/c,s.a*=c,s.c*=c)}}}class Vm extends va{value(e,t,s,n){if(s)return t.scaleY+n[Mt.SCALEY];const r=t.b/e.scaleX,o=t.d/e.scaleY;return Math.sqrt(r*r+o*o)+n[Mt.SCALEY]}}class LS extends ya{mix(e){return e.mixScaleY}apply(e,t,s,n,r,o){if(r)o?s.scaleY*=1+(n-1)*t.mixScaleY:s.scaleY!==0&&(s.scaleY+=(n-s.scaleY)*t.mixScaleY);else if(o){const a=1+(n-1)*t.mixScaleY;s.b*=a,s.d*=a}else{let a=s.b/e.scaleX,l=s.d/e.scaleY,c=Math.sqrt(a*a+l*l);c!==0&&(c=1+(n-c)*t.mixScaleY/c,s.b*=c,s.d*=c)}}}class Ym extends va{value(e,t,s,n){if(s)return t.shearY+n[Mt.SHEARY];const r=1/e.scaleX,o=1/e.scaleY;return(Math.atan2(t.d*o,t.b*r)-Math.atan2(t.c*o,t.a*r))*Ee.radDeg-90+n[Mt.SHEARY]}}class BS extends ya{mix(e){return e.mixShearY}apply(e,t,s,n,r,o){if(r)o||(n-=s.shearY),s.shearY+=n*t.mixShearY;else{const a=e.scaleX,l=e.scaleY,c=s.b/a,h=s.d/l,u=Math.atan2(h,c);n=(n+90)*Ee.degRad,o?n-=Ee.PI/2:(n-=u-Math.atan2(s.c/l,s.a/a),n>Ee.PI?n-=Ee.PI2:n<-Ee.PI&&(n+=Ee.PI2)),n=u+n*t.mixShearY;const d=Math.sqrt(c*c+h*h);s.b=Math.cos(n)*d*a,s.d=Math.sin(n)*d*l}}}class iV{constructor(e){S(this,"scale",1);S(this,"attachmentLoader");S(this,"linkedMeshes",[]);this.attachmentLoader=e}readSkeletonData(e){const t=this.scale,s=new IS;s.name="";const n=new cO(e),r=n.readInt32(),o=n.readInt32();s.hash=o===0&&r===0?null:o.toString(16)+r.toString(16),s.version=n.readString(),s.x=n.readFloat(),s.y=n.readFloat(),s.width=n.readFloat(),s.height=n.readFloat(),s.referenceScale=n.readFloat()*t;const a=n.readBoolean();a&&(s.fps=n.readFloat(),s.imagesPath=n.readString(),s.audioPath=n.readString());let l=0;l=n.readInt(!0);for(let p=0;p>5;for(let M=0,C;M>1&1,v.spacingMode=y>>2&3,v.rotateMode=y>>4&3,(y&128)!==0&&(v.offsetRotation=n.readFloat());const x=v.setupPose;x.position=n.readFloat(),v.positionMode===cn.Fixed&&(x.position*=t),x.spacing=n.readFloat(),(v.spacingMode===ms.Length||v.spacingMode===ms.Fixed)&&(x.spacing*=t),x.mixRotate=n.readFloat(),x.mixX=n.readFloat(),x.mixY=n.readFloat(),h.push(v);break}case FO:{const v=new Xc(m);v.bone=c[n.readInt(!0)];let y=n.readByte();if(v.skinRequired=(y&1)!==0,(y&2)!==0&&(v.x=n.readFloat()),(y&4)!==0&&(v.y=n.readFloat()),(y&8)!==0&&(v.rotate=n.readFloat()),(y&16)!==0){let M=n.readFloat();M<-2?(v.scaleYMode=Vs.Volume,M=-2-M):M<0&&(v.scaleYMode=Vs.Uniform,M=-1-M),v.scaleX=M}(y&32)!==0&&(v.shearX=n.readFloat()),v.limit=((y&64)!==0?n.readFloat():5e3)*t,v.step=1/n.readUnsignedByte();const x=v.setupPose;x.inertia=n.readFloat(),x.strength=n.readFloat(),x.damping=n.readFloat(),x.massInverse=(y&128)!==0?n.readFloat():1,x.wind=n.readFloat(),x.gravity=n.readFloat(),y=n.readByte(),(y&1)!==0&&(v.inertiaGlobal=!0),(y&2)!==0&&(v.strengthGlobal=!0),(y&4)!==0&&(v.dampingGlobal=!0),(y&8)!==0&&(v.massGlobal=!0),(y&16)!==0&&(v.windGlobal=!0),(y&32)!==0&&(v.gravityGlobal=!0),(y&64)!==0&&(v.mixGlobal=!0),x.mix=(y&128)!==0?n.readFloat():1,h.push(v);break}case OO:{const v=new Zr(m),y=n.readByte();if(v.skinRequired=(y&1)!==0,v.loop=(y&2)!==0,v.additive=(y&4)!==0,(y&8)!==0){const x=n.readFloat();a&&(y&64)!==0?v.max=x:v.setupPose.time=x}if((y&16)!==0&&(v.setupPose.mix=(y&32)!==0?n.readFloat():1),(y&64)!==0){v.local=(y&128)!==0,v.bone=c[n.readInt(!0)];const x=n.readFloat();let M=1;switch(n.readByte()){case 0:v.property=new Dm;break;case 1:{M=t,v.property=new Um;break}case 2:{M=t,v.property=new $m;break}case 3:v.property=new Xm;break;case 4:v.property=new Vm;break;case 5:v.property=new Ym;break;default:continue}v.property.offset=x*M,v.offset=n.readFloat(),v.scale=n.readFloat()/M}h.push(v);break}}}const d=this.readSkin(n,s,!0,a);d&&(s.defaultSkin=d,s.skins.push(d));{let p=s.skins.length;for(Ge.setArraySize(s.skins,l=p+n.readInt(!0));p0){y=[];for(let b=0;b>4,e.readFloat())}r.push(F);break}}}}}const a=s.slots.length,l=e.readInt(!0);if(l>0){const f=new br(l);for(let p=0;p0){const f=new Sl(h);for(let p=0;p>>1^-(s&1)}readStringRef(){const e=this.readInt(!0);return e===0?null:this.strings[e-1]}readString(){let e=this.readInt(!0);switch(e){case 0:return null;case 1:return""}e--;let t="";for(let s=0;s>4){case 12:case 13:t+=String.fromCharCode((n&31)<<6|this.readByte()&63),s+=2;break;case 14:t+=String.fromCharCode((n&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),s+=3;break;default:t+=String.fromCharCode(n),s++}}return t}readFloat(){const e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!==0}}let hO=class{constructor(e,t,s,n,r,o){S(this,"source");S(this,"skinIndex");S(this,"slotIndex");S(this,"sourceIndex");S(this,"mesh");S(this,"inheritTimelines");this.mesh=e,this.skinIndex=t,this.slotIndex=s,this.sourceIndex=n,this.source=r,this.inheritTimelines=o}};class by{constructor(e=null,t,s=0){S(this,"bones");S(this,"vertices");S(this,"length");this.bones=e,this.vertices=t,this.length=s}}var Sn;(function(i){i[i.Region=0]="Region",i[i.BoundingBox=1]="BoundingBox",i[i.Mesh=2]="Mesh",i[i.LinkedMesh=3]="LinkedMesh",i[i.Path=4]="Path",i[i.Point=5]="Point",i[i.Clipping=6]="Clipping"})(Sn||(Sn={}));function is(i,e,t,s){t instanceof Fn?uO(i,e,t,s):dO(i,e,t,s)}function uO(i,e,t,s){let n=i.readFloat(),r=i.readFloat()*s;for(let o=0,a=0,l=t.getFrameCount()-1;t.setFrame(o,n,r),o!==l;o++){const c=i.readFloat(),h=i.readFloat()*s;switch(i.readByte()){case Wi:t.setStepped(o);break;case zi:dt(i,t,a++,o,0,n,c,r,h,s)}n=c,r=h}e.push(t)}function dO(i,e,t,s){let n=i.readFloat(),r=i.readFloat()*s,o=i.readFloat()*s;for(let a=0,l=0,c=t.getFrameCount()-1;t.setFrame(a,n,r,o),a!==c;a++){const h=i.readFloat(),u=i.readFloat()*s,d=i.readFloat()*s;switch(i.readByte()){case Wi:t.setStepped(a);break;case zi:dt(i,t,l++,a,0,n,h,r,u,s),dt(i,t,l++,a,1,n,h,o,d,s)}n=h,r=u,o=d}e.push(t)}function wy(i,e){const t=i.readInt(!0);if(t===0)return null;const s=new Array(e).fill(-1),n=new Array(e-t);let r=0,o=0;for(let a=0;a=0;a--)s[a]===-1&&(s[a]=n[--o]);return s}function dt(i,e,t,s,n,r,o,a,l,c){e.setBezier(t,s,n,r,a,i.readFloat(),i.readFloat()*c,i.readFloat(),i.readFloat()*c,o,l)}const fO=0,mO=1,pO=2,gO=3,vO=4,yO=5,xO=6,bO=7,wO=8,SO=9,MO=10,TO=0,_O=1,CO=2,AO=3,EO=4,IO=5,RO=0,PO=1,kO=2,FO=3,OO=4,LO=0,BO=1,NO=0,DO=1,UO=2,$O=0,XO=1,VO=2,YO=4,GO=5,jO=6,HO=7,WO=8,zO=0,qO=1,Wi=1,zi=2;class KO{constructor(e){S(this,"attachmentLoader");S(this,"scale",1);S(this,"linkedMeshes",[]);this.attachmentLoader=e}readSkeletonData(e){const t=this.scale,s=new IS,n=typeof e=="string"?JSON.parse(e):e,r=n.skeleton;if(r&&(s.hash=r.hash,s.version=r.spine,s.x=r.x,s.y=r.y,s.width=r.width,s.height=r.height,s.referenceScale=Q(r,"referenceScale",100)*t,s.fps=r.fps,s.imagesPath=r.images??null,s.audioPath=r.audio??null),n.bones)for(let o=0;o0&&c.properties.push(w)}c.offsets[Mt.ROTATION]=Q(o,"rotation",0),c.offsets[Mt.X]=Q(o,"x",0)*t,c.offsets[Mt.Y]=Q(o,"y",0)*t,c.offsets[Mt.SCALEX]=Q(o,"scaleX",0),c.offsets[Mt.SCALEY]=Q(o,"scaleY",0),c.offsets[Mt.SHEARY]=Q(o,"shearY",0);const x=c.setupPose;d&&(x.mixRotate=Q(o,"mixRotate",1)),f&&(x.mixX=Q(o,"mixX",1)),p&&(x.mixY=Q(o,"mixY",x.mixX)),m&&(x.mixScaleX=Q(o,"mixScaleX",1)),g&&(x.mixScaleY=Q(o,"mixScaleY",x.mixScaleX)),v&&(x.mixShearY=Q(o,"mixShearY",1)),s.constraints.push(c);break}case"path":{const c=new $c(a);c.skinRequired=l;for(let f=0;f0){const d=s.findConstraint(c,Xc);if(!d)throw new Error(`Physics constraint not found: ${c}`);u=s.constraints.indexOf(d)}for(const d in h){const f=h[d];let p=f[0];if(!p)continue;const m=f.length;let g,v=0;if(d==="reset"){const y=new kh(m,u);for(let x=0;p!=null;p=f[x+1],x++)y.setFrame(x,Q(p,"time",0));r.push(y);continue}switch(d){case"inertia":g=new vS(m,m,u);break;case"strength":g=new yS(m,m,u);break;case"damping":g=new xS(m,m,u);break;case"mass":g=new bS(m,m,u);break;case"wind":g=new wS(m,m,u);break;case"gravity":g=new SS(m,m,u);break;case"mix":{v=1,g=new MS(m,m,u);break}default:continue}Ks(r,f,g,v,1)}}if(e.slider)for(const c in e.slider){const h=e.slider[c],u=s.findConstraint(c,Zr);if(!u)throw new Error(`Slider not found: ${c}`);const d=s.constraints.indexOf(u);for(const f in h){const p=h[f];if(!p[0])continue;const g=p.length;switch(f){case"time":Ks(r,p,new TS(g,g,d),1,1);break;case"mix":Ks(r,p,new _S(g,g,d),1,1);break}}}if(e.attachments)for(const c in e.attachments){const h=e.attachments[c],u=s.findSkin(c);if(!u)throw new Error(`Skin not found: ${c}`);for(const d in h){const f=h[d],p=s.findSlot(d);if(!p)throw new Error(`Attachment slot not found: ${d}`);const m=p.index;for(const g in f){const v=f[g],y=u.getAttachment(m,g);if(!y)throw new Error(`Timeline attachment not found: ${g}`);for(const x in v){const M=v[x];let C=M[0];if(C){if(x==="deform"){const w=y.bones,b=y.vertices,_=w?b.length/3*2:b.length,E=new uS(M.length,M.length,m,y);let F=Q(C,"time",0);for(let I=0,k=0;;I++){let B;const D=Q(C,"vertices",null);if(!D)B=w?Ge.newFloatArray(_):b;else{B=Ge.newFloatArray(_);const A=Q(C,"offset",0);if(Ge.arrayCopy(D,0,B,A,D.length),n!==1)for(let P=A,O=P+D.length;P=0;c--)r[c]===-1&&(r[c]=o[--l]);return r}function pt(i,e,t,s,n,r,o,a,l,c){if(i==="stepped")return e.setStepped(s),t;const h=n<<2,u=i[h],d=i[h+1]*c,f=i[h+2],p=i[h+3]*c;return e.setBezier(t,s,n,r,a,u,d,f,p,o,l),t+1}function Q(i,e,t){return i[e]!==void 0?i[e]:t}class JO{newRegionAttachment(e,t,s,n){return new mu(t,s)}newMeshAttachment(e,t,s,n){return new kl(t,s)}newBoundingBoxAttachment(e,t){return new cw(t)}newPathAttachment(e,t){return new wl(t)}newPointAttachment(e,t){return new pw(t)}newClippingAttachment(e,t){return new sa(t)}}class QO{sequence(e){for(let t=0;t!Number.isInteger(h)||h<0||h>=o))throw new Error(`拖尾网格“${e}”的三角形索引越界`);const a=Number(i.hull)||0;if(!Number.isInteger(a)||a<0||a>o)throw new Error(`拖尾网格“${e}”的外轮廓数量无效`);if(Array.isArray(i.edges)&&i.edges.some(h=>!Number.isInteger(h)||h<0||h>=o*2||h%2))throw new Error(`拖尾网格“${e}”的外轮廓边索引越界`);if(n.length===s.length)return;let l=0,c=0;for(;l=t)throw new Error(`拖尾网格“${e}”引用了不存在的骨骼`);if(![p,m,g].every(Number.isFinite)||g<0)throw new Error(`拖尾网格“${e}”包含无效权重数据`);u+=g}if(Math.abs(u-1)>.001)throw new Error(`拖尾网格“${e}”的顶点权重之和不为 1`);c++}if(l!==n.length||c!==o)throw new Error(`拖尾网格“${e}”的顶点数量与 UV 不一致`)}function sL(i,e){var r,o,a,l;const t=Array.isArray(i.bones)?i.bones:[],s=new Map(t.map(c=>[String(c.name||""),c])),n=new Set;for(const c of t){if(c.inherit!=null&&!eL.has(c.inherit))throw new Error(`骨骼“${c.name||""}”的 inherit 值“${c.inherit}”不符合 Spine ${e} JSON 格式`);if(/_trail_\d+_\d+$/.test(String(c.name||""))){const h=s.get(String(c.parent||""));if(!h||/_trail_\d+_\d+$/.test(String(h.name||"")))throw new Error(`拖尾骨骼“${c.name||""}”必须直接挂在粒子系统骨骼下,不能组成骨骼链`)}}for(const c of Array.isArray(i.skins)?i.skins:[]){const h=(c==null?void 0:c.attachments)||{};for(const u of Object.keys(h))for(const d of Object.keys(h[u]||{})){const f=h[u][d];(f==null?void 0:f.type)==="mesh"&&(tL(f,d,t.length),((r=f.vertices)==null?void 0:r.length)!==((o=f.uvs)==null?void 0:o.length)&&n.add(u))}}for(const c of Object.values(i.animations||{}))for(const h of n){const u=(l=(a=c==null?void 0:c.slots)==null?void 0:a[h])==null?void 0:l.attachment;if(Array.isArray(u)&&u.some(d=>!(d!=null&&d.name)))throw new Error(`加权拖尾插槽“${h}”不能使用空附件,未出现或死亡阶段应将对应骨骼缩放设为 0`)}}function iL(i){var e;if(String(((e=i==null?void 0:i.skeleton)==null?void 0:e.spine)||"")!=="3.8")throw new Error("Spine 3.8 导出的版本标识必须为 3.8");for(const t of i.bones||[])if(t.inherit!=null)throw new Error(`Spine 3.8 骨骼“${t.name||""}”应使用 transform,不能使用 inherit`);for(const t of Object.values(i.animations||{})){for(const n of Object.values(t.slots||{})){if(n.rgba||n.rgba2)throw new Error("Spine 3.8 插槽颜色时间轴必须使用 color / twoColor");for(const r of n.attachment||[])if(!Object.prototype.hasOwnProperty.call(r,"name"))throw new Error("Spine 3.8 附件时间轴的隐藏帧必须显式写入 name: null")}for(const n of Object.values(t.bones||{}))for(const r of n.rotate||[])if(r.value!=null||r.angle==null)throw new Error("Spine 3.8 旋转时间轴必须使用 angle");const s=[t];for(;s.length;){const n=s.pop();if(!(!n||typeof n!="object")){if(!Array.isArray(n)&&Array.isArray(n.curve))throw new Error("Spine 3.8 不支持 4.x 数组曲线格式");s.push(...Object.values(n))}}}}function My(i,e){var o;const t=JSON.parse(i),s=gh((o=t==null?void 0:t.skeleton)==null?void 0:o.spine);if(!s)throw new Error(`导出版本不受支持,仅支持 Spine ${pm()}`);if(e&&s!==e)throw new Error(`导出版本不一致:设置为 Spine ${e},JSON 标记为 Spine ${s}`);sL(t,s),s==="3.8"&&iL(t);const n=s==="3.8"?Ew(JSON.parse(JSON.stringify(t))):t,r=s==="4.3"?new KO(new QO).readSkeletonData(n):new Sh(new JO).readSkeletonData(n);if(!r.bones.length)throw new Error("导出结果缺少骨骼");return{version:s,bones:r.bones.length,slots:r.slots.length,animations:r.animations.length}}const NS="http://127.0.0.1:27843";class Oh extends Error{constructor(t,s="CONNECTOR_ERROR",n){super(t);S(this,"code");S(this,"pairUrl");this.name="SpineConnectorError",this.code=s,this.pairUrl=n}}function Gm(i,e){return String(i||"").trim().replace(/[\\/:*?"<>|]+/g,"_").replace(/^\.+/,"")||e}function nL(i,e){const t=/\.([a-z0-9]{2,5})$/i.exec(i);return t?`.${t[1].toLowerCase()}`:e.includes("jpeg")?".jpg":e.includes("webp")?".webp":e.includes("gif")?".gif":".png"}function rL(i,e,t){const s=String(i||"").replace(/\\/g,"/").split("/").filter(Boolean).map(r=>Gm(r,"images")),n=Gm(e.replace(/\.[^./\\]+$/,""),"image");return[...s,`${n}${nL(e,t)}`].join("/")}async function pf(i,e,t){if(!i)return null;const s=await fetch(i);if(!s.ok)throw new Error(`无法读取导出图片:${t}`);const n=await s.blob(),r=new Uint8Array(await n.arrayBuffer());let o="";const a=32768;for(let l=0;lo.finally(()=>{s++,e==null||e(s,t.length)});for(const o of i.filter(a=>a.visible!==!1)){for(const a of o.config.imageResources)if(a.imageMode==="sequence"&&a.sequenceFrames.length)for(const l of a.sequenceFrames)t.push(n(pf(l.previewUrl,a.textureFolder,l.name||a.textureName)));else t.push(n(pf(a.previewUrl,a.textureFolder,a.textureName)));if(o.config.trail)for(const a of o.config.trailResources)t.push(n(pf(a.previewUrl,"",a.textureName)))}const r=new Map;for(const o of await Promise.all(t))o&&!r.has(o.path)&&r.set(o.path,o);return[...r.values()]}async function oL(){try{const i=await fetch(`${NS}/v1/health`,{cache:"no-store"});if(!i.ok)throw new Error(`HTTP ${i.status}`);return{available:!0,...await i.json()}}catch(i){return{available:!1,authorized:!1,error:i instanceof Error?i.message:String(i)}}}async function aL(i,e){const t=await DS(i.systems,(n,r)=>{e==null||e({phase:"images",progress:r?n/r:1})}),s=JSON.stringify({schemaVersion:1,projectName:i.projectName,spineVersion:i.spineVersion,skeletonJson:i.skeletonJson,images:t});return new Promise((n,r)=>{const o=new XMLHttpRequest;o.open("POST",`${NS}/v1/convert`),o.responseType="blob",o.setRequestHeader("Content-Type","application/json"),o.upload.onprogress=a=>{e==null||e({phase:"upload",progress:a.lengthComputable&&a.total>0?a.loaded/a.total:null})},o.upload.onloadend=()=>e==null?void 0:e({phase:"processing",progress:null}),o.onprogress=a=>{e==null||e({phase:"download",progress:a.lengthComputable&&a.total>0?a.loaded/a.total:null})},o.onerror=()=>r(new Oh("未检测到本地 Spine 连接器,请先启动连接器","CONNECTOR_OFFLINE")),o.onload=async()=>{const a=o.response;if(o.status<200||o.status>=300){let h={};try{h=JSON.parse(await a.text())}catch{}r(new Oh(h.message||`Spine 连接器返回错误:HTTP ${o.status}`,h.code,h.pairUrl));return}const l=o.getResponseHeader("X-Spine-File-Name");let c=`${Gm(i.projectName,"SpineParticle")}.zip`;if(l)try{c=decodeURIComponent(l)}catch{}n({blob:a,fileName:c,spineEditorVersion:o.getResponseHeader("X-Spine-Editor-Version")||i.spineVersion,imageCount:t.length})},o.send(s)})}function lL(i,e){const t=URL.createObjectURL(i),s=document.createElement("a");s.href=t,s.download=/\.zip$/i.test(e)?e:`${e}.zip`,s.style.display="none",document.body.appendChild(s),s.click(),s.remove(),setTimeout(()=>URL.revokeObjectURL(t),1e3)}const cL=Array.from({length:256},(i,e)=>{let t=e;for(let s=0;s<8;s++)t=t&1?3988292384^t>>>1:t>>>1;return t>>>0});function hL(i){let e=4294967295;for(const t of i)e=cL[(e^t)&255]^e>>>8;return(e^4294967295)>>>0}function uL(i){const e=String(i||"").replace(/\\/g,"/").split("/").filter(t=>t&&t!==".");if(!e.length||e.some(t=>t===".."))throw new Error("ZIP 文件路径无效");return e.join("/")}function dL(i=new Date){const e=Math.max(1980,i.getFullYear());return{time:i.getHours()<<11|i.getMinutes()<<5|Math.floor(i.getSeconds()/2),date:e-1980<<9|i.getMonth()+1<<5|i.getDate()}}function gf(i){const e=new Uint8Array(i);return{bytes:e,view:new DataView(e.buffer)}}function Ty(i){const e=new Uint8Array(i.reduce((s,n)=>s+n.length,0));let t=0;for(const s of i)e.set(s,t),t+=s.length;return e}function fL(i){const e=new TextEncoder,t=[],s=[],n=dL();let r=0;for(const l of i){const c=e.encode(uL(l.name)),h=hL(l.data),u=gf(30);u.view.setUint32(0,67324752,!0),u.view.setUint16(4,20,!0),u.view.setUint16(6,2048,!0),u.view.setUint16(10,n.time,!0),u.view.setUint16(12,n.date,!0),u.view.setUint32(14,h,!0),u.view.setUint32(18,l.data.length,!0),u.view.setUint32(22,l.data.length,!0),u.view.setUint16(26,c.length,!0),t.push(u.bytes,c,l.data);const d=gf(46);d.view.setUint32(0,33639248,!0),d.view.setUint16(4,20,!0),d.view.setUint16(6,20,!0),d.view.setUint16(8,2048,!0),d.view.setUint16(12,n.time,!0),d.view.setUint16(14,n.date,!0),d.view.setUint32(16,h,!0),d.view.setUint32(20,l.data.length,!0),d.view.setUint32(24,l.data.length,!0),d.view.setUint16(28,c.length,!0),d.view.setUint32(42,r,!0),s.push(d.bytes,c),r+=u.bytes.length+c.length+l.data.length}const o=Ty(s),a=gf(22);return a.view.setUint32(0,101010256,!0),a.view.setUint16(8,i.length,!0),a.view.setUint16(10,i.length,!0),a.view.setUint32(12,o.length,!0),a.view.setUint32(16,r,!0),new Blob([Ty([...t,o,a.bytes])],{type:"application/zip"})}function mL(i){const e=atob(i),t=new Uint8Array(e.length);for(let s=0;ss===".."||/^[a-z]+:/i.test(s))?"images":t.join("/")}function gL(i){return String(i||"SpineParticle").replace(/\.json$/i,"").replace(/[\\/:*?"<>|]+/g,"_").replace(/^\.+/,"")||"SpineParticle"}async function vL(i){const e=await DS(i.systems);if(!e.length)throw new Error("当前可见粒子系统没有可导出的图片");const t=pL(i.imagesPath);return{blob:fL(e.map(n=>({name:`${t}/${n.path}`,data:mL(n.dataBase64)}))),imageCount:e.length,folder:t}}function yL(i,e){const t=`${gL(e)}-images.zip`,s=URL.createObjectURL(i),n=document.createElement("a");return n.href=s,n.download=t,n.style.display="none",document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(s),1e3),t}function xL(i){i.settings.exportSettings=T1(i.settings.exportSettings);const e=De(()=>i.settings.exportSettings),t=Fe(!1),s=Fe(null),n=Fe(""),r=Fe(!1),o=Fe(null),a=Fe(""),l=Fe(""),c=De(()=>{const b=o.value;return b?b.available?b.spineFound?b.authorized?"连接器可用 · Spine 已就绪":"连接器已启动,当前网站尚未授权":"连接器已启动,但未找到 Spine":"本地 Spine 连接器未启动":"正在检测本地 Spine 连接器…"}),h=De(()=>{var b,_,E,F,I,k;return{ready:!!((b=o.value)!=null&&b.available)&&!!((_=o.value)!=null&&_.spineFound)&&!!((E=o.value)!=null&&E.authorized),warning:!!((F=o.value)!=null&&F.available)&&(!((I=o.value)!=null&&I.spineFound)||!((k=o.value)!=null&&k.authorized))}}),u=De(()=>{var b,_,E;return!!((b=o.value)!=null&&b.available)&&!!((_=o.value)!=null&&_.spineFound)&&!!((E=o.value)!=null&&E.authorized)}),d=De(()=>{const b=o.value;return!(b!=null&&b.available)||!b.spineFound||b.authorized||typeof window>"u"?"":`http://127.0.0.1:27843/pair?origin=${encodeURIComponent(window.location.origin)}`}),f=De(()=>{const b=o.value;return b?b.available?b.spineFound?b.authorized?"":"未授权":"未找到 Spine":"未启动":"检测中"}),p=De(()=>t.value?"正在重新计算并生成 Spine 工程":f.value?`暂不可用:${f.value}`:`调用本机 Spine 自动生成 ${e.value.spineVersion} 工程`);Oi(()=>{v(),m=window.setInterval(v,3e3)});let m,g=0;po(()=>{m!==void 0&&window.clearInterval(m)});async function v(){const b=++g,_=await oL();if(b!==g)return;o.value=_;const E=l.value;(E==="CONNECTOR_OFFLINE"?_.available:E==="SPINE_NOT_FOUND"?_.available&&_.spineFound:E==="ORIGIN_NOT_ALLOWED"?_.available&&_.spineFound&&_.authorized:!!E&&_.available&&_.spineFound&&_.authorized)&&(l.value="",a.value="",r.value&&(r.value=!1,n.value=""))}function y(){return new Promise(b=>requestAnimationFrame(()=>b()))}async function x(b){i.timeline.playing=!1,i.timeline.frame=0,i.timeline.recorded=!1;for(const F of i.systems)F.frames=void 0;i.recalcTotalFrames(),await y(),i.timeline.playing=!0;const _=i.timeline.totalFrames/Math.max(1,i.timeline.fps)*1e3,E=performance.now()+Math.max(8e3,_*2.5+3e3);for(;!i.timeline.recorded;){if(performance.now()>E)throw new Error("重新计算动画超时,请确认页面仍在运行后重试");b==null||b(Math.min(.98,i.timeline.frame/Math.max(1,i.timeline.totalFrames-1))),await new Promise(F=>setTimeout(F,50))}b==null||b(1)}async function M(){if(!t.value){t.value=!0,s.value="json",r.value=!1,l.value="",a.value="",n.value="正在重新计算粒子动画…";try{await x();const b=uy({systems:i.systems,timeline:i.timeline,settings:e.value});My(b.text,e.value.spineVersion),q3(b,e.value.fileName);const _=b.warnings.length?`;${b.warnings.length} 条资源提示(缺图仍已导出)`:"";n.value=`已导出 Spine ${e.value.spineVersion}:${b.particleSystemCount} 个粒子系统、${b.animationCount} 个动画、${b.boneCount} 根骨骼${_}`}catch(b){r.value=!0,n.value=b instanceof Error?b.message:String(b)}finally{t.value=!1,s.value=null}}}async function C(){if(t.value)return;t.value=!0,s.value="spine",r.value=!1,l.value="",a.value="",n.value="正在重新计算粒子动画…";const b=Vw("导出 Spine 包","正在重新计算粒子动画…");try{await b.paint(),await x(I=>b.update(I*18,"正在重新计算粒子动画…")),b.update(20,"正在生成 Spine JSON…");const _=uy({systems:i.systems,timeline:i.timeline,settings:e.value});My(_.text,e.value.spineVersion),n.value="正在整理图片并调用本机 Spine…";const E=e.value.fileName.replace(/\.json$/i,"")||"SpineParticle",F=await aL({projectName:E,spineVersion:e.value.spineVersion,skeletonJson:_.text,systems:i.systems},({phase:I,progress:k})=>{I==="images"?b.update(k==null?null:22+k*18,"正在整理工程图片…"):I==="upload"?b.update(k==null?null:40+k*30,"正在上传数据到 Spine 连接器…"):I==="processing"?b.update(null,"Spine 正在转换工程,请稍候…"):b.update(k==null?null:82+k*16,"正在下载生成的 Spine 工程包…")});b.update(99,"正在交给浏览器下载…"),lL(F.blob,F.fileName),n.value=`已生成 ${F.fileName}:包含 .spine 工程和 ${F.imageCount} 张图片,Spine ${F.spineEditorVersion}`,await v(),await b.finish("Spine 工程包已开始下载")}catch(_){const E=_ instanceof Error?_.message:String(_);r.value=!0,l.value=_ instanceof Oh?_.code:"",_ instanceof Oh&&_.pairUrl&&(a.value=_.pairUrl),n.value=E,await v(),await b.fail(E)}finally{t.value=!1,s.value=null}}async function w(){if(!t.value){t.value=!0,s.value="images",r.value=!1,l.value="",a.value="",n.value="正在整理当前粒子系统使用的图片…";try{const b=await vL({systems:i.systems,imagesPath:e.value.imagesPath}),_=yL(b.blob,e.value.fileName);n.value=`已生成 ${_}:${b.folder}/ 内包含 ${b.imageCount} 张图片`}catch(b){r.value=!0,n.value=b instanceof Error?b.message:String(b)}finally{t.value=!1,s.value=null}}}return{exportSettings:e,exportBusy:t,exportTarget:s,exportMessage:n,exportError:r,connectorHealth:o,connectorPairUrl:a,connectorExportErrorCode:l,connectorStatusText:c,connectorStatusClass:h,connectorReady:u,connectorAuthorizationUrl:d,connectorDisabledReason:f,connectorButtonTitle:p,connectorHealthTimer:m,connectorHealthRequestId:g,refreshConnectorHealth:v,nextPaint:y,prepareExportFrames:x,exportSpineJson:M,exportSpineProject:C,exportSpineImages:w}}function bL(i){const e=Fe(null),t=Fe(""),s=Fe([]),n=Fe(!1),r=Fe(""),o=Fe(!1);function a(){Ow(i),o.value=!1,r.value="配置已保存到本地"}async function l(u){var p;const d=u.target,f=(p=d.files)==null?void 0:p[0];if(f){r.value="正在加载配置…",o.value=!1;try{await Ok(i,f),r.value=`已加载:${f.name}`}catch(m){o.value=!0,r.value=m instanceof Error?m.message:String(m)}finally{d.value=""}}}async function c(){try{const u=await fetch(`/Preset/index.json?t=${Date.now()}`,{cache:"no-store"});if(!u.ok)throw new Error("无法读取预设列表");const d=await u.json();s.value=Array.isArray(d)?d.filter(f=>!!f&&typeof f.name=="string"&&typeof f.file=="string"):[]}catch{s.value=[]}}async function h(){const u=t.value;if(!u)return;n.value=!0,o.value=!1,r.value="正在加载预设…";const d=Vw("加载预设",`正在下载 ${u}…`);try{await d.paint();const f=await fetch(`/Preset/${encodeURIComponent(u)}`,{cache:"no-store"});if(!f.ok)throw new Error(`无法读取预设:${u}`);const p=await b3(f,m=>{d.update(m==null?null:m*55,`正在下载 ${u}…`)});d.update(58,"正在解析预设配置…"),d.update(70,"正在解析并恢复预设资源…"),await Bw(i,p),r.value=`已加载预设:${u.replace(/\.json$/i,"")}`,await d.finish("预设加载完成")}catch(f){o.value=!0;const p=f instanceof Error?f.message:String(f);r.value=`${p},请检查预设文件命名`,await d.fail(p)}finally{n.value=!1,t.value=""}}return Oi(c),{configFileInput:e,selectedPreset:t,presetOptions:s,presetLoading:n,configMessage:r,configError:o,saveConfig:a,onConfigFileChange:l,refreshPresets:c,loadSelectedPreset:h}}function wL(i){const e=Fe(null),t=Fe(null),s=Fe(null),n=Fe(null),r=Fe(null);function o(){var L;const P=(L=i.value)==null?void 0:L.config;if(!P)return;const O=Math.max(0,...P.trailResources.map($=>$.id))+1;P.trailResources.push({id:O,texture:null,textureName:"trail",previewUrl:"/images/trail.png",weight:100,locked:!1,rotation:0,colorMode:"particle",color:"#ffffff",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],blend:"normal",alphaMode:"particle",alpha:1,alphaCurve:Tm.map($=>({...$})),boneCount:3,trailRatio:100,lengthMode:"fixed",length:100,lengthMin:100,lengthMax:100,widthSizeMode:"fixed",width:100,widthMin:100,widthMax:100,widthMode:"particle",lifeLengthEnabled:!1,lifeLengthCurve:Sm.map($=>({...$})),shapeEnabled:!1,shapeCurve:_m.map($=>({...$}))}),p()}function a(P){var O;r.value=P,(O=n.value)==null||O.click()}function l(P,O){var V;const L=(V=i.value)==null?void 0:V.config;if(!L)return;const $=P==="trailGridCols"?32:16;L[P]=Math.min($,Math.max(2,Math.round(Number(O)||2)))}function c(P,O){var $;const L=($=i.value)==null?void 0:$.config.trailResources.find(V=>V.id===P);L&&(L.boneCount=Math.min(16,Math.max(2,Math.round(Number(O)||2))))}function h(P,O){var $;const L=($=i.value)==null?void 0:$.config.trailResources.find(V=>V.id===P);L&&(L.rotation=Math.max(-360,Math.min(360,Number(O)||0)))}async function u(P){var K,ie;const O=P.target,L=(K=O.files)==null?void 0:K[0],$=(ie=i.value)==null?void 0:ie.config,V=$==null?void 0:$.trailResources.find(re=>re.id===r.value);if(!L||!V){O.value="";return}const j=await _(L);V.texture=ur(await ze.fromURL(j)),V.previewUrl=j,V.textureName=L.name.replace(/\.[^.]+$/,"")||"trail",O.value="",r.value=null}async function d(P){var $;const O=($=i.value)==null?void 0:$.config,L=O==null?void 0:O.trailResources.find(V=>V.id===P);L&&(L.texture=ur(await ze.fromURL("/images/trail.png")),L.previewUrl="/images/trail.png",L.textureName="trail",L.weight=100,L.locked=!1,L.rotation=0,L.boneCount=3,L.trailRatio=100,L.lengthMode="fixed",L.length=100,L.lengthMin=100,L.lengthMax=100,L.widthSizeMode="fixed",L.width=100,L.widthMin=100,L.widthMax=100,L.widthMode="particle",L.lifeLengthEnabled=!1,L.lifeLengthCurve=Sm.map(V=>({...V})),L.shapeEnabled=!1,L.shapeCurve=_m.map(V=>({...V})),L.colorMode="particle",L.color="#ffffff",L.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],L.blend="normal",L.alphaMode="particle",L.alpha=1,L.alphaCurve=Tm.map(V=>({...V})),p())}function f(P){var $;const O=($=i.value)==null?void 0:$.config.trailResources;if(!O||O.length<=1)return;const L=O.findIndex(V=>V.id===P);L>=0&&O.splice(L,1),p()}function p(){var V;const P=(V=i.value)==null?void 0:V.config.trailResources;if(!(P!=null&&P.length))return;if(P.length===1){P[0].weight=100,P[0].locked=!1;return}const O=P.filter(j=>j.locked),L=P.filter(j=>!j.locked);let $=O.reduce((j,K)=>j+Math.max(0,Number(K.weight)||0),0);$>100&&(X(O,100,!0),$=100),X(L,100-$)}function m(P,O){var ie;const L=(ie=i.value)==null?void 0:ie.config.trailResources;if(!(L!=null&&L.length))return;if(L.length===1){L[0].weight=100,L[0].locked=!1;return}const $=L.find(re=>re.id===P);if(!$||$.locked)return;const V=L.filter(re=>re.id!==P&&re.locked).reduce((re,pe)=>re+Math.max(0,Number(pe.weight)||0),0),j=Math.max(0,100-V),K=L.filter(re=>re.id!==P&&!re.locked);$.weight=D(Math.min(j,Math.max(0,Number(O)||0))),K.length?X(K,j-$.weight,!0):$.weight=D(j)}function g(P){var $;const O=($=i.value)==null?void 0:$.config.trailResources;if(!O||O.length===1)return;const L=O.find(V=>V.id===P);L&&(L.locked=!L.locked)}function v(P,O){const L=O.target;P.color=F(L.value,P.color),L.value=P.color}function y(P,O){v(P,O),O.target.blur()}function x(){var L;const P=(L=i.value)==null?void 0:L.config;if(!P)return;const O=Math.max(0,...P.imageResources.map($=>$.id))+1;P.imageResources.push({id:O,texture:P.texture,textureName:"star",textureFolder:"",previewUrl:"/images/star.png",imageMode:"fixed",sequencePlayback:"loop-forward",sequenceFps:30,sequenceFrames:[],weight:100,locked:!1,scale:1,anchorX:.5,anchorY:.5,colorMode:"fixed",colorStart:"#ffffff",colorEnd:"#ff4d4d",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],blend:"normal",independentAlpha:"off",alpha:1,alphaCurveMode:"跟随导出",alphaCurve:Mm.map($=>({...$}))}),N()}function M(P){var O;s.value=P,(O=e.value)==null||O.click()}function C(P){var O;s.value=P,(O=t.value)==null||O.click()}async function w(P){var ie,re;const O=P.target,L=(ie=O.files)==null?void 0:ie[0],$=(re=i.value)==null?void 0:re.config,V=$==null?void 0:$.imageResources.find(pe=>pe.id===s.value);if(!L||!V){O.value="";return}const j=await _(L),K=ur(await ze.fromURL(j));V.texture=K,V.previewUrl=j,V.textureFolder="",V.textureName=L.name.replace(/\.[^.]+$/,"")||"particle",O.value="",s.value=null}async function b(P){var j;const O=P.target,L=Array.from(O.files||[]).sort((K,ie)=>K.name.localeCompare(ie.name,void 0,{numeric:!0,sensitivity:"base"})),$=(j=i.value)==null?void 0:j.config,V=$==null?void 0:$.imageResources.find(K=>K.id===s.value);if(!L.length||!V){O.value="";return}V.sequenceFrames=await Promise.all(L.map(async K=>{const ie=await _(K);return{name:K.name,previewUrl:ie,texture:ur(await ze.fromURL(ie))}})),V.imageMode="sequence",O.value="",s.value=null}function _(P){return new Promise((O,L)=>{const $=new FileReader;$.onload=()=>O(String($.result||"")),$.onerror=()=>L($.error),$.readAsDataURL(P)})}function E(P){var $;const O=($=i.value)==null?void 0:$.config,L=O==null?void 0:O.imageResources.find(V=>V.id===P);!O||!L||(L.texture=O.texture,L.textureName="star",L.textureFolder="",L.previewUrl="/images/star.png",L.imageMode="fixed",L.sequencePlayback="loop-forward",L.sequenceFps=30,L.sequenceFrames=[],L.scale=1,L.anchorX=.5,L.anchorY=.5,L.colorMode="fixed",L.colorStart="#ffffff",L.colorEnd="#ff4d4d",L.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],L.blend="normal",L.independentAlpha="off",L.alpha=1,L.alphaCurveMode="跟随导出",L.alphaCurve=Mm.map(V=>({...V})),L.locked=!1,N())}function F(P,O){let L=P.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(L)&&(L=L.split("").map($=>$+$).join("")),/^[0-9a-f]{6}$/i.test(L)?`#${L.toLowerCase()}`:O}function I(P,O){const L=O.target;P.colorStart=F(L.value,P.colorStart),L.value=P.colorStart}function k(P,O){I(P,O),O.target.blur()}function B(P){var $;const O=($=i.value)==null?void 0:$.config.imageResources;if(!O||O.length<=1)return;const L=O.findIndex(V=>V.id===P);L>=0&&O.splice(L,1),N()}function D(P){return Math.round(P)}function X(P,O,L=!1){if(!P.length)return;const $=Math.max(0,D(O)),V=L?P.reduce((K,ie)=>K+Math.max(0,Number(ie.weight)||0),0):0;let j=0;P.forEach((K,ie)=>{const re=ie===P.length-1,pe=D(re?$-j:V>0?$*Math.max(0,Number(K.weight)||0)/V:$/P.length);K.weight=pe,j+=pe})}function N(){var V;const P=(V=i.value)==null?void 0:V.config.imageResources;if(!(P!=null&&P.length))return;if(P.length===1){P[0].weight=100,P[0].locked=!1;return}const O=P.filter(j=>j.locked),L=P.filter(j=>!j.locked);let $=O.reduce((j,K)=>j+Math.max(0,Number(K.weight)||0),0);$>100&&(X(O,100,!0),$=100),X(L,100-$)}function U(P,O){var ie;const L=(ie=i.value)==null?void 0:ie.config.imageResources;if(!(L!=null&&L.length))return;if(L.length===1){L[0].weight=100,L[0].locked=!1;return}const $=L.find(re=>re.id===P);if(!$||$.locked)return;const V=L.filter(re=>re.id!==P&&re.locked).reduce((re,pe)=>re+Math.max(0,Number(pe.weight)||0),0),j=Math.max(0,100-V),K=L.filter(re=>re.id!==P&&!re.locked);if($.weight=D(Math.min(j,Math.max(0,Number(O)||0))),!K.length){$.weight=D(j);return}X(K,j-$.weight,!0)}function A(P){var $;const O=($=i.value)==null?void 0:$.config.imageResources;if(!O||O.length===1)return;const L=O.find(V=>V.id===P);L&&(L.locked=!L.locked)}return{textureFileInput:e,sequenceFileInput:t,pendingResourceId:s,trailTextureFileInput:n,pendingTrailResourceId:r,addTrailResource:o,openTrailTexturePicker:a,onTrailRigChange:l,onTrailResourceBoneCountChange:c,onTrailResourceRotationChange:h,onTrailTextureFile:u,resetTrailTexture:d,removeTrailResource:f,rebalanceTrailWeights:p,setTrailResourceWeight:m,toggleTrailResourceLock:g,setTrailColor:v,commitTrailColor:y,addImageResource:x,openTexturePicker:M,openSequencePicker:C,onTextureFile:w,onSequenceFiles:b,readFileAsDataUrl:_,resetTexture:E,normalizeHex:F,setResourceFixedColor:I,commitResourceFixedColor:k,removeImageResource:B,roundWeight:D,distributeImageWeights:X,rebalanceImageWeights:N,setResourceWeight:U,toggleResourceLock:A}}function SL(){const i=yo(),{exportSettings:e,exportBusy:t,exportTarget:s,exportMessage:n,exportError:r,connectorPairUrl:o,connectorStatusText:a,connectorStatusClass:l,connectorReady:c,connectorAuthorizationUrl:h,connectorDisabledReason:u,connectorButtonTitle:d,refreshConnectorHealth:f,exportSpineJson:p,exportSpineProject:m,exportSpineImages:g}=xL(i),{configFileInput:v,selectedPreset:y,presetOptions:x,presetLoading:M,configMessage:C,configError:w,saveConfig:b,onConfigFileChange:_,refreshPresets:E,loadSelectedPreset:F}=bL(i);function I(Z){return Z==="跟随导出"?e.value.keyframeCurve==="bezier"?"bezier":"linear":Z==="贝塞尔"?"bezier":"linear"}i.systems.length||i.addSystem();const k=De(()=>{const Z=i.systems.findIndex(ae=>ae.id===i.activeId);return Z>=0?Z:0}),B=De(()=>i.systems[k.value]||null),{textureFileInput:D,sequenceFileInput:X,trailTextureFileInput:N,addTrailResource:U,openTrailTexturePicker:A,onTrailRigChange:P,onTrailResourceBoneCountChange:O,onTrailResourceRotationChange:L,onTrailTextureFile:$,resetTrailTexture:V,removeTrailResource:j,setTrailResourceWeight:K,toggleTrailResourceLock:ie,setTrailColor:re,commitTrailColor:pe,addImageResource:ge,openTexturePicker:he,openSequencePicker:fe,onTextureFile:Y,onSequenceFiles:W,resetTexture:H,setResourceFixedColor:G,commitResourceFixedColor:q,removeImageResource:se,setResourceWeight:ue,toggleResourceLock:ne}=wL(B),de=De(()=>B.value?_1(B.value.config,i.timeline.fps):30),le=De(()=>{var ae;const Z=(ae=B.value)==null?void 0:ae.config;return Z?Math.max(1,Math.ceil(Number(Z.loopDurationFrames)||1)):1}),Re=De(()=>i.activeObjectType),we=De(()=>i.activeObjectType==="collision"&&i.colliders.find(Z=>Z.id===i.activeObjectId)||null),me=De(()=>i.activeObjectType==="path"&&i.paths.find(Z=>Z.id===i.activeObjectId)||null),Ue=De(()=>i.activeObjectType==="spine"&&i.spines.find(Z=>Z.id===i.activeObjectId)||null),Je=De(()=>i.activeObjectType==="particle"?i.systems.some(Z=>Z.id===i.activeObjectId):i.activeObjectType==="collision"?i.colliders.some(Z=>Z.id===i.activeObjectId):i.activeObjectType==="path"?i.paths.some(Z=>Z.id===i.activeObjectId):i.spines.some(Z=>Z.id===i.activeObjectId)),qe=De(()=>{const Z=i.spines.find(ae=>ae.selectedBone&&ae.bones.some(Se=>Se.name===ae.selectedBone));return Z?{spine:Z,boneName:Z.selectedBone}:null}),Ze=De(()=>{var Se;const Z=(Se=B.value)==null?void 0:Se.config;if(!Z||Z.emitterFollowMode!=="bone")return null;const ae=i.spines.find(bt=>bt.id===Z.emitterFollowSpineId);return!ae||!ae.bones.some(bt=>bt.name===Z.emitterFollowBoneName)?null:{spine:ae,boneName:Z.emitterFollowBoneName}}),Be=Fe(!1),Me=Fe(""),nt=De(()=>i.spines.filter(Z=>Z.enabled&&Z.visible!==!1&&Z.status==="ready")),Te=De(()=>i.spines.find(Z=>{var ae;return Z.id===((ae=B.value)==null?void 0:ae.config.renderLayerSpineId)})||null),vs=De(()=>{const Z=Te.value;return!!Z&&Z.enabled&&Z.visible!==!1&&Z.status==="ready"}),Ct=De(()=>{var Z;return[...((Z=Te.value)==null?void 0:Z.slots)||[]].sort((ae,Se)=>ae.order-Se.order)}),xt=De(()=>{const Z=Me.value.trim().toLocaleLowerCase();return Z?Ct.value.filter(ae=>ae.name.toLocaleLowerCase().includes(Z)||ae.attachment.toLocaleLowerCase().includes(Z)):Ct.value}),te=De(()=>Ct.value.find(Z=>{var ae;return Z.name===((ae=B.value)==null?void 0:ae.config.renderLayerSlotName)})||null),oe=De(()=>{const Z=te.value;return Z&&Ct.value.filter(ae=>ae.orderSe.order-ae.order)[0]||null}),lt=De(()=>{var bt;const Z=(bt=B.value)==null?void 0:bt.config,ae=Te.value,Se=te.value;return!Z||!ae||!Se?"":`${ae.name} / ${Se.name} · 图片${Z.renderLayerSlotPosition==="below"?"之下":"之上"}`}),It=De(()=>{var Se;const Z=(Se=B.value)==null?void 0:Se.config,ae=te.value;return!Z||!ae?"":Z.renderLayerSlotPosition==="above"?`渲染在 ${ae.name} 图片之上、其后插槽之下`:oe.value?`渲染在 ${oe.value.name} 与 ${ae.name} 之间`:""}),Rt=De(()=>{var Se;const Z=(Se=B.value)==null?void 0:Se.config;if(!Z||Z.renderLayerMode!=="slot")return"";if(!nt.value.length)return"没有已加载的 Spine,粒子临时显示在最上层。";if(!Z.renderLayerSpineId)return"尚未选择 Spine,粒子临时显示在最上层。";const ae=Te.value;return ae?!ae.enabled||ae.status!=="ready"?"目标 Spine 未就绪,粒子临时显示在最上层。":Z.renderLayerSlotName?te.value?Z.renderLayerSlotPosition==="below"&&!oe.value?"这是第一个插槽,无法显示在其下方,粒子临时显示在最上层。":"":"目标插槽不存在(资源可能已更换),粒子临时显示在最上层。":"":"目标 Spine 不存在,粒子临时显示在最上层。"});function tt(){var ae;const Z=(ae=B.value)==null?void 0:ae.config;Z&&(Z.renderLayerMode="slot",!Z.renderLayerSpineId&&nt.value.length&&(Z.renderLayerSpineId=nt.value[0].id),Be.value=!Z.renderLayerSlotName)}function ni(Z){var Se;const ae=(Se=B.value)==null?void 0:Se.config;ae&&(ae.renderLayerSpineId=Math.max(0,Math.round(Number(Z.target.value)||0)),ae.renderLayerSlotName="",Be.value=!0)}function rs(Z){var Se;const ae=(Se=B.value)==null?void 0:Se.config;ae&&(ae.renderLayerSlotName=Z.name,Be.value=!1,Me.value="")}function ss(){var ae;const Z=(ae=B.value)==null?void 0:ae.config;Z&&(Z.renderLayerSlotName="",Z.renderLayerSlotPosition="above")}const Tt=Fe(!1),vi=De(()=>{var ae;const Z=new Set(((ae=B.value)==null?void 0:ae.config.collisionColliderIds)||[]);return i.colliders.filter(Se=>Z.has(Se.id))}),As=De(()=>{var ae;const Z=new Set(((ae=B.value)==null?void 0:ae.config.collisionColliderIds)||[]);return i.colliders.filter(Se=>!Z.has(Se.id))});cs(()=>{var Z,ae;return[(Z=B.value)==null?void 0:Z.id,(ae=B.value)==null?void 0:ae.config.collision]},()=>{Tt.value=!1}),cs(()=>{var Z;return(Z=B.value)==null?void 0:Z.id},()=>{Be.value=!1,Me.value=""});function os(Z){var Se;const ae=(Se=B.value)==null?void 0:Se.config;!ae||ae.collisionColliderIds.includes(Z)||(ae.collisionColliderIds.push(Z),Tt.value=!1)}function fn(Z){var Se;const ae=(Se=B.value)==null?void 0:Se.config;ae&&(ae.collisionColliderIds=ae.collisionColliderIds.filter(bt=>bt!==Z))}Fo(()=>{for(const Z of i.systems)Z.visible==null&&(Z.visible=!0);for(const Z of i.colliders)Z.visible==null&&(Z.visible=!0);for(const Z of i.paths)Z.visible==null&&(Z.visible=!0);for(const Z of i.spines)Z.visible==null&&(Z.visible=!0)}),Fo(()=>{if(!B.value)return;const Z=Dn(B.value.config);Z.lifeMode==="curve"&&(Z.lifeMode="random"),Z.speedMode==="curve"&&(Z.speedMode="random"),Z.scaleMode==="curve"&&(Z.scaleMode="random"),Z.initialRotationMode==="curve"&&(Z.initialRotationMode="random"),Z.mode==="stream"&&!(Z.duration>0)&&(Z.duration=1),Z.streamBehavior==="loop"&&(Z.emitterFollow||Z.emitterFollowMode!=="none")&&Ir(Z)}),Fo(()=>{const Z=new Set(i.colliders.map(ae=>ae.id));for(const ae of i.systems){const Se=Dn(ae.config),bt=Se.collisionColliderIds.filter(Rr=>Z.has(Rr));if(bt.length!==Se.collisionColliderIds.length&&(Se.collisionColliderIds=bt),Se.spawnPathId>0&&!i.paths.some(Rr=>Rr.id===Se.spawnPathId)&&(Se.spawnPathId=0,(Se.emissionAngleMode==="path-normal"||Se.emissionAngleMode==="path-tangent")&&(Se.emissionAngleMode="fixed")),Se.emitterFollowMode!=="bone")continue;const jt=i.spines.find(Rr=>Rr.id===Se.emitterFollowSpineId);!!(jt!=null&&jt.bones.some(Rr=>Rr.name===Se.emitterFollowBoneName))||(Se.emitterFollowMode="none",Se.emitterFollowSpineId=0,Se.emitterFollowBoneName="")}}),Fo(()=>{for(const Z of i.systems){const ae=Dn(Z.config);ae.renderLayerMode!=="slot"||!ae.renderLayerSpineId||i.spines.some(Se=>Se.id===ae.renderLayerSpineId)||(ae.renderLayerSpineId=0,ae.renderLayerSlotName="")}}),Fo(()=>{for(const Z of i.colliders)Z.followPathId==null&&(Z.followPathId=0),Z.followDuration>0||(Z.followDuration=2),Z.followPathRotation==null&&(Z.followPathRotation=!1),["跟随导出","线性","贝塞尔"].includes(Z.followCurveMode)||(Z.followCurveMode="跟随导出"),(!Array.isArray(Z.followCurve)||Z.followCurve.length<2)&&(Z.followCurve=[{x:0,y:0},{x:1,y:1}])});const ri=mo({config:!0,scene:!1,emitMode:!0,shape:!0,attr:!0,look:!0,mods:!0,export:!1});function Bi(Z){ri[Z]=!ri[Z]}function Ni(Z){var Se;const ae=(Se=B.value)==null?void 0:Se.config;ae&&(ae.mode=Z,Z==="stream"&&!(ae.duration>0)&&(ae.duration=1))}function Er(Z){var bt;const ae=(bt=B.value)==null?void 0:bt.config;if(!ae)return;const Se=Math.min(1800,Math.max(1,Math.ceil(Number(Z)||1)));ae.loopDurationFrames=Se}function Ir(Z){const ae=bl();Z.emitterFollow=!1,Z.emitterFollowMode="none",Z.emitterFollowPathId=ae.emitterFollowPathId,Z.emitterFollowSpineId=ae.emitterFollowSpineId,Z.emitterFollowBoneName=ae.emitterFollowBoneName,Z.emitterFollowBoneOffsetX=ae.emitterFollowBoneOffsetX,Z.emitterFollowBoneOffsetY=ae.emitterFollowBoneOffsetY,Z.emitterFollowBoneRotation=ae.emitterFollowBoneRotation,Z.emitterFollowBoneScaleX=ae.emitterFollowBoneScaleX,Z.emitterFollowBoneScaleY=ae.emitterFollowBoneScaleY,Z.emitterAngleMode=ae.emitterAngleMode,Z.emitterFollowCurve=ae.emitterFollowCurve.map(Se=>({...Se})),Z.emitterFollowDuration=ae.emitterFollowDuration,Z.emitterFollowSpace=ae.emitterFollowSpace,Z.emitterFollowDirection=ae.emitterFollowDirection,Z.emitterFollowOffset=ae.emitterFollowOffset}function xa(Z){var jt;const ae=(jt=B.value)==null?void 0:jt.config;if(!ae||ae.streamBehavior===Z)return;const Se=Z==="loop",bt=Se?"进入循环持续模式后,粒子跟随设置会失效并恢复默认值。是否继续?":"退出循环持续模式后,粒子跟随设置会失效并恢复默认值。是否继续?";window.confirm(bt)&&(Ir(ae),ae.streamBehavior=Z,Se||(ae.generateLoopStartAnimation=!1,ae.generateLoopEndAnimation=!1))}function ba(Z,ae){var jt;const Se=(jt=B.value)==null?void 0:jt.config;if(!Se)return;const bt=ae.target.checked;Z==="start"?Se.generateLoopStartAnimation=bt:Se.generateLoopEndAnimation=bt}function Bl(Z,ae){var jt;const Se=(jt=B.value)==null?void 0:jt.config;if(!Se)return;const bt=Math.min(1800,Math.max(1,Math.ceil(Number(ae.target.value)||30)));Z==="start"?Se.loopStartDurationFrames=bt:Se.loopEndDurationFrames=bt}function Nl(Z,ae){var jt;const Se=(jt=B.value)==null?void 0:jt.config;if(!Se)return;const bt=ae.target.checked;Z==="start"?Se.loopStartUseCustomDuration=bt:Se.loopEndUseCustomDuration=bt}function wa(Z,ae){const Se=Z.target.value;if(ae.emitterFollowMode=Se,Se!=="bone"){ae.emitterFollowSpineId=0,ae.emitterFollowBoneName="";return}Sa(ae)}function Sa(Z){const ae=qe.value;if(!ae){Z.emitterFollowMode="none",Z.emitterFollowSpineId=0,Z.emitterFollowBoneName="";return}Z.emitterFollowMode="bone",Z.emitterFollowSpineId=ae.spine.id,Z.emitterFollowBoneName=ae.boneName}const Ma={emitMode:["mode","rate","streamBehavior","loopDurationFrames","generateLoopStartAnimation","loopStartUseCustomDuration","loopStartDurationFrames","generateLoopEndAnimation","loopEndUseCustomDuration","loopEndDurationFrames","burstCount","burstLoop","delay","duration"],shape:["shape","showShape","shapeRangeVersion","innerRadius","outerRadius","innerRectW","innerRectH","outerRectW","outerRectH","spawnPathId","spawnPathDistribution","radius","rectW","rectH","emissionAngleMode","direction","spread","coneDirection","coneAngle"],attr:["lifeMin","lifeMax","lifeMode","lifeCurve","speedMin","speedMax","speedMode","speedCurve","scaleMin","scaleMax","scaleMode","scaleAxisMode","scaleYMin","scaleYMax","scaleCurve","scaleYCurve","scaleEndRatio","initialRotationMode","initialRotationMin","initialRotationMax","initialRotationCurve","rotationSpeedMin","rotationSpeedMax","speedOverLifeEnabled","speedOverLifeMode","speedOverLifeMin","speedOverLifeMax","speedOverLifeCurve","scaleOverLifeEnabled","scaleOverLifeMode","scaleOverLifeAxisMode","scaleOverLifeMin","scaleOverLifeMax","scaleYOverLifeMin","scaleYOverLifeMax","scaleOverLifeCurve","scaleYOverLifeCurve","rotationOverLifeEnabled","rotationOverLifeMode","rotationOverLifeCurve"],look:["texture","imageResources","imageWeightVersion","alpha","alphaEnd","colorStart","colorEnd","colorOverLife","blend","alphaMode","curveMode","alphaCurve","textureName","textureFolder","alphaScale","anchorX","anchorY","independentAlpha","renderLayerMode","renderLayerSpineId","renderLayerSlotName","renderLayerSlotPosition","renderLayerFollowAttachment"],mods:["noise","noiseAmt","noiseRange","noiseSpeed","useGravity","gravity","gravityMode","gravityMin","gravityMax","gravityDirection","gravityCurve","wind","windX","windY","windMode","windMin","windMax","windDirection","windCurve","forceField","forceStrength","forceRadius","forceCenterX","forceCenterY","forceFalloff","showForceFieldShape","vortex","vortexStrength","vortexRadius","vortexCenterX","vortexCenterY","vortexFalloff","showVortexShape","attraction","attractionCenterX","attractionCenterY","attractionRadius","attractionDuration","attractionDelay","attractionDelayMode","attractionPath","showAttractionShape","trail","trailConfigVersion","trailResources","trailResourceVersion","trailTexture","trailTextureName","trailPreviewUrl","trailColorMode","trailColor","trailColorGradient","trailAlphaMode","trailAlpha","trailAlphaCurve","trailBoneCount","trailLength","trailWidth","trailWidthMode","trailLifeLengthEnabled","trailLifeLengthCurve","trailShapeEnabled","trailShapeCurve","trailGridRows","trailGridCols","collision","collisionColliderIds","pathFollow","emitterFollow","emitterFollowMode","emitterFollowPathId","emitterFollowSpineId","emitterFollowBoneName","emitterFollowBoneOffsetX","emitterFollowBoneOffsetY","emitterFollowBoneRotation","emitterFollowBoneScaleX","emitterFollowBoneScaleY","emitterAngleMode","emitterFollowCurve","emitterFollowDuration","emitterFollowSpace","emitterFollowDirection","emitterFollowOffset","damping"]};function Dl(Z){var bt;const ae=(bt=B.value)==null?void 0:bt.config;if(Z==="export"){i.settings.exportSettings=wp();return}if(!ae)return;const Se=bl();for(const jt of Ma[Z])ae[jt]=Se[jt]}function wu(){e.value.fps=Math.min(240,Math.max(1,Math.round(Number(e.value.fps)||30)))}function Ta(Z){var ae;i.selectSystem(((ae=i.systems[Z])==null?void 0:ae.id)??0)}function zn(){i.addSystem()}function So(){i.addCollider()}function Su(){i.addPath()}function Ul(){i.addSpine()}function VS(){i.duplicateSelectedObject()}function mn(Z,ae,Se=0,bt=0,jt=0,_a=0){return{x:Z,y:ae,inX:Se,inY:bt,outX:jt,outY:_a}}function YS(){const Z=me.value;if(!(!Z||!Z.preset))if(Z.preset==="circle"){const Se=60.751328;Z.points=[mn(110,0,0,-Se,0,Se),mn(0,110,Se,0,-Se,0),mn(-110,0,0,Se,0,-Se),mn(0,-110,-Se,0,Se,0)],Z.closed=!0}else if(Z.preset==="square")Z.points=[mn(-100,-100),mn(100,-100),mn(100,100),mn(-100,100)],Z.closed=!0;else{const ae=Z.preset==="star"?10:6;Z.points=Array.from({length:ae},(Se,bt)=>{const jt=Z.preset==="star"&&bt%2?50:110,_a=-Math.PI*.5+bt/ae*Math.PI*2;return mn(Math.cos(_a)*jt,Math.sin(_a)*jt)}),Z.closed=!0}}function GS(){me.value&&(me.value.points=[])}function jS(){B.value&&(B.value.config.seed=Math.floor(Math.random()*999999)+1)}function HS(Z){var Se;const ae=(Se=B.value)==null?void 0:Se.config;!ae||Z==="direction"||(ae.speedOverLifeMode=Z,Z==="curve"&&ae.speedOverLifeMin===ae.speedOverLifeMax&&(ae.speedOverLifeMin=0,ae.speedOverLifeMax=1))}function $p(){var ae;const Z=(ae=B.value)==null?void 0:ae.config;!Z||Z.scaleOverLifeMode!=="curve"||(Z.scaleOverLifeMin===Z.scaleOverLifeMax&&(Z.scaleOverLifeMin=0,Z.scaleOverLifeMax=1),Z.scaleYOverLifeMin===Z.scaleYOverLifeMax&&(Z.scaleYOverLifeMin=0,Z.scaleYOverLifeMax=1))}function WS(Z){var Se;const ae=(Se=B.value)==null?void 0:Se.config;!ae||Z==="direction"||(ae.scaleOverLifeMode=Z,$p())}const zS={point:{emissionAngleMode:"random",direction:0,spread:360},circle:{innerRadius:0,outerRadius:100,emissionAngleMode:"fixed",direction:-90,spread:0},rect:{innerRectW:0,innerRectH:0,outerRectW:200,outerRectH:100,emissionAngleMode:"fixed",direction:-90,spread:0},cone:{innerRadius:0,outerRadius:100,coneAngle:90,coneDirection:90,emissionAngleMode:"random",direction:90,spread:90},path:{spawnPathId:0,spawnPathDistribution:"fixed",emissionAngleMode:"fixed",direction:0,spread:0}};function qS(){var Se;const Z=(Se=B.value)==null?void 0:Se.config;if(!Z)return;const ae=zS[Z.shape];ae&&Object.assign(Z,ae)}function KS(){var ae;const Z=(ae=B.value)==null?void 0:ae.config;!Z||Z.spawnPathId>0||(Z.emissionAngleMode==="path-normal"||Z.emissionAngleMode==="path-tangent")&&(Z.emissionAngleMode="fixed")}return{store:i,exportSettings:e,exportBusy:t,exportTarget:s,exportMessage:n,exportError:r,connectorPairUrl:o,connectorStatusText:a,connectorStatusClass:l,connectorReady:c,connectorAuthorizationUrl:h,connectorDisabledReason:u,connectorButtonTitle:d,refreshConnectorHealth:f,exportSpineJson:p,exportSpineProject:m,exportSpineImages:g,configFileInput:v,selectedPreset:y,presetOptions:x,presetLoading:M,configMessage:C,configError:w,saveConfig:b,onConfigFileChange:_,refreshPresets:E,loadSelectedPreset:F,resolvedCurveEditorMode:I,sys:B,textureFileInput:D,sequenceFileInput:X,trailTextureFileInput:N,addTrailResource:U,openTrailTexturePicker:A,onTrailRigChange:P,onTrailResourceBoneCountChange:O,onTrailResourceRotationChange:L,onTrailTextureFile:$,resetTrailTexture:V,removeTrailResource:j,setTrailResourceWeight:K,toggleTrailResourceLock:ie,setTrailColor:re,commitTrailColor:pe,addImageResource:ge,openTexturePicker:he,openSequencePicker:fe,onTextureFile:Y,onSequenceFiles:W,resetTexture:H,setResourceFixedColor:G,commitResourceFixedColor:q,removeImageResource:se,setResourceWeight:ue,toggleResourceLock:ne,automaticLoopDuration:de,loopDurationFrames:le,activeObjectType:Re,activeCollider:we,activePath:me,activeSpine:Ue,canCopyObject:Je,selectedSpineBone:qe,boundSpineBone:Ze,renderLayerSlotPickerOpen:Be,renderLayerSlotSearch:Me,renderLayerReadySpines:nt,renderLayerSpineReady:vs,renderLayerSlots:Ct,renderLayerFilteredSlots:xt,renderLayerSlotLabel:lt,renderLayerResolvedLabel:It,renderLayerWarning:Rt,setRenderLayerSlotMode:tt,selectRenderLayerSpine:ni,pickRenderLayerSlot:rs,clearRenderLayerSlot:ss,collisionPickerOpen:Tt,selectedCollisionBodies:vi,availableCollisionBodies:As,addCollisionBody:os,removeCollisionBody:fn,collapsed:ri,toggle:Bi,setEmitMode:Ni,setLoopDurationFrames:Er,setStreamBehavior:xa,setLoopSection:ba,setLoopSectionDuration:Bl,setLoopCustomDuration:Nl,onEmitterFollowModeChange:wa,bindSelectedBone:Sa,resetModule:Dl,normalizeExportFps:wu,select:Ta,addSys:zn,addCollider:So,addPath:Su,addSpine:Ul,copySelectedObject:VS,applyPathPreset:YS,clearPathAnchors:GS,randomizeSeed:jS,setSpeedOverLifeMode:HS,prepareScaleOverLifeCurve:$p,setScaleOverLifeMode:WS,onShapeChange:qS,onSpawnPathChange:KS,LINEAR_CURVE:v3,FLAT_CURVE:Sm,ALPHA_CURVE:y3,RESOURCE_ALPHA_CURVE:Mm,TRAIL_ALPHA_CURVE:Tm,TRAIL_SHAPE_CURVE:_m}}const US=Symbol("particle-panel");function ML(){const i=SL();return rx(US,i),i}function Ar(){const i=Wo(US);if(!i)throw new Error("Particle panel sections require a ParticlePanel parent");return i}const TL={class:"group config-management"},_L={class:"caret"},CL={class:"group-body config-management-body"},AL={class:"config-toolbar"},EL=["disabled"],IL={value:""},RL=["value"],PL=Zt({__name:"ProjectConfigSection",setup(i){const{configFileInput:e,selectedPreset:t,presetOptions:s,presetLoading:n,configMessage:r,configError:o,saveConfig:a,onConfigFileChange:l,refreshPresets:c,loadSelectedPreset:h,collapsed:u,toggle:d,select:f}=Ar();return(p,m)=>(z(),J("div",TL,[T("div",{class:"group-head",onClick:m[0]||(m[0]=g=>R(d)("config"))},[T("span",_L,ye(R(u).config?"▸":"▾"),1),m[8]||(m[8]=T("span",null,"配置管理",-1))]),ce(T("div",CL,[T("div",AL,[T("button",{title:"保存全部编辑器配置 (Ctrl+S)",onClick:m[1]||(m[1]=(...g)=>R(a)&&R(a)(...g))},"保存配置"),T("button",{title:"加载本地编辑器配置",onClick:m[2]||(m[2]=g=>{var v;return(v=R(e))==null?void 0:v.click()})},"加载配置"),ce(T("select",{"onUpdate:modelValue":m[3]||(m[3]=g=>Gt(t)?t.value=g:null),"aria-label":"预设列表",disabled:!R(s).length||R(n),onPointerdown:m[4]||(m[4]=(...g)=>R(c)&&R(c)(...g)),onFocus:m[5]||(m[5]=(...g)=>R(c)&&R(c)(...g)),onChange:m[6]||(m[6]=(...g)=>R(h)&&R(h)(...g))},[T("option",IL,ye(R(s).length?"选择预设":"无预设文件"),1),(z(!0),J(Ce,null,Ft(R(s),g=>(z(),J("option",{key:g.file,value:g.file},ye(g.name),9,RL))),128))],40,EL),[[_t,R(t)]]),T("input",{ref_key:"configFileInput",ref:e,hidden:"",type:"file",accept:".json,application/json",onChange:m[7]||(m[7]=(...g)=>R(l)&&R(l)(...g))},null,544)]),R(r)?(z(),J("div",{key:0,class:Ae(["config-message",{error:R(o)}])},ye(R(r)),3)):xe("",!0)],512),[[Ss,!R(u).config]])]))}}),kL=Jt(PL,[["__scopeId","data-v-cb52d3e0"]]),FL={class:"ns-label"},OL=["min","max","step","value","disabled"],LL=["min","max","step","value","disabled"],BL=Zt({__name:"NumSlider",props:{label:{},modelValue:{},min:{},max:{},step:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(i,{emit:e}){const t=i,s=e,n=Fe(String(t.modelValue));cs(()=>t.modelValue,l=>{n.value=String(l)});function r(l){const c=parseFloat(l.target.value);Number.isNaN(c)||s("update:modelValue",c)}function o(l){n.value=l.target.value;const c=parseFloat(n.value);Number.isNaN(c)||s("update:modelValue",c)}function a(){const l=parseFloat(n.value);Number.isNaN(l)&&(n.value=String(t.modelValue))}return(l,c)=>(z(),J("div",{class:Ae(["ns",{disabled:i.disabled}])},[T("span",FL,ye(i.label),1),T("input",{type:"range",class:"ns-range",min:i.min,max:i.max,step:i.step,value:i.modelValue,disabled:i.disabled,onInput:r},null,40,OL),T("input",{type:"number",class:"ns-num",min:i.min,max:i.max,step:i.step,value:n.value,disabled:i.disabled,onInput:o,onBlur:a},null,40,LL)],2))}}),Oe=Jt(BL,[["__scopeId","data-v-7c2fbed0"]]),NL={class:"ce"},DL={class:"ce-editor"},UL={class:"ce-grid"},$L=["x1","x2","y2"],XL=["y1","x2","y2"],VL=["x","y","width","height"],YL=["d"],GL={key:0,class:"ce-handles"},jL=["x1","y1","x2","y2"],HL=["cx","cy","onPointerdown"],WL=["x1","y1","x2","y2"],zL=["cx","cy","onPointerdown"],qL=["cx","cy"],KL=["cx","cy","onPointerdown","onDblclick"],ZL={class:"ce-nav"},JL={class:"ce-tip"},Zn=8,QL=Zt({__name:"CurveEditor",props:{modelValue:{},defaultValue:{default:()=>[{x:0,y:0},{x:1,y:1}]},mode:{default:"linear"}},emits:["update:modelValue"],setup(i,{emit:e}){const t=i,s=e,n=Fe(null),r=Fe(300),o=Fe(110);let a=null;function l(){if(!n.value)return;const I=n.value.getBoundingClientRect();r.value=I.width,o.value=I.height}function c(I){return Zn+I*(r.value-Zn*2)}function h(I){return Zn+(1-I)*(o.value-Zn*2)}function u(){return[...t.modelValue].sort((I,k)=>I.x-k.x)}function d(I){s("update:modelValue",[...I].sort((k,B)=>k.x-B.x))}function f(){d(t.defaultValue.map(I=>({...I})))}const p=De(()=>u());function m(I){const k=p.value[I],B=p.value[Math.max(0,I-1)];return{x:k.x-(k.x-B.x)/3,y:k.y-(k.y-B.y)/3}}function g(I){const k=p.value[I],B=p.value[Math.min(p.value.length-1,I+1)];return{x:k.x+(B.x-k.x)/3,y:k.y+(B.y-k.y)/3}}function v(I){const k=p.value[I],B=m(I);return{x:k.x+(k.inX??B.x-k.x),y:k.y+(k.inY??B.y-k.y)}}function y(I){const k=p.value[I],B=g(I);return{x:k.x+(k.outX??B.x-k.x),y:k.y+(k.outY??B.y-k.y)}}const x=De(()=>{if(!p.value.length)return"";let I=`M ${c(p.value[0].x)} ${h(p.value[0].y)}`;for(let k=1;kMath.abs(X.x-k)>.02);D.push({x:k,y:B}),d(D)}let b={t:0,i:-1,x:0,y:0};function _(I,k){I.stopPropagation();const B=u().findIndex(U=>Math.abs(U.x-p.value[k].x)<1e-6&&Math.abs(U.y-p.value[k].y)<1e-6);if(B<0)return;const D=Date.now();if(D-b.t<300&&b.i===k&&Math.abs(I.clientX-b.x)<8&&Math.abs(I.clientY-b.y)<8){b={t:0,i:-1,x:0,y:0},F(k);return}b={t:D,i:k,x:I.clientX,y:I.clientY};const X=U=>{(Math.abs(U.clientX-I.clientX)>8||Math.abs(U.clientY-I.clientY)>8)&&(b={t:0,i:-1,x:0,y:0});const{x:A,y:P}=M(U.clientX,U.clientY),O=u();O[B]={x:A,y:P},d(O)},N=()=>{window.removeEventListener("pointermove",X),window.removeEventListener("pointerup",N)};window.addEventListener("pointermove",X),window.addEventListener("pointerup",N)}function E(I,k,B){I.stopPropagation();const D=N=>{const U=M(N.clientX,N.clientY),A=u(),P=A[k],O=B==="in"?A[Math.max(0,k-1)].x:P.x,L=B==="in"?P.x:A[Math.min(A.length-1,k+1)].x,$=Math.min(L,Math.max(O,U.x)),V=Math.round(($-P.x)*100)/100,j=Math.round((U.y-P.y)*100)/100;A[k]=B==="in"?{...P,inX:V,inY:j}:{...P,outX:V,outY:j},d(A)},X=()=>{window.removeEventListener("pointermove",D),window.removeEventListener("pointerup",X)};window.addEventListener("pointermove",D),window.addEventListener("pointerup",X)}function F(I,k){k==null||k.stopPropagation();const B=u();B.length<=2||(C=Date.now(),d(B.filter((D,X)=>X!==I)))}return Oi(()=>{l(),a=new ResizeObserver(l),n.value&&a.observe(n.value)}),Cl(()=>{a==null||a.disconnect()}),(I,k)=>(z(),J("div",NL,[T("div",DL,[(z(),J("svg",{ref_key:"svg",ref:n,class:"ce-svg",onDblclick:w},[T("g",UL,[(z(),J(Ce,null,Ft([.25,.5,.75],B=>T("line",{key:"v"+B,x1:c(B),y1:"0",x2:c(B),y2:h(0)},null,8,$L)),64)),(z(),J(Ce,null,Ft([.25,.5,.75],B=>T("line",{key:"h"+B,x1:"0",y1:h(B),x2:c(1),y2:h(B)},null,8,XL)),64))]),T("rect",{x:c(0),y:h(1),width:c(1)-c(0),height:h(0)-h(1),class:"ce-frame",fill:"none"},null,8,VL),T("path",{d:x.value,class:"ce-line",fill:"none"},null,8,YL),i.mode==="bezier"?(z(),J("g",GL,[(z(!0),J(Ce,null,Ft(p.value,(B,D)=>(z(),J(Ce,{key:"handles-"+D},[D>0?(z(),J("line",{key:0,x1:c(B.x),y1:h(B.y),x2:c(v(D).x),y2:h(v(D).y)},null,8,jL)):xe("",!0),D>0?(z(),J("circle",{key:1,cx:c(v(D).x),cy:h(v(D).y),r:"4",onPointerdown:X=>E(X,D,"in")},null,40,HL)):xe("",!0),DE(X,D,"out")},null,40,zL)):xe("",!0)],64))),128))])):xe("",!0),(z(!0),J(Ce,null,Ft(p.value,(B,D)=>(z(),J("g",{key:D},[T("circle",{cx:c(B.x),cy:h(B.y),r:"5",class:"ce-node"},null,8,qL),T("circle",{cx:c(B.x),cy:h(B.y),r:"9",class:"ce-hit",onPointerdown:X=>_(X,D),onDblclick:X=>F(D,X)},null,40,KL)]))),128))],544)),T("div",ZL,[T("span",JL,ye(i.mode==="bezier"?"拖动方形手柄调整弧度·双击空白新建·双击节点删除":"双击空白新建·双击节点删除·拖动节点调整"),1)])]),T("button",{class:"ce-reset",type:"button",title:"恢复默认曲线",onClick:f},"重置")]))}}),Ji=Jt(QL,[["__scopeId","data-v-9bfb7b31"]]),eB={class:"spine-editor"},tB={class:"field wide"},sB={class:"grid three"},iB={class:"field"},nB={class:"field"},rB={class:"field"},oB={class:"grid three"},aB={class:"field"},lB={class:"field"},cB={class:"field"},hB=["disabled"],uB={class:"asset-row"},dB=["title"],fB={class:"asset-row"},mB=["title"],pB={class:"asset-row"},gB=["title"],vB={class:"asset-actions"},yB=["disabled"],xB={class:"runtime-note"},bB={key:0},wB={key:0,class:"error"},SB={class:"section-box"},MB={key:0,class:"empty"},TB={key:1,class:"field wide"},_B=["value"],CB={class:"section-box"},AB={class:"tree-title-row"},EB=["disabled","title"],IB=["disabled","title"],RB={class:"tree-tabs"},PB={key:0,class:"empty"},kB={key:1,class:"bone-search"},FB={key:2,class:"empty"},OB={key:3,class:"bone-tree"},LB=["onClick","onKeydown"],BB=["title","onClick"],NB={key:1,class:"bone-leaf"},DB={class:"bone-name"},UB={key:0,class:"empty"},$B={key:1,class:"bone-search"},XB={key:2,class:"empty"},VB={key:3,class:"bone-tree slot-tree"},YB=["title","onClick","onKeydown"],GB={class:"slot-order"},jB={class:"bone-name"},HB={class:"slot-attachment"},WB=Zt({__name:"SpineObjectPanel",props:{spineObject:{}},setup(i){const e=i,t=yo(),s=Fe(null),n=Fe(null),r=Fe(null),o=Fe(null),a=Fe(new Set),l=Fe(""),c=Fe("bone"),h=Fe(""),u=Fe(null),d=Fe(null),f=Fe([]);e.spineObject.selectedBone==null&&(e.spineObject.selectedBone=""),e.spineObject.selectedSlot==null&&(e.spineObject.selectedSlot=""),Array.isArray(e.spineObject.slots)||(e.spineObject.slots=[]),e.spineObject.sourceBundle==null&&(e.spineObject.sourceBundle=null),e.spineObject.dataVersion==null&&(e.spineObject.dataVersion="");const p=De(()=>{var L;return((L=u.value)==null?void 0:L.name)||e.spineObject.skeletonFileName}),m=De(()=>{var L;return((L=d.value)==null?void 0:L.name)||e.spineObject.atlasFileName}),g=De(()=>f.value.length?f.value.map(L=>L.name):e.spineObject.textureFileNames),v=De(()=>g.value.length?`${g.value.length} 张:${g.value.join(", ")}`:"PNG / JPEG / WebP..."),y=De(()=>new Set(e.spineObject.bones.map(L=>L.parent).filter(L=>!!L))),x=De(()=>new Map(e.spineObject.bones.map(L=>[L.name,L]))),M=De(()=>e.spineObject.bones.filter(L=>{var j;const $=l.value.trim().toLocaleLowerCase();if($)return L.name.toLocaleLowerCase().includes($);let V=L.parent;for(;V;){if(a.value.has(V))return!1;V=((j=x.value.get(V))==null?void 0:j.parent)||null}return!0})),C=De(()=>y.value.size>0&&[...y.value].every(L=>a.value.has(L))),w=De(()=>{const L=h.value.trim().toLocaleLowerCase(),$=[...e.spineObject.slots].sort((V,j)=>V.order-j.order);return L?$.filter(V=>V.name.toLocaleLowerCase().includes(L)||V.attachment.toLocaleLowerCase().includes(L)):$});function b(L){const $=e.spineObject.selectedBone===L;for(const V of t.spines)V.selectedBone="";$||(e.spineObject.selectedBone=L)}function _(L){const $=e.spineObject.selectedSlot===L;for(const V of t.spines)V.selectedSlot="";$||(e.spineObject.selectedSlot=L)}function E(L){a.value.has(L)?a.value.delete(L):a.value.add(L)}function F(){a.value=C.value?new Set:new Set(y.value)}function I(L){var $;return(($=L.target.files)==null?void 0:$[0])||null}function k(L){u.value=I(L)}function B(L){d.value=I(L)}function D(L){f.value=Array.from(L.target.files||[])}function X(L){return L.name.replace(/\.[^.]+$/,"").toLocaleLowerCase()}async function N(L){const $=Array.from(L.target.files||[]);if(!$.length)return;const V=$.filter(ge=>/\.(json|skel)$/i.test(ge.name)),j=$.filter(ge=>/\.atlas$/i.test(ge.name)),K=$.filter(ge=>/\.(png|jpe?g|webp|wepb)$/i.test(ge.name)),ie=j.map(ge=>({atlas:ge,skeleton:V.find(he=>X(he)===X(ge))})).find(ge=>ge.skeleton),re=(ie==null?void 0:ie.skeleton)||V[0]||null,pe=(ie==null?void 0:ie.atlas)||j[0]||null;if(u.value=re,d.value=pe,f.value=K,!re||!pe||!K.length){const ge=[!re&&"JSON / SKEL",!pe&&"Atlas",!K.length&&"纹理图片"].filter(Boolean).join("、");e.spineObject.status="error",e.spineObject.error=`所选文件夹缺少:${ge}`;return}await P()}function U(){t.recalcTotalFrames()}function A(){U(),t.timeline.frame=0}async function P(){var V;const L=u.value,$=d.value;if(!L||!$||!f.value.length){e.spineObject.status="error",e.spineObject.error="请依次选择 Spine 数据、Atlas 和全部纹理图片";return}e.spineObject.status="loading",e.spineObject.error="";try{const j=await Iw(L,$,f.value);fu(e.spineObject.id,j),e.spineObject.skeletonFileName=L.name,e.spineObject.atlasFileName=$.name,e.spineObject.textureFileNames=f.value.map(K=>K.name),e.spineObject.dataVersion=j.dataVersion,e.spineObject.animations=j.animations,e.spineObject.bones=j.bones,e.spineObject.slots=j.slots,e.spineObject.selectedBone="",e.spineObject.selectedSlot="",l.value="",h.value="",a.value=new Set,e.spineObject.selectedAnimation=((V=j.animations[0])==null?void 0:V.name)||"",e.spineObject.assetVersion++,e.spineObject.status="ready",U(),t.timeline.frame=0;try{e.spineObject.sourceBundle=await _k(L,$,f.value)}catch(K){e.spineObject.sourceBundle=null,console.warn("Spine 配置资源嵌入失败",K)}}catch(j){e.spineObject.status="error",e.spineObject.error=j instanceof Error?j.message:String(j)}}function O(){Pl(e.spineObject.id),u.value=null,d.value=null,f.value=[],s.value&&(s.value.value=""),n.value&&(n.value.value=""),r.value&&(r.value.value=""),o.value&&(o.value.value=""),e.spineObject.skeletonFileName="",e.spineObject.atlasFileName="",e.spineObject.textureFileNames=[],e.spineObject.dataVersion="",e.spineObject.sourceBundle=null,e.spineObject.animations=[],e.spineObject.bones=[],e.spineObject.slots=[],e.spineObject.selectedBone="",e.spineObject.selectedSlot="",l.value="",h.value="",a.value=new Set,e.spineObject.selectedAnimation="",e.spineObject.assetVersion++,e.spineObject.status="empty",e.spineObject.error="",U()}return(L,$)=>(z(),J("div",eB,[$[38]||($[38]=T("div",{class:"editor-title"},"Spine 属性",-1)),T("label",tB,[$[20]||($[20]=T("span",null,"Spine 名称",-1)),ce(T("input",{"onUpdate:modelValue":$[0]||($[0]=V=>i.spineObject.name=V)},null,512),[[je,i.spineObject.name]])]),T("div",sB,[T("label",iB,[$[21]||($[21]=T("span",null,"X 位置",-1)),ce(T("input",{"onUpdate:modelValue":$[1]||($[1]=V=>i.spineObject.x=V),type:"number"},null,512),[[je,i.spineObject.x,void 0,{number:!0}]])]),T("label",nB,[$[22]||($[22]=T("span",null,"Y 位置",-1)),ce(T("input",{"onUpdate:modelValue":$[2]||($[2]=V=>i.spineObject.y=V),type:"number"},null,512),[[je,i.spineObject.y,void 0,{number:!0}]])]),T("label",rB,[$[23]||($[23]=T("span",null,"旋转",-1)),ce(T("input",{"onUpdate:modelValue":$[3]||($[3]=V=>i.spineObject.rotation=V),type:"number"},null,512),[[je,i.spineObject.rotation,void 0,{number:!0}]])])]),T("div",oB,[T("label",aB,[$[24]||($[24]=T("span",null,"Scale X",-1)),ce(T("input",{"onUpdate:modelValue":$[4]||($[4]=V=>i.spineObject.scaleX=V),type:"number",step:"0.05"},null,512),[[je,i.spineObject.scaleX,void 0,{number:!0}]])]),T("label",lB,[$[25]||($[25]=T("span",null,"Scale Y",-1)),ce(T("input",{"onUpdate:modelValue":$[5]||($[5]=V=>i.spineObject.scaleY=V),type:"number",step:"0.05"},null,512),[[je,i.spineObject.scaleY,void 0,{number:!0}]])]),T("label",cB,[$[26]||($[26]=T("span",null,"开始时间",-1)),ce(T("input",{"onUpdate:modelValue":$[6]||($[6]=V=>i.spineObject.timeOffset=V),type:"number",min:"0",step:"0.033333",onChange:U},null,544),[[je,i.spineObject.timeOffset,void 0,{number:!0}]])])]),$[39]||($[39]=T("div",{class:"divider"},null,-1)),$[40]||($[40]=T("div",{class:"section-title"},"Spine 资源",-1)),T("input",{ref_key:"skeletonInput",ref:s,hidden:"",type:"file",accept:".json,.skel,application/json,application/octet-stream",onChange:k},null,544),T("input",{ref_key:"atlasInput",ref:n,hidden:"",type:"file",accept:".atlas,text/plain",onChange:B},null,544),T("input",{ref_key:"textureInput",ref:r,hidden:"",type:"file",multiple:"",accept:".png,.jpg,.jpeg,.webp,.wepb,image/png,image/jpeg,image/webp",onChange:D},null,544),T("input",{ref_key:"folderInput",ref:o,hidden:"",type:"file",multiple:"",webkitdirectory:"",directory:"",onChange:N},null,544),T("button",{class:"folder-select",disabled:i.spineObject.status==="loading",onClick:$[7]||($[7]=V=>{var j;return(j=o.value)==null?void 0:j.click()})},"选择文件夹并加载",8,hB),$[41]||($[41]=T("div",{class:"folder-hint"},"一次读取文件夹中的 JSON / SKEL、Atlas 和全部纹理;仍可在下方单独替换资源。",-1)),T("div",uB,[T("div",{class:"asset-name",title:p.value},ye(p.value||"JSON / SKEL..."),9,dB),T("button",{onClick:$[8]||($[8]=V=>{var j;return(j=s.value)==null?void 0:j.click()})},"选择")]),T("div",fB,[T("div",{class:"asset-name",title:m.value},ye(m.value||"Atlas..."),9,mB),T("button",{onClick:$[9]||($[9]=V=>{var j;return(j=n.value)==null?void 0:j.click()})},"选择")]),T("div",pB,[T("div",{class:"asset-name",title:g.value.join(", ")},ye(v.value),9,gB),T("button",{onClick:$[10]||($[10]=V=>{var j;return(j=r.value)==null?void 0:j.click()})},"选择(多选)")]),T("div",vB,[T("button",{class:"load",disabled:i.spineObject.status==="loading",onClick:P},ye(i.spineObject.status==="loading"?"加载中…":"↧ 加载"),9,yB),T("button",{class:"clear",onClick:O},"清除")]),T("div",xB,[$[27]||($[27]=gt(" 支持 Spine 3.8 / 4.0 / 4.1 / 4.2 / 4.3 JSON · 对应版本运行时按需加载 · 本地离线 ",-1)),i.spineObject.dataVersion?(z(),J("span",bB," · 当前资源 "+ye(i.spineObject.dataVersion),1)):xe("",!0)]),i.spineObject.error?(z(),J("div",wB,ye(i.spineObject.error),1)):xe("",!0),T("div",SB,[$[30]||($[30]=T("div",{class:"section-title"},"Spine 动画",-1)),i.spineObject.animations.length?(z(),J("label",TB,[$[29]||($[29]=T("span",null,"时间轴播放动画",-1)),ce(T("select",{"onUpdate:modelValue":$[11]||($[11]=V=>i.spineObject.selectedAnimation=V),onChange:A},[$[28]||($[28]=T("option",{value:""},"无",-1)),(z(!0),J(Ce,null,Ft(i.spineObject.animations,V=>(z(),J("option",{key:V.name,value:V.name},ye(V.name)+"("+ye(V.duration.toFixed(2))+"s) ",9,_B))),128))],544),[[_t,i.spineObject.selectedAnimation]])])):(z(),J("div",MB,"无可用动画"))]),T("div",CB,[T("div",AB,[$[37]||($[37]=T("div",{class:"section-title"},"层级树",-1)),c.value==="bone"?(z(),J("button",{key:0,class:Ae(["selected-bone",{active:i.spineObject.selectedBone}]),disabled:!i.spineObject.selectedBone,title:i.spineObject.selectedBone?"点击清除骨骼选择":"当前未选择骨骼",onClick:$[12]||($[12]=V=>i.spineObject.selectedBone="")},[i.spineObject.selectedBone?(z(),J(Ce,{key:0},[$[31]||($[31]=gt("清除选中骨骼:",-1)),T("strong",null,ye(i.spineObject.selectedBone),1)],64)):(z(),J(Ce,{key:1},[$[32]||($[32]=gt("当前骨骼:",-1)),$[33]||($[33]=T("strong",null,"未选择",-1))],64))],10,EB)):(z(),J("button",{key:1,class:Ae(["selected-bone",{active:i.spineObject.selectedSlot}]),disabled:!i.spineObject.selectedSlot,title:i.spineObject.selectedSlot?"点击清除插槽选择":"当前未选择插槽",onClick:$[13]||($[13]=V=>i.spineObject.selectedSlot="")},[i.spineObject.selectedSlot?(z(),J(Ce,{key:0},[$[34]||($[34]=gt("清除选中插槽:",-1)),T("strong",null,ye(i.spineObject.selectedSlot),1)],64)):(z(),J(Ce,{key:1},[$[35]||($[35]=gt("当前插槽:",-1)),$[36]||($[36]=T("strong",null,"未选择",-1))],64))],10,IB)),c.value==="bone"&&i.spineObject.bones.length?(z(),J("button",{key:2,class:"tree-action",onClick:F},ye(C.value?"全部展开":"全部折叠"),1)):xe("",!0)]),T("div",RB,[T("button",{class:Ae({on:c.value==="bone"}),onClick:$[14]||($[14]=V=>c.value="bone")},"骨骼",2),T("button",{class:Ae({on:c.value==="slot"}),onClick:$[15]||($[15]=V=>c.value="slot")},"插槽",2)]),c.value==="bone"?(z(),J(Ce,{key:0},[i.spineObject.bones.length?(z(),J("div",kB,[ce(T("input",{"onUpdate:modelValue":$[16]||($[16]=V=>l.value=V),type:"search","aria-label":"搜索骨骼",placeholder:"搜索骨骼名称…"},null,512),[[je,l.value,void 0,{trim:!0}]]),l.value?(z(),J("button",{key:0,title:"清空搜索","aria-label":"清空骨骼搜索",onClick:$[17]||($[17]=V=>l.value="")},"✕")):xe("",!0)])):(z(),J("div",PB,"未加载 Spine")),i.spineObject.bones.length&&!M.value.length?(z(),J("div",FB,"未找到匹配的骨骼")):i.spineObject.bones.length?(z(),J("div",OB,[(z(!0),J(Ce,null,Ft(M.value,V=>(z(),J("div",{key:V.name,class:Ae(["bone",{selected:i.spineObject.selectedBone===V.name}]),style:Vt({paddingLeft:`${6+V.depth*16}px`}),role:"button",tabindex:"0",onClick:j=>b(V.name),onKeydown:yr(Ke(j=>b(V.name),["prevent"]),["enter"])},[y.value.has(V.name)?(z(),J("button",{key:0,class:"bone-toggle",title:a.value.has(V.name)?"展开子骨骼":"折叠子骨骼",onClick:Ke(j=>E(V.name),["stop"])},ye(a.value.has(V.name)?"▸":"▾"),9,BB)):(z(),J("span",NB,"•")),T("span",DB,ye(V.name),1)],46,LB))),128))])):xe("",!0)],64)):(z(),J(Ce,{key:1},[i.spineObject.slots.length?(z(),J("div",$B,[ce(T("input",{"onUpdate:modelValue":$[18]||($[18]=V=>h.value=V),type:"search","aria-label":"搜索插槽",placeholder:"搜索插槽或附件名称…"},null,512),[[je,h.value,void 0,{trim:!0}]]),h.value?(z(),J("button",{key:0,title:"清空搜索","aria-label":"清空插槽搜索",onClick:$[19]||($[19]=V=>h.value="")},"✕")):xe("",!0)])):(z(),J("div",UB,"未加载 Spine 插槽")),i.spineObject.slots.length&&!w.value.length?(z(),J("div",XB,"未找到匹配的插槽")):i.spineObject.slots.length?(z(),J("div",VB,[(z(!0),J(Ce,null,Ft(w.value,V=>(z(),J("div",{key:V.name,class:Ae(["bone slot-row",{selected:i.spineObject.selectedSlot===V.name}]),role:"button",tabindex:"0",title:`${V.name}(骨骼:${V.bone||"-"},附件:${V.attachment||"空"})`,onClick:j=>_(V.name),onKeydown:yr(Ke(j=>_(V.name),["prevent"]),["enter"])},[T("span",GB,ye(V.order+1),1),T("span",jB,ye(V.name),1),T("span",HB,ye(V.attachment||"空"),1)],42,YB))),128))])):xe("",!0)],64))])]))}}),zB=Jt(WB,[["__scopeId","data-v-3545b078"]]),qB={class:"group"},KB={class:"caret"},ZB={class:"scene-actions"},JB=["disabled"],QB={class:"group-body"},eN={class:"tree scene-tree"},tN=["onClick"],sN={class:"tlabel"},iN=["title","aria-label","onClick"],nN={viewBox:"0 0 24 24","aria-hidden":"true"},rN={key:0,class:"eye-slash",d:"M4 4l16 16"},oN=["onClick"],aN=["onClick"],lN={class:"tlabel"},cN=["title","aria-label","onClick"],hN={viewBox:"0 0 24 24","aria-hidden":"true"},uN={key:0,class:"eye-slash",d:"M4 4l16 16"},dN=["onClick"],fN=["onClick"],mN={class:"tlabel"},pN=["title","aria-label","onClick"],gN={viewBox:"0 0 24 24","aria-hidden":"true"},vN={key:0,class:"eye-slash",d:"M4 4l16 16"},yN=["onClick"],xN=["onClick"],bN={class:"tlabel"},wN=["title","aria-label","onClick"],SN={viewBox:"0 0 24 24","aria-hidden":"true"},MN={key:0,class:"eye-slash",d:"M4 4l16 16"},TN=["onClick"],_N={key:0,class:"empty"},CN={class:"row"},AN={class:"seed-row scene-seed"},EN={class:"field-block"},IN={class:"field-grid"},RN={class:"field-block"},PN={class:"field-block check-field"},kN={class:"field-grid"},FN={class:"compact-field"},ON={class:"compact-field"},LN={class:"field-grid"},BN={class:"compact-field"},NN={class:"compact-field"},DN={key:1,class:"field-grid"},UN={class:"compact-field"},$N={class:"compact-field"},XN={key:2,class:"field-grid"},VN={class:"compact-field"},YN={class:"compact-field"},GN={class:"field-block"},jN={key:4,class:"field-grid"},HN={class:"compact-field"},WN={class:"compact-field"},zN={class:"collider-follow-section"},qN={class:"follow-path"},KN={class:"field-block"},ZN=["value"],JN={class:"field-grid"},QN={class:"compact-field"},eD={class:"compact-field"},tD={class:"follow-path"},sD={class:"field-block"},iD={class:"field-grid"},nD={class:"compact-field"},rD={class:"compact-field"},oD={class:"field-grid"},aD={class:"compact-field"},lD={class:"compact-field"},cD={class:"setting-line"},hD={class:"setting-line"},uD={class:"field-block"},dD={key:4,class:"panel-hint"},fD=Zt({__name:"SceneObjectsSection",setup(i){const{store:e,resolvedCurveEditorMode:t,sys:s,activeObjectType:n,activeCollider:r,activePath:o,activeSpine:a,canCopyObject:l,collapsed:c,toggle:h,select:u,addSys:d,addCollider:f,addPath:p,addSpine:m,copySelectedObject:g,applyPathPreset:v,clearPathAnchors:y,randomizeSeed:x,LINEAR_CURVE:M}=Ar();return(C,w)=>(z(),J("div",qB,[T("div",{class:"group-head scene-head",onClick:w[5]||(w[5]=b=>R(h)("scene"))},[T("span",KB,ye(R(c).scene?"▸":"▾"),1),w[50]||(w[50]=T("span",null,"场景对象",-1)),T("div",ZB,[T("button",{class:"scene-add",title:"添加粒子系统",onClick:w[0]||(w[0]=Ke((...b)=>R(d)&&R(d)(...b),["stop"]))},"+粒子"),T("button",{class:"scene-add",title:"添加碰撞体",onClick:w[1]||(w[1]=Ke((...b)=>R(f)&&R(f)(...b),["stop"]))},"+碰撞"),T("button",{class:"scene-add",title:"添加路径",onClick:w[2]||(w[2]=Ke((...b)=>R(p)&&R(p)(...b),["stop"]))},"+路径"),T("button",{class:"scene-add",title:"添加 Spine",onClick:w[3]||(w[3]=Ke((...b)=>R(m)&&R(m)(...b),["stop"]))},"+Spine"),T("button",{class:"scene-add",disabled:!R(l),title:"复制当前选中的场景对象",onClick:w[4]||(w[4]=Ke((...b)=>R(g)&&R(g)(...b),["stop"]))},"+Copy",8,JB)])]),ce(T("div",QB,[T("div",eN,[(z(!0),J(Ce,null,Ft(R(e).systems,(b,_)=>(z(),J("div",{key:`particle-${b.id}`,class:Ae(["tree-item scene-object-item",{on:R(n)==="particle"&&b.id===R(e).activeObjectId}]),onClick:E=>R(u)(_)},[w[53]||(w[53]=T("span",{class:"tdot"},"●",-1)),T("span",sN,ye(b.config.name||"ParticleSystem"+(_+1)),1),T("button",{class:Ae(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示粒子系统":"隐藏粒子系统","aria-label":b.visible===!1?"显示粒子系统":"隐藏粒子系统",onClick:Ke(E=>b.visible=b.visible===!1,["stop"])},[(z(),J("svg",nN,[w[51]||(w[51]=T("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),w[52]||(w[52]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(z(),J("path",rN)):xe("",!0)]))],10,iN),w[54]||(w[54]=T("span",{class:"scene-object-kind"},"粒子",-1)),T("button",{class:"scene-object-delete",title:"删除粒子系统",onClick:Ke(E=>R(e).removeSystem(b.id),["stop"])},"✕",8,oN)],10,tN))),128)),(z(!0),J(Ce,null,Ft(R(e).colliders,b=>(z(),J("div",{key:`collision-${b.id}`,class:Ae(["tree-item scene-object-item",{on:R(n)==="collision"&&b.id===R(e).activeObjectId}]),onClick:_=>R(e).selectSceneObject("collision",b.id)},[w[57]||(w[57]=T("span",{class:"tdot collision-dot"},"■",-1)),T("span",lN,ye(b.name),1),T("button",{class:Ae(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示碰撞体":"隐藏碰撞体","aria-label":b.visible===!1?"显示碰撞体":"隐藏碰撞体",onClick:Ke(_=>b.visible=b.visible===!1,["stop"])},[(z(),J("svg",hN,[w[55]||(w[55]=T("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),w[56]||(w[56]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(z(),J("path",uN)):xe("",!0)]))],10,cN),w[58]||(w[58]=T("span",{class:"scene-object-kind"},"碰撞",-1)),T("button",{class:"scene-object-delete",title:"删除碰撞体",onClick:Ke(_=>R(e).removeCollider(b.id),["stop"])},"✕",8,dN)],10,aN))),128)),(z(!0),J(Ce,null,Ft(R(e).paths,b=>(z(),J("div",{key:`path-${b.id}`,class:Ae(["tree-item scene-object-item",{on:R(n)==="path"&&b.id===R(e).activeObjectId}]),onClick:_=>R(e).selectSceneObject("path",b.id)},[w[61]||(w[61]=T("span",{class:"tdot path-dot"},"◇",-1)),T("span",mN,ye(b.name),1),T("button",{class:Ae(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示路径":"隐藏路径","aria-label":b.visible===!1?"显示路径":"隐藏路径",onClick:Ke(_=>b.visible=b.visible===!1,["stop"])},[(z(),J("svg",gN,[w[59]||(w[59]=T("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),w[60]||(w[60]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(z(),J("path",vN)):xe("",!0)]))],10,pN),w[62]||(w[62]=T("span",{class:"scene-object-kind"},"路径",-1)),T("button",{class:"scene-object-delete",title:"删除路径",onClick:Ke(_=>R(e).removePath(b.id),["stop"])},"✕",8,yN)],10,fN))),128)),(z(!0),J(Ce,null,Ft(R(e).spines,b=>(z(),J("div",{key:`spine-${b.id}`,class:Ae(["tree-item scene-object-item",{on:R(n)==="spine"&&b.id===R(e).activeObjectId}]),onClick:_=>R(e).selectSceneObject("spine",b.id)},[w[65]||(w[65]=T("span",{class:"tdot spine-dot"},"◆",-1)),T("span",bN,ye(b.name),1),T("button",{class:Ae(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示 Spine":"隐藏 Spine","aria-label":b.visible===!1?"显示 Spine":"隐藏 Spine",onClick:Ke(_=>b.visible=b.visible===!1,["stop"])},[(z(),J("svg",SN,[w[63]||(w[63]=T("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),w[64]||(w[64]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(z(),J("path",MN)):xe("",!0)]))],10,wN),w[66]||(w[66]=T("span",{class:"scene-object-kind"},"Spine",-1)),T("button",{class:"scene-object-delete",title:"删除 Spine",onClick:Ke(_=>R(e).removeSpine(b.id),["stop"])},"✕",8,TN)],10,xN))),128)),!R(e).systems.length&&!R(e).colliders.length&&!R(e).paths.length&&!R(e).spines.length?(z(),J("div",_N,"场景中暂无对象")):xe("",!0)]),R(n)==="particle"&&R(s)?(z(),J(Ce,{key:0},[T("label",CN,[w[67]||(w[67]=T("span",null,"名称",-1)),ce(T("input",{"onUpdate:modelValue":w[6]||(w[6]=b=>R(s).config.name=b),class:"inp"},null,512),[[je,R(s).config.name]])]),be(Oe,{label:"位置X",min:-2e3,max:2e3,step:1,modelValue:R(s).config.centerX,"onUpdate:modelValue":w[7]||(w[7]=b=>R(s).config.centerX=b)},null,8,["modelValue"]),be(Oe,{label:"位置Y",min:-2e3,max:2e3,step:1,modelValue:R(s).config.centerY,"onUpdate:modelValue":w[8]||(w[8]=b=>R(s).config.centerY=b)},null,8,["modelValue"]),be(Oe,{label:"偏移X",min:-2e3,max:2e3,step:1,modelValue:R(s).config.offsetX,"onUpdate:modelValue":w[9]||(w[9]=b=>R(s).config.offsetX=b)},null,8,["modelValue"]),be(Oe,{label:"偏移Y",min:-2e3,max:2e3,step:1,modelValue:R(s).config.offsetY,"onUpdate:modelValue":w[10]||(w[10]=b=>R(s).config.offsetY=b)},null,8,["modelValue"]),be(Oe,{label:"旋转",min:-360,max:360,step:1,modelValue:R(s).config.rootRotation,"onUpdate:modelValue":w[11]||(w[11]=b=>R(s).config.rootRotation=b)},null,8,["modelValue"]),be(Oe,{label:"缩放X",min:.05,max:10,step:.05,modelValue:R(s).config.rootScaleX,"onUpdate:modelValue":w[12]||(w[12]=b=>R(s).config.rootScaleX=b)},null,8,["modelValue"]),be(Oe,{label:"缩放Y",min:.05,max:10,step:.05,modelValue:R(s).config.rootScaleY,"onUpdate:modelValue":w[13]||(w[13]=b=>R(s).config.rootScaleY=b)},null,8,["modelValue"]),T("div",AN,[w[68]||(w[68]=T("label",{for:"system-seed"},"随机种子",-1)),ce(T("input",{id:"system-seed",class:"seed-input",type:"number",min:"0",step:"1","onUpdate:modelValue":w[14]||(w[14]=b=>R(s).config.seed=b),title:"控制粒子系统内全部随机属性、资源选择与修改器随机采样"},null,512),[[je,R(s).config.seed,void 0,{number:!0}]]),T("button",{class:"seed-random",title:"生成新的全局随机种子",onClick:w[15]||(w[15]=(...b)=>R(x)&&R(x)(...b))},"⚄")]),w[69]||(w[69]=T("div",{class:"seed-hint"},"控制初始随机参数、资源选择和修改器随机采样;相同种子可复现相同效果",-1))],64)):R(r)?(z(),J(Ce,{key:1},[w[94]||(w[94]=T("div",{class:"object-editor-title"},"碰撞体属性",-1)),T("label",EN,[w[70]||(w[70]=T("span",null,"碰撞体名称",-1)),ce(T("input",{"onUpdate:modelValue":w[16]||(w[16]=b=>R(r).name=b),class:"inp"},null,512),[[je,R(r).name]])]),T("div",IN,[T("label",RN,[w[72]||(w[72]=T("span",null,"类型",-1)),ce(T("select",{"onUpdate:modelValue":w[17]||(w[17]=b=>R(r).shape=b),class:"inp"},[...w[71]||(w[71]=[Qs('',5)])],512),[[_t,R(r).shape]])]),T("label",PN,[w[73]||(w[73]=T("span",null,"启用",-1)),ce(T("input",{"onUpdate:modelValue":w[18]||(w[18]=b=>R(r).enabled=b),type:"checkbox"},null,512),[[yt,R(r).enabled]])])]),T("div",kN,[T("label",FN,[w[74]||(w[74]=T("span",null,"X 位置",-1)),ce(T("input",{"onUpdate:modelValue":w[19]||(w[19]=b=>R(r).x=b),type:"number",class:"inp"},null,512),[[je,R(r).x,void 0,{number:!0}]])]),T("label",ON,[w[75]||(w[75]=T("span",null,"Y 位置",-1)),ce(T("input",{"onUpdate:modelValue":w[20]||(w[20]=b=>R(r).y=b),type:"number",class:"inp"},null,512),[[je,R(r).y,void 0,{number:!0}]])])]),be(Oe,{label:"旋转",min:-360,max:360,step:1,modelValue:R(r).rotation,"onUpdate:modelValue":w[21]||(w[21]=b=>R(r).rotation=b)},null,8,["modelValue"]),T("div",LN,[T("label",BN,[w[76]||(w[76]=T("span",null,"缩放 X",-1)),ce(T("input",{"onUpdate:modelValue":w[22]||(w[22]=b=>R(r).scaleX=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[je,R(r).scaleX,void 0,{number:!0}]])]),T("label",NN,[w[77]||(w[77]=T("span",null,"缩放 Y",-1)),ce(T("input",{"onUpdate:modelValue":w[23]||(w[23]=b=>R(r).scaleY=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[je,R(r).scaleY,void 0,{number:!0}]])])]),R(r).shape==="circle"?(z(),At(Oe,{key:0,label:"半径",min:1,max:1e3,step:1,modelValue:R(r).radius,"onUpdate:modelValue":w[24]||(w[24]=b=>R(r).radius=b)},null,8,["modelValue"])):R(r).shape==="ellipse"?(z(),J("div",DN,[T("label",UN,[w[78]||(w[78]=T("span",null,"X 半径",-1)),ce(T("input",{"onUpdate:modelValue":w[25]||(w[25]=b=>R(r).radiusX=b),type:"number",min:"1",class:"inp"},null,512),[[je,R(r).radiusX,void 0,{number:!0}]])]),T("label",$N,[w[79]||(w[79]=T("span",null,"Y 半径",-1)),ce(T("input",{"onUpdate:modelValue":w[26]||(w[26]=b=>R(r).radiusY=b),type:"number",min:"1",class:"inp"},null,512),[[je,R(r).radiusY,void 0,{number:!0}]])])])):(z(),J("div",XN,[T("label",VN,[w[80]||(w[80]=T("span",null,"宽度",-1)),ce(T("input",{"onUpdate:modelValue":w[27]||(w[27]=b=>R(r).width=b),type:"number",min:"1",class:"inp"},null,512),[[je,R(r).width,void 0,{number:!0}]])]),T("label",YN,[w[81]||(w[81]=T("span",null,"高度",-1)),ce(T("input",{"onUpdate:modelValue":w[28]||(w[28]=b=>R(r).height=b),type:"number",min:"1",class:"inp"},null,512),[[je,R(r).height,void 0,{number:!0}]])])])),R(r).shape==="polygon"||R(r).shape==="custom"?(z(),At(Oe,{key:3,label:"边数",min:3,max:16,step:1,modelValue:R(r).sides,"onUpdate:modelValue":w[29]||(w[29]=b=>R(r).sides=b)},null,8,["modelValue"])):xe("",!0),T("label",GN,[w[83]||(w[83]=T("span",null,"碰撞响应",-1)),ce(T("select",{"onUpdate:modelValue":w[30]||(w[30]=b=>R(r).response=b),class:"inp"},[...w[82]||(w[82]=[T("option",{value:"physics"},"物理(弹跳/摩擦)",-1),T("option",{value:"pause"},"暂停(停止不动)",-1),T("option",{value:"destroy"},"消失(立即销毁)",-1)])],512),[[_t,R(r).response]])]),R(r).response==="physics"?(z(),J("div",jN,[T("label",HN,[w[84]||(w[84]=T("span",null,"弹性 (0-1)",-1)),ce(T("input",{"onUpdate:modelValue":w[31]||(w[31]=b=>R(r).elasticity=b),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[je,R(r).elasticity,void 0,{number:!0}]])]),T("label",WN,[w[85]||(w[85]=T("span",null,"摩擦 (0-1)",-1)),ce(T("input",{"onUpdate:modelValue":w[32]||(w[32]=b=>R(r).friction=b),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[je,R(r).friction,void 0,{number:!0}]])])])):xe("",!0),T("div",zN,[T("label",qN,[ce(T("input",{"onUpdate:modelValue":w[33]||(w[33]=b=>R(r).followPath=b),type:"checkbox"},null,512),[[yt,R(r).followPath]]),w[86]||(w[86]=gt("跟随路径移动",-1))]),R(r).followPath?(z(),J(Ce,{key:0},[T("label",KN,[w[88]||(w[88]=T("span",null,"目标路径",-1)),ce(T("select",{"onUpdate:modelValue":w[34]||(w[34]=b=>R(r).followPathId=b),class:"inp"},[w[87]||(w[87]=T("option",{value:0},"(未选择)",-1)),(z(!0),J(Ce,null,Ft(R(e).paths,b=>(z(),J("option",{key:b.id,value:b.id},ye(b.name),9,ZN))),128))],512),[[_t,R(r).followPathId,void 0,{number:!0}]])]),T("div",JN,[T("label",QN,[w[89]||(w[89]=T("span",null,"移动时长(秒)",-1)),ce(T("input",{"onUpdate:modelValue":w[35]||(w[35]=b=>R(r).followDuration=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[je,R(r).followDuration,void 0,{number:!0}]])]),T("label",eD,[w[91]||(w[91]=T("span",null,"曲线模式",-1)),ce(T("select",{"onUpdate:modelValue":w[36]||(w[36]=b=>R(r).followCurveMode=b),class:"inp"},[...w[90]||(w[90]=[T("option",null,"跟随导出",-1),T("option",null,"线性",-1),T("option",null,"贝塞尔",-1)])],512),[[_t,R(r).followCurveMode]])])]),T("label",tD,[ce(T("input",{"onUpdate:modelValue":w[37]||(w[37]=b=>R(r).followPathRotation=b),type:"checkbox"},null,512),[[yt,R(r).followPathRotation]]),w[92]||(w[92]=gt("方向沿路径",-1))]),w[93]||(w[93]=T("div",{class:"collider-curve-title"},[gt("移动进度曲线 "),T("small",null,"横轴:实时/移动时长 纵轴:路径进度(0=起点 → 1=终点)")],-1)),be(Ji,{"model-value":R(r).followCurve||R(M),"default-value":R(M),mode:R(t)(R(r).followCurveMode),"onUpdate:modelValue":w[38]||(w[38]=b=>R(r).followCurve=b)},null,8,["model-value","default-value","mode"])],64)):xe("",!0)])],64)):R(o)?(z(),J(Ce,{key:2},[w[104]||(w[104]=T("div",{class:"object-editor-title"},"路径属性",-1)),T("label",sD,[w[95]||(w[95]=T("span",null,"路径名称",-1)),ce(T("input",{"onUpdate:modelValue":w[39]||(w[39]=b=>R(o).name=b),class:"inp"},null,512),[[je,R(o).name]])]),T("div",iD,[T("label",nD,[w[96]||(w[96]=T("span",null,"X 位置",-1)),ce(T("input",{"onUpdate:modelValue":w[40]||(w[40]=b=>R(o).x=b),type:"number",class:"inp"},null,512),[[je,R(o).x,void 0,{number:!0}]])]),T("label",rD,[w[97]||(w[97]=T("span",null,"Y 位置",-1)),ce(T("input",{"onUpdate:modelValue":w[41]||(w[41]=b=>R(o).y=b),type:"number",class:"inp"},null,512),[[je,R(o).y,void 0,{number:!0}]])])]),be(Oe,{label:"旋转",min:-360,max:360,step:1,modelValue:R(o).rotation,"onUpdate:modelValue":w[42]||(w[42]=b=>R(o).rotation=b)},null,8,["modelValue"]),T("div",oD,[T("label",aD,[w[98]||(w[98]=T("span",null,"缩放 X",-1)),ce(T("input",{"onUpdate:modelValue":w[43]||(w[43]=b=>R(o).scaleX=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[je,R(o).scaleX,void 0,{number:!0}]])]),T("label",lD,[w[99]||(w[99]=T("span",null,"缩放 Y",-1)),ce(T("input",{"onUpdate:modelValue":w[44]||(w[44]=b=>R(o).scaleY=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[je,R(o).scaleY,void 0,{number:!0}]])])]),T("label",cD,[w[100]||(w[100]=T("span",null,"闭合路径",-1)),ce(T("input",{"onUpdate:modelValue":w[45]||(w[45]=b=>R(o).closed=b),type:"checkbox"},null,512),[[yt,R(o).closed]])]),T("label",hD,[w[101]||(w[101]=T("span",null,"路径颜色",-1)),ce(T("input",{"onUpdate:modelValue":w[46]||(w[46]=b=>R(o).color=b),type:"color",class:"path-color"},null,512),[[je,R(o).color]])]),w[105]||(w[105]=Qs('
操作说明:
  • 双击空白处/曲线:新建锚点
  • 双击锚点:删除节点
  • 双击第二下按住拖动:新建并拉出手柄
  • 拖动锚点移动位置,拖动手柄调整曲线
  • Shift+拖动手柄:两侧完全对称
  • Alt+拖动手柄:独立控制单侧
  • Ctrl+点击/框选:加选节点
  • Alt+点击/框选:减选节点
  • Alt+单击空白处:清除全部选中
  • 选中多个节点后可整体拖动
',1)),T("label",uD,[w[103]||(w[103]=T("span",null,"应用预设形状",-1)),ce(T("select",{"onUpdate:modelValue":w[47]||(w[47]=b=>R(o).preset=b),class:"inp"},[...w[102]||(w[102]=[Qs('',5)])],512),[[_t,R(o).preset]])]),T("button",{class:"path-action primary",onClick:w[48]||(w[48]=(...b)=>R(v)&&R(v)(...b))},"应用预设"),T("button",{class:"path-action",onClick:w[49]||(w[49]=(...b)=>R(y)&&R(y)(...b))},"清空锚点")],64)):R(a)?(z(),At(zB,{key:3,"spine-object":R(a)},null,8,["spine-object"])):(z(),J("div",dD,"使用右上角按钮创建场景对象"))],512),[[Ss,!R(c).scene]])]))}}),mD=Jt(fD,[["__scopeId","data-v-3873124f"]]),pD={class:"group"},gD={class:"caret"},vD={class:"group-body"},yD={class:"segs"},xD={class:"segs stream-behavior-segs"},bD={key:2,class:"stream-loop-options"},wD={class:"loop-section-row"},SD={class:"switch-row"},MD=["checked"],TD={key:0,class:"loop-duration-control"},_D={class:"switch-row loop-duration-toggle"},CD=["checked"],AD={class:"loop-section-duration"},ED=["value"],ID={key:1},RD={key:2,class:"loop-auto-duration"},PD={class:"loop-section-row"},kD={class:"switch-row"},FD=["checked"],OD={key:0,class:"loop-duration-control"},LD={class:"switch-row loop-duration-toggle"},BD=["checked"],ND={class:"loop-section-duration"},DD=["value"],UD={key:1},$D={key:2,class:"loop-auto-duration"},XD={key:3,class:"modifier-hint stream-loop-hint"},VD={class:"group"},YD={class:"caret"},GD={class:"group-body"},jD={class:"row"},HD={class:"row"},WD=["value","disabled"],zD={key:0,class:"row"},qD={class:"row"},KD={key:0,value:"radial"},ZD={key:1,value:"path-normal"},JD={key:2,value:"path-tangent"},QD={key:6,class:"switch-row"},e4=Zt({__name:"EmissionSection",setup(i){const{store:e,sys:t,automaticLoopDuration:s,loopDurationFrames:n,collapsed:r,toggle:o,setEmitMode:a,setLoopDurationFrames:l,setStreamBehavior:c,setLoopSection:h,setLoopSectionDuration:u,setLoopCustomDuration:d,resetModule:f,select:p,onShapeChange:m,onSpawnPathChange:g}=Ar();return(v,y)=>(z(),J(Ce,null,[T("div",pD,[T("div",{class:"group-head",onClick:y[1]||(y[1]=x=>R(o)("emitMode"))},[T("span",gD,ye(R(r).emitMode?"▸":"▾"),1),y[36]||(y[36]=T("span",null,"发射模式",-1)),T("button",{class:"group-reset",title:"重置发射模式参数",onClick:y[0]||(y[0]=Ke(x=>R(f)("emitMode"),["stop"]))},"重置")]),ce(T("div",vD,[T("div",yD,[T("button",{class:Ae(["seg",{on:R(t).config.mode==="stream"}]),onClick:y[2]||(y[2]=x=>R(a)("stream"))},"持续",2),T("button",{class:Ae(["seg",{on:R(t).config.mode==="burst"}]),onClick:y[3]||(y[3]=x=>R(a)("burst"))},"爆发",2)]),R(t).config.mode==="stream"?(z(),J(Ce,{key:0},[T("div",xD,[T("button",{class:Ae(["seg",{on:R(t).config.streamBehavior==="normal"}]),onClick:y[4]||(y[4]=x=>R(c)("normal"))},"常规持续",2),T("button",{class:Ae(["seg",{on:R(t).config.streamBehavior==="loop"}]),onClick:y[5]||(y[5]=x=>R(c)("loop"))},"循环持续",2)]),be(Oe,{label:"发射速率",min:1,max:300,step:1,modelValue:R(t).config.rate,"onUpdate:modelValue":y[6]||(y[6]=x=>R(t).config.rate=x)},null,8,["modelValue"]),R(t).config.streamBehavior==="normal"?(z(),At(Oe,{key:0,label:"发射时长",min:1/30,max:60,step:1/30,modelValue:R(t).config.duration,"onUpdate:modelValue":y[7]||(y[7]=x=>R(t).config.duration=x)},null,8,["modelValue"])):(z(),At(Oe,{key:1,label:"发射时长 (f)",min:1,max:1800,step:1,"model-value":R(n),"onUpdate:modelValue":R(l)},null,8,["model-value","onUpdate:modelValue"])),R(t).config.streamBehavior==="loop"?(z(),J("div",bD,[T("div",wD,[T("label",SD,[T("input",{type:"checkbox",checked:R(t).config.generateLoopStartAnimation,onChange:y[8]||(y[8]=x=>R(h)("start",x))},null,40,MD),y[37]||(y[37]=T("span",{class:"switch-ui"},null,-1)),y[38]||(y[38]=T("span",null,"生成开始循环动画",-1))]),R(t).config.generateLoopStartAnimation?(z(),J("div",TD,[T("label",_D,[T("input",{type:"checkbox",checked:R(t).config.loopStartUseCustomDuration,onChange:y[9]||(y[9]=x=>R(d)("start",x))},null,40,CD),y[39]||(y[39]=T("span",{class:"switch-ui"},null,-1)),y[40]||(y[40]=T("span",null,"指定时长",-1))]),T("label",AD,[R(t).config.loopStartUseCustomDuration?(z(),J("input",{key:0,value:R(t).config.loopStartDurationFrames,type:"number",min:"1",max:"1800",step:"1","aria-label":"开始循环段时长",onChange:y[10]||(y[10]=x=>R(u)("start",x))},null,40,ED)):xe("",!0),R(t).config.loopStartUseCustomDuration?(z(),J("span",ID,"f")):(z(),J("span",RD,"自动 "+ye(R(s))+"f",1))])])):xe("",!0)]),T("div",PD,[T("label",kD,[T("input",{type:"checkbox",checked:R(t).config.generateLoopEndAnimation,onChange:y[11]||(y[11]=x=>R(h)("end",x))},null,40,FD),y[41]||(y[41]=T("span",{class:"switch-ui"},null,-1)),y[42]||(y[42]=T("span",null,"生成结束循环动画",-1))]),R(t).config.generateLoopEndAnimation?(z(),J("div",OD,[T("label",LD,[T("input",{type:"checkbox",checked:R(t).config.loopEndUseCustomDuration,onChange:y[12]||(y[12]=x=>R(d)("end",x))},null,40,BD),y[43]||(y[43]=T("span",{class:"switch-ui"},null,-1)),y[44]||(y[44]=T("span",null,"指定时长",-1))]),T("label",ND,[R(t).config.loopEndUseCustomDuration?(z(),J("input",{key:0,value:R(t).config.loopEndDurationFrames,type:"number",min:"1",max:"1800",step:"1","aria-label":"结束循环段时长",onChange:y[13]||(y[13]=x=>R(u)("end",x))},null,40,DD)):xe("",!0),R(t).config.loopEndUseCustomDuration?(z(),J("span",UD,"f")):(z(),J("span",$D,"自动 "+ye(R(s))+"f",1))])])):xe("",!0)])])):xe("",!0),R(t).config.streamBehavior==="loop"?(z(),J("div",XD,"循环持续模式不支持骨骼跟随和路径跟随;进入或退出时会将粒子跟随设置恢复默认值。")):xe("",!0)],64)):(z(),At(Oe,{key:1,label:"单次数量",min:1,max:1e3,step:1,modelValue:R(t).config.burstCount,"onUpdate:modelValue":y[14]||(y[14]=x=>R(t).config.burstCount=x)},null,8,["modelValue"])),be(Oe,{label:"延迟时间",min:0,max:5,step:.1,modelValue:R(t).config.delay,"onUpdate:modelValue":y[15]||(y[15]=x=>R(t).config.delay=x)},null,8,["modelValue"])],512),[[Ss,!R(r).emitMode]])]),T("div",VD,[T("div",{class:"group-head",onClick:y[17]||(y[17]=x=>R(o)("shape"))},[T("span",YD,ye(R(r).shape?"▸":"▾"),1),y[45]||(y[45]=T("span",null,"发射器形状",-1)),T("button",{class:"group-reset",title:"重置发射器形状参数",onClick:y[16]||(y[16]=Ke(x=>R(f)("shape"),["stop"]))},"重置")]),ce(T("div",GD,[T("label",jD,[y[47]||(y[47]=T("span",null,"形状",-1)),ce(T("select",{"onUpdate:modelValue":y[18]||(y[18]=x=>R(t).config.shape=x),class:"inp",onChange:y[19]||(y[19]=(...x)=>R(m)&&R(m)(...x))},[...y[46]||(y[46]=[Qs('',5)])],544),[[_t,R(t).config.shape]])]),R(t).config.shape==="circle"||R(t).config.shape==="cone"?(z(),J(Ce,{key:0},[be(Oe,{label:R(t).config.shape==="cone"?"内径":"内半径",min:0,max:R(t).config.outerRadius,step:1,modelValue:R(t).config.innerRadius,"onUpdate:modelValue":y[20]||(y[20]=x=>R(t).config.innerRadius=x)},null,8,["label","max","modelValue"]),be(Oe,{label:R(t).config.shape==="cone"?"外径":"外半径",min:R(t).config.innerRadius,max:300,step:1,modelValue:R(t).config.outerRadius,"onUpdate:modelValue":y[21]||(y[21]=x=>R(t).config.outerRadius=x)},null,8,["label","min","modelValue"])],64)):xe("",!0),R(t).config.shape==="cone"?(z(),J(Ce,{key:1},[be(Oe,{label:"锥形朝向",min:-360,max:360,step:1,modelValue:R(t).config.coneDirection,"onUpdate:modelValue":y[22]||(y[22]=x=>R(t).config.coneDirection=x)},null,8,["modelValue"]),be(Oe,{label:"锥形开口角度",min:1,max:360,step:1,modelValue:R(t).config.coneAngle,"onUpdate:modelValue":y[23]||(y[23]=x=>R(t).config.coneAngle=x)},null,8,["modelValue"])],64)):R(t).config.shape==="rect"?(z(),J(Ce,{key:2},[be(Oe,{label:"内宽",min:0,max:R(t).config.outerRectW,step:1,modelValue:R(t).config.innerRectW,"onUpdate:modelValue":y[24]||(y[24]=x=>R(t).config.innerRectW=x)},null,8,["max","modelValue"]),be(Oe,{label:"内高",min:0,max:R(t).config.outerRectH,step:1,modelValue:R(t).config.innerRectH,"onUpdate:modelValue":y[25]||(y[25]=x=>R(t).config.innerRectH=x)},null,8,["max","modelValue"]),be(Oe,{label:"外宽",min:R(t).config.innerRectW,max:400,step:1,modelValue:R(t).config.outerRectW,"onUpdate:modelValue":y[26]||(y[26]=x=>R(t).config.outerRectW=x)},null,8,["min","modelValue"]),be(Oe,{label:"外高",min:R(t).config.innerRectH,max:400,step:1,modelValue:R(t).config.outerRectH,"onUpdate:modelValue":y[27]||(y[27]=x=>R(t).config.outerRectH=x)},null,8,["min","modelValue"])],64)):R(t).config.shape==="path"?(z(),J(Ce,{key:3},[T("label",HD,[y[49]||(y[49]=T("span",null,"选择路径",-1)),ce(T("select",{"onUpdate:modelValue":y[28]||(y[28]=x=>R(t).config.spawnPathId=x),class:"inp",onChange:y[29]||(y[29]=(...x)=>R(g)&&R(g)(...x))},[y[48]||(y[48]=T("option",{value:0},"无路径(点发射)",-1)),(z(!0),J(Ce,null,Ft(R(e).paths,x=>(z(),J("option",{key:x.id,value:x.id,disabled:!x.enabled},ye(x.name),9,WD))),128))],544),[[_t,R(t).config.spawnPathId,void 0,{number:!0}]])]),R(t).config.spawnPathId>0?(z(),J("label",zD,[y[51]||(y[51]=T("span",null,"出生分布",-1)),ce(T("select",{"onUpdate:modelValue":y[30]||(y[30]=x=>R(t).config.spawnPathDistribution=x),class:"inp"},[...y[50]||(y[50]=[T("option",{value:"fixed"},"等间距固定分布",-1),T("option",{value:"random"},"随机分布",-1)])],512),[[_t,R(t).config.spawnPathDistribution]])])):xe("",!0)],64)):xe("",!0),y[57]||(y[57]=T("div",{class:"divider"},null,-1)),T("label",qD,[y[54]||(y[54]=T("span",null,"发射角度",-1)),ce(T("select",{"onUpdate:modelValue":y[31]||(y[31]=x=>R(t).config.emissionAngleMode=x),class:"inp"},[y[52]||(y[52]=T("option",{value:"fixed"},"固定",-1)),y[53]||(y[53]=T("option",{value:"random"},"随机",-1)),R(t).config.shape==="circle"||R(t).config.shape==="rect"||R(t).config.shape==="cone"?(z(),J("option",KD,"径向(中心向外)")):xe("",!0),R(t).config.shape==="path"&&R(t).config.spawnPathId>0?(z(),J("option",ZD,"垂直于路径")):xe("",!0),R(t).config.shape==="path"&&R(t).config.spawnPathId>0?(z(),J("option",JD,"沿路径方向")):xe("",!0)],512),[[_t,R(t).config.emissionAngleMode]])]),R(t).config.emissionAngleMode==="fixed"?(z(),At(Oe,{key:4,label:"固定角度",min:-360,max:360,step:1,modelValue:R(t).config.direction,"onUpdate:modelValue":y[32]||(y[32]=x=>R(t).config.direction=x)},null,8,["modelValue"])):R(t).config.emissionAngleMode==="random"?(z(),J(Ce,{key:5},[be(Oe,{label:"基准角度",min:-360,max:360,step:1,modelValue:R(t).config.direction,"onUpdate:modelValue":y[33]||(y[33]=x=>R(t).config.direction=x)},null,8,["modelValue"]),be(Oe,{label:"随机范围",min:0,max:360,step:1,modelValue:R(t).config.spread,"onUpdate:modelValue":y[34]||(y[34]=x=>R(t).config.spread=x)},null,8,["modelValue"])],64)):xe("",!0),R(t).config.shape!=="point"?(z(),J("label",QD,[ce(T("input",{type:"checkbox","onUpdate:modelValue":y[35]||(y[35]=x=>R(t).config.showShape=x)},null,512),[[yt,R(t).config.showShape]]),y[55]||(y[55]=T("span",{class:"switch-ui"},null,-1)),y[56]||(y[56]=T("span",null,"显示形状",-1))])):xe("",!0)],512),[[Ss,!R(r).shape]])])],64))}}),t4=Jt(e4,[["__scopeId","data-v-f9eac627"]]),s4={class:"pac"},i4={class:"pac-head"},n4={class:"pac-label"},r4={key:0,class:"pac-modes"},o4=["onClick"],a4={class:"pac-range"},l4={class:"pac-curve"},c4={class:"pac-axis"},h4=Zt({__name:"ParticleAttributeControl",props:{label:{},mode:{},valueMin:{},valueMax:{},curve:{},defaultCurve:{default:()=>[{x:0,y:0},{x:1,y:1}]},min:{},max:{},step:{default:1},allowDirection:{type:Boolean,default:!1},allowCurve:{type:Boolean,default:!0},showModes:{type:Boolean,default:!0},curveLabel:{default:"曲线输入 →"}},emits:["update:mode","update:valueMin","update:valueMax","update:curve"],setup(i){const e=i,t=De(()=>{const s=[{label:"固定",value:"fixed"},{label:"随机",value:"random"}];return e.allowCurve&&s.push({label:"曲线",value:"curve"}),e.allowDirection&&s.push({label:"发射方向",value:"direction"}),s});return(s,n)=>(z(),J("div",s4,[T("div",i4,[T("span",n4,ye(i.label),1),i.showModes?(z(),J("div",r4,[(z(!0),J(Ce,null,Ft(t.value,r=>(z(),J("button",{key:r.value,class:Ae(["pac-mode",{on:i.mode===r.value}]),onClick:o=>s.$emit("update:mode",r.value)},ye(r.label),11,o4))),128))])):xe("",!0)]),i.mode==="fixed"||i.mode==="direction"?(z(),At(Oe,{key:0,label:i.mode==="direction"?"角度偏移":"数值",min:i.min,max:i.max,step:i.step,"model-value":i.valueMin,"onUpdate:modelValue":n[0]||(n[0]=r=>s.$emit("update:valueMin",r))},null,8,["label","min","max","step","model-value"])):i.mode==="random"?(z(),J(Ce,{key:1},[be(Oe,{label:"下限",min:i.min,max:i.max,step:i.step,"model-value":i.valueMin,"onUpdate:modelValue":n[1]||(n[1]=r=>s.$emit("update:valueMin",r))},null,8,["min","max","step","model-value"]),be(Oe,{label:"上限",min:i.min,max:i.max,step:i.step,"model-value":i.valueMax,"onUpdate:modelValue":n[2]||(n[2]=r=>s.$emit("update:valueMax",r))},null,8,["min","max","step","model-value"])],64)):(z(),J(Ce,{key:2},[T("div",a4,[be(Oe,{label:"范围下限",min:i.min,max:i.max,step:i.step,"model-value":i.valueMin,"onUpdate:modelValue":n[3]||(n[3]=r=>s.$emit("update:valueMin",r))},null,8,["min","max","step","model-value"]),be(Oe,{label:"范围上限",min:i.min,max:i.max,step:i.step,"model-value":i.valueMax,"onUpdate:modelValue":n[4]||(n[4]=r=>s.$emit("update:valueMax",r))},null,8,["min","max","step","model-value"])]),T("div",l4,[be(Ji,{"model-value":i.curve,"default-value":i.defaultCurve,"onUpdate:modelValue":n[5]||(n[5]=r=>s.$emit("update:curve",r))},null,8,["model-value","default-value"]),T("div",c4,[n[6]||(n[6]=T("span",null,"0",-1)),T("span",null,ye(i.curveLabel),1),n[7]||(n[7]=T("span",null,"1",-1))])])],64))]))}}),xn=Jt(h4,[["__scopeId","data-v-238f838c"]]),u4={class:"group"},d4={class:"caret"},f4={class:"group-body attr-body"},m4={class:"attr-axis-head"},p4={class:"axis-modes"},g4={class:"life-item"},v4={class:"switch-row"},y4={class:"life-item"},x4={class:"switch-row"},b4={class:"axis-modes life-axis"},w4={class:"life-item"},S4={class:"switch-row"},M4=Zt({__name:"ParticleAttributesSection",setup(i){const{sys:e,collapsed:t,toggle:s,resetModule:n,setSpeedOverLifeMode:r,prepareScaleOverLifeCurve:o,setScaleOverLifeMode:a,LINEAR_CURVE:l,FLAT_CURVE:c}=Ar();return(h,u)=>(z(),J("div",u4,[T("div",{class:"group-head",onClick:u[1]||(u[1]=d=>R(s)("attr"))},[T("span",d4,ye(R(t).attr?"▸":"▾"),1),u[44]||(u[44]=T("span",null,"粒子属性",-1)),T("button",{class:"group-reset",title:"重置粒子属性参数",onClick:u[0]||(u[0]=Ke(d=>R(n)("attr"),["stop"]))},"重置")]),ce(T("div",f4,[u[52]||(u[52]=T("div",{class:"attr-section-title"},"粒子初始参数",-1)),be(xn,{label:"初始生命周期","allow-curve":!1,mode:R(e).config.lifeMode,"onUpdate:mode":u[2]||(u[2]=d=>R(e).config.lifeMode=d),"value-min":R(e).config.lifeMin,"onUpdate:valueMin":u[3]||(u[3]=d=>R(e).config.lifeMin=d),"value-max":R(e).config.lifeMax,"onUpdate:valueMax":u[4]||(u[4]=d=>R(e).config.lifeMax=d),curve:R(e).config.lifeCurve,"onUpdate:curve":u[5]||(u[5]=d=>R(e).config.lifeCurve=d),min:.1,max:10,step:.1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),be(xn,{label:"初始速度","allow-curve":!1,mode:R(e).config.speedMode,"onUpdate:mode":u[6]||(u[6]=d=>R(e).config.speedMode=d),"value-min":R(e).config.speedMin,"onUpdate:valueMin":u[7]||(u[7]=d=>R(e).config.speedMin=d),"value-max":R(e).config.speedMax,"onUpdate:valueMax":u[8]||(u[8]=d=>R(e).config.speedMax=d),curve:R(e).config.speedCurve,"onUpdate:curve":u[9]||(u[9]=d=>R(e).config.speedCurve=d),min:0,max:1e3,step:1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),T("div",m4,[u[45]||(u[45]=T("span",null,"初始缩放",-1)),T("div",p4,[T("button",{class:Ae(["axis-mode",{on:R(e).config.scaleAxisMode==="uniform"}]),onClick:u[10]||(u[10]=d=>R(e).config.scaleAxisMode="uniform")},"统一",2),T("button",{class:Ae(["axis-mode",{on:R(e).config.scaleAxisMode==="separate"}]),onClick:u[11]||(u[11]=d=>R(e).config.scaleAxisMode="separate")},"XY分离",2)])]),be(xn,{label:R(e).config.scaleAxisMode==="uniform"?"初始缩放":"缩放 X","allow-curve":!1,mode:R(e).config.scaleMode,"onUpdate:mode":u[12]||(u[12]=d=>R(e).config.scaleMode=d),"value-min":R(e).config.scaleMin,"onUpdate:valueMin":u[13]||(u[13]=d=>R(e).config.scaleMin=d),"value-max":R(e).config.scaleMax,"onUpdate:valueMax":u[14]||(u[14]=d=>R(e).config.scaleMax=d),curve:R(e).config.scaleCurve,"onUpdate:curve":u[15]||(u[15]=d=>R(e).config.scaleCurve=d),min:0,max:5,step:.05,"curve-label":"随机采样 →"},null,8,["label","mode","value-min","value-max","curve"]),R(e).config.scaleAxisMode==="separate"?(z(),At(xn,{key:0,label:"缩放 Y","show-modes":!1,"allow-curve":!1,mode:R(e).config.scaleMode,"onUpdate:mode":u[16]||(u[16]=d=>R(e).config.scaleMode=d),"value-min":R(e).config.scaleYMin,"onUpdate:valueMin":u[17]||(u[17]=d=>R(e).config.scaleYMin=d),"value-max":R(e).config.scaleYMax,"onUpdate:valueMax":u[18]||(u[18]=d=>R(e).config.scaleYMax=d),curve:R(e).config.scaleYCurve,"onUpdate:curve":u[19]||(u[19]=d=>R(e).config.scaleYCurve=d),min:0,max:5,step:.05,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"])):xe("",!0),be(xn,{label:"初始旋转","allow-direction":"","allow-curve":!1,mode:R(e).config.initialRotationMode,"onUpdate:mode":u[20]||(u[20]=d=>R(e).config.initialRotationMode=d),"value-min":R(e).config.initialRotationMin,"onUpdate:valueMin":u[21]||(u[21]=d=>R(e).config.initialRotationMin=d),"value-max":R(e).config.initialRotationMax,"onUpdate:valueMax":u[22]||(u[22]=d=>R(e).config.initialRotationMax=d),curve:R(e).config.initialRotationCurve,"onUpdate:curve":u[23]||(u[23]=d=>R(e).config.initialRotationCurve=d),min:-360,max:360,step:1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),u[53]||(u[53]=T("div",{class:"attr-section-title life-title"},"粒子生命周期变化参数",-1)),T("div",g4,[T("label",v4,[ce(T("input",{type:"checkbox","onUpdate:modelValue":u[24]||(u[24]=d=>R(e).config.speedOverLifeEnabled=d)},null,512),[[yt,R(e).config.speedOverLifeEnabled]]),u[46]||(u[46]=T("span",{class:"switch-ui"},null,-1)),u[47]||(u[47]=T("span",null,"生命周期内速度",-1))]),R(e).config.speedOverLifeEnabled?(z(),At(xn,{key:0,label:"速度倍率",mode:R(e).config.speedOverLifeMode,"onUpdate:mode":R(r),"value-min":R(e).config.speedOverLifeMin,"onUpdate:valueMin":u[25]||(u[25]=d=>R(e).config.speedOverLifeMin=d),"value-max":R(e).config.speedOverLifeMax,"onUpdate:valueMax":u[26]||(u[26]=d=>R(e).config.speedOverLifeMax=d),curve:R(e).config.speedOverLifeCurve,"onUpdate:curve":u[27]||(u[27]=d=>R(e).config.speedOverLifeCurve=d),"default-curve":R(c),min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["mode","onUpdate:mode","value-min","value-max","curve","default-curve"])):xe("",!0)]),T("div",y4,[T("label",x4,[ce(T("input",{type:"checkbox","onUpdate:modelValue":u[28]||(u[28]=d=>R(e).config.scaleOverLifeEnabled=d),onChange:u[29]||(u[29]=(...d)=>R(o)&&R(o)(...d))},null,544),[[yt,R(e).config.scaleOverLifeEnabled]]),u[48]||(u[48]=T("span",{class:"switch-ui"},null,-1)),u[49]||(u[49]=T("span",null,"生命周期内缩放",-1))]),R(e).config.scaleOverLifeEnabled?(z(),J(Ce,{key:0},[T("div",b4,[T("button",{class:Ae(["axis-mode",{on:R(e).config.scaleOverLifeAxisMode==="uniform"}]),onClick:u[30]||(u[30]=d=>R(e).config.scaleOverLifeAxisMode="uniform")},"统一",2),T("button",{class:Ae(["axis-mode",{on:R(e).config.scaleOverLifeAxisMode==="separate"}]),onClick:u[31]||(u[31]=d=>R(e).config.scaleOverLifeAxisMode="separate")},"XY分离",2)]),be(xn,{label:R(e).config.scaleOverLifeAxisMode==="uniform"?"缩放倍率":"倍率 X",mode:R(e).config.scaleOverLifeMode,"onUpdate:mode":R(a),"value-min":R(e).config.scaleOverLifeMin,"onUpdate:valueMin":u[32]||(u[32]=d=>R(e).config.scaleOverLifeMin=d),"value-max":R(e).config.scaleOverLifeMax,"onUpdate:valueMax":u[33]||(u[33]=d=>R(e).config.scaleOverLifeMax=d),curve:R(e).config.scaleOverLifeCurve,"onUpdate:curve":u[34]||(u[34]=d=>R(e).config.scaleOverLifeCurve=d),"default-curve":R(c),min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["label","mode","onUpdate:mode","value-min","value-max","curve","default-curve"]),R(e).config.scaleOverLifeAxisMode==="separate"?(z(),At(xn,{key:0,label:"倍率 Y","show-modes":!1,mode:R(e).config.scaleOverLifeMode,"onUpdate:mode":u[35]||(u[35]=d=>R(e).config.scaleOverLifeMode=d),"value-min":R(e).config.scaleYOverLifeMin,"onUpdate:valueMin":u[36]||(u[36]=d=>R(e).config.scaleYOverLifeMin=d),"value-max":R(e).config.scaleYOverLifeMax,"onUpdate:valueMax":u[37]||(u[37]=d=>R(e).config.scaleYOverLifeMax=d),curve:R(e).config.scaleYOverLifeCurve,"onUpdate:curve":u[38]||(u[38]=d=>R(e).config.scaleYOverLifeCurve=d),"default-curve":R(c),min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["mode","value-min","value-max","curve","default-curve"])):xe("",!0)],64)):xe("",!0)]),T("div",w4,[T("label",S4,[ce(T("input",{type:"checkbox","onUpdate:modelValue":u[39]||(u[39]=d=>R(e).config.rotationOverLifeEnabled=d)},null,512),[[yt,R(e).config.rotationOverLifeEnabled]]),u[50]||(u[50]=T("span",{class:"switch-ui"},null,-1)),u[51]||(u[51]=T("span",null,"生命周期内旋转",-1))]),R(e).config.rotationOverLifeEnabled?(z(),At(xn,{key:0,label:"旋转速度",mode:R(e).config.rotationOverLifeMode,"onUpdate:mode":u[40]||(u[40]=d=>R(e).config.rotationOverLifeMode=d),"value-min":R(e).config.rotationSpeedMin,"onUpdate:valueMin":u[41]||(u[41]=d=>R(e).config.rotationSpeedMin=d),"value-max":R(e).config.rotationSpeedMax,"onUpdate:valueMax":u[42]||(u[42]=d=>R(e).config.rotationSpeedMax=d),curve:R(e).config.rotationOverLifeCurve,"onUpdate:curve":u[43]||(u[43]=d=>R(e).config.rotationOverLifeCurve=d),"default-curve":R(l),min:-720,max:720,step:10,"curve-label":"生命周期 →"},null,8,["mode","value-min","value-max","curve","default-curve"])):xe("",!0)])],512),[[Ss,!R(t).attr]])]))}}),T4=Jt(M4,[["__scopeId","data-v-cf6b86a5"]]),_4={class:"gradient-editor"},C4=["title","onClick","onDblclick","onPointerdown"],A4={key:0,class:"gradient-controls"},E4=["value"],I4=["value"],R4={class:"gradient-position"},P4=["value"],k4=["disabled"],F4=Zt({__name:"ColorGradientEditor",props:{modelValue:{}},emits:["update:modelValue"],setup(i,{emit:e}){const t=i,s=e,n=Fe(null),r=Fe(0),o=De(()=>t.modelValue[r.value]||null),a=De(()=>[...t.modelValue].sort((_,E)=>_.position-E.position)),l=De(()=>{const _=a.value;return _.length?`linear-gradient(90deg, ${_.map(E=>`${E.color} ${c(E.position)*100}%`).join(", ")})`:"#ffffff"});cs(()=>t.modelValue.length,_=>{r.value>=_&&(r.value=Math.max(0,_-1))});function c(_){return Math.min(1,Math.max(0,Number(_)||0))}function h(){return t.modelValue.map(_=>({position:c(_.position),color:_.color}))}function u(_,E){const F=h();F[_]&&(F[_]={...F[_],...E},s("update:modelValue",F))}function d(_){u(r.value,{color:_.target.value})}function f(_){var I;const E=_.target,F=b(E.value,((I=o.value)==null?void 0:I.color)||"#ffffff");E.value=F,u(r.value,{color:F})}function p(_){const E=_.target;f(_),E.blur()}function m(_){const E=Number(_.target.value);Number.isFinite(E)&&u(r.value,{position:c(E/100)})}function g(_){const E=h();E.push({position:c(_),color:C(E,_)}),r.value=E.length-1,s("update:modelValue",E)}function v(_){if(!n.value)return;const E=n.value.getBoundingClientRect();g((_.clientX-E.left)/Math.max(1,E.width))}function y(){const _=a.value;let E=.5;if(_.length>1){let F=-1;for(let I=0;I<_.length-1;I++){const k=_[I+1].position-_[I].position;k>F&&(F=k,E=(_[I].position+_[I+1].position)/2)}}g(E)}function x(_){if(t.modelValue.length<=2||_<0)return;const E=h().filter((F,I)=>I!==_);r.value=Math.min(_,E.length-1),s("update:modelValue",E)}function M(_,E){if(!n.value)return;r.value=E;const F=k=>{const B=n.value.getBoundingClientRect();u(E,{position:c((k.clientX-B.left)/Math.max(1,B.width))})},I=()=>{window.removeEventListener("pointermove",F),window.removeEventListener("pointerup",I),window.removeEventListener("pointercancel",I)};window.addEventListener("pointermove",F),window.addEventListener("pointerup",I),window.addEventListener("pointercancel",I),_.preventDefault()}function C(_,E){const F=[..._].sort((I,k)=>I.position-k.position);if(!F.length)return"#ffffff";if(E<=F[0].position)return F[0].color;if(E>=F[F.length-1].position)return F[F.length-1].color;for(let I=0;IB.position)continue;const D=(E-k.position)/Math.max(1e-4,B.position-k.position);return w(k.color,B.color,D)}return F[F.length-1].color}function w(_,E,F){const I=X=>{const N=parseInt(X.replace("#","").padEnd(6,"0").slice(0,6),16);return[N>>16&255,N>>8&255,N&255]},k=I(_),B=I(E),D=X=>Math.round(k[X]+(B[X]-k[X])*F);return`#${[D(0),D(1),D(2)].map(X=>X.toString(16).padStart(2,"0")).join("")}`}function b(_,E){let F=_.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(F)&&(F=F.split("").map(I=>I+I).join("")),/^[0-9a-f]{6}$/i.test(F)?`#${F.toLowerCase()}`:E}return(_,E)=>(z(),J("div",_4,[T("div",{ref_key:"bar",ref:n,class:"gradient-bar",style:Vt({background:l.value}),title:"双击色带添加色标",onDblclick:v},[(z(!0),J(Ce,null,Ft(i.modelValue,(F,I)=>(z(),J("button",{key:I,type:"button",class:Ae(["gradient-stop",{selected:I===r.value}]),style:Vt({left:`${c(F.position)*100}%`,"--stop-color":F.color}),title:`${Math.round(c(F.position)*100)}% · ${F.color}`,onClick:Ke(k=>r.value=I,["stop"]),onDblclick:Ke(k=>x(I),["stop"]),onPointerdown:Ke(k=>M(k,I),["stop"])},null,46,C4))),128))],36),o.value?(z(),J("div",A4,[T("input",{type:"color",class:"gradient-color",value:o.value.color,"aria-label":"色标颜色",onInput:d},null,40,E4),T("input",{type:"text",class:"gradient-hex-input",value:o.value.color,"aria-label":"色标颜色值",spellcheck:"false",onChange:f,onKeydown:yr(p,["enter"])},null,40,I4),T("label",R4,[T("input",{type:"number",min:"0",max:"100",step:"1",value:Math.round(c(o.value.position)*100),"aria-label":"色标位置",onInput:m},null,40,P4),E[1]||(E[1]=T("span",null,"%",-1))]),T("button",{type:"button",class:"gradient-action",title:"在中间新增颜色",onClick:y},"+"),T("button",{type:"button",class:"gradient-action danger",title:"删除当前色标",disabled:i.modelValue.length<=2,onClick:E[0]||(E[0]=F=>x(r.value))},"×",8,k4)])):xe("",!0),E[2]||(E[2]=T("div",{class:"gradient-hint"},"双击色带新增 · 拖动色标调整位置 · 双击色标删除",-1))]))}}),$S=Jt(F4,[["__scopeId","data-v-f6ab10bf"]]),O4={class:"pivot-toolbar"},L4={class:"pivot-zoom"},B4=["disabled"],N4=["disabled"],D4=["src"],U4={key:2,class:"pivot-empty"},$4={class:"pivot-bottom"},X4={class:"pivot-card"},V4={class:"pivot-presets"},Y4=["title","aria-label","onClick"],G4={class:"pivot-card"},j4={class:"pivot-coords"},H4=["value"],W4=["value"],z4={class:"pivot-card-head pivot-rotate-head"},q4={class:"pivot-rotate-state"},K4={class:"pivot-rotate-body"},Z4={class:"pivot-rotate-modes"},J4={class:"pivot-rotate-preview"},Q4=["src"],vf=1e3,e5=Zt({__name:"PivotEditor",props:{previewUrl:{},anchorX:{},anchorY:{},large:{type:Boolean,default:!1}},emits:["update:anchorX","update:anchorY","fullscreen"],setup(i,{emit:e}){const t=i,s=e,n=[{icon:"↖",label:"左上",x:0,y:0},{icon:"↑",label:"正上",x:50,y:0},{icon:"↗",label:"右上",x:100,y:0},{icon:"←",label:"正左",x:0,y:50},{icon:"◯",label:"正中",x:50,y:50},{icon:"→",label:"正右",x:100,y:50},{icon:"↙",label:"左下",x:0,y:100},{icon:"↓",label:"正下·底部",x:50,y:100},{icon:"↘",label:"右下",x:100,y:100}],r=Fe(null),o=Fe(null),a=Fe({w:0,h:0}),l=Fe({w:1,h:1}),c=Fe(100),h=Fe({x:0,y:0}),u=Fe(!1),d=Fe("static");let f=null;const p=U=>Math.min(vf,Math.max(-vf,Number.isFinite(U)?U:0)),m=De(()=>p(t.anchorX*100).toFixed(1)),g=De(()=>p(t.anchorY*100).toFixed(1));function v(U,A){const P=l.value.w/Math.max(1,l.value.h);let O=U,L=O/P;return L>A&&(L=A,O=L*P),{w:Math.max(1,O),h:Math.max(1,L)}}const y=De(()=>{const U=t.large?26:12,A=Math.max(1,a.value.w-U*2),P=Math.max(1,a.value.h-U*2);return v(A,P)}),x=De(()=>({width:`${y.value.w}px`,height:`${y.value.h}px`,transform:`translate(${h.value.x}px, ${h.value.y}px) scale(${c.value/100})`})),M=De(()=>{const U=c.value/100;return{x:a.value.w/2+h.value.x+(p(t.anchorX*100)/100-.5)*y.value.w*U,y:a.value.h/2+h.value.y+(p(t.anchorY*100)/100-.5)*y.value.h*U}}),C=De(()=>{const U=t.large?128:72,A=v(U,U);return{width:`${A.w}px`,height:`${A.h}px`,transformOrigin:`${p(t.anchorX*100)}% ${p(t.anchorY*100)}%`}});function w(U,A){const P=vf/100;s("update:anchorX",Math.min(P,Math.max(-P,Number.isFinite(U)?U:0))),s("update:anchorY",Math.min(P,Math.max(-P,Number.isFinite(A)?A:0)))}function b(U){const A=o.value;if(!A)return;const P=A.getBoundingClientRect();P.width<=0||P.height<=0||w((U.clientX-P.left)/P.width,(U.clientY-P.top)/P.height)}function _(U){if(!t.previewUrl)return;if(U.button===2){E(U);return}if(U.button!==0)return;U.preventDefault(),b(U);const A=O=>b(O),P=()=>{window.removeEventListener("pointermove",A),window.removeEventListener("pointerup",P),window.removeEventListener("pointercancel",P)};window.addEventListener("pointermove",A),window.addEventListener("pointerup",P),window.addEventListener("pointercancel",P)}function E(U){U.preventDefault(),u.value=!0;const A=U.clientX,P=U.clientY,O=h.value.x,L=h.value.y,$=j=>{h.value={x:O+j.clientX-A,y:L+j.clientY-P}},V=()=>{u.value=!1,window.removeEventListener("pointermove",$),window.removeEventListener("pointerup",V),window.removeEventListener("pointercancel",V)};window.addEventListener("pointermove",$),window.addEventListener("pointerup",V),window.addEventListener("pointercancel",V)}function F(U){const A=U.deltaY<0?1.12:.8928571428571428,P=Math.min(400,Math.max(100,Math.round(c.value*A)));if(P===c.value)return;const O=r.value;if(!O){c.value=P;return}const L=O.getBoundingClientRect(),$=U.clientX-L.left,V=U.clientY-L.top,j=P/c.value;h.value={x:h.value.x+($-L.width/2-h.value.x)*(1-j),y:h.value.y+(V-L.height/2-h.value.y)*(1-j)},c.value=P}function I(U){const A=U.target;l.value={w:A.naturalWidth||1,h:A.naturalHeight||1}}function k(U){c.value=Math.min(400,Math.max(100,c.value+U))}function B(){w(.5,.5)}function D(U){w(U.x/100,U.y/100)}function X(U){return Math.abs(p(t.anchorX*100)-U.x)<.05&&Math.abs(p(t.anchorY*100)-U.y)<.05}function N(U,A){const P=p(Number(A.target.value));s(U==="x"?"update:anchorX":"update:anchorY",P/100)}return cs(()=>t.previewUrl,()=>{l.value={w:1,h:1},h.value={x:0,y:0},c.value=100}),Oi(()=>{r.value&&(f=new ResizeObserver(U=>{var P;const A=(P=U[0])==null?void 0:P.contentRect;A&&(a.value={w:A.width,h:A.height})}),f.observe(r.value))}),po(()=>{f==null||f.disconnect(),f=null}),(U,A)=>(z(),J("div",{class:Ae(["pivot-editor",{"pivot-large":i.large}])},[T("div",O4,[A[9]||(A[9]=T("div",{class:"pivot-hint"},[T("span",{class:"pivot-hint-icon"},"⊕"),T("span",null,"贴图轴点")],-1)),T("div",L4,[T("button",{type:"button",disabled:c.value<=100,title:"缩小",onClick:A[0]||(A[0]=P=>k(-25))},"−",8,B4),T("span",null,ye(c.value)+"%",1),T("button",{type:"button",disabled:c.value>=400,title:"放大",onClick:A[1]||(A[1]=P=>k(25))},"+",8,N4)]),i.large?xe("",!0):(z(),J("button",{key:0,type:"button",class:"pivot-expand",title:"放大到全屏操作",onClick:A[2]||(A[2]=P=>U.$emit("fullscreen"))},"⤢"))]),T("div",{ref_key:"stageRef",ref:r,class:Ae(["pivot-stage",{panning:u.value}]),title:"左键点击/拖动设置轴点 · 右键拖动画布 · 滚轮缩放",onPointerdown:_,onWheel:Ke(F,["prevent"]),onContextmenu:A[3]||(A[3]=Ke(()=>{},["prevent"]))},[i.previewUrl?(z(),J("div",{key:0,ref_key:"boxRef",ref:o,class:"pivot-box",style:Vt(x.value)},[T("img",{src:i.previewUrl,alt:"轴点预览",draggable:"false",onLoad:I},null,40,D4)],4)):xe("",!0),i.previewUrl?(z(),J(Ce,{key:1},[T("div",{class:"pivot-cross vertical",style:Vt({left:`${M.value.x}px`})},null,4),T("div",{class:"pivot-cross horizontal",style:Vt({top:`${M.value.y}px`})},null,4),T("div",{class:"pivot-marker",style:Vt({left:`${M.value.x}px`,top:`${M.value.y}px`})},null,4),T("div",{class:"pivot-badge",style:Vt({left:`${M.value.x}px`,top:`${M.value.y}px`})},"X: "+ye(m.value)+"% | Y: "+ye(g.value)+"%",5)],64)):(z(),J("div",U4,"未选择图片"))],34),T("div",$4,[T("div",X4,[T("div",V4,[(z(),J(Ce,null,Ft(n,P=>T("button",{key:P.label,type:"button",class:Ae(["pivot-preset",{on:X(P)}]),title:`${P.label}(${P.x}%, ${P.y}%)`,"aria-label":P.label,onClick:O=>D(P)},ye(P.icon),11,Y4)),64))]),T("button",{type:"button",class:"pivot-reset",onClick:B},"↺ 复位居中 (50%, 50%)")]),T("div",G4,[A[15]||(A[15]=T("div",{class:"pivot-card-head"},[T("span",null,[T("span",{class:"pivot-card-icon"},"◎"),gt(" 轴点坐标(%)")])],-1)),T("div",j4,[T("label",null,[A[10]||(A[10]=gt("X: ",-1)),T("input",{type:"number",min:"-1000",max:"1000",step:"0.1",value:m.value,onInput:A[4]||(A[4]=P=>N("x",P))},null,40,H4),A[11]||(A[11]=T("span",null,"%",-1))]),T("label",null,[A[12]||(A[12]=gt("Y: ",-1)),T("input",{type:"number",min:"-1000",max:"1000",step:"0.1",value:g.value,onInput:A[5]||(A[5]=P=>N("y",P))},null,40,W4),A[13]||(A[13]=T("span",null,"%",-1))])]),i.large?(z(),J(Ce,{key:0},[T("div",z4,[A[14]||(A[14]=T("span",null,[T("span",{class:"pivot-card-icon"},"✥"),gt(" 轴心旋转测试")],-1)),T("span",q4,ye(d.value==="static"?"静止":d.value==="spin"?"自转":"摆动"),1)]),T("div",K4,[T("div",Z4,[T("button",{type:"button",class:Ae({on:d.value==="static"}),onClick:A[6]||(A[6]=P=>d.value="static")},"静止",2),T("button",{type:"button",class:Ae({on:d.value==="spin"}),onClick:A[7]||(A[7]=P=>d.value="spin")},"↻ 自转",2),T("button",{type:"button",class:Ae({on:d.value==="swing"}),onClick:A[8]||(A[8]=P=>d.value="swing")},"⇄ 摆动",2)]),T("div",J4,[i.previewUrl?(z(),J("img",{key:0,src:i.previewUrl,alt:"旋转测试",draggable:"false",class:Ae(d.value),style:Vt(C.value)},null,14,Q4)):xe("",!0)])])],64)):xe("",!0)])])],2))}}),_y=Jt(e5,[["__scopeId","data-v-1261b03a"]]),t5={class:"image-card"},s5={class:"imgrow"},i5=["title"],n5=["src","alt"],r5={key:1,viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"#8a93bb","stroke-width":"1.6"},o5={class:"img-fields"},a5={key:0,class:"row"},l5={class:"row"},c5=["placeholder"],h5={class:"img-actions"},u5=["title"],d5=["disabled"],f5={class:"thumb-note"},m5={key:0,class:"row"},p5={class:"row"},g5={class:"row"},v5={class:"sequence-note"},y5={class:"resource-weight-row"},x5=["disabled","title"],b5={key:0,viewBox:"0 0 24 24","aria-hidden":"true"},w5={key:1,viewBox:"0 0 24 24","aria-hidden":"true"},S5={key:2,class:"pivot-toggle-row"},M5={class:"pivot-toggle-text"},T5=["title"],_5=["title"],C5={class:"pivot-modal",role:"dialog","aria-modal":"true","aria-label":"贴图旋转轴点大图精修"},A5={class:"pivot-modal-head"},E5={class:"pivot-modal-info"},I5={class:"pivot-modal-title"},R5={class:"pivot-modal-badge"},P5={class:"pivot-modal-actions"},Cy="SpineParticle.PivotPanels.v1",k5=Zt({__name:"ImageResourceCard",props:{resource:{},resourceCount:{},defaultFile:{},namePlaceholder:{default:"particle"},showFolder:{type:Boolean,default:!0},supportsSequence:{type:Boolean,default:!1},pivotKey:{}},emits:["pick","pickSequence","reset","remove","updateWeight","toggleLock"],setup(i,{emit:e}){const t=i,s=e,n=De(()=>{var _,E;if(t.resource.imageMode==="sequence"){const F=t.resource.sequenceFrames||[];if(!F.length)return"未选择序列帧";const I=((_=F[0])==null?void 0:_.name)||"第 1 帧",k=((E=F[F.length-1])==null?void 0:E.name)||I;return F.length===1?`1 帧 · ${I}`:`${F.length} 帧 · ${I} → ${k}`}const b=t.resource.textureName||t.defaultFile.replace(/\.[^.]+$/,"");return b.includes(".")?b:`${b}.png`}),r=De(()=>{var b,_;return t.resource.imageMode==="sequence"?((_=(b=t.resource.sequenceFrames)==null?void 0:b[0])==null?void 0:_.previewUrl)||"":t.resource.previewUrl});function o(){try{const b=JSON.parse(sessionStorage.getItem(Cy)||"{}");return b&&typeof b=="object"?b:{}}catch{return{}}}const a=o(),l=De(()=>t.pivotKey||`particle-image:${t.resource.id}`),c=De(()=>typeof t.resource.anchorX=="number"&&typeof t.resource.anchorY=="number"),h=De(()=>Math.abs((t.resource.anchorX??.5)-.5)<1e-4&&Math.abs((t.resource.anchorY??.5)-.5)<1e-4),u=typeof a[l.value]=="boolean",d=Fe(u?a[l.value]:!h.value);cs(d,b=>{a[l.value]=b;try{sessionStorage.setItem(Cy,JSON.stringify(a))}catch{}}),cs(l,b=>{d.value=typeof a[b]=="boolean"?a[b]:!h.value}),cs(()=>h.value,b=>{b||(d.value=!0)},{immediate:!0});const f=Fe(!1),p=Fe(.5),m=Fe(.5),g=De(()=>{const b=((t.resource.anchorX??.5)*100).toFixed(1),_=((t.resource.anchorY??.5)*100).toFixed(1);return d.value?`已开启:X ${b}% | Y ${_}%`:h.value?"未开启,默认围绕图片正中心 (50%, 50%)":`轴点已自定义:X ${b}% | Y ${_}%`});function v(){p.value=t.resource.anchorX??.5,m.value=t.resource.anchorY??.5,f.value=!0}function y(){d.value||(t.resource.anchorX=.5,t.resource.anchorY=.5,f.value=!1)}function x(b){b&&(t.resource.anchorX=p.value,t.resource.anchorY=m.value),f.value=!1}function M(b){b.key==="Escape"&&f.value&&x(!1)}Oi(()=>window.addEventListener("keydown",M)),po(()=>window.removeEventListener("keydown",M));const C=De(()=>{var F,I;const b=t.resource.sequenceFrames||[];if(!b.length)return"未选择序列帧";const _=((F=b[0])==null?void 0:F.name)||"第一张图片",E=((I=b[b.length-1])==null?void 0:I.name)||"最后一张图片";return`已选择 ${b.length} 帧,按 ${_}-${E} 顺序播放`});function w(){t.supportsSequence&&t.resource.imageMode==="sequence"?s("pickSequence",t.resource.id):s("pick",t.resource.id)}return(b,_)=>(z(),J(Ce,null,[T("div",t5,[T("div",s5,[T("button",{class:"img-thumb",title:i.supportsSequence&&i.resource.imageMode==="sequence"?"选择序列帧图片":"选择本地图片",onClick:w},[r.value?(z(),J("img",{key:0,src:r.value,alt:i.resource.textureName},null,8,n5)):(z(),J("svg",r5,[..._[19]||(_[19]=[T("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"},null,-1),T("circle",{cx:"8.5",cy:"8.5",r:"1.6"},null,-1),T("path",{d:"M21 15l-5-5-9 9"},null,-1)])]))],8,i5),T("div",o5,[i.showFolder?(z(),J("label",a5,[_[20]||(_[20]=T("span",null,"子文件夹",-1)),ce(T("input",{"onUpdate:modelValue":_[0]||(_[0]=E=>i.resource.textureFolder=E),type:"text",class:"inp",placeholder:"subfolder/"},null,512),[[je,i.resource.textureFolder]])])):xe("",!0),T("label",l5,[_[21]||(_[21]=T("span",null,"名称",-1)),ce(T("input",{"onUpdate:modelValue":_[1]||(_[1]=E=>i.resource.textureName=E),type:"text",class:"inp",placeholder:i.namePlaceholder},null,8,c5),[[je,i.resource.textureName]])])]),T("div",h5,[T("button",{class:"mini-btn2",title:`恢复 ${i.defaultFile}`,onClick:_[2]||(_[2]=E=>b.$emit("reset",i.resource.id))},"⟳",8,u5),T("button",{class:"mini-btn2",title:"删除图片资源",disabled:i.resourceCount===1,onClick:_[3]||(_[3]=E=>b.$emit("remove",i.resource.id))},"🗑",8,d5)])]),T("div",f5,ye(n.value),1),i.supportsSequence?(z(),J("label",m5,[_[23]||(_[23]=T("span",null,"图片模式",-1)),ce(T("select",{"onUpdate:modelValue":_[4]||(_[4]=E=>i.resource.imageMode=E),class:"inp"},[..._[22]||(_[22]=[T("option",{value:"fixed"},"固定",-1),T("option",{value:"sequence"},"序列帧",-1)])],512),[[_t,i.resource.imageMode]])])):xe("",!0),i.supportsSequence&&i.resource.imageMode==="sequence"?(z(),J(Ce,{key:1},[T("label",p5,[_[25]||(_[25]=T("span",null,"播放模式",-1)),ce(T("select",{"onUpdate:modelValue":_[5]||(_[5]=E=>i.resource.sequencePlayback=E),class:"inp"},[..._[24]||(_[24]=[T("option",{value:"once-hide"},"单次-尾帧消失",-1),T("option",{value:"once-hold"},"单次-尾帧固定",-1),T("option",{value:"loop-forward"},"正向循环",-1),T("option",{value:"loop-reverse"},"反向循环",-1)])],512),[[_t,i.resource.sequencePlayback]])]),T("label",g5,[_[26]||(_[26]=T("span",null,"播放帧率",-1)),ce(T("input",{"onUpdate:modelValue":_[6]||(_[6]=E=>i.resource.sequenceFps=E),type:"number",min:"1",max:"120",step:"1",class:"inp"},null,512),[[je,i.resource.sequenceFps,void 0,{number:!0}]])]),T("button",{class:"sequence-pick",onClick:_[7]||(_[7]=E=>b.$emit("pickSequence",i.resource.id))},"选择序列帧(多选)"),T("div",v5,ye(C.value),1)],64)):xe("",!0),T("div",y5,[be(Oe,{class:"resource-weight-control",label:"占比%",min:0,max:100,step:1,"model-value":i.resource.weight,disabled:i.resource.locked||i.resourceCount===1,"onUpdate:modelValue":_[8]||(_[8]=E=>b.$emit("updateWeight",i.resource.id,E))},null,8,["model-value","disabled"]),T("button",{class:Ae(["weight-lock",{on:i.resource.locked}]),disabled:i.resourceCount===1,title:i.resource.locked?"解除占比锁定":"锁定当前占比",onClick:_[9]||(_[9]=E=>b.$emit("toggleLock",i.resource.id))},[i.resource.locked?(z(),J("svg",b5,[..._[27]||(_[27]=[T("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"},null,-1),T("path",{d:"M8 10V7a4 4 0 0 1 8 0v3"},null,-1)])])):(z(),J("svg",w5,[..._[28]||(_[28]=[T("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"},null,-1),T("path",{d:"M16 10V7a4 4 0 0 0-7.5-2"},null,-1)])]))],10,x5)]),dT(b.$slots,"default",{},void 0),c.value?(z(),J("div",S5,[_[31]||(_[31]=T("div",{class:"pivot-toggle-icon"},"◎",-1)),T("div",M5,[_[29]||(_[29]=T("div",{class:"pivot-toggle-title"},"贴图轴点",-1)),T("div",{class:"pivot-toggle-sub",title:g.value},ye(g.value),9,T5)]),T("label",{class:"pivot-switch",title:d.value?"收起轴点调整":"展开轴点调整"},[ce(T("input",{"onUpdate:modelValue":_[10]||(_[10]=E=>d.value=E),type:"checkbox",onChange:y},null,544),[[yt,d.value]]),_[30]||(_[30]=T("span",{class:"pivot-switch-ui"},null,-1))],8,_5)])):xe("",!0),c.value&&d.value?(z(),At(_y,{key:3,"preview-url":r.value,"anchor-x":i.resource.anchorX??.5,"anchor-y":i.resource.anchorY??.5,"onUpdate:anchorX":_[11]||(_[11]=E=>i.resource.anchorX=E),"onUpdate:anchorY":_[12]||(_[12]=E=>i.resource.anchorY=E),onFullscreen:v},null,8,["preview-url","anchor-x","anchor-y"])):xe("",!0)]),(z(),At(ZM,{to:"body"},[f.value?(z(),J("div",{key:0,class:"pivot-modal-backdrop",onPointerdown:_[18]||(_[18]=Ke(E=>x(!1),["self"]))},[T("div",C5,[T("div",A5,[_[34]||(_[34]=T("div",{class:"pivot-modal-icon"},"◎",-1)),T("div",E5,[T("div",I5,[_[32]||(_[32]=gt(" 贴图旋转轴点大图精修 ",-1)),T("span",R5,ye(i.resource.textureName||i.defaultFile),1)]),_[33]||(_[33]=T("div",{class:"pivot-modal-desc"},"在下方贴图上任意点击或拖拽,精确设置粒子的旋转/摆动中心",-1))]),T("button",{type:"button",class:"pivot-modal-close",title:"关闭",onClick:_[13]||(_[13]=E=>x(!1))},"✕")]),_[35]||(_[35]=T("div",{class:"pivot-modal-hint"},"支持 100% ~ 400% 放大,精确对准尖端或根部:",-1)),be(_y,{large:"","preview-url":r.value,"anchor-x":p.value,"anchor-y":m.value,"onUpdate:anchorX":_[14]||(_[14]=E=>p.value=E),"onUpdate:anchorY":_[15]||(_[15]=E=>m.value=E)},null,8,["preview-url","anchor-x","anchor-y"]),T("div",P5,[T("button",{type:"button",class:"pivot-modal-cancel",onClick:_[16]||(_[16]=E=>x(!1))},"取消"),T("button",{type:"button",class:"pivot-modal-confirm",onClick:_[17]||(_[17]=E=>x(!0))},"确定并保存轴点")])])],32)):xe("",!0)]))],64))}}),XS=Jt(k5,[["__scopeId","data-v-cb3a8e2c"]]),F5={class:"group"},O5={class:"caret"},L5={class:"group-body"},B5={class:"seg"},N5={class:"row"},D5={class:"curve-wrap"},U5={class:"seg"},$5={class:"row"},X5=["value"],V5={value:0},Y5=["value"],G5={class:"render-layer-current"},j5=["title"],H5={key:0,class:"slot-picker"},W5={class:"slot-list"},z5=["onClick"],q5={class:"slot-order"},K5={class:"slot-name"},Z5={class:"slot-attachment"},J5={key:0,class:"modifier-hint"},Q5={class:"seg"},e8={class:"switch-row render-layer-switch"},t8=["disabled"],s8={key:0,class:"modifier-hint"},i8={key:2,class:"modifier-hint render-layer-warning"},n8={class:"look-title image-title"},r8={class:"row resource-color-row"},o8=["onUpdate:modelValue"],a8=["onUpdate:modelValue"],l8={key:0,class:"row resource-color-picker"},c8=["onUpdate:modelValue"],h8=["value","onChange","onKeydown"],u8={key:0,class:"random-color-hint"},d8={class:"resource-alpha-head"},f8={class:"alpha-modes"},m8=["onClick"],p8=["onClick"],g8=["onClick"],v8={class:"row"},y8=["onUpdate:modelValue"],x8={class:"resource-alpha-curve"},b8=Zt({__name:"ParticleAppearanceSection",setup(i){const{resolvedCurveEditorMode:e,sys:t,textureFileInput:s,sequenceFileInput:n,addImageResource:r,openTexturePicker:o,openSequencePicker:a,onTextureFile:l,onSequenceFiles:c,resetTexture:h,setResourceFixedColor:u,commitResourceFixedColor:d,removeImageResource:f,setResourceWeight:p,toggleResourceLock:m,collapsed:g,toggle:v,resetModule:y,select:x,renderLayerSlotPickerOpen:M,renderLayerSlotSearch:C,renderLayerReadySpines:w,renderLayerSpineReady:b,renderLayerFilteredSlots:_,renderLayerSlotLabel:E,renderLayerResolvedLabel:F,renderLayerWarning:I,setRenderLayerSlotMode:k,selectRenderLayerSpine:B,pickRenderLayerSlot:D,clearRenderLayerSlot:X,ALPHA_CURVE:N,RESOURCE_ALPHA_CURVE:U}=Ar();return(A,P)=>(z(),J("div",F5,[T("div",{class:"group-head",onClick:P[1]||(P[1]=O=>R(v)("look"))},[T("span",O5,ye(R(g).look?"▸":"▾"),1),P[19]||(P[19]=T("span",null,"外观与资源",-1)),T("button",{class:"group-reset",title:"重置外观与资源参数",onClick:P[0]||(P[0]=Ke(O=>R(y)("look"),["stop"]))},"重置")]),ce(T("div",L5,[P[36]||(P[36]=T("div",{class:"look-title"},"透明度",-1)),T("div",B5,[T("button",{class:Ae(["seg-btn",{active:R(t).config.alphaMode==="curve"}]),onClick:P[2]||(P[2]=O=>R(t).config.alphaMode="curve")},"曲线",2),T("button",{class:Ae(["seg-btn",{active:R(t).config.alphaMode==="fixed"}]),onClick:P[3]||(P[3]=O=>R(t).config.alphaMode="fixed")},"固定",2)]),R(t).config.alphaMode==="fixed"?(z(),At(Oe,{key:0,label:"透明度",min:0,max:1,step:.01,modelValue:R(t).config.alpha,"onUpdate:modelValue":P[4]||(P[4]=O=>R(t).config.alpha=O)},null,8,["modelValue"])):(z(),J(Ce,{key:1},[T("label",N5,[P[21]||(P[21]=T("span",null,"曲线模式",-1)),ce(T("select",{"onUpdate:modelValue":P[5]||(P[5]=O=>R(t).config.curveMode=O),class:"inp"},[...P[20]||(P[20]=[T("option",null,"跟随导出",-1),T("option",null,"线性",-1),T("option",null,"贝塞尔",-1)])],512),[[_t,R(t).config.curveMode]])]),T("div",D5,[be(Ji,{modelValue:R(t).config.alphaCurve,"onUpdate:modelValue":P[6]||(P[6]=O=>R(t).config.alphaCurve=O),"default-value":R(N),mode:R(e)(R(t).config.curveMode)},null,8,["modelValue","default-value","mode"]),P[22]||(P[22]=T("div",{class:"curve-labels"},[T("span",null,"0(透明)"),T("span",null,"生命周期 →"),T("span",null,"1(不透明)")],-1))])],64)),P[37]||(P[37]=T("div",{class:"look-title"},"渲染层级(Spine 插槽)",-1)),T("div",U5,[T("button",{class:Ae(["seg-btn",{active:R(t).config.renderLayerMode==="top"}]),onClick:P[7]||(P[7]=O=>R(t).config.renderLayerMode="top")},"最上层",2),T("button",{class:Ae(["seg-btn",{active:R(t).config.renderLayerMode==="slot"}]),onClick:P[8]||(P[8]=(...O)=>R(k)&&R(k)(...O))},"Spine 插槽",2)]),R(t).config.renderLayerMode==="slot"?(z(),J(Ce,{key:2},[T("label",$5,[P[23]||(P[23]=T("span",null,"Spine",-1)),T("select",{class:"inp",value:R(t).config.renderLayerSpineId,onChange:P[9]||(P[9]=(...O)=>R(B)&&R(B)(...O))},[T("option",V5,ye(R(w).length?"请选择 Spine":"无可用 Spine"),1),(z(!0),J(Ce,null,Ft(R(w),O=>(z(),J("option",{key:O.id,value:O.id},ye(O.name),9,Y5))),128))],40,X5)]),R(b)?(z(),J(Ce,{key:0},[T("div",G5,[T("span",{class:"render-layer-text",title:R(E)},ye(R(E)||"尚未选择插槽"),9,j5),T("button",{class:"mini-btn",onClick:P[10]||(P[10]=O=>M.value=!R(M))},ye(R(E)?"重新选择":"选择插槽"),1),R(t).config.renderLayerSlotName?(z(),J("button",{key:0,class:"mini-btn ghost",onClick:P[11]||(P[11]=(...O)=>R(X)&&R(X)(...O))},"清除")):xe("",!0)]),R(M)?(z(),J("div",H5,[ce(T("input",{"onUpdate:modelValue":P[12]||(P[12]=O=>Gt(C)?C.value=O:null),class:"inp",type:"search",placeholder:"搜索插槽或附件名称…","aria-label":"搜索插槽"},null,512),[[je,R(C),void 0,{trim:!0}]]),T("div",W5,[(z(!0),J(Ce,null,Ft(R(_),O=>(z(),J("button",{key:O.name,class:Ae(["slot-item",{on:R(t).config.renderLayerSlotName===O.name}]),onClick:L=>R(D)(O)},[T("span",q5,ye(O.order+1),1),T("span",K5,ye(O.name),1),T("span",Z5,ye(O.attachment||"空插槽"),1)],10,z5))),128)),R(_).length?xe("",!0):(z(),J("div",J5,"没有匹配的插槽"))])])):xe("",!0),R(t).config.renderLayerSlotName?(z(),J(Ce,{key:1},[T("div",Q5,[T("button",{class:Ae(["seg-btn",{active:R(t).config.renderLayerSlotPosition==="above"}]),onClick:P[13]||(P[13]=O=>R(t).config.renderLayerSlotPosition="above")},"在此插槽图片之上",2),T("button",{class:Ae(["seg-btn",{active:R(t).config.renderLayerSlotPosition==="below"}]),onClick:P[14]||(P[14]=O=>R(t).config.renderLayerSlotPosition="below")},"在此插槽图片之下",2)]),T("label",e8,[ce(T("input",{"onUpdate:modelValue":P[15]||(P[15]=O=>R(t).config.renderLayerFollowAttachment=O),type:"checkbox",disabled:R(t).config.renderLayerSlotPosition==="below"},null,8,t8),[[yt,R(t).config.renderLayerFollowAttachment]]),P[24]||(P[24]=T("span",{class:"switch-ui"},null,-1)),P[25]||(P[25]=T("span",null,"随插槽附件显隐",-1))]),R(F)?(z(),J("div",s8,ye(R(F)),1)):xe("",!0)],64)):xe("",!0),R(I)?(z(),J("div",i8,ye(R(I)),1)):xe("",!0),P[26]||(P[26]=T("div",{class:"modifier-hint"},"调整显示层级只影响编辑器预览,不影响导出数据。",-1))],64)):xe("",!0)],64)):xe("",!0),T("div",n8,[P[27]||(P[27]=T("span",null,"图片资源",-1)),T("button",{class:"image-add",title:"新增图片资源",onClick:P[16]||(P[16]=(...O)=>R(r)&&R(r)(...O))},"+")]),(z(!0),J(Ce,null,Ft(R(t).config.imageResources,O=>(z(),At(XS,{key:`${R(t).id}:${O.id}`,resource:O,"resource-count":R(t).config.imageResources.length,"pivot-key":`${R(t).id}:${O.id}`,"supports-sequence":"","default-file":"star.png",onPick:R(o),onPickSequence:R(a),onReset:R(h),onRemove:R(f),onUpdateWeight:R(p),onToggleLock:R(m)},{default:qh(()=>[be(Oe,{label:"缩放",min:.1,max:3,step:.05,modelValue:O.scale,"onUpdate:modelValue":L=>O.scale=L},null,8,["modelValue","onUpdate:modelValue"]),P[35]||(P[35]=T("div",{class:"resource-divider"},null,-1)),T("label",r8,[P[30]||(P[30]=T("span",null,"颜色",-1)),ce(T("select",{"onUpdate:modelValue":L=>O.colorMode=L,class:"inp"},[...P[28]||(P[28]=[T("option",{value:"fixed"},"固定色",-1),T("option",{value:"random"},"随机颜色",-1),T("option",{value:"lifetime"},"生命周期",-1)])],8,o8),[[_t,O.colorMode]]),ce(T("select",{"onUpdate:modelValue":L=>O.blend=L,class:"inp blend-select"},[...P[29]||(P[29]=[T("option",{value:"normal"},"正常",-1),T("option",{value:"add"},"相加",-1),T("option",{value:"multiply"},"相乘",-1),T("option",{value:"screen"},"滤色",-1)])],8,a8),[[_t,O.blend]])]),O.colorMode==="fixed"?(z(),J("label",l8,[P[31]||(P[31]=T("span",null,"固定色",-1)),ce(T("input",{type:"color","onUpdate:modelValue":L=>O.colorStart=L,class:"colr"},null,8,c8),[[je,O.colorStart]]),T("input",{type:"text",class:"hex-input",value:O.colorStart,spellcheck:"false","aria-label":"固定颜色值",onChange:L=>R(u)(O,L),onKeydown:yr(L=>R(d)(O,L),["enter"])},null,40,h8)])):(z(),J(Ce,{key:1},[be($S,{modelValue:O.colorGradient,"onUpdate:modelValue":L=>O.colorGradient=L},null,8,["modelValue","onUpdate:modelValue"]),O.colorMode==="random"?(z(),J("div",u8,"每个粒子出生时从色带随机取色,生命周期内保持不变")):xe("",!0)],64)),T("div",d8,[P[32]||(P[32]=T("span",null,"独立透明度",-1)),T("div",f8,[T("button",{class:Ae({on:O.independentAlpha==="off"}),onClick:L=>O.independentAlpha="off"},"关闭",10,m8),T("button",{class:Ae({on:O.independentAlpha==="fixed"}),onClick:L=>O.independentAlpha="fixed"},"固定",10,p8),T("button",{class:Ae({on:O.independentAlpha==="curve"}),onClick:L=>O.independentAlpha="curve"},"曲线",10,g8)])]),O.independentAlpha==="fixed"?(z(),At(Oe,{key:2,label:"透明度",min:0,max:1,step:.01,modelValue:O.alpha,"onUpdate:modelValue":L=>O.alpha=L},null,8,["modelValue","onUpdate:modelValue"])):O.independentAlpha==="curve"?(z(),J(Ce,{key:3},[T("label",v8,[P[34]||(P[34]=T("span",null,"曲线模式",-1)),ce(T("select",{"onUpdate:modelValue":L=>O.alphaCurveMode=L,class:"inp"},[...P[33]||(P[33]=[T("option",null,"跟随导出",-1),T("option",null,"线性",-1),T("option",null,"贝塞尔",-1)])],8,y8),[[_t,O.alphaCurveMode]])]),T("div",x8,[be(Ji,{modelValue:O.alphaCurve,"onUpdate:modelValue":L=>O.alphaCurve=L,"default-value":R(U),mode:R(e)(O.alphaCurveMode)},null,8,["modelValue","onUpdate:modelValue","default-value","mode"])])],64)):xe("",!0)]),_:2},1032,["resource","resource-count","pivot-key","onPick","onPickSequence","onReset","onRemove","onUpdateWeight","onToggleLock"]))),128)),T("input",{ref_key:"textureFileInput",ref:s,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:P[17]||(P[17]=(...O)=>R(l)&&R(l)(...O))},null,544),T("input",{ref_key:"sequenceFileInput",ref:n,class:"file-input",type:"file",multiple:"",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:P[18]||(P[18]=(...O)=>R(c)&&R(c)(...O))},null,544)],512),[[Ss,!R(g).look]])]))}}),w8=Jt(b8,[["__scopeId","data-v-5709815f"]]),S8={class:"group"},M8={class:"caret"},T8={class:"group-body"},_8={class:"modifier-item"},C8={class:"switch-row modifier-switch"},A8={key:0,class:"modifier-params"},E8={class:"modifier-item"},I8={class:"switch-row modifier-switch"},R8={key:0,class:"modifier-params gravity-params"},P8={class:"modifier-mode-row"},k8={class:"modifier-item"},F8={class:"switch-row modifier-switch"},O8={key:0,class:"modifier-params gravity-params"},L8={class:"modifier-mode-row"},B8={class:"modifier-item"},N8={class:"switch-row modifier-switch"},D8={key:0,class:"modifier-params"},U8={class:"row"},$8={class:"switch-row"},X8={class:"modifier-item"},V8={class:"switch-row modifier-switch"},Y8={key:0,class:"modifier-params"},G8={class:"row"},j8={class:"switch-row"},H8={class:"modifier-item"},W8={class:"switch-row modifier-switch"},z8={key:0,class:"modifier-params"},q8={class:"row"},K8={class:"row"},Z8={class:"switch-row"},J8={class:"modifier-item"},Q8={class:"switch-row modifier-switch"},eU={key:0,class:"modifier-params trail-params"},tU={class:"trail-section-head"},sU={class:"row"},iU=["onUpdate:modelValue"],nU={class:"row"},rU=["onUpdate:modelValue"],oU={class:"row"},aU=["onUpdate:modelValue"],lU={class:"switch-row trail-sub-switch"},cU=["onUpdate:modelValue"],hU={class:"switch-row trail-sub-switch"},uU=["onUpdate:modelValue"],dU={class:"trail-mode-head"},fU={class:"alpha-modes"},mU=["onClick"],pU=["onClick"],gU=["onClick"],vU={class:"row"},yU=["onUpdate:modelValue"],xU={key:6,class:"row trail-fixed-color"},bU=["onUpdate:modelValue"],wU=["value","onChange","onKeydown"],SU={class:"trail-mode-head"},MU={class:"alpha-modes"},TU=["onClick"],_U=["onClick"],CU=["onClick"],AU={class:"trail-grid-row"},EU={class:"modifier-item"},IU={class:"switch-row modifier-switch"},RU=["disabled"],PU={key:0,class:"modifier-params emitter-follow-params"},kU={class:"field-block"},FU=["value"],OU={key:0,value:"bone"},LU={class:"field-block"},BU=["value"],NU={class:"field-block"},DU={class:"field-grid follow-grid"},UU={class:"compact-field"},$U={class:"compact-field"},XU={class:"field-block"},VU={key:0,class:"bone-follow-target"},YU={key:1,class:"bone-follow-missing"},GU={class:"field-block"},jU={class:"field-grid follow-grid"},HU={class:"compact-field"},WU={class:"compact-field"},zU={class:"bone-follow-transform-grid"},qU={class:"compact-field"},KU={class:"compact-field"},ZU={class:"compact-field"},JU={class:"modifier-item"},QU={class:"switch-row modifier-switch"},e$={key:0,class:"modifier-params collision-filter-params"},t$={class:"collision-filter-tags"},s$=["title"],i$=["aria-label","onClick"],n$=["disabled","title"],r$={key:0,class:"collision-filter-empty"},o$={key:1,class:"collision-filter-picker"},a$=["onClick"],l$=Zt({__name:"ParticleModifiersSection",setup(i){const{store:e,sys:t,trailTextureFileInput:s,addTrailResource:n,openTrailTexturePicker:r,onTrailRigChange:o,onTrailResourceBoneCountChange:a,onTrailResourceRotationChange:l,onTrailTextureFile:c,resetTrailTexture:h,removeTrailResource:u,setTrailResourceWeight:d,toggleTrailResourceLock:f,setTrailColor:p,commitTrailColor:m,selectedSpineBone:g,boundSpineBone:v,collisionPickerOpen:y,selectedCollisionBodies:x,availableCollisionBodies:M,addCollisionBody:C,removeCollisionBody:w,collapsed:b,toggle:_,onEmitterFollowModeChange:E,bindSelectedBone:F,resetModule:I,select:k,LINEAR_CURVE:B,FLAT_CURVE:D,TRAIL_ALPHA_CURVE:X,TRAIL_SHAPE_CURVE:N}=Ar();return(U,A)=>(z(),J("div",S8,[T("div",{class:"group-head",onClick:A[1]||(A[1]=P=>R(_)("mods"))},[T("span",M8,ye(R(b).mods?"▸":"▾"),1),A[69]||(A[69]=T("span",null,"修改器",-1)),T("button",{class:"group-reset",title:"重置修改器参数",onClick:A[0]||(A[0]=Ke(P=>R(I)("mods"),["stop"]))},"重置")]),ce(T("div",T8,[T("div",_8,[T("label",C8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":A[2]||(A[2]=P=>R(t).config.noise=P)},null,512),[[yt,R(t).config.noise]]),A[70]||(A[70]=T("span",{class:"switch-ui"},null,-1)),A[71]||(A[71]=T("span",null,"开启移动噪声",-1))]),R(t).config.noise?(z(),J("div",A8,[be(Oe,{label:"强度",min:0,max:100,step:1,modelValue:R(t).config.noiseAmt,"onUpdate:modelValue":A[3]||(A[3]=P=>R(t).config.noiseAmt=P)},null,8,["modelValue"]),be(Oe,{label:"波动范围",min:0,max:500,step:1,modelValue:R(t).config.noiseRange,"onUpdate:modelValue":A[4]||(A[4]=P=>R(t).config.noiseRange=P)},null,8,["modelValue"]),be(Oe,{label:"时间流速",min:0,max:10,step:.1,modelValue:R(t).config.noiseSpeed,"onUpdate:modelValue":A[5]||(A[5]=P=>R(t).config.noiseSpeed=P)},null,8,["modelValue"]),A[72]||(A[72]=T("div",{class:"modifier-hint"},"强度控制影响比例 · 波动范围控制最大偏移 · 时间流速控制变化速度",-1))])):xe("",!0)]),T("div",E8,[T("label",I8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":A[6]||(A[6]=P=>R(t).config.useGravity=P)},null,512),[[yt,R(t).config.useGravity]]),A[73]||(A[73]=T("span",{class:"switch-ui"},null,-1)),A[74]||(A[74]=T("span",null,"开启重力",-1))]),R(t).config.useGravity?(z(),J("div",R8,[T("div",P8,[T("button",{class:Ae(["axis-mode",{on:R(t).config.gravityMode==="fixed"}]),onClick:A[7]||(A[7]=P=>R(t).config.gravityMode="fixed")},"固定",2),T("button",{class:Ae(["axis-mode",{on:R(t).config.gravityMode==="random"}]),onClick:A[8]||(A[8]=P=>R(t).config.gravityMode="random")},"随机",2)]),R(t).config.gravityMode==="fixed"?(z(),At(Oe,{key:0,label:"重力强度",min:-3e3,max:3e3,step:10,modelValue:R(t).config.gravityMin,"onUpdate:modelValue":A[9]||(A[9]=P=>R(t).config.gravityMin=P)},null,8,["modelValue"])):(z(),J(Ce,{key:1},[be(Oe,{label:"强度 min",min:-3e3,max:3e3,step:10,modelValue:R(t).config.gravityMin,"onUpdate:modelValue":A[10]||(A[10]=P=>R(t).config.gravityMin=P)},null,8,["modelValue"]),be(Oe,{label:"强度 max",min:-3e3,max:3e3,step:10,modelValue:R(t).config.gravityMax,"onUpdate:modelValue":A[11]||(A[11]=P=>R(t).config.gravityMax=P)},null,8,["modelValue"])],64)),be(Oe,{label:"方向",min:-360,max:360,step:1,modelValue:R(t).config.gravityDirection,"onUpdate:modelValue":A[12]||(A[12]=P=>R(t).config.gravityDirection=P)},null,8,["modelValue"]),A[75]||(A[75]=T("div",{class:"gravity-curve-title"},[T("span",null,"生命周期内重力"),T("span",null,"纵轴:强度 0~1")],-1)),be(Ji,{modelValue:R(t).config.gravityCurve,"onUpdate:modelValue":A[13]||(A[13]=P=>R(t).config.gravityCurve=P),"default-value":R(D)},null,8,["modelValue","default-value"]),A[76]||(A[76]=T("div",{class:"gravity-curve-axis"},[T("span",null,"0"),T("span",null,"生命周期 →"),T("span",null,"1")],-1)),A[77]||(A[77]=T("div",{class:"modifier-hint"},"0° 向右 · -90° 向下 · 负强度会反转方向",-1))])):xe("",!0)]),T("div",k8,[T("label",F8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":A[14]||(A[14]=P=>R(t).config.wind=P)},null,512),[[yt,R(t).config.wind]]),A[78]||(A[78]=T("span",{class:"switch-ui"},null,-1)),A[79]||(A[79]=T("span",null,"开启风力",-1))]),R(t).config.wind?(z(),J("div",O8,[T("div",L8,[T("button",{class:Ae(["axis-mode",{on:R(t).config.windMode==="fixed"}]),onClick:A[15]||(A[15]=P=>R(t).config.windMode="fixed")},"固定",2),T("button",{class:Ae(["axis-mode",{on:R(t).config.windMode==="random"}]),onClick:A[16]||(A[16]=P=>R(t).config.windMode="random")},"随机",2)]),R(t).config.windMode==="fixed"?(z(),At(Oe,{key:0,label:"风力强度",min:-3e3,max:3e3,step:10,modelValue:R(t).config.windMin,"onUpdate:modelValue":A[17]||(A[17]=P=>R(t).config.windMin=P)},null,8,["modelValue"])):(z(),J(Ce,{key:1},[be(Oe,{label:"强度 min",min:-3e3,max:3e3,step:10,modelValue:R(t).config.windMin,"onUpdate:modelValue":A[18]||(A[18]=P=>R(t).config.windMin=P)},null,8,["modelValue"]),be(Oe,{label:"强度 max",min:-3e3,max:3e3,step:10,modelValue:R(t).config.windMax,"onUpdate:modelValue":A[19]||(A[19]=P=>R(t).config.windMax=P)},null,8,["modelValue"])],64)),be(Oe,{label:"方向",min:-360,max:360,step:1,modelValue:R(t).config.windDirection,"onUpdate:modelValue":A[20]||(A[20]=P=>R(t).config.windDirection=P)},null,8,["modelValue"]),A[80]||(A[80]=T("div",{class:"gravity-curve-title"},[T("span",null,"生命周期内风力"),T("span",null,"纵轴:强度 0~1")],-1)),be(Ji,{modelValue:R(t).config.windCurve,"onUpdate:modelValue":A[21]||(A[21]=P=>R(t).config.windCurve=P),"default-value":R(D)},null,8,["modelValue","default-value"]),A[81]||(A[81]=T("div",{class:"gravity-curve-axis"},[T("span",null,"0"),T("span",null,"生命周期 →"),T("span",null,"1")],-1)),A[82]||(A[82]=T("div",{class:"modifier-hint"},"0° 向右 · -90° 向下 · 负强度会反转方向",-1))])):xe("",!0)]),T("div",B8,[T("label",N8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":A[22]||(A[22]=P=>R(t).config.forceField=P)},null,512),[[yt,R(t).config.forceField]]),A[83]||(A[83]=T("span",{class:"switch-ui"},null,-1)),A[84]||(A[84]=T("span",null,"开启力场",-1))]),R(t).config.forceField?(z(),J("div",D8,[be(Oe,{label:"中心 X",min:-5e3,max:5e3,step:1,modelValue:R(t).config.forceCenterX,"onUpdate:modelValue":A[23]||(A[23]=P=>R(t).config.forceCenterX=P)},null,8,["modelValue"]),be(Oe,{label:"中心 Y",min:-5e3,max:5e3,step:1,modelValue:R(t).config.forceCenterY,"onUpdate:modelValue":A[24]||(A[24]=P=>R(t).config.forceCenterY=P)},null,8,["modelValue"]),be(Oe,{label:"力场强度",min:-300,max:300,step:1,modelValue:R(t).config.forceStrength,"onUpdate:modelValue":A[25]||(A[25]=P=>R(t).config.forceStrength=P)},null,8,["modelValue"]),be(Oe,{label:"力场半径",min:1,max:2e3,step:1,modelValue:R(t).config.forceRadius,"onUpdate:modelValue":A[26]||(A[26]=P=>R(t).config.forceRadius=P)},null,8,["modelValue"]),T("label",U8,[A[86]||(A[86]=T("span",null,"衰减模式",-1)),ce(T("select",{"onUpdate:modelValue":A[27]||(A[27]=P=>R(t).config.forceFalloff=P),class:"inp"},[...A[85]||(A[85]=[T("option",{value:"constant"},"恒定(范围内力度不变)",-1),T("option",{value:"linear"},"线性衰减(边缘为 0)",-1),T("option",{value:"inverse"},"距离反比(中心最强)",-1)])],512),[[_t,R(t).config.forceFalloff]])]),A[89]||(A[89]=T("div",{class:"modifier-hint"},"正数吸向中心 · 负数向外排斥 · 可在画布内拖动力场圆",-1)),T("label",$8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":A[28]||(A[28]=P=>R(t).config.showForceFieldShape=P)},null,512),[[yt,R(t).config.showForceFieldShape]]),A[87]||(A[87]=T("span",{class:"switch-ui"},null,-1)),A[88]||(A[88]=T("span",null,"显示形状",-1))])])):xe("",!0)]),T("div",X8,[T("label",V8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":A[29]||(A[29]=P=>R(t).config.vortex=P)},null,512),[[yt,R(t).config.vortex]]),A[90]||(A[90]=T("span",{class:"switch-ui"},null,-1)),A[91]||(A[91]=T("span",null,"开启漩涡",-1))]),R(t).config.vortex?(z(),J("div",Y8,[be(Oe,{label:"中心 X",min:-5e3,max:5e3,step:1,modelValue:R(t).config.vortexCenterX,"onUpdate:modelValue":A[30]||(A[30]=P=>R(t).config.vortexCenterX=P)},null,8,["modelValue"]),be(Oe,{label:"中心 Y",min:-5e3,max:5e3,step:1,modelValue:R(t).config.vortexCenterY,"onUpdate:modelValue":A[31]||(A[31]=P=>R(t).config.vortexCenterY=P)},null,8,["modelValue"]),be(Oe,{label:"力场强度",min:-300,max:300,step:1,modelValue:R(t).config.vortexStrength,"onUpdate:modelValue":A[32]||(A[32]=P=>R(t).config.vortexStrength=P)},null,8,["modelValue"]),be(Oe,{label:"力场半径",min:1,max:2e3,step:1,modelValue:R(t).config.vortexRadius,"onUpdate:modelValue":A[33]||(A[33]=P=>R(t).config.vortexRadius=P)},null,8,["modelValue"]),T("label",G8,[A[93]||(A[93]=T("span",null,"衰减模式",-1)),ce(T("select",{"onUpdate:modelValue":A[34]||(A[34]=P=>R(t).config.vortexFalloff=P),class:"inp"},[...A[92]||(A[92]=[T("option",{value:"constant"},"恒定(范围内力度不变)",-1),T("option",{value:"linear"},"线性衰减(边缘为 0)",-1),T("option",{value:"inverse"},"距离反比(中心最强)",-1)])],512),[[_t,R(t).config.vortexFalloff]])]),A[96]||(A[96]=T("div",{class:"modifier-hint"},"正数逆时针 · 负数顺时针",-1)),T("label",j8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":A[35]||(A[35]=P=>R(t).config.showVortexShape=P)},null,512),[[yt,R(t).config.showVortexShape]]),A[94]||(A[94]=T("span",{class:"switch-ui"},null,-1)),A[95]||(A[95]=T("span",null,"显示形状",-1))])])):xe("",!0)]),T("div",H8,[T("label",W8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":A[36]||(A[36]=P=>R(t).config.attraction=P)},null,512),[[yt,R(t).config.attraction]]),A[97]||(A[97]=T("span",{class:"switch-ui"},null,-1)),A[98]||(A[98]=T("span",null,"开启吸附",-1))]),R(t).config.attraction?(z(),J("div",z8,[be(Oe,{label:"吸附点 X",min:-5e3,max:5e3,step:1,modelValue:R(t).config.attractionCenterX,"onUpdate:modelValue":A[37]||(A[37]=P=>R(t).config.attractionCenterX=P)},null,8,["modelValue"]),be(Oe,{label:"吸附点 Y",min:-5e3,max:5e3,step:1,modelValue:R(t).config.attractionCenterY,"onUpdate:modelValue":A[38]||(A[38]=P=>R(t).config.attractionCenterY=P)},null,8,["modelValue"]),be(Oe,{label:"吸附半径",min:0,max:2e3,step:1,modelValue:R(t).config.attractionRadius,"onUpdate:modelValue":A[39]||(A[39]=P=>R(t).config.attractionRadius=P)},null,8,["modelValue"]),be(Oe,{label:"吸附时长",min:.05,max:30,step:.05,modelValue:R(t).config.attractionDuration,"onUpdate:modelValue":A[40]||(A[40]=P=>R(t).config.attractionDuration=P)},null,8,["modelValue"]),be(Oe,{label:"延迟时间",min:0,max:30,step:.05,modelValue:R(t).config.attractionDelay,"onUpdate:modelValue":A[41]||(A[41]=P=>R(t).config.attractionDelay=P)},null,8,["modelValue"]),T("label",q8,[A[100]||(A[100]=T("span",null,"延迟方式",-1)),ce(T("select",{"onUpdate:modelValue":A[42]||(A[42]=P=>R(t).config.attractionDelayMode=P),class:"inp"},[...A[99]||(A[99]=[T("option",{value:"global"},"统一时间",-1),T("option",{value:"particle"},"单粒子生命",-1)])],512),[[_t,R(t).config.attractionDelayMode]])]),T("label",K8,[A[102]||(A[102]=T("span",null,"吸附方式",-1)),ce(T("select",{"onUpdate:modelValue":A[43]||(A[43]=P=>R(t).config.attractionPath=P),class:"inp"},[...A[101]||(A[101]=[T("option",{value:"linear"},"直线",-1),T("option",{value:"curve"},"曲线",-1)])],512),[[_t,R(t).config.attractionPath]])]),A[105]||(A[105]=T("div",{class:"modifier-hint"},"延迟后从当前位置开始吸附 · 到达红色范围即死亡 · 可在画布内拖动吸附圆",-1)),T("label",Z8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":A[44]||(A[44]=P=>R(t).config.showAttractionShape=P)},null,512),[[yt,R(t).config.showAttractionShape]]),A[103]||(A[103]=T("span",{class:"switch-ui"},null,-1)),A[104]||(A[104]=T("span",null,"显示形状",-1))])])):xe("",!0)]),T("div",J8,[T("label",Q8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":A[45]||(A[45]=P=>R(t).config.trail=P)},null,512),[[yt,R(t).config.trail]]),A[106]||(A[106]=T("span",{class:"switch-ui"},null,-1)),A[107]||(A[107]=T("span",null,"开启拖尾",-1))]),R(t).config.trail?(z(),J("div",eU,[T("div",tU,[A[108]||(A[108]=T("div",{class:"trail-section-title"},"拖尾独立图片",-1)),T("button",{class:"image-add",title:"增加拖尾图片资源",onClick:A[46]||(A[46]=(...P)=>R(n)&&R(n)(...P))},"+")]),(z(!0),J(Ce,null,Ft(R(t).config.trailResources,P=>(z(),At(XS,{key:P.id,resource:P,"resource-count":R(t).config.trailResources.length,"default-file":"trail.png","name-placeholder":"trail","show-folder":!1,onPick:R(r),onReset:R(h),onRemove:R(u),onUpdateWeight:R(d),onToggleLock:R(f)},{default:qh(()=>[A[124]||(A[124]=T("div",{class:"resource-divider"},null,-1)),be(Oe,{label:"旋转",min:-360,max:360,step:1,"model-value":P.rotation,"onUpdate:modelValue":O=>R(l)(P.id,O)},null,8,["model-value","onUpdate:modelValue"]),be(Oe,{label:"拖尾骨骼数",min:2,max:16,step:1,"model-value":P.boneCount,"onUpdate:modelValue":O=>R(a)(P.id,O)},null,8,["model-value","onUpdate:modelValue"]),be(Oe,{label:"拖尾比例 (%)",min:0,max:100,step:1,modelValue:P.trailRatio,"onUpdate:modelValue":O=>P.trailRatio=O},null,8,["modelValue","onUpdate:modelValue"]),T("label",sU,[A[110]||(A[110]=T("span",null,"拖尾长度",-1)),ce(T("select",{"onUpdate:modelValue":O=>P.lengthMode=O,class:"inp"},[...A[109]||(A[109]=[T("option",{value:"fixed"},"固定",-1),T("option",{value:"random"},"随机范围",-1)])],8,iU),[[_t,P.lengthMode]])]),P.lengthMode==="fixed"?(z(),At(Oe,{key:0,label:"长度比例 (%)",min:0,max:500,step:1,modelValue:P.length,"onUpdate:modelValue":O=>P.length=O},null,8,["modelValue","onUpdate:modelValue"])):(z(),J(Ce,{key:1},[be(Oe,{label:"长度最小 (%)",min:0,max:500,step:1,modelValue:P.lengthMin,"onUpdate:modelValue":O=>P.lengthMin=O},null,8,["modelValue","onUpdate:modelValue"]),be(Oe,{label:"长度最大 (%)",min:0,max:500,step:1,modelValue:P.lengthMax,"onUpdate:modelValue":O=>P.lengthMax=O},null,8,["modelValue","onUpdate:modelValue"])],64)),T("label",nU,[A[112]||(A[112]=T("span",null,"拖尾宽度",-1)),ce(T("select",{"onUpdate:modelValue":O=>P.widthSizeMode=O,class:"inp"},[...A[111]||(A[111]=[T("option",{value:"fixed"},"固定",-1),T("option",{value:"random"},"随机范围",-1)])],8,rU),[[_t,P.widthSizeMode]])]),P.widthSizeMode==="fixed"?(z(),At(Oe,{key:2,label:"宽度比例 (%)",min:0,max:500,step:1,modelValue:P.width,"onUpdate:modelValue":O=>P.width=O},null,8,["modelValue","onUpdate:modelValue"])):(z(),J(Ce,{key:3},[be(Oe,{label:"宽度最小 (%)",min:0,max:500,step:1,modelValue:P.widthMin,"onUpdate:modelValue":O=>P.widthMin=O},null,8,["modelValue","onUpdate:modelValue"]),be(Oe,{label:"宽度最大 (%)",min:0,max:500,step:1,modelValue:P.widthMax,"onUpdate:modelValue":O=>P.widthMax=O},null,8,["modelValue","onUpdate:modelValue"])],64)),T("label",oU,[A[114]||(A[114]=T("span",null,"宽度缩放",-1)),ce(T("select",{"onUpdate:modelValue":O=>P.widthMode=O,class:"inp"},[...A[113]||(A[113]=[T("option",{value:"particle"},"跟随粒子",-1),T("option",{value:"fixed"},"固定",-1)])],8,aU),[[_t,P.widthMode]])]),T("label",lU,[ce(T("input",{type:"checkbox","onUpdate:modelValue":O=>P.lifeLengthEnabled=O},null,8,cU),[[yt,P.lifeLengthEnabled]]),A[115]||(A[115]=T("span",{class:"switch-ui"},null,-1)),A[116]||(A[116]=T("span",null,"生命周期长度曲线",-1))]),P.lifeLengthEnabled?(z(),At(Ji,{key:4,modelValue:P.lifeLengthCurve,"onUpdate:modelValue":O=>P.lifeLengthCurve=O,"default-value":R(D)},null,8,["modelValue","onUpdate:modelValue","default-value"])):xe("",!0),T("label",hU,[ce(T("input",{type:"checkbox","onUpdate:modelValue":O=>P.shapeEnabled=O},null,8,uU),[[yt,P.shapeEnabled]]),A[117]||(A[117]=T("span",{class:"switch-ui"},null,-1)),A[118]||(A[118]=T("span",null,"形状曲线(首端 → 尾端宽度)",-1))]),P.shapeEnabled?(z(),At(Ji,{key:5,modelValue:P.shapeCurve,"onUpdate:modelValue":O=>P.shapeCurve=O,"default-value":R(N)},null,8,["modelValue","onUpdate:modelValue","default-value"])):xe("",!0),T("div",dU,[A[119]||(A[119]=T("span",null,"颜色模式",-1)),T("div",fU,[T("button",{class:Ae(["axis-mode",{on:P.colorMode==="particle"}]),onClick:O=>P.colorMode="particle"},"跟随粒子",10,mU),T("button",{class:Ae(["axis-mode",{on:P.colorMode==="fixed"}]),onClick:O=>P.colorMode="fixed"},"固定",10,pU),T("button",{class:Ae(["axis-mode",{on:P.colorMode==="curve"}]),onClick:O=>P.colorMode="curve"},"曲线",10,gU)])]),T("label",vU,[A[121]||(A[121]=T("span",null,"混合模式",-1)),ce(T("select",{"onUpdate:modelValue":O=>P.blend=O,class:"inp"},[...A[120]||(A[120]=[T("option",{value:"normal"},"正常",-1),T("option",{value:"add"},"相加",-1),T("option",{value:"multiply"},"相乘",-1),T("option",{value:"screen"},"滤色",-1)])],8,yU),[[_t,P.blend]])]),P.colorMode==="fixed"?(z(),J("label",xU,[A[122]||(A[122]=T("span",null,"固定颜色",-1)),ce(T("input",{class:"colr",type:"color","onUpdate:modelValue":O=>P.color=O},null,8,bU),[[je,P.color]]),T("input",{class:"hex-input",value:P.color,onChange:O=>R(p)(P,O),onKeydown:yr(Ke(O=>R(m)(P,O),["prevent"]),["enter"])},null,40,wU)])):P.colorMode==="curve"?(z(),At($S,{key:7,modelValue:P.colorGradient,"onUpdate:modelValue":O=>P.colorGradient=O},null,8,["modelValue","onUpdate:modelValue"])):xe("",!0),T("div",SU,[A[123]||(A[123]=T("span",null,"透明度模式",-1)),T("div",MU,[T("button",{class:Ae(["axis-mode",{on:P.alphaMode==="particle"}]),onClick:O=>P.alphaMode="particle"},"跟随粒子",10,TU),T("button",{class:Ae(["axis-mode",{on:P.alphaMode==="fixed"}]),onClick:O=>P.alphaMode="fixed"},"固定",10,_U),T("button",{class:Ae(["axis-mode",{on:P.alphaMode==="curve"}]),onClick:O=>P.alphaMode="curve"},"曲线",10,CU)])]),P.alphaMode==="fixed"?(z(),At(Oe,{key:8,label:"透明度",min:0,max:1,step:.01,modelValue:P.alpha,"onUpdate:modelValue":O=>P.alpha=O},null,8,["modelValue","onUpdate:modelValue"])):xe("",!0),P.alphaMode==="curve"?(z(),At(Ji,{key:9,modelValue:P.alphaCurve,"onUpdate:modelValue":O=>P.alphaCurve=O,"default-value":R(X)},null,8,["modelValue","onUpdate:modelValue","default-value"])):xe("",!0)]),_:2},1032,["resource","resource-count","onPick","onReset","onRemove","onUpdateWeight","onToggleLock"]))),128)),T("input",{ref_key:"trailTextureFileInput",ref:s,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:A[47]||(A[47]=(...P)=>R(c)&&R(c)(...P))},null,544),T("div",AU,[be(Oe,{label:"网格行数",min:2,max:16,step:1,"model-value":R(t).config.trailGridRows,"onUpdate:modelValue":A[48]||(A[48]=P=>R(o)("trailGridRows",P))},null,8,["model-value"]),be(Oe,{label:"网格列数",min:2,max:32,step:1,"model-value":R(t).config.trailGridCols,"onUpdate:modelValue":A[49]||(A[49]=P=>R(o)("trailGridCols",P))},null,8,["model-value"])]),A[125]||(A[125]=T("div",{class:"modifier-hint"},"每个粒子按资源比例生成一组同级拖尾骨骼;随机长度与宽度在粒子出生时确定,相同种子可稳定复现",-1))])):xe("",!0)]),T("div",EU,[T("label",IU,[ce(T("input",{type:"checkbox","onUpdate:modelValue":A[50]||(A[50]=P=>R(t).config.emitterFollow=P),disabled:R(t).config.streamBehavior==="loop"},null,8,RU),[[yt,R(t).config.emitterFollow]]),A[126]||(A[126]=T("span",{class:"switch-ui"},null,-1)),A[127]||(A[127]=T("span",null,"开启发射器跟随",-1))]),R(t).config.emitterFollow&&R(t).config.streamBehavior!=="loop"?(z(),J("div",PU,[T("label",kU,[A[130]||(A[130]=T("span",null,"跟随模式",-1)),T("select",{value:R(t).config.emitterFollowMode,class:"inp",onChange:A[51]||(A[51]=P=>R(E)(P,R(t).config))},[A[128]||(A[128]=T("option",{value:"none"},"无",-1)),A[129]||(A[129]=T("option",{value:"path"},"跟随路径",-1)),R(g)||R(t).config.emitterFollowMode==="bone"?(z(),J("option",OU,"选中的骨骼")):xe("",!0)],40,FU)]),R(t).config.emitterFollowMode==="path"?(z(),J(Ce,{key:0},[T("label",LU,[A[132]||(A[132]=T("span",null,"跟随路径",-1)),ce(T("select",{"onUpdate:modelValue":A[52]||(A[52]=P=>R(t).config.emitterFollowPathId=P),class:"inp"},[A[131]||(A[131]=T("option",{value:0},"无",-1)),(z(!0),J(Ce,null,Ft(R(e).paths,P=>(z(),J("option",{key:P.id,value:P.id},ye(P.name),9,BU))),128))],512),[[_t,R(t).config.emitterFollowPathId,void 0,{number:!0}]])]),T("label",NU,[A[134]||(A[134]=T("span",null,"发射器角度模式",-1)),ce(T("select",{"onUpdate:modelValue":A[53]||(A[53]=P=>R(t).config.emitterAngleMode=P),class:"inp"},[...A[133]||(A[133]=[T("option",{value:"fixed"},"固定角度",-1),T("option",{value:"direction"},"跟随移动方向",-1)])],512),[[_t,R(t).config.emitterAngleMode]])]),A[140]||(A[140]=T("div",{class:"gravity-curve-title"},[T("span",null,"移动进度曲线 (0→1)")],-1)),be(Ji,{modelValue:R(t).config.emitterFollowCurve,"onUpdate:modelValue":A[54]||(A[54]=P=>R(t).config.emitterFollowCurve=P),"default-value":R(B)},null,8,["modelValue","default-value"]),T("div",DU,[T("label",UU,[A[135]||(A[135]=T("span",null,"移动时长 (s)",-1)),ce(T("input",{"onUpdate:modelValue":A[55]||(A[55]=P=>R(t).config.emitterFollowDuration=P),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[je,R(t).config.emitterFollowDuration,void 0,{number:!0}]])]),T("label",$U,[A[137]||(A[137]=T("span",null,"跟随空间",-1)),ce(T("select",{"onUpdate:modelValue":A[56]||(A[56]=P=>R(t).config.emitterFollowSpace=P),class:"inp"},[...A[136]||(A[136]=[T("option",{value:"local"},"局部空间(GEN 移动)",-1),T("option",{value:"world"},"世界空间(粒子生成点移动)",-1)])],512),[[_t,R(t).config.emitterFollowSpace]])])]),T("label",XU,[A[139]||(A[139]=T("span",null,"移动方向",-1)),ce(T("select",{"onUpdate:modelValue":A[57]||(A[57]=P=>R(t).config.emitterFollowDirection=P),class:"inp"},[...A[138]||(A[138]=[T("option",{value:"forward"},"正向(起点 → 终点)",-1),T("option",{value:"reverse"},"反向(终点 → 起点)",-1)])],512),[[_t,R(t).config.emitterFollowDirection]])]),be(Oe,{label:"偏移起始点 (0-1)",min:0,max:1,step:.01,modelValue:R(t).config.emitterFollowOffset,"onUpdate:modelValue":A[58]||(A[58]=P=>R(t).config.emitterFollowOffset=P)},null,8,["modelValue"]),A[141]||(A[141]=T("div",{class:"modifier-hint"},"局部空间会移动整个发射器;世界空间只移动新粒子的生成点,已出生粒子留在世界位置。",-1))],64)):R(t).config.emitterFollowMode==="bone"?(z(),J(Ce,{key:1},[R(v)?(z(),J("div",VU,[A[142]||(A[142]=gt("跟随目标:",-1)),T("strong",null,ye(R(v).spine.name)+" / "+ye(R(v).boneName),1)])):(z(),J("div",YU,"尚未绑定有效骨骼,请先在 Spine 层级树中选择骨骼。")),R(g)&&(!R(v)||R(g).spine.id!==R(v).spine.id||R(g).boneName!==R(v).boneName)?(z(),J("button",{key:2,class:"bone-follow-rebind",onClick:A[59]||(A[59]=P=>R(F)(R(t).config))},ye(R(v)?"重新绑定":"绑定")+"当前选中骨骼:"+ye(R(g).spine.name)+" / "+ye(R(g).boneName),1)):xe("",!0),R(v)?(z(),J(Ce,{key:3},[T("label",GU,[A[144]||(A[144]=T("span",null,"跟随空间",-1)),ce(T("select",{"onUpdate:modelValue":A[60]||(A[60]=P=>R(t).config.emitterFollowSpace=P),class:"inp"},[...A[143]||(A[143]=[T("option",{value:"local"},"本地空间(随骨骼移动)",-1),T("option",{value:"world"},"世界空间(粒子生成后保持位置)",-1)])],512),[[_t,R(t).config.emitterFollowSpace]])]),T("div",jU,[T("label",HU,[A[145]||(A[145]=T("span",null,"位移偏移 X",-1)),ce(T("input",{"onUpdate:modelValue":A[61]||(A[61]=P=>R(t).config.emitterFollowBoneOffsetX=P),type:"number",step:"1",class:"inp"},null,512),[[je,R(t).config.emitterFollowBoneOffsetX,void 0,{number:!0}]])]),T("label",WU,[A[146]||(A[146]=T("span",null,"位移偏移 Y",-1)),ce(T("input",{"onUpdate:modelValue":A[62]||(A[62]=P=>R(t).config.emitterFollowBoneOffsetY=P),type:"number",step:"1",class:"inp"},null,512),[[je,R(t).config.emitterFollowBoneOffsetY,void 0,{number:!0}]])])]),T("div",zU,[T("label",qU,[A[147]||(A[147]=T("span",null,"旋转偏移",-1)),ce(T("input",{"onUpdate:modelValue":A[63]||(A[63]=P=>R(t).config.emitterFollowBoneRotation=P),type:"number",step:"1",class:"inp"},null,512),[[je,R(t).config.emitterFollowBoneRotation,void 0,{number:!0}]])]),T("label",KU,[A[148]||(A[148]=T("span",null,"缩放偏移 X",-1)),ce(T("input",{"onUpdate:modelValue":A[64]||(A[64]=P=>R(t).config.emitterFollowBoneScaleX=P),type:"number",step:"0.05",class:"inp"},null,512),[[je,R(t).config.emitterFollowBoneScaleX,void 0,{number:!0}]])]),T("label",ZU,[A[149]||(A[149]=T("span",null,"缩放偏移 Y",-1)),ce(T("input",{"onUpdate:modelValue":A[65]||(A[65]=P=>R(t).config.emitterFollowBoneScaleY=P),type:"number",step:"0.05",class:"inp"},null,512),[[je,R(t).config.emitterFollowBoneScaleY,void 0,{number:!0}]])])]),A[150]||(A[150]=T("div",{class:"modifier-hint"},"发射器只跟随所选 Spine 骨骼的位置,不继承 Spine 的旋转或缩放;粒子变换使用粒子系统自身参数和上方偏移。",-1))],64)):xe("",!0)],64)):xe("",!0)])):xe("",!0)]),T("div",JU,[T("label",QU,[ce(T("input",{type:"checkbox","onUpdate:modelValue":A[66]||(A[66]=P=>R(t).config.collision=P)},null,512),[[yt,R(t).config.collision]]),A[151]||(A[151]=T("span",{class:"switch-ui"},null,-1)),A[152]||(A[152]=T("span",null,"开启碰撞",-1))]),R(t).config.collision?(z(),J("div",e$,[A[153]||(A[153]=T("div",{class:"collision-filter-title"},"参与的碰撞对象",-1)),T("div",t$,[(z(!0),J(Ce,null,Ft(R(x),P=>(z(),J("span",{key:P.id,class:Ae(["collision-filter-tag",{disabled:!P.enabled}]),title:P.enabled?P.name:`${P.name}(碰撞体已禁用)`},[T("span",null,ye(P.name),1),T("button",{type:"button","aria-label":`清除碰撞对象 ${P.name}`,onClick:O=>R(w)(P.id)},"×",8,i$)],10,s$))),128)),T("button",{type:"button",class:Ae(["collision-filter-add",{active:R(y)}]),disabled:R(M).length===0,title:R(M).length?"加入场景碰撞对象":"没有可加入的碰撞对象",onClick:A[67]||(A[67]=P=>y.value=!R(y))},"+",10,n$)]),R(x).length===0?(z(),J("div",r$,"未选择碰撞对象,当前粒子不会发生碰撞")):xe("",!0),R(y)&&R(M).length?(z(),J("div",o$,[(z(!0),J(Ce,null,Ft(R(M),P=>(z(),J("button",{key:P.id,type:"button",onClick:O=>R(C)(P.id)},[T("span",null,ye(P.name),1),T("small",null,ye(P.enabled?"可用":"已禁用"),1)],8,a$))),128))])):xe("",!0),A[154]||(A[154]=T("div",{class:"modifier-hint"},"只有已加入且启用的场景碰撞对象会参与当前粒子系统的碰撞",-1))])):xe("",!0)]),be(Oe,{label:"阻尼",min:0,max:2,step:.05,modelValue:R(t).config.damping,"onUpdate:modelValue":A[68]||(A[68]=P=>R(t).config.damping=P)},null,8,["modelValue"])],512),[[Ss,!R(b).mods]])]))}}),c$=Jt(l$,[["__scopeId","data-v-96ef634f"]]),h$={class:"group"},u$={class:"caret"},d$={class:"group-body export-settings"},f$={class:"export-field"},m$={class:"export-field"},p$={class:"export-field"},g$={key:0,class:"export-help"},v$={class:"export-fps-row"},y$={class:"export-field export-fps-field"},x$={class:"export-checkbox"},b$={class:"export-switches"},w$={class:"switch-row export-switch"},S$={class:"switch-row export-switch"},M$={class:"switch-row export-switch export-switch-last"},T$=Zt({__name:"ExportSettingsSection",setup(i){const{exportSettings:e,collapsed:t,toggle:s,resetModule:n,normalizeExportFps:r,select:o}=Ar();return(a,l)=>(z(),J("div",h$,[T("div",{class:"group-head",onClick:l[1]||(l[1]=c=>R(s)("export"))},[T("span",u$,ye(R(t).export?"▸":"▾"),1),l[11]||(l[11]=T("span",null,"导出设置",-1)),T("button",{class:"group-reset",title:"重置导出设置",onClick:l[0]||(l[0]=Ke(c=>R(n)("export"),["stop"]))},"重置")]),ce(T("div",d$,[T("label",f$,[l[12]||(l[12]=T("span",null,"图片路径 (Spine Images Path)",-1)),ce(T("input",{"onUpdate:modelValue":l[2]||(l[2]=c=>R(e).imagesPath=c),class:"inp export-input",type:"text",placeholder:"./images/"},null,512),[[je,R(e).imagesPath,void 0,{trim:!0}]])]),T("label",m$,[l[14]||(l[14]=T("span",null,"Spine 版本",-1)),ce(T("select",{"onUpdate:modelValue":l[3]||(l[3]=c=>R(e).spineVersion=c),class:"inp export-input"},[...l[13]||(l[13]=[Qs('',5)])],512),[[_t,R(e).spineVersion]])]),T("label",p$,[l[16]||(l[16]=T("span",null,"关键帧插值曲线",-1)),ce(T("select",{"onUpdate:modelValue":l[4]||(l[4]=c=>R(e).keyframeCurve=c),class:"inp export-input"},[...l[15]||(l[15]=[T("option",{value:"linear"},"线性 (Linear)",-1),T("option",{value:"bezier"},"平滑贝塞尔 (Smooth Bézier)",-1)])],512),[[_t,R(e).keyframeCurve]])]),l[25]||(l[25]=T("div",{class:"export-help"},"平滑贝塞尔会在误差允许范围内拟合连续运动;出生、死亡、附件切换和突变仍使用阶跃关键帧。",-1)),R(e).spineVersion==="3.8"?(z(),J("div",g$,"Spine 3.8 不支持 4.x 的逐通道数组贝塞尔,导出时会转换为经过容差精简的分段线性关键帧。")):xe("",!0),T("div",v$,[T("label",y$,[l[17]||(l[17]=T("span",null,"导出 FPS",-1)),ce(T("input",{"onUpdate:modelValue":l[5]||(l[5]=c=>R(e).fps=c),class:"inp export-input",type:"number",min:"1",max:"240",step:"1",onChange:l[6]||(l[6]=(...c)=>R(r)&&R(r)(...c))},null,544),[[je,R(e).fps,void 0,{number:!0}]])]),T("label",x$,[ce(T("input",{"onUpdate:modelValue":l[7]||(l[7]=c=>R(e).omitFps=c),type:"checkbox"},null,512),[[yt,R(e).omitFps]]),l[18]||(l[18]=gt("不写 fps",-1))])]),l[26]||(l[26]=T("div",{class:"export-help"},"修改 FPS 时保持动画实际秒数不变;“不写 fps”只省略 Spine 的 fps 元数据。",-1)),T("div",b$,[T("label",w$,[ce(T("input",{"onUpdate:modelValue":l[8]||(l[8]=c=>R(e).integerFrameAlignment=c),type:"checkbox"},null,512),[[yt,R(e).integerFrameAlignment]]),l[19]||(l[19]=T("span",{class:"switch-ui"},null,-1)),l[20]||(l[20]=T("span",null,"整数帧对齐",-1))]),T("label",S$,[ce(T("input",{"onUpdate:modelValue":l[9]||(l[9]=c=>R(e).bonePool=c),type:"checkbox"},null,512),[[yt,R(e).bonePool]]),l[21]||(l[21]=T("span",{class:"switch-ui"},null,-1)),l[22]||(l[22]=T("span",null,"骨骼对象池",-1))]),T("label",M$,[ce(T("input",{"onUpdate:modelValue":l[10]||(l[10]=c=>R(e).excludeEmptyAnimations=c),type:"checkbox"},null,512),[[yt,R(e).excludeEmptyAnimations]]),l[23]||(l[23]=T("span",{class:"switch-ui"},null,-1)),l[24]||(l[24]=T("span",null,"排除无内容动画",-1))])])],512),[[Ss,!R(t).export]])]))}}),_$=Jt(T$,[["__scopeId","data-v-04462c7a"]]),C$={class:"spine-export-actions"},A$=["disabled","title"],E$=["disabled"],I$=["disabled","title"],R$={key:0},P$=["href"],k$=["href"],F$=Zt({__name:"ParticleExportFooter",setup(i){const{exportSettings:e,exportBusy:t,exportTarget:s,exportMessage:n,exportError:r,connectorPairUrl:o,connectorStatusText:a,connectorStatusClass:l,connectorReady:c,connectorAuthorizationUrl:h,connectorDisabledReason:u,connectorButtonTitle:d,refreshConnectorHealth:f,exportSpineJson:p,exportSpineProject:m,exportSpineImages:g}=Ar();return(v,y)=>(z(),J(Ce,null,[T("div",C$,[T("button",{type:"button",class:"export-spine-json",disabled:R(t),title:R(t)?"正在重新计算并烘焙动画":`导出 Spine ${R(e).spineVersion} JSON`,onClick:y[0]||(y[0]=(...x)=>R(p)&&R(p)(...x))},ye(R(t)&&R(s)==="json"?"正在准备导出…":"导出Spine Json"),9,A$),T("button",{type:"button",class:"export-spine-images",disabled:R(t),title:"单独下载当前粒子系统使用的图片 ZIP",onClick:y[1]||(y[1]=(...x)=>R(g)&&R(g)(...x))},ye(R(t)&&R(s)==="images"?"正在整理图片…":"导出 images 包"),9,E$),T("button",{type:"button",class:"export-spine-project",disabled:R(t)||!R(c),title:R(d),onClick:y[2]||(y[2]=(...x)=>R(m)&&R(m)(...x))},[T("span",null,ye(R(t)&&R(s)==="spine"?"正在生成工程…":"导出 .spine 包"),1),!R(t)&&R(u)?(z(),J("small",R$,ye(R(u)),1)):xe("",!0)],8,I$)]),T("div",{class:Ae(["connector-status",R(l)])},[y[5]||(y[5]=T("span",{class:"connector-dot"},null,-1)),gt(ye(R(a))+" ",1),R(h)?(z(),J("a",{key:0,href:R(h),target:"_blank",rel:"noopener",title:"在本机连接器中授权当前网站"},"授权当前网站",8,P$)):xe("",!0),T("button",{type:"button",title:"重新检测连接器",onClick:y[3]||(y[3]=(...x)=>R(f)&&R(f)(...x))},"刷新")],2),R(n)?(z(),J("div",{key:0,class:Ae(["export-message",{error:R(r)}])},[gt(ye(R(n))+" ",1),R(o)?(z(),J("a",{key:0,href:R(o),target:"_blank",rel:"noopener",onClick:y[4]||(y[4]=x=>o.value="")},"授权当前网站",8,k$)):xe("",!0)],2)):xe("",!0)],64))}}),O$=Jt(F$,[["__scopeId","data-v-7ff40afe"]]),L$={class:"panel"},B$={class:"panel-scroll"},N$=Zt({__name:"ParticlePanel",setup(i){const{activeObjectType:e,sys:t}=ML();return(s,n)=>(z(),J("div",L$,[n[0]||(n[0]=T("div",{class:"panel-header"},[T("span",null,"Spine粒子编辑器-Yeomai")],-1)),T("div",B$,[be(kL),be(mD),R(e)==="particle"&&R(t)?(z(),J(Ce,{key:0},[be(t4),be(T4),be(w8),be(c$),be(_$)],64)):xe("",!0)]),be(O$)]))}}),D$=Jt(N$,[["__scopeId","data-v-283ef8eb"]]),U$={class:"timeline"},$$={class:"tl-controls"},X$=["title"],V$={class:"tl-range",title:"自定义播放起始帧"},Y$=["max","onKeydown"],G$={class:"tl-range",title:"自定义播放结束帧"},j$=["min","max","onKeydown"],H$=["title"],W$={class:"tl-frame"},z$=["disabled"],q$=["onClick"],K$={key:0},Z$={class:"tl-animation-editor"},J$={key:0,class:"tl-animation-error"},Q$={class:"tl-animation-actions"},eX=["disabled"],tX={key:1,class:"tl-animation-hint"},sX={class:"tl-anim tl-spine-preview"},iX=["value","disabled"],nX={value:""},rX=["value"],oX={class:"tl-zoom"},aX={class:"tl-ticks"},lX={class:"tl-ticklabel"},cX={class:"tl-lanes"},hX=["onPointerdown"],uX={class:"lane-name"},dX=["onPointerdown"],fX=["onPointerdown"],mX=["onPointerdown"],pX={class:"lane-name"},gX={key:0,class:"tl-empty"},vX=Zt({__name:"Timeline",setup(i){const e=yo(),t=Fe(null),s=Fe(null),n=Fe(!1),r=Fe("animation"),o=Fe("");Fo(()=>{(!Array.isArray(e.timeline.animations)||!e.timeline.animations.length)&&(e.timeline.animations=["animation"]),e.timeline.animations.includes(e.timeline.animation)||(e.timeline.animation=e.timeline.animations[0]);for(const H of e.systems)(!H.animation||!e.timeline.animations.includes(H.animation))&&(H.animation=e.timeline.animations[0])});const a=De(()=>e.systems.find(H=>H.id===e.activeId)||null),l=De(()=>{const H=a.value;return!H||!V(H)?null:Sp(H.config,m.value)});function c(){a.value&&(n.value=!n.value,r.value=a.value.animation,o.value="")}function h(H){const G=a.value;G&&(e.setSystemAnimation(G.id,H),r.value=H,o.value="")}function u(){const H=e.addAnimation();r.value=H,o.value=""}function d(){var q;const H=((q=a.value)==null?void 0:q.animation)||e.timeline.animation,G=r.value.trim();if(!G){o.value="动画名称不能为空";return}if(G!==H&&e.timeline.animations.includes(G)){o.value="动画名称不能重复";return}if(!e.renameAnimation(H,G)){o.value="无法修改动画名称";return}r.value=G,o.value=""}function f(){var q,se;const H=((q=a.value)==null?void 0:q.animation)||e.timeline.animation;if(!e.removeAnimation(H)){o.value="至少需要保留一个动画";return}const G=((se=a.value)==null?void 0:se.animation)||e.timeline.animation;r.value=G,o.value=""}function p(H){var G;(G=s.value)!=null&&G.contains(H.target)||(n.value=!1)}Oi(()=>document.addEventListener("pointerdown",p)),po(()=>document.removeEventListener("pointerdown",p));const m=De(()=>Math.max(1,e.timeline.fps||30)),g=Fe(120),v=Fe({}),y=Fe({}),x=Fe({}),M=Fe({}),C=Fe(String(e.timeline.playbackStart)),w=Fe(String(e.timeline.playbackEnd));cs(()=>e.timeline.playbackStart,H=>{C.value=String(H)}),cs(()=>e.timeline.playbackEnd,H=>{w.value=String(H)});const b=De(()=>e.timeline.totalFrames),_=De(()=>g.value<=30?"放大":g.value>=300?"缩小":"适中"),E=De(()=>e.spines.filter(H=>H.selectedAnimation&&H.animations.some(G=>G.name===H.selectedAnimation&&G.duration>0))),F=De(()=>(e.activeObjectType==="spine"?e.spines.find(G=>G.id===e.activeObjectId&&G.animations.length):null)||e.spines.find(G=>G.animations.length)||null);function I(H){const G=F.value;G&&(G.selectedAnimation=H.target.value,e.recalcTotalFrames(),e.timeline.frame=0)}function k(){e.setPlaybackStart(Number(C.value)),C.value=String(e.timeline.playbackStart)}function B(){e.setPlaybackEnd(Number(w.value)),w.value=String(e.timeline.playbackEnd)}function D(){const H=l.value;H&&(e.setPlaybackEnd(H.end),e.setPlaybackStart(H.start))}function X(){var G;const H=((G=t.value)==null?void 0:G.clientWidth)||600;return g.value/H}const N=De(()=>{const H=[],G=g.value;let q=1;g.value<=10?q=1:g.value<=50?q=5:g.value<=200?q=10:g.value<=500?q=50:q=100;for(let se=0;se<=G;se+=q)H.push({f:se,px:se/X()});return H}),U=De(()=>e.timeline.frame/X());function A(H){const G=H.config;return(v.value[H.id]??Math.max(0,Number(G.delay)||0))*m.value/X()}function P(H){const G=H.config,q=Math.max(0,Number(G.lifeMin)||0),se=Math.max(0,Number(G.lifeMax)||0);return G.lifeMode==="fixed"?q:Math.max(q,se)}function O(H){return $(H)}function L(H){if(H.config.mode!=="stream")return 0;if(H.config.streamBehavior==="loop"){const q=H.config;return(x.value[H.id]??pr(q,m.value).loop)/X()}return(y.value[H.id]??Math.max(1/m.value,Number(H.config.duration)||1))*m.value/X()}function $(H){const G=H.config;return G.mode==="stream"&&G.streamBehavior==="loop"?j(H)+L(H)+K(H):L(H)+P(H)*m.value/X()}function V(H){const G=H.config;return G.mode==="stream"&&G.streamBehavior==="loop"}function j(H){return V(H)?pr(H.config,m.value).start/X():0}function K(H){return V(H)?pr(H.config,m.value).end/X():0}function ie(H){var G;return((G=H.animations.find(q=>q.name===H.selectedAnimation))==null?void 0:G.duration)||0}function re(H){return(M.value[H.id]??Math.max(0,Number(H.timeOffset)||0))*m.value/X()}function pe(H){return ie(H)*m.value/X()}function ge(H){const G=H.deltaY<0?.8:1.25;let q=g.value*G;q=Math.min(2e3,Math.max(10,q)),g.value=Math.round(q)}function he(H){const G=t.value;e.pause();const q=ue=>{const ne=G.getBoundingClientRect(),de=Math.floor((ue.clientX-ne.left)/ne.width*g.value);e.timeline.frame=Math.max(0,Math.min(de,b.value-1))};q(H);const se=()=>{window.removeEventListener("pointermove",q),window.removeEventListener("pointerup",se)};window.addEventListener("pointermove",q),window.addEventListener("pointerup",se)}function fe(H,G){H.stopPropagation();const q=H.clientX,se=Math.max(0,Number(G.config.delay)||0),ue=X()/m.value,ne=we=>{const me=(we.clientX-q)*ue,Ue=Math.max(0,Math.min(se+me,600));v.value[G.id]=Math.round(Ue*m.value)/m.value},de=we=>{window.removeEventListener("pointermove",ne),window.removeEventListener("pointerup",le),window.removeEventListener("pointercancel",Re);const me=v.value[G.id];delete v.value[G.id],we&&me!=null&&me!==se&&(G.config.delay=me)},le=()=>de(!0),Re=()=>de(!1);window.addEventListener("pointermove",ne),window.addEventListener("pointerup",le),window.addEventListener("pointercancel",Re)}function Y(H,G){var qe;H.stopPropagation();const q=V(G),se=Math.max(0,Number(G.config.duration)||0),ue=pr(G.config,m.value).loop,ne=X()/m.value,de=((qe=H.currentTarget.closest(".lane-bar"))==null?void 0:qe.getBoundingClientRect().left)??H.clientX,le=j(G);let Re=!1;const we=Ze=>{if(Re=!0,q){const Be=Math.min(1800,Math.max(1,Math.round((Ze.clientX-de-le)/X())));x.value[G.id]=Be}else{const Be=Math.max(1/m.value,Math.min((Ze.clientX-de)*ne,600));y.value[G.id]=Math.round(Be*m.value)/m.value}},me=Ze=>{window.removeEventListener("pointermove",we),window.removeEventListener("pointerup",Ue),window.removeEventListener("pointercancel",Je);const Be=y.value[G.id],Me=x.value[G.id];delete y.value[G.id],delete x.value[G.id],Ze&&Re&&q&&Me!=null&&Me!==ue?G.config.loopDurationFrames=Me:Ze&&Re&&!q&&Be!=null&&Be!==se&&(G.config.duration=Be)},Ue=()=>me(!0),Je=()=>me(!1);window.addEventListener("pointermove",we),window.addEventListener("pointerup",Ue),window.addEventListener("pointercancel",Je)}function W(H,G){H.stopPropagation();const q=H.clientX,se=Math.max(0,Number(G.timeOffset)||0),ue=X()/m.value,ne=we=>{const me=Math.max(0,Math.min(se+(we.clientX-q)*ue,600));M.value[G.id]=Math.round(me*m.value)/m.value},de=we=>{window.removeEventListener("pointermove",ne),window.removeEventListener("pointerup",le),window.removeEventListener("pointercancel",Re);const me=M.value[G.id];delete M.value[G.id],we&&me!=null&&me!==se&&(G.timeOffset=me,e.recalcTotalFrames())},le=()=>de(!0),Re=()=>de(!1);window.addEventListener("pointermove",ne),window.addEventListener("pointerup",le),window.addEventListener("pointercancel",Re)}return(H,G)=>{var q,se,ue;return z(),J("div",U$,[T("div",$$,[T("button",{class:Ae(["tl-btn",{on:R(e).timeline.playing}]),onClick:G[0]||(G[0]=ne=>R(e).togglePlay()),title:R(e).timeline.playing?"暂停 (D)":"播放 (D)"},ye(R(e).timeline.playing?"❚❚":"▶"),11,X$),T("button",{class:"tl-btn",onClick:G[1]||(G[1]=ne=>R(e).toStart()),title:"回到第一帧 (S)"},"⏮"),T("button",{class:"tl-btn",onClick:G[2]||(G[2]=ne=>R(e).previousFrame()),title:"前一帧"},"◀"),T("button",{class:"tl-btn",onClick:G[3]||(G[3]=ne=>R(e).nextFrame()),title:"后一帧"},"▶"),T("button",{class:"tl-btn",onClick:G[4]||(G[4]=ne=>R(e).toEnd()),title:"移动到最后一帧"},"⏭"),T("button",{class:Ae(["tl-btn",{on:R(e).timeline.loop}]),onClick:G[5]||(G[5]=ne=>R(e).toggleLoop()),title:"循环"},"⟳",2),T("label",V$,[G[10]||(G[10]=T("span",null,"A",-1)),ce(T("input",{"onUpdate:modelValue":G[6]||(G[6]=ne=>C.value=ne),type:"number",min:"0",max:Math.max(0,R(e).timeline.playbackEnd-1),"aria-label":"播放起始帧",onChange:k,onKeydown:yr(Ke(k,["prevent"]),["enter"])},null,40,Y$),[[je,C.value]])]),T("label",G$,[G[11]||(G[11]=T("span",null,"B",-1)),ce(T("input",{"onUpdate:modelValue":G[7]||(G[7]=ne=>w.value=ne),type:"number",min:R(e).timeline.playbackStart+1,max:Math.max(1,R(e).timeline.totalFrames-1),"aria-label":"播放结束帧",onChange:B,onKeydown:yr(Ke(B,["prevent"]),["enter"])},null,40,j$),[[je,w.value]])]),l.value?(z(),J("button",{key:0,class:"tl-loop-range",title:`设为闭合自循环范围 ${l.value.start}–${l.value.end}f`,onClick:D},"循环段",8,H$)):xe("",!0),T("span",W$,[G[12]||(G[12]=gt("帧 ",-1)),T("b",null,ye(R(e).timeline.frame),1),G[13]||(G[13]=gt(" / ",-1)),T("b",null,ye(Math.max(0,R(e).timeline.totalFrames-1)),1)]),G[18]||(G[18]=T("span",{class:"tl-legend"},[T("i",{class:"legend-emission"}),gt("持续发射 "),T("i",{class:"legend-life"}),gt("粒子存在 "),T("i",{class:"legend-spine"}),gt("Spine 动画")],-1)),T("div",{ref_key:"animationMenuRef",ref:s,class:"tl-anim tl-owner-animation"},[G[16]||(G[16]=T("span",null,"所属动画",-1)),T("button",{class:"tl-animation-trigger",disabled:!a.value,title:"设置当前粒子系统所属的动画",onClick:Ke(c,["stop"])},[T("span",null,ye(((q=a.value)==null?void 0:q.animation)||R(e).timeline.animation),1),G[14]||(G[14]=T("i",null,"⌄",-1))],8,z$),n.value?(z(),J("div",{key:0,class:"tl-animation-menu",onPointerdown:G[9]||(G[9]=Ke(()=>{},["stop"]))},[G[15]||(G[15]=T("div",{class:"tl-animation-menu-title"},"选择所属动画",-1)),(z(!0),J(Ce,null,Ft(R(e).timeline.animations,ne=>{var de,le;return z(),J("button",{key:ne,class:Ae(["tl-animation-option",{on:((de=a.value)==null?void 0:de.animation)===ne}]),onClick:Re=>h(ne)},[T("span",null,ye(ne),1),((le=a.value)==null?void 0:le.animation)===ne?(z(),J("i",K$,"✓")):xe("",!0)],10,q$)}),128)),T("div",Z$,[ce(T("input",{"onUpdate:modelValue":G[8]||(G[8]=ne=>r.value=ne),class:"tl-animation-name",maxlength:"64","aria-label":"动画名称",onKeydown:yr(d,["enter"])},null,544),[[je,r.value]]),T("button",{title:"重命名当前动画",onClick:d},"重命名")]),o.value?(z(),J("div",J$,ye(o.value),1)):xe("",!0),T("div",Q$,[T("button",{onClick:u},"+ 新增"),T("button",{disabled:R(e).timeline.animations.length<=1,onClick:f},"删除",8,eX)]),R(e).timeline.animations.length<=1?(z(),J("div",tX,"至少需要保留一个动画")):xe("",!0)],32)):xe("",!0)],512),T("label",sX,[G[17]||(G[17]=gt("Spine 预览动画 ",-1)),T("select",{class:"tl-sel",value:((se=F.value)==null?void 0:se.selectedAnimation)||"",disabled:!F.value,onChange:I},[T("option",nX,ye(F.value?"无":"无可用 Spine 动画"),1),(z(!0),J(Ce,null,Ft(((ue=F.value)==null?void 0:ue.animations)||[],ne=>(z(),J("option",{key:ne.name,value:ne.name},ye(ne.name)+"("+ye(ne.duration.toFixed(2))+"s) ",9,rX))),128))],40,iX)]),T("span",oX,ye(_.value),1)]),T("div",{class:"tl-viewport",ref_key:"vpRef",ref:t,onWheel:Ke(ge,["prevent"]),onPointerdown:he},[T("div",aX,[(z(!0),J(Ce,null,Ft(N.value,ne=>(z(),J("div",{key:ne.f,class:"tl-tickline",style:Vt({left:ne.px+"px"})},[T("span",lX,ye(ne.f)+"f",1)],4))),128))]),T("div",{class:"tl-playhead",style:Vt({left:U.value+"px"})},null,4),T("div",cX,[(z(!0),J(Ce,null,Ft(R(e).systems,(ne,de)=>(z(),J("div",{key:ne.id,class:"tl-lane"},[G[19]||(G[19]=T("span",{class:"lane-ico"},"●",-1)),T("div",{class:"lane-bar",style:Vt({left:A(ne)+"px",width:O(ne)+"px"}),onPointerdown:Ke(le=>fe(le,ne),["stop"])},[T("span",uX,ye(ne.config.name||"系统 "+(de+1)),1),T("span",{class:Ae(["bar-life",{"loop-life":V(ne)}]),style:Vt({width:$(ne)+"px"})},null,6),V(ne)?(z(),J(Ce,{key:0},[j(ne)?(z(),J("span",{key:0,class:"bar-loop-transition bar-loop-start",style:Vt({width:j(ne)+"px"})},null,4)):xe("",!0),T("span",{class:"bar-emission bar-loop",style:Vt({left:j(ne)+"px",width:L(ne)+"px"})},[T("span",{class:"bar-handle",title:"拖动循环段时长",onPointerdown:Ke(le=>Y(le,ne),["stop"])},null,40,dX)],4),K(ne)?(z(),J("span",{key:1,class:"bar-loop-transition bar-loop-end",style:Vt({left:j(ne)+L(ne)+"px",width:K(ne)+"px"})},null,4)):xe("",!0)],64)):ne.config.mode==="stream"?(z(),J("span",{key:1,class:"bar-emission",style:Vt({width:L(ne)+"px"})},[T("span",{class:"bar-handle",title:"拖动持续发射时长",onPointerdown:Ke(le=>Y(le,ne),["stop"])},null,40,fX)],4)):xe("",!0)],44,hX)]))),128)),(z(!0),J(Ce,null,Ft(E.value,ne=>(z(),J("div",{key:`spine-${ne.id}`,class:"tl-lane spine-lane"},[G[20]||(G[20]=T("span",{class:"lane-ico spine-ico"},"◆",-1)),T("div",{class:"spine-bar",style:Vt({left:re(ne)+"px",width:pe(ne)+"px"}),title:"拖动调整动画开始时间",onPointerdown:Ke(de=>W(de,ne),["stop"])},[T("span",pX,ye(ne.name)+" · "+ye(ne.selectedAnimation),1)],44,mX)]))),128)),!R(e).systems.length&&!E.value.length?(z(),J("div",gX,"暂无可显示的动画数据")):xe("",!0)])],544)])}}}),yX=Jt(vX,[["__scopeId","data-v-1e581e89"]]),xX={class:"transfer-heading"},bX={key:0},wX={class:"transfer-detail"},SX=Zt({__name:"TransferProgressOverlay",setup(i){const e=Fe(null);return cs(()=>Qt.visible,async t=>{var s;t&&(await zh(),(s=e.value)==null||s.focus({preventScroll:!0}))},{flush:"post"}),(t,s)=>(z(),At(i_,{name:"transfer-fade"},{default:qh(()=>[R(Qt).visible?(z(),J("div",{key:0,ref_key:"overlayElement",ref:e,class:"transfer-overlay",role:"dialog","aria-modal":"true","aria-live":"polite",tabindex:"-1",onPointerdown:s[0]||(s[0]=Ke(()=>{},["stop","prevent"])),onPointerup:s[1]||(s[1]=Ke(()=>{},["stop","prevent"])),onClick:s[2]||(s[2]=Ke(()=>{},["stop","prevent"])),onDblclick:s[3]||(s[3]=Ke(()=>{},["stop","prevent"])),onContextmenu:s[4]||(s[4]=Ke(()=>{},["stop","prevent"])),onWheel:s[5]||(s[5]=Ke(()=>{},["stop","prevent"])),onKeydown:s[6]||(s[6]=Ke(()=>{},["stop","prevent"]))},[T("div",{class:Ae(["transfer-dialog",{failed:R(Qt).failed}])},[T("div",xX,[T("span",null,ye(R(Qt).title),1),R(Qt).indeterminate?xe("",!0):(z(),J("strong",bX,ye(Math.round(R(Qt).progress))+"%",1))]),T("div",{class:Ae(["transfer-track",{indeterminate:R(Qt).indeterminate}])},[T("div",{class:"transfer-bar",style:Vt(R(Qt).indeterminate?void 0:{width:`${R(Qt).progress}%`})},null,4)],2),T("div",wX,ye(R(Qt).detail),1)],2)],544)):xe("",!0)]),_:1}))}}),MX=Jt(SX,[["__scopeId","data-v-592b922e"]]),TX=["inert","aria-hidden"],_X={class:"right"},CX={class:"stage-area"},AX=Zt({__name:"App",setup(i){const e=yo();PR(e);const t=Fe(360),s=Fe(180);function n(o){o.preventDefault();const a=c=>{const h=e.settings.parameterPanelOnRight?window.innerWidth-c.clientX:c.clientX,u=Math.max(240,Math.min(h,window.innerWidth-200));t.value=u},l=()=>{window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",l)};window.addEventListener("pointermove",a),window.addEventListener("pointerup",l)}function r(o){o.preventDefault();const a=o.clientY,l=s.value,c=u=>{const d=Math.max(80,Math.min(l+(a-u.clientY),window.innerHeight-200));s.value=d},h=()=>{window.removeEventListener("pointermove",c),window.removeEventListener("pointerup",h)};window.addEventListener("pointermove",c),window.addEventListener("pointerup",h)}return(o,a)=>(z(),J(Ce,null,[T("div",{class:Ae(["layout",{"panel-right":R(e).settings.parameterPanelOnRight}]),inert:R(Qt).visible?!0:void 0,"aria-hidden":R(Qt).visible?"true":void 0},[T("div",{class:"parameter-panel",style:Vt({width:t.value+"px"})},[be(D$)],4),T("div",{class:"resizer-col",onPointerdown:n},null,32),T("div",_X,[T("div",CX,[be(g3)]),T("div",{class:"resizer-row",onPointerdown:r,title:"拖动调整时间轴高度"},null,32),T("div",{class:"timeline-area",style:Vt({height:s.value+"px"})},[be(yX)],4)])],10,TX),be(MX)],64))}}),EX=Jt(AX,[["__scopeId","data-v-42c4fa00"]]);P_(EX).use(O_()).mount("#app");export{yy as $,rn as A,Fh as B,Et as C,gs as D,ke as E,Gs as F,hn as G,st as H,vt as I,IS as J,Ds as K,ii as L,gi as M,Mr as N,yu as O,nn as P,yl as Q,ha as R,Ci as S,Q3 as T,Ge as U,dy as V,Ii as W,iV as X,KO as Y,Ml as Z,bp as _,ze as a,Pm as a$,vy as a0,lS as a1,kp as a2,tV as a3,Ih as a4,sl as a5,cO as a6,il as a7,xu as a8,Am as a9,Um as aA,$m as aB,Mc as aC,rr as aD,Uc as aE,Em as aF,dS as aG,zt as aH,rS as aI,W6 as aJ,na as aK,gy as aL,Ee as aM,Ve as aN,Rm as aO,$c as aP,gS as aQ,Im as aR,mS as aS,pS as aT,bu as aU,xS as aV,Xc as aW,SS as aX,vS as aY,bS as aZ,MS as a_,wo as aa,Fp as ab,Op as ac,my as ad,Ol as ae,Ll as af,Fl as ag,bo as ah,Fn as ai,q6 as aj,uS as ak,lO as al,da as am,br as an,Np as ao,ES as ap,oO as aq,Sl as ar,Ws as as,py as at,J6 as au,va as av,Dm as aw,Xm as ax,Vm as ay,Ym as az,la as b,Hn as b$,kh as b0,yS as b1,Cr as b2,wS as b3,Lp as b4,J3 as b5,CS as b6,AS as b7,Bp as b8,cn as b9,TS as bA,Dp as bB,vu as bC,RS as bD,km as bE,ms as bF,K3 as bG,tO as bH,zw as bI,Ww as bJ,K6 as bK,Bt as bL,ya as bM,PS as bN,OS as bO,LS as bP,BS as bQ,kS as bR,FS as bS,rO as bT,Up as bU,Mt as bV,Nm as bW,fS as bX,Kw as bY,Zw as bZ,Jw as b_,Z3 as ba,z6 as bb,et as bc,hS as bd,cS as be,oS as bf,aS as bg,lo as bh,Rh as bi,aO as bj,Qw as bk,eS as bl,Vs as bm,tS as bn,ua as bo,_s as bp,qw as bq,Ph as br,sS as bs,iS as bt,nS as bu,xy as bv,Lm as bw,Zr as bx,_S as by,Om as bz,ca as c,Z6 as c0,iO as c1,nO as c2,sO as c3,He as d,Xe as e,Q6 as f,Qe as g,bs as h,lh as i,qs as j,Ut as k,$e as l,ki as m,Ot as n,fp as o,ts as p,xl as q,ir as r,Le as s,pb as t,xp as u,fh as v,Fm as w,qr as x,fy as y,Bm as z}; diff --git a/dist/assets/index-CPXvsWyv.js b/dist/assets/index-CPXvsWyv.js new file mode 100644 index 0000000..ddad8ef --- /dev/null +++ b/dist/assets/index-CPXvsWyv.js @@ -0,0 +1,1239 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-8-FN8Glu.js","assets/index-CT90mgj8.js"])))=>i.map(i=>d[i]); +var oM=Object.defineProperty;var aM=(s,e,t)=>e in s?oM(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var M=(s,e,t)=>aM(s,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(n){const r={};return n.integrity&&(r.integrity=n.integrity),n.referrerPolicy&&(r.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?r.credentials="include":n.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(n){if(n.ep)return;n.ep=!0;const r=t(n);fetch(n.href,r)}})();/** +* @vue/shared v3.5.41 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function qm(s){const e=Object.create(null);for(const t of s.split(","))e[t]=1;return t=>t in e}const Lt={},Ho=[],cn=()=>{},Py=()=>!1,Xh=s=>s.charCodeAt(0)===111&&s.charCodeAt(1)===110&&(s.charCodeAt(2)>122||s.charCodeAt(2)<97),Vh=s=>s.startsWith("onUpdate:"),pi=Object.assign,Km=(s,e)=>{const t=s.indexOf(e);t>-1&&s.splice(t,1)},lM=Object.prototype.hasOwnProperty,Rt=(s,e)=>lM.call(s,e),ze=Array.isArray,Wo=s=>Cl(s)==="[object Map]",pa=s=>Cl(s)==="[object Set]",Gp=s=>Cl(s)==="[object Date]",at=s=>typeof s=="function",Gt=s=>typeof s=="string",rs=s=>typeof s=="symbol",Pt=s=>s!==null&&typeof s=="object",ky=s=>(Pt(s)||at(s))&&at(s.then)&&at(s.catch),Fy=Object.prototype.toString,Cl=s=>Fy.call(s),cM=s=>Cl(s).slice(8,-1),Oy=s=>Cl(s)==="[object Object]",Yh=s=>Gt(s)&&s!=="NaN"&&s[0]!=="-"&&""+parseInt(s,10)===s,za=qm(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Gh=s=>{const e=Object.create(null);return(t=>e[t]||(e[t]=s(t)))},hM=/-\w/g,ks=Gh(s=>s.replace(hM,e=>e.slice(1).toUpperCase())),uM=/\B([A-Z])/g,Ir=Gh(s=>s.replace(uM,"-$1").toLowerCase()),Ly=Gh(s=>s.charAt(0).toUpperCase()+s.slice(1)),Cu=Gh(s=>s?`on${Ly(s)}`:""),sn=(s,e)=>!Object.is(s,e),Ec=(s,...e)=>{for(let t=0;t{Object.defineProperty(s,e,{configurable:!0,enumerable:!1,writable:i,value:t})},jh=s=>{const e=parseFloat(s);return isNaN(e)?s:e},dM=s=>{const e=Gt(s)?Number(s):NaN;return isNaN(e)?s:e};let jp;const Hh=()=>jp||(jp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ot(s){if(ze(s)){const e={};for(let t=0;t{if(t){const i=t.split(mM);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function Ce(s){let e="";if(Gt(s))e=s;else if(ze(s))for(let t=0;tga(t,e))}const Dy=s=>!!(s&&s.__v_isRef===!0),ve=s=>Gt(s)?s:s==null?"":ze(s)||Pt(s)&&(s.toString===Fy||!at(s.toString))?Dy(s)?ve(s.value):JSON.stringify(s,Uy,2):String(s),Uy=(s,e)=>Dy(e)?Uy(s,e.value):Wo(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[i,n],r)=>(t[Eu(i,r)+" =>"]=n,t),{})}:pa(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>Eu(t))}:rs(e)?Eu(e):Pt(e)&&!ze(e)&&!Oy(e)?String(e):e,Eu=(s,e="")=>{var t;return rs(s)?`Symbol(${(t=s.description)!=null?t:e})`:s};/** +* @vue/reactivity v3.5.41 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let di;class $y{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&di&&(di.active?(this.parent=di,this.index=(di.scopes||(di.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){const i=this.scopes.slice();for(e=0,t=i.length;e0&&--this._on===0){if(di===this)di=this.prevScope;else{let e=di;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,i;for(t=0,i=this.effects.length;t0)return;if(Ka){let e=Ka;for(Ka=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let s;for(;qa;){let e=qa;for(qa=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){s||(s=i)}e=t}}if(s)throw s}function Hy(s){for(let e=s.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Wy(s){let e,t=s.depsTail,i=t;for(;i;){const n=i.prevDep;i.version===-1?(i===t&&(t=n),ep(i),wM(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=n}s.deps=e,s.depsTail=t}function Sf(s){for(let e=s.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(zy(e.dep.computed)||e.dep.version!==e.version))return!0;return!!s._dirty}function zy(s){if(s.flags&4&&!(s.flags&16)||(s.flags&=-17,s.globalVersion===ll)||(s.globalVersion=ll,!s.isSSR&&s.flags&128&&(!s.deps&&!s._dirty||!Sf(s))))return;s.flags|=2;const e=s.dep,t=Ut,i=Fs;Ut=s,Fs=!0;try{Hy(s);const n=s.fn(s._value);(e.version===0||sn(n,s._value))&&(s.flags|=128,s._value=n,e.version++)}catch(n){throw e.version++,n}finally{Ut=t,Fs=i,Wy(s),s.flags&=-3}}function ep(s,e=!1){const{dep:t,prevSub:i,nextSub:n}=s;if(i&&(i.nextSub=n,s.prevSub=void 0),n&&(n.prevSub=i,s.nextSub=void 0),t.subs===s&&(t.subs=i,!i&&t.computed)){t.computed.flags&=-5;for(let r=t.computed.deps;r;r=r.nextDep)ep(r,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function wM(s){const{prevDep:e,nextDep:t}=s;e&&(e.nextDep=t,s.prevDep=void 0),t&&(t.prevDep=e,s.nextDep=void 0)}let Fs=!0;const qy=[];function Yn(){qy.push(Fs),Fs=!1}function Gn(){const s=qy.pop();Fs=s===void 0?!0:s}function Hp(s){const{cleanup:e}=s;if(s.cleanup=void 0,e){const t=Ut;Ut=void 0;try{e()}finally{Ut=t}}}let ll=0;class SM{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class tp{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Ut||!Fs||Ut===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Ut)t=this.activeLink=new SM(Ut,this),Ut.deps?(t.prevDep=Ut.depsTail,Ut.depsTail.nextDep=t,Ut.depsTail=t):Ut.deps=Ut.depsTail=t,Ky(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const i=t.nextDep;i.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=i),t.prevDep=Ut.depsTail,t.nextDep=void 0,Ut.depsTail.nextDep=t,Ut.depsTail=t,Ut.deps===t&&(Ut.deps=i)}return t}trigger(e){this.version++,ll++,this.notify(e)}notify(e){Jm();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{Qm()}}}function Ky(s){if(s.dep.sc++,s.sub.flags&4){const e=s.dep.computed;if(e&&!s.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)Ky(i)}const t=s.dep.subs;t!==s&&(s.prevSub=t,t&&(t.nextSub=s)),s.dep.subs=s}}const Gc=new WeakMap,so=Symbol(""),Mf=Symbol(""),cl=Symbol("");function Pi(s,e,t){if(Fs&&Ut){let i=Gc.get(s);i||Gc.set(s,i=new Map);let n=i.get(t);n||(i.set(t,n=new tp),n.map=i,n.key=t),n.track()}}function In(s,e,t,i,n,r){const o=Gc.get(s);if(!o){ll++;return}const a=c=>{c&&c.trigger()};if(Jm(),e==="clear")o.forEach(a);else{const c=ze(s),l=c&&Yh(t);if(c&&t==="length"){const h=Number(i);o.forEach((u,d)=>{(d==="length"||d===cl||!rs(d)&&d>=h)&&a(u)})}else switch((t!==void 0||o.has(void 0))&&a(o.get(t)),l&&a(o.get(cl)),e){case"add":c?l&&a(o.get("length")):(a(o.get(so)),Wo(s)&&a(o.get(Mf)));break;case"delete":c||(a(o.get(so)),Wo(s)&&a(o.get(Mf)));break;case"set":Wo(s)&&a(o.get(so));break}}Qm()}function MM(s,e){const t=Gc.get(s);return t&&t.get(e)}function To(s){const e=Tt(s);return e===s?e:(Pi(e,"iterate",cl),ns(s)?e:e.map(Ds))}function Wh(s){return Pi(s=Tt(s),"iterate",cl),s}function Js(s,e){return jn(s)?aa(Un(s)?Ds(e):e):Ds(e)}const TM={__proto__:null,[Symbol.iterator](){return Iu(this,Symbol.iterator,s=>Js(this,s))},concat(...s){return To(this).concat(...s.map(e=>ze(e)?To(e):e))},entries(){return Iu(this,"entries",s=>(s[1]=Js(this,s[1]),s))},every(s,e){return yn(this,"every",s,e,void 0,arguments)},filter(s,e){return yn(this,"filter",s,e,t=>t.map(i=>Js(this,i)),arguments)},find(s,e){return yn(this,"find",s,e,t=>Js(this,t),arguments)},findIndex(s,e){return yn(this,"findIndex",s,e,void 0,arguments)},findLast(s,e){return yn(this,"findLast",s,e,t=>Js(this,t),arguments)},findLastIndex(s,e){return yn(this,"findLastIndex",s,e,void 0,arguments)},forEach(s,e){return yn(this,"forEach",s,e,void 0,arguments)},includes(...s){return Ru(this,"includes",s)},indexOf(...s){return Ru(this,"indexOf",s)},join(s){return To(this).join(s)},lastIndexOf(...s){return Ru(this,"lastIndexOf",s)},map(s,e){return yn(this,"map",s,e,void 0,arguments)},pop(){return Ea(this,"pop")},push(...s){return Ea(this,"push",s)},reduce(s,...e){return Wp(this,"reduce",s,e)},reduceRight(s,...e){return Wp(this,"reduceRight",s,e)},shift(){return Ea(this,"shift")},some(s,e){return yn(this,"some",s,e,void 0,arguments)},splice(...s){return Ea(this,"splice",s)},toReversed(){return To(this).toReversed()},toSorted(s){return To(this).toSorted(s)},toSpliced(...s){return To(this).toSpliced(...s)},unshift(...s){return Ea(this,"unshift",s)},values(){return Iu(this,"values",s=>Js(this,s))}};function Iu(s,e,t){const i=Wh(s),n=i[e]();return i!==s&&!ns(s)&&(n._next=n.next,n.next=()=>{const r=n._next();return r.done||(r.value=t(r.value)),r}),n}const _M=Array.prototype;function yn(s,e,t,i,n,r){const o=Wh(s),a=o!==s&&!ns(s),c=o[e];if(c!==_M[e]){const u=c.apply(s,r);return a?Ds(u):u}let l=t;o!==s&&(a?l=function(u,d){return t.call(this,Js(s,u),d,s)}:t.length>2&&(l=function(u,d){return t.call(this,u,d,s)}));const h=c.call(o,l,i);return a&&n?n(h):h}function Wp(s,e,t,i){const n=Wh(s),r=n!==s&&!ns(s);let o=t,a=!1;n!==s&&(r?(a=i.length===0,o=function(l,h,u){return a&&(a=!1,l=Js(s,l)),t.call(this,l,Js(s,h),u,s)}):t.length>3&&(o=function(l,h,u){return t.call(this,l,h,u,s)}));const c=n[e](o,...i);return a?Js(s,c):c}function Ru(s,e,t){const i=Tt(s);Pi(i,"iterate",cl);const n=i[e](...t);return(n===-1||n===!1)&&zh(t[0])?(t[0]=Tt(t[0]),i[e](...t)):n}function Ea(s,e,t=[]){Yn(),Jm();const i=Tt(s)[e].apply(s,t);return Qm(),Gn(),i}const CM=qm("__proto__,__v_isRef,__isVue"),Zy=new Set(Object.getOwnPropertyNames(Symbol).filter(s=>s!=="arguments"&&s!=="caller").map(s=>Symbol[s]).filter(rs));function EM(s){rs(s)||(s=String(s));const e=Tt(this);return Pi(e,"has",s),e.hasOwnProperty(s)}class Jy{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){if(t==="__v_skip")return e.__v_skip;const n=this._isReadonly,r=this._isShallow;if(t==="__v_isReactive")return!n;if(t==="__v_isReadonly")return n;if(t==="__v_isShallow")return r;if(t==="__v_raw")return i===(n?r?NM:ix:r?tx:ex).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const o=ze(e);if(!n){let c;if(o&&(c=TM[t]))return c;if(t==="hasOwnProperty")return EM}const a=Reflect.get(e,t,jt(e)?e:i);if((rs(t)?Zy.has(t):CM(t))||(n||Pi(e,"get",t),r))return a;if(jt(a)){const c=o&&Yh(t)?a:a.value;return n&&Pt(c)?_f(c):c}return Pt(a)?n?_f(a):po(a):a}}class Qy extends Jy{constructor(e=!1){super(!1,e)}set(e,t,i,n){let r=e[t];const o=ze(e)&&Yh(t);if(!this._isShallow){const l=jn(r);if(!ns(i)&&!jn(i)&&(r=Tt(r),i=Tt(i)),!o&&jt(r)&&!jt(i))return l||(r.value=i),!0}const a=o?Number(t)s,Vl=s=>Reflect.getPrototypeOf(s);function kM(s,e,t){return function(...i){const n=this.__v_raw,r=Tt(n),o=Wo(r),a=s==="entries"||s===Symbol.iterator&&o,c=s==="keys"&&o,l=n[s](...i),h=t?Tf:e?aa:Ds;return!e&&Pi(r,"iterate",c?Mf:so),pi(Object.create(l),{next(){const{value:u,done:d}=l.next();return d?{value:u,done:d}:{value:a?[h(u[0]),h(u[1])]:h(u),done:d}}})}}function Yl(s){return function(...e){return s==="delete"?!1:s==="clear"?void 0:this}}function FM(s,e){const t={get(n){const r=this.__v_raw,o=Tt(r),a=Tt(n);s||(sn(n,a)&&Pi(o,"get",n),Pi(o,"get",a));const{has:c}=Vl(o),l=e?Tf:s?aa:Ds;if(c.call(o,n))return l(r.get(n));if(c.call(o,a))return l(r.get(a));r!==o&&r.get(n)},get size(){const n=this.__v_raw;return!s&&Pi(Tt(n),"iterate",so),n.size},has(n){const r=this.__v_raw,o=Tt(r),a=Tt(n);return s||(sn(n,a)&&Pi(o,"has",n),Pi(o,"has",a)),n===a?r.has(n):r.has(n)||r.has(a)},forEach(n,r){const o=this,a=o.__v_raw,c=Tt(a),l=e?Tf:s?aa:Ds;return!s&&Pi(c,"iterate",so),a.forEach((h,u)=>n.call(r,l(h),l(u),o))}};return pi(t,s?{add:Yl("add"),set:Yl("set"),delete:Yl("delete"),clear:Yl("clear")}:{add(n){const r=Tt(this),o=Vl(r),a=Tt(n),c=!e&&!ns(n)&&!jn(n)?a:n;return o.has.call(r,c)||sn(n,c)&&o.has.call(r,n)||sn(a,c)&&o.has.call(r,a)||(r.add(c),In(r,"add",c,c)),this},set(n,r){!e&&!ns(r)&&!jn(r)&&(r=Tt(r));const o=Tt(this),{has:a,get:c}=Vl(o);let l=a.call(o,n);l||(n=Tt(n),l=a.call(o,n));const h=c.call(o,n);return o.set(n,r),l?sn(r,h)&&In(o,"set",n,r):In(o,"add",n,r),this},delete(n){const r=Tt(this),{has:o,get:a}=Vl(r);let c=o.call(r,n);c||(n=Tt(n),c=o.call(r,n)),a&&a.call(r,n);const l=r.delete(n);return c&&In(r,"delete",n,void 0),l},clear(){const n=Tt(this),r=n.size!==0,o=n.clear();return r&&In(n,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(n=>{t[n]=kM(n,s,e)}),t}function ip(s,e){const t=FM(s,e);return(i,n,r)=>n==="__v_isReactive"?!s:n==="__v_isReadonly"?s:n==="__v_raw"?i:Reflect.get(Rt(t,n)&&n in i?t:i,n,r)}const OM={get:ip(!1,!1)},LM={get:ip(!1,!0)},BM={get:ip(!0,!1)};const ex=new WeakMap,tx=new WeakMap,ix=new WeakMap,NM=new WeakMap;function DM(s){switch(s){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function po(s){return jn(s)?s:sp(s,!1,IM,OM,ex)}function UM(s){return sp(s,!1,PM,LM,tx)}function _f(s){return sp(s,!0,RM,BM,ix)}function sp(s,e,t,i,n){if(!Pt(s)||s.__v_raw&&!(e&&s.__v_isReactive)||s.__v_skip||!Object.isExtensible(s))return s;const r=n.get(s);if(r)return r;const o=DM(cM(s));if(o===0)return s;const a=new Proxy(s,o===2?i:t);return n.set(s,a),a}function Un(s){return jn(s)?Un(s.__v_raw):!!(s&&s.__v_isReactive)}function jn(s){return!!(s&&s.__v_isReadonly)}function ns(s){return!!(s&&s.__v_isShallow)}function zh(s){return s?!!s.__v_raw:!1}function Tt(s){const e=s&&s.__v_raw;return e?Tt(e):s}function vr(s){return!Rt(s,"__v_skip")&&Object.isExtensible(s)&&By(s,"__v_skip",!0),s}const Ds=s=>Pt(s)?po(s):s,aa=s=>Pt(s)?_f(s):s;function jt(s){return s?s.__v_isRef===!0:!1}function Fe(s){return $M(s,!1)}function $M(s,e){return jt(s)?s:new XM(s,e)}class XM{constructor(e,t){this.dep=new tp,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Tt(e),this._value=t?e:Ds(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||ns(e)||jn(e);e=i?e:Tt(e),sn(e,t)&&(this._rawValue=e,this._value=i?e:Ds(e),this.dep.trigger())}}function I(s){return jt(s)?s.value:s}const VM={get:(s,e,t)=>e==="__v_raw"?s:I(Reflect.get(s,e,t)),set:(s,e,t,i)=>{const n=s[e];return jt(n)&&!jt(t)?(n.value=t,!0):Reflect.set(s,e,t,i)}};function sx(s){return Un(s)?s:new Proxy(s,VM)}function YM(s){const e=ze(s)?new Array(s.length):{};for(const t in s)e[t]=jM(s,t);return e}class GM{constructor(e,t,i){this._object=e,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0,this._key=rs(t)?t:String(t),this._raw=Tt(e);let n=!0,r=e;if(!ze(e)||rs(this._key)||!Yh(this._key))do n=!zh(r)||ns(r);while(n&&(r=r.__v_raw));this._shallow=n}get value(){let e=this._object[this._key];return this._shallow&&(e=I(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&jt(this._raw[this._key])){const t=this._object[this._key];if(jt(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return MM(this._raw,this._key)}}function jM(s,e,t){return new GM(s,e,t)}class HM{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new tp(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ll-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&Ut!==this)return jy(this,!0),!0}get value(){const e=this.dep.track();return zy(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function WM(s,e,t=!1){let i,n;return at(s)?i=s:(i=s.get,n=s.set),new HM(i,n,t)}const Gl={},jc=new WeakMap;let Xr;function zM(s,e=!1,t=Xr){if(t){let i=jc.get(t);i||jc.set(t,i=[]),i.push(s)}}function qM(s,e,t=Lt){const{immediate:i,deep:n,once:r,scheduler:o,augmentJob:a,call:c}=t,l=S=>n?S:ns(S)||n===!1||n===0?Rn(S,1):Rn(S);let h,u,d,f,m=!1,p=!1;if(jt(s)?(u=()=>s.value,m=ns(s)):Un(s)?(u=()=>l(s),m=!0):ze(s)?(p=!0,m=s.some(S=>Un(S)||ns(S)),u=()=>s.map(S=>{if(jt(S))return S.value;if(Un(S))return l(S);if(at(S))return c?c(S,2):S()})):at(s)?e?u=c?()=>c(s,2):s:u=()=>{if(d){Yn();try{d()}finally{Gn()}}const S=Xr;Xr=h;try{return c?c(s,3,[f]):s(f)}finally{Xr=S}}:u=cn,e&&n){const S=u,C=n===!0?1/0:n;u=()=>Rn(S(),C)}const g=Vy(),x=()=>{h.stop(),g&&g.active&&Km(g.effects,h)};if(r&&e){const S=e;e=(...C)=>{const w=S(...C);return x(),w}}let v=p?new Array(s.length).fill(Gl):Gl;const y=S=>{if(!(!(h.flags&1)||!h.dirty&&!S))if(e){const C=h.run();if(S||n||m||(p?C.some((w,b)=>sn(w,v[b])):sn(C,v))){d&&d();const w=Xr;Xr=h;try{const b=[C,v===Gl?void 0:p&&v[0]===Gl?[]:v,f];v=C,c?c(e,3,b):e(...b)}finally{Xr=w}}}else h.run()};return a&&a(y),h=new Yy(u),h.scheduler=o?()=>o(y,!1):y,f=S=>zM(S,!1,h),d=h.onStop=()=>{const S=jc.get(h);if(S){if(c)c(S,4);else for(const C of S)C();jc.delete(h)}},e?i?y(!0):v=h.run():o?o(y.bind(null,!0),!0):h.run(),x.pause=h.pause.bind(h),x.resume=h.resume.bind(h),x.stop=x,x}function Rn(s,e=1/0,t){if(e<=0||!Pt(s)||s.__v_skip||(t=t||new Map,(t.get(s)||0)>=e))return s;if(t.set(s,e),e--,jt(s))Rn(s.value,e,t);else if(ze(s))for(let i=0;i{Rn(i,e,t)});else if(Oy(s)){for(const i in s)Rn(s[i],e,t);for(const i of Object.getOwnPropertySymbols(s))Object.prototype.propertyIsEnumerable.call(s,i)&&Rn(s[i],e,t)}return s}/** +* @vue/runtime-core v3.5.41 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function El(s,e,t,i){try{return i?s(...i):s()}catch(n){qh(n,e,t)}}function gs(s,e,t,i){if(at(s)){const n=El(s,e,t,i);return n&&ky(n)&&n.catch(r=>{qh(r,e,t)}),n}if(ze(s)){const n=[];for(let r=0;r>>1,n=Ui[i],r=hl(n);r=hl(t)?Ui.push(s):Ui.splice(ZM(e),0,s),s.flags|=1,rx()}}function rx(){Hc||(Hc=nx.then(ax))}function JM(s){if(!ze(s))lr&&s.id===-1?lr.splice(Oo+1,0,s):s.flags&1||(zo.push(s),s.flags|=1);else for(let e=0;ehl(t)-hl(i));if(zo.length=0,lr){for(let t=0;ts.id==null?s.flags&2?-1:1/0:s.id;function ax(s){try{for(Ws=0;Ws{i._d&&Zc(-1);const r=Wc(e),o=$n.length;let a;try{a=s(...n)}finally{for(let c=$n.length;c>o;c--)cp();Wc(r),i._d&&Zc(1)}return a};return i._n=!0,i._c=!0,i._d=!0,i}function ce(s,e){if(Oi===null)return s;const t=su(Oi),i=s.dirs||(s.dirs=[]);for(let n=0;n1)return t&&at(e)?e.call(i&&i.proxy):e}}function QM(){return!!(hp()||no)}const eT=Symbol.for("v-scx"),tT=()=>qo(eT);function Lo(s,e){return rp(s,null,e)}function ai(s,e,t){return rp(s,e,t)}function rp(s,e,t=Lt){const{immediate:i,deep:n,flush:r,once:o}=t,a=pi({},t),c=e&&i||!e&&r!=="post";let l;if(pl){if(r==="sync"){const f=tT();l=f.__watcherHandles||(f.__watcherHandles=[])}else if(!c){const f=()=>{};return f.stop=cn,f.resume=cn,f.pause=cn,f}}const h=$i;a.call=(f,m,p)=>gs(f,h,m,p);let u=!1;r==="post"?a.scheduler=f=>{Bi(f,h&&h.suspense)}:r!=="sync"&&(u=!0,a.scheduler=(f,m)=>{m?f():np(f)}),a.augmentJob=f=>{e&&(f.flags|=4),u&&(f.flags|=2,h&&(f.id=h.uid,f.i=h))};const d=qM(s,e,a);return pl&&(l?l.push(d):c&&d()),d}function iT(s,e,t){const i=this.proxy,n=Gt(s)?s.includes(".")?hx(i,s):()=>i[s]:s.bind(i,i);let r;at(e)?r=e:(r=e.handler,t=e);const o=Il(this),a=rp(n,r.bind(i),t);return o(),a}function hx(s,e){const t=e.split(".");return()=>{let i=s;for(let n=0;ns.__isTeleport,Wr=s=>s&&(s.disabled||s.disabled===""),sT=s=>s&&(s.defer||s.defer===""),qp=s=>typeof SVGElement<"u"&&s instanceof SVGElement,Kp=s=>typeof MathMLElement=="function"&&s instanceof MathMLElement,Cf=(s,e)=>{const t=s&&s.to;return Gt(t)?e?e(t):null:t},nT={name:"Teleport",__isTeleport:!0,process(s,e,t,i,n,r,o,a,c,l){const{mc:h,pc:u,pbc:d,o:{insert:f,querySelector:m,createText:p,createComment:g,parentNode:x}}=l,v=Wr(e.props);let{dynamicChildren:y}=e;const S=(b,_,A)=>{b.shapeFlag&16&&h(b.children,_,A,n,r,o,a,c)},C=(b=e)=>{const _=Wr(b.props),A=b.target=Cf(b.props,m),P=Ef(A,b,p,f);A&&(o!=="svg"&&qp(A)?o="svg":o!=="mathml"&&Kp(A)&&(o="mathml"),n&&n.isCE&&(n.ce._teleportTargets||(n.ce._teleportTargets=new Set)).add(A),_||(S(b,A,P),Na(b,!1)))},w=b=>{const _=()=>{if(sr.get(b)===_){if(sr.delete(b),Wr(b.props)){const A=x(b.el)||t;S(b,A,b.anchor),Na(b,!0)}C(b)}};sr.set(b,_),Bi(_,r)};if(s==null){const b=e.el=p(""),_=e.anchor=p("");if(f(b,t,i),f(_,t,i),sT(e.props)||r&&r.pendingBranch){w(e);return}v&&(S(e,t,_),Na(e,!0)),C()}else{e.el=s.el;const b=e.anchor=s.anchor,_=sr.get(s);if(_){_.flags|=8,sr.delete(s),w(e);return}e.targetStart=s.targetStart;const A=e.target=s.target,P=e.targetAnchor=s.targetAnchor,E=Wr(s.props),R=E?t:A,O=E?b:P;if(o==="svg"||qp(A)?o="svg":(o==="mathml"||Kp(A))&&(o="mathml"),y?(d(s.dynamicChildren,y,R,n,r,o,a),lp(s,e,!0)):c||u(s,e,R,O,n,r,o,a,!1),v)E?e.props&&s.props&&e.props.to!==s.props.to&&(e.props.to=s.props.to):jl(e,t,b,l,1);else if((e.props&&e.props.to)!==(s.props&&s.props.to)){const U=Cf(e.props,m);U&&(e.target=U,jl(e,U,null,l,0))}else E&&jl(e,A,P,l,1);Na(e,v)}},remove(s,e,t,{um:i,o:{remove:n}},r){const{shapeFlag:o,children:a,anchor:c,targetStart:l,targetAnchor:h,target:u,props:d}=s,f=Wr(d),m=r||!f,p=sr.get(s);if(p&&(p.flags|=8,sr.delete(s)),u&&(n(l),n(h)),r&&n(c),!p&&(f||u)&&o&16)for(let g=0;g{s.isMounted=!0}),Rr(()=>{s.isUnmounting=!0}),s}const as=[Function,Array],fx={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:as,onEnter:as,onAfterEnter:as,onEnterCancelled:as,onBeforeLeave:as,onLeave:as,onAfterLeave:as,onLeaveCancelled:as,onBeforeAppear:as,onAppear:as,onAfterAppear:as,onAppearCancelled:as},mx=s=>{const e=s.subTree;return e.component?mx(e.component):e},aT={name:"BaseTransition",props:fx,setup(s,{slots:e}){const t=hp(),i=oT();return()=>{const n=e.default&&vx(e.default(),!0),r=n&&n.length?px(n):t.subTree?xe():void 0;if(!r)return;const o=Tt(s),{mode:a}=o;if(i.isLeaving)return Pu(r);const c=zc(r);if(!c)return Pu(r);let l=Af(c,o,i,t,u=>l=u);c.type!==Fi&&ul(c,l);let h=t.subTree&&zc(t.subTree);if(h&&h.type!==Fi&&!zr(h,c)&&mx(t).type!==Fi){let u=Af(h,o,i,t);if(ul(h,u),a==="out-in"&&c.type!==Fi)return i.isLeaving=!0,u.afterLeave=()=>{i.isLeaving=!1,t.job.flags&8||t.update(),delete u.afterLeave,h=void 0},Pu(r);a==="in-out"&&c.type!==Fi?u.delayLeave=(d,f,m)=>{const p=gx(i,h);p[String(h.key)]=h,d[us]=()=>{f(),d[us]=void 0,delete l.delayedLeave,h=void 0},l.delayedLeave=()=>{m(),delete l.delayedLeave,h=void 0}}:h=void 0}else h&&(h=void 0);return r}}};function px(s){let e=s[0];if(s.length>1){for(const t of s)if(t.type!==Fi){e=t;break}}return e}const lT=aT;function gx(s,e){const{leavingVNodes:t}=s;let i=t.get(e.type);return i||(i=Object.create(null),t.set(e.type,i)),i}function Af(s,e,t,i,n){const{appear:r,mode:o,persisted:a=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:h,onEnterCancelled:u,onBeforeLeave:d,onLeave:f,onAfterLeave:m,onLeaveCancelled:p,onBeforeAppear:g,onAppear:x,onAfterAppear:v,onAppearCancelled:y}=e,S=String(s.key),C=gx(t,s),w=(A,P)=>{A&&gs(A,i,9,P)},b=(A,P)=>{const E=P[1];w(A,P),ze(A)?A.every(R=>R.length<=1)&&E():A.length<=1&&E()},_={mode:o,persisted:a,beforeEnter(A){let P=c;if(!t.isMounted)if(r)P=g||c;else return;A[us]&&A[us](!0);const E=C[S];E&&zr(s,E)&&E.el[us]&&E.el[us](),w(P,[A])},enter(A){if(C[S]===s)return;let P=l,E=h,R=u;if(!t.isMounted)if(r)P=x||l,E=v||h,R=y||u;else return;let O=!1;A[Aa]=Y=>{O||(O=!0,Y?w(R,[A]):w(E,[A]),_.delayedLeave&&_.delayedLeave(),A[Aa]=void 0)};const U=A[Aa].bind(null,!1);P?b(P,[A,U]):U()},leave(A,P){const E=String(s.key);if(A[Aa]&&A[Aa](!0),t.isUnmounting)return P();w(d,[A]);let R=!1;A[us]=U=>{R||(R=!0,P(),U?w(p,[A]):w(m,[A]),A[us]=void 0,C[E]===s&&delete C[E])};const O=A[us].bind(null,!1);C[E]=s,f?b(f,[A,O]):O()},clone(A){const P=Af(A,e,t,i,n);return n&&n(P),P}};return _}function Pu(s){if(Qh(s))return s=Cr(s),s.children=null,s}function zc(s){if(!Qh(s))return Jh(s.type)&&s.children?px(s.children):s;if(s.component)return s.component.subTree;const{shapeFlag:e,children:t}=s;if(t){if(e&16)return t[0];if(e&32&&at(t.default))return t.default()}}function ul(s,e){if(s.shapeFlag&6&&s.component){s.transition=e;const t=s.component.subTree;ul(Jh(t.type)&&zc(t)||t,e)}else s.shapeFlag&128?(s.ssContent.transition=e.clone(s.ssContent),s.ssFallback.transition=e.clone(s.ssFallback)):s.transition=e}function vx(s,e=!1,t){let i=[],n=0;for(let r=0;r1)for(let r=0;rZa(p,e&&(ze(e)?e[g]:e),t,i,n));return}if(Ko(i)&&!n){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&Za(s,e,t,i.component.subTree);return}const r=i.shapeFlag&4?su(i.component):i.el,o=n?null:r,{i:a,r:c}=s,l=e&&e.r,h=a.refs===Lt?a.refs={}:a.refs,u=a.setupState,d=Tt(u),f=u===Lt?Py:p=>Zp(h,p)?!1:Rt(d,p),m=(p,g)=>!(g&&Zp(h,g));if(l!=null&&l!==c){if(Jp(e),Gt(l))h[l]=null,f(l)&&(u[l]=null);else if(jt(l)){const p=e;m(l,p.k)&&(l.value=null),p.k&&(h[p.k]=null)}}if(at(c))El(c,a,12,[o,h]);else{const p=Gt(c),g=jt(c);if(p||g){const x=()=>{if(s.f){const v=p?f(c)?u[c]:h[c]:m()||!s.k?c.value:h[s.k];if(n)ze(v)&&Km(v,r);else if(ze(v))v.includes(r)||v.push(r);else if(p)h[c]=[r],f(c)&&(u[c]=h[c]);else{const y=[r];m(c,s.k)&&(c.value=y),s.k&&(h[s.k]=y)}}else p?(h[c]=o,f(c)&&(u[c]=o)):g&&(m(c,s.k)&&(c.value=o),s.k&&(h[s.k]=o))};if(o){const v=()=>{x(),qc.delete(s)};v.id=-1,qc.set(s,v),Bi(v,t)}else Jp(s),x()}}}function Jp(s){const e=qc.get(s);e&&(e.flags|=8,qc.delete(s))}Hh().requestIdleCallback;Hh().cancelIdleCallback;const Ko=s=>!!s.type.__asyncLoader,Qh=s=>s.type.__isKeepAlive;function cT(s,e){xx(s,"a",e)}function hT(s,e){xx(s,"da",e)}function xx(s,e,t=$i){const i=s.__wdc||(s.__wdc=()=>{let n=t;for(;n;){if(n.isDeactivated)return;n=n.parent}return s()});if(eu(e,i,t),t){let n=t.parent;for(;n&&n.parent;)Qh(n.parent.vnode)&&uT(i,e,t,n),n=n.parent}}function uT(s,e,t,i){const n=eu(e,s,i,!0);Al(()=>{Km(i[e],n)},t)}function eu(s,e,t=$i,i=!1){if(t){const n=t[s]||(t[s]=[]),r=e.__weh||(e.__weh=(...o)=>{Yn();const a=Il(t),c=gs(e,t,s,o);return a(),Gn(),c});return i?n.unshift(r):n.push(r),r}}const Kn=s=>(e,t=$i)=>{(!pl||s==="sp")&&eu(s,(...i)=>e(...i),t)},dT=Kn("bm"),ys=Kn("m"),fT=Kn("bu"),mT=Kn("u"),Rr=Kn("bum"),Al=Kn("um"),pT=Kn("sp"),gT=Kn("rtg"),vT=Kn("rtc");function yT(s,e=$i){eu("ec",s,e)}const xT=Symbol.for("v-ndc");function Et(s,e,t,i){let n;const r=t,o=ze(s);if(o||Gt(s)){const a=o&&Un(s);let c=!1,l=!1;a&&(c=!ns(s),l=jn(s),s=Wh(s)),n=new Array(s.length);for(let h=0,u=s.length;he(a,c,void 0,r));else{const a=Object.keys(s);n=new Array(a.length);for(let c=0,l=a.length;c0;return q(),Ct(_e,null,[we("slot",l,i)],h?-2:64)}let o=s[e];o&&o._c&&(o._d=!1);const a=$n.length;q();let c;try{const l=o&&bx(o(t)),h=t.key||r||l&&l.key;c=Ct(_e,{key:(h&&!rs(h)?h:`_${e}`)+(!l&&i?"_fb":"")},l||(i?i():[]),l&&s._===1?64:-2)}catch(l){for(let h=$n.length;h>a;h--)cp();throw l}finally{o&&o._c&&(o._d=!0)}return c}function bx(s){return s.some(e=>fl(e)?!(e.type===Fi||e.type===_e&&!bx(e.children)):!0)?s:null}const If=s=>s?Ux(s)?su(s):If(s.parent):null,Ja=pi(Object.create(null),{$:s=>s,$el:s=>s.vnode.el,$data:s=>s.data,$props:s=>s.props,$attrs:s=>s.attrs,$slots:s=>s.slots,$refs:s=>s.refs,$parent:s=>If(s.parent),$root:s=>If(s.root),$host:s=>s.ce,$emit:s=>s.emit,$options:s=>Sx(s),$forceUpdate:s=>s.f||(s.f=()=>{np(s.update)}),$nextTick:s=>s.n||(s.n=Kh.bind(s.proxy)),$watch:s=>iT.bind(s)}),ku=(s,e)=>s!==Lt&&!s.__isScriptSetup&&Rt(s,e),wT={get({_:s},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:i,data:n,props:r,accessCache:o,type:a,appContext:c}=s;if(e[0]!=="$"){const d=o[e];if(d!==void 0)switch(d){case 1:return i[e];case 2:return n[e];case 4:return t[e];case 3:return r[e]}else{if(ku(i,e))return o[e]=1,i[e];if(n!==Lt&&Rt(n,e))return o[e]=2,n[e];if(Rt(r,e))return o[e]=3,r[e];if(t!==Lt&&Rt(t,e))return o[e]=4,t[e];Rf&&(o[e]=0)}}const l=Ja[e];let h,u;if(l)return e==="$attrs"&&Pi(s.attrs,"get",""),l(s);if((h=a.__cssModules)&&(h=h[e]))return h;if(t!==Lt&&Rt(t,e))return o[e]=4,t[e];if(u=c.config.globalProperties,Rt(u,e))return u[e]},set({_:s},e,t){const{data:i,setupState:n,ctx:r}=s;return ku(n,e)?(n[e]=t,!0):i!==Lt&&Rt(i,e)?(i[e]=t,!0):Rt(s.props,e)||e[0]==="$"&&e.slice(1)in s?!1:(r[e]=t,!0)},has({_:{data:s,setupState:e,accessCache:t,ctx:i,appContext:n,props:r,type:o}},a){let c;return!!(t[a]||s!==Lt&&a[0]!=="$"&&Rt(s,a)||ku(e,a)||Rt(r,a)||Rt(i,a)||Rt(Ja,a)||Rt(n.config.globalProperties,a)||(c=o.__cssModules)&&c[a])},defineProperty(s,e,t){return t.get!=null?s._.accessCache[e]=0:Rt(t,"value")&&this.set(s,e,t.value,null),Reflect.defineProperty(s,e,t)}};function Qp(s){return ze(s)?s.reduce((e,t)=>(e[t]=null,e),{}):s}let Rf=!0;function ST(s){const e=Sx(s),t=s.proxy,i=s.ctx;Rf=!1,e.beforeCreate&&eg(e.beforeCreate,s,"bc");const{data:n,computed:r,methods:o,watch:a,provide:c,inject:l,created:h,beforeMount:u,mounted:d,beforeUpdate:f,updated:m,activated:p,deactivated:g,beforeDestroy:x,beforeUnmount:v,destroyed:y,unmounted:S,render:C,renderTracked:w,renderTriggered:b,errorCaptured:_,serverPrefetch:A,expose:P,inheritAttrs:E,components:R,directives:O,filters:U}=e;if(l&&MT(l,i,null),o)for(const X in o){const D=o[X];at(D)&&(i[X]=D.bind(t))}if(n){const X=n.call(t,t);Pt(X)&&(s.data=po(X))}if(Rf=!0,r)for(const X in r){const D=r[X],F=at(D)?D.bind(t,t):at(D.get)?D.get.bind(t,t):cn,N=!at(D)&&at(D.set)?D.set.bind(t):cn,k=Le({get:F,set:N});Object.defineProperty(i,X,{enumerable:!0,configurable:!0,get:()=>k.value,set:V=>k.value=V})}if(a)for(const X in a)wx(a[X],i,t,X);if(c){const X=at(c)?c.call(t):c;Reflect.ownKeys(X).forEach(D=>{cx(D,X[D])})}h&&eg(h,s,"c");function $(X,D){ze(D)?D.forEach(F=>X(F.bind(t))):D&&X(D.bind(t))}if($(dT,u),$(ys,d),$(fT,f),$(mT,m),$(cT,p),$(hT,g),$(yT,_),$(vT,w),$(gT,b),$(Rr,v),$(Al,S),$(pT,A),ze(P))if(P.length){const X=s.exposed||(s.exposed={});P.forEach(D=>{Object.defineProperty(X,D,{get:()=>t[D],set:F=>t[D]=F,enumerable:!0})})}else s.exposed||(s.exposed={});C&&s.render===cn&&(s.render=C),E!=null&&(s.inheritAttrs=E),R&&(s.components=R),O&&(s.directives=O),A&&yx(s)}function MT(s,e,t=cn){ze(s)&&(s=Pf(s));for(const i in s){const n=s[i];let r;Pt(n)?"default"in n?r=qo(n.from||i,n.default,!0):r=qo(n.from||i):r=qo(n),jt(r)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[i]=r}}function eg(s,e,t){gs(ze(s)?s.map(i=>i.bind(e.proxy)):s.bind(e.proxy),e,t)}function wx(s,e,t,i){let n=i.includes(".")?hx(t,i):()=>t[i];if(Gt(s)){const r=e[s];at(r)&&ai(n,r)}else if(at(s))ai(n,s.bind(t));else if(Pt(s))if(ze(s))s.forEach(r=>wx(r,e,t,i));else{const r=at(s.handler)?s.handler.bind(t):e[s.handler];at(r)&&ai(n,r,s)}}function Sx(s){const e=s.type,{mixins:t,extends:i}=e,{mixins:n,optionsCache:r,config:{optionMergeStrategies:o}}=s.appContext,a=r.get(e);let c;return a?c=a:!n.length&&!t&&!i?c=e:(c={},n.length&&n.forEach(l=>Kc(c,l,o,!0)),Kc(c,e,o)),Pt(e)&&r.set(e,c),c}function Kc(s,e,t,i=!1){const{mixins:n,extends:r}=e;r&&Kc(s,r,t,!0),n&&n.forEach(o=>Kc(s,o,t,!0));for(const o in e)if(!(i&&o==="expose")){const a=TT[o]||t&&t[o];s[o]=a?a(s[o],e[o]):e[o]}return s}const TT={data:tg,props:ig,emits:ig,methods:Da,computed:Da,beforeCreate:Li,created:Li,beforeMount:Li,mounted:Li,beforeUpdate:Li,updated:Li,beforeDestroy:Li,beforeUnmount:Li,destroyed:Li,unmounted:Li,activated:Li,deactivated:Li,errorCaptured:Li,serverPrefetch:Li,components:Da,directives:Da,watch:CT,provide:tg,inject:_T};function tg(s,e){return e?s?function(){return pi(at(s)?s.call(this,this):s,at(e)?e.call(this,this):e)}:e:s}function _T(s,e){return Da(Pf(s),Pf(e))}function Pf(s){if(ze(s)){const e={};for(let t=0;te==="modelValue"||e==="model-value"?s.modelModifiers:s[`${e}Modifiers`]||s[`${ks(e)}Modifiers`]||s[`${Ir(e)}Modifiers`];function RT(s,e,...t){if(s.isUnmounted)return;const i=s.vnode.props||Lt;let n=t;const r=e.startsWith("update:"),o=r&&IT(i,e.slice(7));o&&(o.trim&&(n=t.map(h=>Gt(h)?h.trim():h)),o.number&&(n=t.map(jh)));let a,c=i[a=Cu(e)]||i[a=Cu(ks(e))];!c&&r&&(c=i[a=Cu(Ir(e))]),c&&gs(c,s,6,n);const l=i[a+"Once"];if(l){if(!s.emitted)s.emitted={};else if(s.emitted[a])return;s.emitted[a]=!0,gs(l,s,6,n)}}const PT=new WeakMap;function Tx(s,e,t=!1){const i=t?PT:e.emitsCache,n=i.get(s);if(n!==void 0)return n;const r=s.emits;let o={},a=!1;if(!at(s)){const c=l=>{const h=Tx(l,e,!0);h&&(a=!0,pi(o,h))};!t&&e.mixins.length&&e.mixins.forEach(c),s.extends&&c(s.extends),s.mixins&&s.mixins.forEach(c)}return!r&&!a?(Pt(s)&&i.set(s,null),null):(ze(r)?r.forEach(c=>o[c]=null):pi(o,r),Pt(s)&&i.set(s,o),o)}function tu(s,e){return!s||!Xh(e)?!1:(e=e.slice(2),e=e==="Once"?e:e.replace(/Once$/,""),Rt(s,e[0].toLowerCase()+e.slice(1))||Rt(s,Ir(e))||Rt(s,e))}function sg(s){const{type:e,vnode:t,proxy:i,withProxy:n,propsOptions:[r],slots:o,attrs:a,emit:c,render:l,renderCache:h,props:u,data:d,setupState:f,ctx:m,inheritAttrs:p}=s,g=Wc(s);let x,v;try{if(t.shapeFlag&4){const S=n||i,C=S;x=Qs(l.call(C,S,h,u,f,d,m)),v=a}else{const S=e;x=Qs(S.length>1?S(u,{attrs:a,slots:o,emit:c}):S(u,null)),v=e.props?a:kT(a)}}catch(S){$n.length=0,qh(S,s,1),x=we(Fi)}let y=x;if(v&&p!==!1){const S=Object.keys(v),{shapeFlag:C}=y;S.length&&C&7&&(r&&S.some(Vh)&&(v=FT(v,r)),y=Cr(y,v,!1,!0))}if(t.dirs&&(y=Cr(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(t.dirs):t.dirs),t.transition){const S=Jh(y.type)&&zc(y)||y;ul(S,t.transition)}return x=y,Wc(g),x}const kT=s=>{let e;for(const t in s)(t==="class"||t==="style"||Xh(t))&&((e||(e={}))[t]=s[t]);return e},FT=(s,e)=>{const t={};for(const i in s)(!Vh(i)||!(i.slice(9)in e))&&(t[i]=s[i]);return t};function OT(s,e,t){const{props:i,children:n,component:r}=s,{props:o,children:a,patchFlag:c}=e,l=r.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&c>=0){if(c&1024)return!0;if(c&16)return i?ng(i,o,l):!!o;if(c&8){const h=e.dynamicProps;for(let u=0;uObject.create(Cx),Ax=s=>Object.getPrototypeOf(s)===Cx;function BT(s,e,t,i=!1){const n={},r=Ex();s.propsDefaults=Object.create(null),Ix(s,e,n,r);for(const o in s.propsOptions[0])o in n||(n[o]=void 0);t?s.props=i?n:UM(n):s.type.props?s.props=n:s.props=r,s.attrs=r}function NT(s,e,t,i){const{props:n,attrs:r,vnode:{patchFlag:o}}=s,a=Tt(n),[c]=s.propsOptions;let l=!1;if((i||o>0)&&!(o&16)){if(o&8){const h=s.vnode.dynamicProps;for(let u=0;u{c=!0;const[d,f]=Rx(u,e,!0);pi(o,d),f&&a.push(...f)};!t&&e.mixins.length&&e.mixins.forEach(h),s.extends&&h(s.extends),s.mixins&&s.mixins.forEach(h)}if(!r&&!c)return Pt(s)&&i.set(s,Ho),Ho;if(ze(r))for(let h=0;hs==="_"||s==="_ctx"||s==="$stable",ap=s=>ze(s)?s.map(Qs):[Qs(s)],UT=(s,e,t)=>{if(e._n)return e;const i=Zh((...n)=>ap(e(...n)),t);return i._c=!1,i},Px=(s,e,t)=>{const i=s._ctx;for(const n in s){if(op(n))continue;const r=s[n];if(at(r))e[n]=UT(n,r,i);else if(r!=null){const o=ap(r);e[n]=()=>o}}},kx=(s,e)=>{const t=ap(e);s.slots.default=()=>t},Fx=(s,e,t)=>{for(const i in e)(t||!op(i))&&(s[i]=e[i])},$T=(s,e,t)=>{const i=s.slots=Ex();if(s.vnode.shapeFlag&32){const n=e._;n?(Fx(i,e,t),t&&By(i,"_",n,!0)):Px(e,i)}else e&&kx(s,e)},XT=(s,e,t)=>{const{vnode:i,slots:n}=s;let r=!0,o=Lt;if(i.shapeFlag&32){const a=e._;a?t&&a===1?r=!1:Fx(n,e,t):(r=!e.$stable,Px(e,n)),o=e}else e&&(kx(s,e),o={default:1});if(r)for(const a in n)!op(a)&&o[a]==null&&delete n[a]},Bi=HT;function VT(s){return YT(s)}function YT(s,e){const t=Hh();t.__VUE__=!0;const{insert:i,remove:n,patchProp:r,createElement:o,createText:a,createComment:c,setText:l,setElementText:h,parentNode:u,nextSibling:d,setScopeId:f=cn,insertStaticContent:m}=s,p=(H,z,K,B=null,L=null,j=null,ie=void 0,ue=null,fe=!!z.dynamicChildren)=>{if(H===z)return;H&&!zr(H,z)&&(B=oe(H),V(H,L,j,!0),H=null),z.patchFlag===-2&&(fe=!1,z.dynamicChildren=null);const{type:ee,ref:Me,shapeFlag:be}=z;switch(ee){case iu:g(H,z,K,B);break;case Fi:x(H,z,K,B);break;case Ac:H==null&&v(z,K,B,ie);break;case _e:R(H,z,K,B,L,j,ie,ue,fe);break;default:be&1?C(H,z,K,B,L,j,ie,ue,fe):be&6?O(H,z,K,B,L,j,ie,ue,fe):(be&64||be&128)&&ee.process(H,z,K,B,L,j,ie,ue,fe,he)}Me!=null&&L?Za(Me,H&&H.ref,j,z||H,!z):Me==null&&H&&H.ref!=null&&Za(H.ref,null,j,H,!0)},g=(H,z,K,B)=>{if(H==null)i(z.el=a(z.children),K,B);else{const L=z.el=H.el;z.children!==H.children&&l(L,z.children)}},x=(H,z,K,B)=>{H==null?i(z.el=c(z.children||""),K,B):z.el=H.el},v=(H,z,K,B)=>{[H.el,H.anchor]=m(H.children,z,K,B,H.el,H.anchor)},y=({el:H,anchor:z},K,B)=>{let L;for(;H&&H!==z;)L=d(H),i(H,K,B),H=L;i(z,K,B)},S=({el:H,anchor:z})=>{let K;for(;H&&H!==z;)K=d(H),n(H),H=K;n(z)},C=(H,z,K,B,L,j,ie,ue,fe)=>{if(z.type==="svg"?ie="svg":z.type==="math"&&(ie="mathml"),H==null)w(z,K,B,L,j,ie,ue,fe);else{const ee=H.el&&H.el._isVueCE?H.el:null;try{ee&&ee._beginPatch(),A(H,z,L,j,ie,ue,fe)}finally{ee&&ee._endPatch()}}},w=(H,z,K,B,L,j,ie,ue)=>{let fe,ee;const{props:Me,shapeFlag:be,transition:ge,dirs:Ne}=H;if(fe=H.el=o(H.type,j,Me&&Me.is,Me),be&8?h(fe,H.children):be&16&&_(H.children,fe,null,B,L,Fu(H,j),ie,ue),Ne&&Or(H,null,B,"created"),b(fe,H,H.scopeId,ie,B),Me){for(const Ze in Me)Ze!=="value"&&!za(Ze)&&r(fe,Ze,null,Me[Ze],j,B);"value"in Me&&r(fe,"value",null,Me.value,j),(ee=Me.onVnodeBeforeMount)&&Xs(ee,B,H)}Ne&&Or(H,null,B,"beforeMount");const Ve=GT(L,ge);Ve&&ge.beforeEnter(fe),i(fe,z,K),((ee=Me&&Me.onVnodeMounted)||Ve||Ne)&&Bi(()=>{try{ee&&Xs(ee,B,H),Ve&&ge.enter(fe),Ne&&Or(H,null,B,"mounted")}finally{}},L)},b=(H,z,K,B,L)=>{if(K&&f(H,K),B)for(let j=0;j{for(let ee=fe;ee{const ue=z.el=H.el;let{patchFlag:fe,dynamicChildren:ee,dirs:Me}=z;fe|=H.patchFlag&16;const be=H.props||Lt,ge=z.props||Lt;let Ne;if(K&&Lr(K,!1),(Ne=ge.onVnodeBeforeUpdate)&&Xs(Ne,K,z,H),Me&&Or(z,H,K,"beforeUpdate"),K&&Lr(K,!0),ee&&(!H.dynamicChildren||H.dynamicChildren.length!==ee.length)&&(fe=0,ie=!1,ee=null),(be.innerHTML&&ge.innerHTML==null||be.textContent&&ge.textContent==null)&&h(ue,""),ee?P(H.dynamicChildren,ee,ue,K,B,Fu(z,L),j):ie||D(H,z,ue,null,K,B,Fu(z,L),j,!1),fe>0){if(fe&16)E(ue,be,ge,K,L);else if(fe&2&&be.class!==ge.class&&r(ue,"class",null,ge.class,L),fe&4&&r(ue,"style",be.style,ge.style,L),fe&8){const Ve=z.dynamicProps;for(let Ze=0;Ze{Ne&&Xs(Ne,K,z,H),Me&&Or(z,H,K,"updated")},B)},P=(H,z,K,B,L,j,ie)=>{for(let ue=0;ue{if(z!==K){if(z!==Lt)for(const j in z)!za(j)&&!(j in K)&&r(H,j,z[j],null,L,B);for(const j in K){if(za(j))continue;const ie=K[j],ue=z[j];ie!==ue&&j!=="value"&&r(H,j,ue,ie,L,B)}"value"in K&&r(H,"value",z.value,K.value,L)}},R=(H,z,K,B,L,j,ie,ue,fe)=>{const ee=z.el=H?H.el:a(""),Me=z.anchor=H?H.anchor:a("");let{patchFlag:be,dynamicChildren:ge,slotScopeIds:Ne}=z;Ne&&(ue=ue?ue.concat(Ne):Ne),H==null?(i(ee,K,B),i(Me,K,B),_(z.children||[],K,Me,L,j,ie,ue,fe)):be>0&&be&64&&ge&&H.dynamicChildren&&H.dynamicChildren.length===ge.length?(P(H.dynamicChildren,ge,K,L,j,ie,ue),(z.key!=null||L&&z===L.subTree)&&lp(H,z,!0)):D(H,z,K,Me,L,j,ie,ue,fe)},O=(H,z,K,B,L,j,ie,ue,fe)=>{z.slotScopeIds=ue,H==null?z.shapeFlag&512?L.ctx.activate(z,K,B,ie,fe):U(z,K,B,L,j,ie,fe):Y(H,z,fe)},U=(H,z,K,B,L,j,ie)=>{const ue=H.component=JT(H,B,L);if(Qh(H)&&(ue.ctx.renderer=he),QT(ue,!1,ie),ue.asyncDep){if(L&&L.registerDep(ue,$,ie),!H.el){const fe=ue.subTree=we(Fi);x(null,fe,z,K),H.placeholder=fe.el}}else $(ue,H,z,K,L,j,ie)},Y=(H,z,K)=>{const B=z.component=H.component;if(OT(H,z,K))if(B.asyncDep&&!B.asyncResolved){X(B,z,K);return}else B.next=z,B.update();else z.el=H.el,B.vnode=z},$=(H,z,K,B,L,j,ie)=>{const ue=()=>{if(H.isMounted){let{next:be,bu:ge,u:Ne,parent:Ve,vnode:Ze}=H;{const Qe=Ox(H);if(Qe){be&&(be.el=Ze.el,X(H,be,ie)),Qe.asyncDep.then(()=>{Bi(()=>{H.isUnmounted||ee()},L)});return}}let rt=be,Je;Lr(H,!1),be?(be.el=Ze.el,X(H,be,ie)):be=Ze,ge&&Ec(ge),(Je=be.props&&be.props.onVnodeBeforeUpdate)&&Xs(Je,Ve,be,Ze),Lr(H,!0);const je=sg(H),Ae=H.subTree;H.subTree=je,p(Ae,je,u(Ae.el),oe(Ae),H,L,j),be.el=je.el,rt===null&<(H,je.el),Ne&&Bi(Ne,L),(Je=be.props&&be.props.onVnodeUpdated)&&Bi(()=>Xs(Je,Ve,be,Ze),L)}else{let be;const{el:ge,props:Ne}=z,{bm:Ve,m:Ze,parent:rt,root:Je,type:je}=H,Ae=Ko(z);Lr(H,!1),Ve&&Ec(Ve),!Ae&&(be=Ne&&Ne.onVnodeBeforeMount)&&Xs(be,rt,z),Lr(H,!0);{Je.ce&&Je.ce._hasShadowRoot()&&Je.ce._injectChildStyle(je,H.parent?H.parent.type:void 0);const Qe=H.subTree=sg(H);p(null,Qe,K,B,H,L,j),z.el=Qe.el}if(Ze&&Bi(Ze,L),!Ae&&(be=Ne&&Ne.onVnodeMounted)){const Qe=z;Bi(()=>Xs(be,rt,Qe),L)}(z.shapeFlag&256||rt&&Ko(rt.vnode)&&rt.vnode.shapeFlag&256)&&H.a&&Bi(H.a,L),H.isMounted=!0,z=K=B=null}};H.scope.on();const fe=H.effect=new Yy(ue);H.scope.off();const ee=H.update=fe.run.bind(fe),Me=H.job=fe.runIfDirty.bind(fe);Me.i=H,Me.id=H.uid,fe.scheduler=()=>np(Me),Lr(H,!0),ee()},X=(H,z,K)=>{z.component=H;const B=H.vnode.props;H.vnode=z,H.next=null,NT(H,z.props,B,K),XT(H,z.children,K),Yn(),zp(H),Gn()},D=(H,z,K,B,L,j,ie,ue,fe=!1)=>{const ee=H&&H.children,Me=H?H.shapeFlag:0,be=z.children,{patchFlag:ge,shapeFlag:Ne}=z;if(ge>0){if(ge&128){N(ee,be,K,B,L,j,ie,ue,fe);return}else if(ge&256){F(ee,be,K,B,L,j,ie,ue,fe);return}}Ne&8?(Me&16&&ne(ee,L,j),be!==ee&&h(K,be)):Me&16?Ne&16?N(ee,be,K,B,L,j,ie,ue,fe):ne(ee,L,j,!0):(Me&8&&h(K,""),Ne&16&&_(be,K,B,L,j,ie,ue,fe))},F=(H,z,K,B,L,j,ie,ue,fe)=>{H=H||Ho,z=z||Ho;const ee=H.length,Me=z.length,be=Math.min(ee,Me);let ge;for(ge=0;geMe?ne(H,L,j,!0,!1,be):_(z,K,B,L,j,ie,ue,fe,be)},N=(H,z,K,B,L,j,ie,ue,fe)=>{let ee=0;const Me=z.length;let be=H.length-1,ge=Me-1;for(;ee<=be&&ee<=ge;){const Ne=H[ee],Ve=z[ee]=fe?An(z[ee]):Qs(z[ee]);if(zr(Ne,Ve))p(Ne,Ve,K,null,L,j,ie,ue,fe);else break;ee++}for(;ee<=be&&ee<=ge;){const Ne=H[be],Ve=z[ge]=fe?An(z[ge]):Qs(z[ge]);if(zr(Ne,Ve))p(Ne,Ve,K,null,L,j,ie,ue,fe);else break;be--,ge--}if(ee>be){if(ee<=ge){const Ne=ge+1,Ve=Nege)for(;ee<=be;)V(H[ee],L,j,!0),ee++;else{const Ne=ee,Ve=ee,Ze=new Map;for(ee=Ve;ee<=ge;ee++){const ut=z[ee]=fe?An(z[ee]):Qs(z[ee]);ut.key!=null&&Ze.set(ut.key,ee)}let rt,Je=0;const je=ge-Ve+1;let Ae=!1,Qe=0;const Ee=new Array(je);for(ee=0;ee=je){V(ut,L,j,!0);continue}let re;if(ut.key!=null)re=Ze.get(ut.key);else for(rt=Ve;rt<=ge;rt++)if(Ee[rt-Ve]===0&&zr(ut,z[rt])){re=rt;break}re===void 0?V(ut,L,j,!0):(Ee[re-Ve]=ee+1,re>=Qe?Qe=re:Ae=!0,p(ut,z[re],K,null,L,j,ie,ue,fe),Je++)}const Qt=Ae?jT(Ee):Ho;for(rt=Qt.length-1,ee=je-1;ee>=0;ee--){const ut=Ve+ee,re=z[ut],ae=z[ut+1],et=ut+1{const{el:j,type:ie,transition:ue,children:fe,shapeFlag:ee}=H;if(ee&6){k(H.component.subTree,z,K,B);return}if(ee&128){H.suspense.move(z,K,B);return}if(ee&64){ie.move(H,z,K,he);return}if(ie===_e){i(j,z,K);for(let be=0;beue.enter(j),L));else{const{leave:be,delayLeave:ge,afterLeave:Ne}=ue,Ve=()=>{H.ctx.isUnmounted?n(j):i(j,z,K)},Ze=()=>{const rt=j._isLeaving||!!j[us];j._isLeaving&&j[us](!0),ue.persisted&&!rt?Ve():be(j,()=>{Ve(),Ne&&Ne()})};ge?ge(j,Ve,Ze):Ze()}else i(j,z,K)},V=(H,z,K,B=!1,L=!1)=>{const{type:j,props:ie,ref:ue,children:fe,dynamicChildren:ee,shapeFlag:Me,patchFlag:be,dirs:ge,cacheIndex:Ne,memo:Ve}=H;if(be===-2&&(L=!1),ue!=null&&(Yn(),Za(ue,null,K,H,!0),Gn()),Ne!=null&&(z.renderCache[Ne]=void 0),Me&256){z.ctx.deactivate(H);return}const Ze=Me&1&&ge,rt=!Ko(H);let Je;if(rt&&(Je=ie&&ie.onVnodeBeforeUnmount)&&Xs(Je,z,H),Me&6)Z(H.component,K,B);else{if(Me&128){H.suspense.unmount(K,B);return}Ze&&Or(H,null,z,"beforeUnmount"),Me&64?H.type.remove(H,z,K,he,B):ee&&!ee.hasOnce&&(j!==_e||be>0&&be&64)?ne(ee,z,K,!1,!0):(j===_e&&be&384||!L&&Me&16)&&ne(fe,z,K),B&&G(H)}const je=Ve!=null&&Ne==null;(rt&&(Je=ie&&ie.onVnodeUnmounted)||Ze||je)&&Bi(()=>{Je&&Xs(Je,z,H),Ze&&Or(H,null,z,"unmounted"),je&&(H.el=null)},K)},G=H=>{const{type:z,el:K,anchor:B,transition:L}=H;if(z===_e){W(K,B);return}if(z===Ac){S(H);return}const j=()=>{n(K),L&&!L.persisted&&L.afterLeave&&L.afterLeave()};if(H.shapeFlag&1&&L&&!L.persisted){const{leave:ie,delayLeave:ue}=L,fe=()=>ie(K,j);ue?ue(H.el,j,fe):fe()}else j()},W=(H,z)=>{let K;for(;H!==z;)K=d(H),n(H),H=K;n(z)},Z=(H,z,K)=>{const{bum:B,scope:L,job:j,subTree:ie,um:ue,m:fe,a:ee}=H;og(fe),og(ee),B&&Ec(B),L.stop(),j&&(j.flags|=8,V(ie,H,z,K)),ue&&Bi(ue,z),Bi(()=>{H.isUnmounted=!0},z)},ne=(H,z,K,B=!1,L=!1,j=0)=>{for(let ie=j;ie{if(H.shapeFlag&6)return oe(H.component.subTree);if(H.shapeFlag&128)return H.suspense.next();const z=d(H.anchor||H.el),K=z&&z[ux];return K?d(K):z};let de=!1;const pe=(H,z,K)=>{let B;H==null?z._vnode&&(V(z._vnode,null,null,!0),B=z._vnode.component):p(z._vnode||null,H,z,null,null,null,K),z._vnode=H,de||(de=!0,zp(B),ox(),de=!1)},he={p,um:V,m:k,r:G,mt:U,mc:_,pc:D,pbc:P,n:oe,o:s};return{render:pe,hydrate:void 0,createApp:AT(pe)}}function Fu({type:s,props:e},t){return t==="svg"&&s==="foreignObject"||t==="mathml"&&s==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function Lr({effect:s,job:e},t){t?(s.flags|=32,e.flags|=4):(s.flags&=-33,e.flags&=-5)}function GT(s,e){return(!s||s&&!s.pendingBranch)&&e&&!e.persisted}function lp(s,e,t=!1){const i=s.children,n=e.children;if(ze(i)&&ze(n))for(let r=0;r>1,s[t[a]]0&&(e[i]=t[r-1]),t[r]=i)}}for(r=t.length,o=t[r-1];r-- >0;)t[r]=o,o=e[o];return t}function Ox(s){const e=s.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:Ox(e)}function og(s){if(s)for(let e=0;es.__isSuspense;function HT(s,e){e&&e.pendingBranch?ze(s)?e.effects.push(...s):e.effects.push(s):JM(s)}const _e=Symbol.for("v-fgt"),iu=Symbol.for("v-txt"),Fi=Symbol.for("v-cmt"),Ac=Symbol.for("v-stc"),$n=[];let ss=null;function q(s=!1){$n.push(ss=s?null:[])}function cp(){$n.pop(),ss=$n[$n.length-1]||null}let dl=1;function Zc(s,e=!1){dl+=s,s<0&&ss&&e&&(ss.hasOnce=!0)}function Nx(s){return s.dynamicChildren=dl>0?ss||Ho:null,cp(),dl>0&&ss&&ss.push(s),s}function J(s,e,t,i,n,r){return Nx(T(s,e,t,i,n,r,!0))}function Ct(s,e,t,i,n){return Nx(we(s,e,t,i,n,!0))}function fl(s){return s?s.__v_isVNode===!0:!1}function zr(s,e){return s.type===e.type&&s.key===e.key}const Dx=({key:s})=>s??null,Ic=({ref:s,ref_key:e,ref_for:t})=>(typeof s=="number"&&(s=""+s),s!=null?Gt(s)||jt(s)||at(s)?{i:Oi,r:s,k:e,f:!!t}:s:null);function T(s,e=null,t=null,i=0,n=null,r=s===_e?0:1,o=!1,a=!1){const c={__v_isVNode:!0,__v_skip:!0,type:s,props:e,key:e&&Dx(e),ref:e&&Ic(e),scopeId:lx,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:i,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:Oi};return a?(Jc(c,t),r&128&&s.normalize(c)):t&&(c.shapeFlag|=Gt(t)?8:16),dl>0&&!o&&ss&&(c.patchFlag>0||r&6)&&c.patchFlag!==32&&ss.push(c),c}const we=WT;function WT(s,e=null,t=null,i=0,n=null,r=!1){if((!s||s===xT)&&(s=Fi),fl(s)){const a=Cr(s,e,!0);return t&&Jc(a,t),dl>0&&!r&&ss&&(a.shapeFlag&6?ss[ss.indexOf(s)]=a:ss.push(a)),a.patchFlag=-2,a}if(s2(s)&&(s=s.__vccOpts),e){e=zT(e);let{class:a,style:c}=e;a&&!Gt(a)&&(e.class=Ce(a)),Pt(c)&&(zh(c)&&!ze(c)&&(c=pi({},c)),e.style=Ot(c))}const o=Gt(s)?1:Bx(s)?128:Jh(s)?64:Pt(s)?4:at(s)?2:0;return T(s,e,t,i,n,o,r,!0)}function zT(s){return s?zh(s)||Ax(s)?pi({},s):s:null}function Cr(s,e,t=!1,i=!1){const{props:n,ref:r,patchFlag:o,children:a,transition:c}=s,l=e?qT(n||{},e):n,h={__v_isVNode:!0,__v_skip:!0,type:s.type,props:l,key:l&&Dx(l),ref:e&&e.ref?t&&r?ze(r)?r.concat(Ic(e)):[r,Ic(e)]:Ic(e):r,scopeId:s.scopeId,slotScopeIds:s.slotScopeIds,children:a,target:s.target,targetStart:s.targetStart,targetAnchor:s.targetAnchor,staticCount:s.staticCount,shapeFlag:s.shapeFlag,patchFlag:e&&s.type!==_e?o===-1?16:o|16:o,dynamicProps:s.dynamicProps,dynamicChildren:s.dynamicChildren,appContext:s.appContext,dirs:s.dirs,transition:c,component:s.component,suspense:s.suspense,ssContent:s.ssContent&&Cr(s.ssContent),ssFallback:s.ssFallback&&Cr(s.ssFallback),placeholder:s.placeholder,el:s.el,anchor:s.anchor,ctx:s.ctx,ce:s.ce};return c&&i&&ul(h,c.clone(h)),h}function ft(s=" ",e=0){return we(iu,null,s,e)}function is(s,e){const t=we(Ac,null,s);return t.staticCount=e,t}function xe(s="",e=!1){return e?(q(),Ct(Fi,null,s)):we(Fi,null,s)}function Qs(s){return s==null||typeof s=="boolean"?we(Fi):ze(s)?we(_e,null,s.slice()):fl(s)?An(s):we(iu,null,String(s))}function An(s){return s.el===null&&s.patchFlag!==-1||s.memo?s:Cr(s)}function Jc(s,e){let t=0;const{shapeFlag:i}=s;if(e==null)e=null;else if(ze(e))t=16;else if(typeof e=="object")if(i&65){const n=e.default;n&&(n._c&&(n._d=!1),Jc(s,n()),n._c&&(n._d=!0));return}else{t=32;const n=e._;!n&&!Ax(e)?e._ctx=Oi:n===3&&Oi&&(Oi.slots._===1?e._=1:(e._=2,s.patchFlag|=1024))}else if(at(e)){if(i&65){Jc(s,{default:e});return}e={default:e,_ctx:Oi},t=32}else e=String(e),i&64?(t=16,e=[ft(e)]):t=8;s.children=e,s.shapeFlag|=t}function qT(...s){const e={};for(let t=0;t$i||Oi;let Qc,ml;{const s=Hh(),e=(t,i)=>{let n;return(n=s[t])||(n=s[t]=[]),n.push(i),r=>{n.length>1?n.forEach(o=>o(r)):n[0](r)}};Qc=e("__VUE_INSTANCE_SETTERS__",t=>$i=t),ml=e("__VUE_SSR_SETTERS__",t=>pl=t)}const Il=s=>{const e=$i;return Qc(s),s.scope.on(),()=>{s.scope.off(),Qc(e)}},ag=()=>{$i&&$i.scope.off(),Qc(null)};function Ux(s){return s.vnode.shapeFlag&4}let pl=!1;function QT(s,e=!1,t=!1){e&&ml(e);const{props:i,children:n}=s.vnode,r=Ux(s);BT(s,i,r,e),$T(s,n,t||e);const o=r?e2(s,e):void 0;return e&&ml(!1),o}function e2(s,e){const t=s.type;s.accessCache=Object.create(null),s.proxy=new Proxy(s.ctx,wT);const{setup:i}=t;if(i){Yn();const n=s.setupContext=i.length>1?i2(s):null,r=Il(s),o=El(i,s,0,[s.props,n]),a=ky(o);if(Gn(),r(),(a||s.sp)&&!Ko(s)&&yx(s),a){if(o.then(ag,ag),e)return o.then(c=>{ml(!0);try{lg(s,c,e)}finally{ml(!1)}}).catch(c=>{qh(c,s,0)});s.asyncDep=o}else lg(s,o)}else $x(s)}function lg(s,e,t){at(e)?s.type.__ssrInlineRender?s.ssrRender=e:s.render=e:Pt(e)&&(s.setupState=sx(e)),$x(s)}function $x(s,e,t){const i=s.type;s.render||(s.render=i.render||cn);{const n=Il(s);Yn();try{ST(s)}finally{Gn(),n()}}}const t2={get(s,e){return Pi(s,"get",""),s[e]}};function i2(s){const e=t=>{s.exposed=t||{}};return{attrs:new Proxy(s.attrs,t2),slots:s.slots,emit:s.emit,expose:e}}function su(s){return s.exposed?s.exposeProxy||(s.exposeProxy=new Proxy(sx(vr(s.exposed)),{get(e,t){if(t in e)return e[t];if(t in Ja)return Ja[t](s)},has(e,t){return t in e||t in Ja}})):s.proxy}function s2(s){return at(s)&&"__vccOpts"in s}const Le=(s,e)=>WM(s,e,pl);function n2(s,e,t){try{Zc(-1);const i=arguments.length;return i===2?Pt(e)&&!ze(e)?fl(e)?we(s,null,[e]):we(s,e):we(s,null,e):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&fl(t)&&(t=[t]),we(s,e,t))}finally{Zc(1)}}const r2="3.5.41";/** +* @vue/runtime-dom v3.5.41 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Ff;const cg=typeof window<"u"&&window.trustedTypes;if(cg)try{Ff=cg.createPolicy("vue",{createHTML:s=>s})}catch{}const Xx=Ff?s=>Ff.createHTML(s):s=>s,o2="http://www.w3.org/2000/svg",a2="http://www.w3.org/1998/Math/MathML",Mn=typeof document<"u"?document:null,hg=Mn&&Mn.createElement("template"),l2={insert:(s,e,t)=>{e.insertBefore(s,t||null)},remove:s=>{const e=s.parentNode;e&&e.removeChild(s)},createElement:(s,e,t,i)=>{const n=e==="svg"?Mn.createElementNS(o2,s):e==="mathml"?Mn.createElementNS(a2,s):t?Mn.createElement(s,{is:t}):Mn.createElement(s);return s==="select"&&i&&i.multiple!=null&&n.setAttribute("multiple",i.multiple),n},createText:s=>Mn.createTextNode(s),createComment:s=>Mn.createComment(s),setText:(s,e)=>{s.nodeValue=e},setElementText:(s,e)=>{s.textContent=e},parentNode:s=>s.parentNode,nextSibling:s=>s.nextSibling,querySelector:s=>Mn.querySelector(s),setScopeId(s,e){s.setAttribute(e,"")},insertStaticContent(s,e,t,i,n,r){const o=t?t.previousSibling:e.lastChild;if(n&&(n===r||n.nextSibling))for(;e.insertBefore(n.cloneNode(!0),t),!(n===r||!(n=n.nextSibling)););else{hg.innerHTML=Xx(i==="svg"?`${s}`:i==="mathml"?`${s}`:s);const a=hg.content;if(i==="svg"||i==="mathml"){const c=a.firstChild;for(;c.firstChild;)a.appendChild(c.firstChild);a.removeChild(c)}e.insertBefore(a,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},Qn="transition",Ia="animation",gl=Symbol("_vtc"),Vx={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},c2=pi({},fx,Vx),h2=s=>(s.displayName="Transition",s.props=c2,s),u2=h2((s,{slots:e})=>n2(lT,d2(s),e)),Br=(s,e=[])=>{ze(s)?s.forEach(t=>t(...e)):s&&s(...e)},ug=s=>s?ze(s)?s.some(e=>e.length>1):s.length>1:!1;function d2(s){const e={};for(const R in s)R in Vx||(e[R]=s[R]);if(s.css===!1)return e;const{name:t="v",type:i,duration:n,enterFromClass:r=`${t}-enter-from`,enterActiveClass:o=`${t}-enter-active`,enterToClass:a=`${t}-enter-to`,appearFromClass:c=r,appearActiveClass:l=o,appearToClass:h=a,leaveFromClass:u=`${t}-leave-from`,leaveActiveClass:d=`${t}-leave-active`,leaveToClass:f=`${t}-leave-to`}=s,m=f2(n),p=m&&m[0],g=m&&m[1],{onBeforeEnter:x,onEnter:v,onEnterCancelled:y,onLeave:S,onLeaveCancelled:C,onBeforeAppear:w=x,onAppear:b=v,onAppearCancelled:_=y}=e,A=(R,O,U,Y)=>{R._enterCancelled=Y,Nr(R,O?h:a),Nr(R,O?l:o),U&&U()},P=(R,O)=>{R._isLeaving=!1,Nr(R,u),Nr(R,f),Nr(R,d),O&&O()},E=R=>(O,U)=>{const Y=R?b:v,$=()=>A(O,R,U);Br(Y,[O,$]),dg(()=>{Nr(O,R?c:r),xn(O,R?h:a),ug(Y)||fg(O,i,p,$)})};return pi(e,{onBeforeEnter(R){Br(x,[R]),xn(R,r),xn(R,o)},onBeforeAppear(R){Br(w,[R]),xn(R,c),xn(R,l)},onEnter:E(!1),onAppear:E(!0),onLeave(R,O){R._isLeaving=!0;const U=()=>P(R,O);xn(R,u),R._enterCancelled?(xn(R,d),gg(R)):(gg(R),xn(R,d)),dg(()=>{R._isLeaving&&(Nr(R,u),xn(R,f),ug(S)||fg(R,i,g,U))}),Br(S,[R,U])},onEnterCancelled(R){A(R,!1,void 0,!0),Br(y,[R])},onAppearCancelled(R){A(R,!0,void 0,!0),Br(_,[R])},onLeaveCancelled(R){P(R),Br(C,[R])}})}function f2(s){if(s==null)return null;if(Pt(s))return[Ou(s.enter),Ou(s.leave)];{const e=Ou(s);return[e,e]}}function Ou(s){return dM(s)}function xn(s,e){e.split(/\s+/).forEach(t=>t&&s.classList.add(t)),(s[gl]||(s[gl]=new Set)).add(e)}function Nr(s,e){e.split(/\s+/).forEach(i=>i&&s.classList.remove(i));const t=s[gl];t&&(t.delete(e),t.size||(s[gl]=void 0))}function dg(s){requestAnimationFrame(()=>{requestAnimationFrame(s)})}let m2=0;function fg(s,e,t,i){const n=s._endId=++m2,r=()=>{n===s._endId&&i()};if(t!=null)return setTimeout(r,t);const{type:o,timeout:a,propCount:c}=p2(s,e);if(!o)return i();const l=o+"end";let h=0;const u=()=>{s.removeEventListener(l,d),r()},d=f=>{f.target===s&&++h>=c&&u()};setTimeout(()=>{h(t[m]||"").split(", "),n=i(`${Qn}Delay`),r=i(`${Qn}Duration`),o=mg(n,r),a=i(`${Ia}Delay`),c=i(`${Ia}Duration`),l=mg(a,c);let h=null,u=0,d=0;e===Qn?o>0&&(h=Qn,u=o,d=r.length):e===Ia?l>0&&(h=Ia,u=l,d=c.length):(u=Math.max(o,l),h=u>0?o>l?Qn:Ia:null,d=h?h===Qn?r.length:c.length:0);const f=h===Qn&&/\b(?:transform|all)(?:,|$)/.test(i(`${Qn}Property`).toString());return{type:h,timeout:u,propCount:d,hasTransform:f}}function mg(s,e){for(;s.lengthpg(t)+pg(s[i])))}function pg(s){return s==="auto"?0:Number(s.slice(0,-1).replace(",","."))*1e3}function gg(s){return(s?s.ownerDocument:document).body.offsetHeight}function g2(s,e,t){const i=s[gl];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?s.removeAttribute("class"):t?s.setAttribute("class",e):s.className=e}const eh=Symbol("_vod"),Yx=Symbol("_vsh"),Si={name:"show",beforeMount(s,{value:e},{transition:t}){s[eh]=s.style.display==="none"?"":s.style.display,t&&e?t.beforeEnter(s):Ra(s,e)},mounted(s,{value:e},{transition:t}){t&&e&&t.enter(s)},updated(s,{value:e,oldValue:t},{transition:i}){!e!=!t&&(i?e?(i.beforeEnter(s),Ra(s,!0),i.enter(s)):i.leave(s,()=>{Ra(s,!1)}):Ra(s,e))},beforeUnmount(s,{value:e}){Ra(s,e)}};function Ra(s,e){s.style.display=e?s[eh]:"none",s[Yx]=!e}const v2=Symbol(""),y2=/(?:^|;)\s*display\s*:/;function x2(s,e,t){const i=s.style,n=Gt(t);let r=!1;if(t&&!n){if(e)if(Gt(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();t[a]==null&&Ua(i,a,"")}else for(const o in e)t[o]==null&&Ua(i,o,"");for(const o in t){o==="display"&&(r=!0);const a=t[o];a!=null?w2(s,o,!Gt(e)&&e?e[o]:void 0,a)||Ua(i,o,a):Ua(i,o,"")}}else if(n){if(e!==t){const o=i[v2];o&&(t+=";"+o),i.cssText=t,r=y2.test(t)}}else e&&s.removeAttribute("style");eh in s&&(s[eh]=r?i.display:"",s[Yx]&&(i.display="none"))}const vg=/\s*!important$/;function Ua(s,e,t){if(ze(t))t.forEach(i=>Ua(s,e,i));else if(t==null&&(t=""),e.startsWith("--"))s.setProperty(e,t);else{const i=b2(s,e);vg.test(t)?s.setProperty(Ir(i),t.replace(vg,""),"important"):s[i]=t}}const yg=["Webkit","Moz","ms"],Lu={};function b2(s,e){const t=Lu[e];if(t)return t;let i=ks(e);if(i!=="filter"&&i in s)return Lu[e]=i;i=Ly(i);for(let n=0;nBu||(E2.then(()=>Bu=0),Bu=Date.now());function I2(s,e){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;const n=t.value;if(ze(n)){const r=i.stopImmediatePropagation;i.stopImmediatePropagation=()=>{r.call(i),i._stopped=!0};const o=n.slice(),a=[i];for(let c=0;cs.charCodeAt(0)===111&&s.charCodeAt(1)===110&&s.charCodeAt(2)>96&&s.charCodeAt(2)<123,R2=(s,e,t,i,n,r)=>{const o=n==="svg";e==="class"?g2(s,i,o):e==="style"?x2(s,t,i):Xh(e)?Vh(e)||M2(s,e,t,i,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):P2(s,e,i,o))?(wg(s,e,i),!s.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&bg(s,e,i,o,r,e!=="value")):s._isVueCE&&(k2(s,e)||s._def.__asyncLoader&&(/[A-Z]/.test(e)||!Gt(i)))?wg(s,ks(e),i,r,e):(e==="true-value"?s._trueValue=i:e==="false-value"&&(s._falseValue=i),bg(s,e,i,o))};function P2(s,e,t,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in s&&Mg(e)&&at(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&s.tagName==="IFRAME"||e==="form"||e==="list"&&s.tagName==="INPUT"||e==="type"&&s.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const n=s.tagName;if(n==="IMG"||n==="VIDEO"||n==="CANVAS"||n==="SOURCE")return!1}return Mg(e)&&Gt(t)?!1:e in s}function k2(s,e){const t=s._def.props;if(!t)return!1;const i=ks(e);return Array.isArray(t)?t.some(n=>ks(n)===i):Object.keys(t).some(n=>ks(n)===i)}const la=s=>{const e=s.props["onUpdate:modelValue"]||!1;return ze(e)?t=>Ec(e,t):e};function F2(s){s.target.composing=!0}function Tg(s){const e=s.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const rn=Symbol("_assign"),Hl=Symbol("_initialValue");function Nu(s,e,t){return e&&(s=s.trim()),t&&(s=jh(s)),s}const He={created(s,{modifiers:{lazy:e,trim:t,number:i}},n){s.parentNode&&(s.type==="text"?s[Hl]=s.defaultValue.replace(/[\r\n]/g,""):s.type==="textarea"&&(s[Hl]=s.defaultValue.replace(/\r\n?/g,` +`))),s[rn]=la(n);const r=i||n.props&&n.props.type==="number";fr(s,e?"change":"input",o=>{o.target.composing||s[rn](Nu(s.value,t,r))}),(t||r)&&fr(s,"change",()=>{s.value=Nu(s.value,t,r)}),e||(fr(s,"compositionstart",F2),fr(s,"compositionend",Tg),fr(s,"change",Tg))},mounted(s,{value:e,modifiers:{trim:t,number:i}}){const n=e??"",r=s[Hl];delete s[Hl],r!==void 0&&(s.type==="text"||s.type==="textarea")&&s.value!==r?s[rn](Nu(s.value,t,i)):s.value=n},beforeUpdate(s,{value:e,oldValue:t,modifiers:{lazy:i,trim:n,number:r}},o){if(s[rn]=la(o),s.composing)return;const a=(r||s.type==="number")&&!/^0\d/.test(s.value)?jh(s.value):s.value,c=e??"";if(a===c)return;const l=s.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===s&&s.type!=="range"&&(i&&e===t||n&&s.value.trim()===c)||(s.value=c)}},wt={deep:!0,created(s,e,t){s[rn]=la(t),fr(s,"change",()=>{const i=s._modelValue,n=vl(s),r=s.checked,o=s[rn];if(ze(i)){const a=Zm(i,n),c=a!==-1;if(r&&!c)o(i.concat(n));else if(!r&&c){const l=[...i];l.splice(a,1),o(l)}}else if(pa(i)){const a=new Set(i);r?a.add(n):a.delete(n),o(a)}else o(Gx(s,r))})},mounted:_g,beforeUpdate(s,e,t){s[rn]=la(t),_g(s,e,t)}};function _g(s,{value:e,oldValue:t},i){s._modelValue=e;let n;if(ze(e))n=Zm(e,i.props.value)>-1;else if(pa(e))n=e.has(i.props.value);else{if(e===t)return;n=ga(e,Gx(s,!0))}s.checked!==n&&(s.checked=n)}const bt={deep:!0,created(s,{value:e,modifiers:{number:t}},i){s._modelValue=e,fr(s,"change",()=>{const n=Array.prototype.filter.call(s.options,r=>r.selected).map(r=>t?jh(vl(r)):vl(r));s[rn](s.multiple?pa(s._modelValue)?new Set(n):n:n[0]),s._assigning=!0,Kh(()=>{s._assigning=!1})}),s[rn]=la(i)},mounted(s,{value:e}){Cg(s,e)},beforeUpdate(s,{value:e},t){s._modelValue=e,s[rn]=la(t)},updated(s,{value:e}){s._assigning||Cg(s,e)}};function Cg(s,e){const t=s.multiple,i=ze(e);if(!(t&&!i&&!pa(e))){for(let n=0,r=s.options.length;nString(l)===String(a)):o.selected=Zm(e,a)>-1}else o.selected=e.has(a);else if(ga(vl(o),e)){s.selectedIndex!==n&&(s.selectedIndex=n);return}}!t&&s.selectedIndex!==-1&&(s.selectedIndex=-1)}}function vl(s){return"_value"in s?s._value:s.value}function Gx(s,e){const t=e?"_trueValue":"_falseValue";return t in s?s[t]:e}const O2=["ctrl","shift","alt","meta"],L2={stop:s=>s.stopPropagation(),prevent:s=>s.preventDefault(),self:s=>s.target!==s.currentTarget,ctrl:s=>!s.ctrlKey,shift:s=>!s.shiftKey,alt:s=>!s.altKey,meta:s=>!s.metaKey,left:s=>"button"in s&&s.button!==0,middle:s=>"button"in s&&s.button!==1,right:s=>"button"in s&&s.button!==2,exact:(s,e)=>O2.some(t=>s[`${t}Key`]&&!e.includes(t))},qe=(s,e)=>{if(!s)return s;const t=s._withMods||(s._withMods={}),i=e.join(".");return t[i]||(t[i]=((n,...r)=>{for(let o=0;o{const t=s._withKeys||(s._withKeys={}),i=e.join(".");return t[i]||(t[i]=(n=>{if(!("key"in n))return;const r=Ir(n.key);if(e.some(o=>o===r||B2[o]===r))return s(n)}))},N2=pi({patchProp:R2},l2);let Eg;function D2(){return Eg||(Eg=VT(N2))}const U2=((...s)=>{const e=D2().createApp(...s),{mount:t}=e;return e.mount=i=>{const n=X2(i);if(!n)return;const r=e._component;!at(r)&&!r.render&&!r.template&&(r.template=n.innerHTML),n.nodeType===1&&(n.textContent="");const o=t(n,!1,$2(n));return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),o},e});function $2(s){if(s instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&s instanceof MathMLElement)return"mathml"}function X2(s){return Gt(s)?document.querySelector(s):s}/*! + * pinia v4.0.3 + * (c) 2026 Eduardo San Martin Morote + * @license MIT + */let jx;const nu=s=>jx=s,Hx=Symbol();function Ag(s){return s&&typeof s=="object"&&Object.prototype.toString.call(s)==="[object Object]"&&typeof s.toJSON!="function"}function V2(){const s=Xy(!0),e=s.run(()=>Fe({}));let t=[],i=[];const n=vr({install(r){nu(n),n._a=r,r.provide(Hx,n),r.config.globalProperties.$pinia=n,i.forEach(o=>t.push(o)),i=[]},use(r){return this._a?t.push(r):i.push(r),this},_p:t,_a:null,_e:s,_s:new Map,state:e});return n}const Of=()=>{};function Ig(s,e,t,i=Of){s.add(e);const n=()=>{s.delete(e)&&i()};return!t&&Vy()&&bM(n),n}function _o(s,...e){s.forEach(t=>{t(...e)})}const Y2=s=>s(),Rg=Symbol(),Du=Symbol();function Lf(s,e){s instanceof Map&&e instanceof Map?e.forEach((t,i)=>s.set(i,t)):s instanceof Set&&e instanceof Set&&e.forEach(s.add,s);for(const t in e){if(!Object.hasOwn(e,t))continue;const i=e[t],n=s[t];Ag(n)&&Ag(i)&&Object.hasOwn(s,t)&&!jt(i)&&!Un(i)?s[t]=Lf(n,i):s[t]=i}return s}const G2=Symbol();function j2(s){return!s||typeof s!="object"||!Object.hasOwn(s,G2)}const{assign:nr}=Object;function H2(s){return!!(jt(s)&&s.effect)}function W2(s,e,t,i){const{state:n,actions:r,getters:o}=e,a=t.state.value[s];let c;function l(){a||(t.state.value[s]=n?n():{});const h=YM(t.state.value[s]);return nr(h,r,Object.keys(o||{}).reduce((u,d)=>(u[d]=vr(Le(()=>{nu(t);const f=t._s.get(s);return o[d].call(f,f)})),u),{}))}return c=Wx(s,l,e,t,i,!0),c}function Wx(s,e,t={},i,n,r){let o;const a=nr({actions:{}},t),c={deep:!0};let l,h,u=new Set,d=new Set,f;const m=i.state.value[s];!r&&!m&&(i.state.value[s]={});let p;function g(b){let _;l=h=!1,typeof b=="function"?(b(i.state.value[s]),_={type:"patch function",storeId:s,events:f}):(Lf(i.state.value[s],b),_={type:"patch object",payload:b,storeId:s,events:f});const A=p=Symbol();Kh().then(()=>{p===A&&(l=!0)}),h=!0,_o(u,_,i.state.value[s])}const x=r?function(){const{state:_}=t,A=_?_():{};this.$patch(P=>{nr(P,A)})}:Of;function v(){o.stop(),u.clear(),d.clear(),i._s.delete(s)}const y=(b,_="")=>{if(Rg in b)return b[Du]=_,b;const A=function(){nu(i);const P=Array.from(arguments),E=new Set,R=new Set;function O($){E.add($)}function U($){R.add($)}_o(d,{args:P,name:A[Du],store:C,after:O,onError:U});let Y;try{Y=b.apply(this&&this.$id===s?this:C,P)}catch($){throw _o(R,$),$}return Y instanceof Promise?Y.then($=>(_o(E,$),$)).catch($=>(_o(R,$),Promise.reject($))):(_o(E,Y),Y)};return A[Rg]=!0,A[Du]=_,A},S={_p:i,$id:s,$onAction:Ig.bind(null,d),$patch:g,$reset:x,$subscribe(b,_={}){if(u.has(b))return Of;const A=Ig(u,b,_.detached,()=>P()),P=o.run(()=>ai(()=>i.state.value[s],E=>{(_.flush==="sync"?h:l)&&b({storeId:s,type:"direct",events:f},E)},nr({},c,_)));return A},$dispose:v},C=po(S);i._s.set(s,C);const w=(i._a&&i._a.runWithContext||Y2)(()=>i._e.run(()=>(o=Xy()).run(()=>e({action:y}))));for(const b in w){const _=w[b];jt(_)&&!H2(_)||Un(_)?r||(m&&j2(_)&&(jt(_)?_.value=m[b]:((_ instanceof Set||_ instanceof Map)&&_.clear(),Lf(_,m[b]))),i.state.value[s][b]=_):typeof _=="function"&&(w[b]=y(_,b),a.actions[b]=_)}return nr(C,w),nr(Tt(C),w),Object.defineProperty(C,"$state",{get:()=>i.state.value[s],set:b=>{g(_=>{nr(_,b)})}}),i._p.forEach(b=>{const _=o.run(()=>b({store:C,app:i._a,pinia:i,options:a}));nr(C,_)}),m&&r&&t.hydrate&&t.hydrate(C.$state,m),l=!0,h=!0,C}/*! #__NO_SIDE_EFFECTS__ */function z2(s,e,t){let i;const n=typeof e=="function";i=n?t:e;function r(o,a){const c=QM();return o=o||(c?qo(Hx,null):null),o&&nu(o),o=jx,o._s.has(s)||(n?Wx(s,e,i,o):W2(s,i,o)),o._s.get(s)}return r.$id=s,r}var go=(s=>(s[s.WEBGL_LEGACY=0]="WEBGL_LEGACY",s[s.WEBGL=1]="WEBGL",s[s.WEBGL2=2]="WEBGL2",s))(go||{}),zx=(s=>(s[s.UNKNOWN=0]="UNKNOWN",s[s.WEBGL=1]="WEBGL",s[s.CANVAS=2]="CANVAS",s))(zx||{}),Bf=(s=>(s[s.COLOR=16384]="COLOR",s[s.DEPTH=256]="DEPTH",s[s.STENCIL=1024]="STENCIL",s))(Bf||{}),We=(s=>(s[s.NORMAL=0]="NORMAL",s[s.ADD=1]="ADD",s[s.MULTIPLY=2]="MULTIPLY",s[s.SCREEN=3]="SCREEN",s[s.OVERLAY=4]="OVERLAY",s[s.DARKEN=5]="DARKEN",s[s.LIGHTEN=6]="LIGHTEN",s[s.COLOR_DODGE=7]="COLOR_DODGE",s[s.COLOR_BURN=8]="COLOR_BURN",s[s.HARD_LIGHT=9]="HARD_LIGHT",s[s.SOFT_LIGHT=10]="SOFT_LIGHT",s[s.DIFFERENCE=11]="DIFFERENCE",s[s.EXCLUSION=12]="EXCLUSION",s[s.HUE=13]="HUE",s[s.SATURATION=14]="SATURATION",s[s.COLOR=15]="COLOR",s[s.LUMINOSITY=16]="LUMINOSITY",s[s.NORMAL_NPM=17]="NORMAL_NPM",s[s.ADD_NPM=18]="ADD_NPM",s[s.SCREEN_NPM=19]="SCREEN_NPM",s[s.NONE=20]="NONE",s[s.SRC_OVER=0]="SRC_OVER",s[s.SRC_IN=21]="SRC_IN",s[s.SRC_OUT=22]="SRC_OUT",s[s.SRC_ATOP=23]="SRC_ATOP",s[s.DST_OVER=24]="DST_OVER",s[s.DST_IN=25]="DST_IN",s[s.DST_OUT=26]="DST_OUT",s[s.DST_ATOP=27]="DST_ATOP",s[s.ERASE=26]="ERASE",s[s.SUBTRACT=28]="SUBTRACT",s[s.XOR=29]="XOR",s))(We||{}),on=(s=>(s[s.POINTS=0]="POINTS",s[s.LINES=1]="LINES",s[s.LINE_LOOP=2]="LINE_LOOP",s[s.LINE_STRIP=3]="LINE_STRIP",s[s.TRIANGLES=4]="TRIANGLES",s[s.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",s[s.TRIANGLE_FAN=6]="TRIANGLE_FAN",s))(on||{}),Te=(s=>(s[s.RGBA=6408]="RGBA",s[s.RGB=6407]="RGB",s[s.RG=33319]="RG",s[s.RED=6403]="RED",s[s.RGBA_INTEGER=36249]="RGBA_INTEGER",s[s.RGB_INTEGER=36248]="RGB_INTEGER",s[s.RG_INTEGER=33320]="RG_INTEGER",s[s.RED_INTEGER=36244]="RED_INTEGER",s[s.ALPHA=6406]="ALPHA",s[s.LUMINANCE=6409]="LUMINANCE",s[s.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",s[s.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",s[s.DEPTH_STENCIL=34041]="DEPTH_STENCIL",s))(Te||{}),Zo=(s=>(s[s.TEXTURE_2D=3553]="TEXTURE_2D",s[s.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",s[s.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",s[s.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",s[s.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",s[s.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",s[s.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",s[s.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",s[s.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",s))(Zo||{}),Ue=(s=>(s[s.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",s[s.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",s[s.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",s[s.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",s[s.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",s[s.UNSIGNED_INT=5125]="UNSIGNED_INT",s[s.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",s[s.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",s[s.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",s[s.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",s[s.BYTE=5120]="BYTE",s[s.SHORT=5122]="SHORT",s[s.INT=5124]="INT",s[s.FLOAT=5126]="FLOAT",s[s.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",s[s.HALF_FLOAT=36193]="HALF_FLOAT",s))(Ue||{}),De=(s=>(s[s.FLOAT=0]="FLOAT",s[s.INT=1]="INT",s[s.UINT=2]="UINT",s))(De||{}),Rs=(s=>(s[s.NEAREST=0]="NEAREST",s[s.LINEAR=1]="LINEAR",s))(Rs||{}),Os=(s=>(s[s.CLAMP=33071]="CLAMP",s[s.REPEAT=10497]="REPEAT",s[s.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",s))(Os||{}),vs=(s=>(s[s.OFF=0]="OFF",s[s.POW2=1]="POW2",s[s.ON=2]="ON",s[s.ON_MANUAL=3]="ON_MANUAL",s))(vs||{}),bi=(s=>(s[s.NPM=0]="NPM",s[s.UNPACK=1]="UNPACK",s[s.PMA=2]="PMA",s[s.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",s[s.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",s[s.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",s))(bi||{}),en=(s=>(s[s.NO=0]="NO",s[s.YES=1]="YES",s[s.AUTO=2]="AUTO",s[s.BLEND=0]="BLEND",s[s.CLEAR=1]="CLEAR",s[s.BLIT=2]="BLIT",s))(en||{}),up=(s=>(s[s.AUTO=0]="AUTO",s[s.MANUAL=1]="MANUAL",s))(up||{}),ms=(s=>(s.LOW="lowp",s.MEDIUM="mediump",s.HIGH="highp",s))(ms||{}),ui=(s=>(s[s.NONE=0]="NONE",s[s.SCISSOR=1]="SCISSOR",s[s.STENCIL=2]="STENCIL",s[s.SPRITE=3]="SPRITE",s[s.COLOR=4]="COLOR",s))(ui||{}),ci=(s=>(s[s.NONE=0]="NONE",s[s.LOW=2]="LOW",s[s.MEDIUM=4]="MEDIUM",s[s.HIGH=8]="HIGH",s))(ci||{}),hn=(s=>(s[s.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",s[s.ARRAY_BUFFER=34962]="ARRAY_BUFFER",s[s.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",s))(hn||{});const q2={createCanvas:(s,e)=>{const t=document.createElement("canvas");return t.width=s,t.height=e,t},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(s,e)=>fetch(s,e),parseXML:s=>new DOMParser().parseFromString(s,"text/xml")},Be={ADAPTER:q2,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var Uu=/iPhone/i,Pg=/iPod/i,kg=/iPad/i,Fg=/\biOS-universal(?:.+)Mac\b/i,$u=/\bAndroid(?:.+)Mobile\b/i,Og=/Android/i,Co=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Wl=/Silk/i,bn=/Windows Phone/i,Lg=/\bWindows(?:.+)ARM\b/i,Bg=/BlackBerry/i,Ng=/BB10/i,Dg=/Opera Mini/i,Ug=/\b(CriOS|Chrome)(?:.+)Mobile/i,$g=/Mobile(?:.+)Firefox\b/i,Xg=function(s){return typeof s<"u"&&s.platform==="MacIntel"&&typeof s.maxTouchPoints=="number"&&s.maxTouchPoints>1&&typeof MSStream>"u"};function K2(s){return function(e){return e.test(s)}}function Vg(s){var e={userAgent:"",platform:"",maxTouchPoints:0};!s&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof s=="string"?e.userAgent=s:s&&s.userAgent&&(e={userAgent:s.userAgent,platform:s.platform,maxTouchPoints:s.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var n=K2(t),r={apple:{phone:n(Uu)&&!n(bn),ipod:n(Pg),tablet:!n(Uu)&&(n(kg)||Xg(e))&&!n(bn),universal:n(Fg),device:(n(Uu)||n(Pg)||n(kg)||n(Fg)||Xg(e))&&!n(bn)},amazon:{phone:n(Co),tablet:!n(Co)&&n(Wl),device:n(Co)||n(Wl)},android:{phone:!n(bn)&&n(Co)||!n(bn)&&n($u),tablet:!n(bn)&&!n(Co)&&!n($u)&&(n(Wl)||n(Og)),device:!n(bn)&&(n(Co)||n(Wl)||n($u)||n(Og))||n(/\bokhttp\b/i)},windows:{phone:n(bn),tablet:n(Lg),device:n(bn)||n(Lg)},other:{blackberry:n(Bg),blackberry10:n(Ng),opera:n(Dg),firefox:n($g),chrome:n(Ug),device:n(Bg)||n(Ng)||n(Dg)||n($g)||n(Ug)},any:!1,phone:!1,tablet:!1};return r.any=r.apple.device||r.android.device||r.windows.device||r.other.device,r.phone=r.apple.phone||r.android.phone||r.windows.phone,r.tablet=r.apple.tablet||r.android.tablet||r.windows.tablet,r}const Z2=Vg.default??Vg,kn=Z2(globalThis.navigator);Be.RETINA_PREFIX=/@([0-9\.]+)x/;Be.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var th=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qx(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function J2(s){if(Object.prototype.hasOwnProperty.call(s,"__esModule"))return s;var e=s.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(i){var n=Object.getOwnPropertyDescriptor(s,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return s[i]}})}),t}var Xu={exports:{}},Yg;function Q2(){return Yg||(Yg=1,(function(s){var e=Object.prototype.hasOwnProperty,t="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(t=!1));function n(c,l,h){this.fn=c,this.context=l,this.once=h||!1}function r(c,l,h,u,d){if(typeof h!="function")throw new TypeError("The listener must be a function");var f=new n(h,u||c,d),m=t?t+l:l;return c._events[m]?c._events[m].fn?c._events[m]=[c._events[m],f]:c._events[m].push(f):(c._events[m]=f,c._eventsCount++),c}function o(c,l){--c._eventsCount===0?c._events=new i:delete c._events[l]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],h,u;if(this._eventsCount===0)return l;for(u in h=this._events)e.call(h,u)&&l.push(t?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(h)):l},a.prototype.listeners=function(l){var h=t?t+l:l,u=this._events[h];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,f=u.length,m=new Array(f);d80*D){G=Z=$[0],W=ne=$[1];for(var he=D;heZ&&(Z=oe),de>ne&&(ne=de);pe=Math.max(Z-G,ne-W),pe=pe!==0?32767/pe:0}return i(k,V,D,G,W,pe,0),V}function e($,X,D,F,N){var k,V;if(N===Y($,X,D,F)>0)for(k=X;k=X;k-=F)V=R(k,$[k],$[k+1],V);return V&&S(V,V.next)&&(O(V),V=V.next),V}function t($,X){if(!$)return $;X||(X=$);var D=$,F;do if(F=!1,!D.steiner&&(S(D,D.next)||y(D.prev,D,D.next)===0)){if(O(D),D=X=D.prev,D===D.next)break;F=!0}else D=D.next;while(F||D!==X);return X}function i($,X,D,F,N,k,V){if($){!V&&k&&f($,F,N,k);for(var G=$,W,Z;$.prev!==$.next;){if(W=$.prev,Z=$.next,k?r($,F,N,k):n($)){X.push(W.i/D|0),X.push($.i/D|0),X.push(Z.i/D|0),O($),$=Z.next,G=Z.next;continue}if($=Z,$===G){V?V===1?($=o(t($),X,D),i($,X,D,F,N,k,2)):V===2&&a($,X,D,F,N,k):i(t($),X,D,F,N,k,1);break}}}}function n($){var X=$.prev,D=$,F=$.next;if(y(X,D,F)>=0)return!1;for(var N=X.x,k=D.x,V=F.x,G=X.y,W=D.y,Z=F.y,ne=Nk?N>V?N:V:k>V?k:V,pe=G>W?G>Z?G:Z:W>Z?W:Z,he=F.next;he!==X;){if(he.x>=ne&&he.x<=de&&he.y>=oe&&he.y<=pe&&x(N,G,k,W,V,Z,he.x,he.y)&&y(he.prev,he,he.next)>=0)return!1;he=he.next}return!0}function r($,X,D,F){var N=$.prev,k=$,V=$.next;if(y(N,k,V)>=0)return!1;for(var G=N.x,W=k.x,Z=V.x,ne=N.y,oe=k.y,de=V.y,pe=GW?G>Z?G:Z:W>Z?W:Z,H=ne>oe?ne>de?ne:de:oe>de?oe:de,z=p(pe,he,X,D,F),K=p(me,H,X,D,F),B=$.prevZ,L=$.nextZ;B&&B.z>=z&&L&&L.z<=K;){if(B.x>=pe&&B.x<=me&&B.y>=he&&B.y<=H&&B!==N&&B!==V&&x(G,ne,W,oe,Z,de,B.x,B.y)&&y(B.prev,B,B.next)>=0||(B=B.prevZ,L.x>=pe&&L.x<=me&&L.y>=he&&L.y<=H&&L!==N&&L!==V&&x(G,ne,W,oe,Z,de,L.x,L.y)&&y(L.prev,L,L.next)>=0))return!1;L=L.nextZ}for(;B&&B.z>=z;){if(B.x>=pe&&B.x<=me&&B.y>=he&&B.y<=H&&B!==N&&B!==V&&x(G,ne,W,oe,Z,de,B.x,B.y)&&y(B.prev,B,B.next)>=0)return!1;B=B.prevZ}for(;L&&L.z<=K;){if(L.x>=pe&&L.x<=me&&L.y>=he&&L.y<=H&&L!==N&&L!==V&&x(G,ne,W,oe,Z,de,L.x,L.y)&&y(L.prev,L,L.next)>=0)return!1;L=L.nextZ}return!0}function o($,X,D){var F=$;do{var N=F.prev,k=F.next.next;!S(N,k)&&C(N,F,F.next,k)&&A(N,k)&&A(k,N)&&(X.push(N.i/D|0),X.push(F.i/D|0),X.push(k.i/D|0),O(F),O(F.next),F=$=k),F=F.next}while(F!==$);return t(F)}function a($,X,D,F,N,k){var V=$;do{for(var G=V.next.next;G!==V.prev;){if(V.i!==G.i&&v(V,G)){var W=E(V,G);V=t(V,V.next),W=t(W,W.next),i(V,X,D,F,N,k,0),i(W,X,D,F,N,k,0);return}G=G.next}V=V.next}while(V!==$)}function c($,X,D,F){var N=[],k,V,G,W,Z;for(k=0,V=X.length;k=D.next.y&&D.next.y!==D.y){var G=D.x+(N-D.y)*(D.next.x-D.x)/(D.next.y-D.y);if(G<=F&&G>k&&(k=G,V=D.x=D.x&&D.x>=Z&&F!==D.x&&x(NV.x||D.x===V.x&&d(V,D)))&&(V=D,oe=de)),D=D.next;while(D!==W);return V}function d($,X){return y($.prev,$,X.prev)<0&&y(X.next,$,$.next)<0}function f($,X,D,F){var N=$;do N.z===0&&(N.z=p(N.x,N.y,X,D,F)),N.prevZ=N.prev,N.nextZ=N.next,N=N.next;while(N!==$);N.prevZ.nextZ=null,N.prevZ=null,m(N)}function m($){var X,D,F,N,k,V,G,W,Z=1;do{for(D=$,$=null,k=null,V=0;D;){for(V++,F=D,G=0,X=0;X0||W>0&&F;)G!==0&&(W===0||!F||D.z<=F.z)?(N=D,D=D.nextZ,G--):(N=F,F=F.nextZ,W--),k?k.nextZ=N:$=N,N.prevZ=k,k=N;D=F}k.nextZ=null,Z*=2}while(V>1);return $}function p($,X,D,F,N){return $=($-D)*N|0,X=(X-F)*N|0,$=($|$<<8)&16711935,$=($|$<<4)&252645135,$=($|$<<2)&858993459,$=($|$<<1)&1431655765,X=(X|X<<8)&16711935,X=(X|X<<4)&252645135,X=(X|X<<2)&858993459,X=(X|X<<1)&1431655765,$|X<<1}function g($){var X=$,D=$;do(X.x=($-V)*(k-G)&&($-V)*(F-G)>=(D-V)*(X-G)&&(D-V)*(k-G)>=(N-V)*(F-G)}function v($,X){return $.next.i!==X.i&&$.prev.i!==X.i&&!_($,X)&&(A($,X)&&A(X,$)&&P($,X)&&(y($.prev,$,X.prev)||y($,X.prev,X))||S($,X)&&y($.prev,$,$.next)>0&&y(X.prev,X,X.next)>0)}function y($,X,D){return(X.y-$.y)*(D.x-X.x)-(X.x-$.x)*(D.y-X.y)}function S($,X){return $.x===X.x&&$.y===X.y}function C($,X,D,F){var N=b(y($,X,D)),k=b(y($,X,F)),V=b(y(D,F,$)),G=b(y(D,F,X));return!!(N!==k&&V!==G||N===0&&w($,D,X)||k===0&&w($,F,X)||V===0&&w(D,$,F)||G===0&&w(D,X,F))}function w($,X,D){return X.x<=Math.max($.x,D.x)&&X.x>=Math.min($.x,D.x)&&X.y<=Math.max($.y,D.y)&&X.y>=Math.min($.y,D.y)}function b($){return $>0?1:$<0?-1:0}function _($,X){var D=$;do{if(D.i!==$.i&&D.next.i!==$.i&&D.i!==X.i&&D.next.i!==X.i&&C(D,D.next,$,X))return!0;D=D.next}while(D!==$);return!1}function A($,X){return y($.prev,$,$.next)<0?y($,X,$.next)>=0&&y($,$.prev,X)>=0:y($,X,$.prev)<0||y($,$.next,X)<0}function P($,X){var D=$,F=!1,N=($.x+X.x)/2,k=($.y+X.y)/2;do D.y>k!=D.next.y>k&&D.next.y!==D.y&&N<(D.next.x-D.x)*(k-D.y)/(D.next.y-D.y)+D.x&&(F=!F),D=D.next;while(D!==$);return F}function E($,X){var D=new U($.i,$.x,$.y),F=new U(X.i,X.x,X.y),N=$.next,k=X.prev;return $.next=X,X.prev=$,D.next=N,N.prev=D,F.next=D,D.prev=F,k.next=F,F.prev=k,F}function R($,X,D,F){var N=new U($,X,D);return F?(N.next=F.next,N.prev=F,F.next.prev=N,F.next=N):(N.prev=N,N.next=N),N}function O($){$.next.prev=$.prev,$.prev.next=$.next,$.prevZ&&($.prevZ.nextZ=$.nextZ),$.nextZ&&($.nextZ.prevZ=$.prevZ)}function U($,X,D){this.i=$,this.x=X,this.y=D,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}s.deviation=function($,X,D,F){var N=X&&X.length,k=N?X[0]*D:$.length,V=Math.abs(Y($,0,k,D));if(N)for(var G=0,W=X.length;G0&&(F+=$[N-1].length,D.holes.push(F))}return D},zl.exports}var i_=t_();const s_=qx(i_);var Dr={},$a={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var n_=$a.exports,jg;function r_(){return jg||(jg=1,(function(s,e){(function(t){var i=e&&!e.nodeType&&e,n=s&&!s.nodeType&&s,r=typeof th=="object"&&th;(r.global===r||r.window===r||r.self===r)&&(t=r);var o,a=2147483647,c=36,l=1,h=26,u=38,d=700,f=72,m=128,p="-",g=/^xn--/,x=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},S=c-l,C=Math.floor,w=String.fromCharCode,b;function _(N){throw new RangeError(y[N])}function A(N,k){for(var V=N.length,G=[];V--;)G[V]=k(N[V]);return G}function P(N,k){var V=N.split("@"),G="";V.length>1&&(G=V[0]+"@",N=V[1]),N=N.replace(v,".");var W=N.split("."),Z=A(W,k).join(".");return G+Z}function E(N){for(var k=[],V=0,G=N.length,W,Z;V=55296&&W<=56319&&V65535&&(k-=65536,V+=w(k>>>10&1023|55296),k=56320|k&1023),V+=w(k),V}).join("")}function O(N){return N-48<10?N-22:N-65<26?N-65:N-97<26?N-97:c}function U(N,k){return N+22+75*(N<26)-((k!=0)<<5)}function Y(N,k,V){var G=0;for(N=V?C(N/d):N>>1,N+=C(N/k);N>S*h>>1;G+=c)N=C(N/S);return C(G+(S+1)*N/(N+u))}function $(N){var k=[],V=N.length,G,W=0,Z=m,ne=f,oe,de,pe,he,me,H,z,K,B;for(oe=N.lastIndexOf(p),oe<0&&(oe=0),de=0;de=128&&_("not-basic"),k.push(N.charCodeAt(de));for(pe=oe>0?oe+1:0;pe=V&&_("invalid-input"),z=O(N.charCodeAt(pe++)),(z>=c||z>C((a-W)/me))&&_("overflow"),W+=z*me,K=H<=ne?l:H>=ne+h?h:H-ne,!(zC(a/B)&&_("overflow"),me*=B;G=k.length+1,ne=Y(W-he,G,he==0),C(W/G)>a-Z&&_("overflow"),Z+=C(W/G),W%=G,k.splice(W++,0,Z)}return R(k)}function X(N){var k,V,G,W,Z,ne,oe,de,pe,he,me,H=[],z,K,B,L;for(N=E(N),z=N.length,k=m,V=0,Z=f,ne=0;ne=k&&meC((a-V)/K)&&_("overflow"),V+=(oe-k)*K,k=oe,ne=0;nea&&_("overflow"),me==k){for(de=V,pe=c;he=pe<=Z?l:pe>=Z+h?h:pe-Z,!(de-1e3&&re<1e3||w.call(/e/,ae))return ae;var et=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof re=="number"){var It=re<0?-P(-re):P(re);if(It!==re){var kt=String(It),ot=v.call(ae,kt.length+1);return y.call(kt,et,"$&_")+"."+y.call(y.call(ot,/([0-9]{3})/g,"$&_"),/_$/,"")}}return y.call(ae,et,"$&_")}var F=l_,N=F.custom,k=K(N)?N:null,V={__proto__:null,double:'"',single:"'"},G={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Yu=function re(ae,et,It,kt){var ot=et||{};if(j(ot,"quoteStyle")&&!j(V,ot.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(j(ot,"maxStringLength")&&(typeof ot.maxStringLength=="number"?ot.maxStringLength<0&&ot.maxStringLength!==1/0:ot.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Gi=j(ot,"customInspect")?ot.customInspect:!0;if(typeof Gi!="boolean"&&Gi!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(j(ot,"indent")&&ot.indent!==null&&ot.indent!==" "&&!(parseInt(ot.indent,10)===ot.indent&&ot.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(j(ot,"numericSeparator")&&typeof ot.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var xs=ot.numericSeparator;if(typeof ae>"u")return"undefined";if(ae===null)return"null";if(typeof ae=="boolean")return ae?"true":"false";if(typeof ae=="string")return Ze(ae,ot);if(typeof ae=="number"){if(ae===0)return 1/0/ae>0?"0":"-0";var Nt=String(ae);return xs?D(ae,Nt):Nt}if(typeof ae=="bigint"){var vi=String(ae)+"n";return xs?D(ae,vi):vi}var Xt=typeof ot.depth>"u"?5:ot.depth;if(typeof It>"u"&&(It=0),It>=Xt&&Xt>0&&typeof ae=="object")return oe(ae)?"[Array]":"[Object]";var ji=Ee(ot,It);if(typeof kt>"u")kt=[];else if(fe(kt,ae)>=0)return"[Circular]";function ni(Jn,So,Tu){if(So&&(kt=A.call(kt),kt.push(So)),Tu){var Xl={depth:ot.depth};return j(ot,"quoteStyle")&&(Xl.quoteStyle=ot.quoteStyle),re(Jn,Xl,It+1,kt)}return re(Jn,ot,It+1,kt)}if(typeof ae=="function"&&!pe(ae)){var bs=ue(ae),ws=ut(ae,ni);return"[Function"+(bs?": "+bs:" (anonymous)")+"]"+(ws.length>0?" { "+_.call(ws,", ")+" }":"")}if(K(ae)){var $s=U?y.call(String(ae),/^(Symbol\(.*\))_[^)]*$/,"$1"):O.call(ae);return typeof ae=="object"&&!U?Je($s):$s}if(Ve(ae)){for(var Zi="<"+C.call(String(ae.nodeName)),Zn=ae.attributes||[],gn=0;gn",Zi}if(oe(ae)){if(ae.length===0)return"[]";var wa=ut(ae,ni);return ji&&!Qe(wa)?"["+Qt(wa,ji)+"]":"[ "+_.call(wa,", ")+" ]"}if(he(ae)){var Sa=ut(ae,ni);return!("cause"in Error.prototype)&&"cause"in ae&&!$.call(ae,"cause")?"{ ["+String(ae)+"] "+_.call(b.call("[cause]: "+ni(ae.cause),Sa),", ")+" }":Sa.length===0?"["+String(ae)+"]":"{ ["+String(ae)+"] "+_.call(Sa,", ")+" }"}if(typeof ae=="object"&&Gi){if(k&&typeof ae[k]=="function"&&F)return F(ae,{depth:Xt-It});if(Gi!=="symbol"&&typeof ae.inspect=="function")return ae.inspect()}if(ee(ae)){var Dl=[];return i&&i.call(ae,function(Jn,So){Dl.push(ni(So,ae,!0)+" => "+ni(Jn,ae))}),Ae("Map",t.call(ae),Dl,ji)}if(ge(ae)){var Ul=[];return a&&a.call(ae,function(Jn){Ul.push(ni(Jn,ae))}),Ae("Set",o.call(ae),Ul,ji)}if(Me(ae))return je("WeakMap");if(Ne(ae))return je("WeakSet");if(be(ae))return je("WeakRef");if(H(ae))return Je(ni(Number(ae)));if(B(ae))return Je(ni(E.call(ae)));if(z(ae))return Je(m.call(ae));if(me(ae))return Je(ni(String(ae)));if(typeof window<"u"&&ae===window)return"{ [object Window] }";if(typeof globalThis<"u"&&ae===globalThis||typeof th<"u"&&ae===th)return"{ [object globalThis] }";if(!de(ae)&&!pe(ae)){var Ma=ut(ae,ni),Ta=X?X(ae)===Object.prototype:ae instanceof Object||ae.constructor===Object,_a=ae instanceof Object?"":"null prototype",$l=!Ta&&Y&&Object(ae)===ae&&Y in ae?v.call(ie(ae),8,-1):_a?"Object":"",Mu=Ta||typeof ae.constructor!="function"?"":ae.constructor.name?ae.constructor.name+" ":"",Ca=Mu+($l||_a?"["+_.call(b.call([],$l||[],_a||[]),": ")+"] ":"");return Ma.length===0?Ca+"{}":ji?Ca+"{"+Qt(Ma,ji)+"}":Ca+"{ "+_.call(Ma,", ")+" }"}return String(ae)};function W(re,ae,et){var It=et.quoteStyle||ae,kt=V[It];return kt+re+kt}function Z(re){return y.call(String(re),/"/g,""")}function ne(re){return!Y||!(typeof re=="object"&&(Y in re||typeof re[Y]<"u"))}function oe(re){return ie(re)==="[object Array]"&&ne(re)}function de(re){return ie(re)==="[object Date]"&&ne(re)}function pe(re){return ie(re)==="[object RegExp]"&&ne(re)}function he(re){return ie(re)==="[object Error]"&&ne(re)}function me(re){return ie(re)==="[object String]"&&ne(re)}function H(re){return ie(re)==="[object Number]"&&ne(re)}function z(re){return ie(re)==="[object Boolean]"&&ne(re)}function K(re){if(U)return re&&typeof re=="object"&&re instanceof Symbol;if(typeof re=="symbol")return!0;if(!re||typeof re!="object"||!O)return!1;try{return O.call(re),!0}catch{}return!1}function B(re){if(!re||typeof re!="object"||!E)return!1;try{return E.call(re),!0}catch{}return!1}var L=Object.prototype.hasOwnProperty||function(re){return re in this};function j(re,ae){return L.call(re,ae)}function ie(re){return p.call(re)}function ue(re){if(re.name)return re.name;var ae=x.call(g.call(re),/^function\s*([\w$]+)/);return ae?ae[1]:null}function fe(re,ae){if(re.indexOf)return re.indexOf(ae);for(var et=0,It=re.length;etae.maxStringLength){var et=re.length-ae.maxStringLength,It="... "+et+" more character"+(et>1?"s":"");return Ze(v.call(re,0,ae.maxStringLength),ae)+It}var kt=G[ae.quoteStyle||"single"];kt.lastIndex=0;var ot=y.call(y.call(re,kt,"\\$1"),/[\x00-\x1f]/g,rt);return W(ot,"single",ae)}function rt(re){var ae=re.charCodeAt(0),et={8:"b",9:"t",10:"n",12:"f",13:"r"}[ae];return et?"\\"+et:"\\x"+(ae<16?"0":"")+S.call(ae.toString(16))}function Je(re){return"Object("+re+")"}function je(re){return re+" { ? }"}function Ae(re,ae,et,It){var kt=It?Qt(et,It):_.call(et,", ");return re+" ("+ae+") {"+kt+"}"}function Qe(re){for(var ae=0;ae=0)return!1;return!0}function Ee(re,ae){var et;if(re.indent===" ")et=" ";else if(typeof re.indent=="number"&&re.indent>0)et=_.call(Array(re.indent+1)," ");else return null;return{base:et,prev:_.call(Array(ae+1),et)}}function Qt(re,ae){if(re.length===0)return"";var et=` +`+ae.prev+ae.base;return et+_.call(re,","+et)+` +`+ae.prev}function ut(re,ae){var et=oe(re),It=[];if(et){It.length=re.length;for(var kt=0;kt"u"||!b?s:b(Uint8Array),U={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?s:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?s:ArrayBuffer,"%ArrayIteratorPrototype%":w&&b?b([][Symbol.iterator]()):s,"%AsyncFromSyncIteratorPrototype%":s,"%AsyncFunction%":R,"%AsyncGenerator%":R,"%AsyncGeneratorFunction%":R,"%AsyncIteratorPrototype%":R,"%Atomics%":typeof Atomics>"u"?s:Atomics,"%BigInt%":typeof BigInt>"u"?s:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?s:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?s:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?s:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":i,"%Float16Array%":typeof Float16Array>"u"?s:Float16Array,"%Float32Array%":typeof Float32Array>"u"?s:Float32Array,"%Float64Array%":typeof Float64Array>"u"?s:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?s:FinalizationRegistry,"%Function%":g,"%GeneratorFunction%":R,"%Int8Array%":typeof Int8Array>"u"?s:Int8Array,"%Int16Array%":typeof Int16Array>"u"?s:Int16Array,"%Int32Array%":typeof Int32Array>"u"?s:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":w&&b?b(b([][Symbol.iterator]())):s,"%JSON%":typeof JSON=="object"?JSON:s,"%Map%":typeof Map>"u"?s:Map,"%MapIteratorPrototype%":typeof Map>"u"||!w||!b?s:b(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":v,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?s:Promise,"%Proxy%":typeof Proxy>"u"?s:Proxy,"%RangeError%":n,"%ReferenceError%":r,"%Reflect%":typeof Reflect>"u"?s:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?s:Set,"%SetIteratorPrototype%":typeof Set>"u"||!w||!b?s:b(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?s:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":w&&b?b(""[Symbol.iterator]()):s,"%Symbol%":w?Symbol:s,"%SyntaxError%":o,"%ThrowTypeError%":C,"%TypedArray%":O,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?s:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?s:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?s:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?s:Uint32Array,"%URIError%":c,"%WeakMap%":typeof WeakMap>"u"?s:WeakMap,"%WeakRef%":typeof WeakRef>"u"?s:WeakRef,"%WeakSet%":typeof WeakSet>"u"?s:WeakSet,"%Function.prototype.call%":E,"%Function.prototype.apply%":P,"%Object.defineProperty%":y,"%Object.getPrototypeOf%":_,"%Math.abs%":l,"%Math.floor%":h,"%Math.max%":u,"%Math.min%":d,"%Math.pow%":f,"%Math.round%":m,"%Math.sign%":p,"%Reflect.getPrototypeOf%":A};if(b)try{null.error}catch(pe){var Y=b(b(pe));U["%Error.prototype%"]=Y}var $=function pe(he){var me;if(he==="%AsyncFunction%")me=x("async function () {}");else if(he==="%GeneratorFunction%")me=x("function* () {}");else if(he==="%AsyncGeneratorFunction%")me=x("async function* () {}");else if(he==="%AsyncGenerator%"){var H=pe("%AsyncGeneratorFunction%");H&&(me=H.prototype)}else if(he==="%AsyncIteratorPrototype%"){var z=pe("%AsyncGenerator%");z&&b&&(me=b(z.prototype))}return U[he]=me,me},X={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},D=ou(),F=k_(),N=D.call(E,Array.prototype.concat),k=D.call(P,Array.prototype.splice),V=D.call(E,String.prototype.replace),G=D.call(E,String.prototype.slice),W=D.call(E,RegExp.prototype.exec),Z=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ne=/\\(\\)?/g,oe=function(he){var me=G(he,0,1),H=G(he,-1);if(me==="%"&&H!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(H==="%"&&me!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var z=[];return V(he,Z,function(K,B,L,j){z[z.length]=L?V(j,ne,"$1"):B||K}),z},de=function(he,me){var H=he,z;if(F(X,H)&&(z=X[H],H="%"+z[0]+"%"),F(U,H)){var K=U[H];if(K===R&&(K=$(H)),typeof K>"u"&&!me)throw new a("intrinsic "+he+" exists, but is not available. Please file an issue!");return{alias:z,name:H,value:K}}throw new o("intrinsic "+he+" does not exist!")};return Md=function(he,me){if(typeof he!="string"||he.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof me!="boolean")throw new a('"allowMissing" argument must be a boolean');if(W(/^%?[^%]*%?$/,he)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var H=oe(he),z=H.length>0?H[0]:"",K=de("%"+z+"%",me),B=K.name,L=K.value,j=!1,ie=K.alias;ie&&(z=ie[0],k(H,N([0,1],ie)));for(var ue=1,fe=!0;ue=H.length){var ge=v(L,ee);fe=!!ge,fe&&"get"in ge&&!("originalValue"in ge.get)?L=ge.get:L=L[ee]}else fe=F(L,ee),L=L[ee];fe&&!j&&(U[B]=L)}}return L},Md}var Td,A0;function sb(){if(A0)return Td;A0=1;var s=fp(),e=ib(),t=e([s("%String.prototype.indexOf%")]);return Td=function(n,r){var o=s(n,!!r);return typeof o=="function"&&t(n,".prototype.")>-1?e([o]):o},Td}var _d,I0;function nb(){if(I0)return _d;I0=1;var s=fp(),e=sb(),t=ru(),i=va(),n=s("%Map%",!0),r=e("Map.prototype.get",!0),o=e("Map.prototype.set",!0),a=e("Map.prototype.has",!0),c=e("Map.prototype.delete",!0),l=e("Map.prototype.size",!0);return _d=!!n&&function(){var u,d={assert:function(f){if(!d.has(f))throw new i("Side channel does not contain "+t(f))},delete:function(f){if(u){var m=c(u,f);return l(u)===0&&(u=void 0),m}return!1},get:function(f){if(u)return r(u,f)},has:function(f){return u?a(u,f):!1},set:function(f,m){u||(u=new n),o(u,f,m)}};return d},_d}var Cd,R0;function F_(){if(R0)return Cd;R0=1;var s=fp(),e=sb(),t=ru(),i=nb(),n=va(),r=s("%WeakMap%",!0),o=e("WeakMap.prototype.get",!0),a=e("WeakMap.prototype.set",!0),c=e("WeakMap.prototype.has",!0),l=e("WeakMap.prototype.delete",!0);return Cd=r?function(){var u,d,f={assert:function(m){if(!f.has(m))throw new n("Side channel does not contain "+t(m))},delete:function(m){if(r&&m&&(typeof m=="object"||typeof m=="function")){if(u)return l(u,m)}else if(i&&d)return d.delete(m);return!1},get:function(m){return r&&m&&(typeof m=="object"||typeof m=="function")&&u?o(u,m):d&&d.get(m)},has:function(m){return r&&m&&(typeof m=="object"||typeof m=="function")&&u?c(u,m):!!d&&d.has(m)},set:function(m,p){r&&m&&(typeof m=="object"||typeof m=="function")?(u||(u=new r),a(u,m,p)):i&&(d||(d=i()),d.set(m,p))}};return f}:i,Cd}var Ed,P0;function rb(){if(P0)return Ed;P0=1;var s=va(),e=ru(),t=c_(),i=nb(),n=F_(),r=n||i||t;return Ed=function(){var a,c={assert:function(l){if(!c.has(l)){var h=l&&Object(l)===l?"the given object key":e(l);throw new s("Side channel does not contain "+h)}},delete:function(l){return!!a&&a.delete(l)},get:function(l){return a&&a.get(l)},has:function(l){return!!a&&a.has(l)},set:function(l,h){a||(a=r()),a.set(l,h)}};return c},Ed}var Ad,k0;function mp(){if(k0)return Ad;k0=1;var s=String.prototype.replace,e=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Ad={default:t.RFC3986,formatters:{RFC1738:function(i){return s.call(i,e,"+")},RFC3986:function(i){return String(i)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},Ad}var Id,F0;function ob(){if(F0)return Id;F0=1;var s=mp(),e=rb(),t=Jx(),i=Object.prototype.hasOwnProperty,n=Array.isArray,r=e(),o=function(A,P){return r.set(A,P),A},a=function(A){return r.has(A)},c=function(A){return r.get(A)},l=function(A,P){r.set(A,P)},h=(function(){for(var _=[],A=0;A<256;++A)_[_.length]="%"+((A<16?"0":"")+A.toString(16)).toUpperCase();return _})(),u=function(A){for(;A.length>1;){var P=A.pop(),E=P.obj[P.prop];if(n(E)){for(var R=[],O=0;O=E.arrayLimit){if(E.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+E.arrayLimit+" element"+(E.arrayLimit===1?"":"s")+" allowed in an array.");return o(d(A.concat(P),E),R)}A[R]=P}else if(A&&typeof A=="object")if(a(A)){var O=c(A)+1;A[O]=P,l(A,O)}else{if(E&&E.strictMerge)return[A,P];(E&&(E.plainObjects||E.allowPrototypes)||!i.call(Object.prototype,P))&&(A[P]=!0)}else return[A,P];return A}if(!A||typeof A!="object"){if(a(P)){for(var U=Object.keys(P),Y=E&&E.plainObjects?{__proto__:null,0:A}:{0:A},$=0;$E.arrayLimit){if(E.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+E.arrayLimit+" element"+(E.arrayLimit===1?"":"s")+" allowed in an array.");return o(d(D,E),D.length-1)}return D}var F=A;if(n(A)&&!n(P)&&(F=d(A,E)),n(A)&&n(P)){if(P.forEach(function(N,k){if(i.call(A,k)){var V=A[k];V&&typeof V=="object"&&N&&typeof N=="object"?A[k]=_(V,N,E):A[A.length]=N}else A[k]=N}),E&&typeof E.arrayLimit=="number"&&A.length>E.arrayLimit){if(E.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+E.arrayLimit+" element"+(E.arrayLimit===1?"":"s")+" allowed in an array.");return o(d(A,E),A.length-1)}return A}return Object.keys(P).reduce(function(N,k){var V=P[k];if(i.call(N,k)?f(N,k,_(N[k],V,E)):f(N,k,V),a(P)&&!a(N)&&o(N,c(P)),a(N)){var G=parseInt(k,10);String(G)===k&&G>=0&&G>c(N)&&l(N,G)}return N},F)},p=function(A,P){return Object.keys(P).reduce(function(E,R){return f(E,R,P[R]),E},A)},g=function(_,A,P){var E=_.replace(/\+/g," ");if(P==="iso-8859-1")return E.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(E)}catch{return E}},x=1024,v=function(A,P,E,R,O){if(A.length===0)return A;var U=A;if(typeof A=="symbol"?U=Symbol.prototype.toString.call(A):typeof A!="string"&&(U=String(A)),E==="iso-8859-1")return escape(U).replace(/%u[0-9a-f]{4}/gi,function(V){return"%26%23"+parseInt(V.slice(2),16)+"%3B"});for(var Y="",$=0;$=x?U.slice($,$+x):U;if($+x=55296&&D<=56319&&(X=X.slice(0,-1),$-=1)}for(var F=[],N=0;N=48&&k<=57||k>=65&&k<=90||k>=97&&k<=122||O===s.RFC1738&&(k===40||k===41)){F[F.length]=X.charAt(N);continue}if(k<128){F[F.length]=h[k];continue}if(k<2048){F[F.length]=h[192|k>>6]+h[128|k&63];continue}if(k<55296||k>=57344){F[F.length]=h[224|k>>12]+h[128|k>>6&63]+h[128|k&63];continue}N+=1,k=65536+((k&1023)<<10|X.charCodeAt(N)&1023),F[F.length]=h[240|k>>18]+h[128|k>>12&63]+h[128|k>>6&63]+h[128|k&63]}Y+=F.join("")}return Y},y=function(A){for(var P=[{obj:{o:A},prop:"o"}],E=e(),R=0;RE){if(O)throw new RangeError("Array limit exceeded. Only "+E+" element"+(E===1?"":"s")+" allowed in an array.");return o(d(Y,{plainObjects:R}),Y.length-1)}return Y},b=function(A,P){if(n(A)){for(var E=[],R=0;R"u"&&(N=0)}if(typeof A=="function"?D=A(x,D):D instanceof Date?D=R(D):v==="comma"&&r(D)&&(D=e.maybeMap(D,function(B){return B instanceof Date?R(B):B})),D===null){if(C)return U(_&&!Y?_(x,h.encoder,$,"key",O):x);D=""}if(u(D)||e.isBuffer(D)){if(_){var G=Y?x:_(x,h.encoder,$,"key",O);return[U(G)+"="+U(_(D,h.encoder,$,"value",O))]}return[U(x)+"="+U(String(D))]}var W=[];if(typeof D>"u")return W;var Z;if(v==="comma"&&r(D))Y&&_&&(D=e.maybeMap(D,function(B){return B==null?B:_(B)})),Z=[{value:D.length>0?D.join(",")||null:void 0}];else if(r(A))Z=A;else{var ne=Object.keys(D);Z=P?ne.sort(P):ne}var oe=b?String(x).replace(/\./g,"%2E"):String(x),de=y&&r(D)&&D.length===1?oe+"[]":oe;if(S&&r(D)&&D.length===0)return de+"[]";for(var pe=0;pe"u"?g.encodeDotInKeys===!0?!0:h.allowDots:!!g.allowDots;return{addQueryPrefix:typeof g.addQueryPrefix=="boolean"?g.addQueryPrefix:h.addQueryPrefix,allowDots:w,allowEmptyArrays:typeof g.allowEmptyArrays=="boolean"?!!g.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:C,charset:x,charsetSentinel:typeof g.charsetSentinel=="boolean"?g.charsetSentinel:h.charsetSentinel,commaRoundTrip:!!g.commaRoundTrip,delimiter:typeof g.delimiter>"u"?h.delimiter:g.delimiter,encode:typeof g.encode=="boolean"?g.encode:h.encode,encodeDotInKeys:typeof g.encodeDotInKeys=="boolean"?g.encodeDotInKeys:h.encodeDotInKeys,encoder:typeof g.encoder=="function"?g.encoder:h.encoder,encodeValuesOnly:typeof g.encodeValuesOnly=="boolean"?g.encodeValuesOnly:h.encodeValuesOnly,filter:S,format:v,formatter:y,serializeDate:typeof g.serializeDate=="function"?g.serializeDate:h.serializeDate,skipNulls:typeof g.skipNulls=="boolean"?g.skipNulls:h.skipNulls,sort:typeof g.sort=="function"?g.sort:null,strictNullHandling:typeof g.strictNullHandling=="boolean"?g.strictNullHandling:h.strictNullHandling}};return Rd=function(p,g){var x=p,v=m(g),y,S;typeof v.filter=="function"?(S=v.filter,x=S("",x)):r(v.filter)&&(S=v.filter,y=S);var C=[];if(typeof x!="object"||x===null)return"";var w=n[v.arrayFormat],b=w==="comma"&&v.commaRoundTrip;y||(y=Object.keys(x)),v.sort&&y.sort(v.sort);for(var _=s(),A=0;A"u"||P===null)){var E=x[P];v.skipNulls&&E===null||a(C,f(E,P,w,b,v.allowEmptyArrays,v.strictNullHandling,v.skipNulls,v.encodeDotInKeys,v.encode?v.encoder:null,v.filter,v.sort,v.allowDots,v.serializeDate,v.format,v.formatter,v.encodeValuesOnly,v.charset,_))}}var R=C.join(v.delimiter),O=v.addQueryPrefix===!0?"?":"";return v.charsetSentinel&&(v.charset==="iso-8859-1"?O+="utf8=%26%2310003%3B"+v.delimiter:O+="utf8=%E2%9C%93"+v.delimiter),R.length>0?O+R:""},Rd}var Pd,L0;function L_(){if(L0)return Pd;L0=1;var s=ob(),e=Object.prototype.hasOwnProperty,t=Array.isArray,i={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:s.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},n=function(f){return f.replace(/&#(\d+);/g,function(m,p){return String.fromCharCode(parseInt(p,10))})},r=function(f,m,p,g){if(f&&typeof f=="string"&&m.comma&&f.indexOf(",")>-1){if(g&&m.throwOnLimitExceeded)for(var x=0,v=f.indexOf(",");v>-1;){if(x+=1,x>=m.arrayLimit)throw new RangeError("Array limit exceeded. Only "+m.arrayLimit+" element"+(m.arrayLimit===1?"":"s")+" allowed in an array.");v=f.indexOf(",",v+1)}return f.split(",")}if(m.throwOnLimitExceeded&&p>=m.arrayLimit)throw new RangeError("Array limit exceeded. Only "+m.arrayLimit+" element"+(m.arrayLimit===1?"":"s")+" allowed in an array.");return f},o="utf8=%26%2310003%3B",a="utf8=%E2%9C%93",c=function(m,p){var g={__proto__:null},x=p.ignoreQueryPrefix?m.replace(/^\?/,""):m;x=x.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var v=p.parameterLimit===1/0?void 0:p.parameterLimit,y=x.split(p.delimiter,p.throwOnLimitExceeded&&typeof v<"u"?v+1:v);if(p.throwOnLimitExceeded&&typeof v<"u"&&y.length>v)throw new RangeError("Parameter limit exceeded. Only "+v+" parameter"+(v===1?"":"s")+" allowed.");var S=-1,C,w=p.charset;if(p.charsetSentinel)for(C=0;C-1&&(E=t(E)?[E]:E),p.comma&&t(E)&&E.length>p.arrayLimit&&(E=s.combine([],E,p.arrayLimit,p.plainObjects,p.throwOnLimitExceeded)),P!==null){var R=e.call(g,P);R&&(p.duplicates==="combine"||b.indexOf("[]=")>-1)?g[P]=s.combine(g[P],E,p.arrayLimit,p.plainObjects,p.throwOnLimitExceeded):(!R||p.duplicates==="last")&&(g[P]=E)}}return g},l=function(f,m,p,g){var x=0;if(f.length>0&&f[f.length-1]==="[]"){var v=f.slice(0,-1).join("");x=Array.isArray(m)&&m[v]?m[v].length:0}for(var y=g?m:r(m,p,x),S=f.length-1;S>=0;--S){var C,w=f[S];if(w==="[]"&&p.parseArrays)s.isOverflow(y)?C=y:C=p.allowEmptyArrays&&(y===""||p.strictNullHandling&&y===null)?[]:s.combine([],y,p.arrayLimit,p.plainObjects,p.throwOnLimitExceeded);else{C=p.plainObjects?{__proto__:null}:{};var b=w.charAt(0)==="["&&w.charAt(w.length-1)==="]"?w.slice(1,-1):w,_=p.decodeDotInKeys?b.replace(/%2E/g,"."):b,A=parseInt(_,10),P=!isNaN(A)&&w!==_&&String(A)===_&&A>=0&&p.parseArrays;if(!p.parseArrays&&_==="")C={0:y};else if(P&&A=0?g.slice(0,v):g;if(y){if(!p.plainObjects&&e.call(Object.prototype,y)&&!p.allowPrototypes)return;x[x.length]=y}for(var S=g.length,C=v,w=0;C>=0&&w=0){if(p.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+p.depth+" and strictDepth is true");x[x.length]="["+g.slice(C)+"]"}return x},u=function(m,p,g,x){if(m){var v=h(m,g);if(v)return l(v,p,g,x)}},d=function(m){if(!m)return i;if(typeof m.allowEmptyArrays<"u"&&typeof m.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof m.decodeDotInKeys<"u"&&typeof m.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(m.decoder!==null&&typeof m.decoder<"u"&&typeof m.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof m.charset<"u"&&m.charset!=="utf-8"&&m.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof m.throwOnLimitExceeded<"u"&&typeof m.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var p=typeof m.charset>"u"?i.charset:m.charset,g=typeof m.duplicates>"u"?i.duplicates:m.duplicates;if(g!=="combine"&&g!=="first"&&g!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var x=typeof m.allowDots>"u"?m.decodeDotInKeys===!0?!0:i.allowDots:!!m.allowDots;return{allowDots:x,allowEmptyArrays:typeof m.allowEmptyArrays=="boolean"?!!m.allowEmptyArrays:i.allowEmptyArrays,allowPrototypes:typeof m.allowPrototypes=="boolean"?m.allowPrototypes:i.allowPrototypes,allowSparse:typeof m.allowSparse=="boolean"?m.allowSparse:i.allowSparse,arrayLimit:typeof m.arrayLimit=="number"?m.arrayLimit:i.arrayLimit,charset:p,charsetSentinel:typeof m.charsetSentinel=="boolean"?m.charsetSentinel:i.charsetSentinel,comma:typeof m.comma=="boolean"?m.comma:i.comma,decodeDotInKeys:typeof m.decodeDotInKeys=="boolean"?m.decodeDotInKeys:i.decodeDotInKeys,decoder:typeof m.decoder=="function"?m.decoder:i.decoder,delimiter:typeof m.delimiter=="string"||s.isRegExp(m.delimiter)?m.delimiter:i.delimiter,depth:typeof m.depth=="number"||m.depth===!1?+m.depth:i.depth,duplicates:g,ignoreQueryPrefix:m.ignoreQueryPrefix===!0,interpretNumericEntities:typeof m.interpretNumericEntities=="boolean"?m.interpretNumericEntities:i.interpretNumericEntities,parameterLimit:typeof m.parameterLimit=="number"?m.parameterLimit:i.parameterLimit,parseArrays:m.parseArrays!==!1,plainObjects:typeof m.plainObjects=="boolean"?m.plainObjects:i.plainObjects,strictDepth:typeof m.strictDepth=="boolean"?!!m.strictDepth:i.strictDepth,strictMerge:typeof m.strictMerge=="boolean"?!!m.strictMerge:i.strictMerge,strictNullHandling:typeof m.strictNullHandling=="boolean"?m.strictNullHandling:i.strictNullHandling,throwOnLimitExceeded:typeof m.throwOnLimitExceeded=="boolean"?m.throwOnLimitExceeded:!1}};return Pd=function(f,m){var p=d(m);if(f===""||f===null||typeof f>"u")return p.plainObjects?{__proto__:null}:{};for(var g=typeof f=="string"?c(f,p):f,x=p.plainObjects?{__proto__:null}:{},v=Object.keys(g),y=0;y",'"',"`"," ","\r",` +`," "],o=["{","}","|","\\","^","`"].concat(r),a=["'"].concat(o),c=["%","/","?",";","#"].concat(a),l=["/","?","#"],h=255,u=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},p={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=B_();function x(C,w,b){if(C&&typeof C=="object"&&C instanceof e)return C;var _=new e;return _.parse(C,w,b),_}e.prototype.parse=function(C,w,b){if(typeof C!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof C);var _=C.indexOf("?"),A=_!==-1&&_127?ne+="x":ne+=Z[oe];if(!ne.match(u)){var pe=G.slice(0,D),he=G.slice(D+1),me=Z.match(d);me&&(pe.push(me[1]),he.unshift(me[2])),he.length&&(R="/"+he.join(".")+R),this.hostname=pe.join(".");break}}}this.hostname.length>h?this.hostname="":this.hostname=this.hostname.toLowerCase(),V||(this.hostname=s.toASCII(this.hostname));var H=this.port?":"+this.port:"",z=this.hostname||"";this.host=z+H,this.href+=this.host,V&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),R[0]!=="/"&&(R="/"+R))}if(!f[Y])for(var D=0,W=a.length;D0?b.host.split("@"):!1;ne&&(b.auth=ne.shift(),b.hostname=ne.shift(),b.host=b.hostname)}return b.search=C.search,b.query=C.query,(b.pathname!==null||b.search!==null)&&(b.path=(b.pathname?b.pathname:"")+(b.search?b.search:"")),b.href=b.format(),b}if(!G.length)return b.pathname=null,b.search?b.path="/"+b.search:b.path=null,b.href=b.format(),b;for(var oe=G.slice(-1)[0],de=(b.host||C.host||G.length>1)&&(oe==="."||oe==="..")||oe==="",pe=0,he=G.length;he>=0;he--)oe=G[he],oe==="."?G.splice(he,1):oe===".."?(G.splice(he,1),pe++):pe&&(G.splice(he,1),pe--);if(!k&&!V)for(;pe--;pe)G.unshift("..");k&&G[0]!==""&&(!G[0]||G[0].charAt(0)!=="/")&&G.unshift(""),de&&G.join("/").substr(-1)!=="/"&&G.push("");var me=G[0]===""||G[0]&&G[0].charAt(0)==="/";if(Z){b.hostname=me?"":G.length?G.shift():"",b.host=b.hostname;var ne=b.host&&b.host.indexOf("@")>0?b.host.split("@"):!1;ne&&(b.auth=ne.shift(),b.hostname=ne.shift(),b.host=b.hostname)}return k=k||b.host&&G.length,k&&!me&&G.unshift(""),G.length>0?b.pathname=G.join("/"):(b.pathname=null,b.path=null),(b.pathname!==null||b.search!==null)&&(b.path=(b.pathname?b.pathname:"")+(b.search?b.search:"")),b.auth=C.auth||b.auth,b.slashes=b.slashes||C.slashes,b.href=b.format(),b},e.prototype.parseHost=function(){var C=this.host,w=i.exec(C);w&&(w=w[0],w!==":"&&(this.port=w.substr(1)),C=C.substr(0,C.length-w.length)),C&&(this.hostname=C)},Dr.parse=x,Dr.resolve=y,Dr.resolveObject=S,Dr.format=v,Dr.Url=e,Dr}N_();const D0={};function mt(s,e,t=3){if(D0[e])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${e} +Deprecated since v${s}`):(i=i.split(` +`).splice(t).join(` +`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${e} +Deprecated since v${s}`),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${e} +Deprecated since v${s}`),console.warn(i))),D0[e]=!0}function Ss(s){if(typeof s!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(s)}`)}function Pa(s){return s.split("?")[0].split("#")[0]}function D_(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function U_(s,e,t){return s.replace(new RegExp(D_(e),"g"),t)}function $_(s,e){let t="",i=0,n=-1,r=0,o=-1;for(let a=0;a<=s.length;++a){if(a2){const c=t.lastIndexOf("/");if(c!==t.length-1){c===-1?(t="",i=0):(t=t.slice(0,c),i=t.length-1-t.lastIndexOf("/")),n=a,r=0;continue}}else if(t.length===2||t.length===1){t="",i=0,n=a,r=0;continue}}}else t.length>0?t+=`/${s.slice(n+1,a)}`:t=s.slice(n+1,a),i=a-n-1;n=a,r=0}else o===46&&r!==-1?++r:r=-1}return t}const si={toPosix(s){return U_(s,"\\","/")},isUrl(s){return/^https?:/.test(this.toPosix(s))},isDataUrl(s){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(s)},isBlobUrl(s){return s.startsWith("blob:")},hasProtocol(s){return/^[^/:]+:/.test(this.toPosix(s))},getProtocol(s){Ss(s),s=this.toPosix(s);const e=/^file:\/\/\//.exec(s);if(e)return e[0];const t=/^[^/:]+:\/{0,2}/.exec(s);return t?t[0]:""},toAbsolute(s,e,t){if(Ss(s),this.isDataUrl(s)||this.isBlobUrl(s))return s;const i=Pa(this.toPosix(e??Be.ADAPTER.getBaseUrl())),n=Pa(this.toPosix(t??this.rootname(i)));return s=this.toPosix(s),s.startsWith("/")?si.join(n,s.slice(1)):this.isAbsolute(s)?s:this.join(i,s)},normalize(s){if(Ss(s),s.length===0)return".";if(this.isDataUrl(s)||this.isBlobUrl(s))return s;s=this.toPosix(s);let e="";const t=s.startsWith("/");this.hasProtocol(s)&&(e=this.rootname(s),s=s.slice(e.length));const i=s.endsWith("/");return s=$_(s),s.length>0&&i&&(s+="/"),t?`/${s}`:e+s},isAbsolute(s){return Ss(s),s=this.toPosix(s),this.hasProtocol(s)?!0:s.startsWith("/")},join(...s){if(s.length===0)return".";let e;for(let t=0;t0)if(e===void 0)e=i;else{const n=s[t-1]??"";this.joinExtensions.includes(this.extname(n).toLowerCase())?e+=`/../${i}`:e+=`/${i}`}}return e===void 0?".":this.normalize(e)},dirname(s){if(Ss(s),s.length===0)return".";s=this.toPosix(s);let e=s.charCodeAt(0);const t=e===47;let i=-1,n=!0;const r=this.getProtocol(s),o=s;s=s.slice(r.length);for(let a=s.length-1;a>=1;--a)if(e=s.charCodeAt(a),e===47){if(!n){i=a;break}}else n=!1;return i===-1?t?"/":this.isUrl(o)?r+s:r:t&&i===1?"//":r+s.slice(0,i)},rootname(s){Ss(s),s=this.toPosix(s);let e="";if(s.startsWith("/")?e="/":e=this.getProtocol(s),this.isUrl(s)){const t=s.indexOf("/",e.length);t!==-1?e=s.slice(0,t):e=s,e.endsWith("/")||(e+="/")}return e},basename(s,e){Ss(s),e&&Ss(e),s=Pa(this.toPosix(s));let t=0,i=-1,n=!0,r;if(e!==void 0&&e.length>0&&e.length<=s.length){if(e.length===s.length&&e===s)return"";let o=e.length-1,a=-1;for(r=s.length-1;r>=0;--r){const c=s.charCodeAt(r);if(c===47){if(!n){t=r+1;break}}else a===-1&&(n=!1,a=r+1),o>=0&&(c===e.charCodeAt(o)?--o===-1&&(i=r):(o=-1,i=a))}return t===i?i=a:i===-1&&(i=s.length),s.slice(t,i)}for(r=s.length-1;r>=0;--r)if(s.charCodeAt(r)===47){if(!n){t=r+1;break}}else i===-1&&(n=!1,i=r+1);return i===-1?"":s.slice(t,i)},extname(s){Ss(s),s=Pa(this.toPosix(s));let e=-1,t=0,i=-1,n=!0,r=0;for(let o=s.length-1;o>=0;--o){const a=s.charCodeAt(o);if(a===47){if(!n){t=o+1;break}continue}i===-1&&(n=!1,i=o+1),a===46?e===-1?e=o:r!==1&&(r=1):e!==-1&&(r=-1)}return e===-1||i===-1||r===0||r===1&&e===i-1&&e===t+1?"":s.slice(e,i)},parse(s){Ss(s);const e={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return e;s=Pa(this.toPosix(s));let t=s.charCodeAt(0);const i=this.isAbsolute(s);let n;e.root=this.rootname(s),i||this.hasProtocol(s)?n=1:n=0;let r=-1,o=0,a=-1,c=!0,l=s.length-1,h=0;for(;l>=n;--l){if(t=s.charCodeAt(l),t===47){if(!c){o=l+1;break}continue}a===-1&&(c=!1,a=l+1),t===46?r===-1?r=l:h!==1&&(h=1):r!==-1&&(h=-1)}return r===-1||a===-1||h===0||h===1&&r===a-1&&r===o+1?a!==-1&&(o===0&&i?e.base=e.name=s.slice(1,a):e.base=e.name=s.slice(o,a)):(o===0&&i?(e.name=s.slice(1,r),e.base=s.slice(1,a)):(e.name=s.slice(o,r),e.base=s.slice(o,a)),e.ext=s.slice(r,a)),e.dir=this.dirname(s),e},sep:"/",delimiter:":",joinExtensions:[".html"]};let Fd;async function X_(){return Fd??(Fd=(async()=>{var r;const s=document.createElement("canvas").getContext("webgl");if(!s)return bi.UNPACK;const e=await new Promise(o=>{const a=document.createElement("video");a.onloadeddata=()=>o(a),a.onerror=()=>o(null),a.autoplay=!1,a.crossOrigin="anonymous",a.preload="auto",a.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",a.load()});if(!e)return bi.UNPACK;const t=s.createTexture();s.bindTexture(s.TEXTURE_2D,t);const i=s.createFramebuffer();s.bindFramebuffer(s.FRAMEBUFFER,i),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,t,0),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,e);const n=new Uint8Array(4);return s.readPixels(0,0,1,1,s.RGBA,s.UNSIGNED_BYTE,n),s.deleteFramebuffer(i),s.deleteTexture(t),(r=s.getExtension("WEBGL_lose_context"))==null||r.loseContext(),n[0]<=n[3]?bi.PMA:bi.UNPACK})()),Fd}let Od;function V_(){return typeof Od>"u"&&(Od=(function(){var e;const s={stencil:!0,failIfMajorPerformanceCaveat:Be.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!Be.ADAPTER.getWebGLRenderingContext())return!1;const t=Be.ADAPTER.createCanvas();let i=t.getContext("webgl",s)||t.getContext("experimental-webgl",s);const n=!!((e=i==null?void 0:i.getContextAttributes())!=null&&e.stencil);if(i){const r=i.getExtension("WEBGL_lose_context");r&&r.loseContext()}return i=null,n}catch{return!1}})()),Od}var Y_={grad:.9,turn:360,rad:360/(2*Math.PI)},wn=function(s){return typeof s=="string"?s.length>0:typeof s=="number"},xi=function(s,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*s)/t+0},ps=function(s,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),s>t?t:s>e?s:e},ab=function(s){return(s=isFinite(s)?s%360:0)>0?s:s+360},U0=function(s){return{r:ps(s.r,0,255),g:ps(s.g,0,255),b:ps(s.b,0,255),a:ps(s.a)}},Ld=function(s){return{r:xi(s.r),g:xi(s.g),b:xi(s.b),a:xi(s.a,3)}},G_=/^#([0-9a-f]{3,8})$/i,ql=function(s){var e=s.toString(16);return e.length<2?"0"+e:e},lb=function(s){var e=s.r,t=s.g,i=s.b,n=s.a,r=Math.max(e,t,i),o=r-Math.min(e,t,i),a=o?r===e?(t-i)/o:r===t?2+(i-e)/o:4+(e-t)/o:0;return{h:60*(a<0?a+6:a),s:r?o/r*100:0,v:r/255*100,a:n}},cb=function(s){var e=s.h,t=s.s,i=s.v,n=s.a;e=e/360*6,t/=100,i/=100;var r=Math.floor(e),o=i*(1-t),a=i*(1-(e-r)*t),c=i*(1-(1-e+r)*t),l=r%6;return{r:255*[i,a,o,o,c,i][l],g:255*[c,i,i,a,o,o][l],b:255*[o,o,c,i,i,a][l],a:n}},$0=function(s){return{h:ab(s.h),s:ps(s.s,0,100),l:ps(s.l,0,100),a:ps(s.a)}},X0=function(s){return{h:xi(s.h),s:xi(s.s),l:xi(s.l),a:xi(s.a,3)}},V0=function(s){return cb((t=(e=s).s,{h:e.h,s:(t*=((i=e.l)<50?i:100-i)/100)>0?2*t/(i+t)*100:0,v:i+t,a:e.a}));var e,t,i},Qa=function(s){return{h:(e=lb(s)).h,s:(n=(200-(t=e.s))*(i=e.v)/100)>0&&n<200?t*i/100/(n<=100?n:200-n)*100:0,l:n/2,a:e.a};var e,t,i,n},j_=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,H_=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,W_=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,z_=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Nf={string:[[function(s){var e=G_.exec(s);return e?(s=e[1]).length<=4?{r:parseInt(s[0]+s[0],16),g:parseInt(s[1]+s[1],16),b:parseInt(s[2]+s[2],16),a:s.length===4?xi(parseInt(s[3]+s[3],16)/255,2):1}:s.length===6||s.length===8?{r:parseInt(s.substr(0,2),16),g:parseInt(s.substr(2,2),16),b:parseInt(s.substr(4,2),16),a:s.length===8?xi(parseInt(s.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(s){var e=W_.exec(s)||z_.exec(s);return e?e[2]!==e[4]||e[4]!==e[6]?null:U0({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(s){var e=j_.exec(s)||H_.exec(s);if(!e)return null;var t,i,n=$0({h:(t=e[1],i=e[2],i===void 0&&(i="deg"),Number(t)*(Y_[i]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return V0(n)},"hsl"]],object:[[function(s){var e=s.r,t=s.g,i=s.b,n=s.a,r=n===void 0?1:n;return wn(e)&&wn(t)&&wn(i)?U0({r:Number(e),g:Number(t),b:Number(i),a:Number(r)}):null},"rgb"],[function(s){var e=s.h,t=s.s,i=s.l,n=s.a,r=n===void 0?1:n;if(!wn(e)||!wn(t)||!wn(i))return null;var o=$0({h:Number(e),s:Number(t),l:Number(i),a:Number(r)});return V0(o)},"hsl"],[function(s){var e=s.h,t=s.s,i=s.v,n=s.a,r=n===void 0?1:n;if(!wn(e)||!wn(t)||!wn(i))return null;var o=(function(a){return{h:ab(a.h),s:ps(a.s,0,100),v:ps(a.v,0,100),a:ps(a.a)}})({h:Number(e),s:Number(t),v:Number(i),a:Number(r)});return cb(o)},"hsv"]]},Y0=function(s,e){for(var t=0;t=.5},s.prototype.toHex=function(){return e=Ld(this.rgba),t=e.r,i=e.g,n=e.b,o=(r=e.a)<1?ql(xi(255*r)):"","#"+ql(t)+ql(i)+ql(n)+o;var e,t,i,n,r,o},s.prototype.toRgb=function(){return Ld(this.rgba)},s.prototype.toRgbString=function(){return e=Ld(this.rgba),t=e.r,i=e.g,n=e.b,(r=e.a)<1?"rgba("+t+", "+i+", "+n+", "+r+")":"rgb("+t+", "+i+", "+n+")";var e,t,i,n,r},s.prototype.toHsl=function(){return X0(Qa(this.rgba))},s.prototype.toHslString=function(){return e=X0(Qa(this.rgba)),t=e.h,i=e.s,n=e.l,(r=e.a)<1?"hsla("+t+", "+i+"%, "+n+"%, "+r+")":"hsl("+t+", "+i+"%, "+n+"%)";var e,t,i,n,r},s.prototype.toHsv=function(){return e=lb(this.rgba),{h:xi(e.h),s:xi(e.s),v:xi(e.v),a:xi(e.a,3)};var e},s.prototype.invert=function(){return Vs({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},s.prototype.saturate=function(e){return e===void 0&&(e=.1),Vs(Bd(this.rgba,e))},s.prototype.desaturate=function(e){return e===void 0&&(e=.1),Vs(Bd(this.rgba,-e))},s.prototype.grayscale=function(){return Vs(Bd(this.rgba,-1))},s.prototype.lighten=function(e){return e===void 0&&(e=.1),Vs(G0(this.rgba,e))},s.prototype.darken=function(e){return e===void 0&&(e=.1),Vs(G0(this.rgba,-e))},s.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},s.prototype.alpha=function(e){return typeof e=="number"?Vs({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):xi(this.rgba.a,3);var t},s.prototype.hue=function(e){var t=Qa(this.rgba);return typeof e=="number"?Vs({h:e,s:t.s,l:t.l,a:t.a}):xi(t.h)},s.prototype.isEqual=function(e){return this.toHex()===Vs(e).toHex()},s})(),Vs=function(s){return s instanceof Df?s:new Df(s)},j0=[],K_=function(s){s.forEach(function(e){j0.indexOf(e)<0&&(e(Df,Nf),j0.push(e))})};function Z_(s,e){var t={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},i={};for(var n in t)i[t[n]]=n;var r={};s.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,c,l=i[this.toHex()];if(l)return l;if(o!=null&&o.closest){var h=this.toRgb(),u=1/0,d="black";if(!r.length)for(var f in t)r[f]=new s(t[f]).toRgb();for(var m in t){var p=(a=h,c=r[m],Math.pow(a.r-c.r,2)+Math.pow(a.g-c.g,2)+Math.pow(a.b-c.b,2));pn===t[r]);if(e!==null&&t!==null){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(o=>e[o]===t[o])}return e===t}toRgba(){const[e,t,i,n]=this._components;return{r:e,g:t,b:i,a:n}}toRgb(){const[e,t,i]=this._components;return{r:e,g:t,b:i}}toRgbaString(){const[e,t,i]=this.toUint8RgbArray();return`rgba(${e},${t},${i},${this.alpha})`}toUint8RgbArray(e){const[t,i,n]=this._components;return e=e??[],e[0]=Math.round(t*255),e[1]=Math.round(i*255),e[2]=Math.round(n*255),e}toRgbArray(e){e=e??[];const[t,i,n]=this._components;return e[0]=t,e[1]=i,e[2]=n,e}toNumber(){return this._int}toLittleEndianNumber(){const e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(e){const[t,i,n,r]=Rc.temp.setValue(e)._components;return this._components[0]*=t,this._components[1]*=i,this._components[2]*=n,this._components[3]*=r,this.refreshInt(),this._value=null,this}premultiply(e,t=!0){return t&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this.refreshInt(),this._value=null,this}toPremultiplied(e,t=!0){if(e===1)return(255<<24)+this._int;if(e===0)return t?0:this._int;let i=this._int>>16&255,n=this._int>>8&255,r=this._int&255;return t&&(i=i*e+.5|0,n=n*e+.5|0,r=r*e+.5|0),(e*255<<24)+(i<<16)+(n<<8)+r}toHex(){const e=this._int.toString(16);return`#${"000000".substring(0,6-e.length)+e}`}toHexa(){const e=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-e.length)+e}setAlpha(e){return this._components[3]=this._clamp(e),this}round(e){const[t,i,n]=this._components;return this._components[0]=Math.round(t*e)/e,this._components[1]=Math.round(i*e)/e,this._components[2]=Math.round(n*e)/e,this.refreshInt(),this._value=null,this}toArray(e){e=e??[];const[t,i,n,r]=this._components;return e[0]=t,e[1]=i,e[2]=n,e[3]=r,e}normalize(e){let t,i,n,r;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){const o=e;t=(o>>16&255)/255,i=(o>>8&255)/255,n=(o&255)/255,r=1}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[t,i,n,r=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[t,i,n,r=255]=e,t/=255,i/=255,n/=255,r/=255;else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){const a=Rc.HEX_PATTERN.exec(e);a&&(e=`#${a[2]}`)}const o=Vs(e);o.isValid()&&({r:t,g:i,b:n,a:r}=o.rgba,t/=255,i/=255,n/=255)}if(t!==void 0)this._components[0]=t,this._components[1]=i,this._components[2]=n,this._components[3]=r,this.refreshInt();else throw new Error(`Unable to convert color ${e}`)}refreshInt(){this._clamp(this._components);const[e,t,i]=this._components;this._int=(e*255<<16)+(t*255<<8)+(i*255|0)}_clamp(e,t=0,i=1){return typeof e=="number"?Math.min(Math.max(e,t),i):(e.forEach((n,r)=>{e[r]=Math.min(Math.max(n,t),i)}),e)}};Bo.shared=new Bo,Bo.temp=new Bo,Bo.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let At=Bo;function J_(s){return mt("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),At.shared.setValue(s).toHex()}function Q_(s){return mt("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),At.shared.setValue(s).toNumber()}function eC(){const s=[],e=[];for(let i=0;i<32;i++)s[i]=i,e[i]=i;s[We.NORMAL_NPM]=We.NORMAL,s[We.ADD_NPM]=We.ADD,s[We.SCREEN_NPM]=We.SCREEN,e[We.NORMAL]=We.NORMAL_NPM,e[We.ADD]=We.ADD_NPM,e[We.SCREEN]=We.SCREEN_NPM;const t=[];return t.push(e),t.push(s),t}const hb=eC();function ub(s,e){return hb[e?1:0][s]}function tC(s,e=null){const t=s*6;if(e=e||new Uint16Array(t),e.length!==t)throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${t}`);for(let i=0,n=0;i>>1,s|=s>>>2,s|=s>>>4,s|=s>>>8,s|=s>>>16,s+1}function H0(s){return!(s&s-1)&&!!s}function W0(s){let e=(s>65535?1:0)<<4;s>>>=e;let t=(s>255?1:0)<<3;return s>>>=t,e|=t,t=(s>15?1:0)<<2,s>>>=t,e|=t,t=(s>3?1:0)<<1,s>>>=t,e|=t,e|s>>1}function Jo(s,e,t){const i=s.length;let n;if(e>=i||t===0)return;t=e+t>i?i-e:t;const r=i-t;for(n=e;n(s.Renderer="renderer",s.Application="application",s.RendererSystem="renderer-webgl-system",s.RendererPlugin="renderer-webgl-plugin",s.CanvasRendererSystem="renderer-canvas-system",s.CanvasRendererPlugin="renderer-canvas-plugin",s.Asset="asset",s.LoadParser="load-parser",s.ResolveParser="resolve-parser",s.CacheParser="cache-parser",s.DetectionParser="detection-parser",s))(ke||{});const $f=s=>{if(typeof s=="function"||typeof s=="object"&&s.extension){if(!s.extension)throw new Error("Extension class must have an extension object");s={...typeof s.extension!="object"?{type:s.extension}:s.extension,ref:s}}if(typeof s=="object")s={...s};else throw new Error("Invalid extension type");return typeof s.type=="string"&&(s.type=[s.type]),s},J0=(s,e)=>$f(s).priority??e,$e={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...s){return s.map($f).forEach(e=>{e.type.forEach(t=>{var i,n;return(n=(i=this._removeHandlers)[t])==null?void 0:n.call(i,e)})}),this},add(...s){return s.map($f).forEach(e=>{e.type.forEach(t=>{var r,o;const i=this._addHandlers,n=this._queue;i[t]?(r=i[t])==null||r.call(i,e):(n[t]=n[t]||[],(o=n[t])==null||o.push(e))})}),this},handle(s,e,t){var o;const i=this._addHandlers,n=this._removeHandlers;if(i[s]||n[s])throw new Error(`Extension type ${s} already has a handler`);i[s]=e,n[s]=t;const r=this._queue;return r[s]&&((o=r[s])==null||o.forEach(a=>e(a)),delete r[s]),this},handleByMap(s,e){return this.handle(s,t=>{t.name&&(e[t.name]=t.ref)},t=>{t.name&&delete e[t.name]})},handleByList(s,e,t=-1){return this.handle(s,i=>{e.includes(i.ref)||(e.push(i.ref),e.sort((n,r)=>J0(r,t)-J0(n,t)))},i=>{const n=e.indexOf(i.ref);n!==-1&&e.splice(n,1)})}};class Xf{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(e){return this[`${e}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(e){switch(e){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}}const aC=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(` +`);function lC(s){let e="";for(let t=0;t0&&(e+=` +else `),t=0;--i){const n=Vf[i];if(n.test&&n.test(s,t))return new n(s,e)}throw new Error("Unrecognized source type to auto-detect Resource")}class Ls{constructor(e){this.items=[],this._name=e,this._aliasCount=0}emit(e,t,i,n,r,o,a,c){if(arguments.length>8)throw new Error("max arguments reached");const{name:l,items:h}=this;this._aliasCount++;for(let u=0,d=h.length;u0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this}remove(e){const t=this.items.indexOf(e);return t!==-1&&(this.ensureNonAliasedItems(),this.items.splice(t,1)),this}contains(e){return this.items.includes(e)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items.length=0,this._name=""}get empty(){return this.items.length===0}get name(){return this._name}}Object.defineProperties(Ls.prototype,{dispatch:{value:Ls.prototype.emit},run:{value:Ls.prototype.emit}});class yl{constructor(e=0,t=0){this._width=e,this._height=t,this.destroyed=!1,this.internal=!1,this.onResize=new Ls("setRealSize"),this.onUpdate=new Ls("update"),this.onError=new Ls("onError")}bind(e){this.onResize.add(e),this.onUpdate.add(e),this.onError.add(e),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(e){this.onResize.remove(e),this.onUpdate.remove(e),this.onError.remove(e)}resize(e,t){(e!==this._width||t!==this._height)&&(this._width=e,this._height=t,this.onResize.emit(e,t))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(e,t,i){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(e,t){return!1}}class au extends yl{constructor(e,t){const{width:i,height:n}=t||{};if(!i||!n)throw new Error("BufferResource width or height invalid");super(i,n),this.data=e,this.unpackAlignment=t.unpackAlignment??4}upload(e,t,i){const n=e.gl;n.pixelStorei(n.UNPACK_ALIGNMENT,this.unpackAlignment),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.alphaMode===bi.UNPACK);const r=t.realWidth,o=t.realHeight;return i.width===r&&i.height===o?n.texSubImage2D(t.target,0,0,0,r,o,t.format,i.type,this.data):(i.width=r,i.height=o,n.texImage2D(t.target,0,i.internalFormat,r,o,0,t.format,i.type,this.data)),!0}dispose(){this.data=null}static test(e){return e===null||e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}}const hC={scaleMode:Rs.NEAREST,alphaMode:bi.NPM},Yf=class No extends Rl{constructor(e=null,t=null){super(),t=Object.assign({},No.defaultOptions,t);const{alphaMode:i,mipmap:n,anisotropicLevel:r,scaleMode:o,width:a,height:c,wrapMode:l,format:h,type:u,target:d,resolution:f,resourceOptions:m}=t;e&&!(e instanceof yl)&&(e=fb(e,m),e.internal=!0),this.resolution=f||Be.RESOLUTION,this.width=Math.round((a||0)*this.resolution)/this.resolution,this.height=Math.round((c||0)*this.resolution)/this.resolution,this._mipmap=n,this.anisotropicLevel=r,this._wrapMode=l,this._scaleMode=o,this.format=h,this.type=u,this.target=d,this.alphaMode=i,this.uid=ho(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=a>0&&c>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(e)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)}setStyle(e,t){let i;return e!==void 0&&e!==this.scaleMode&&(this.scaleMode=e,i=!0),t!==void 0&&t!==this.mipmap&&(this.mipmap=t,i=!0),i&&this.dirtyStyleId++,this}setSize(e,t,i){return i=i||this.resolution,this.setRealSize(e*i,t*i,i)}setRealSize(e,t,i){return this.resolution=i||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(t)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=H0(this.realWidth)&&H0(this.realHeight)}setResolution(e){const t=this.resolution;return t===e?this:(this.resolution=e,this.valid&&(this.width=Math.round(this.width*t)/e,this.height=Math.round(this.height*t)/e,this.emit("update",this)),this._refreshPOT(),this)}setResource(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}onError(e){this.emit("error",this,e)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete er[this.cacheId],delete Ys[this.cacheId],this.cacheId=null),this.valid=!1,this.dispose(),No.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(e,t,i=Be.STRICT_TEXTURE_CACHE){const n=typeof e=="string";let r=null;if(n)r=e;else{if(!e._pixiId){const a=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e._pixiId=`${a}_${ho()}`}r=e._pixiId}let o=er[r];if(n&&i&&!o)throw new Error(`The cacheId "${r}" does not exist in BaseTextureCache.`);return o||(o=new No(e,t),o.cacheId=r,No.addToCache(o,r)),o}static fromBuffer(e,t,i,n){e=e||new Float32Array(t*i*4);const r=new au(e,{width:t,height:i,...n==null?void 0:n.resourceOptions});let o,a;return e instanceof Float32Array?(o=Te.RGBA,a=Ue.FLOAT):e instanceof Int32Array?(o=Te.RGBA_INTEGER,a=Ue.INT):e instanceof Uint32Array?(o=Te.RGBA_INTEGER,a=Ue.UNSIGNED_INT):e instanceof Int16Array?(o=Te.RGBA_INTEGER,a=Ue.SHORT):e instanceof Uint16Array?(o=Te.RGBA_INTEGER,a=Ue.UNSIGNED_SHORT):e instanceof Int8Array?(o=Te.RGBA,a=Ue.BYTE):(o=Te.RGBA,a=Ue.UNSIGNED_BYTE),r.internal=!0,new No(r,Object.assign({},hC,{type:a,format:o},n))}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),er[t]&&er[t]!==e&&console.warn(`BaseTexture added to the cache with an id [${t}] that already had an entry`),er[t]=e)}static removeFromCache(e){if(typeof e=="string"){const t=er[e];if(t){const i=t.textureCacheIds.indexOf(e);return i>-1&&t.textureCacheIds.splice(i,1),delete er[e],t}}else if(e!=null&&e.textureCacheIds){for(let t=0;t1){for(let u=0;u(s[s.POLY=0]="POLY",s[s.RECT=1]="RECT",s[s.CIRC=2]="CIRC",s[s.ELIP=3]="ELIP",s[s.RREC=4]="RREC",s))(Ci||{});class St{constructor(e=0,t=0){this.x=0,this.y=0,this.x=e,this.y=t}clone(){return new St(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,t=e){return this.x=e,this.y=t,this}}St.prototype.toString=function(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`};const Kl=[new St,new St,new St,new St];class ct{constructor(e=0,t=0,i=0,n=0){this.x=Number(e),this.y=Number(t),this.width=Number(i),this.height=Number(n),this.type=Ci.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new ct(0,0,0,0)}clone(){return new ct(this.x,this.y,this.width,this.height)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}contains(e,t){return this.width<=0||this.height<=0?!1:e>=this.x&&e=this.y&&te.right?e.right:this.right)<=_)return!1;const A=this.ye.bottom?e.bottom:this.bottom)>A}const i=this.left,n=this.right,r=this.top,o=this.bottom;if(n<=i||o<=r)return!1;const a=Kl[0].set(e.left,e.top),c=Kl[1].set(e.left,e.bottom),l=Kl[2].set(e.right,e.top),h=Kl[3].set(e.right,e.bottom);if(l.x<=a.x||c.y<=a.y)return!1;const u=Math.sign(t.a*t.d-t.b*t.c);if(u===0||(t.apply(a,a),t.apply(c,c),t.apply(l,l),t.apply(h,h),Math.max(a.x,c.x,l.x,h.x)<=i||Math.min(a.x,c.x,l.x,h.x)>=n||Math.max(a.y,c.y,l.y,h.y)<=r||Math.min(a.y,c.y,l.y,h.y)>=o))return!1;const d=u*(c.y-a.y),f=u*(a.x-c.x),m=d*i+f*r,p=d*n+f*r,g=d*i+f*o,x=d*n+f*o;if(Math.max(m,p,g,x)<=d*a.x+f*a.y||Math.min(m,p,g,x)>=d*h.x+f*h.y)return!1;const v=u*(a.y-l.y),y=u*(l.x-a.x),S=v*i+y*r,C=v*n+y*r,w=v*i+y*o,b=v*n+y*o;return!(Math.max(S,C,w,b)<=v*a.x+y*a.y||Math.min(S,C,w,b)>=v*h.x+y*h.y)}pad(e=0,t=e){return this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this}fit(e){const t=Math.max(this.x,e.x),i=Math.min(this.x+this.width,e.x+e.width),n=Math.max(this.y,e.y),r=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(i-t,0),this.y=n,this.height=Math.max(r-n,0),this}ceil(e=1,t=.001){const i=Math.ceil((this.x+this.width-t)*e)/e,n=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=i-this.x,this.height=n-this.y,this}enlarge(e){const t=Math.min(this.x,e.x),i=Math.max(this.x+this.width,e.x+e.width),n=Math.min(this.y,e.y),r=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=i-t,this.y=n,this.height=r-n,this}}ct.prototype.toString=function(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class lu{constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.radius=i,this.type=Ci.CIRC}clone(){return new lu(this.x,this.y,this.radius)}contains(e,t){if(this.radius<=0)return!1;const i=this.radius*this.radius;let n=this.x-e,r=this.y-t;return n*=n,r*=r,n+r<=i}getBounds(){return new ct(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}}lu.prototype.toString=function(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`};class cu{constructor(e=0,t=0,i=0,n=0){this.x=e,this.y=t,this.width=i,this.height=n,this.type=Ci.ELIP}clone(){return new cu(this.x,this.y,this.width,this.height)}contains(e,t){if(this.width<=0||this.height<=0)return!1;let i=(e-this.x)/this.width,n=(t-this.y)/this.height;return i*=i,n*=n,i+n<=1}getBounds(){return new ct(this.x-this.width,this.y-this.height,this.width,this.height)}}cu.prototype.toString=function(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class ro{constructor(...e){let t=Array.isArray(e[0])?e[0]:e;if(typeof t[0]!="number"){const i=[];for(let n=0,r=t.length;nt!=h>t&&e<(l-a)*((t-c)/(h-c))+a&&(i=!i)}return i}}ro.prototype.toString=function(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((s,e)=>`${s}, ${e}`,"")}]`};class hu{constructor(e=0,t=0,i=0,n=0,r=20){this.x=e,this.y=t,this.width=i,this.height=n,this.radius=r,this.type=Ci.RREC}clone(){return new hu(this.x,this.y,this.width,this.height,this.radius)}contains(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){const i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+i&&t<=this.y+this.height-i||e>=this.x+i&&e<=this.x+this.width-i)return!0;let n=e-(this.x+i),r=t-(this.y+i);const o=i*i;if(n*n+r*r<=o||(n=e-(this.x+this.width-i),n*n+r*r<=o)||(r=t-(this.y+this.height-i),n*n+r*r<=o)||(n=e-(this.x+i),n*n+r*r<=o))return!0}return!1}}hu.prototype.toString=function(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`};class Ft{constructor(e=1,t=0,i=0,n=1,r=0,o=0){this.array=null,this.a=e,this.b=t,this.c=i,this.d=n,this.tx=r,this.ty=o}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,t,i,n,r,o){return this.a=e,this.b=t,this.c=i,this.d=n,this.tx=r,this.ty=o,this}toArray(e,t){this.array||(this.array=new Float32Array(9));const i=t||this.array;return e?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i}apply(e,t){t=t||new St;const i=e.x,n=e.y;return t.x=this.a*i+this.c*n+this.tx,t.y=this.b*i+this.d*n+this.ty,t}applyInverse(e,t){t=t||new St;const i=1/(this.a*this.d+this.c*-this.b),n=e.x,r=e.y;return t.x=this.d*i*n+-this.c*i*r+(this.ty*this.c-this.tx*this.d)*i,t.y=this.a*i*r+-this.b*i*n+(-this.ty*this.a+this.tx*this.b)*i,t}translate(e,t){return this.tx+=e,this.ty+=t,this}scale(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this}rotate(e){const t=Math.cos(e),i=Math.sin(e),n=this.a,r=this.c,o=this.tx;return this.a=n*t-this.b*i,this.b=n*i+this.b*t,this.c=r*t-this.d*i,this.d=r*i+this.d*t,this.tx=o*t-this.ty*i,this.ty=o*i+this.ty*t,this}append(e){const t=this.a,i=this.b,n=this.c,r=this.d;return this.a=e.a*t+e.b*n,this.b=e.a*i+e.b*r,this.c=e.c*t+e.d*n,this.d=e.c*i+e.d*r,this.tx=e.tx*t+e.ty*n+this.tx,this.ty=e.tx*i+e.ty*r+this.ty,this}setTransform(e,t,i,n,r,o,a,c,l){return this.a=Math.cos(a+l)*r,this.b=Math.sin(a+l)*r,this.c=-Math.sin(a-c)*o,this.d=Math.cos(a-c)*o,this.tx=e-(i*this.a+n*this.c),this.ty=t-(i*this.b+n*this.d),this}prepend(e){const t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const i=this.a,n=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=n*e.a+this.d*e.c,this.d=n*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this}decompose(e){const t=this.a,i=this.b,n=this.c,r=this.d,o=e.pivot,a=-Math.atan2(-n,r),c=Math.atan2(i,t),l=Math.abs(a+c);return l<1e-5||Math.abs(nh-l)<1e-5?(e.rotation=c,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=a,e.skew.y=c),e.scale.x=Math.sqrt(t*t+i*i),e.scale.y=Math.sqrt(n*n+r*r),e.position.x=this.tx+(o.x*t+o.y*n),e.position.y=this.ty+(o.x*i+o.y*r),e}invert(){const e=this.a,t=this.b,i=this.c,n=this.d,r=this.tx,o=e*n-t*i;return this.a=n/o,this.b=-t/o,this.c=-i/o,this.d=e/o,this.tx=(i*this.ty-n*r)/o,this.ty=-(e*this.ty-t*r)/o,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new Ft;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}static get IDENTITY(){return new Ft}static get TEMP_MATRIX(){return new Ft}}Ft.prototype.toString=function(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`};const Vr=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Yr=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Gr=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],jr=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],jf=[],pb=[],Zl=Math.sign;function yC(){for(let s=0;s<16;s++){const e=[];jf.push(e);for(let t=0;t<16;t++){const i=Zl(Vr[s]*Vr[t]+Gr[s]*Yr[t]),n=Zl(Yr[s]*Vr[t]+jr[s]*Yr[t]),r=Zl(Vr[s]*Gr[t]+Gr[s]*jr[t]),o=Zl(Yr[s]*Gr[t]+jr[s]*jr[t]);for(let a=0;a<16;a++)if(Vr[a]===i&&Yr[a]===n&&Gr[a]===r&&jr[a]===o){e.push(a);break}}}for(let s=0;s<16;s++){const e=new Ft;e.set(Vr[s],Yr[s],Gr[s],jr[s],0,0),pb.push(e)}}yC();const Wt={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:s=>Vr[s],uY:s=>Yr[s],vX:s=>Gr[s],vY:s=>jr[s],inv:s=>s&8?s&15:-s&7,add:(s,e)=>jf[s][e],sub:(s,e)=>jf[s][Wt.inv(e)],rotate180:s=>s^4,isVertical:s=>(s&3)===2,byDirection:(s,e)=>Math.abs(s)*2<=Math.abs(e)?e>=0?Wt.S:Wt.N:Math.abs(e)*2<=Math.abs(s)?s>0?Wt.E:Wt.W:e>0?s>0?Wt.SE:Wt.SW:s>0?Wt.NE:Wt.NW,matrixAppendRotationInv:(s,e,t=0,i=0)=>{const n=pb[Wt.inv(e)];n.tx=t,n.ty=i,s.append(n)}};class Fn{constructor(e,t,i=0,n=0){this._x=i,this._y=n,this.cb=e,this.scope=t}clone(e=this.cb,t=this.scope){return new Fn(e,t,this._x,this._y)}set(e=0,t=e){return(this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this.cb.call(this.scope)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))}}Fn.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=${this.scope}]`};const Hf=class{constructor(){this.worldTransform=new Ft,this.localTransform=new Ft,this.position=new Fn(this.onChange,this,0,0),this.scale=new Fn(this.onChange,this,1,1),this.pivot=new Fn(this.onChange,this,0,0),this.skew=new Fn(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}updateLocalTransform(){const s=this.localTransform;this._localID!==this._currentLocalID&&(s.a=this._cx*this.scale.x,s.b=this._sx*this.scale.x,s.c=this._cy*this.scale.y,s.d=this._sy*this.scale.y,s.tx=this.position.x-(this.pivot.x*s.a+this.pivot.y*s.c),s.ty=this.position.y-(this.pivot.x*s.b+this.pivot.y*s.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(s){const e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==s._worldID){const t=s.worldTransform,i=this.worldTransform;i.a=e.a*t.a+e.b*t.c,i.b=e.a*t.b+e.b*t.d,i.c=e.c*t.a+e.d*t.c,i.d=e.c*t.b+e.d*t.d,i.tx=e.tx*t.a+e.ty*t.c+t.tx,i.ty=e.tx*t.b+e.ty*t.d+t.ty,this._parentID=s._worldID,this._worldID++}}setFromMatrix(s){s.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(s){this._rotation!==s&&(this._rotation=s,this.updateSkew())}};Hf.IDENTITY=new Hf;let pp=Hf;pp.prototype.toString=function(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`};var xC=`varying vec2 vTextureCoord; + +uniform sampler2D uSampler; + +void main(void){ + gl_FragColor *= texture2D(uSampler, vTextureCoord); +}`,bC=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void){ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +} +`;function ev(s,e,t){const i=s.createShader(e);return s.shaderSource(i,t),s.compileShader(i),i}function Gd(s){const e=new Array(s);for(let t=0;ts.type==="float"&&s.size===1&&!s.isArray,code:s=>` + if(uv["${s}"] !== ud["${s}"].value) + { + ud["${s}"].value = uv["${s}"] + gl.uniform1f(ud["${s}"].location, uv["${s}"]) + } + `},{test:(s,e)=>(s.type==="sampler2D"||s.type==="samplerCube"||s.type==="sampler2DArray")&&s.size===1&&!s.isArray&&(e==null||e.castToBaseTexture!==void 0),code:s=>`t = syncData.textureCount++; + + renderer.texture.bind(uv["${s}"], t); + + if(ud["${s}"].value !== t) + { + ud["${s}"].value = t; + gl.uniform1i(ud["${s}"].location, t); +; // eslint-disable-line max-len + }`},{test:(s,e)=>s.type==="mat3"&&s.size===1&&!s.isArray&&e.a!==void 0,code:s=>` + gl.uniformMatrix3fv(ud["${s}"].location, false, uv["${s}"].toArray(true)); + `,codeUbo:s=>` + var ${s}_matrix = uv.${s}.toArray(true); + + data[offset] = ${s}_matrix[0]; + data[offset+1] = ${s}_matrix[1]; + data[offset+2] = ${s}_matrix[2]; + + data[offset + 4] = ${s}_matrix[3]; + data[offset + 5] = ${s}_matrix[4]; + data[offset + 6] = ${s}_matrix[5]; + + data[offset + 8] = ${s}_matrix[6]; + data[offset + 9] = ${s}_matrix[7]; + data[offset + 10] = ${s}_matrix[8]; + `},{test:(s,e)=>s.type==="vec2"&&s.size===1&&!s.isArray&&e.x!==void 0,code:s=>` + cv = ud["${s}"].value; + v = uv["${s}"]; + + if(cv[0] !== v.x || cv[1] !== v.y) + { + cv[0] = v.x; + cv[1] = v.y; + gl.uniform2f(ud["${s}"].location, v.x, v.y); + }`,codeUbo:s=>` + v = uv.${s}; + + data[offset] = v.x; + data[offset+1] = v.y; + `},{test:s=>s.type==="vec2"&&s.size===1&&!s.isArray,code:s=>` + cv = ud["${s}"].value; + v = uv["${s}"]; + + if(cv[0] !== v[0] || cv[1] !== v[1]) + { + cv[0] = v[0]; + cv[1] = v[1]; + gl.uniform2f(ud["${s}"].location, v[0], v[1]); + } + `},{test:(s,e)=>s.type==="vec4"&&s.size===1&&!s.isArray&&e.width!==void 0,code:s=>` + cv = ud["${s}"].value; + v = uv["${s}"]; + + if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) + { + cv[0] = v.x; + cv[1] = v.y; + cv[2] = v.width; + cv[3] = v.height; + gl.uniform4f(ud["${s}"].location, v.x, v.y, v.width, v.height) + }`,codeUbo:s=>` + v = uv.${s}; + + data[offset] = v.x; + data[offset+1] = v.y; + data[offset+2] = v.width; + data[offset+3] = v.height; + `},{test:(s,e)=>s.type==="vec4"&&s.size===1&&!s.isArray&&e.red!==void 0,code:s=>` + cv = ud["${s}"].value; + v = uv["${s}"]; + + if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) + { + cv[0] = v.red; + cv[1] = v.green; + cv[2] = v.blue; + cv[3] = v.alpha; + gl.uniform4f(ud["${s}"].location, v.red, v.green, v.blue, v.alpha) + }`,codeUbo:s=>` + v = uv.${s}; + + data[offset] = v.red; + data[offset+1] = v.green; + data[offset+2] = v.blue; + data[offset+3] = v.alpha; + `},{test:(s,e)=>s.type==="vec3"&&s.size===1&&!s.isArray&&e.red!==void 0,code:s=>` + cv = ud["${s}"].value; + v = uv["${s}"]; + + if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.a) + { + cv[0] = v.red; + cv[1] = v.green; + cv[2] = v.blue; + + gl.uniform3f(ud["${s}"].location, v.red, v.green, v.blue) + }`,codeUbo:s=>` + v = uv.${s}; + + data[offset] = v.red; + data[offset+1] = v.green; + data[offset+2] = v.blue; + `},{test:s=>s.type==="vec4"&&s.size===1&&!s.isArray,code:s=>` + cv = ud["${s}"].value; + v = uv["${s}"]; + + if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + cv[3] = v[3]; + + gl.uniform4f(ud["${s}"].location, v[0], v[1], v[2], v[3]) + }`}],wC={float:` + if (cv !== v) + { + cu.value = v; + gl.uniform1f(location, v); + }`,vec2:` + if (cv[0] !== v[0] || cv[1] !== v[1]) + { + cv[0] = v[0]; + cv[1] = v[1]; + + gl.uniform2f(location, v[0], v[1]) + }`,vec3:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + + gl.uniform3f(location, v[0], v[1], v[2]) + }`,vec4:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + cv[3] = v[3]; + + gl.uniform4f(location, v[0], v[1], v[2], v[3]); + }`,int:` + if (cv !== v) + { + cu.value = v; + + gl.uniform1i(location, v); + }`,ivec2:` + if (cv[0] !== v[0] || cv[1] !== v[1]) + { + cv[0] = v[0]; + cv[1] = v[1]; + + gl.uniform2i(location, v[0], v[1]); + }`,ivec3:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + + gl.uniform3i(location, v[0], v[1], v[2]); + }`,ivec4:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + cv[3] = v[3]; + + gl.uniform4i(location, v[0], v[1], v[2], v[3]); + }`,uint:` + if (cv !== v) + { + cu.value = v; + + gl.uniform1ui(location, v); + }`,uvec2:` + if (cv[0] !== v[0] || cv[1] !== v[1]) + { + cv[0] = v[0]; + cv[1] = v[1]; + + gl.uniform2ui(location, v[0], v[1]); + }`,uvec3:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + + gl.uniform3ui(location, v[0], v[1], v[2]); + }`,uvec4:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + cv[3] = v[3]; + + gl.uniform4ui(location, v[0], v[1], v[2], v[3]); + }`,bool:` + if (cv !== v) + { + cu.value = v; + gl.uniform1i(location, v); + }`,bvec2:` + if (cv[0] != v[0] || cv[1] != v[1]) + { + cv[0] = v[0]; + cv[1] = v[1]; + + gl.uniform2i(location, v[0], v[1]); + }`,bvec3:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + + gl.uniform3i(location, v[0], v[1], v[2]); + }`,bvec4:` + if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) + { + cv[0] = v[0]; + cv[1] = v[1]; + cv[2] = v[2]; + cv[3] = v[3]; + + gl.uniform4i(location, v[0], v[1], v[2], v[3]); + }`,mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:` + if (cv !== v) + { + cu.value = v; + + gl.uniform1i(location, v); + }`,samplerCube:` + if (cv !== v) + { + cu.value = v; + + gl.uniform1i(location, v); + }`,sampler2DArray:` + if (cv !== v) + { + cu.value = v; + + gl.uniform1i(location, v); + }`},SC={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function MC(s,e){var i;const t=[` + var v = null; + var cv = null; + var cu = null; + var t = 0; + var gl = renderer.gl; + `];for(const n in s.uniforms){const r=e[n];if(!r){((i=s.uniforms[n])==null?void 0:i.group)===!0&&(s.uniforms[n].ubo?t.push(` + renderer.shader.syncUniformBufferGroup(uv.${n}, '${n}'); + `):t.push(` + renderer.shader.syncUniformGroup(uv.${n}, syncData); + `));continue}const o=s.uniforms[n];let a=!1;for(let c=0;c=go.WEBGL2&&(e=s.getContext("webgl2",{})),e||(e=s.getContext("webgl",{})||s.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),Eo=e}return Eo}let Jl;function _C(){if(!Jl){Jl=ms.MEDIUM;const s=TC();if(s&&s.getShaderPrecisionFormat){const e=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT);e&&(Jl=e.precision?ms.HIGH:ms.MEDIUM)}}return Jl}function tv(s,e){const t=s.getShaderSource(e).split(` +`).map((l,h)=>`${h}: ${l}`),i=s.getShaderInfoLog(e),n=i.split(` +`),r={},o=n.map(l=>parseFloat(l.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(l=>l&&!r[l]?(r[l]=!0,!0):!1),a=[""];o.forEach(l=>{t[l-1]=`%c${t[l-1]}%c`,a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const c=t.join(` +`);a[0]=c,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...a),console.groupEnd()}function CC(s,e,t,i){s.getProgramParameter(e,s.LINK_STATUS)||(s.getShaderParameter(t,s.COMPILE_STATUS)||tv(s,t),s.getShaderParameter(i,s.COMPILE_STATUS)||tv(s,i),console.error("PixiJS Error: Could not initialize shader."),s.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",s.getProgramInfoLog(e)))}const EC={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function yb(s){return EC[s]}let Ql=null;const iv={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function xb(s,e){if(!Ql){const t=Object.keys(iv);Ql={};for(let i=0;i0&&(t+=` +else `),ithis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)}buildTexturesAndDrawCalls(){const{_bufferedTextures:e,maxTextures:t}=this,i=_s._textureArrayPool,n=this.renderer.batch,r=this._tempBoundTextures,o=this.renderer.textureGC.count;let a=++it._globalBatch,c=0,l=i[0],h=0;n.copyBoundTextures(r,t);for(let u=0;u=t&&(n.boundArray(l,r,a,t),this.buildDrawCalls(l,h,u),h=u,l=i[++c],++a),d._batchEnabled=a,d.touched=o,l.elements[l.count++]=d)}l.count>0&&(n.boundArray(l,r,a,t),this.buildDrawCalls(l,h,this._bufferSize),++c,++a);for(let u=0;u0);for(let p=0;p=0;--n)e[n]=i[n]||null,e[n]&&(e[n]._batchLocation=n)}boundArray(e,t,i,n){const{elements:r,ids:o,count:a}=e;let c=0;for(let l=0;l=0&&u=go.WEBGL2&&(i=e.getContext("webgl2",t)),i)this.webGLVersion=2;else if(this.webGLVersion=1,i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),!i)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl}getExtensions(){const{gl:e}=this,t={loseContext:e.getExtension("WEBGL_lose_context"),anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc"),bptc:e.getExtension("EXT_texture_compression_bptc")};this.webGLVersion===1?Object.assign(this.extensions,t,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})}handleContextLost(e){e.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this.renderer.view;this.renderer=null,e.removeEventListener!==void 0&&(e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(e){const t=e.getContextAttributes(),i="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;i&&(this.webGLVersion=2),t&&!t.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const n=i||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=n,n||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}oh.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},oh.extension={type:ke.RendererSystem,name:"context"};$e.add(oh);class Kf{constructor(e,t){if(this.width=Math.round(e),this.height=Math.round(t),!this.width||!this.height)throw new Error("Framebuffer width or height is zero");this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Ls("disposeFramebuffer"),this.multisample=ci.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(e=0,t){return this.colorTextures[e]=t||new it(null,{scaleMode:Rs.NEAREST,resolution:1,mipmap:vs.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(e){return this.depthTexture=e||new it(null,{scaleMode:Rs.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:vs.OFF,format:Te.DEPTH_COMPONENT,type:Ue.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(e,t){if(e=Math.round(e),t=Math.round(t),!e||!t)throw new Error("Framebuffer width and height must not be zero");if(!(e===this.width&&t===this.height)){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(let i=0;i{const n=this.source;this.url=n.src;const r=()=>{this.destroyed||(n.onload=null,n.onerror=null,this.update(),this._load=null,this.createBitmap?t(this.process()):t(this))};n.complete&&n.src?r():(n.onload=r,n.onerror=o=>{i(o),this.onError.emit(o)})}),this._load)}process(){const e=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);const t=globalThis.createImageBitmap,i=!e.crossOrigin||e.crossOrigin==="anonymous";return this._process=fetch(e.src,{mode:i?"cors":"no-cors"}).then(n=>n.blob()).then(n=>t(n,0,0,e.width,e.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===bi.UNPACK?"premultiply":"none"})).then(n=>this.destroyed?Promise.reject():(this.bitmap=n,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(e,t,i){if(typeof this.alphaMode=="number"&&(t.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(e,t,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(e,t,i,this.bitmap),!this.preserveBitmap){let n=!0;const r=t._glTextures;for(const o in r){const a=r[o];if(a!==i&&a.dirtyId!==t.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(e){return typeof HTMLImageElement<"u"&&(typeof e=="string"||e instanceof HTMLImageElement)}}class gp{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(e,t,i){const n=t.width,r=t.height;if(i){const o=e.width/2/n,a=e.height/2/r,c=e.x/n+o,l=e.y/r+a;i=Wt.add(i,Wt.NW),this.x0=c+o*Wt.uX(i),this.y0=l+a*Wt.uY(i),i=Wt.add(i,2),this.x1=c+o*Wt.uX(i),this.y1=l+a*Wt.uY(i),i=Wt.add(i,2),this.x2=c+o*Wt.uX(i),this.y2=l+a*Wt.uY(i),i=Wt.add(i,2),this.x3=c+o*Wt.uX(i),this.y3=l+a*Wt.uY(i)}else this.x0=e.x/n,this.y0=e.y/r,this.x1=(e.x+e.width)/n,this.y1=e.y/r,this.x2=(e.x+e.width)/n,this.y2=(e.y+e.height)/r,this.x3=e.x/n,this.y3=(e.y+e.height)/r;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}}gp.prototype.toString=function(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`};const rv=new gp;function tc(s){s.destroy=function(){},s.on=function(){},s.once=function(){},s.emit=function(){}}let Ke=class Dt extends Rl{constructor(e,t,i,n,r,o,a){if(super(),this.noFrame=!1,t||(this.noFrame=!0,t=new ct(0,0,1,1)),e instanceof Dt&&(e=e.baseTexture),this.baseTexture=e,this._frame=t,this.trim=n,this.valid=!1,this.destroyed=!1,this._uvs=rv,this.uvMatrix=null,this.orig=i||t,this._rotate=Number(r||0),r===!0)this._rotate=2;else if(this._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=o?new St(o.x,o.y):new St(0,0),this.defaultBorders=a,this._updateID=0,this.textureCacheIds=[],e.valid?this.noFrame?e.valid&&this.onBaseTextureUpdated(e):this.frame=t:e.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&e.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(e){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=e.width,this._frame.height=e.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(e){if(this.baseTexture){if(e){const{resource:t}=this.baseTexture;t!=null&&t.url&&Ys[t.url]&&Dt.removeFromCache(t.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,Dt.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}clone(){var n;const e=this._frame.clone(),t=this._frame===this.orig?e:this.orig.clone(),i=new Dt(this.baseTexture,!this.noFrame&&e,t,(n=this.trim)==null?void 0:n.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(i._frame=e),i}updateUvs(){this._uvs===rv&&(this._uvs=new gp),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(e,t={},i=Be.STRICT_TEXTURE_CACHE){const n=typeof e=="string";let r=null;if(n)r=e;else if(e instanceof it){if(!e.cacheId){const a=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e.cacheId=`${a}-${ho()}`,it.addToCache(e,e.cacheId)}r=e.cacheId}else{if(!e._pixiId){const a=(t==null?void 0:t.pixiIdPrefix)||"pixiid";e._pixiId=`${a}_${ho()}`}r=e._pixiId}let o=Ys[r];if(n&&i&&!o)throw new Error(`The cacheId "${r}" does not exist in TextureCache.`);return!o&&!(e instanceof it)?(t.resolution||(t.resolution=Hn(e)),o=new Dt(new it(e,t)),o.baseTexture.cacheId=r,it.addToCache(o.baseTexture,r),Dt.addToCache(o,r)):!o&&e instanceof it&&(o=new Dt(e),Dt.addToCache(o,r)),o}static fromURL(e,t){const i=Object.assign({autoLoad:!1},t==null?void 0:t.resourceOptions),n=Dt.from(e,Object.assign({resourceOptions:i},t),!1),r=n.baseTexture.resource;return n.baseTexture.valid?Promise.resolve(n):r.load().then(()=>Promise.resolve(n))}static fromBuffer(e,t,i,n){return new Dt(it.fromBuffer(e,t,i,n))}static fromLoader(e,t,i,n){const r=new it(e,Object.assign({scaleMode:it.defaultOptions.scaleMode,resolution:Hn(t)},n)),{resource:o}=r;o instanceof Mb&&(o.url=t);const a=new Dt(r);return i||(i=t),it.addToCache(a.baseTexture,i),Dt.addToCache(a,i),i!==t&&(it.addToCache(a.baseTexture,t),Dt.addToCache(a,t)),a.baseTexture.valid?Promise.resolve(a):new Promise(c=>{a.baseTexture.once("loaded",()=>c(a))})}static addToCache(e,t){t&&(e.textureCacheIds.includes(t)||e.textureCacheIds.push(t),Ys[t]&&Ys[t]!==e&&console.warn(`Texture added to the cache with an id [${t}] that already had an entry`),Ys[t]=e)}static removeFromCache(e){if(typeof e=="string"){const t=Ys[e];if(t){const i=t.textureCacheIds.indexOf(e);return i>-1&&t.textureCacheIds.splice(i,1),delete Ys[e],t}}else if(e!=null&&e.textureCacheIds){for(let t=0;tthis.baseTexture.width,a=i+r>this.baseTexture.height;if(o||a){const c=o&&a?"and":"or",l=`X: ${t} + ${n} = ${t+n} > ${this.baseTexture.width}`,h=`Y: ${i} + ${r} = ${i+r} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${l} ${c} ${h}`)}this.valid=n&&r&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=e),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(e){this._rotate=e,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return Dt._EMPTY||(Dt._EMPTY=new Dt(new it),tc(Dt._EMPTY),tc(Dt._EMPTY.baseTexture)),Dt._EMPTY}static get WHITE(){if(!Dt._WHITE){const e=Be.ADAPTER.createCanvas(16,16),t=e.getContext("2d");e.width=16,e.height=16,t.fillStyle="white",t.fillRect(0,0,16,16),Dt._WHITE=new Dt(it.from(e)),tc(Dt._WHITE),tc(Dt._WHITE.baseTexture)}return Dt._WHITE}};class vo extends Ke{constructor(e,t){super(e,t),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(e){this.framebuffer.multisample=e}resize(e,t,i=!0){const n=this.baseTexture.resolution,r=Math.round(e*n)/n,o=Math.round(t*n)/n;this.valid=r>0&&o>0,this._frame.width=this.orig.width=r,this._frame.height=this.orig.height=o,i&&this.baseTexture.resize(r,o),this.updateUvs()}setResolution(e){const{baseTexture:t}=this;t.resolution!==e&&(t.setResolution(e),this.resize(t.width,t.height,!1))}static create(e){return new vo(new Sb(e))}}class Tb{constructor(e){this.texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(e,t,i=ci.NONE){const n=new Sb(Object.assign({width:e,height:t,resolution:1,multisample:i},this.textureOptions));return new vo(n)}getOptimalTexture(e,t,i=1,n=ci.NONE){let r;e=Math.max(Math.ceil(e*i-1e-6),1),t=Math.max(Math.ceil(t*i-1e-6),1),!this.enableFullScreen||e!==this._pixelsWidth||t!==this._pixelsHeight?(e=ih(e),t=ih(t),r=((e&65535)<<16|t&65535)>>>0,n>1&&(r+=n*4294967296)):r=n>1?-n:-1,this.texturePool[r]||(this.texturePool[r]=[]);let o=this.texturePool[r].pop();return o||(o=this.createTexture(e,t,n)),o.filterPoolKey=r,o.setResolution(i),o}getFilterTexture(e,t,i){const n=this.getOptimalTexture(e.width,e.height,t||e.resolution,i||ci.NONE);return n.filterFrame=e.filterFrame,n}returnTexture(e){const t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)}returnFilterTexture(e){this.returnTexture(e)}clear(e){if(e=e!==!1,e)for(const t in this.texturePool){const i=this.texturePool[t];if(i)for(let n=0;n0&&e.height>0;for(const t in this.texturePool){if(!(Number(t)<0))continue;const i=this.texturePool[t];if(i)for(let n=0;n1&&(h=this.getOptimalFilterTexture(l.width,l.height,t.resolution),h.filterFrame=l.filterFrame),i[u].apply(this,l,h,en.CLEAR,t);const d=l;l=h,h=d}i[u].apply(this,l,c.renderTexture,en.BLEND,t),u>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(h)}t.clear(),this.statePool.push(t)}bindAndClear(e,t=en.CLEAR){const{renderTexture:i,state:n}=this.renderer;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e==null?void 0:e.filterFrame){const o=this.tempRect;o.x=0,o.y=0,o.width=e.filterFrame.width,o.height=e.filterFrame.height,i.bind(e,e.filterFrame,o)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?i.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const r=n.stateId&1||this.forceClear;(t===en.CLEAR||t===en.BLIT&&r)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(e,t,i,n){const r=this.renderer;r.state.set(e.state),this.bindAndClear(i,n),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,r.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),r.geometry.bind(this.quadUv),r.geometry.draw(on.TRIANGLES)):(r.geometry.bind(this.quad),r.geometry.draw(on.TRIANGLE_STRIP))}calculateSpriteMatrix(e,t){const{sourceFrame:i,destinationFrame:n}=this.activeState,{orig:r}=t._texture,o=e.set(n.width,0,0,n.height,i.x,i.y),a=t.worldTransform.copyTo(Ft.TEMP_MATRIX);return a.invert(),o.prepend(a),o.scale(1/r.width,1/r.height),o.translate(t.anchor.x,t.anchor.y),o}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(e,t,i=1,n=ci.NONE){return this.texturePool.getOptimalTexture(e,t,i,n)}getFilterTexture(e,t,i){if(typeof e=="number"){const r=e;e=t,t=r}e=e||this.activeState.renderTexture;const n=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,i||ci.NONE);return n.filterFrame=e.filterFrame,n}returnFilterTexture(e){this.texturePool.returnTexture(e)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(e,t){const i=ic[0],n=ic[1],r=ic[2],o=ic[3];i.set(t.left,t.top),n.set(t.left,t.bottom),r.set(t.right,t.top),o.set(t.right,t.bottom),e.apply(i,i),e.apply(n,n),e.apply(r,r),e.apply(o,o);const a=Math.min(i.x,n.x,r.x,o.x),c=Math.min(i.y,n.y,r.y,o.y),l=Math.max(i.x,n.x,r.x,o.x),h=Math.max(i.y,n.y,r.y,o.y);t.x=a,t.y=c,t.width=l-a,t.height=h-c}roundFrame(e,t,i,n,r){if(!(e.width<=0||e.height<=0||i.width<=0||i.height<=0)){if(r){const{a:o,b:a,c,d:l}=r;if((Math.abs(a)>1e-4||Math.abs(c)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(l)>1e-4))return}r=r?jd.copyFrom(r):jd.identity(),r.translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.transformAABB(r,e),e.ceil(t),this.transformAABB(r.invert(),e)}}}Cb.extension={type:ke.RendererSystem,name:"filter"};$e.add(Cb);class UC{constructor(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=ci.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const $C=new ct;class Eb{constructor(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new Kf(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new ct,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let t=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;Be.PREFER_ENV===go.WEBGL_LEGACY&&(t=null,i=null),t?e.drawBuffers=n=>t.drawBuffersWEBGL(n):(this.hasMRT=!1,e.drawBuffers=()=>{}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)}bind(e,t,i=0){const{gl:n}=this;if(e){const r=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,n.bindFramebuffer(n.FRAMEBUFFER,r.framebuffer)),r.mipLevel!==i&&(e.dirtyId++,e.dirtyFormat++,r.mipLevel=i),r.dirtyId!==e.dirtyId&&(r.dirtyId=e.dirtyId,r.dirtyFormat!==e.dirtyFormat?(r.dirtyFormat=e.dirtyFormat,r.dirtySize=e.dirtySize,this.updateFramebuffer(e,i)):r.dirtySize!==e.dirtySize&&(r.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(let o=0;o>i,a=t.height>>i,c=o/t.width;this.setViewport(t.x*c,t.y*c,o,a)}else{const o=e.width>>i,a=e.height>>i;this.setViewport(0,0,o,a)}}else this.current&&(this.current=null,n.bindFramebuffer(n.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(e,t,i,n){const r=this.viewport;e=Math.round(e),t=Math.round(t),i=Math.round(i),n=Math.round(n),(r.width!==i||r.height!==n||r.x!==e||r.y!==t)&&(r.x=e,r.y=t,r.width=i,r.height=n,this.gl.viewport(e,t,i,n))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(e,t,i,n,r=Bf.COLOR|Bf.DEPTH){const{gl:o}=this;o.clearColor(e,t,i,n),o.clear(r)}initFramebuffer(e){const{gl:t}=this,i=new UC(t.createFramebuffer());return i.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(e),e.disposeRunner.add(this),i}resizeFramebuffer(e){const{gl:t}=this,i=e.glFramebuffers[this.CONTEXT_UID];if(i.stencil){t.bindRenderbuffer(t.RENDERBUFFER,i.stencil);let o;this.renderer.context.webGLVersion===1?o=t.DEPTH_STENCIL:e.depth&&e.stencil?o=t.DEPTH24_STENCIL8:e.depth?o=t.DEPTH_COMPONENT24:o=t.STENCIL_INDEX8,i.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,i.multisample,o,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,o,e.width,e.height)}const n=e.colorTextures;let r=n.length;t.drawBuffers||(r=Math.min(r,1));for(let o=0;o1&&this.canMultisampleFramebuffer(e)?n.msaaBuffer=n.msaaBuffer||i.createRenderbuffer():n.msaaBuffer&&(i.deleteRenderbuffer(n.msaaBuffer),n.msaaBuffer=null,n.blitFramebuffer&&(n.blitFramebuffer.dispose(),n.blitFramebuffer=null));const a=[];for(let c=0;c1&&i.drawBuffers(a),e.depthTexture&&this.writeDepthTexture){const c=e.depthTexture;this.renderer.texture.bind(c,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,c._glTextures[this.CONTEXT_UID].texture,t)}if((e.stencil||e.depth)&&!(e.depthTexture&&this.writeDepthTexture)){n.stencil=n.stencil||i.createRenderbuffer();let c,l;this.renderer.context.webGLVersion===1?(c=i.DEPTH_STENCIL_ATTACHMENT,l=i.DEPTH_STENCIL):e.depth&&e.stencil?(c=i.DEPTH_STENCIL_ATTACHMENT,l=i.DEPTH24_STENCIL8):e.depth?(c=i.DEPTH_ATTACHMENT,l=i.DEPTH_COMPONENT24):(c=i.STENCIL_ATTACHMENT,l=i.STENCIL_INDEX8),i.bindRenderbuffer(i.RENDERBUFFER,n.stencil),n.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,l,e.width,e.height):i.renderbufferStorage(i.RENDERBUFFER,l,e.width,e.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,c,i.RENDERBUFFER,n.stencil)}else n.stencil&&(i.deleteRenderbuffer(n.stencil),n.stencil=null)}canMultisampleFramebuffer(e){return this.renderer.context.webGLVersion!==1&&e.colorTextures.length<=1&&!e.depthTexture}detectSamples(e){const{msaaSamples:t}=this;let i=ci.NONE;if(e<=1||t===null)return i;for(let n=0;n=0&&this.managedFramebuffers.splice(r,1),e.disposeRunner.remove(this),t||(n.deleteFramebuffer(i.framebuffer),i.msaaBuffer&&n.deleteRenderbuffer(i.msaaBuffer),i.stencil&&n.deleteRenderbuffer(i.stencil)),i.blitFramebuffer&&this.disposeFramebuffer(i.blitFramebuffer,t)}disposeAll(e){const t=this.managedFramebuffers;this.managedFramebuffers=[];for(let i=0;ii.createVertexArrayOES(),e.bindVertexArray=n=>i.bindVertexArrayOES(n),e.deleteVertexArray=n=>i.deleteVertexArrayOES(n)):(this.hasVao=!1,e.createVertexArray=()=>null,e.bindVertexArray=()=>null,e.deleteVertexArray=()=>null)}if(t.webGLVersion!==2){const i=e.getExtension("ANGLE_instanced_arrays");i?(e.vertexAttribDivisor=(n,r)=>i.vertexAttribDivisorANGLE(n,r),e.drawElementsInstanced=(n,r,o,a,c)=>i.drawElementsInstancedANGLE(n,r,o,a,c),e.drawArraysInstanced=(n,r,o,a)=>i.drawArraysInstancedANGLE(n,r,o,a)):this.hasInstance=!1}this.canUseUInt32ElementIndex=t.webGLVersion===2||!!t.extensions.uint32ElementIndex}bind(e,t){t=t||this.renderer.shader.shader;const{gl:i}=this;let n=e.glVertexArrayObjects[this.CONTEXT_UID],r=!1;n||(this.managedGeometries[e.id]=e,e.disposeRunner.add(this),e.glVertexArrayObjects[this.CONTEXT_UID]=n={},r=!0);const o=n[t.program.id]||this.initGeometryVao(e,t,r);this._activeGeometry=e,this._activeVao!==o&&(this._activeVao=o,this.hasVao?i.bindVertexArray(o):this.activateVao(e,t.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const e=this._activeGeometry,t=this.renderer.buffer;for(let i=0;i"u"?.5:t,this.isSimple=!1}get texture(){return this._texture}set texture(e){this._texture=e,this._textureID=-1}multiplyUvs(e,t){t===void 0&&(t=e);const i=this.mapCoord;for(let n=0;n0?this.maskStack[this.maskStack.length-1]._colorMask:15;i!==t&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)}destroy(){this.renderer=null}}Ib.extension={type:ke.RendererSystem,name:"mask"};$e.add(Ib);class Rb{constructor(e){this.renderer=e,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(e){const{gl:t}=this.renderer,i=this.getStackLength();this.maskStack=e;const n=this.getStackLength();n!==i&&(n===0?t.disable(this.glConst):(t.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const av=new Ft,lv=[],Pb=class Pc extends Rb{constructor(e){super(e),this.glConst=Be.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._scissorCounter:0}calcScissorRect(e){if(e._scissorRectLocal)return;const t=e._scissorRect,{maskObject:i}=e,{renderer:n}=this,r=n.renderTexture,o=i.getBounds(!0,lv.pop()??new ct);this.roundFrameToPixels(o,r.current?r.current.resolution:n.resolution,r.sourceFrame,r.destinationFrame,n.projection.transform),t&&o.fit(t),e._scissorRectLocal=o}static isMatrixRotated(e){if(!e)return!1;const{a:t,b:i,c:n,d:r}=e;return(Math.abs(i)>1e-4||Math.abs(n)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(r)>1e-4)}testScissor(e){const{maskObject:t}=e;if(!t.isFastRect||!t.isFastRect()||Pc.isMatrixRotated(t.worldTransform)||Pc.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);const i=e._scissorRectLocal;return i.width>0&&i.height>0}roundFrameToPixels(e,t,i,n,r){Pc.isMatrixRotated(r)||(r=r?av.copyFrom(r):av.identity(),r.translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.renderer.filter.transformAABB(r,e),e.fit(n),e.x=Math.round(e.x*t),e.y=Math.round(e.y*t),e.width=Math.round(e.width*t),e.height=Math.round(e.height*t))}push(e){e._scissorRectLocal||this.calcScissorRect(e);const{gl:t}=this.renderer;e._scissorRect||t.enable(t.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()}pop(e){const{gl:t}=this.renderer;e&&lv.push(e._scissorRectLocal),this.getStackLength()>0?this._useCurrent():t.disable(t.SCISSOR_TEST)}_useCurrent(){const e=this.maskStack[this.maskStack.length-1]._scissorRect;let t;this.renderer.renderTexture.current?t=e.y:t=this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,t,e.width,e.height)}};Pb.extension={type:ke.RendererSystem,name:"scissor"};let jC=Pb;$e.add(jC);class kb extends Rb{constructor(e){super(e),this.glConst=Be.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0}push(e){const t=e.maskObject,{gl:i}=this.renderer,n=e._stencilCounter;n===0&&(this.renderer.framebuffer.forceStencil(),i.clearStencil(0),i.clear(i.STENCIL_BUFFER_BIT),i.enable(i.STENCIL_TEST)),e._stencilCounter++;const r=e._colorMask;r!==0&&(e._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilFunc(i.EQUAL,n,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.INCR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,r!==0&&(e._colorMask=r,i.colorMask((r&1)!==0,(r&2)!==0,(r&4)!==0,(r&8)!==0)),this._useCurrent()}pop(e){const t=this.renderer.gl;if(this.getStackLength()===0)t.disable(t.STENCIL_TEST);else{const i=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,n=i?i._colorMask:15;n!==0&&(i._colorMask=0,t.colorMask(!1,!1,!1,!1)),t.stencilOp(t.KEEP,t.KEEP,t.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,n!==0&&(i._colorMask=n,t.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)),this._useCurrent()}}_useCurrent(){const e=this.renderer.gl;e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)}}kb.extension={type:ke.RendererSystem,name:"stencil"};$e.add(kb);class Fb{constructor(e){this.renderer=e,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return mt("7.0.0","renderer.plugins.extract has moved to renderer.extract"),e.extract}},prepare:{enumerable:!1,get(){return mt("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),e.prepare}},interaction:{enumerable:!1,get(){return mt("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),e.events}}})}init(){const e=this.rendererPlugins;for(const t in e)this.plugins[t]=new e[t](this.renderer)}destroy(){for(const e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null}}Fb.extension={type:[ke.RendererSystem,ke.CanvasRendererSystem],name:"_plugin"};$e.add(Fb);class Ob{constructor(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Ft,this.transform=null}update(e,t,i,n){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,n),this.transform&&this.projectionMatrix.append(this.transform);const r=this.renderer;r.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,r.globalUniforms.update(),r.shader.shader&&r.shader.syncUniformGroup(r.shader.shader.uniforms.globals)}calculateProjection(e,t,i,n){const r=this.projectionMatrix,o=n?-1:1;r.identity(),r.a=1/t.width*2,r.d=o*(1/t.height*2),r.tx=-1-t.x*r.a,r.ty=-o-t.y*r.d}setTransform(e){}destroy(){this.renderer=null}}Ob.extension={type:ke.RendererSystem,name:"projection"};$e.add(Ob);const HC=new pp,cv=new ct;class Lb{constructor(e){this.renderer=e,this._tempMatrix=new Ft}generateTexture(e,t){const{region:i,...n}=t||{},r=(i==null?void 0:i.copyTo(cv))||e.getLocalBounds(cv,!0),o=n.resolution||this.renderer.resolution;r.width=Math.max(r.width,1/o),r.height=Math.max(r.height,1/o),n.width=r.width,n.height=r.height,n.resolution=o,n.multisample??(n.multisample=this.renderer.multisample);const a=vo.create(n);this._tempMatrix.tx=-r.x,this._tempMatrix.ty=-r.y;const c=e.transform;return e.transform=HC,this.renderer.render(e,{renderTexture:a,transform:this._tempMatrix,skipUpdateTransform:!!e.parent,blit:!0}),e.transform=c,a}destroy(){}}Lb.extension={type:[ke.RendererSystem,ke.CanvasRendererSystem],name:"textureGenerator"};$e.add(Lb);const Ur=new ct,Fa=new ct;class Bb{constructor(e){this.renderer=e,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new ct,this.destinationFrame=new ct,this.viewportFrame=new ct}contextChange(){var t;const e=(t=this.renderer)==null?void 0:t.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(e&&e.alpha&&e.premultipliedAlpha)}bind(e=null,t,i){const n=this.renderer;this.current=e;let r,o,a;e?(r=e.baseTexture,a=r.resolution,t||(Ur.width=e.frame.width,Ur.height=e.frame.height,t=Ur),i||(Fa.x=e.frame.x,Fa.y=e.frame.y,Fa.width=t.width,Fa.height=t.height,i=Fa),o=r.framebuffer):(a=n.resolution,t||(Ur.width=n._view.screen.width,Ur.height=n._view.screen.height,t=Ur),i||(i=Ur,i.width=t.width,i.height=t.height));const c=this.viewportFrame;c.x=i.x*a,c.y=i.y*a,c.width=i.width*a,c.height=i.height*a,e||(c.y=n.view.height-(c.y+c.height)),c.ceil(),this.renderer.framebuffer.bind(o,c),this.renderer.projection.update(i,t,a,!o),e?this.renderer.mask.setMaskStack(r.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(i)}clear(e,t){const i=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,n=At.shared.setValue(e||i);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&n.premultiply(n.alpha);const r=this.destinationFrame,o=this.current?this.current.baseTexture:this.renderer._view.screen,a=r.width!==o.width||r.height!==o.height;if(a){let{x:c,y:l,width:h,height:u}=this.viewportFrame;c=Math.round(c),l=Math.round(l),h=Math.round(h),u=Math.round(u),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(c,l,h,u)}this.renderer.framebuffer.clear(n.red,n.green,n.blue,n.alpha,t),a&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}Bb.extension={type:ke.RendererSystem,name:"renderTexture"};$e.add(Bb);class WC{constructor(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function zC(s,e){const t={},i=e.getProgramParameter(s,e.ACTIVE_ATTRIBUTES);for(let n=0;nl>h?1:-1);for(let l=0;l({data:r,offset:0,dataLen:0,dirty:0}));let t=0,i=0,n=0;for(let r=0;r1&&(t=Math.max(t,16)*o.data.size),o.dataLen=t,i%t!==0&&i<16){const a=i%t%16;i+=a,n+=a}i+t>16?(n=Math.ceil(n/16)*16,o.offset=n,n+=t,i=t):(o.offset=n,i+=t,n+=t)}return n=Math.ceil(n/16)*16,{uboElements:e,size:n}}function eE(s,e){const t=[];for(const i in s)e[i]&&t.push(e[i]);return t.sort((i,n)=>i.index-n.index),t}function tE(s,e){if(!s.autoManage)return{size:0,syncFunc:ZC};const t=eE(s.uniforms,e),{uboElements:i,size:n}=QC(t),r=[` + var v = null; + var v2 = null; + var cv = null; + var t = 0; + var gl = renderer.gl + var index = 0; + var data = buffer.data; + `];for(let o=0;o1){const u=yb(a.data.type),d=Math.max(Nb[a.data.type]/16,1),f=u/d,m=(4-f%4)%4;r.push(` + cv = ud.${l}.value; + v = uv.${l}; + offset = ${a.offset/4}; + + t = 0; + + for(var i=0; i < ${a.data.size*d}; i++) + { + for(var j = 0; j < ${f}; j++) + { + data[offset++] = v[t++]; + } + offset += ${m}; + } + + `)}else{const u=JC[a.data.type];r.push(` + cv = ud.${l}.value; + v = uv.${l}; + offset = ${a.offset/4}; + ${u}; + `)}}return r.push(` + renderer.buffer.update(buffer); + `),{size:n,syncFunc:new Function("ud","uv","renderer","syncData","buffer",r.join(` +`))}}let iE=0;const sc={textureCount:0,uboCount:0};class Db{constructor(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=iE++}systemCheck(){if(!AC())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(e){this.gl=e,this.reset()}bind(e,t){e.disposeRunner.add(this),e.uniforms.globals=this.renderer.globalUniforms;const i=e.program,n=i.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==i&&(this.program=i,this.gl.useProgram(n.program)),t||(sc.textureCount=0,sc.uboCount=0,this.syncUniformGroup(e.uniformGroup,sc)),n}setUniforms(e){const t=this.shader.program,i=t.glPrograms[this.renderer.CONTEXT_UID];t.syncUniforms(i.uniformData,e,this.renderer)}syncUniformGroup(e,t){const i=this.getGlProgram();(!e.static||e.dirtyId!==i.uniformDirtyGroups[e.id])&&(i.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,i,t))}syncUniforms(e,t,i){(e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e))(t.uniformData,e.uniforms,this.renderer,i)}createSyncGroups(e){const t=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[t]||(this.cache[t]=MC(e,this.shader.program.uniformData)),e.syncUniforms[this.shader.program.id]=this.cache[t],e.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(e,t){const i=this.getGlProgram();if(!e.static||e.dirtyId!==0||!i.uniformGroups[e.id]){e.dirtyId=0;const n=i.uniformGroups[e.id]||this.createSyncBufferGroup(e,i,t);e.buffer.update(),n(i.uniformData,e.uniforms,this.renderer,sc,e.buffer)}this.renderer.buffer.bindBufferBase(e.buffer,i.uniformBufferBindings[t])}createSyncBufferGroup(e,t,i){const{gl:n}=this.renderer;this.renderer.buffer.bind(e.buffer);const r=this.gl.getUniformBlockIndex(t.program,i);t.uniformBufferBindings[i]=this.shader.uniformBindCount,n.uniformBlockBinding(t.program,r,this.shader.uniformBindCount),this.shader.uniformBindCount++;const o=this.getSignature(e,this.shader.program.uniformData,"ubo");let a=this._uboCache[o];if(a||(a=this._uboCache[o]=tE(e,this.shader.program.uniformData)),e.autoManage){const c=new Float32Array(a.size/4);e.buffer.update(c)}return t.uniformGroups[e.id]=a.syncFunc,t.uniformGroups[e.id]}getSignature(e,t,i){const n=e.uniforms,r=[`${i}-`];for(const o in n)r.push(o),t[o]&&r.push(t[o].type);return r.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(e){const t=this.gl,i=e.program,n=KC(t,i);return i.glPrograms[this.renderer.CONTEXT_UID]=n,n}reset(){this.program=null,this.shader=null}disposeShader(e){this.shader===e&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}Db.extension={type:ke.RendererSystem,name:"shader"};$e.add(Db);class ah{constructor(e){this.renderer=e}run(e){const{renderer:t}=this;t.runners.init.emit(t.options),e.hello&&console.log(`PixiJS 7.4.3 - ${t.rendererLogId} - https://pixijs.com`),t.resize(t.screen.width,t.screen.height)}destroy(){}}ah.defaultOptions={hello:!1},ah.extension={type:[ke.RendererSystem,ke.CanvasRendererSystem],name:"startup"};$e.add(ah);function sE(s,e=[]){return e[We.NORMAL]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.ADD]=[s.ONE,s.ONE],e[We.MULTIPLY]=[s.DST_COLOR,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.SCREEN]=[s.ONE,s.ONE_MINUS_SRC_COLOR,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.OVERLAY]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.DARKEN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.LIGHTEN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.COLOR_DODGE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.COLOR_BURN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.HARD_LIGHT]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.SOFT_LIGHT]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.DIFFERENCE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.EXCLUSION]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.HUE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.SATURATION]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.COLOR]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.LUMINOSITY]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.NONE]=[0,0],e[We.NORMAL_NPM]=[s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.ADD_NPM]=[s.SRC_ALPHA,s.ONE,s.ONE,s.ONE],e[We.SCREEN_NPM]=[s.SRC_ALPHA,s.ONE_MINUS_SRC_COLOR,s.ONE,s.ONE_MINUS_SRC_ALPHA],e[We.SRC_IN]=[s.DST_ALPHA,s.ZERO],e[We.SRC_OUT]=[s.ONE_MINUS_DST_ALPHA,s.ZERO],e[We.SRC_ATOP]=[s.DST_ALPHA,s.ONE_MINUS_SRC_ALPHA],e[We.DST_OVER]=[s.ONE_MINUS_DST_ALPHA,s.ONE],e[We.DST_IN]=[s.ZERO,s.SRC_ALPHA],e[We.DST_OUT]=[s.ZERO,s.ONE_MINUS_SRC_ALPHA],e[We.DST_ATOP]=[s.ONE_MINUS_DST_ALPHA,s.SRC_ALPHA],e[We.XOR]=[s.ONE_MINUS_DST_ALPHA,s.ONE_MINUS_SRC_ALPHA],e[We.SUBTRACT]=[s.ONE,s.ONE,s.ONE,s.ONE,s.FUNC_REVERSE_SUBTRACT,s.FUNC_ADD],e}const nE=0,rE=1,oE=2,aE=3,lE=4,cE=5,Ub=class Zf{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=We.NONE,this._blendEq=!1,this.map=[],this.map[nE]=this.setBlend,this.map[rE]=this.setOffset,this.map[oE]=this.setCullFace,this.map[aE]=this.setDepthTest,this.map[lE]=this.setFrontFace,this.map[cE]=this.setDepthMask,this.checks=[],this.defaultState=new mn,this.defaultState.blend=!0}contextChange(e){this.gl=e,this.blendModes=sE(e),this.set(this.defaultState),this.reset()}set(e){if(e=e||this.defaultState,this.stateId!==e.data){let t=this.stateId^e.data,i=0;for(;t;)t&1&&this.map[i].call(this,!!(e.data&1<>1,i++;this.stateId=e.data}for(let t=0;te.systems[n]),i=[...t,...Object.keys(e.systems).filter(n=>!t.includes(n))];for(const n of i)this.addSystem(e.systems[n],n)}addRunners(...e){e.forEach(t=>{this.runners[t]=new Ls(t)})}addSystem(e,t){const i=new e(this);if(this[t])throw new Error(`Whoops! The name "${t}" is already in use`);this[t]=i,this._systemsHash[t]=i;for(const n in this.runners)this.runners[n].add(i);return this}emitWithCustomOptions(e,t){const i=Object.keys(this._systemsHash);e.items.forEach(n=>{const r=i.find(o=>this._systemsHash[o]===n);n[e.name](t[r])})}destroy(){Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash={}}}const Ya=class kc{constructor(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=kc.defaultMaxIdle,this.checkCountMax=kc.defaultCheckCountMax,this.mode=kc.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==up.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const e=this.renderer.texture,t=e.managedTextures;let i=!1;for(let n=0;nthis.maxIdle&&(e.destroyTexture(r,!0),t[n]=null,i=!0)}if(i){let n=0;for(let r=0;r=0;n--)this.unload(e.children[n])}destroy(){this.renderer=null}};Ya.defaultMode=up.AUTO,Ya.defaultMaxIdle=3600,Ya.defaultCheckCountMax=600,Ya.extension={type:ke.RendererSystem,name:"textureGC"};let Hr=Ya;$e.add(Hr);class Wd{constructor(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=Ue.UNSIGNED_BYTE,this.internalFormat=Te.RGBA,this.samplerType=0}}function dE(s){let e;return"WebGL2RenderingContext"in globalThis&&s instanceof globalThis.WebGL2RenderingContext?e={[s.RGB]:De.FLOAT,[s.RGBA]:De.FLOAT,[s.ALPHA]:De.FLOAT,[s.LUMINANCE]:De.FLOAT,[s.LUMINANCE_ALPHA]:De.FLOAT,[s.R8]:De.FLOAT,[s.R8_SNORM]:De.FLOAT,[s.RG8]:De.FLOAT,[s.RG8_SNORM]:De.FLOAT,[s.RGB8]:De.FLOAT,[s.RGB8_SNORM]:De.FLOAT,[s.RGB565]:De.FLOAT,[s.RGBA4]:De.FLOAT,[s.RGB5_A1]:De.FLOAT,[s.RGBA8]:De.FLOAT,[s.RGBA8_SNORM]:De.FLOAT,[s.RGB10_A2]:De.FLOAT,[s.RGB10_A2UI]:De.FLOAT,[s.SRGB8]:De.FLOAT,[s.SRGB8_ALPHA8]:De.FLOAT,[s.R16F]:De.FLOAT,[s.RG16F]:De.FLOAT,[s.RGB16F]:De.FLOAT,[s.RGBA16F]:De.FLOAT,[s.R32F]:De.FLOAT,[s.RG32F]:De.FLOAT,[s.RGB32F]:De.FLOAT,[s.RGBA32F]:De.FLOAT,[s.R11F_G11F_B10F]:De.FLOAT,[s.RGB9_E5]:De.FLOAT,[s.R8I]:De.INT,[s.R8UI]:De.UINT,[s.R16I]:De.INT,[s.R16UI]:De.UINT,[s.R32I]:De.INT,[s.R32UI]:De.UINT,[s.RG8I]:De.INT,[s.RG8UI]:De.UINT,[s.RG16I]:De.INT,[s.RG16UI]:De.UINT,[s.RG32I]:De.INT,[s.RG32UI]:De.UINT,[s.RGB8I]:De.INT,[s.RGB8UI]:De.UINT,[s.RGB16I]:De.INT,[s.RGB16UI]:De.UINT,[s.RGB32I]:De.INT,[s.RGB32UI]:De.UINT,[s.RGBA8I]:De.INT,[s.RGBA8UI]:De.UINT,[s.RGBA16I]:De.INT,[s.RGBA16UI]:De.UINT,[s.RGBA32I]:De.INT,[s.RGBA32UI]:De.UINT,[s.DEPTH_COMPONENT16]:De.FLOAT,[s.DEPTH_COMPONENT24]:De.FLOAT,[s.DEPTH_COMPONENT32F]:De.FLOAT,[s.DEPTH_STENCIL]:De.FLOAT,[s.DEPTH24_STENCIL8]:De.FLOAT,[s.DEPTH32F_STENCIL8]:De.FLOAT}:e={[s.RGB]:De.FLOAT,[s.RGBA]:De.FLOAT,[s.ALPHA]:De.FLOAT,[s.LUMINANCE]:De.FLOAT,[s.LUMINANCE_ALPHA]:De.FLOAT,[s.DEPTH_STENCIL]:De.FLOAT},e}function fE(s){let e;return"WebGL2RenderingContext"in globalThis&&s instanceof globalThis.WebGL2RenderingContext?e={[Ue.UNSIGNED_BYTE]:{[Te.RGBA]:s.RGBA8,[Te.RGB]:s.RGB8,[Te.RG]:s.RG8,[Te.RED]:s.R8,[Te.RGBA_INTEGER]:s.RGBA8UI,[Te.RGB_INTEGER]:s.RGB8UI,[Te.RG_INTEGER]:s.RG8UI,[Te.RED_INTEGER]:s.R8UI,[Te.ALPHA]:s.ALPHA,[Te.LUMINANCE]:s.LUMINANCE,[Te.LUMINANCE_ALPHA]:s.LUMINANCE_ALPHA},[Ue.BYTE]:{[Te.RGBA]:s.RGBA8_SNORM,[Te.RGB]:s.RGB8_SNORM,[Te.RG]:s.RG8_SNORM,[Te.RED]:s.R8_SNORM,[Te.RGBA_INTEGER]:s.RGBA8I,[Te.RGB_INTEGER]:s.RGB8I,[Te.RG_INTEGER]:s.RG8I,[Te.RED_INTEGER]:s.R8I},[Ue.UNSIGNED_SHORT]:{[Te.RGBA_INTEGER]:s.RGBA16UI,[Te.RGB_INTEGER]:s.RGB16UI,[Te.RG_INTEGER]:s.RG16UI,[Te.RED_INTEGER]:s.R16UI,[Te.DEPTH_COMPONENT]:s.DEPTH_COMPONENT16},[Ue.SHORT]:{[Te.RGBA_INTEGER]:s.RGBA16I,[Te.RGB_INTEGER]:s.RGB16I,[Te.RG_INTEGER]:s.RG16I,[Te.RED_INTEGER]:s.R16I},[Ue.UNSIGNED_INT]:{[Te.RGBA_INTEGER]:s.RGBA32UI,[Te.RGB_INTEGER]:s.RGB32UI,[Te.RG_INTEGER]:s.RG32UI,[Te.RED_INTEGER]:s.R32UI,[Te.DEPTH_COMPONENT]:s.DEPTH_COMPONENT24},[Ue.INT]:{[Te.RGBA_INTEGER]:s.RGBA32I,[Te.RGB_INTEGER]:s.RGB32I,[Te.RG_INTEGER]:s.RG32I,[Te.RED_INTEGER]:s.R32I},[Ue.FLOAT]:{[Te.RGBA]:s.RGBA32F,[Te.RGB]:s.RGB32F,[Te.RG]:s.RG32F,[Te.RED]:s.R32F,[Te.DEPTH_COMPONENT]:s.DEPTH_COMPONENT32F},[Ue.HALF_FLOAT]:{[Te.RGBA]:s.RGBA16F,[Te.RGB]:s.RGB16F,[Te.RG]:s.RG16F,[Te.RED]:s.R16F},[Ue.UNSIGNED_SHORT_5_6_5]:{[Te.RGB]:s.RGB565},[Ue.UNSIGNED_SHORT_4_4_4_4]:{[Te.RGBA]:s.RGBA4},[Ue.UNSIGNED_SHORT_5_5_5_1]:{[Te.RGBA]:s.RGB5_A1},[Ue.UNSIGNED_INT_2_10_10_10_REV]:{[Te.RGBA]:s.RGB10_A2,[Te.RGBA_INTEGER]:s.RGB10_A2UI},[Ue.UNSIGNED_INT_10F_11F_11F_REV]:{[Te.RGB]:s.R11F_G11F_B10F},[Ue.UNSIGNED_INT_5_9_9_9_REV]:{[Te.RGB]:s.RGB9_E5},[Ue.UNSIGNED_INT_24_8]:{[Te.DEPTH_STENCIL]:s.DEPTH24_STENCIL8},[Ue.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[Te.DEPTH_STENCIL]:s.DEPTH32F_STENCIL8}}:e={[Ue.UNSIGNED_BYTE]:{[Te.RGBA]:s.RGBA,[Te.RGB]:s.RGB,[Te.ALPHA]:s.ALPHA,[Te.LUMINANCE]:s.LUMINANCE,[Te.LUMINANCE_ALPHA]:s.LUMINANCE_ALPHA},[Ue.UNSIGNED_SHORT_5_6_5]:{[Te.RGB]:s.RGB},[Ue.UNSIGNED_SHORT_4_4_4_4]:{[Te.RGBA]:s.RGBA},[Ue.UNSIGNED_SHORT_5_5_5_1]:{[Te.RGBA]:s.RGBA}},e}class $b{constructor(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new it,this.hasIntegerTextures=!1}contextChange(){const e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=fE(e),this.samplerTypes=dE(e);const t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=t;for(let n=0;n=0;--r){const o=t[r];o&&o._glTextures[n].samplerType!==De.FLOAT&&this.renderer.texture.unbind(o)}}initTexture(e){const t=new Wd(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),t}initTextureType(e,t){var i;t.internalFormat=((i=this.internalFormats[e.type])==null?void 0:i[e.format])??e.format,t.samplerType=this.samplerTypes[t.internalFormat]??De.FLOAT,this.webGLVersion===2&&e.type===Ue.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type}updateTexture(e){var n;const t=e._glTextures[this.CONTEXT_UID];if(!t)return;const i=this.renderer;if(this.initTextureType(e,t),(n=e.resource)==null?void 0:n.upload(i,e,t))t.samplerType!==De.FLOAT&&(this.hasIntegerTextures=!0);else{const r=e.realWidth,o=e.realHeight,a=i.gl;(t.width!==r||t.height!==o||t.dirtyId<0)&&(t.width=r,t.height=o,a.texImage2D(e.target,0,t.internalFormat,r,o,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}destroyTexture(e,t){const{gl:i}=this;if(e=e.castToBaseTexture(),e._glTextures[this.CONTEXT_UID]&&(this.unbind(e),i.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){const n=this.managedTextures.indexOf(e);n!==-1&&Jo(this.managedTextures,n,1)}}updateTextureStyle(e){var i;const t=e._glTextures[this.CONTEXT_UID];t&&((e.mipmap===vs.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?t.mipmap=!1:t.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?t.wrapMode=Os.CLAMP:t.wrapMode=e.wrapMode,(i=e.resource)!=null&&i.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)}setStyle(e,t){const i=this.gl;if(t.mipmap&&e.mipmap!==vs.ON_MANUAL&&i.generateMipmap(e.target),i.texParameteri(e.target,i.TEXTURE_WRAP_S,t.wrapMode),i.texParameteri(e.target,i.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===Rs.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);const n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===Rs.LINEAR){const r=Math.min(e.anisotropicLevel,i.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(e.target,n.TEXTURE_MAX_ANISOTROPY_EXT,r)}}else i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===Rs.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(e.target,i.TEXTURE_MAG_FILTER,e.scaleMode===Rs.LINEAR?i.LINEAR:i.NEAREST)}destroy(){this.renderer=null}}$b.extension={type:ke.RendererSystem,name:"texture"};$e.add($b);class Xb{constructor(e){this.renderer=e}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){const{gl:t,CONTEXT_UID:i}=this,n=e._glTransformFeedbacks[i]||this.createGLTransformFeedback(e);t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,n)}unbind(){const{gl:e}=this;e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(e,t){const{gl:i,renderer:n}=this;t&&n.shader.bind(t),i.beginTransformFeedback(e)}endTransformFeedback(){const{gl:e}=this;e.endTransformFeedback()}createGLTransformFeedback(e){const{gl:t,renderer:i,CONTEXT_UID:n}=this,r=t.createTransformFeedback();e._glTransformFeedbacks[n]=r,t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,r);for(let o=0;o(s[s.INTERACTION=50]="INTERACTION",s[s.HIGH=25]="HIGH",s[s.NORMAL=0]="NORMAL",s[s.LOW=-25]="LOW",s[s.UTILITY=-50]="UTILITY",s))(uo||{});class zd{constructor(e,t=null,i=0,n=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=e,this.context=t,this.priority=i,this.once=n}match(e,t=null){return this.fn===e&&this.context===t}emit(e){this.fn&&(this.context?this.fn.call(this.context,e):this.fn(e));const t=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),t}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this}destroy(e=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const t=this.next;return this.next=e?null:t,this.previous=null,t}}const Vb=class es{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new zd(null,null,1/0),this.deltaMS=1/es.targetFPMS,this.elapsedMS=1/es.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(e,t,i=uo.NORMAL){return this._addListener(new zd(e,t,i))}addOnce(e,t,i=uo.NORMAL){return this._addListener(new zd(e,t,i,!0))}_addListener(e){let t=this._head.next,i=this._head;if(!t)e.connect(i);else{for(;t;){if(e.priority>t.priority){e.connect(i);break}i=t,t=t.next}e.previous||e.connect(i)}return this._startIfPossible(),this}remove(e,t){let i=this._head.next;for(;i;)i.match(e,t)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){const r=e-this._lastFrame|0;if(r{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?Yi.shared:new Yi,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}Yb.extension=ke.Application;$e.add(Yb);const Gb=[];$e.handleByList(ke.Renderer,Gb);function mE(s){for(const e of Gb)if(e.test(s))return new e(s);throw new Error("Unable to auto-detect a suitable renderer.")}var pE=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,gE=`attribute vec2 aVertexPosition; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +uniform vec4 inputSize; +uniform vec4 outputFrame; + +vec4 filterVertexPosition( void ) +{ + vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; + + return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); +} + +vec2 filterTextureCoord( void ) +{ + return aVertexPosition * (outputFrame.zw * inputSize.zw); +} + +void main(void) +{ + gl_Position = filterVertexPosition(); + vTextureCoord = filterTextureCoord(); +} +`;const vE=pE,jb=gE;class Hb{constructor(e){this.renderer=e}contextChange(e){let t;if(this.renderer.context.webGLVersion===1){const i=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,i)}else{const i=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,i)}t>=ci.HIGH?this.multisample=ci.HIGH:t>=ci.MEDIUM?this.multisample=ci.MEDIUM:t>=ci.LOW?this.multisample=ci.LOW:this.multisample=ci.NONE}destroy(){}}Hb.extension={type:ke.RendererSystem,name:"_multisample"};$e.add(Hb);class yE{constructor(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class Wb{constructor(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){const{gl:t,CONTEXT_UID:i}=this,n=e._glBuffers[i]||this.createGLBuffer(e);t.bindBuffer(e.type,n.buffer)}unbind(e){const{gl:t}=this;t.bindBuffer(e,null)}bindBufferBase(e,t){const{gl:i,CONTEXT_UID:n}=this;if(this.boundBufferBases[t]!==e){const r=e._glBuffers[n]||this.createGLBuffer(e);this.boundBufferBases[t]=e,i.bindBufferBase(i.UNIFORM_BUFFER,t,r.buffer)}}bindBufferRange(e,t,i){const{gl:n,CONTEXT_UID:r}=this;i=i||0;const o=e._glBuffers[r]||this.createGLBuffer(e);n.bindBufferRange(n.UNIFORM_BUFFER,t||0,o.buffer,i*256,256)}update(e){const{gl:t,CONTEXT_UID:i}=this,n=e._glBuffers[i]||this.createGLBuffer(e);if(e._updateID!==n.updateID)if(n.updateID=e._updateID,t.bindBuffer(e.type,n.buffer),n.byteLength>=e.data.byteLength)t.bufferSubData(e.type,0,e.data);else{const r=e.static?t.STATIC_DRAW:t.DYNAMIC_DRAW;n.byteLength=e.data.byteLength,t.bufferData(e.type,e.data,r)}}dispose(e,t){if(!this.managedBuffers[e.id])return;delete this.managedBuffers[e.id];const i=e._glBuffers[this.CONTEXT_UID],n=this.gl;e.disposeRunner.remove(this),i&&(t||n.deleteBuffer(i.buffer),delete e._glBuffers[this.CONTEXT_UID])}disposeAll(e){const t=Object.keys(this.managedBuffers);for(let i=0;it.resource).filter(t=>t).map(t=>t.load());return this._load=Promise.all(e).then(()=>{const{realWidth:t,realHeight:i}=this.items[0];return this.resize(t,i),this.update(),Promise.resolve(this)}),this._load}}class xE extends qb{constructor(e,t){const{width:i,height:n}=t||{};let r,o;Array.isArray(e)?(r=e,o=e.length):o=e,super(o,{width:i,height:n}),r&&this.initFromArray(r,t)}addBaseTextureAt(e,t){if(e.resource)this.addResourceAt(e.resource,t);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(e){super.bind(e),e.target=Zo.TEXTURE_2D_ARRAY}upload(e,t,i){const{length:n,itemDirtyIds:r,items:o}=this,{gl:a}=e;i.dirtyId<0&&a.texImage3D(a.TEXTURE_2D_ARRAY,0,i.internalFormat,this._width,this._height,n,0,t.format,i.type,null);for(let c=0;c0)if(e.resource)this.addResourceAt(e.resource,t);else throw new Error("CubeResource does not support copying of renderTexture.");else e.target=Zo.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this}upload(e,t,i){const n=this.itemDirtyIds;for(let r=0;r{if(this.url===null){e(this);return}try{const i=await Be.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const n=await i.blob();if(this.destroyed)return;const r=await createImageBitmap(n,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===bi.UNPACK?"premultiply":"none"});if(this.destroyed){r.close();return}this.source=r,this.update(),e(this)}catch(i){if(this.destroyed)return;t(i),this.onError.emit(i)}}),this._load)}upload(e,t,i){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(t.alphaMode=this.alphaMode),super.upload(e,t,i)):(this.load(),!1)}dispose(){this.ownsImageBitmap&&this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof e=="string"||e instanceof ImageBitmap)}static get EMPTY(){return Vo._EMPTY=Vo._EMPTY??Be.ADAPTER.createCanvas(0,0),Vo._EMPTY}}const Qf=class Oc extends Wn{constructor(e,t){t=t||{},super(Be.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=e,this.scale=t.scale||1,this._overrideWidth=t.width,this._overrideHeight=t.height,this._resolve=null,this._crossorigin=t.crossorigin,this._load=null,t.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(e=>{if(this._resolve=()=>{this.update(),e(this)},Oc.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){const e=new Image;Wn.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=t=>{this._resolve&&(e.onerror=null,this.onError.emit(t))},e.onload=()=>{if(!this._resolve)return;const t=e.width,i=e.height;if(!t||!i)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let n=t*this.scale,r=i*this.scale;(this._overrideWidth||this._overrideHeight)&&(n=this._overrideWidth||this._overrideHeight/i*t,r=this._overrideHeight||this._overrideWidth/t*i),n=Math.round(n),r=Math.round(r);const o=this.source;o.width=n,o.height=r,o._pixiId=`canvas_${ho()}`,o.getContext("2d").drawImage(e,0,0,t,i,0,0,n,r),this._resolve(),this._resolve=null}}static getSize(e){const t=Oc.SVG_SIZE.exec(e),i={};return t&&(i[t[1]]=Math.round(parseFloat(t[3])),i[t[5]]=Math.round(parseFloat(t[7]))),i}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(e,t){return t==="svg"||typeof e=="string"&&e.startsWith("data:image/svg+xml")||typeof e=="string"&&Oc.SVG_XML.test(e)}};Qf.SVG_XML=/^(<\?xml[^?]+\?>)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;let em=Qf;class SE extends Wn{constructor(e){super(e)}static test(e){return!!globalThis.VideoFrame&&e instanceof globalThis.VideoFrame}}const tm=class im extends Wn{constructor(e,t){if(t=t||{},!(e instanceof HTMLVideoElement)){const i=document.createElement("video");t.autoLoad!==!1&&i.setAttribute("preload","auto"),t.playsinline!==!1&&(i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline","")),t.muted===!0&&(i.setAttribute("muted",""),i.muted=!0),t.loop===!0&&i.setAttribute("loop",""),t.autoPlay!==!1&&i.setAttribute("autoplay",""),typeof e=="string"&&(e=[e]);const n=e[0].src||e[0];Wn.crossOrigin(i,n,t.crossorigin);for(let r=0;r{this.valid?t(this):(this._resolve=t,this._reject=i,e.load())}),this._load}_onError(e){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){const e=this.source;return!e.paused&&!e.ended}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}_onCanPlay(){const e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);const t=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!t&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()}dispose(){this._configureAutoUpdate();const e=this.source;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.source.requestVideoFrameCallback?(this._isConnectedToTicker&&(Yi.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(Yi.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Yi.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e,t){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||im.TYPES.includes(t)}};tm.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],tm.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let Zb=tm;Vf.push(Vo,Mb,bE,Zb,SE,em,au,wE,xE);class xl{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(e){return this.minX>this.maxX||this.minY>this.maxY?ct.EMPTY:(e=e||new ct(0,0,1,1),e.x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)}addPoint(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)}addPointMatrix(e,t){const{a:i,b:n,c:r,d:o,tx:a,ty:c}=e,l=i*t.x+r*t.y+a,h=n*t.x+o*t.y+c;this.minX=Math.min(this.minX,l),this.maxX=Math.max(this.maxX,l),this.minY=Math.min(this.minY,h),this.maxY=Math.max(this.maxY,h)}addQuad(e){let t=this.minX,i=this.minY,n=this.maxX,r=this.maxY,o=e[0],a=e[1];t=on?o:n,r=a>r?a:r,o=e[2],a=e[3],t=on?o:n,r=a>r?a:r,o=e[4],a=e[5],t=on?o:n,r=a>r?a:r,o=e[6],a=e[7],t=on?o:n,r=a>r?a:r,this.minX=t,this.minY=i,this.maxX=n,this.maxY=r}addFrame(e,t,i,n,r){this.addFrameMatrix(e.worldTransform,t,i,n,r)}addFrameMatrix(e,t,i,n,r){const o=e.a,a=e.b,c=e.c,l=e.d,h=e.tx,u=e.ty;let d=this.minX,f=this.minY,m=this.maxX,p=this.maxY,g=o*t+c*i+h,x=a*t+l*i+u;d=gm?g:m,p=x>p?x:p,g=o*n+c*i+h,x=a*n+l*i+u,d=gm?g:m,p=x>p?x:p,g=o*t+c*r+h,x=a*t+l*r+u,d=gm?g:m,p=x>p?x:p,g=o*n+c*r+h,x=a*n+l*r+u,d=gm?g:m,p=x>p?x:p,this.minX=d,this.minY=f,this.maxX=m,this.maxY=p}addVertexData(e,t,i){let n=this.minX,r=this.minY,o=this.maxX,a=this.maxY;for(let c=t;co?l:o,a=h>a?h:a}this.minX=n,this.minY=r,this.maxX=o,this.maxY=a}addVertices(e,t,i,n){this.addVerticesMatrix(e.worldTransform,t,i,n)}addVerticesMatrix(e,t,i,n,r=0,o=r){const a=e.a,c=e.b,l=e.c,h=e.d,u=e.tx,d=e.ty;let f=this.minX,m=this.minY,p=this.maxX,g=this.maxY;for(let x=i;xn?e.maxX:n,this.maxY=e.maxY>r?e.maxY:r}addBoundsMask(e,t){const i=e.minX>t.minX?e.minX:t.minX,n=e.minY>t.minY?e.minY:t.minY,r=e.maxXl?r:l,this.maxY=o>h?o:h}}addBoundsMatrix(e,t){this.addFrameMatrix(t,e.minX,e.minY,e.maxX,e.maxY)}addBoundsArea(e,t){const i=e.minX>t.x?e.minX:t.x,n=e.minY>t.y?e.minY:t.y,r=e.maxXl?r:l,this.maxY=o>h?o:h}}pad(e=0,t=e){this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t)}addFramePad(e,t,i,n,r,o){e-=r,t-=o,i+=r,n+=o,this.minX=this.minXi?this.maxX:i,this.minY=this.minYn?this.maxY:n}}class Kt extends Rl{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new pp,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new xl,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(e){const t=Object.keys(e);for(let i=0;i1)for(let t=0;tthis.children.length)throw new Error(`${e}addChildAt: The index ${t} supplied is out of bounds ${this.children.length}`);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),this.emit("childAdded",e,this,t),e}swapChildren(e,t){if(e===t)return;const i=this.getChildIndex(e),n=this.getChildIndex(t);this.children[i]=t,this.children[n]=e,this.onChildrenChange(i=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);const i=this.getChildIndex(e);Jo(this.children,i,1),this.children.splice(t,0,e),this.onChildrenChange(t)}getChildAt(e){if(e<0||e>=this.children.length)throw new Error(`getChildAt: Index (${e}) does not exist.`);return this.children[e]}removeChild(...e){if(e.length>1)for(let t=0;t0&&r<=n){o=this.children.splice(i,r);for(let a=0;a1&&this.children.sort(_E),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let e=0,t=this.children.length;e0&&t.height>0))return;let i,n;this.cullArea?(i=this.cullArea,n=this.worldTransform):this._render!==sm.prototype._render&&(i=this.getBounds(!0));const r=e.projection.transform;if(r&&(n?(n=TE.copyFrom(n),n.prepend(r)):n=r),i&&t.intersects(i,n))this._render(e);else if(this.cullArea)return;for(let o=0,a=this.children.length;o=n&&Oa.x=r&&Oa.y=t&&(o=s-a-1),c=c.replace("%value%",e[o].toString()),n+=c,n+=` +`}return i=i.replace("%blur%",n),i=i.replace("%size%",s.toString()),i}const FE=` + attribute vec2 aVertexPosition; + + uniform mat3 projectionMatrix; + + uniform float strength; + + varying vec2 vBlurTexCoords[%size%]; + + uniform vec4 inputSize; + uniform vec4 outputFrame; + + vec4 filterVertexPosition( void ) + { + vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; + + return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); + } + + vec2 filterTextureCoord( void ) + { + return aVertexPosition * (outputFrame.zw * inputSize.zw); + } + + void main(void) + { + gl_Position = filterVertexPosition(); + + vec2 textureCoord = filterTextureCoord(); + %blur% + }`;function OE(s,e){const t=Math.ceil(s/2);let i=FE,n="",r;e?r="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":r="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(let o=0;o 0.0) { + c.rgb /= c.a; + } + + vec4 result; + + result.r = (m[0] * c.r); + result.r += (m[1] * c.g); + result.r += (m[2] * c.b); + result.r += (m[3] * c.a); + result.r += m[4]; + + result.g = (m[5] * c.r); + result.g += (m[6] * c.g); + result.g += (m[7] * c.b); + result.g += (m[8] * c.a); + result.g += m[9]; + + result.b = (m[10] * c.r); + result.b += (m[11] * c.g); + result.b += (m[12] * c.b); + result.b += (m[13] * c.a); + result.b += m[14]; + + result.a = (m[15] * c.r); + result.a += (m[16] * c.g); + result.a += (m[17] * c.b); + result.a += (m[18] * c.a); + result.a += m[19]; + + vec3 rgb = mix(c.rgb, result.rgb, uAlpha); + + // Premultiply alpha again. + rgb *= result.a; + + gl_FragColor = vec4(rgb, result.a); +} +`;class rm extends Vi{constructor(){const e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};super(jb,BE,e),this.alpha=1}_loadMatrix(e,t=!1){let i=e;t&&(this._multiply(i,this.uniforms.m,e),i=this._colorMatrix(i)),this.uniforms.m=i}_multiply(e,t,i){return e[0]=t[0]*i[0]+t[1]*i[5]+t[2]*i[10]+t[3]*i[15],e[1]=t[0]*i[1]+t[1]*i[6]+t[2]*i[11]+t[3]*i[16],e[2]=t[0]*i[2]+t[1]*i[7]+t[2]*i[12]+t[3]*i[17],e[3]=t[0]*i[3]+t[1]*i[8]+t[2]*i[13]+t[3]*i[18],e[4]=t[0]*i[4]+t[1]*i[9]+t[2]*i[14]+t[3]*i[19]+t[4],e[5]=t[5]*i[0]+t[6]*i[5]+t[7]*i[10]+t[8]*i[15],e[6]=t[5]*i[1]+t[6]*i[6]+t[7]*i[11]+t[8]*i[16],e[7]=t[5]*i[2]+t[6]*i[7]+t[7]*i[12]+t[8]*i[17],e[8]=t[5]*i[3]+t[6]*i[8]+t[7]*i[13]+t[8]*i[18],e[9]=t[5]*i[4]+t[6]*i[9]+t[7]*i[14]+t[8]*i[19]+t[9],e[10]=t[10]*i[0]+t[11]*i[5]+t[12]*i[10]+t[13]*i[15],e[11]=t[10]*i[1]+t[11]*i[6]+t[12]*i[11]+t[13]*i[16],e[12]=t[10]*i[2]+t[11]*i[7]+t[12]*i[12]+t[13]*i[17],e[13]=t[10]*i[3]+t[11]*i[8]+t[12]*i[13]+t[13]*i[18],e[14]=t[10]*i[4]+t[11]*i[9]+t[12]*i[14]+t[13]*i[19]+t[14],e[15]=t[15]*i[0]+t[16]*i[5]+t[17]*i[10]+t[18]*i[15],e[16]=t[15]*i[1]+t[16]*i[6]+t[17]*i[11]+t[18]*i[16],e[17]=t[15]*i[2]+t[16]*i[7]+t[17]*i[12]+t[18]*i[17],e[18]=t[15]*i[3]+t[16]*i[8]+t[17]*i[13]+t[18]*i[18],e[19]=t[15]*i[4]+t[16]*i[9]+t[17]*i[14]+t[18]*i[19]+t[19],e}_colorMatrix(e){const t=new Float32Array(e);return t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,t}brightness(e,t){const i=[e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0];this._loadMatrix(i,t)}tint(e,t){const[i,n,r]=At.shared.setValue(e).toArray(),o=[i,0,0,0,0,0,n,0,0,0,0,0,r,0,0,0,0,0,1,0];this._loadMatrix(o,t)}greyscale(e,t){const i=[e,e,e,0,0,e,e,e,0,0,e,e,e,0,0,0,0,0,1,0];this._loadMatrix(i,t)}blackAndWhite(e){const t=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(t,e)}hue(e,t){e=(e||0)/180*Math.PI;const i=Math.cos(e),n=Math.sin(e),r=Math.sqrt,o=1/3,a=r(o),c=i+(1-i)*o,l=o*(1-i)-a*n,h=o*(1-i)+a*n,u=o*(1-i)+a*n,d=i+o*(1-i),f=o*(1-i)-a*n,m=o*(1-i)-a*n,p=o*(1-i)+a*n,g=i+o*(1-i),x=[c,l,h,0,0,u,d,f,0,0,m,p,g,0,0,0,0,0,1,0];this._loadMatrix(x,t)}contrast(e,t){const i=(e||0)+1,n=-.5*(i-1),r=[i,0,0,0,n,0,i,0,0,n,0,0,i,0,n,0,0,0,1,0];this._loadMatrix(r,t)}saturate(e=0,t){const i=e*2/3+1,n=(i-1)*-.5,r=[i,n,n,0,0,n,i,n,0,0,n,n,i,0,0,0,0,0,1,0];this._loadMatrix(r,t)}desaturate(){this.saturate(-1)}negative(e){const t=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(t,e)}sepia(e){const t=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(t,e)}technicolor(e){const t=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(t,e)}polaroid(e){const t=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(t,e)}toBGR(e){const t=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(t,e)}kodachrome(e){const t=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(t,e)}browni(e){const t=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(t,e)}vintage(e){const t=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(t,e)}colorTone(e,t,i,n,r){e=e||.2,t=t||.15,i=i||16770432,n=n||3375104;const o=At.shared,[a,c,l]=o.setValue(i).toArray(),[h,u,d]=o.setValue(n).toArray(),f=[.3,.59,.11,0,0,a,c,l,e,0,h,u,d,t,0,a-h,c-u,l-d,0,0];this._loadMatrix(f,r)}night(e,t){e=e||.1;const i=[e*-2,-e,0,0,0,-e,0,e,0,0,0,e,e*2,0,0,0,0,0,1,0];this._loadMatrix(i,t)}predator(e,t){const i=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(i,t)}lsd(e){const t=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(t,e)}reset(){const e=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(e,!1)}get matrix(){return this.uniforms.m}set matrix(e){this.uniforms.m=e}get alpha(){return this.uniforms.uAlpha}set alpha(e){this.uniforms.uAlpha=e}}rm.prototype.grayscale=rm.prototype.greyscale;var NE=`varying vec2 vFilterCoord; +varying vec2 vTextureCoord; + +uniform vec2 scale; +uniform mat2 rotation; +uniform sampler2D uSampler; +uniform sampler2D mapSampler; + +uniform highp vec4 inputSize; +uniform vec4 inputClamp; + +void main(void) +{ + vec4 map = texture2D(mapSampler, vFilterCoord); + + map -= 0.5; + map.xy = scale * inputSize.zw * (rotation * map.xy); + + gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw)); +} +`,DE=`attribute vec2 aVertexPosition; + +uniform mat3 projectionMatrix; +uniform mat3 filterMatrix; + +varying vec2 vTextureCoord; +varying vec2 vFilterCoord; + +uniform vec4 inputSize; +uniform vec4 outputFrame; + +vec4 filterVertexPosition( void ) +{ + vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; + + return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); +} + +vec2 filterTextureCoord( void ) +{ + return aVertexPosition * (outputFrame.zw * inputSize.zw); +} + +void main(void) +{ + gl_Position = filterVertexPosition(); + vTextureCoord = filterTextureCoord(); + vFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy; +} +`;class UE extends Vi{constructor(e,t){const i=new Ft;e.renderable=!1,super(DE,NE,{mapSampler:e._texture,filterMatrix:i,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=i,t==null&&(t=20),this.scale=new St(t,t)}apply(e,t,i,n){this.uniforms.filterMatrix=e.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;const r=this.maskSprite.worldTransform,o=Math.sqrt(r.a*r.a+r.b*r.b),a=Math.sqrt(r.c*r.c+r.d*r.d);o!==0&&a!==0&&(this.uniforms.rotation[0]=r.a/o,this.uniforms.rotation[1]=r.b/o,this.uniforms.rotation[2]=r.c/a,this.uniforms.rotation[3]=r.d/a),e.applyFilter(this,t,i,n)}get map(){return this.uniforms.mapSampler}set map(e){this.uniforms.mapSampler=e}}var $E=`varying vec2 v_rgbNW; +varying vec2 v_rgbNE; +varying vec2 v_rgbSW; +varying vec2 v_rgbSE; +varying vec2 v_rgbM; + +varying vec2 vFragCoord; +uniform sampler2D uSampler; +uniform highp vec4 inputSize; + + +/** + Basic FXAA implementation based on the code on geeks3d.com with the + modification that the texture2DLod stuff was removed since it's + unsupported by WebGL. + + -- + + From: + https://github.com/mitsuhiko/webgl-meincraft + + Copyright (c) 2011 by Armin Ronacher. + + Some rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * The names of the contributors may not be used to endorse or + promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FXAA_REDUCE_MIN +#define FXAA_REDUCE_MIN (1.0/ 128.0) +#endif +#ifndef FXAA_REDUCE_MUL +#define FXAA_REDUCE_MUL (1.0 / 8.0) +#endif +#ifndef FXAA_SPAN_MAX +#define FXAA_SPAN_MAX 8.0 +#endif + +//optimized version for mobile, where dependent +//texture reads can be a bottleneck +vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP, + vec2 v_rgbNW, vec2 v_rgbNE, + vec2 v_rgbSW, vec2 v_rgbSE, + vec2 v_rgbM) { + vec4 color; + vec3 rgbNW = texture2D(tex, v_rgbNW).xyz; + vec3 rgbNE = texture2D(tex, v_rgbNE).xyz; + vec3 rgbSW = texture2D(tex, v_rgbSW).xyz; + vec3 rgbSE = texture2D(tex, v_rgbSE).xyz; + vec4 texColor = texture2D(tex, v_rgbM); + vec3 rgbM = texColor.xyz; + vec3 luma = vec3(0.299, 0.587, 0.114); + float lumaNW = dot(rgbNW, luma); + float lumaNE = dot(rgbNE, luma); + float lumaSW = dot(rgbSW, luma); + float lumaSE = dot(rgbSE, luma); + float lumaM = dot(rgbM, luma); + float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE))); + float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE))); + + mediump vec2 dir; + dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE)); + dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE)); + + float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) * + (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN); + + float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce); + dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX), + max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX), + dir * rcpDirMin)) * inverseVP; + + vec3 rgbA = 0.5 * ( + texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz + + texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz); + vec3 rgbB = rgbA * 0.5 + 0.25 * ( + texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz + + texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz); + + float lumaB = dot(rgbB, luma); + if ((lumaB < lumaMin) || (lumaB > lumaMax)) + color = vec4(rgbA, texColor.a); + else + color = vec4(rgbB, texColor.a); + return color; +} + +void main() { + + vec4 color; + + color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM); + + gl_FragColor = color; +} +`,XE=` +attribute vec2 aVertexPosition; + +uniform mat3 projectionMatrix; + +varying vec2 v_rgbNW; +varying vec2 v_rgbNE; +varying vec2 v_rgbSW; +varying vec2 v_rgbSE; +varying vec2 v_rgbM; + +varying vec2 vFragCoord; + +uniform vec4 inputSize; +uniform vec4 outputFrame; + +vec4 filterVertexPosition( void ) +{ + vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; + + return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); +} + +void texcoords(vec2 fragCoord, vec2 inverseVP, + out vec2 v_rgbNW, out vec2 v_rgbNE, + out vec2 v_rgbSW, out vec2 v_rgbSE, + out vec2 v_rgbM) { + v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP; + v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP; + v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP; + v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP; + v_rgbM = vec2(fragCoord * inverseVP); +} + +void main(void) { + + gl_Position = filterVertexPosition(); + + vFragCoord = aVertexPosition * outputFrame.zw; + + texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM); +} +`;class VE extends Vi{constructor(){super(XE,$E)}}var YE=`precision highp float; + +varying vec2 vTextureCoord; +varying vec4 vColor; + +uniform float uNoise; +uniform float uSeed; +uniform sampler2D uSampler; + +float rand(vec2 co) +{ + return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); +} + +void main() +{ + vec4 color = texture2D(uSampler, vTextureCoord); + float randomValue = rand(gl_FragCoord.xy * uSeed); + float diff = (randomValue - 0.5) * uNoise; + + // Un-premultiply alpha before applying the color matrix. See issue #3539. + if (color.a > 0.0) { + color.rgb /= color.a; + } + + color.r += diff; + color.g += diff; + color.b += diff; + + // Premultiply alpha again. + color.rgb *= color.a; + + gl_FragColor = color; +} +`;class GE extends Vi{constructor(e=.5,t=Math.random()){super(jb,YE,{uNoise:0,uSeed:0}),this.noise=e,this.seed=t}get noise(){return this.uniforms.uNoise}set noise(e){this.uniforms.uNoise=e}get seed(){return this.uniforms.uSeed}set seed(e){this.uniforms.uSeed=e}}const hv={AlphaFilter:IE,BlurFilter:LE,BlurFilterPass:nm,ColorMatrixFilter:rm,DisplacementFilter:UE,FXAAFilter:VE,NoiseFilter:GE};Object.entries(hv).forEach(([s,e])=>{Object.defineProperty(hv,s,{get(){return mt("7.1.0",`filters.${s} has moved to ${s}`),e}})});class jE{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e}addTickerListener(){this.tickerAdded||!this.domElement||(Yi.system.add(this.tickerUpdate,this,uo.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&(Yi.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)}pointerMoved(){this._didMove=!0}update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const e=this.events.rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType==="touch"||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:e.clientX,clientY:e.clientY}))}tickerUpdate(e){this._deltaTime+=e,!(this._deltaTimei.priority-n.priority)}dispatchEvent(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.dispatch.emit(t||e.type,e)}mapEvent(e){if(!this.rootTarget)return;const t=this.mappingTable[e.type];if(t)for(let i=0,n=t.length;i=0;n--)if(e.currentTarget=i[n],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,i=this._allInteractiveElements){if(i.length===0)return;e.eventPhase=e.BUBBLING_PHASE;const n=Array.isArray(t)?t:[t];for(let r=i.length-1;r>=0;r--)n.forEach(o=>{e.currentTarget=i[r],this.notifyTarget(e,o)})}propagationPath(e){const t=[e];for(let i=0;i=0;u--){const d=h[u],f=this.hitTestMoveRecursive(d,this._isInteractive(t)?t:d.eventMode,i,n,r,o||r(e,i));if(f){if(f.length>0&&!f[f.length-1].parent)continue;const m=e.isInteractive();(f.length>0||m)&&(m&&this._allInteractiveElements.push(e),f.push(e)),this._hitElements.length===0&&(this._hitElements=f),a=!0}}}const c=this._isInteractive(t),l=e.isInteractive();return c&&l&&this._allInteractiveElements.push(e),o||this._hitElements.length>0?null:a?this._hitElements:c&&!r(e,i)&&n(e,i)?l?[e]:[]:null}hitTestRecursive(e,t,i,n,r){if(this._interactivePrune(e)||r(e,i))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(mr.pauseUpdate=!1),e.interactiveChildren&&e.children){const c=e.children;for(let l=c.length-1;l>=0;l--){const h=c[l],u=this.hitTestRecursive(h,this._isInteractive(t)?t:h.eventMode,i,n,r);if(u){if(u.length>0&&!u[u.length-1].parent)continue;const d=e.isInteractive();return(u.length>0||d)&&u.push(e),u}}}const o=this._isInteractive(t),a=e.isInteractive();return o&&n(e,i)?a?[e]:[]:null}_isInteractive(e){return e==="static"||e==="dynamic"}_interactivePrune(e){return!!(!e||e.isMask||!e.visible||!e.renderable||e.eventMode==="none"||e.eventMode==="passive"&&!e.interactiveChildren||e.isMask)}hitPruneFn(e,t){var i;if(e.hitArea&&(e.worldTransform.applyInverse(t,qd),!e.hitArea.contains(qd.x,qd.y)))return!0;if(e._mask){const n=e._mask.isMaskData?e._mask.maskObject:e._mask;if(n&&!((i=n.containsPoint)!=null&&i.call(n,t)))return!0}return!1}hitTestFn(e,t){return e.eventMode==="passive"?!1:e.hitArea?!0:e.containsPoint?e.containsPoint(t):!1}notifyTarget(e,t){var r,o;t=t??e.type;const i=`on${t}`;(o=(r=e.currentTarget)[i])==null||o.call(r,e);const n=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?`${t}capture`:t;this.notifyListeners(e,n),e.eventPhase===e.AT_TARGET&&this.notifyListeners(e,t)}mapPointerDown(e){if(!(e instanceof Cs)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.createPointerEvent(e);if(this.dispatchEvent(t,"pointerdown"),t.pointerType==="touch")this.dispatchEvent(t,"touchstart");else if(t.pointerType==="mouse"||t.pointerType==="pen"){const n=t.button===2;this.dispatchEvent(t,n?"rightdown":"mousedown")}const i=this.trackingData(e.pointerId);i.pressTargetsByButton[e.button]=t.composedPath(),this.freeEvent(t)}mapPointerMove(e){var c,l;if(!(e instanceof Cs)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const t=this.createPointerEvent(e);this._isPointerMoveEvent=!1;const i=t.pointerType==="mouse"||t.pointerType==="pen",n=this.trackingData(e.pointerId),r=this.findMountedTarget(n.overTargets);if(((c=n.overTargets)==null?void 0:c.length)>0&&r!==t.target){const h=e.type==="mousemove"?"mouseout":"pointerout",u=this.createPointerEvent(e,h,r);if(this.dispatchEvent(u,"pointerout"),i&&this.dispatchEvent(u,"mouseout"),!t.composedPath().includes(r)){const d=this.createPointerEvent(e,"pointerleave",r);for(d.eventPhase=d.AT_TARGET;d.target&&!t.composedPath().includes(d.target);)d.currentTarget=d.target,this.notifyTarget(d),i&&this.notifyTarget(d,"mouseleave"),d.target=d.target.parent;this.freeEvent(d)}this.freeEvent(u)}if(r!==t.target){const h=e.type==="mousemove"?"mouseover":"pointerover",u=this.clonePointerEvent(t,h);this.dispatchEvent(u,"pointerover"),i&&this.dispatchEvent(u,"mouseover");let d=r==null?void 0:r.parent;for(;d&&d!==this.rootTarget.parent&&d!==t.target;)d=d.parent;if(!d||d===this.rootTarget.parent){const f=this.clonePointerEvent(t,"pointerenter");for(f.eventPhase=f.AT_TARGET;f.target&&f.target!==r&&f.target!==this.rootTarget.parent;)f.currentTarget=f.target,this.notifyTarget(f),i&&this.notifyTarget(f,"mouseenter"),f.target=f.target.parent;this.freeEvent(f)}this.freeEvent(u)}const o=[],a=this.enableGlobalMoveEvents??!0;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(t,"pointermove"),a&&o.push("globalpointermove"),t.pointerType==="touch"&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),a&&o.push("globaltouchmove")),i&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),a&&o.push("globalmousemove"),this.cursor=(l=t.target)==null?void 0:l.cursor),o.length>0&&this.all(t,o),this._allInteractiveElements.length=0,this._hitElements.length=0,n.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){var o;if(!(e instanceof Cs)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.createPointerEvent(e),n=i.pointerType==="mouse"||i.pointerType==="pen";this.dispatchEvent(i,"pointerover"),n&&this.dispatchEvent(i,"mouseover"),i.pointerType==="mouse"&&(this.cursor=(o=i.target)==null?void 0:o.cursor);const r=this.clonePointerEvent(i,"pointerenter");for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==this.rootTarget.parent;)r.currentTarget=r.target,this.notifyTarget(r),n&&this.notifyTarget(r,"mouseenter"),r.target=r.target.parent;t.overTargets=i.composedPath(),this.freeEvent(i),this.freeEvent(r)}mapPointerOut(e){if(!(e instanceof Cs)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId);if(t.overTargets){const i=e.pointerType==="mouse"||e.pointerType==="pen",n=this.findMountedTarget(t.overTargets),r=this.createPointerEvent(e,"pointerout",n);this.dispatchEvent(r),i&&this.dispatchEvent(r,"mouseout");const o=this.createPointerEvent(e,"pointerleave",n);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),i&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;t.overTargets=null,this.freeEvent(r),this.freeEvent(o)}this.cursor=null}mapPointerUp(e){if(!(e instanceof Cs)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=performance.now(),i=this.createPointerEvent(e);if(this.dispatchEvent(i,"pointerup"),i.pointerType==="touch")this.dispatchEvent(i,"touchend");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const a=i.button===2;this.dispatchEvent(i,a?"rightup":"mouseup")}const n=this.trackingData(e.pointerId),r=this.findMountedTarget(n.pressTargetsByButton[e.button]);let o=r;if(r&&!i.composedPath().includes(r)){let a=r;for(;a&&!i.composedPath().includes(a);){if(i.currentTarget=a,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const c=i.button===2;this.notifyTarget(i,c?"rightupoutside":"mouseupoutside")}a=a.parent}delete n.pressTargetsByButton[e.button],o=a}if(o){const a=this.clonePointerEvent(i,"click");a.target=o,a.path=null,n.clicksByButton[e.button]||(n.clicksByButton[e.button]={clickCount:0,target:a.target,timeStamp:t});const c=n.clicksByButton[e.button];if(c.target===a.target&&t-c.timeStamp<200?++c.clickCount:c.clickCount=1,c.target=a.target,c.timeStamp=t,a.detail=c.clickCount,a.pointerType==="mouse"){const l=a.button===2;this.dispatchEvent(a,l?"rightclick":"click")}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a)}this.freeEvent(i)}mapPointerUpOutside(e){if(!(e instanceof Cs)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.findMountedTarget(t.pressTargetsByButton[e.button]),n=this.createPointerEvent(e);if(i){let r=i;for(;r;)n.currentTarget=r,this.notifyTarget(n,"pointerupoutside"),n.pointerType==="touch"?this.notifyTarget(n,"touchendoutside"):(n.pointerType==="mouse"||n.pointerType==="pen")&&this.notifyTarget(n,n.button===2?"rightupoutside":"mouseupoutside"),r=r.parent;delete t.pressTargetsByButton[e.button]}this.freeEvent(n)}mapWheel(e){if(!(e instanceof ea)){console.warn("EventBoundary cannot map a non-wheel event as a wheel event");return}const t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t)}findMountedTarget(e){if(!e)return null;let t=e[0];for(let i=1;i(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=n),t[i]=n,!0)}),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOverOut=this.onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{view:t,resolution:i}=this.renderer;this.setTargetElement(t),this.resolution=i,am._defaultEventMode=e.eventMode??"auto",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){this.setTargetElement(null),this.renderer=null}setCursor(e){e=e||"default";let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this.currentCursor===e)return;this.currentCursor=e;const i=this.cursorStyles[e];if(i)switch(typeof i){case"string":t&&(this.domElement.style.cursor=i);break;case"function":i(e);break;case"object":t&&Object.assign(this.domElement.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this.rootPointerEvent}onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this.normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let i=0,n=t.length;i0&&(t=e.composedPath()[0]);const i=t!==this.domElement?"outside":"",n=this.normalizeToPointerData(e);for(let r=0,o=n.length;r"u"&&(r.button=0),typeof r.buttons>"u"&&(r.buttons=1),typeof r.isPrimary>"u"&&(r.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof r.width>"u"&&(r.width=r.radiusX||1),typeof r.height>"u"&&(r.height=r.radiusY||1),typeof r.tiltX>"u"&&(r.tiltX=0),typeof r.tiltY>"u"&&(r.tiltY=0),typeof r.pointerType>"u"&&(r.pointerType="touch"),typeof r.pointerId>"u"&&(r.pointerId=r.identifier||0),typeof r.pressure>"u"&&(r.pressure=r.force||.5),typeof r.twist>"u"&&(r.twist=0),typeof r.tangentialPressure>"u"&&(r.tangentialPressure=0),typeof r.layerX>"u"&&(r.layerX=r.offsetX=r.clientX),typeof r.layerY>"u"&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,r.type=e.type,t.push(r)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){const i=e;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=qE),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=!0,t.push(i)}else t.push(e);return t}normalizeWheelEvent(e){const t=this.rootWheelEvent;return this.transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this.transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=KE[e.type]||e.type),e}transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}};om.extension={name:"events",type:[ke.RendererSystem,ke.CanvasRendererSystem]},om.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let lm=om;$e.add(lm);function uv(s){return s==="dynamic"||s==="static"}const ZE={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,_internalInteractive:void 0,get interactive(){return this._internalInteractive??uv(lm.defaultEventMode)},set interactive(s){mt("7.2.0","Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),this._internalInteractive=s,this.eventMode=s?"static":"auto"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??lm.defaultEventMode},set eventMode(s){this._internalInteractive=uv(s),this._internalEventMode=s},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(s,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof t=="object"?t.signal:void 0,r=typeof t=="object"?t.once===!0:!1,o=typeof e=="function"?void 0:e;s=i?`${s}capture`:s;const a=typeof e=="function"?e:e.handleEvent,c=this;n&&n.addEventListener("abort",()=>{c.off(s,a,o)}),r?c.once(s,a,o):c.on(s,a,o)},removeEventListener(s,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof e=="function"?void 0:e;s=i?`${s}capture`:s,e=typeof e=="function"?e:e.handleEvent,this.off(s,e,n)},dispatchEvent(s){if(!(s instanceof Pl))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return s.defaultPrevented=!1,s.path=null,s.target=this,s.manager.dispatchEvent(s),!s.defaultPrevented}};Kt.mixin(ZE);const JE={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};Kt.mixin(JE);const QE=9,nc=100,eA=0,tA=0,dv=2,fv=1,iA=-1e3,sA=-1e3,nA=2;class e1{constructor(e){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(kn.tablet||kn.phone)&&this.createTouchHook();const t=document.createElement("div");t.style.width=`${nc}px`,t.style.height=`${nc}px`,t.style.position="absolute",t.style.top=`${eA}px`,t.style.left=`${tA}px`,t.style.zIndex=dv.toString(),this.div=t,this.renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}createTouchHook(){const e=document.createElement("button");e.style.width=`${fv}px`,e.style.height=`${fv}px`,e.style.position="absolute",e.style.top=`${iA}px`,e.style.left=`${sA}px`,e.style.zIndex=nA.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this.activate(),this.destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}activate(){var e;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),(e=this.renderer.view.parentNode)==null||e.appendChild(this.div))}deactivate(){var e;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),(e=this.div.parentNode)==null||e.removeChild(this.div))}updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&e.isInteractive()&&(e._accessibleActive||this.addChild(e),e.renderId=this.renderId);const t=e.children;if(t)for(let i=0;i title : ${e.title}
tabIndex: ${e.tabIndex}`}capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:i}=this.renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y)}addChild(e){let t=this.pool.pop();t||(t=document.createElement("button"),t.style.width=`${nc}px`,t.style.height=`${nc}px`,t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=dv.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`displayObject ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this.updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex}_dispatchEvent(e,t){const{displayObject:i}=e.target,n=this.renderer.events.rootBoundary,r=Object.assign(new Pl(n),{target:i});n.rootTarget=this.renderer.lastObjectRendered,t.forEach(o=>n.dispatchEvent(r,o))}_onClick(e){this._dispatchEvent(e,["click","pointertap","tap"])}_onFocus(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive"),this._dispatchEvent(e,["mouseover"])}_onFocusOut(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite"),this._dispatchEvent(e,["mouseout"])}_onKeyDown(e){e.keyCode===QE&&this.activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this.deactivate()}destroy(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null}}e1.extension={name:"accessibility",type:[ke.RendererPlugin,ke.CanvasRendererPlugin]};$e.add(e1);const t1=class cm{constructor(e){this.stage=new gi,e=Object.assign({forceCanvas:!1},e),this.renderer=mE(e),cm._plugins.forEach(t=>{t.init.call(this,e)})}render(){this.renderer.render(this.stage)}get view(){var e;return(e=this.renderer)==null?void 0:e.view}get screen(){var e;return(e=this.renderer)==null?void 0:e.screen}destroy(e,t){const i=cm._plugins.slice(0);i.reverse(),i.forEach(n=>{n.destroy.call(this)}),this.stage.destroy(t),this.stage=null,this.renderer.destroy(e),this.renderer=null}};t1._plugins=[];let i1=t1;$e.handleByList(ke.Application,i1._plugins);class s1{static init(e){Object.defineProperty(this,"resizeTo",{set(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this.cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this.cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this.cancelResize();let t,i;if(this._resizeTo===globalThis.window)t=globalThis.innerWidth,i=globalThis.innerHeight;else{const{clientWidth:n,clientHeight:r}=this._resizeTo;t=n,i=r}this.renderer.resize(t,i),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}s1.extension=ke.Application;$e.add(s1);const mv={loader:ke.LoadParser,resolver:ke.ResolveParser,cache:ke.CacheParser,detection:ke.DetectionParser};$e.handle(ke.Asset,s=>{const e=s.ref;Object.entries(mv).filter(([t])=>!!e[t]).forEach(([t,i])=>$e.add(Object.assign(e[t],{extension:e[t].extension??i})))},s=>{const e=s.ref;Object.keys(mv).filter(t=>!!e[t]).forEach(t=>$e.remove(e[t]))});class rA{constructor(e,t=!1){this._loader=e,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=t}add(e){e.forEach(t=>{this._assetList.push(t)}),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=!0;const e=[],t=Math.min(this._assetList.length,this._maxConcurrent);for(let i=0;i(Array.isArray(s)||(s=[s]),e?s.map(i=>typeof i=="string"||t?e(i):i):s),hh=(s,e)=>{const t=e.split("?")[1];return t&&(s+=`?${t}`),s};function n1(s,e,t,i,n){const r=e[t];for(let o=0;o{const o=r.substring(1,r.length-1).split(",");n.push(o)}),n1(s,n,0,t,i)}else i.push(s);return i}const uh=s=>!Array.isArray(s);class aA{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(e){return this._cache.has(e)}get(e){const t=this._cache.get(e);return t||console.warn(`[Assets] Asset id ${e} was not found in the Cache`),t}set(e,t){const i=As(e);let n;for(let a=0;a{n[a]=t}));const r=Object.keys(n),o={cacheKeys:r,keys:i};if(i.forEach(a=>{this._cacheMap.set(a,o)}),r.forEach(a=>{const c=n?n[a]:t;this._cache.has(a)&&this._cache.get(a)!==c&&console.warn("[Cache] already has key:",a),this._cache.set(a,n[a])}),t instanceof Ke){const a=t;i.forEach(c=>{a.baseTexture!==Ke.EMPTY.baseTexture&&it.addToCache(a.baseTexture,c),Ke.addToCache(a,c)})}}remove(e){if(!this._cacheMap.has(e)){console.warn(`[Assets] Asset id ${e} was not found in the Cache`);return}const t=this._cacheMap.get(e);t.cacheKeys.forEach(i=>{this._cache.delete(i)}),t.keys.forEach(i=>{this._cacheMap.delete(i)})}get parsers(){return this._parsers}}const qr=new aA;class lA{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(e,t,i)=>(this._parsersValidated=!1,e[t]=i,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(e,t){const i={promise:null,parser:null};return i.promise=(async()=>{var o,a;let n=null,r=null;if(t.loadParser&&(r=this._parserHash[t.loadParser],r||console.warn(`[Assets] specified load parser "${t.loadParser}" not found while loading ${e}`)),!r){for(let c=0;c({alias:[l],src:l})),a=o.length,c=o.map(async l=>{const h=si.toAbsolute(l.src);if(!n[l.src])try{this.promiseCache[h]||(this.promiseCache[h]=this._getLoadPromiseAndParser(h,l)),n[l.src]=await this.promiseCache[h].promise,t&&t(++i/a)}catch(u){throw delete this.promiseCache[h],delete n[l.src],new Error(`[Loader.load] Failed to load ${h}. +${u}`)}});return await Promise.all(c),r?n[o[0].src]:n}async unload(e){const t=As(e,i=>({alias:[i],src:i})).map(async i=>{var o,a;const n=si.toAbsolute(i.src),r=this.promiseCache[n];if(r){const c=await r.promise;delete this.promiseCache[n],(a=(o=r.parser)==null?void 0:o.unload)==null||a.call(o,c,i,this)}});await Promise.all(t)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter(e=>e.name).reduce((e,t)=>(e[t.name]&&console.warn(`[Assets] loadParser name conflict "${t.name}"`),{...e,[t.name]:t}),{})}}var os=(s=>(s[s.Low=0]="Low",s[s.Normal=1]="Normal",s[s.High=2]="High",s))(os||{});const cA=".json",hA="application/json",uA={extension:{type:ke.LoadParser,priority:os.Low},name:"loadJson",test(s){return ya(s,hA)||Ki(s,cA)},async load(s){return await(await Be.ADAPTER.fetch(s)).json()}};$e.add(uA);const dA=".txt",fA="text/plain",mA={name:"loadTxt",extension:{type:ke.LoadParser,priority:os.Low},test(s){return ya(s,fA)||Ki(s,dA)},async load(s){return await(await Be.ADAPTER.fetch(s)).text()}};$e.add(mA);const pA=["normal","bold","100","200","300","400","500","600","700","800","900"],gA=[".ttf",".otf",".woff",".woff2"],vA=["font/ttf","font/otf","font/woff","font/woff2"],yA=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function xA(s){const e=si.extname(s),t=si.basename(s,e).replace(/(-|_)/g," ").toLowerCase().split(" ").map(r=>r.charAt(0).toUpperCase()+r.slice(1));let i=t.length>0;for(const r of t)if(!r.match(yA)){i=!1;break}let n=t.join(" ");return i||(n=`"${n.replace(/[\\"]/g,"\\$&")}"`),n}const bA=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;function wA(s){return bA.test(s)?s:encodeURI(s)}const SA={extension:{type:ke.LoadParser,priority:os.Low},name:"loadWebFont",test(s){return ya(s,vA)||Ki(s,gA)},async load(s,e){var i,n,r;const t=Be.ADAPTER.getFontFaceSet();if(t){const o=[],a=((i=e.data)==null?void 0:i.family)??xA(s),c=((r=(n=e.data)==null?void 0:n.weights)==null?void 0:r.filter(h=>pA.includes(h)))??["normal"],l=e.data??{};for(let h=0;hBe.ADAPTER.getFontFaceSet().delete(e))}};$e.add(SA);const MA=`(function() { + "use strict"; + const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII="; + async function checkImageBitmap() { + try { + if (typeof createImageBitmap != "function") + return !1; + const imageBlob = await (await fetch(WHITE_PNG)).blob(), imageBitmap = await createImageBitmap(imageBlob); + return imageBitmap.width === 1 && imageBitmap.height === 1; + } catch { + return !1; + } + } + checkImageBitmap().then((result) => { + self.postMessage(result); + }); +})(); +`;let ta=null,hm=class{constructor(){ta||(ta=URL.createObjectURL(new Blob([MA],{type:"application/javascript"}))),this.worker=new Worker(ta)}};hm.revokeObjectURL=function(){ta&&(URL.revokeObjectURL(ta),ta=null)};const TA=`(function() { + "use strict"; + async function loadImageBitmap(url) { + const response = await fetch(url); + if (!response.ok) + throw new Error(\`[WorkerManager.loadImageBitmap] Failed to fetch \${url}: \${response.status} \${response.statusText}\`); + const imageBlob = await response.blob(); + return await createImageBitmap(imageBlob); + } + self.onmessage = async (event) => { + try { + const imageBitmap = await loadImageBitmap(event.data.data[0]); + self.postMessage({ + data: imageBitmap, + uuid: event.data.uuid, + id: event.data.id + }, [imageBitmap]); + } catch (e) { + self.postMessage({ + error: e, + uuid: event.data.uuid, + id: event.data.id + }); + } + }; +})(); +`;let ia=null;class r1{constructor(){ia||(ia=URL.createObjectURL(new Blob([TA],{type:"application/javascript"}))),this.worker=new Worker(ia)}}r1.revokeObjectURL=function(){ia&&(URL.revokeObjectURL(ia),ia=null)};let pv=0,Kd;class _A{constructor(){this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}isImageBitmapSupported(){return this._isImageBitmapSupported!==void 0?this._isImageBitmapSupported:(this._isImageBitmapSupported=new Promise(e=>{const{worker:t}=new hm;t.addEventListener("message",i=>{t.terminate(),hm.revokeObjectURL(),e(i.data)})}),this._isImageBitmapSupported)}loadImageBitmap(e){return this._run("loadImageBitmap",[e])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){Kd===void 0&&(Kd=navigator.hardwareConcurrency||4);let e=this.workerPool.pop();return!e&&this._createdWorkers{this.complete(t.data),this.returnWorker(t.target),this.next()})),e}returnWorker(e){this.workerPool.push(e)}complete(e){e.error!==void 0?this.resolveHash[e.uuid].reject(e.error):this.resolveHash[e.uuid].resolve(e.data),this.resolveHash[e.uuid]=null}async _run(e,t){await this._initWorkers();const i=new Promise((n,r)=>{this.queue.push({id:e,arguments:t,resolve:n,reject:r})});return this.next(),i}next(){if(!this.queue.length)return;const e=this.getWorker();if(!e)return;const t=this.queue.pop(),i=t.id;this.resolveHash[pv]={resolve:t.resolve,reject:t.reject},e.postMessage({data:t.arguments,uuid:pv++,id:i})}}const gv=new _A;function kl(s,e,t){s.resource.internal=!0;const i=new Ke(s),n=()=>{delete e.promiseCache[t],qr.has(t)&&qr.remove(t)};return i.baseTexture.once("destroyed",()=>{t in e.promiseCache&&(console.warn("[Assets] A BaseTexture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the BaseTexture."),n())}),i.once("destroyed",()=>{s.destroyed||(console.warn("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),n())}),i}const CA=[".jpeg",".jpg",".png",".webp",".avif"],EA=["image/jpeg","image/png","image/webp","image/avif"];async function AA(s){const e=await Be.ADAPTER.fetch(s);if(!e.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${s}: ${e.status} ${e.statusText}`);const t=await e.blob();return await createImageBitmap(t)}const du={name:"loadTextures",extension:{type:ke.LoadParser,priority:os.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(s){return ya(s,EA)||Ki(s,CA)},async load(s,e,t){var a;const i=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap;let n;i?this.config.preferWorkers&&await gv.isImageBitmapSupported()?n=await gv.loadImageBitmap(s):n=await AA(s):n=await new Promise((c,l)=>{const h=new Image;h.crossOrigin=this.config.crossOrigin,h.src=s,h.complete?c(h):(h.onload=()=>c(h),h.onerror=u=>l(u))});const r={...e.data};r.resolution??(r.resolution=Hn(s)),i&&((a=r.resourceOptions)==null?void 0:a.ownsImageBitmap)===void 0&&(r.resourceOptions={...r.resourceOptions},r.resourceOptions.ownsImageBitmap=!0);const o=new it(n,r);return o.resource.src=s,kl(o,t,s)},unload(s){s.destroy(!0)}};$e.add(du);const IA=".svg",RA="image/svg+xml",PA={extension:{type:ke.LoadParser,priority:os.High},name:"loadSVG",test(s){return ya(s,RA)||Ki(s,IA)},async testParse(s){return em.test(s)},async parse(s,e,t){var r;const i=new em(s,(r=e==null?void 0:e.data)==null?void 0:r.resourceOptions);await i.load();const n=new it(i,{resolution:Hn(s),...e==null?void 0:e.data});return n.resource.src=e.src,kl(n,t,e.src)},async load(s,e){return(await Be.ADAPTER.fetch(s)).text()},unload:du.unload};$e.add(PA);const kA=[".mp4",".m4v",".webm",".ogv"],FA=["video/mp4","video/webm","video/ogg"],OA={name:"loadVideo",extension:{type:ke.LoadParser,priority:os.High},config:{defaultAutoPlay:!0,defaultUpdateFPS:0,defaultLoop:!1,defaultMuted:!1,defaultPlaysinline:!0},test(s){return ya(s,FA)||Ki(s,kA)},async load(s,e,t){var o;let i;const n=await(await Be.ADAPTER.fetch(s)).blob(),r=URL.createObjectURL(n);try{const a={autoPlay:this.config.defaultAutoPlay,updateFPS:this.config.defaultUpdateFPS,loop:this.config.defaultLoop,muted:this.config.defaultMuted,playsinline:this.config.defaultPlaysinline,...(o=e==null?void 0:e.data)==null?void 0:o.resourceOptions,autoLoad:!0},c=new Zb(r,a);await c.load();const l=new it(c,{alphaMode:await X_(),resolution:Hn(s),...e==null?void 0:e.data});l.resource.src=s,i=kl(l,t,s),i.baseTexture.once("destroyed",()=>{URL.revokeObjectURL(r)})}catch(a){throw URL.revokeObjectURL(r),a}return i},unload(s){s.destroy(!0)}};$e.add(OA);class LA{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(e,t)=>`${e}${this._bundleIdConnector}${t}`,extractAssetIdFromBundle:(e,t)=>t.replace(`${e}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...e){e.forEach(t=>{this._preferredOrder.push(t),t.priority||(t.priority=Object.keys(t.params))}),this._resolverHash={}}set basePath(e){this._basePath=e}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(e){if(typeof e=="string")this._defaultSearchParams=e;else{const t=e;this._defaultSearchParams=Object.keys(t).map(i=>`${encodeURIComponent(i)}=${encodeURIComponent(t[i])}`).join("&")}}getAlias(e){const{alias:t,name:i,src:n,srcs:r}=e;return As(t||i||n||r,o=>typeof o=="string"?o:Array.isArray(o)?o.map(a=>(a==null?void 0:a.src)??(a==null?void 0:a.srcs)??a):o!=null&&o.src||o!=null&&o.srcs?o.src??o.srcs:o,!0)}addManifest(e){this._manifest&&console.warn("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=e,e.bundles.forEach(t=>{this.addBundle(t.name,t.assets)})}addBundle(e,t){const i=[];Array.isArray(t)?t.forEach(n=>{const r=n.src??n.srcs,o=n.alias??n.name;let a;if(typeof o=="string"){const c=this._createBundleAssetId(e,o);i.push(c),a=[o,c]}else{const c=o.map(l=>this._createBundleAssetId(e,l));i.push(...c),a=[...o,...c]}this.add({...n,alias:a,src:r})}):Object.keys(t).forEach(n=>{const r=[n,this._createBundleAssetId(e,n)];if(typeof t[n]=="string")this.add({alias:r,src:t[n]});else if(Array.isArray(t[n]))this.add({alias:r,src:t[n]});else{const o=t[n],a=o.src??o.srcs;this.add({...o,alias:r,src:Array.isArray(a)?a:[a]})}i.push(...r)}),this._bundles[e]=i}add(e,t,i,n,r){const o=[];typeof e=="string"||Array.isArray(e)&&typeof e[0]=="string"?(mt("7.2.0",`Assets.add now uses an object instead of individual parameters. +Please use Assets.add({ alias, src, data, format, loadParser }) instead.`),o.push({alias:e,src:t,data:i,format:n,loadParser:r})):Array.isArray(e)?o.push(...e):o.push(e);let a;a=c=>{this.hasKey(c)&&console.warn(`[Resolver] already has key: ${c} overwriting`)},As(o).forEach(c=>{const{src:l,srcs:h}=c;let{data:u,format:d,loadParser:f}=c;const m=As(l||h).map(x=>typeof x=="string"?oA(x):Array.isArray(x)?x:[x]),p=this.getAlias(c);Array.isArray(p)?p.forEach(a):a(p);const g=[];m.forEach(x=>{x.forEach(v=>{let y={};if(typeof v!="object"){y.src=v;for(let S=0;S{this._assetMap[x]=g})})}resolveBundle(e){const t=uh(e);e=As(e);const i={};return e.forEach(n=>{const r=this._bundles[n];if(r){const o=this.resolve(r),a={};for(const c in o){const l=o[c];a[this._extractAssetIdFromBundle(n,c)]=l}i[n]=a}}),t?i[e[0]]:i}resolveUrl(e){const t=this.resolve(e);if(typeof e!="string"){const i={};for(const n in t)i[n]=t[n].src;return i}return t.src}resolve(e){const t=uh(e);e=As(e);const i={};return e.forEach(n=>{if(!this._resolverHash[n])if(this._assetMap[n]){let r=this._assetMap[n];const o=r[0],a=this._getPreferredOrder(r);a==null||a.priority.forEach(c=>{a.params[c].forEach(l=>{const h=r.filter(u=>u[c]?u[c]===l:!1);h.length&&(r=h)})}),this._resolverHash[n]=r[0]??o}else this._resolverHash[n]=this.buildResolvedAsset({alias:[n],src:n},{});i[n]=this._resolverHash[n]}),t?i[e[0]]:i}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let t=0;tr.params.format.includes(i.format));if(n)return n}return this._preferredOrder[0]}_appendDefaultSearchParams(e){if(!this._defaultSearchParams)return e;const t=/\?/.test(e)?"&":"?";return`${e}${t}${this._defaultSearchParams}`}buildResolvedAsset(e,t){const{aliases:i,data:n,loadParser:r,format:o}=t;return(this._basePath||this._rootPath)&&(e.src=si.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=i??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...n||{},...e.data},e.loadParser=r??e.loadParser,e.format=o??e.format??si.extname(e.src).slice(1),e.srcs=e.src,e.name=e.alias,e}}class BA{constructor(){this._detections=[],this._initialized=!1,this.resolver=new LA,this.loader=new lA,this.cache=qr,this._backgroundLoader=new rA(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(e={}){var r,o;if(this._initialized){console.warn("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");return}if(this._initialized=!0,e.defaultSearchParams&&this.resolver.setDefaultSearchParams(e.defaultSearchParams),e.basePath&&(this.resolver.basePath=e.basePath),e.bundleIdentifier&&this.resolver.setBundleIdentifier(e.bundleIdentifier),e.manifest){let a=e.manifest;typeof a=="string"&&(a=await this.load(a)),this.resolver.addManifest(a)}const t=((r=e.texturePreference)==null?void 0:r.resolution)??1,i=typeof t=="number"?[t]:t,n=await this._detectFormats({preferredFormats:(o=e.texturePreference)==null?void 0:o.format,skipDetections:e.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:n,resolution:i}}),e.preferences&&this.setPreferences(e.preferences)}add(e,t,i,n,r){this.resolver.add(e,t,i,n,r)}async load(e,t){this._initialized||await this.init();const i=uh(e),n=As(e).map(a=>{if(typeof a!="string"){const c=this.resolver.getAlias(a);return c.some(l=>!this.resolver.hasKey(l))&&this.add(a),Array.isArray(c)?c[0]:c}return this.resolver.hasKey(a)||this.add({alias:a,src:a}),a}),r=this.resolver.resolve(n),o=await this._mapLoadToResolve(r,t);return i?o[n[0]]:o}addBundle(e,t){this.resolver.addBundle(e,t)}async loadBundle(e,t){this._initialized||await this.init();let i=!1;typeof e=="string"&&(i=!0,e=[e]);const n=this.resolver.resolveBundle(e),r={},o=Object.keys(n);let a=0,c=0;const l=()=>{t==null||t(++a/c)},h=o.map(u=>{const d=n[u];return c+=Object.keys(d).length,this._mapLoadToResolve(d,l).then(f=>{r[u]=f})});return await Promise.all(h),i?r[e[0]]:r}async backgroundLoad(e){this._initialized||await this.init(),typeof e=="string"&&(e=[e]);const t=this.resolver.resolve(e);this._backgroundLoader.add(Object.values(t))}async backgroundLoadBundle(e){this._initialized||await this.init(),typeof e=="string"&&(e=[e]);const t=this.resolver.resolveBundle(e);Object.values(t).forEach(i=>{this._backgroundLoader.add(Object.values(i))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(e){if(typeof e=="string")return qr.get(e);const t={};for(let i=0;i{const l=r[a.src],h=[a.src];a.alias&&h.push(...a.alias),o[n[c]]=l,qr.set(h,l)}),o}async unload(e){this._initialized||await this.init();const t=As(e).map(n=>typeof n!="string"?n.src:n),i=this.resolver.resolve(t);await this._unloadFromResolved(i)}async unloadBundle(e){this._initialized||await this.init(),e=As(e);const t=this.resolver.resolveBundle(e),i=Object.keys(t).map(n=>this._unloadFromResolved(t[n]));await Promise.all(i)}async _unloadFromResolved(e){const t=Object.values(e);t.forEach(i=>{qr.remove(i.src)}),await this.loader.unload(t)}async _detectFormats(e){let t=[];e.preferredFormats&&(t=Array.isArray(e.preferredFormats)?e.preferredFormats:[e.preferredFormats]);for(const i of e.detections)e.skipDetections||await i.test()?t=await i.add(t):e.skipDetections||(t=await i.remove(t));return t=t.filter((i,n)=>t.indexOf(i)===n),t}get detections(){return this._detections}get preferWorkers(){return du.config.preferWorkers}set preferWorkers(e){mt("7.2.0","Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead."),this.setPreferences({preferWorkers:e})}setPreferences(e){this.loader.parsers.forEach(t=>{t.config&&Object.keys(t.config).filter(i=>i in e).forEach(i=>{t.config[i]=e[i]})})}}const ln=new BA;$e.handleByList(ke.LoadParser,ln.loader.parsers).handleByList(ke.ResolveParser,ln.resolver.parsers).handleByList(ke.CacheParser,ln.cache.parsers).handleByList(ke.DetectionParser,ln.detections);const NA={extension:ke.CacheParser,test:s=>Array.isArray(s)&&s.every(e=>e instanceof Ke),getCacheableAssets:(s,e)=>{const t={};return s.forEach(i=>{e.forEach((n,r)=>{t[i+(r===0?"":r+1)]=n})}),t}};$e.add(NA);async function o1(s){if("Image"in globalThis)return new Promise(e=>{const t=new Image;t.onload=()=>{e(!0)},t.onerror=()=>{e(!1)},t.src=s});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{const e=await(await fetch(s)).blob();await createImageBitmap(e)}catch{return!1}return!0}return!1}const DA={extension:{type:ke.DetectionParser,priority:1},test:async()=>o1("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async s=>[...s,"avif"],remove:async s=>s.filter(e=>e!=="avif")};$e.add(DA);const UA={extension:{type:ke.DetectionParser,priority:0},test:async()=>o1("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async s=>[...s,"webp"],remove:async s=>s.filter(e=>e!=="webp")};$e.add(UA);const vv=["png","jpg","jpeg"],$A={extension:{type:ke.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async s=>[...s,...vv],remove:async s=>s.filter(e=>!vv.includes(e))};$e.add($A);const XA="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function xp(s){return XA?!1:document.createElement("video").canPlayType(s)!==""}const VA={extension:{type:ke.DetectionParser,priority:0},test:async()=>xp("video/webm"),add:async s=>[...s,"webm"],remove:async s=>s.filter(e=>e!=="webm")};$e.add(VA);const YA={extension:{type:ke.DetectionParser,priority:0},test:async()=>xp("video/mp4"),add:async s=>[...s,"mp4","m4v"],remove:async s=>s.filter(e=>e!=="mp4"&&e!=="m4v")};$e.add(YA);const GA={extension:{type:ke.DetectionParser,priority:0},test:async()=>xp("video/ogg"),add:async s=>[...s,"ogv"],remove:async s=>s.filter(e=>e!=="ogv")};$e.add(GA);const jA={extension:ke.ResolveParser,test:du.test,parse:s=>{var e;return{resolution:parseFloat(((e=Be.RETINA_PREFIX.exec(s))==null?void 0:e[1])??"1"),format:si.extname(s).slice(1),src:s}}};$e.add(jA);var wi=(s=>(s[s.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",s[s.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",s[s.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",s[s.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",s[s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",s[s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",s[s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",s[s.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",s[s.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",s[s.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",s[s.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",s[s.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",s[s.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",s[s.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",s[s.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",s[s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",s[s.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",s[s.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",s[s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",s[s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",s[s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",s[s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",s[s.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",s[s.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",s[s.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35987]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",s[s.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",s[s.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",s[s.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",s[s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",s[s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",s[s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",s))(wi||{});const dh={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,35840:.5,35842:.5,35841:.25,35843:.25,36196:.5,35986:.5,35987:1,34798:1,37808:1,36492:1,36493:1,36494:1,36495:1};let Gs,Uo;function yv(){Uo={bptc:Gs.getExtension("EXT_texture_compression_bptc"),astc:Gs.getExtension("WEBGL_compressed_texture_astc"),etc:Gs.getExtension("WEBGL_compressed_texture_etc"),s3tc:Gs.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:Gs.getExtension("WEBGL_compressed_texture_s3tc_srgb"),pvrtc:Gs.getExtension("WEBGL_compressed_texture_pvrtc")||Gs.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:Gs.getExtension("WEBGL_compressed_texture_etc1"),atc:Gs.getExtension("WEBGL_compressed_texture_atc")}}const HA={extension:{type:ke.DetectionParser,priority:2},test:async()=>{const s=Be.ADAPTER.createCanvas().getContext("webgl");return s?(Gs=s,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async s=>{Uo||yv();const e=[];for(const t in Uo)Uo[t]&&e.push(t);return[...e,...s]},remove:async s=>(Uo||yv(),s.filter(e=>!(e in Uo)))};$e.add(HA);class WA extends au{constructor(e,t={width:1,height:1,autoLoad:!0}){let i,n;typeof e=="string"?(i=e,n=new Uint8Array):(i=null,n=e),super(n,t),this.origin=i,this.buffer=n?new Xf(n):null,this._load=null,this.loaded=!1,this.origin!==null&&t.autoLoad!==!1&&this.load(),this.origin===null&&this.buffer&&(this._load=Promise.resolve(this),this.loaded=!0,this.onBlobLoaded(this.buffer.rawBinaryData))}onBlobLoaded(e){}load(){return this._load?this._load:(this._load=fetch(this.origin).then(e=>e.blob()).then(e=>e.arrayBuffer()).then(e=>(this.data=new Uint32Array(e),this.buffer=new Xf(e),this.loaded=!0,this.onBlobLoaded(e),this.update(),this)),this._load)}}class oo extends WA{constructor(e,t){super(e,t),this.format=t.format,this.levels=t.levels||1,this._width=t.width,this._height=t.height,this._extension=oo._formatToExtension(this.format),(t.levelBuffers||this.buffer)&&(this._levelBuffers=t.levelBuffers||oo._createLevelBuffers(e instanceof Uint8Array?e:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(e,t,i){const n=e.gl;if(!e.context.extensions[this._extension])throw new Error(`${this._extension} textures are not supported on the current machine`);if(!this._levelBuffers)return!1;n.pixelStorei(n.UNPACK_ALIGNMENT,4);for(let r=0,o=this.levels;r=33776&&e<=33779)return"s3tc";if(e>=35916&&e<=35919)return"s3tc_sRGB";if(e>=37488&&e<=37497)return"etc";if(e>=35840&&e<=35843)return"pvrtc";if(e===36196)return"etc1";if(e===35986||e===35987||e===34798)return"atc";if(e>=36492&&e<=36495)return"bptc";if(e===37808)return"astc";throw new Error(`Invalid (compressed) texture format given: ${e}`)}static _createLevelBuffers(e,t,i,n,r,o,a){const c=new Array(i);let l=e.byteOffset,h=o,u=a,d=h+n-1&~(n-1),f=u+r-1&~(r-1),m=d*f*dh[t];for(let p=0;p1?h:d,levelHeight:i>1?u:f,levelBuffer:new Uint8Array(e.buffer,l,m)},l+=m,h=h>>1||1,u=u>>1||1,d=h+n-1&~(n-1),f=u+r-1&~(r-1),m=d*f*dh[t];return c}}const Zd=4,rc=124,zA=32,xv=20,qA=542327876,oc={HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},KA={FOURCC:2},ac={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3},ZA=1,JA=2,QA=4,eI=64,tI=512,iI=131072,sI=827611204,nI=861165636,rI=894720068,oI=808540228,aI=4,lI={[sI]:wi.COMPRESSED_RGBA_S3TC_DXT1_EXT,[nI]:wi.COMPRESSED_RGBA_S3TC_DXT3_EXT,[rI]:wi.COMPRESSED_RGBA_S3TC_DXT5_EXT},cI={70:wi.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:wi.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:wi.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:wi.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:wi.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:wi.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:wi.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:wi.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:wi.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,96:wi.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,95:wi.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,98:wi.COMPRESSED_RGBA_BPTC_UNORM_EXT,99:wi.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT};function hI(s){const e=new Uint32Array(s);if(e[0]!==qA)throw new Error("Invalid DDS file magic word");const t=new Uint32Array(s,0,rc/Uint32Array.BYTES_PER_ELEMENT),i=t[oc.HEIGHT],n=t[oc.WIDTH],r=t[oc.MIPMAP_COUNT],o=new Uint32Array(s,oc.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,zA/Uint32Array.BYTES_PER_ELEMENT),a=o[ZA];if(a&QA){const c=o[KA.FOURCC];if(c!==oI){const v=lI[c],y=Zd+rc,S=new Uint8Array(s,y);return[new oo(S,{format:v,width:n,height:i,levels:r})]}const l=Zd+rc,h=new Uint32Array(e.buffer,l,xv/Uint32Array.BYTES_PER_ELEMENT),u=h[ac.DXGI_FORMAT],d=h[ac.RESOURCE_DIMENSION],f=h[ac.MISC_FLAG],m=h[ac.ARRAY_SIZE],p=cI[u];if(p===void 0)throw new Error(`DDSParser cannot parse texture data with DXGI format ${u}`);if(f===aI)throw new Error("DDSParser does not support cubemap textures");if(d===6)throw new Error("DDSParser does not supported 3D texture data");const g=new Array,x=Zd+rc+xv;if(m===1)g.push(new Uint8Array(s,x));else{const v=dh[p];let y=0,S=n,C=i;for(let b=0;b>>1,C=C>>>1}let w=x;for(let b=0;bnew oo(v,{format:p,width:n,height:i,levels:r}))}throw a&eI?new Error("DDSParser does not support uncompressed texture data."):a&tI?new Error("DDSParser does not supported YUV uncompressed texture data."):a&iI?new Error("DDSParser does not support single-channel (lumninance) texture data!"):a&JA?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}const bv=[171,75,84,88,32,49,49,187,13,10,26,10],uI=67305985,Ms={ENDIANNESS:12,GL_TYPE:16,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},um=64,wv={[Ue.UNSIGNED_BYTE]:1,[Ue.UNSIGNED_SHORT]:2,[Ue.INT]:4,[Ue.UNSIGNED_INT]:4,[Ue.FLOAT]:4,[Ue.HALF_FLOAT]:8},dI={[Te.RGBA]:4,[Te.RGB]:3,[Te.RG]:2,[Te.RED]:1,[Te.LUMINANCE]:1,[Te.LUMINANCE_ALPHA]:2,[Te.ALPHA]:1},fI={[Ue.UNSIGNED_SHORT_4_4_4_4]:2,[Ue.UNSIGNED_SHORT_5_5_5_1]:2,[Ue.UNSIGNED_SHORT_5_6_5]:2};function mI(s,e,t=!1){const i=new DataView(e);if(!pI(s,i))return null;const n=i.getUint32(Ms.ENDIANNESS,!0)===uI,r=i.getUint32(Ms.GL_TYPE,n),o=i.getUint32(Ms.GL_FORMAT,n),a=i.getUint32(Ms.GL_INTERNAL_FORMAT,n),c=i.getUint32(Ms.PIXEL_WIDTH,n),l=i.getUint32(Ms.PIXEL_HEIGHT,n)||1,h=i.getUint32(Ms.PIXEL_DEPTH,n)||1,u=i.getUint32(Ms.NUMBER_OF_ARRAY_ELEMENTS,n)||1,d=i.getUint32(Ms.NUMBER_OF_FACES,n),f=i.getUint32(Ms.NUMBER_OF_MIPMAP_LEVELS,n),m=i.getUint32(Ms.BYTES_OF_KEY_VALUE_DATA,n);if(l===0||h!==1)throw new Error("Only 2D textures are supported");if(d!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(u!==1)throw new Error("WebGL does not support array textures");const p=4,g=4,x=c+3&-4,v=l+3&-4,y=new Array(u);let S=c*l;r===0&&(S=x*v);let C;if(r!==0?wv[r]?C=wv[r]*dI[o]:C=fI[r]:C=dh[a],C===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const w=t?vI(i,m,n):null;let b=S*C,_=c,A=l,P=x,E=v,R=um+m;for(let O=0;O1||r!==0?_:P,levelHeight:f>1||r!==0?A:E,levelBuffer:new Uint8Array(e,Y,b)},Y+=b}R+=U+4,R=R%4!==0?R+4-R%4:R,_=_>>1||1,A=A>>1||1,P=_+p-1&-4,E=A+g-1&-4,b=P*E*C}return r!==0?{uncompressed:y.map(O=>{let U=O[0].levelBuffer,Y=!1;return r===Ue.FLOAT?U=new Float32Array(O[0].levelBuffer.buffer,O[0].levelBuffer.byteOffset,O[0].levelBuffer.byteLength/4):r===Ue.UNSIGNED_INT?(Y=!0,U=new Uint32Array(O[0].levelBuffer.buffer,O[0].levelBuffer.byteOffset,O[0].levelBuffer.byteLength/4)):r===Ue.INT&&(Y=!0,U=new Int32Array(O[0].levelBuffer.buffer,O[0].levelBuffer.byteOffset,O[0].levelBuffer.byteLength/4)),{resource:new au(U,{width:O[0].levelWidth,height:O[0].levelHeight}),type:r,format:Y?gI(o):o}}),kvData:w}:{compressed:y.map(O=>new oo(null,{format:a,width:c,height:l,levels:f,levelBuffers:O})),kvData:w}}function pI(s,e){for(let t=0;te-n){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let c=0;for(;c{const o=new it(r,{mipmap:vs.OFF,alphaMode:bi.NO_PREMULTIPLIED_ALPHA,resolution:Hn(s),...e.data});return kl(o,t,s)});return n.length===1?n[0]:n},unload(s){Array.isArray(s)?s.forEach(e=>e.destroy(!0)):s.destroy(!0)}};$e.add(yI);const xI={extension:{type:ke.LoadParser,priority:os.High},name:"loadKTX",test(s){return Ki(s,".ktx")},async load(s,e,t){const i=await(await Be.ADAPTER.fetch(s)).arrayBuffer(),{compressed:n,uncompressed:r,kvData:o}=mI(s,i),a=n??r,c={mipmap:vs.OFF,alphaMode:bi.NO_PREMULTIPLIED_ALPHA,resolution:Hn(s),...e.data},l=a.map(h=>{a===r&&Object.assign(c,{type:h.type,format:h.format});const u=h.resource??h,d=new it(u,c);return d.ktxKeyValueData=o,kl(d,t,s)});return l.length===1?l[0]:l},unload(s){Array.isArray(s)?s.forEach(e=>e.destroy(!0)):s.destroy(!0)}};$e.add(xI);const bI=["s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"],wI={extension:ke.ResolveParser,test:s=>{const e=si.extname(s).slice(1);return["basis","ktx","dds"].includes(e)},parse:s=>{var i,n;const e=s.split("."),t=e.pop();if(["ktx","dds"].includes(t)){const r=e.pop();if(bI.includes(r))return{resolution:parseFloat(((i=Be.RETINA_PREFIX.exec(s))==null?void 0:i[1])??"1"),format:r,src:s}}return{resolution:parseFloat(((n=Be.RETINA_PREFIX.exec(s))==null?void 0:n[1])??"1"),format:t,src:s}}};$e.add(wI);const lc=new ct,SI=4,a1=class ja{constructor(e){this.renderer=e,this._rendererPremultipliedAlpha=!1}contextChange(){var t;const e=(t=this.renderer)==null?void 0:t.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(e&&e.alpha&&e.premultipliedAlpha)}async image(e,t,i,n){const r=new Image;return r.src=await this.base64(e,t,i,n),r}async base64(e,t,i,n){const r=this.canvas(e,n);if(r.toBlob!==void 0)return new Promise((o,a)=>{r.toBlob(c=>{if(!c){a(new Error("ICanvas.toBlob failed!"));return}const l=new FileReader;l.onload=()=>o(l.result),l.onerror=a,l.readAsDataURL(c)},t,i)});if(r.toDataURL!==void 0)return r.toDataURL(t,i);if(r.convertToBlob!==void 0){const o=await r.convertToBlob({type:t,quality:i});return new Promise((a,c)=>{const l=new FileReader;l.onload=()=>a(l.result),l.onerror=c,l.readAsDataURL(o)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e,t){const{pixels:i,width:n,height:r,flipY:o,premultipliedAlpha:a}=this._rawPixels(e,t);o&&ja._flipY(i,n,r),a&&ja._unpremultiplyAlpha(i);const c=new sC(n,r,1),l=new ImageData(new Uint8ClampedArray(i.buffer),n,r);return c.context.putImageData(l,0,0),c.canvas}pixels(e,t){const{pixels:i,width:n,height:r,flipY:o,premultipliedAlpha:a}=this._rawPixels(e,t);return o&&ja._flipY(i,n,r),a&&ja._unpremultiplyAlpha(i),i}_rawPixels(e,t){const i=this.renderer;if(!i)throw new Error("The Extract has already been destroyed");let n,r=!1,o=!1,a,c=!1;e&&(e instanceof vo?a=e:(a=i.generateTexture(e,{region:t,resolution:i.resolution,multisample:i.multisample}),c=!0,t&&(lc.width=t.width,lc.height=t.height,t=lc)));const l=i.gl;if(a){if(n=a.baseTexture.resolution,t=t??a.frame,r=!1,o=a.baseTexture.alphaMode>0&&a.baseTexture.format===Te.RGBA,!c){i.renderTexture.bind(a);const f=a.framebuffer.glFramebuffers[i.CONTEXT_UID];f.blitFramebuffer&&i.framebuffer.bind(f.blitFramebuffer)}}else n=i.resolution,t||(t=lc,t.width=i.width/n,t.height=i.height/n),r=!0,o=this._rendererPremultipliedAlpha,i.renderTexture.bind();const h=Math.max(Math.round(t.width*n),1),u=Math.max(Math.round(t.height*n),1),d=new Uint8Array(SI*h*u);return l.readPixels(Math.round(t.x*n),Math.round(t.y*n),h,u,l.RGBA,l.UNSIGNED_BYTE,d),c&&(a==null||a.destroy(!0)),{pixels:d,width:h,height:u,flipY:r,premultipliedAlpha:o}}destroy(){this.renderer=null}static _flipY(e,t,i){const n=t<<2,r=i>>1,o=new Uint8Array(n);for(let a=0;a=0&&a>=0&&n>=0&&r>=0)){e.length=0;return}const c=Math.ceil(2.3*Math.sqrt(o+a)),l=c*8+(n?4:0)+(r?4:0);if(e.length=l,l===0)return;if(c===0){e.length=8,e[0]=e[6]=t+n,e[1]=e[3]=i+r,e[2]=e[4]=t-n,e[5]=e[7]=i-r;return}let h=0,u=c*4+(n?2:0)+2,d=u,f=l;{const m=n+o,p=r,g=t+m,x=t-m,v=i+p;if(e[h++]=g,e[h++]=v,e[--u]=v,e[--u]=x,r){const y=i-p;e[d++]=x,e[d++]=y,e[--f]=y,e[--f]=g}}for(let m=1;m0||e&&i<=0){const n=t/2;for(let r=n+n%2;r=6){Sv(t,!1);const o=[];for(let l=0;l=0&&r>=0&&o.push(t,i,t+n,i,t+n,i+r,t,i+r)},triangulate(s,e){const t=s.points,i=e.points;if(t.length===0)return;const n=i.length/2;i.push(t[0],t[1],t[2],t[3],t[6],t[7],t[4],t[5]),e.indices.push(n,n+1,n+2,n+1,n+2,n+3)}},_I={build(s){fh.build(s)},triangulate(s,e){fh.triangulate(s,e)}};var hs=(s=>(s.MITER="miter",s.BEVEL="bevel",s.ROUND="round",s))(hs||{}),xr=(s=>(s.BUTT="butt",s.ROUND="round",s.SQUARE="square",s))(xr||{});const ca={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(s,e=20){if(!this.adaptive||!s||isNaN(s))return e;let t=Math.ceil(s/this.maxLength);return tthis.maxSegments&&(t=this.maxSegments),t}};class Mv{static curveTo(e,t,i,n,r,o){const a=o[o.length-2],c=o[o.length-1]-t,l=a-e,h=n-t,u=i-e,d=Math.abs(c*u-l*h);if(d<1e-8||r===0)return(o[o.length-2]!==e||o[o.length-1]!==t)&&o.push(e,t),null;const f=c*c+l*l,m=h*h+u*u,p=c*h+l*u,g=r*Math.sqrt(f)/d,x=r*Math.sqrt(m)/d,v=g*p/f,y=x*p/m,S=g*u+x*l,C=g*h+x*c,w=l*(x+v),b=c*(x+v),_=u*(g+y),A=h*(g+y),P=Math.atan2(b-C,w-S),E=Math.atan2(A-C,_-S);return{cx:S+e,cy:C+t,radius:r,startAngle:P,endAngle:E,anticlockwise:l*h>u*c}}static arc(e,t,i,n,r,o,a,c,l){const h=a-o,u=ca._segmentsCount(Math.abs(h)*r,Math.ceil(Math.abs(h)/nh)*40),d=h/(u*2),f=d*2,m=Math.cos(d),p=Math.sin(d),g=u-1,x=g%1/g;for(let v=0;v<=g;++v){const y=v+x*v,S=d+o+f*y,C=Math.cos(S),w=-Math.sin(S);l.push((m*C+p*w)*r+i,(m*-w+p*C)*r+n)}}}class CI{constructor(){this.reset()}begin(e,t,i){this.reset(),this.style=e,this.start=t,this.attribStart=i}end(e,t){this.attribSize=t-this.attribStart,this.size=e-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class bp{static curveLength(e,t,i,n,r,o,a,c){let l=0,h=0,u=0,d=0,f=0,m=0,p=0,g=0,x=0,v=0,y=0,S=e,C=t;for(let w=1;w<=10;++w)h=w/10,u=h*h,d=u*h,f=1-h,m=f*f,p=m*f,g=p*e+3*m*h*i+3*f*u*r+d*a,x=p*t+3*m*h*n+3*f*u*o+d*c,v=S-g,y=C-x,S=g,C=x,l+=Math.sqrt(v*v+y*y);return l}static curveTo(e,t,i,n,r,o,a){const c=a[a.length-2],l=a[a.length-1];a.length-=2;const h=ca._segmentsCount(bp.curveLength(c,l,e,t,i,n,r,o));let u=0,d=0,f=0,m=0,p=0;a.push(c,l);for(let g=1,x=0;g<=h;++g)x=g/h,u=1-x,d=u*u,f=d*u,m=x*x,p=m*x,a.push(f*c+3*d*x*e+3*u*m*i+p*r,f*l+3*d*x*t+3*u*m*n+p*o)}}function Tv(s,e,t,i,n,r,o,a){const c=s-t*n,l=e-i*n,h=s+t*r,u=e+i*r;let d,f;o?(d=i,f=-t):(d=-i,f=t);const m=c+d,p=l+f,g=h+d,x=u+f;return a.push(m,p,g,x),2}function $r(s,e,t,i,n,r,o,a){const c=t-s,l=i-e;let h=Math.atan2(c,l),u=Math.atan2(n-s,r-e);a&&hu&&(u+=Math.PI*2);let d=h;const f=u-h,m=Math.abs(f),p=Math.sqrt(c*c+l*l),g=(15*m*Math.sqrt(p)/Math.PI>>0)+1,x=f/g;if(d+=x,a){o.push(s,e,t,i);for(let v=1,y=d;v=0&&(r.join===hs.ROUND?d+=$r(y,S,y-b*O,S-_*O,y-A*O,S-P*O,h,!1)+4:d+=2,h.push(y-A*U,S-P*U,y+A*O,S+P*O));continue}const Z=(-b+x)*(-_+S)-(-b+y)*(-_+v),ne=(-A+C)*(-P+S)-(-A+y)*(-P+w),oe=(D*ne-N*Z)/G,de=(k*Z-F*ne)/G,pe=(oe-y)*(oe-y)+(de-S)*(de-S),he=y+(oe-y)*O,me=S+(de-S)*O,H=y-(oe-y)*U,z=S-(de-S)*U,K=Math.min(D*D+F*F,N*N+k*k),B=W?O:U,L=K+B*B*p,j=pe<=L;let ie=r.join;if(ie===hs.MITER&&pe/p>g&&(ie=hs.BEVEL),j)switch(ie){case hs.MITER:{h.push(he,me,H,z);break}case hs.BEVEL:{W?h.push(he,me,y+b*U,S+_*U,he,me,y+A*U,S+P*U):h.push(y-b*O,S-_*O,H,z,y-A*O,S-P*O,H,z),d+=2;break}case hs.ROUND:{W?(h.push(he,me,y+b*U,S+_*U),d+=$r(y,S,y+b*U,S+_*U,y+A*U,S+P*U,h,!0)+4,h.push(he,me,y+A*U,S+P*U)):(h.push(y-b*O,S-_*O,H,z),d+=$r(y,S,y-b*O,S-_*O,y-A*O,S-P*O,h,!1)+4,h.push(y-A*O,S-P*O,H,z));break}}else{switch(h.push(y-b*O,S-_*O,y+b*U,S+_*U),ie){case hs.MITER:{W?h.push(H,z,H,z):h.push(he,me,he,me),d+=2;break}case hs.ROUND:{W?d+=$r(y,S,y+b*U,S+_*U,y+A*U,S+P*U,h,!0)+2:d+=$r(y,S,y-b*O,S-_*O,y-A*O,S-P*O,h,!1)+2;break}}h.push(y-A*O,S-P*O,y+A*U,S+P*U),d+=2}}x=i[(u-2)*2],v=i[(u-2)*2+1],y=i[(u-1)*2],S=i[(u-1)*2+1],b=-(v-S),_=x-y,E=Math.sqrt(b*b+_*_),b/=E,_/=E,b*=m,_*=m,h.push(y-b*O,S-_*O,y+b*U,S+_*U),c||(r.cap===xr.ROUND?d+=$r(y-b*(O-U)*.5,S-_*(O-U)*.5,y-b*O,S-_*O,y+b*U,S+_*U,h,!1)+2:r.cap===xr.SQUARE&&(d+=Tv(y,S,b,_,O,U,!1,h)));const Y=e.indices,$=ca.epsilon*ca.epsilon;for(let X=f;X0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(e,t=null,i=null,n=null){const r=new mh(e,t,i,n);return this.graphicsData.push(r),this.dirty++,this}drawHole(e,t=null){if(!this.graphicsData.length)return null;const i=new mh(e,null,null,t),n=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=n.lineStyle,n.holes.push(i),this.dirty++,this}destroy(){super.destroy();for(let e=0;e0&&(i=this.batches[this.batches.length-1],n=i.style);for(let c=this.shapeIndex;c65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&a===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=a?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(e,t){return!(!e||!t||e.texture.baseTexture!==t.texture.baseTexture||e.color+e.alpha!==t.color+t.alpha||!!e.native!=!!t.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let e=0,t=this.graphicsData.length;e65535*2)return!1;const e=this.batches;for(let t=0;t0&&(n=cc.pop(),n||(n=new Gf,n.texArray=new zf),this.drawCalls.push(n)),n.start=h,n.size=0,n.texArray.count=0,n.type=l),p.touched=1,p._batchEnabled=e,p._batchLocation=r,p.wrapMode=Os.REPEAT,n.texArray.elements[n.texArray.count++]=p,r++)),n.size+=d.size,h+=d.size,a=p._batchLocation,this.addColors(t,m.color,m.alpha,d.attribSize,d.attribStart),this.addTextureIds(i,a,d.attribSize,d.attribStart)}it._globalBatch=e,this.packAttributes()}packAttributes(){const e=this.points,t=this.uvs,i=this.colors,n=this.textureIds,r=new ArrayBuffer(e.length*3*4),o=new Float32Array(r),a=new Uint32Array(r);let c=0;for(let l=0;l0&&e.alpha>0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:i},e)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const e=this.currentPath.points,t=this.currentPath.points.length;t>2&&(this.drawShape(this.currentPath),this.currentPath=new ro,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new ro,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(e,t){return this.startPoly(),this.currentPath.points[0]=e,this.currentPath.points[1]=t,this}lineTo(e,t){this.currentPath||this.moveTo(0,0);const i=this.currentPath.points,n=i[i.length-2],r=i[i.length-1];return(n!==e||r!==t)&&i.push(e,t),this}_initCurve(e=0,t=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[e,t]):this.moveTo(e,t)}quadraticCurveTo(e,t,i,n){this._initCurve();const r=this.currentPath.points;return r.length===0&&this.moveTo(0,0),wp.curveTo(e,t,i,n,r),this}bezierCurveTo(e,t,i,n,r,o){return this._initCurve(),bp.curveTo(e,t,i,n,r,o,this.currentPath.points),this}arcTo(e,t,i,n,r){this._initCurve(e,t);const o=this.currentPath.points,a=Mv.curveTo(e,t,i,n,r,o);if(a){const{cx:c,cy:l,radius:h,startAngle:u,endAngle:d,anticlockwise:f}=a;this.arc(c,l,h,u,d,f)}return this}arc(e,t,i,n,r,o=!1){if(n===r)return this;if(!o&&r<=n?r+=nh:o&&n<=r&&(n+=nh),r-n===0)return this;const a=e+Math.cos(n)*i,c=t+Math.sin(n)*i,l=this._geometry.closePointEps;let h=this.currentPath?this.currentPath.points:null;if(h){const u=Math.abs(h[h.length-2]-a),d=Math.abs(h[h.length-1]-c);u0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:i},e)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(e,t,i,n){return this.drawShape(new ct(e,t,i,n))}drawRoundedRect(e,t,i,n,r){return this.drawShape(new hu(e,t,i,n,r))}drawCircle(e,t,i){return this.drawShape(new lu(e,t,i))}drawEllipse(e,t,i,n){return this.drawShape(new cu(e,t,i,n))}drawPolygon(...e){let t,i=!0;const n=e[0];n.points?(i=n.closeStroke,t=n.points):Array.isArray(e[0])?t=e[0]:t=e;const r=new ro(t);return r.closeStroke=i,this.drawShape(r),this}drawShape(e){return this._holeMode?this._geometry.drawHole(e,this._matrix):this._geometry.drawShape(e,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const e=this._geometry.graphicsData;return e.length===1&&e[0].shape.type===Ci.RECT&&!e[0].matrix&&!e[0].holes.length&&!(e[0].lineStyle.visible&&e[0].lineStyle.width)}_render(e){this.finishPoly();const t=this._geometry;t.updateBatches(),t.batchable?(this.batchDirty!==t.batchDirty&&this._populateBatches(),this._renderBatched(e)):(e.batch.flush(),this._renderDirect(e))}_populateBatches(){const e=this._geometry,t=this.blendMode,i=e.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=e.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(e.points);for(let n=0;ni&&!e.autoResize&&(o=i);let a=e._buffers;a||(a=e._buffers=this.generateBuffers(e));const c=t[0]._texture.baseTexture,l=c.alphaMode>0;this.state.blendMode=ub(e.blendMode,l),r.state.set(this.state);const h=r.gl,u=e.worldTransform.copyTo(this.tempMatrix);u.prepend(r.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=At.shared.setValue(e.tintRgb).premultiply(e.worldAlpha,l).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=c,this.renderer.shader.bind(this.shader);let d=!1;for(let f=0,m=0;fn&&(p=n),m>=a.length&&a.push(this._generateOneMoreBuffer(e));const g=a[m];g.uploadDynamic(t,f,p);const x=e._bufferUpdateIDs[m]||0;d=d||g._updateID0);n[o]=l,n[o+r]=l,n[o+r*2]=l,n[o+r*3]=l,o+=r*4}}destroy(){super.destroy(),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null}}f1.extension={name:"particle",type:ke.RendererPlugin};$e.add(f1);var mu=(s=>(s[s.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",s[s.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",s))(mu||{});const hc={willReadFrequently:!0},js=class Ye{static get experimentalLetterSpacingSupported(){let e=Ye._experimentalLetterSpacingSupported;if(e!==void 0){const t=Be.ADAPTER.getCanvasRenderingContext2D().prototype;e=Ye._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t}return e}constructor(e,t,i,n,r,o,a,c,l){this.text=e,this.style=t,this.width=i,this.height=n,this.lines=r,this.lineWidths=o,this.lineHeight=a,this.maxLineWidth=c,this.fontProperties=l}static measureText(e,t,i,n=Ye._canvas){i=i??t.wordWrap;const r=t.toFontString(),o=Ye.measureFont(r);o.fontSize===0&&(o.fontSize=t.fontSize,o.ascent=t.fontSize);const a=n.getContext("2d",hc);a.font=r;const c=(i?Ye.wordWrap(e,t,n):e).split(/(?:\r\n|\r|\n)/),l=new Array(c.length);let h=0;for(let m=0;m0&&(n?r-=t:r+=(Ye.graphemeSegmenter(e).length-1)*t),r}static wordWrap(e,t,i=Ye._canvas){const n=i.getContext("2d",hc);let r=0,o="",a="";const c=Object.create(null),{letterSpacing:l,whiteSpace:h}=t,u=Ye.collapseSpaces(h),d=Ye.collapseNewlines(h);let f=!u;const m=t.wordWrapWidth+l,p=Ye.tokenize(e);for(let g=0;gm)if(o!==""&&(a+=Ye.addLine(o),o="",r=0),Ye.canBreakWords(x,t.breakWords)){const y=Ye.wordWrapSplit(x);for(let S=0;Sm&&(a+=Ye.addLine(o),f=!1,o="",r=0),o+=C,r+=_}}else{o.length>0&&(a+=Ye.addLine(o),o="",r=0);const y=g===p.length-1;a+=Ye.addLine(x,!y),f=!1,o="",r=0}else v+r>m&&(f=!1,a+=Ye.addLine(o),o="",r=0),(o.length>0||!Ye.isBreakingSpace(x)||f)&&(o+=x,r+=v)}return a+=Ye.addLine(o,!1),a}static addLine(e,t=!0){return e=Ye.trimRight(e),e=t?`${e} +`:e,e}static getFromCache(e,t,i,n){let r=i[e];return typeof r!="number"&&(r=Ye._measureText(e,t,n)+t,i[e]=r),r}static collapseSpaces(e){return e==="normal"||e==="pre-line"}static collapseNewlines(e){return e==="normal"}static trimRight(e){if(typeof e!="string")return"";for(let t=e.length-1;t>=0;t--){const i=e[t];if(!Ye.isBreakingSpace(i))break;e=e.slice(0,-1)}return e}static isNewline(e){return typeof e!="string"?!1:Ye._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,t){return typeof e!="string"?!1:Ye._breakingSpaces.includes(e.charCodeAt(0))}static tokenize(e){const t=[];let i="";if(typeof e!="string")return t;for(let n=0;na;--d){for(let p=0;p{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const s=new Intl.Segmenter;return e=>[...s.segment(e)].map(t=>t.segment)}return s=>[...s]})(),js.experimentalLetterSpacing=!1,js._fonts={},js._newlines=[10,13],js._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let hr=js;const BI=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],m1=class Ha{constructor(e){this.styleID=0,this.reset(),sf(this,e,e)}clone(){const e={};return sf(e,this,Ha.defaultStyle),new Ha(e)}reset(){sf(this,Ha.defaultStyle,Ha.defaultStyle)}get align(){return this._align}set align(e){this._align!==e&&(this._align=e,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(e){const t=tf(e);this._dropShadowColor!==t&&(this._dropShadowColor=t,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)}get fill(){return this._fill}set fill(e){const t=tf(e);this._fill!==t&&(this._fill=t,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(e){NI(this._fillGradientStops,e)||(this._fillGradientStops=e,this.styleID++)}get fontFamily(){return this._fontFamily}set fontFamily(e){this.fontFamily!==e&&(this._fontFamily=e,this.styleID++)}get fontSize(){return this._fontSize}set fontSize(e){this._fontSize!==e&&(this._fontSize=e,this.styleID++)}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.styleID++)}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant!==e&&(this._fontVariant=e,this.styleID++)}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.styleID++)}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.styleID++)}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.styleID++)}get leading(){return this._leading}set leading(e){this._leading!==e&&(this._leading=e,this.styleID++)}get lineJoin(){return this._lineJoin}set lineJoin(e){this._lineJoin!==e&&(this._lineJoin=e,this.styleID++)}get miterLimit(){return this._miterLimit}set miterLimit(e){this._miterLimit!==e&&(this._miterLimit=e,this.styleID++)}get padding(){return this._padding}set padding(e){this._padding!==e&&(this._padding=e,this.styleID++)}get stroke(){return this._stroke}set stroke(e){const t=tf(e);this._stroke!==t&&(this._stroke=t,this.styleID++)}get strokeThickness(){return this._strokeThickness}set strokeThickness(e){this._strokeThickness!==e&&(this._strokeThickness=e,this.styleID++)}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline!==e&&(this._textBaseline=e,this.styleID++)}get trim(){return this._trim}set trim(e){this._trim!==e&&(this._trim=e,this.styleID++)}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.styleID++)}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap!==e&&(this._wordWrap=e,this.styleID++)}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.styleID++)}toFontString(){const e=typeof this.fontSize=="number"?`${this.fontSize}px`:this.fontSize;let t=this.fontFamily;Array.isArray(this.fontFamily)||(t=this.fontFamily.split(","));for(let i=t.length-1;i>=0;i--){let n=t[i].trim();!/([\"\'])[^\'\"]+\1/.test(n)&&!BI.includes(n)&&(n=`"${n}"`),t[i]=n}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${e} ${t.join(",")}`}};m1.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:mu.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let Er=m1;function tf(s){const e=At.shared,t=i=>{const n=e.setValue(i);return n.alpha===1?n.toHex():n.toRgbaString()};return Array.isArray(s)?s.map(t):t(s)}function NI(s,e){if(!Array.isArray(s)||!Array.isArray(e)||s.length!==e.length)return!1;for(let t=0;t0&&m>p&&(g=(p+m)/2);const x=p+d,v=i.lineHeight*(f+1);let y=x;f+10}}function $I(s,e){var i;let t=!1;if((i=s==null?void 0:s._textures)!=null&&i.length){for(let n=0;n{this.queue&&this.prepareItems()},this.registerFindHook(jI),this.registerFindHook(HI),this.registerFindHook($I),this.registerFindHook(XI),this.registerFindHook(VI),this.registerUploadHook(YI),this.registerUploadHook(GI)}upload(e){return new Promise(t=>{e&&this.add(e),this.queue.length?(this.completes.push(t),this.ticking||(this.ticking=!0,Yi.system.addOnce(this.tick,this,uo.UTILITY))):t()})}tick(){setTimeout(this.delayedTick,0)}prepareItems(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){const e=this.queue[0];let t=!1;if(e&&!e._destroyed){for(let i=0,n=this.uploadHooks.length;i=0;t--)this.add(e.children[t]);return this}destroy(){this.ticking&&Yi.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null}};g1.uploadsPerFrame=4;let mm=g1;Object.defineProperties(Be,{UPLOADS_PER_FRAME:{get(){return mm.uploadsPerFrame},set(s){mt("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),mm.uploadsPerFrame=s}}});function y1(s,e){return e instanceof it?(e._glTextures[s.CONTEXT_UID]||s.texture.bind(e),!0):!1}function WI(s,e){if(!(e instanceof Ni))return!1;const{geometry:t}=e;e.finishPoly(),t.updateBatches();const{batches:i}=t;for(let n=0;n1?Ns.from(KI,qI,t):Ns.from(Iv,ZI,t)}render(e){const t=this.renderer,i=this.quad;let n=i.vertices;n[0]=n[6]=e._width*-e.anchor.x,n[1]=n[3]=e._height*-e.anchor.y,n[2]=n[4]=e._width*(1-e.anchor.x),n[5]=n[7]=e._height*(1-e.anchor.y);const r=e.uvRespectAnchor?e.anchor.x:0,o=e.uvRespectAnchor?e.anchor.y:0;n=i.uvs,n[0]=n[6]=-r,n[1]=n[3]=-o,n[2]=n[4]=1-r,n[5]=n[7]=1-o,i.invalidate();const a=e._texture,c=a.baseTexture,l=c.alphaMode>0,h=e.tileTransform.localTransform,u=e.uvMatrix;let d=c.isPowerOfTwo&&a.frame.width===c.width&&a.frame.height===c.height;d&&(c._glTextures[t.CONTEXT_UID]?d=c.wrapMode!==Os.CLAMP:c.wrapMode===Os.CLAMP&&(c.wrapMode=Os.REPEAT));const f=d?this.simpleShader:this.shader,m=a.width,p=a.height,g=e._width,x=e._height;uc.set(h.a*m/g,h.b*m/x,h.c*p/g,h.d*p/x,h.tx/g,h.ty/x),uc.invert(),d?uc.prepend(u.mapCoord):(f.uniforms.uMapCoord=u.mapCoord.toArray(!0),f.uniforms.uClampFrame=u.uClampFrame,f.uniforms.uClampOffset=u.uClampOffset),f.uniforms.uTransform=uc.toArray(!0),f.uniforms.uColor=At.shared.setValue(e.tint).premultiply(e.worldAlpha,l).toArray(f.uniforms.uColor),f.uniforms.translationMatrix=e.transform.worldTransform.toArray(!0),f.uniforms.uSampler=a,t.shader.bind(f),t.geometry.bind(i),this.state.blendMode=ub(e.blendMode,l),t.state.set(this.state),t.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}b1.extension={name:"tilingSprite",type:ke.RendererPlugin};$e.add(b1);const w1=class Wa{constructor(e,t,i){this.linkedSheets=[],(e instanceof it||e instanceof Ke)&&(e={texture:e,data:t,resolutionFilename:i});const{texture:n,data:r,resolutionFilename:o=null,cachePrefix:a=""}=e;this.cachePrefix=a,this._texture=n instanceof Ke?n:null,this.baseTexture=n instanceof it?n:this._texture.baseTexture,this.textures={},this.animations={},this.data=r;const c=this.baseTexture.resource;this.resolution=this._updateResolution(o||(c?c.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}_updateResolution(e=null){const{scale:t}=this.data.meta;let i=Hn(e,null);return i===null&&(i=typeof t=="number"?t:parseFloat(t??"1")),i!==1&&this.baseTexture.setResolution(i),i}parse(){return new Promise(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=Wa.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(e){let t=e;const i=Wa.BATCH_SIZE;for(;t-e{this._batchIndex*Wa.BATCH_SIZE{i[n]=e}),Object.keys(e.textures).forEach(n=>{i[`${e.cachePrefix}${n}`]=e.textures[n]}),!t){const n=si.dirname(s[0]);e.linkedSheets.forEach((r,o)=>{Object.assign(i,S1([`${n}/${e.data.meta.related_multi_packs[o]}`],r,!0))})}return i}const eR={extension:ke.Asset,cache:{test:s=>s instanceof Rv,getCacheableAssets:(s,e)=>S1(s,e,!1)},resolver:{test:s=>{const e=s.split("?")[0].split("."),t=e.pop(),i=e.pop();return t==="json"&&QI.includes(i)},parse:s=>{var t;const e=s.split(".");return{resolution:parseFloat(((t=Be.RETINA_PREFIX.exec(s))==null?void 0:t[1])??"1"),format:e[e.length-2],src:s}}},loader:{name:"spritesheetLoader",extension:{type:ke.LoadParser,priority:os.Normal},async testParse(s,e){return si.extname(e.src).toLowerCase()===".json"&&!!s.frames},async parse(s,e,t){var h,u;const{texture:i,imageFilename:n,cachePrefix:r}=(e==null?void 0:e.data)??{};let o=si.dirname(e.src);o&&o.lastIndexOf("/")!==o.length-1&&(o+="/");let a;if(i&&i.baseTexture)a=i;else{const d=hh(o+(n??s.meta.image),e.src);a=(await t.load([d]))[d]}const c=new Rv({texture:a.baseTexture,data:s,resolutionFilename:e.src,cachePrefix:r});await c.parse();const l=(h=s==null?void 0:s.meta)==null?void 0:h.related_multi_packs;if(Array.isArray(l)){const d=[];for(const m of l){if(typeof m!="string")continue;let p=o+m;(u=e.data)!=null&&u.ignoreMultiPack||(p=hh(p,e.src),d.push(t.load({src:p,data:{ignoreMultiPack:!0}})))}const f=await Promise.all(d);c.linkedSheets=f,f.forEach(m=>{m.linkedSheets=[c].concat(c.linkedSheets.filter(p=>p!==m))})}return c},unload(s){s.destroy(!0)}}};$e.add(eR);class gh{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class Bc{static test(e){return typeof e=="string"&&e.startsWith("info face=")}static parse(e){const t=e.match(/^[a-z]+\s+.+$/gm),i={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const r in t){const o=t[r].match(/^[a-z]+/gm)[0],a=t[r].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),c={};for(const l in a){const h=a[l].split("="),u=h[0],d=h[1].replace(/"/gm,""),f=parseFloat(d),m=isNaN(f)?d:f;c[u]=m}i[o].push(c)}const n=new gh;return i.info.forEach(r=>n.info.push({face:r.face,size:parseInt(r.size,10)})),i.common.forEach(r=>n.common.push({lineHeight:parseInt(r.lineHeight,10)})),i.page.forEach(r=>n.page.push({id:parseInt(r.id,10),file:r.file})),i.char.forEach(r=>n.char.push({id:parseInt(r.id,10),page:parseInt(r.page,10),x:parseInt(r.x,10),y:parseInt(r.y,10),width:parseInt(r.width,10),height:parseInt(r.height,10),xoffset:parseInt(r.xoffset,10),yoffset:parseInt(r.yoffset,10),xadvance:parseInt(r.xadvance,10)})),i.kerning.forEach(r=>n.kerning.push({first:parseInt(r.first,10),second:parseInt(r.second,10),amount:parseInt(r.amount,10)})),i.distanceField.forEach(r=>n.distanceField.push({distanceRange:parseInt(r.distanceRange,10),fieldType:r.fieldType})),n}}class pm{static test(e){const t=e;return typeof e!="string"&&"getElementsByTagName"in e&&t.getElementsByTagName("page").length&&t.getElementsByTagName("info")[0].getAttribute("face")!==null}static parse(e){const t=new gh,i=e.getElementsByTagName("info"),n=e.getElementsByTagName("common"),r=e.getElementsByTagName("page"),o=e.getElementsByTagName("char"),a=e.getElementsByTagName("kerning"),c=e.getElementsByTagName("distanceField");for(let l=0;l")?pm.test(Be.ADAPTER.parseXML(e)):!1}static parse(e){return pm.parse(Be.ADAPTER.parseXML(e))}}const nf=[Bc,pm,gm];function tR(s){for(let e=0;e=c-P*o){if(p===0)throw new Error(`[BitmapFont] textureHeight ${c}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${b}')`);--w,g=null,x=null,v=null,p=0,m=0,y=0;continue}if(y=Math.max(P+_.fontProperties.descent,y),E*o+m>=d){if(m===0)throw new Error(`[BitmapFont] textureWidth ${a}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${b}')`);--w,p+=y*o,p=Math.ceil(p),m=0,y=0;continue}sR(g,x,_,m,p,o,u);const R=Nc(_.text);f.char.push({id:R,page:S.length-1,x:m/o,y:p/o,width:E,height:P,xoffset:0,yoffset:0,xadvance:A-(u.dropShadow?u.dropShadowDistance:0)-(u.stroke?u.strokeThickness:0)}),m+=(E+2*r)*o,m=Math.ceil(m)}if(!(i!=null&&i.skipKerning))for(let w=0,b=h.length;w 0.99) {\r + alpha = 1.0;\r + }\r +\r + // Gamma correction for coverage-like alpha\r + float luma = dot(uColor.rgb, vec3(0.299, 0.587, 0.114));\r + float gamma = mix(1.0, 1.0 / 2.2, luma);\r + float coverage = pow(uColor.a * alpha, gamma); \r +\r + // NPM Textures, NPM outputs\r + gl_FragColor = vec4(uColor.rgb, coverage);\r +}\r +`,oR=`// Mesh material default fragment\r +attribute vec2 aVertexPosition;\r +attribute vec2 aTextureCoord;\r +\r +uniform mat3 projectionMatrix;\r +uniform mat3 translationMatrix;\r +uniform mat3 uTextureMatrix;\r +\r +varying vec2 vTextureCoord;\r +\r +void main(void)\r +{\r + gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r +\r + vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r +}\r +`;const Pv=[],kv=[],Fv=[],aR=class T1 extends gi{constructor(e,t={}){super();const{align:i,tint:n,maxWidth:r,letterSpacing:o,fontName:a,fontSize:c}=Object.assign({},T1.styleDefaults,t);if(!or.available[a])throw new Error(`Missing BitmapFont "${a}"`);this._activePagesMeshData=[],this._textWidth=0,this._textHeight=0,this._align=i,this._tintColor=new At(n),this._font=void 0,this._fontName=a,this._fontSize=c,this.text=e,this._maxWidth=r,this._maxLineHeight=0,this._letterSpacing=o,this._anchor=new Fn(()=>{this.dirty=!0},this,0,0),this._roundPixels=Be.ROUND_PIXELS,this.dirty=!0,this._resolution=Be.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){var E;const e=or.available[this._fontName],t=this.fontSize,i=t/e.size,n=new St,r=[],o=[],a=[],c=this._text.replace(/(?:\r\n|\r)/g,` +`)||" ",l=M1(c),h=this._maxWidth*e.size/t,u=e.distanceFieldType==="none"?Pv:kv;let d=null,f=0,m=0,p=0,g=-1,x=0,v=0,y=0,S=0;for(let R=0;R0&&n.x>h&&(++v,Jo(r,1+g-v,1+R-g),R=g,g=-1,o.push(x),a.push(r.length>0?r[r.length-1].prevSpaces:0),m=Math.max(m,x),p++,n.x=0,n.y+=e.lineHeight,d=null,S=0)}const C=l[l.length-1];C!=="\r"&&C!==` +`&&(/(?:\s)/.test(C)&&(f=x),o.push(f),m=Math.max(m,f),a.push(-1));const w=[];for(let R=0;R<=p;R++){let O=0;this._align==="right"?O=m-o[R]:this._align==="center"?O=(m-o[R])/2:this._align==="justify"&&(O=a[R]<0?0:(m-o[R])/a[R]),w.push(O)}const b=r.length,_={},A=[],P=this._activePagesMeshData;u.push(...P);for(let R=0;R6*U)||O.vertices.lengtht[n.mesh.texture.baseTexture.uid]).forEach(n=>{n.mesh.texture=Ke.EMPTY});for(const n in t)t[n].destroy(),delete t[n];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(e)}};aR.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};const lR=[".xml",".fnt"],cR={extension:{type:ke.LoadParser,priority:os.Normal},name:"loadBitmapFont",test(s){return lR.includes(si.extname(s).toLowerCase())},async testParse(s){return Bc.test(s)||gm.test(s)},async parse(s,e,t){const i=Bc.test(s)?Bc.parse(s):gm.parse(s),{src:n}=e,{page:r}=i,o=[];for(let l=0;la[l]);return or.install(i,c,!0)},async load(s,e){return(await Be.ADAPTER.fetch(s)).text()},unload(s){s.destroy()}};$e.add(cR);const vm=class $o extends Er{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(e){return new $o(Object.keys($o.defaultOptions).reduce((t,i)=>({...t,[i]:e[i]}),{}))}cleanFonts(){this._fonts.length>0&&(this._fonts.forEach(e=>{URL.revokeObjectURL(e.src),e.refs--,e.refs===0&&(e.fontFace&&document.fonts.delete(e.fontFace),delete $o.availableFonts[e.originalUrl])}),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(e,t={}){const{availableFonts:i}=$o;if(i[e]){const n=i[e];return this._fonts.push(n),n.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return Be.ADAPTER.fetch(e).then(n=>n.blob()).then(async n=>new Promise((r,o)=>{const a=URL.createObjectURL(n),c=new FileReader;c.onload=()=>r([a,c.result]),c.onerror=o,c.readAsDataURL(n)})).then(async([n,r])=>{const o=Object.assign({family:si.basename(e,si.extname(e)),weight:"normal",style:"normal",display:"auto",src:n,dataSrc:r,refs:1,originalUrl:e,fontFace:null},t);i[e]=o,this._fonts.push(o),this.styleID++;const a=new FontFace(o.family,`url(${o.src})`,{weight:o.weight,style:o.style,display:o.display});o.fontFace=a,await a.load(),document.fonts.add(a),await document.fonts.ready,this.styleID++,this.fontsDirty=!0})}addOverride(...e){const t=e.filter(i=>!this._overrides.includes(i));t.length>0&&(this._overrides.push(...t),this.styleID++)}removeOverride(...e){const t=e.filter(i=>this._overrides.includes(i));t.length>0&&(this._overrides=this._overrides.filter(i=>!t.includes(i)),this.styleID++)}toCSS(e){return[`transform: scale(${e})`,"transform-origin: top left","display: inline-block",`color: ${this.normalizeColor(this.fill)}`,`font-size: ${this.fontSize}px`,`font-family: ${this.fontFamily}`,`font-weight: ${this.fontWeight}`,`font-style: ${this.fontStyle}`,`font-variant: ${this.fontVariant}`,`letter-spacing: ${this.letterSpacing}px`,`text-align: ${this.align}`,`padding: ${this.padding}px`,`white-space: ${this.whiteSpace}`,...this.lineHeight?[`line-height: ${this.lineHeight}px`]:[],...this.wordWrap?[`word-wrap: ${this.breakWords?"break-all":"break-word"}`,`max-width: ${this.wordWrapWidth}px`]:[],...this.strokeThickness?[`-webkit-text-stroke-width: ${this.strokeThickness}px`,`-webkit-text-stroke-color: ${this.normalizeColor(this.stroke)}`,`text-stroke-width: ${this.strokeThickness}px`,`text-stroke-color: ${this.normalizeColor(this.stroke)}`,"paint-order: stroke"]:[],...this.dropShadow?[this.dropShadowToCSS()]:[],...this._overrides].join(";")}toGlobalCSS(){return this._fonts.reduce((e,t)=>`${e} + @font-face { + font-family: "${t.family}"; + src: url('${t.dataSrc}'); + font-weight: ${t.weight}; + font-style: ${t.style}; + font-display: ${t.display}; + }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(e){this._stylesheet!==e&&(this._stylesheet=e,this.styleID++)}normalizeColor(e){return Array.isArray(e)&&(e=Q_(e)),typeof e=="number"?J_(e):e}dropShadowToCSS(){let e=this.normalizeColor(this.dropShadowColor);const t=this.dropShadowAlpha,i=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),n=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);e.startsWith("#")&&t<1&&(e+=(t*255|0).toString(16).padStart(2,"0"));const r=`${i}px ${n}px`;return this.dropShadowBlur>0?`text-shadow: ${r} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${r} ${e}`}reset(){Object.assign(this,$o.defaultOptions)}onBeforeDraw(){const{fontsDirty:e}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&e?new Promise(t=>setTimeout(t,100)):Promise.resolve()}get isSafari(){const{userAgent:e}=Be.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(e)}set fillGradientStops(e){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(e){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(e){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(e){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(e){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(e){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(e){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};vm.availableFonts={},vm.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let rf=vm;const dc=class Xo extends Pr{constructor(e="",t={}){super(Ke.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const i=new Image,n=Ke.from(i,{scaleMode:Be.SCALE_MODE,resourceOptions:{autoLoad:!1}});n.orig=new ct,n.trim=new ct,this.texture=n;const r="http://www.w3.org/2000/svg",o="http://www.w3.org/1999/xhtml",a=document.createElementNS(r,"svg"),c=document.createElementNS(r,"foreignObject"),l=document.createElementNS(o,"div"),h=document.createElementNS(o,"style");c.setAttribute("width","10000"),c.setAttribute("height","10000"),c.style.overflow="hidden",a.appendChild(c),this.maxWidth=Xo.defaultMaxWidth,this.maxHeight=Xo.defaultMaxHeight,this._domElement=l,this._styleElement=h,this._svgRoot=a,this._foreignObject=c,this._foreignObject.appendChild(h),this._foreignObject.appendChild(l),this._image=i,this._loadImage=new Image,this._autoResolution=Xo.defaultAutoResolution,this._resolution=Xo.defaultResolution??Be.RESOLUTION,this.text=e,this.style=t}measureText(e){var h,u;const{text:t,style:i,resolution:n}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);Object.assign(this._domElement,{innerHTML:t,style:i.toCSS(n)}),this._styleElement.textContent=i.toGlobalCSS(),document.body.appendChild(this._svgRoot);const r=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:o,height:a}=r;(o>this.maxWidth||a>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const c=Math.min(this.maxWidth,Math.ceil(o)),l=Math.min(this.maxHeight,Math.ceil(a));return this._svgRoot.setAttribute("width",c.toString()),this._svgRoot.setAttribute("height",l.toString()),t!==this._text&&(this._domElement.innerHTML=this._text),i!==this._style&&(Object.assign(this._domElement,{style:(h=this._style)==null?void 0:h.toCSS(n)}),this._styleElement.textContent=(u=this._style)==null?void 0:u.toGlobalCSS()),{width:c+i.padding*2,height:l+i.padding*2}}async updateText(e=!0){const{style:t,_image:i,_loadImage:n}=this;if(this.localStyleID!==t.styleID&&(this.dirty=!0,this.localStyleID=t.styleID),!this.dirty&&e)return;const{width:r,height:o}=this.measureText();i.width=n.width=Math.ceil(Math.max(1,r)),i.height=n.height=Math.ceil(Math.max(1,o)),this._updateID++;const a=this._updateID;await new Promise(c=>{n.onload=async()=>{if(a/gi,"

").replace(/
/gi,"
").replace(/ /gi," ")}};dc.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},dc.defaultMaxWidth=2024,dc.defaultMaxHeight=2024,dc.defaultAutoResolution=!0;function vh(s,e){const t=Math.max(0,Number(s)||0),i=Math.max(0,Number(e)||0);return{inner:Math.min(t,i),outer:Math.max(t,i)}}function _1(s){const e=Math.max(0,Number(s.outerRectW)||0),t=Math.max(0,Number(s.outerRectH)||0);return{innerW:Math.min(e,Math.max(0,Number(s.innerRectW)||0)),innerH:Math.min(t,Math.max(0,Number(s.innerRectH)||0)),outerW:e,outerH:t}}function hR(s,e,t,i,n){if(s==="random")return n();const r=Math.max(1,Math.round(t)),o=Math.max(0,Math.round(e))%r;return i?o/r:r<=1?.5:o/(r-1)}function Ov(s,e,t,i){const n=Math.sqrt(s*s+i()*(e*e-s*s));return{x:Math.cos(t)*n,y:-Math.sin(t)*n,radialAngle:-t*180/Math.PI}}function uR(s,e){const{innerW:t,innerH:i,outerW:n,outerH:r}=_1(s),o=Math.max(0,(n-t)/2),a=Math.max(0,(r-i)/2),c=o*r,l=t*a,h=c*2+l*2;if(h<=0){const m=n*2+r*2;if(m<=0)return{x:0,y:0,radialAngle:0};let p=e()*m,g,x;return pt?0:s==="linear"?1-e/t:s==="inverse"?Math.min(10,t/Math.max(e,t*.1)):1}function pR(s,e,t,i,n,r,o){const a=s-t,c=e-i,l=Math.hypot(a,c);if(l<=1e-4||l>r)return{x:0,y:0};const h=n*C1(o,l,r)*10;return{x:-c/l*h,y:a/l*h}}function gR(s,e,t){const i=s.rotation*Math.PI/180,n=Math.cos(i),r=Math.sin(i),o=Math.max(1e-4,Math.abs(s.scaleX??1)),a=Math.max(1e-4,Math.abs(s.scaleY??1)),c=e-s.x,l=t-s.y,h=(n*c+r*l)/o,u=(-r*c+n*l)/a,d=(w,b,_,A)=>{const P=_/o,E=A/a,R=Math.max(1e-4,Math.hypot(P,E)),O=P/R,U=E/R,Y=n*O-r*U,$=r*O+n*U;return{x:s.x+n*w*o-r*b*a+Y*.05,y:s.y+r*w*o+n*b*a+$*.05,nx:Y,ny:$}};if(s.shape==="circle"){const w=Math.max(.001,s.radius),b=Math.hypot(h,u);if(b>=w)return null;const _=b>1e-4?h/b:1,A=b>1e-4?u/b:0;return d(_*w,A*w,_,A)}if(s.shape==="ellipse"){const w=Math.max(.001,s.radiusX),b=Math.max(.001,s.radiusY),_=Math.hypot(h/w,u/b);if(_>=1)return null;const A=_>1e-4?1/_:1,P=_>1e-4?h*A:w,E=_>1e-4?u*A:0,R=Math.max(1e-4,Math.hypot(P/(w*w),E/(b*b)));return d(P,E,P/(w*w)/R,E/(b*b)/R)}if(s.shape==="rect"){const w=Math.max(.001,s.width*.5),b=Math.max(.001,s.height*.5);if(Math.abs(h)>=w||Math.abs(u)>=b)return null;const _=w-Math.abs(h),A=b-Math.abs(u);if(_=0?1:-1;return d(E*w,u,E,0)}const P=u>=0?1:-1;return d(h,P*b,0,P)}const f=Math.max(3,Math.min(16,Math.round(s.sides||(s.shape==="custom"?5:6)))),m=Math.max(.001,s.width*.5),p=Math.max(.001,s.height*.5),g=Array.from({length:f},(w,b)=>{const _=Math.PI*.5+b/f*Math.PI*2;return{x:Math.cos(_)*m,y:Math.sin(_)*p}});let x=!1;for(let w=0,b=g.length-1;wu!=A.y>u&&h<(A.x-_.x)*(u-_.y)/(A.y-_.y)+_.x&&(x=!x)}if(!x)return null;let v=g[0].x,y=g[0].y,S=1/0;for(let w=0;w>>0^Math.imul(e+1,2654435761)^t)>>>0;return i^=i>>>16,i=Math.imul(i,2146121005),i^=i>>>15,i=Math.imul(i,2221713035),i^=i>>>16,(i>>>0)/4294967296}function Io(s,e,t,i,n){return s==="fixed"?e:s==="curve"?Mi(e,t,nn(i,n)):Mi(e,t,n)}function of(s,e,t,i,n,r){return s==="curve"?Mi(e,t,nn(i,n)):s==="random"?r:e}function Nv(s,e,t,i,n){const r=1-n;return r*r*r*s+3*r*r*n*e+3*r*n*n*t+n*n*n*i}function nn(s,e,t="线性"){if(!Array.isArray(s)||s.length===0)return 1;const i=[...s].sort((n,r)=>n.x-r.x);if(e<=i[0].x)return i[0].y;if(e>=i[i.length-1].x)return i[i.length-1].y;for(let n=0;n=i[n].x&&e<=i[n+1].x){const r=i[n],o=i[n+1],a=o.x-r.x||1;if(t!=="贝塞尔")return Mi(r.y,o.y,(e-r.x)/a);const c=r.x+(r.outX??a/3),l=r.y+(r.outY??(o.y-r.y)/3),h=o.x+(o.inX??-a/3),u=o.y+(o.inY??-(o.y-r.y)/3);let d=0,f=1;for(let m=0;m<14;m++){const p=(d+f)/2;Nv(r.x,c,h,o.x,p)>>0;return function(){e|=0,e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}function sa(s){let e=s.replace("#","");return e.length===3&&(e=e.split("").map(t=>t+t).join("")),parseInt(e,16)}function yR(s,e,t){const i=Dv(s),n=Dv(e),r=Math.round(i[0]+(n[0]-i[0])*t),o=Math.round(i[1]+(n[1]-i[1])*t),a=Math.round(i[2]+(n[2]-i[2])*t);return r<<16|o<<8|a}function ym(s,e){if(!Array.isArray(s)||s.length===0)return 16777215;const t=[...s].sort((i,n)=>i.position-n.position);if(e<=t[0].position)return sa(t[0].color);if(e>=t[t.length-1].position)return sa(t[t.length-1].color);for(let i=0;ir.position)continue;const o=(e-n.position)/Math.max(1e-4,r.position-n.position);return yR(n.color,r.color,o)}return sa(t[t.length-1].color)}function Dv(s){let e=s.replace("#","");e.length===3&&(e=e.split("").map(i=>i+i).join(""));const t=parseInt(e,16);return[t>>16&255,t>>8&255,t&255]}function Uv(s,e){const t=Math.min(255,(s>>16&255)+(e>>16&255)),i=Math.min(255,(s>>8&255)+(e>>8&255)),n=Math.min(255,(s&255)+(e&255));return t<<16|i<<8|n}function xR(){return{sprite:null,boneName:"",mesh:null,meshSignature:"",history:[],bones:[],skinWeights:[],currentWidth:0,currentAlpha:0,currentColor:16777215,resourceId:1,enabled:!1,sampledLength:100,sampledWidth:100}}function Dc(s){s.history.length=0,s.bones.length=0,s.mesh&&(s.mesh.visible=!1)}class bR{constructor(e){M(this,"container");this.container=e}ensureMesh(e,t,i){const n=t.trailResources.find(g=>g.id===e.resourceId)||t.trailResources[0],r=(n==null?void 0:n.texture)||Ke.EMPTY,o=Number(n==null?void 0:n.rotation)||0,a=Math.max(2,Math.min(16,Math.round(t.trailGridRows))),c=Math.max(2,Math.min(32,Math.round(t.trailGridCols))),l=Math.max(2,Math.min(16,Math.round((n==null?void 0:n.boneCount)??3))),h=`${a}:${c}:${l}:${(n==null?void 0:n.id)??0}:${o}`;if(e.mesh&&e.meshSignature===h)return e.mesh.texture!==r&&(e.mesh.texture=r),e.mesh;e.mesh&&(this.container.removeChild(e.mesh),e.mesh.destroy()),e.meshSignature&&e.meshSignature!==h&&(e.history.length=0,e.bones.length=0);const u=new Float32Array(a*c*2),d=new Float32Array(a*c*2),f=[],m=[];for(let g=0;g.05?e.history.unshift({x:t,y:i}):(r.x=t,r.y=i);const o=Math.max(1,n)*1.5;let a=0,c=e.history.length;for(let l=1;l=o||l>=239){c=l+1;break}e.history.length>c&&(e.history.length=c)}sampleBones(e,t,i){const n=Math.max(2,Math.min(16,Math.round(i))),r=e.history,o=[];if(!r.length)return o;let a=0;for(let l=1;l=h&&g>1e-4){const x=(h-u)/g;d={x:Mi(m.x,p.x,x),y:Mi(m.y,p.y,x)};break}u+=g}o.push({boneName:`${e.boneName}_trail_${l}`,x:d.x,y:d.y,rotation:0})}for(let l=0;l1){const l=o[0].rotation,u=(o[o.length-1].rotation-l+540)%360-180;for(let d=0;dh.id===i.resourceId)||t.trailResources[0];if(!(r!=null&&r.texture)||i.bones.length<2){n.visible=!1;return}e.resourceId=r.id,n.texture!==r.texture&&(n.texture=r.texture);const o=Math.max(2,Math.min(16,Math.round(t.trailGridRows))),a=Math.max(2,Math.min(32,Math.round(t.trailGridCols))),c=n.vertices,l=[];for(let h=0;h.5&&i.alpha>0}update(e,t,i,n,r,o,a){if(e.sprite=a,e.boneName=i,!t.trail||!e.enabled||e.sampledLength<=0||e.sampledWidth<=0){Dc(e);return}this.ensureMesh(e,t,a);const c=t.trailResources.find(f=>f.id===e.resourceId)||t.trailResources[0];this.appendPoint(e,n,r,e.sampledLength);const l=c!=null&&c.lifeLengthEnabled?Math.max(0,nn(c.lifeLengthCurve,o)):1,h=Math.max(0,e.sampledLength)*l;e.bones=this.sampleBones(e,h,(c==null?void 0:c.boneCount)??3),e.bones[0]&&(e.bones[0].x=n,e.bones[0].y=r);const u=(c==null?void 0:c.widthMode)==="particle"?(Math.abs(a.scale.x)+Math.abs(a.scale.y))*.5:1;e.currentWidth=Math.max(0,e.sampledWidth)*u,e.currentAlpha=(c==null?void 0:c.alphaMode)==="particle"?a.alpha:(c==null?void 0:c.alphaMode)==="curve"?nn(c.alphaCurve,o):(c==null?void 0:c.alpha)??1,e.currentColor=(c==null?void 0:c.colorMode)==="particle"?a.tint:(c==null?void 0:c.colorMode)==="curve"?ym(c.colorGradient,o):sa((c==null?void 0:c.color)||"#ffffff");const d={bones:e.bones.map(f=>({...f})),activeBoneCount:e.bones.length,width:e.currentWidth,alpha:Math.min(1,Math.max(0,e.currentAlpha)),colorHex:e.currentColor,resourceId:e.resourceId};return this.skinMesh(e,t,d),d}applyState(e,t,i,n){var r;e.sprite=i,e.resourceId=n.resourceId??((r=t.trailResources[0])==null?void 0:r.id)??1,e.bones=n.bones.map(o=>({...o})),e.currentWidth=n.width,e.currentAlpha=n.alpha,this.skinMesh(e,t,n)}drawDebug(e,t,i,n){if(e.clear(),!t||!i.trail)return;const r=Math.max(2,Math.min(16,Math.round(i.trailGridRows))),o=Math.max(2,Math.min(32,Math.round(i.trailGridCols)));e.lineStyle(1,3790847,.72);for(const a of n){const c=a.mesh;if(!(c!=null&&c.visible))continue;const l=c.vertices,h=(u,d)=>{const f=(u*r+d)*2;return{x:l[f],y:l[f+1]}};for(let u=0;ur.texture||r.sequenceFrames.some(o=>o.texture));if(!t.length)return wR(s.texture);const i=t.reduce((r,o)=>r+Math.max(0,o.weight),0);if(i<=0)return t[Math.floor(e()*t.length)];let n=e()*i;for(const r of t)if(n-=Math.max(0,r.weight),n<=0)return r;return t[t.length-1]}function TR(s,e){const t=s.trailResources.filter(r=>r.texture);if(!t.length)return s.trailResources[0]||SR();const i=t.reduce((r,o)=>r+Math.max(0,o.weight),0);if(i<=0)return t[Math.min(t.length-1,Math.floor(e*t.length))];let n=e*i;for(const r of t)if(n-=Math.max(0,r.weight),n<=0)return r;return t[t.length-1]}function $v(s,e){if(s.imageMode!=="sequence"||s.sequenceFrames.length<=1)return{index:0,visible:!0};const t=Math.min(120,Math.max(1,Number(s.sequenceFps)||30)),i=Math.max(0,Math.floor(Math.max(0,e)*t)),n=s.sequenceFrames.length-1;return s.sequencePlayback==="once-hide"?{index:Math.min(n,i),visible:i<=n}:s.sequencePlayback==="once-hold"?{index:Math.min(n,i),visible:!0}:s.sequencePlayback==="loop-reverse"?{index:n-i%s.sequenceFrames.length,visible:!0}:{index:i%s.sequenceFrames.length,visible:!0}}function lf(s,e,t){var i;return s.imageMode==="sequence"&&s.sequenceFrames.length?((i=s.sequenceFrames[Math.max(0,Math.min(s.sequenceFrames.length-1,t))])==null?void 0:i.texture)||s.texture||e:s.texture||e}function wl(){return{texture:null,imageResources:[{id:1,texture:null,textureName:"star",textureFolder:"",previewUrl:"/images/star.png",imageMode:"fixed",sequencePlayback:"loop-forward",sequenceFps:30,sequenceFrames:[],weight:100,locked:!1,scale:1,anchorX:.5,anchorY:.5,colorMode:"fixed",colorStart:"#ffffff",colorEnd:"#ff4d4d",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],blend:"normal",independentAlpha:"off",alpha:1,alphaCurveMode:"跟随导出",alphaCurve:[{x:0,y:0},{x:.1,y:1},{x:.9,y:1},{x:1,y:0}]}],imageWeightVersion:1,name:"ParticleSystem1",mode:"stream",rate:20,streamBehavior:"normal",loopDurationFrames:30,generateLoopStartAnimation:!1,loopStartUseCustomDuration:!1,loopStartDurationFrames:30,generateLoopEndAnimation:!1,loopEndUseCustomDuration:!1,loopEndDurationFrames:30,burstCount:50,burstLoop:!1,delay:0,duration:1,shape:"point",showShape:!0,shapeRangeVersion:1,innerRadius:0,outerRadius:30,innerRectW:0,innerRectH:0,outerRectW:60,outerRectH:40,spawnPathId:0,spawnPathDistribution:"fixed",radius:30,rectW:60,rectH:40,centerX:0,centerY:0,rootRotation:0,rootScaleX:1,rootScaleY:1,renderLayerMode:"top",renderLayerSpineId:0,renderLayerSlotName:"",renderLayerSlotPosition:"above",renderLayerFollowAttachment:!1,emissionAngleMode:"random",direction:0,spread:360,coneDirection:90,coneAngle:60,lifeMin:.6,lifeMax:1.8,lifeMode:"random",lifeCurve:[{x:0,y:0},{x:1,y:1}],speedMin:30,speedMax:140,speedMode:"random",speedCurve:[{x:0,y:0},{x:1,y:1}],scaleMin:.3,scaleMax:.8,scaleMode:"random",scaleAxisMode:"uniform",scaleYMin:.3,scaleYMax:.8,scaleCurve:[{x:0,y:0},{x:1,y:1}],scaleYCurve:[{x:0,y:0},{x:1,y:1}],scaleEndRatio:.3,initialRotationMode:"random",initialRotationMin:0,initialRotationMax:360,initialRotationCurve:[{x:0,y:0},{x:1,y:1}],alpha:.9,alphaEnd:0,rotationSpeedMin:-180,rotationSpeedMax:180,speedOverLifeEnabled:!1,speedOverLifeMode:"fixed",speedOverLifeMin:1,speedOverLifeMax:1,speedOverLifeCurve:[{x:0,y:1},{x:1,y:1}],scaleOverLifeEnabled:!1,scaleOverLifeMode:"curve",scaleOverLifeAxisMode:"uniform",scaleOverLifeMin:0,scaleOverLifeMax:1,scaleYOverLifeMin:0,scaleYOverLifeMax:1,scaleOverLifeCurve:[{x:0,y:1},{x:1,y:1}],scaleYOverLifeCurve:[{x:0,y:1},{x:1,y:1}],rotationOverLifeEnabled:!1,rotationOverLifeMode:"random",rotationOverLifeCurve:[{x:0,y:0},{x:1,y:1}],gravity:980,gravityMode:"fixed",gravityMin:980,gravityMax:980,gravityDirection:-90,gravityCurve:[{x:0,y:1},{x:1,y:1}],damping:0,seed:0,colorStart:"#ffffff",colorEnd:"#ff4d4d",colorOverLife:!1,blend:"add",alphaMode:"curve",curveMode:"线性",alphaCurve:[{x:0,y:0},{x:.2,y:1},{x:.8,y:1},{x:1,y:0}],textureName:"star",textureFolder:"",alphaScale:1,anchorX:.5,anchorY:.5,independentAlpha:"off",offsetX:0,offsetY:0,noise:!1,noiseAmt:30,noiseRange:100,noiseSpeed:1,useGravity:!1,wind:!1,windX:0,windY:0,windMode:"fixed",windMin:100,windMax:100,windDirection:0,windCurve:[{x:0,y:1},{x:1,y:1}],forceField:!1,forceStrength:10,forceRadius:100,forceCenterX:0,forceCenterY:0,forceFalloff:"linear",showForceFieldShape:!0,vortex:!1,vortexStrength:10,vortexRadius:100,vortexCenterX:0,vortexCenterY:0,vortexFalloff:"linear",showVortexShape:!0,attraction:!1,attractionCenterX:200,attractionCenterY:0,attractionRadius:20,attractionDuration:.5,attractionDelay:.1,attractionDelayMode:"particle",attractionPath:"curve",showAttractionShape:!0,trail:!1,trailConfigVersion:3,trailResources:[{id:1,texture:null,textureName:"trail",previewUrl:"/images/trail.png",weight:100,locked:!1,rotation:0,colorMode:"particle",color:"#ffffff",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],blend:"normal",alphaMode:"particle",alpha:1,alphaCurve:[{x:0,y:1},{x:1,y:1}],boneCount:3,trailRatio:100,lengthMode:"fixed",length:100,lengthMin:100,lengthMax:100,widthSizeMode:"fixed",width:100,widthMin:100,widthMax:100,widthMode:"particle",lifeLengthEnabled:!1,lifeLengthCurve:[{x:0,y:1},{x:1,y:1}],shapeEnabled:!1,shapeCurve:[{x:0,y:1},{x:1,y:1}]}],trailResourceVersion:6,trailTexture:null,trailTextureName:"trail",trailPreviewUrl:"/images/trail.png",trailColorMode:"particle",trailColor:"#ffffff",trailColorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],trailAlphaMode:"particle",trailAlpha:1,trailAlphaCurve:[{x:0,y:1},{x:1,y:1}],trailBoneCount:3,trailLength:100,trailWidth:100,trailWidthMode:"particle",trailLifeLengthEnabled:!1,trailLifeLengthCurve:[{x:0,y:1},{x:1,y:1}],trailShapeEnabled:!1,trailShapeCurve:[{x:0,y:1},{x:1,y:1}],trailGridRows:4,trailGridCols:4,collision:!1,collisionColliderIds:[],pathFollow:!1,eventEnabled:!1,events:[],emitterFollow:!1,emitterFollowMode:"none",emitterFollowPathId:0,emitterFollowSpineId:0,emitterFollowBoneName:"",emitterFollowBoneOffsetX:0,emitterFollowBoneOffsetY:0,emitterFollowBoneRotation:0,emitterFollowBoneScaleX:1,emitterFollowBoneScaleY:1,emitterAngleMode:"fixed",emitterFollowCurve:[{x:0,y:0},{x:1,y:1}],emitterFollowDuration:2,emitterFollowSpace:"world",emitterFollowDirection:"forward",emitterFollowOffset:0}}function Xn(s){var P;const e=wl(),t=s,i=t.shapeRangeVersion!==1,n=Number(t.radius),r=Number(t.rectW),o=Number(t.rectH),a=Number(t.direction),c=Number(t.spread),l=t.shape,h=t.imageWeightVersion!==1,u=t.loopDurationFrames==null,d=t.gravityMode==null,f=Number(t.gravity),m=t.windMode==null,p=Number(t.windX),g=Number(t.windY),x=t.forceFalloff==null,v=Number(t.forceStrength),y=t.trailConfigVersion!==3,S=!Array.isArray(t.trailResources),C=t.trailResourceVersion!==6,w=t.trailTexture,b=String(t.trailTextureName||"trail"),_=String(t.trailPreviewUrl||"/images/trail.png").replace("/trails/trail.png","/images/trail.png");for(const[E,R]of Object.entries(e))t[E]!==void 0&&t[E]!==null||(t[E]=Array.isArray(R)?R.map(O=>typeof O=="object"&&O!==null?{...O}:O):R);i&&(s.innerRadius=0,s.outerRadius=Math.max(0,Number.isFinite(n)?n:e.outerRadius),s.innerRectW=0,s.innerRectH=0,s.outerRectW=Math.max(0,Number.isFinite(r)?r:e.outerRectW),s.outerRectH=Math.max(0,Number.isFinite(o)?o:e.outerRectH),s.coneDirection=Number.isFinite(a)?a:90,s.emissionAngleMode=Number.isFinite(c)&&c>0?"random":"fixed",l==="cone"&&(s.spread=Math.max(0,Number(s.coneAngle)||0)),s.shapeRangeVersion=1),s.shape==="orbit"&&(s.shape="path"),["fixed","random","radial","path-normal","path-tangent"].includes(s.emissionAngleMode)||(s.emissionAngleMode="fixed"),!["circle","rect","cone"].includes(s.shape)&&s.emissionAngleMode==="radial"&&(s.emissionAngleMode="fixed"),s.shape!=="path"&&(s.emissionAngleMode==="path-normal"||s.emissionAngleMode==="path-tangent")&&(s.emissionAngleMode="fixed"),s.spawnPathId=Math.max(0,Math.round(Number(s.spawnPathId)||0)),s.spawnPathDistribution!=="fixed"&&s.spawnPathDistribution!=="random"&&(s.spawnPathDistribution="fixed"),s.renderLayerMode!=="top"&&s.renderLayerMode!=="slot"&&(s.renderLayerMode="top"),s.renderLayerSpineId=Math.max(0,Math.round(Number(s.renderLayerSpineId)||0)),typeof s.renderLayerSlotName!="string"&&(s.renderLayerSlotName=""),s.renderLayerSlotPosition!=="above"&&s.renderLayerSlotPosition!=="below"&&(s.renderLayerSlotPosition="above"),typeof s.renderLayerFollowAttachment!="boolean"&&(s.renderLayerFollowAttachment=!1),typeof s.eventEnabled!="boolean"&&(s.eventEnabled=!1),Array.isArray(s.events)||(s.events=[]);for(const E of s.events){E.id=Math.max(1,Math.round(Number(E.id)||1)),E.event!=="birth"&&E.event!=="death"&&E.event!=="collision"&&(E.event="birth"),E.targetSystemId=Math.max(0,Math.round(Number(E.targetSystemId)||0));const R=Number(E.probability);E.probability=Math.min(1,Math.max(0,Number.isFinite(R)?R:1));const O=Math.round(Number(E.collisionLimit));E.collisionLimit=Math.min(4,Math.max(1,Number.isFinite(O)?O:1));const U=E.inherit,Y=["color","scale","rotation","life"],$=Array.isArray(U)?U:U==="all"?[...Y]:Y.includes(String(U))?[String(U)]:[],X=[...new Set($.filter(F=>Y.includes(String(F))))],D=Array.isArray(U)?U:null;(!D||D.length!==X.length||X.some((F,N)=>F!==D[N]))&&(E.inherit=X),E.colorInheritMode!=="add"&&E.colorInheritMode!=="replace"&&(E.colorInheritMode="add")}s.innerRadius=Math.max(0,Number(s.innerRadius)||0),s.outerRadius=Math.max(s.innerRadius,Number(s.outerRadius)||0),s.innerRectW=Math.max(0,Number(s.innerRectW)||0),s.innerRectH=Math.max(0,Number(s.innerRectH)||0),s.outerRectW=Math.max(s.innerRectW,Number(s.outerRectW)||0),s.outerRectH=Math.max(s.innerRectH,Number(s.outerRectH)||0);const A=Array.from(new Set((Array.isArray(s.collisionColliderIds)?s.collisionColliderIds:[]).map(E=>Math.round(Number(E))).filter(E=>Number.isFinite(E)&&E>0)));(A.length!==s.collisionColliderIds.length||A.some((E,R)=>E!==s.collisionColliderIds[R]))&&(s.collisionColliderIds=A),s.streamBehavior!=="normal"&&s.streamBehavior!=="loop"&&(s.streamBehavior="normal"),(u||!Number.isFinite(s.loopDurationFrames))&&(s.loopDurationFrames=Math.ceil(Math.max(1/30,Number(s.duration)||1)*30)),s.loopDurationFrames=Math.min(1800,Math.max(1,Math.ceil(s.loopDurationFrames))),typeof s.generateLoopStartAnimation!="boolean"&&(s.generateLoopStartAnimation=!1),typeof s.generateLoopEndAnimation!="boolean"&&(s.generateLoopEndAnimation=!1),typeof s.loopStartUseCustomDuration!="boolean"&&(s.loopStartUseCustomDuration=!1),typeof s.loopEndUseCustomDuration!="boolean"&&(s.loopEndUseCustomDuration=!1),s.loopStartDurationFrames=Math.min(1800,Math.max(1,Math.ceil(Number(s.loopStartDurationFrames)||30))),s.loopEndDurationFrames=Math.min(1800,Math.max(1,Math.ceil(Number(s.loopEndDurationFrames)||30))),(!Array.isArray(s.imageResources)||s.imageResources.length===0)&&(s.imageResources=wl().imageResources);for(const E of s.imageResources){!E.texture&&s.texture&&(E.texture=s.texture),E.textureName||(E.textureName="star"),E.previewUrl==="/particles/star.png"&&(E.previewUrl="/images/star.png"),E.previewUrl||(E.previewUrl=E.textureName==="star"?"/images/star.png":""),E.imageMode!=="fixed"&&E.imageMode!=="sequence"&&(E.imageMode="fixed"),E.sequencePlayback==="once"?E.sequencePlayback="once-hold":E.sequencePlayback==="loop"?E.sequencePlayback="loop-forward":["once-hide","once-hold","loop-forward","loop-reverse"].includes(E.sequencePlayback)||(E.sequencePlayback="loop-forward"),Number.isFinite(E.sequenceFps)||(E.sequenceFps=30),E.sequenceFps=Math.min(120,Math.max(1,Number(E.sequenceFps)||30)),Array.isArray(E.sequenceFrames)||(E.sequenceFrames=[]);for(const R of E.sequenceFrames)typeof R.name!="string"&&(R.name=""),typeof R.previewUrl!="string"&&(R.previewUrl=""),R.texture===void 0&&(R.texture=null);Number.isFinite(E.weight)||(E.weight=100),typeof E.locked!="boolean"&&(E.locked=!1),Number.isFinite(E.scale)||(E.scale=1),Number.isFinite(E.anchorX)||(E.anchorX=.5),Number.isFinite(E.anchorY)||(E.anchorY=.5),E.colorMode!=="fixed"&&E.colorMode!=="random"&&E.colorMode!=="lifetime"&&(E.colorMode=s.colorOverLife?"lifetime":"fixed"),E.colorStart||(E.colorStart=s.colorStart||"#ffffff"),E.colorEnd||(E.colorEnd=s.colorEnd||E.colorStart),(!Array.isArray(E.colorGradient)||E.colorGradient.length<2)&&(E.colorGradient=[{position:0,color:E.colorStart},{position:1,color:E.colorEnd}]),Object.prototype.hasOwnProperty.call(br,E.blend)||(E.blend=s.blend||"normal"),["off","fixed","curve"].includes(E.independentAlpha)||(E.independentAlpha=s.independentAlpha||"off"),Number.isFinite(E.alpha)||(E.alpha=Number.isFinite(s.alphaScale)?s.alphaScale:1),["跟随导出","线性","贝塞尔"].includes(E.alphaCurveMode)||(E.alphaCurveMode=s.curveMode||"跟随导出"),(!Array.isArray(E.alphaCurve)||E.alphaCurve.length<2)&&(E.alphaCurve=(s.alphaCurve||[{x:0,y:1},{x:1,y:1}]).map(R=>({...R})))}if(s.imageResources.length===1)s.imageResources[0].weight=100,s.imageResources[0].locked=!1;else if(h){const E=100/s.imageResources.length;s.imageResources.forEach((R,O)=>{R.weight=O===s.imageResources.length-1?100-E*(s.imageResources.length-1):E,R.locked=!1})}if(s.imageWeightVersion=1,d){const E=Number.isFinite(f)&&f!==0?f:980;s.gravity=E,s.gravityMin=E,s.gravityMax=E}if(m){const E=Number.isFinite(p)&&Number.isFinite(g)&&(p!==0||g!==0);s.windMin=E?Math.hypot(p,g):100,s.windMax=s.windMin,s.windDirection=E?Math.atan2(-g,p)*180/Math.PI:0}x&&(s.forceStrength=Number.isFinite(v)&&v!==0?v:10),y&&(s.trailConfigVersion=3,s.trailAlphaCurve=[{x:0,y:1},{x:1,y:1}],s.trailLifeLengthCurve=[{x:0,y:1},{x:1,y:1}],s.trailShapeCurve=[{x:0,y:1},{x:1,y:1}],s.trailGridRows=4,s.trailGridCols=4),(S||!s.trailResources.length)&&(s.trailResources=[{id:1,texture:w||null,textureName:b,previewUrl:_,weight:100,locked:!1,rotation:0,colorMode:s.trailColorMode,color:s.trailColor,colorGradient:s.trailColorGradient.map(E=>({...E})),blend:"normal",alphaMode:s.trailAlphaMode,alpha:s.trailAlpha,alphaCurve:s.trailAlphaCurve.map(E=>({...E})),boneCount:s.trailBoneCount,trailRatio:100,lengthMode:"fixed",length:s.trailLength,lengthMin:s.trailLength,lengthMax:s.trailLength,widthSizeMode:"fixed",width:s.trailWidth,widthMin:s.trailWidth,widthMax:s.trailWidth,widthMode:s.trailWidthMode,lifeLengthEnabled:s.trailLifeLengthEnabled,lifeLengthCurve:s.trailLifeLengthCurve.map(E=>({...E})),shapeEnabled:s.trailShapeEnabled,shapeCurve:s.trailShapeCurve.map(E=>({...E}))}]);for(const E of s.trailResources)E.textureName||(E.textureName="trail"),E.previewUrl==="/trails/trail.png"&&(E.previewUrl="/images/trail.png"),E.previewUrl||(E.previewUrl="/images/trail.png"),Number.isFinite(E.weight)||(E.weight=100),typeof E.locked!="boolean"&&(E.locked=!1),Number.isFinite(E.rotation)||(E.rotation=0),["particle","fixed","curve"].includes(E.colorMode)||(E.colorMode=s.trailColorMode||"particle"),E.color||(E.color=s.trailColor||"#ffffff"),(!Array.isArray(E.colorGradient)||E.colorGradient.length<2)&&(E.colorGradient=(s.trailColorGradient||[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}]).map(R=>({...R}))),Object.prototype.hasOwnProperty.call(br,E.blend)||(E.blend="normal"),["particle","fixed","curve"].includes(E.alphaMode)||(E.alphaMode=s.trailAlphaMode||"particle"),Number.isFinite(E.alpha)||(E.alpha=Number.isFinite(s.trailAlpha)?s.trailAlpha:1),(!Array.isArray(E.alphaCurve)||E.alphaCurve.length<2)&&(E.alphaCurve=(s.trailAlphaCurve||[{x:0,y:1},{x:1,y:1}]).map(R=>({...R}))),Number.isFinite(E.boneCount)||(E.boneCount=Number.isFinite(s.trailBoneCount)?s.trailBoneCount:3),Number.isFinite(E.trailRatio)||(E.trailRatio=100),E.trailRatio=Math.min(100,Math.max(0,E.trailRatio)),["fixed","random"].includes(E.lengthMode)||(E.lengthMode="fixed"),Number.isFinite(E.length)||(E.length=Number.isFinite(s.trailLength)?s.trailLength:100),Number.isFinite(E.lengthMin)||(E.lengthMin=E.length),Number.isFinite(E.lengthMax)||(E.lengthMax=E.length),["fixed","random"].includes(E.widthSizeMode)||(E.widthSizeMode="fixed"),Number.isFinite(E.width)||(E.width=Number.isFinite(s.trailWidth)?s.trailWidth:100),Number.isFinite(E.widthMin)||(E.widthMin=E.width),Number.isFinite(E.widthMax)||(E.widthMax=E.width),["particle","fixed"].includes(E.widthMode)||(E.widthMode=s.trailWidthMode||"particle"),typeof E.lifeLengthEnabled!="boolean"&&(E.lifeLengthEnabled=!!s.trailLifeLengthEnabled),(!Array.isArray(E.lifeLengthCurve)||E.lifeLengthCurve.length<2)&&(E.lifeLengthCurve=(s.trailLifeLengthCurve||[{x:0,y:1},{x:1,y:1}]).map(R=>({...R}))),typeof E.shapeEnabled!="boolean"&&(E.shapeEnabled=!!s.trailShapeEnabled),(!Array.isArray(E.shapeCurve)||E.shapeCurve.length<2)&&(E.shapeCurve=(s.trailShapeCurve||[{x:0,y:1},{x:1,y:1}]).map(R=>({...R})));if(s.trailResources.length===1&&(s.trailResources[0].weight=100,s.trailResources[0].locked=!1),C)for(const E of s.trailResources)E.alphaCurve=((P=E.alphaCurve)==null?void 0:P.length)>=2?E.alphaCurve:[{x:0,y:1},{x:1,y:1}];return s.trailResourceVersion=6,s}class Xv extends gi{constructor(t,i=Lv){super();M(this,"pool",[]);M(this,"cfg");M(this,"accumulator",0);M(this,"burstTimer",0);M(this,"_spawnSerial",0);M(this,"_elapsed",0);M(this,"_attractionEnabledAt",0);M(this,"_attractionWasEnabled",!1);M(this,"autoEmission",!0);M(this,"pendingEventSpawns",[]);M(this,"states",[]);M(this,"onParticleEvent",null);M(this,"rng",Math.random);M(this,"_lastSeed",-1);M(this,"trailDebugGfx",new Ni);M(this,"trail");M(this,"colliders",[]);M(this,"followSpawnX",0);M(this,"followSpawnY",0);M(this,"followSpawnAngle",0);M(this,"spawnPathSampler",null);M(this,"spawnPathClosed",!1);M(this,"followExportCurveMode","线性");M(this,"simulationTransform",null);this.cfg=Xn(t),this.trail=new bR(this),this._ensurePool(i),this.addChild(this.trailDebugGfx)}setFollowExportCurveMode(t){this.followExportCurveMode=t}resolveCurveMode(t){return t==="跟随导出"?this.followExportCurveMode:t}reseed(){const t=this.cfg.seed;t!==this._lastSeed&&(this._lastSeed=t,this.rng=af(t>>>0))}_ensurePool(t){for(;this.pool.length=n.delay),o=i==="force"||i==="normal"&&(n.mode==="burst"||this._elapsed=1;)this.accumulator-=1,this.spawnOne();else this.burstTimer+=t,n.burstLoop?this.burstTimer>=1&&(this.burstTimer=0,this.emitBurst()):t>0&&this.burstTimer<=t&&this.emitBurst();if(this.pendingEventSpawns.length&&t>0){const m=[],p=[];for(const g of this.pendingEventSpawns)g.remaining-=t,g.remaining<=0?m.push(g):p.push(g);this.pendingEventSpawns=p;for(const g of m){const x=mc(this.cfg,g.worldX,g.worldY,this.simulationTransform);for(let v=0;v0){const F=Math.max(1e-4,Math.abs(n.rootScaleX)),N=Math.max(1e-4,Math.abs(n.rootScaleY)),k=-(((c=this.simulationTransform)==null?void 0:c.rotation)??n.rootRotation)*Math.PI/180,V=Math.cos(k),G=Math.sin(k),W=((l=this.simulationTransform)==null?void 0:l.centerX)??n.centerX,Z=((h=this.simulationTransform)==null?void 0:h.centerY)??n.centerY,ne=W+V*F*p.x-G*N*p.y,oe=-Z+G*F*p.x+V*N*p.y,de=ne,pe=-oe,he=n.forceCenterX-de,me=n.forceCenterY-pe,H=Math.hypot(he,me);if(H>1e-4&&H<=n.forceRadius){const z=C1(n.forceFalloff,H,n.forceRadius),K=n.forceStrength*z*10,B=he/H*K,L=me/H*K,j=B,ie=-L;p.vx+=(V*j+G*ie)/F*t,p.vy+=(-G*j+V*ie)/N*t}}if(!p.collisionPaused&&n.vortex&&n.vortexStrength!==0&&n.vortexRadius>0){const F=tr(n,p.x,p.y,this.simulationTransform),N=pR(F.x,F.y,n.vortexCenterX,n.vortexCenterY,n.vortexStrength,n.vortexRadius,n.vortexFalloff),k=Bv(n,N.x,N.y,this.simulationTransform);p.vx+=k.x*t,p.vy+=k.y*t}if(!p.collisionPaused&&n.damping>0){const F=Math.max(0,1-n.damping*t);p.vx*=F,p.vy*=F}if(p.collisionPaused)p.vx=0,p.vy=0;else if(p.x+=p.vx*t,p.y+=p.vy*t,this.applyColliders(p,m))continue;if(n.attraction&&!p.collisionPaused){const F=p.maxLife-p.life;if(n.attractionDelayMode==="particle"?F>=Math.max(0,n.attractionDelay):this._elapsed-this._attractionEnabledAt>=Math.max(0,n.attractionDelay)){const k=tr(n,p.x,p.y,this.simulationTransform),V=n.attractionCenterX,G=n.attractionCenterY,W=Math.max(0,n.attractionRadius);if(!p.attractionActive){if(Math.hypot(V-k.x,G-k.y)<=W){this.kill(m);continue}p.attractionActive=!0,p.attractionElapsed=0,p.attractionStartWorldX=k.x,p.attractionStartWorldY=k.y}p.attractionElapsed+=t;const Z=Math.max(1e-4,n.attractionDuration),ne=Math.min(1,p.attractionElapsed/Z);let oe=Mi(p.attractionStartWorldX,V,ne),de=Mi(p.attractionStartWorldY,G,ne);if(n.attractionPath==="curve"){const me=V-p.attractionStartWorldX,H=G-p.attractionStartWorldY,z=Math.hypot(me,H);if(z>1e-4){const K=z*.25*p.attractionCurveSide,B=(p.attractionStartWorldX+V)*.5-H/z*K,L=(p.attractionStartWorldY+G)*.5+me/z*K,j=1-ne;oe=j*j*p.attractionStartWorldX+2*j*ne*B+ne*ne*V,de=j*j*p.attractionStartWorldY+2*j*ne*L+ne*ne*G}}const pe=Math.hypot(V-oe,G-de);if(ne>=1||pe<=W){this.kill(m);continue}const he=mc(n,oe,de,this.simulationTransform);p.x=he.x,p.y=he.y,p.vx=0,p.vy=0}}const x=g,v=p.sprite,y=n.imageResources.find(F=>F.id===p.resourceId);if(y){const F=$v(y,p.maxLife-p.life);p.imageFrameIndex=F.index,v.texture=lf(y,n.texture,p.imageFrameIndex),v.visible=F.visible}if(n.speedOverLifeEnabled){const F=fc(of(n.speedOverLifeMode,n.speedOverLifeMin,n.speedOverLifeMax,n.speedOverLifeCurve,x,p.speedScaleTarget),1),N=p.speedScale===0?F:F/p.speedScale;p.vx*=N,p.vy*=N,p.speedScale=F}let S=p.rotationSpeed;n.rotationOverLifeEnabled&&n.rotationOverLifeMode==="curve"&&(S=Mi(n.rotationSpeedMin,n.rotationSpeedMax,nn(n.rotationOverLifeCurve,x))),p.rotation+=S*t;let C=p.x,w=p.y;if(n.noise&&n.noiseAmt>0&&n.noiseRange>0&&n.noiseSpeed>0){const F=p.maxLife-p.life,N=Math.max(0,n.noiseRange)*Math.min(1,Math.max(0,n.noiseAmt)/100)*.5,k=F*Math.max(0,n.noiseSpeed)*Math.PI*2;C+=(Math.sin(p.noisePhaseX+k)-Math.sin(p.noisePhaseX))*N,w+=(Math.sin(p.noisePhaseY+k*.83)-Math.sin(p.noisePhaseY))*N}v.x=C,v.y=w,v.rotation=-p.rotation*Math.PI/180;let b=1,_=1;n.scaleOverLifeEnabled&&(b=of(n.scaleOverLifeMode,n.scaleOverLifeMin,n.scaleOverLifeMax,n.scaleOverLifeCurve,x,p.scaleOverLifeX),_=n.scaleOverLifeAxisMode==="separate"?of(n.scaleOverLifeMode,n.scaleYOverLifeMin,n.scaleYOverLifeMax,n.scaleYOverLifeCurve,x,p.scaleOverLifeY):b),v.scale.set(fc(p.scaleStartX*b,1),fc(p.scaleStartY*_,1)),p.currentScaleX=v.scale.x,p.currentScaleY=v.scale.y;const A=n.alphaMode==="curve"?nn(n.alphaCurve,x,this.resolveCurveMode(n.curveMode))*n.alphaScale:n.alpha*n.alphaScale;v.alpha=fc((y==null?void 0:y.independentAlpha)==="fixed"?y.alpha:(y==null?void 0:y.independentAlpha)==="curve"?nn(y.alphaCurve,x,this.resolveCurveMode(y.alphaCurveMode)):A,1);const P=(y==null?void 0:y.colorStart)||"#ffffff",E=(y==null?void 0:y.colorMode)==="lifetime"?ym(y.colorGradient,x):(y==null?void 0:y.colorMode)==="random"?p.colorSample:sa(P),R=p.colorOverride??Uv(E,p.colorAdd);v.tint=R,v.blendMode=br[(y==null?void 0:y.blend)||"normal"];const O=this.trail.update(p.trail,n,p.boneName,C,w,x,v),U=tr(n,C,w,this.simulationTransform),Y=((u=this.simulationTransform)==null?void 0:u.rotation)??n.rootRotation,$=Math.abs(((d=this.simulationTransform)==null?void 0:d.scaleX)??n.rootScaleX),X=Math.abs(((f=this.simulationTransform)==null?void 0:f.scaleY)??n.rootScaleY),D=O?{...O,bones:O.bones.map(F=>{const N=tr(n,F.x,F.y,this.simulationTransform);return{...F,worldX:N.x,worldY:N.y,worldRotation:Y-F.rotation}})}:void 0;a.push({boneName:p.boneName,spawnId:p.spawnId,x:C,y:w,rotation:p.rotation,scaleX:v.scale.x,scaleY:v.scale.y,worldX:U.x,worldY:U.y,worldRotation:Y+p.rotation,worldScaleX:v.scale.x*$,worldScaleY:v.scale.y*X,alpha:v.alpha,colorHex:R,resourceId:p.resourceId,imageFrameIndex:p.imageFrameIndex,imageVisible:v.visible,trailState:D,active:!0})}return this.states=a,a}drawTrailMeshDebug(t){this.trail.drawDebug(this.trailDebugGfx,t,this.cfg,this.pool.map(i=>i.trail))}emitBurst(){for(let t=0;t0&&this.spawnPathSampler){const a=this.estimatedEmissionCount(),c=hR(t.spawnPathDistribution,this._spawnSerial,a,this.spawnPathClosed,this.rng),l=this.spawnPathSampler(c);if(l)return{...this.applyFollowToOrigin(l.x+i,l.y+n),radialAngle:0,pathAngle:l.angle}}const r=dR(t,this.rng);return{...this.applyFollowToOrigin(i+r.x,n+r.y),radialAngle:r.radialAngle}}estimatedEmissionCount(){const t=this.cfg;return t.mode==="burst"?Math.max(1,Math.round(t.burstCount)):Math.max(1,Math.floor(t.rate*(t.streamBehavior==="loop"?Math.max(1,t.loopDurationFrames)/30:Math.max(0,t.duration))))}applyFollowToOrigin(t,i){const n=this.followSpawnAngle*Math.PI/180,r=Math.cos(n),o=Math.sin(n);return{x:this.followSpawnX+r*t-o*i,y:this.followSpawnY+o*t+r*i}}spawnEventParticle(t,i,n=1,r,o){if(n>2)return!1;const a=o??(this.cfg.mode==="burst"?this.cfg.burstCount:1),c=Math.max(1,Math.min(Lv,Math.round(Number(a)||1))),l=Math.max(0,Number(this.cfg.delay)||0);if(l>0)return this.pendingEventSpawns.push({worldX:t,worldY:i,depth:n,inherit:r,count:c,remaining:l}),!0;const h=mc(this.cfg,t,i,this.simulationTransform);let u=!1;for(let d=0;d!_.active);if(o===-1)return!1;const a=t?{x:t.x,y:t.y,radialAngle:0}:this.spawnOrigin(),{x:c,y:l}=a,h=Io(r.lifeMode,r.lifeMin,r.lifeMax,r.lifeCurve,this.rng()),u=Io(r.speedMode,r.speedMin,r.speedMax,r.speedCurve,this.rng()),d=n!=null&&n.attributes.includes("rotation")?n.data.rotation:0,f=fR(r,a,this.followSpawnAngle,this.rng)+d*Math.PI/180,m=this.pool[o],p=MR(r,this.rng),g=this._spawnSerial++;m.spawnId=g;const x=TR(r,ar(r.seed,g,1540483477));m.noisePhaseX=ar(r.seed,g,1757159915)*Math.PI*2,m.noisePhaseY=ar(r.seed,g,48610963)*Math.PI*2,m.gravityStrength=r.useGravity&&r.gravityMode==="random"?Mi(r.gravityMin,r.gravityMax,this.rng()):r.gravityMin,m.windStrength=r.wind&&r.windMode==="random"?Mi(r.windMin,r.windMax,this.rng()):r.windMin,m.attractionActive=!1,m.attractionElapsed=0,m.collisionPaused=!1,m.collisionCount=0,m.eventDepth=i,m.attractionCurveSide=ar(r.seed,g,2738958700)<.5?-1:1,m.trail.history.length=0,m.trail.bones.length=0,m.trail.currentWidth=0,m.trail.currentAlpha=0,m.trail.currentColor=16777215,m.trail.resourceId=x.id;const v=Math.min(100,Math.max(0,Number(x.trailRatio)||0)),y=r.mode==="burst"?Math.max(0,Math.round(r.burstCount)):Math.max(0,Math.floor(r.rate*(r.streamBehavior==="loop"?Math.max(1,r.loopDurationFrames)/30:Math.max(0,r.duration)))),S=v>0&&y===1&&g===0,C=ar(r.seed,g,668265261)*100,w=(_,A,P,E,R)=>{if(_!=="random")return Math.max(0,Number(A)||0);const O=Math.max(0,Math.min(Number(P)||0,Number(E)||0)),U=Math.max(0,Math.max(Number(P)||0,Number(E)||0));return Mi(O,U,ar(r.seed,g,R))};if(m.trail.sampledLength=w(x.lengthMode,x.length,x.lengthMin,x.lengthMax,374761393),m.trail.sampledWidth=w(x.widthSizeMode,x.width,x.widthMin,x.widthMax,3550635116),m.trail.enabled=r.trail&&(S||C0&&m.trail.sampledWidth>0,m.trail.mesh&&(m.trail.mesh.visible=!1),m.active=!0,m.life=h,m.maxLife=h,m.x=c,m.y=l,m.trail.enabled&&m.trail.history.push({x:c,y:l}),m.vx=Math.cos(f)*u,m.vy=Math.sin(f)*u,m.scaleStartX=Io(r.scaleMode,r.scaleMin,r.scaleMax,r.scaleCurve,this.rng())*p.scale,m.scaleStartY=r.scaleAxisMode==="separate"?Io(r.scaleMode,r.scaleYMin,r.scaleYMax,r.scaleYCurve,this.rng())*p.scale:m.scaleStartX,m.alphaStart=r.alpha,m.alphaEnd=r.alphaEnd,m.rotation=r.initialRotationMode==="direction"?-Math.atan2(m.vy,m.vx)*180/Math.PI+r.initialRotationMin:Io(r.initialRotationMode,r.initialRotationMin,r.initialRotationMax,r.initialRotationCurve,this.rng())+d,m.rotationSpeed=r.rotationOverLifeEnabled?Io(r.rotationOverLifeMode,r.rotationSpeedMin,r.rotationSpeedMax,r.rotationOverLifeCurve,this.rng()):0,m.speedScale=1,m.speedScaleTarget=r.speedOverLifeMode==="random"?Mi(r.speedOverLifeMin,r.speedOverLifeMax,this.rng()):r.speedOverLifeMin,m.scaleOverLifeX=r.scaleOverLifeMode==="random"?Mi(r.scaleOverLifeMin,r.scaleOverLifeMax,this.rng()):r.scaleOverLifeMin,m.scaleOverLifeY=r.scaleOverLifeMode==="random"?Mi(r.scaleYOverLifeMin,r.scaleYOverLifeMax,this.rng()):r.scaleYOverLifeMin,m.resourceId=p.id,m.colorSample=p.colorMode==="random"?ym(p.colorGradient,ar(r.seed,g,2654435769)):sa(p.colorStart),m.colorAdd=0,m.colorOverride=null,n){const _=n.attributes;_.includes("color")&&(n.colorMode==="replace"?m.colorOverride=n.data.colorHex:m.colorAdd=n.data.colorHex),_.includes("scale")&&(m.scaleStartX*=n.data.scaleX,m.scaleStartY*=n.data.scaleY),_.includes("life")&&(m.life=Math.max(1e-4,n.data.life),m.maxLife=m.life)}m.currentScaleX=m.scaleStartX,m.currentScaleY=m.scaleStartY;const b=$v(p,0);return m.imageFrameIndex=b.index,m.sprite.texture=lf(p,r.texture,b.index),m.sprite.anchor.set(p.anchorX,p.anchorY),m.sprite.blendMode=br[p.blend],m.sprite.tint=m.colorOverride??Uv(m.colorSample,m.colorAdd),m.sprite.visible=!0,this.emitLocalEvent("birth",m,m.x,m.y),!0}kill(t){const i=this.pool[t];i.active&&this.emitLocalEvent("death",i,i.x,i.y),i.active=!1,i.sprite.visible=!1,Dc(i.trail)}clear(){this.pendingEventSpawns.length=0;for(const t of this.pool)t.active=!1,t.sprite.visible=!1,Dc(t.trail)}get activeCount(){let t=0;for(const i of this.pool)i.active&&t++;return t}capture(){const t=[];for(const i of this.pool)i.active&&t.push({boneName:i.boneName,spawnId:i.spawnId,x:i.sprite.x,y:i.sprite.y,rotation:i.rotation,scaleX:i.sprite.scale.x,scaleY:i.sprite.scale.y,...this.captureWorldTransform(i),alpha:i.sprite.alpha,colorHex:i.sprite.tint,resourceId:i.resourceId,imageFrameIndex:i.imageFrameIndex,imageVisible:i.sprite.visible,active:!0,trailState:this.cfg.trail&&i.trail.bones.length?{bones:i.trail.bones.map(n=>{var o;const r=tr(this.cfg,n.x,n.y,this.simulationTransform);return{...n,worldX:r.x,worldY:r.y,worldRotation:(((o=this.simulationTransform)==null?void 0:o.rotation)??this.cfg.rootRotation)-n.rotation}}),activeBoneCount:i.trail.bones.length,width:i.trail.currentWidth,alpha:i.trail.currentAlpha,colorHex:i.trail.currentColor,resourceId:i.trail.resourceId}:void 0});return t}captureWorldTransform(t){var r,o,a;const i=tr(this.cfg,t.sprite.x,t.sprite.y,this.simulationTransform),n=((r=this.simulationTransform)==null?void 0:r.rotation)??this.cfg.rootRotation;return{worldX:i.x,worldY:i.y,worldRotation:n+t.rotation,worldScaleX:t.sprite.scale.x*Math.abs(((o=this.simulationTransform)==null?void 0:o.scaleX)??this.cfg.rootScaleX),worldScaleY:t.sprite.scale.y*Math.abs(((a=this.simulationTransform)==null?void 0:a.scaleY)??this.cfg.rootScaleY)}}apply(t){const i=new Map;for(const n of t)i.set(n.boneName,n);for(const n of this.pool){const r=i.get(n.boneName);if(!r){n.active=!1,n.sprite.visible=!1,n.trail.mesh&&(n.trail.mesh.visible=!1);continue}n.active=r.active;const o=n.sprite;if(o.visible=r.active&&r.imageVisible!==!1,o.x=r.x,o.y=r.y,o.rotation=-r.rotation*Math.PI/180,o.scale.set(r.scaleX,r.scaleY),o.alpha=r.alpha,o.tint=r.colorHex,r.resourceId!=null){const a=this.cfg.imageResources.find(c=>c.id===r.resourceId);a&&(n.imageFrameIndex=r.imageFrameIndex??0,o.texture=lf(a,this.cfg.texture,n.imageFrameIndex),o.anchor.set(a.anchorX,a.anchorY),o.blendMode=br[a.blend])}this.cfg.trail&&r.trailState?this.trail.applyState(n.trail,this.cfg,n.sprite,r.trailState):n.trail.mesh&&(n.trail.mesh.visible=!1)}}reset(){this.pendingEventSpawns.length=0;for(const t of this.pool)t.active=!1,t.sprite.visible=!1,Dc(t.trail);this.accumulator=0,this.burstTimer=0,this._spawnSerial=0,this._elapsed=0,this._attractionEnabledAt=0,this._attractionWasEnabled=!1,this._lastSeed=this.cfg.seed,this.rng=af(this.cfg.seed>>>0)}restartEmissionCycle(){this.pendingEventSpawns.length=0,this.accumulator=0,this.burstTimer=0,this._spawnSerial=0,this._elapsed=0,this._attractionEnabledAt=0,this._attractionWasEnabled=this.cfg.attraction,this._lastSeed=this.cfg.seed,this.rng=af(this.cfg.seed>>>0)}}const fo=new Map,ao=new Map;function _R(s){return[...fo.values()].some(e=>e===s)}function E1(s){if(!(_R(s)||(ao.get(s)||0)>0)){ao.delete(s);for(const e of s.textures)e.destroy(!0)}}function CR(s){const e=ao.get(s)||0;e>1?ao.set(s,e-1):ao.delete(s),E1(s)}function ER(s){return fo.get(s)||null}function pu(s,e){Fl(s),fo.set(s,e)}function AR(s){const e=fo.get(s);return e?(ao.set(e,(ao.get(e)||0)+1),e):null}function IR(s,e){const t=fo.get(s);return t?(pu(e,t),!0):!1}function Fl(s){const e=fo.get(s);e&&(fo.delete(s),E1(e))}function Vt(s){if(Array.isArray(s))return s.map(e=>Vt(e));if(s&&typeof s=="object"){const e=Object.getPrototypeOf(s);if(e===Object.prototype||e===null){const t={};for(const[i,n]of Object.entries(s))t[i]=Vt(n);return t}}return s}const A1=["3.8","4.0","4.1","4.2","4.3"];function yh(s){const e=String(s||"").trim();return A1.find(t=>e===t||e.startsWith(`${t}.`))||null}function xm(){return A1.join(" / ")}function RR(s){return s==="4.3"?"4.3":"4.2"}function _p(){return{imagesPath:"./images/",spineVersion:"4.2",keyframeCurve:"bezier",fps:30,omitFps:!1,integerFrameAlignment:!0,bonePool:!0,excludeEmptyAnimations:!1,fileName:"SpineParticle.json"}}function I1(s){const e=Object.assign(_p(),s||{});return e.imagesPath=String(e.imagesPath||"./images/"),e.spineVersion=yh(e.spineVersion)||"4.2",e.keyframeCurve=e.keyframeCurve==="bezier"?"bezier":"linear",e.fps=Math.min(240,Math.max(1,Math.round(Number(e.fps)||30))),e.omitFps=e.omitFps===!0,e.integerFrameAlignment=e.integerFrameAlignment!==!1,e.bonePool=e.bonePool!==!1,e.excludeEmptyAnimations=e.excludeEmptyAnimations===!0,e.fileName=String(e.fileName||"SpineParticle.json"),e}const bm=30;function Uc(s,e=1){return Math.min(1800,Math.max(1,Math.ceil(Number(s)||e)))}function R1(s,e=30){const t=Math.max(0,Number(s.lifeMin)||0),i=Math.max(0,Number(s.lifeMax)||0),n=s.lifeMode==="fixed"?t:Math.max(t,i);return Uc(Math.ceil(n*Math.max(1,e)),bm)}function Ps(s,e=30){const t=Uc(s.loopDurationFrames),i=R1(s,e),n=s.generateLoopStartAnimation?s.loopStartUseCustomDuration?Uc(s.loopStartDurationFrames,bm):i:0,r=s.generateLoopEndAnimation?s.loopEndUseCustomDuration?Uc(s.loopEndDurationFrames,bm):i:0;return{start:n,loop:t,end:r,total:n+t+r}}function P1(s,e){const t=Ps(s,e),n=Math.max(0,Math.ceil(Math.max(0,Number(s.delay)||0)*Math.max(1,e)))+t.start;return{start:n,end:n+t.loop}}function Sl(s){var t,i;const e=new Set;for(const n of s){if(((t=n.config)==null?void 0:t.eventEnabled)===!1)continue;const r=(i=n.config)==null?void 0:i.events;if(Array.isArray(r))for(const o of r)o.targetSystemId>0&&o.targetSystemId!==n.id&&e.add(o.targetSystemId)}return e}function k1(s,e){var r,o;const t=new Map;for(const a of s){if(((r=a.config)==null?void 0:r.eventEnabled)===!1)continue;const c=(o=a.config)==null?void 0:o.events;if(Array.isArray(c))for(const l of c){if(l.targetSystemId<=0||l.targetSystemId===a.id)continue;const h=t.get(l.targetSystemId);h?h.push(a.id):t.set(l.targetSystemId,[a.id])}}const i=new Set,n=[...t.get(e)||[]];for(;n.length;){const a=n.pop();i.has(a)||(i.add(a),n.push(...t.get(a)||[]))}return i.delete(e),i}const PR=.001;function F1(s,e){const t=Math.max(1,Number(e)||30),n=Math.max(0,Number(s)||0)*t+PR*t;return Math.max(0,Math.floor(n))}function O1(s,e,t){const i=Math.max(1,Math.floor(t)-1),n=Math.min(i-1,Math.max(0,Math.floor(Number(s)||0))),r=Math.min(i,Math.max(n+1,Math.floor(Number(e)||i)));return{start:n,end:r}}function cf(s,e,t,i){const n=Math.max(1,Math.floor(i)-1);return O1(s?e:0,s?t:n,i)}function kR(s,e,t){const i=Math.max(1,e-1),n=Math.max(1,t-1),r=s.end>=i?n:s.end;return O1(s.start,r,t)}let pc=1,gc=1,vc=1,yc=1;function xc(s,e){const t=new Set(e),i=`${s} Copy`;if(!t.has(i))return i;let n=2;for(;t.has(`${i} ${n}`);)n++;return`${i} ${n}`}const yo=z2("particle",{state:()=>({editor:{viewScale:1,viewX:0,viewY:0},systems:[],colliders:[],paths:[],spines:[],activeId:0,activeObjectType:"particle",activeObjectId:0,timeline:{playing:!0,loop:!0,abLoop:!1,frame:0,totalFrames:60,playbackStart:0,playbackEnd:59,fps:30,recorded:!1,animation:"animation",animations:["animation"]},settings:{parameterPanelOnRight:!0,tickEnabled:!1,axisFontSize:12,tickWidth:1,showAxisLabels:!0,axisColor:"#7a86ad",undoLimit:20,backgroundX:0,backgroundY:0,backgroundOpacity:1,backgroundImageName:"",backgroundImageData:"",showEmitter:!0,showBones:!1,bonePointDrawSize:1,boneAxisDrawSize:2,showSkinMesh:!1,showGrid:!0,exportSettings:_p()}}),getters:{activeSystemCount:s=>s.systems.length,playbackRange:s=>cf(s.timeline.abLoop,s.timeline.playbackStart,s.timeline.playbackEnd,s.timeline.totalFrames)},actions:{syncSceneSequences(){pc=Math.max(pc,...this.systems.map(s=>s.id+1),1),gc=Math.max(gc,...this.colliders.map(s=>s.id+1),1),vc=Math.max(vc,...this.paths.map(s=>s.id+1),1),yc=Math.max(yc,...this.spines.map(s=>s.id+1),1)},addSystem(s){const e=wl();s!=null&&s.config&&Object.assign(e,s.config);const t=new Set(this.systems.map(r=>r.config.name));if(t.has(e.name)){let r=0;for(const a of this.systems){const c=/^ParticleSystem(\d+)$/.exec(a.config.name);c&&(r=Math.max(r,parseInt(c[1],10)))}e.name=`ParticleSystem${r+1}`;let o=2;for(;t.has(e.name);)e.name=`ParticleSystem${r+o}`,o++}const i=this.timeline.animations.includes(this.timeline.animation)?this.timeline.animation:this.timeline.animations[0]||"animation",n={id:pc++,visible:!0,animation:i,config:e};return this.systems.push(n),this.activeId=n.id,this.activeObjectType="particle",this.activeObjectId=n.id,n},removeSystem(s){var i;const e=this.systems.findIndex(n=>n.id===s);e>=0&&this.systems.splice(e,1),this.activeId===s&&(this.activeId=((i=this.systems[0])==null?void 0:i.id)??0);const t=this.systems.find(n=>n.id===this.activeId);if(t&&(this.timeline.animation=t.animation),this.activeObjectType==="particle"&&this.activeObjectId===s){const n=this.systems[0];this.activeObjectId=(n==null?void 0:n.id)??0}},selectSystem(s){this.activeId=s,this.activeObjectType="particle",this.activeObjectId=s;const e=this.systems.find(t=>t.id===s);e&&(this.timeline.animation=e.animation)},setSystemAnimation(s,e){if(!this.timeline.animations.includes(e))return;const t=this.systems.find(i=>i.id===s);t&&(t.animation=e,this.timeline.animation=e)},addAnimation(){const s=new Set(this.timeline.animations);let e=2,t=`animation${e}`;for(;s.has(t);)t=`animation${++e}`;this.timeline.animations.push(t),this.timeline.animation=t;const i=this.systems.find(n=>n.id===this.activeId);return i&&(i.animation=t),t},renameAnimation(s,e){const t=e.trim(),i=this.timeline.animations.indexOf(s);if(i<0||!t||t!==s&&this.timeline.animations.includes(t))return!1;this.timeline.animations[i]=t;for(const n of this.systems)n.animation===s&&(n.animation=t);return this.timeline.animation===s&&(this.timeline.animation=t),!0},removeAnimation(s){if(this.timeline.animations.length<=1)return!1;const e=this.timeline.animations.indexOf(s);if(e<0)return!1;this.timeline.animations.splice(e,1);const t=this.timeline.animations[Math.min(e,this.timeline.animations.length-1)];for(const i of this.systems)i.animation===s&&(i.animation=t);return this.timeline.animation===s&&(this.timeline.animation=t),!0},addCollider(){const s=gc++,e={id:s,name:`Collider${s}`,visible:!0,shape:"circle",enabled:!0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,radius:50,radiusX:70,radiusY:45,width:120,height:80,sides:6,response:"physics",elasticity:.8,friction:.3,followPath:!1,followPathId:0,followDuration:2,followPathRotation:!1,followCurveMode:"跟随导出",followCurve:[{x:0,y:0},{x:1,y:1}]};return this.colliders.push(e),this.activeObjectType="collision",this.activeObjectId=e.id,e},addPath(){const s=vc++,e={id:s,name:`Path${s}`,visible:!0,enabled:!0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,closed:!1,color:"#ff933e",preset:"",points:[]};return this.paths.push(e),this.activeObjectType="path",this.activeObjectId=e.id,e},addSpine(){const s=yc++,e={id:s,name:`SpineSkeleton${s}`,enabled:!0,visible:!0,x:0,y:0,rotation:0,scaleX:1,scaleY:1,timeOffset:0,skeletonFileName:"",atlasFileName:"",textureFileNames:[],dataVersion:"",sourceBundle:null,selectedAnimation:"",selectedBone:"",selectedSlot:"",animations:[],bones:[],slots:[],assetVersion:0,status:"empty",error:""};return this.spines.push(e),this.activeObjectType="spine",this.activeObjectId=e.id,e},duplicateSelectedObject(){const s=this.activeObjectId;if(!s)return null;if(this.activeObjectType==="particle"){const i=this.systems.find(r=>r.id===s);if(!i)return null;const n=Vt(i);return n.id=pc++,n.config.name=xc(i.config.name,this.systems.map(r=>r.config.name)),n.frames=void 0,this.systems.push(n),this.activeId=n.id,this.activeObjectId=n.id,this.timeline.animation=n.animation,n}if(this.activeObjectType==="collision"){const i=this.colliders.find(r=>r.id===s);if(!i)return null;const n=Vt(i);return n.id=gc++,n.name=xc(i.name,this.colliders.map(r=>r.name)),this.colliders.push(n),this.activeObjectId=n.id,n}if(this.activeObjectType==="path"){const i=this.paths.find(r=>r.id===s);if(!i)return null;const n=Vt(i);return n.id=vc++,n.name=xc(i.name,this.paths.map(r=>r.name)),this.paths.push(n),this.activeObjectId=n.id,n}const e=this.spines.find(i=>i.id===s);if(!e)return null;const t=Vt(e);return t.id=yc++,t.name=xc(e.name,this.spines.map(i=>i.name)),t.selectedBone="",t.selectedSlot="",IR(e.id,t.id),this.spines.push(t),this.activeObjectId=t.id,t},selectSceneObject(s,e){if(this.activeObjectType=s,this.activeObjectId=e,s==="particle"){this.activeId=e;const t=this.systems.find(i=>i.id===e);t&&(this.timeline.animation=t.animation)}},removeCollider(s){var t;const e=this.colliders.findIndex(i=>i.id===s);e>=0&&this.colliders.splice(e,1);for(const i of this.systems){const n=Xn(i.config);n.collisionColliderIds=n.collisionColliderIds.filter(r=>r!==s)}if(this.activeObjectType==="collision"&&this.activeObjectId===s){const i=this.systems[0];this.activeObjectType=i?"particle":"collision",this.activeObjectId=(i==null?void 0:i.id)??((t=this.colliders[0])==null?void 0:t.id)??0}},removePath(s){var t;const e=this.paths.findIndex(i=>i.id===s);if(e>=0&&this.paths.splice(e,1),this.activeObjectType==="path"&&this.activeObjectId===s){const i=this.systems[0];this.activeObjectType=i?"particle":"path",this.activeObjectId=(i==null?void 0:i.id)??((t=this.paths[0])==null?void 0:t.id)??0}},removeSpine(s){Fl(s);const e=this.spines.findIndex(t=>t.id===s);if(e>=0&&this.spines.splice(e,1),this.activeObjectType==="spine"&&this.activeObjectId===s){const t=this.systems[0],i=this.colliders[0],n=this.paths[0],r=this.spines[0];t?(this.activeObjectType="particle",this.activeObjectId=t.id,this.activeId=t.id):i?(this.activeObjectType="collision",this.activeObjectId=i.id):n?(this.activeObjectType="path",this.activeObjectId=n.id):(this.activeObjectType="spine",this.activeObjectId=(r==null?void 0:r.id)??0)}this.recalcTotalFrames()},play(){const s=this.playbackRange;(this.timeline.frame=s.end)&&(this.timeline.frame=s.start),this.timeline.playing=!0},pause(){this.timeline.playing=!1},togglePlay(){this.timeline.playing?this.pause():this.play()},toStart(){this.timeline.frame=this.playbackRange.start},previousFrame(){this.timeline.playing=!1,this.timeline.frame=Math.max(this.playbackRange.start,this.timeline.frame-1)},nextFrame(){this.timeline.playing=!1,this.timeline.frame=Math.min(this.playbackRange.end,this.timeline.frame+1)},toEnd(){this.timeline.playing=!1,this.timeline.frame=this.playbackRange.end},toggleLoop(){this.timeline.loop=!this.timeline.loop},toggleABLoop(){this.timeline.abLoop=!this.timeline.abLoop;const s=this.playbackRange;(this.timeline.frames.end)&&(this.timeline.frame=s.start)},setFrame(s){this.timeline.frame=Math.max(0,Math.min(s,this.timeline.totalFrames-1))},setPlaybackStart(s){const e=cf(!0,s,this.timeline.playbackEnd,this.timeline.totalFrames);this.timeline.playbackStart=e.start,this.timeline.playbackEnd=e.end,this.timeline.abLoop&&this.timeline.framee.end&&(this.timeline.frame=e.end)},recalcTotalFrames(){const s=Math.max(1,this.timeline.fps||30),e=u=>{const d=Math.max(0,Number(u.lifeMin)||0),f=Math.max(0,Number(u.lifeMax)||0);return u.lifeMode==="fixed"?d:Math.max(d,f)},t=new Map(this.systems.map(u=>[u.id,u])),i=new Map,n=new Set,r=u=>{const d=i.get(u.id);if(d!=null)return d;if(n.has(u.id))return 0;n.add(u.id);const f=u.config,m=e(f);let p=m;if(f.eventEnabled)for(const g of f.events||[]){const x=t.get(g.targetSystemId);if(!x||x.id===u.id)continue;const v=r(x),y=g.event==="birth"?0:m,S=Math.max(0,Number(x.config.delay)||0);p=Math.max(p,y+S+v)}return n.delete(u.id),i.set(u.id,p),p},o=Sl(this.systems);let a=0;for(const u of this.systems){if(o.has(u.id))continue;const d=u.config,f=Math.max(0,Number(d.delay)||0),m=d.mode==="stream"&&d.streamBehavior==="loop";let p;if(d.mode==="stream"){const g=m?Ps(d,s).total/s:Math.max(1/s,Number(d.duration)||0);if(p=f+g,m){let x=0;if(d.eventEnabled){const v=e(d);for(const y of d.events||[]){const S=t.get(y.targetSystemId);if(!S||S.id===u.id)continue;const C=Math.max(0,Number(S.config.delay)||0);x=Math.max(x,(y.event==="birth"?0:v)+C+r(S))}}p+=x}else p+=r(u)}else p=f+r(u);p>a&&(a=p)}for(const u of this.spines){const d=u.animations.find(m=>m.name===u.selectedAnimation);if(!d)continue;const f=Math.max(0,Number(u.timeOffset)||0)+Math.max(0,d.duration||0);f>a&&(a=f)}for(const u of this.colliders){if(!u.followPath||!u.followPathId)continue;const d=Math.max(0,Number(u.followDuration)||0);d>a&&(a=d)}const c=this.timeline.totalFrames,l=Math.max(2,F1(a,s)+1);this.timeline.totalFrames=l;const h=kR({start:this.timeline.playbackStart,end:this.timeline.playbackEnd},c,l);return this.timeline.playbackStart=h.start,this.timeline.playbackEnd=h.end,this.timeline.frame>=l&&(this.timeline.frame=l-1),l}}}),L1="SpineParticle.SystemSettings",B1=1,hf="SpineParticle.SystemSettings.v1";function La(s,e,t,i){const n=Number(s);return Math.min(t,Math.max(e,Number.isFinite(n)?n:i))}function FR(s){return{parameterPanelOnRight:s.parameterPanelOnRight,undoLimit:s.undoLimit,showEmitter:s.showEmitter,showBones:s.showBones,bonePointDrawSize:s.bonePointDrawSize,boneAxisDrawSize:s.boneAxisDrawSize,showSkinMesh:s.showSkinMesh,tickEnabled:s.tickEnabled,axisFontSize:s.axisFontSize,tickWidth:s.tickWidth,showAxisLabels:s.showAxisLabels,axisColor:s.axisColor}}function OR(s,e){const t=n=>s[n]==null?!!e[n]:s[n]===!0,i=typeof s.axisColor=="string"&&/^#[0-9a-f]{6}$/i.test(s.axisColor)?s.axisColor:e.axisColor;return{parameterPanelOnRight:t("parameterPanelOnRight"),undoLimit:Math.round(La(s.undoLimit,1,200,e.undoLimit)),showEmitter:t("showEmitter"),showBones:t("showBones"),bonePointDrawSize:La(s.bonePointDrawSize,.1,10,e.bonePointDrawSize),boneAxisDrawSize:La(s.boneAxisDrawSize,.1,10,e.boneAxisDrawSize),showSkinMesh:t("showSkinMesh"),tickEnabled:t("tickEnabled"),axisFontSize:Math.round(La(s.axisFontSize,8,40,e.axisFontSize)),tickWidth:La(s.tickWidth,1,5,e.tickWidth),showAxisLabels:t("showAxisLabels"),axisColor:i}}function LR(s){let e;try{e=JSON.parse(s)}catch{throw new Error("系统设置缓存不是有效的 JSON")}const t=e;if(t.format!==L1)throw new Error("不是 Spine粒子编辑器系统设置缓存");if(t.version!==B1)throw new Error(`暂不支持系统配置版本:${t.version??"未知"}`);if(!t.settings||typeof t.settings!="object")throw new Error("系统设置缓存缺少 settings");return t}function BR(s,e){Object.assign(s.settings,OR(e,s.settings))}let bc=null;function NR(s){bc==null||bc();try{const e=localStorage.getItem(hf);e&&BR(s,LR(e).settings)}catch{try{localStorage.removeItem(hf)}catch{}}bc=ai(()=>FR(s.settings),e=>{const t={format:L1,version:B1,savedAt:new Date().toISOString(),settings:e};try{localStorage.setItem(hf,JSON.stringify(t))}catch{}},{deep:!0})}function DR(s,e=0){if(s<=0)return 1;const t=Math.pow(10,Math.floor(Math.log10(s))),i=[1,2,5,10,20,50,100];let n=1;for(const r of i)if(r*t>=s){n=r*t;break}return Math.max(n,e)}function UR(s,e,t,i,n){if(!t)return;const r=t;r.clear();const o=s.settings;if(!o.tickEnabled){for(const b of n)b.visible=!1;return}const a=0,c=0,l=e.screen.width/s.editor.viewScale,h=e.screen.height/s.editor.viewScale,u=+("0x"+o.axisColor.replace("#",""));r.lineStyle(1.5,u,.35),r.moveTo(-l,c),r.lineTo(l,c),r.moveTo(a,-h),r.lineTo(a,h);const d=s.editor.viewScale,f=DR(50/d),m=l,p=h,g=Math.max(1,o.tickWidth);if(o.tickEnabled){for(let b=0;b<=l;b+=f){const _=Math.round(b/f)*f;_!==0&&(r.lineStyle(g,u,.25),r.moveTo(_,c-4),r.lineTo(_,c+4),r.moveTo(-_,c-4),r.lineTo(-_,c+4))}for(let b=0;b<=h;b+=f)Math.round(b/f)*f!==0&&(r.lineStyle(g,u,.25),r.moveTo(a-4,b),r.lineTo(a+4,b),r.moveTo(a-4,-b),r.lineTo(a+4,-b))}const x=e.screen.width/2+s.editor.viewX,v=e.screen.height*.5+s.editor.viewY,y=o.axisFontSize,S=+("0x"+o.axisColor.replace("#",""));for(;n.length<64;){const b=new Tp("",{fontFamily:"monospace",fontSize:y,fill:S});b.anchor.set(.5,.5),i.addChild(b),n.push(b)}let C=0;const w=o.showAxisLabels&&o.tickEnabled;for(let b=0;b<=l;b+=f){const _=Math.round(b/f)*f;if(_===0||!w||_>m)continue;const A=n[C++];if(!A)break;A.style.fontSize=y,A.text=String(_),A.position.set(x+_*d,v+9),A.visible=!0;const P=n[C++];if(!P)break;P.style.fontSize=y,P.text=String(-_),P.position.set(x-_*d,v+9),P.visible=!0}for(let b=0;b<=h;b+=f){const _=Math.round(b/f)*f;if(_===0||!w||_>p)continue;const A=n[C++];if(!A)break;A.style.fontSize=y,A.text=String(_),A.position.set(x+8,v-b*d),A.visible=!0;const P=n[C++];if(!P)break;P.style.fontSize=y,P.text=String(-_),P.position.set(x+8,v+b*d),P.visible=!0}for(;Cv.id===s.activeId);if(!n||n.visible===!1)return;const r=n.config;if(!r.showShape)return;const o=e.get(n.id),a=(o==null?void 0:o.x)??r.centerX??0,c=-((o==null?void 0:o.y)??r.centerY??0),l=r.shape;if(l==="point"||l==="path")return;const h=r.rootScaleX??1,u=r.rootScaleY??1,d=-((o==null?void 0:o.rotation)??r.rootRotation??0)*Math.PI/180,f=Math.cos(d),m=Math.sin(d),p=r.offsetX??0,g=r.offsetY??0,x=(v,y)=>{const S=v+p,C=-y-g,w=S*h,b=C*u;return[a+w*f-b*m,c+(w*m+b*f)]};if(l==="circle"){const v=vh(r.innerRadius,r.outerRadius);i.lineStyle(2,3991658,.7);const y=48;for(const S of[v.outer,v.inner])if(!(S<=0))for(let C=0;C<=y;C++){const w=C/y*Math.PI*2,[b,_]=x(Math.cos(w)*S,Math.sin(w)*S);C===0?i.moveTo(b,_):i.lineTo(b,_)}}else if(l==="rect"){const v=_1(r);i.lineStyle(2,4885759,.7);for(const[y,S]of[[v.outerW,v.outerH],[v.innerW,v.innerH]]){if(y<=0||S<=0)continue;const C=y/2,w=S/2,b=x(-C,-w),_=x(C,-w),A=x(C,w),P=x(-C,w);i.moveTo(b[0],b[1]),i.lineTo(_[0],_[1]),i.lineTo(A[0],A[1]),i.lineTo(P[0],P[1]),i.lineTo(b[0],b[1])}}else if(l==="cone"){const v=vh(r.innerRadius,r.outerRadius),y=r.coneAngle/2*Math.PI/180,S=r.coneDirection*Math.PI/180,C=x(Math.cos(S-y)*v.inner,Math.sin(S-y)*v.inner),w=x(Math.cos(S+y)*v.inner,Math.sin(S+y)*v.inner),b=x(Math.cos(S-y)*v.outer,Math.sin(S-y)*v.outer),_=x(Math.cos(S+y)*v.outer,Math.sin(S+y)*v.outer);i.lineStyle(2,3991658,.7),i.moveTo(C[0],C[1]),i.lineTo(b[0],b[1]),i.moveTo(w[0],w[1]),i.lineTo(_[0],_[1]),i.lineStyle(1,3991658,.5);const A=24;for(const P of[v.outer,v.inner])if(!(P<=0))for(let E=0;E<=A;E++){const R=S-y+2*y*E/A,[O,U]=x(Math.cos(R)*P,Math.sin(R)*P);E===0?i.moveTo(O,U):i.lineTo(O,U)}}}function VR(s,e){if(!e)return;const t=e;t.clear();const i=s.systems.find(c=>c.id===s.activeId);if((i==null?void 0:i.visible)===!1)return;const n=i==null?void 0:i.config;if(!(n!=null&&n.forceField)||!n.showForceFieldShape||n.forceRadius<=0)return;const r=n.forceCenterX,o=-n.forceCenterY,a=n.forceStrength>=0?5818367:16739194;t.lineStyle(2,a,.85),t.beginFill(a,.08),t.drawCircle(r,o,n.forceRadius),t.endFill(),t.lineStyle(1,a,.7),t.moveTo(r-9,o),t.lineTo(r+9,o),t.moveTo(r,o-9),t.lineTo(r,o+9),t.beginFill(a,.95),t.drawCircle(r,o,4),t.endFill()}function YR(s,e){if(!e)return;const t=e;t.clear();const i=s.systems.find(u=>u.id===s.activeId);if((i==null?void 0:i.visible)===!1)return;const n=i==null?void 0:i.config;if(!(n!=null&&n.vortex)||!n.showVortexShape||n.vortexRadius<=0)return;const r=n.vortexCenterX,o=-n.vortexCenterY,a=n.vortexStrength>=0?12156159:16753228;t.lineStyle(2,a,.9),t.beginFill(a,.07),t.drawCircle(r,o,n.vortexRadius),t.endFill(),t.beginFill(a,.95),t.drawCircle(r,o,4),t.endFill();const c=r+Math.min(n.vortexRadius*.65,50),l=n.vortexStrength>=0?-1:1,h=o+l*14;t.lineStyle(2,a,.9),t.moveTo(c,o+l*-8),t.lineTo(c,h),t.moveTo(c,h),t.lineTo(c-4,h-l*5),t.moveTo(c,h),t.lineTo(c+4,h-l*5)}function GR(s,e){if(!e)return;const t=e;t.clear();const i=s.systems.find(l=>l.id===s.activeId);if((i==null?void 0:i.visible)===!1)return;const n=i==null?void 0:i.config;if(!(n!=null&&n.attraction)||!n.showAttractionShape)return;const r=n.attractionCenterX,o=-n.attractionCenterY,a=Math.max(0,n.attractionRadius),c=16731487;a>0&&(t.lineStyle(2,c,.95),t.beginFill(c,.09),t.drawCircle(r,o,a),t.endFill()),t.lineStyle(1,c,.85),t.moveTo(r-10,o),t.lineTo(r+10,o),t.moveTo(r,o-10),t.lineTo(r,o+10),t.beginFill(c,1),t.drawCircle(r,o,a>0?4:6),t.endFill()}function jR(s,e,t){const i=s.rotation*Math.PI/180,n=Math.cos(i),r=Math.sin(i),o=Math.max(1e-4,Math.abs(s.scaleX??1)),a=Math.max(1e-4,Math.abs(s.scaleY??1));return{x:s.x+n*e*o-r*t*a,y:s.y+r*e*o+n*t*a}}function Ro(s,e,t){const i=s.rotation*Math.PI/180,n=Math.cos(i),r=Math.sin(i),o=Math.max(1e-4,Math.abs(s.scaleX??1)),a=Math.max(1e-4,Math.abs(s.scaleY??1)),c=e-s.x,l=t-s.y;return{x:(n*c+r*l)/o,y:(-r*c+n*l)/a}}function N1(s,e,t="linear"){if(!s.length)return e;const i=[...s].sort((n,r)=>n.x-r.x);if(e<=i[0].x)return i[0].y;for(let n=1;nl.id===a.emitterFollowSpineId);!c||c.visible===!1||n.set(`${a.emitterFollowSpineId}:${a.emitterFollowBoneName}`,{spineId:a.emitterFollowSpineId,boneName:a.emitterFollowBoneName})}for(const o of n.values()){const a=e==null?void 0:e.getBoneWorldTransform(o.spineId,o.boneName);if(!a)continue;const c=a.x,l=-a.y;i.lineStyle(2,12881151,.95),i.beginFill(12881151,.2),i.drawCircle(c,l,8),i.endFill(),i.beginFill(15919103,1),i.drawCircle(c,l,3.5),i.endFill()}}function WR(s,e,t){if(!t)return;const i=t;if(i.clear(),!s.value)return;const n=e();if(!n)return;const r=n.x,o=-n.y,a=n.scaleX,c=n.scaleY,l=-n.rotation*Math.PI/180,h=Math.cos(l),u=Math.sin(l),d=(p,g)=>{const x=p*a,v=-g*c;return[r+x*h-v*u,o+(x*u+v*h)]},f=(p,g,x,v)=>{const y=d(p,g),S=d(x,v);i.moveTo(y[0],y[1]),i.lineTo(S[0],S[1])},m=26;if(i.lineStyle(2,3526911,.9),i.beginFill(3526911,.25),i.drawCircle(r,o,6),i.endFill(),s.value==="translate")i.lineStyle(2,3526911,.9),f(-m,0,m,0),f(0,-m,0,m),f(m-6,-4,m,0),f(m,0,m-6,4),f(-20,-4,-m,0),f(-m,0,-20,4),f(-4,m-6,0,m),f(0,m,4,m-6),f(-4,-20,0,-m),f(0,-m,4,-20);else if(s.value==="rotate"){i.lineStyle(2,3526911,.8);const p=48;for(let v=0;v<=p;v++){const y=v/p*Math.PI*2,[S,C]=d(Math.cos(y)*m,Math.sin(y)*m);v===0?i.moveTo(S,C):i.lineTo(S,C)}const[g,x]=d(0,m);i.beginFill(3526911,.95),i.drawCircle(g,x,4),i.endFill()}else if(s.value==="scale"){i.lineStyle(2,3526911,.9);const g=[[-m,-m],[m,-m],[m,m],[-m,m]].map(([x,v])=>d(x,v));i.moveTo(g[0][0],g[0][1]),i.lineTo(g[1][0],g[1][1]),i.lineTo(g[2][0],g[2][1]),i.lineTo(g[3][0],g[3][1]),i.lineTo(g[0][0],g[0][1]),i.beginFill(3526911,.9);for(const x of g)i.drawRect(x[0]-3,x[1]-3,6,6);i.endFill()}}function zR(s,e=16777215){const t=Number.parseInt(s.replace("#",""),16);return Number.isFinite(t)?t:e}function qR(s,e,t){if(!t)return;const i=t;i.clear();for(const n of e){if(n.visible===!1)continue;const r=s.activeObjectType==="collision"&&s.activeObjectId===n.id,o=n.enabled?r?16735858:13911899:5792116,a=n.rotation*Math.PI/180,c=Math.cos(a),l=Math.sin(a),h=Math.max(1e-4,Math.abs(n.scaleX??1)),u=Math.max(1e-4,Math.abs(n.scaleY??1)),d=(p,g)=>({x:n.x+c*p*h-l*g*u,y:-(n.y+l*p*h+c*g*u)});let f=[];if(n.shape==="circle"||n.shape==="ellipse"){const p=n.shape==="circle"?n.radius:n.radiusX,g=n.shape==="circle"?n.radius:n.radiusY;f=Array.from({length:49},(x,v)=>{const y=v/48*Math.PI*2;return d(Math.cos(y)*p,Math.sin(y)*g)})}else if(n.shape==="rect"){const p=n.width*.5,g=n.height*.5;f=[d(-p,-g),d(p,-g),d(p,g),d(-p,g),d(-p,-g)]}else{const p=Math.max(3,Math.min(16,Math.round(n.sides)));f=Array.from({length:p+1},(g,x)=>{const v=Math.PI*.5+x%p/p*Math.PI*2;return d(Math.cos(v)*n.width*.5,Math.sin(v)*n.height*.5)})}if(!f.length)continue;i.lineStyle(r?2.5:1.5,o,n.enabled?.95:.45),i.beginFill(o,r?.12:.055),i.moveTo(f[0].x,f[0].y);for(let p=1;po.id===s.activeObjectId):null,r=(n==null?void 0:n.config.shape)==="path"&&!n.config.showShape?n.config.spawnPathId:0;for(const o of s.paths){if(o.id===r||o.visible===!1||!o.enabled||!o.points.length)continue;const a=s.activeObjectType==="path"&&s.activeObjectId===o.id,c=zR(o.color,16749374),l=(f,m)=>{const p=jR(o,f,m);return{x:p.x,y:-p.y}},h=o.points[0],u=l(h.x,h.y);i.lineStyle(a?2.5:1.8,c,a?1:.75),i.moveTo(u.x,u.y);const d=o.closed?o.points.length:o.points.length-1;for(let f=0;f{const p=l(f.x,f.y),g=l(f.x+f.inX,f.y+f.inY),x=l(f.x+f.outX,f.y+f.outY),v=Math.hypot(f.inX,f.inY)>.01,y=Math.hypot(f.outX,f.outY)>.01;i.lineStyle(1,11121867,.65),v&&(i.moveTo(p.x,p.y),i.lineTo(g.x,g.y)),y&&(i.moveTo(p.x,p.y),i.lineTo(x.x,x.y)),v&&(i.beginFill(14015724,.95),i.drawCircle(g.x,g.y,3),i.endFill()),y&&(i.beginFill(14015724,.95),i.drawCircle(x.x,x.y,3),i.endFill()),i.beginFill(e.has(m)?16777215:c,1),i.lineStyle(1.5,e.has(m)?6126847:16777215,.95),i.drawCircle(p.x,p.y,e.has(m)?5:4),i.endFill()})}}function ZR(s,e,t,i){var o;const n=Number.isFinite(e.worldX)&&Number.isFinite(e.worldY),r=Number.isFinite(e.worldRotation);s.push({boneName:e.boneName,x:n?e.worldX:e.x,y:n?-e.worldY:e.y,rotation:r?-e.worldRotation:-e.rotation,parentX:t,parentY:i}),(o=e.trailState)!=null&&o.bones.length&&e.trailState.bones.forEach(a=>{const c=Number.isFinite(a.worldX)&&Number.isFinite(a.worldY),l=Number.isFinite(a.worldRotation);s.push({boneName:a.boneName,x:c?a.worldX:a.x,y:c?-a.worldY:a.y,rotation:l?-a.worldRotation:a.rotation,parentX:t,parentY:i,trail:!0})})}function Yv(s,e,t,i,n,r,o,a){const c=r*.62,l=e+i*r,h=t+n*r,u=Math.max(2.5,r*.32),d=Math.max(1.7,r*.22),f=l-i*u,m=h-n*u,p=-n,g=i;s.lineStyle(o,a,.95),s.moveTo(e-i*c,t-n*c),s.lineTo(f,m),s.lineStyle(0),s.beginFill(a,.95),s.drawPolygon([l,h,f+p*d,m+g*d,f-p*d,m-g*d]),s.endFill()}function JR(s,e,t){if(!t)return;const i=t;if(i.clear(),!e.settings.showBones)return;const n=0,r=0,o=Math.max(.25,Math.abs(e.editor.viewScale)||1),a=Math.min(10,Math.max(.1,Number(e.settings.bonePointDrawSize)||1)),c=Math.min(10,Math.max(.1,Number(e.settings.boneAxisDrawSize)||2)),l=2.5*a/o,h=4.5*c/o,u=Math.max(.65,c*.625)/o;for(const d of s){const f=d.trail?16731533:16747610;i.lineStyle(1,f,d.trail?.65:.35),i.moveTo(d.parentX??n,d.parentY??r),i.lineTo(d.x,d.y);const m=d.rotation*Math.PI/180,p=Math.cos(m),g=Math.sin(m);Yv(i,d.x,d.y,p,g,h,u,15684432),Yv(i,d.x,d.y,g,-p,h,u,5622123),i.beginFill(f,.9),i.drawCircle(d.x,d.y,l),i.endFill()}}function Ii(s){return s.map(e=>({...e,trailState:e.trailState?{...e.trailState,bones:e.trailState.bones.map(t=>({...t}))}:void 0}))}function QR(s){const e=new Map;for(const i of s)for(const n of i)e.has(n.boneName)||e.set(n.boneName,Ii([n])[0]);const t=[...e.keys()].sort((i,n)=>{const r=Number(i.replace(/^p_/,"")),o=Number(n.replace(/^p_/,""));return Number.isFinite(r)&&Number.isFinite(o)?r-o:i.localeCompare(n)});for(let i=0;i[r.boneName,r]));s[i]=t.map(r=>{const o=n.get(r);return o||{...Ii([e.get(r)])[0],alpha:0,imageVisible:!1,trailState:void 0,active:!0}})}}function eP(s){s.length<2||(s[s.length-1]=Ii(s[0]))}function tP(s,e){const t=Math.max(0,s.length-1),i=[];for(let n=0;n<=e;n++){const r=Math.min(t,Math.round(n/e*t));i.push(Ii(s[r]||[]))}return i}function uf(s){return`${s.boneName}:${s.spawnId??"legacy"}`}function Gv(s){return{...Ii([s])[0],alpha:0,imageVisible:!1,trailState:void 0,active:!0}}function iP(s,e,t,i){const n=Math.min(s.length,i+1),r=s.slice(Math.max(0,s.length-n)),o=new Map;for(const l of e){if(l.imageVisible===!1||l.alpha<=0)continue;const h=uf(l),u=new Map;let d=!1;for(let f=r.length-1;f>=0;f--){const m=r[f].find(p=>uf(p)===h);if(m)d=!0,u.set(f,m);else if(d)break}o.set(h,u)}const a=Math.max(0,r.length-1),c=[];for(let l=0;l<=t;l++){const h=Math.min(a,Math.round(l/t*a));c.push(e.map(u=>{var f;if(u.imageVisible===!1||u.alpha<=0)return Ii([u])[0];const d=(f=o.get(uf(u)))==null?void 0:f.get(h);return d?Ii([d])[0]:Gv(u)}))}return c[0]=c[0].map(Gv),c[c.length-1]=Ii(e),c}function jv(s,e){const t=s.length?1:0;for(let i=t;i{const y=v?[[]]:[];e.reset();for(let S=0;S0&&e.restartEmissionCycle();for(let C=0;C0;S++)e.update(r,"off"),v.push(e.capture());(x=v[v.length-1])!=null&&x.length&&v.push([]),jv(u,tP(v,a.end))}const g=Ii(u[u.length-1]||[]);for(u.length>i&&(u.length=i);u.length{var a;return String(((a=o==null?void 0:o.data)==null?void 0:a.name)||"")}):null}catch{return null}}getSlotLocalMatrix(e,t){var o,a,c;const i=(o=this.entries.get(e))==null?void 0:o.spine,n=(c=(a=i==null?void 0:i.skeleton)==null?void 0:a.findSlot)==null?void 0:c.call(a,t),r=n==null?void 0:n.bone;return r!=null&&r.active?new Ft(r.a,r.c,-r.b,-r.d,r.worldX,r.worldY):null}getSlotParentMatrix(e,t,i){const n=this.getSlotLocalMatrix(e,t);if(!n)return null;const r=-i.rotation*Math.PI/180,o=Math.cos(r),a=Math.sin(r);return new Ft(o*i.scaleX,a*i.scaleX,-a*i.scaleY,o*i.scaleY,i.x,-i.y).append(n)}attachSlotObject(e,t,i,n){var o;const r=(o=this.entries.get(e))==null?void 0:o.spine;if(!(r!=null&&r.addSlotObject))return!1;try{return r.addSlotObject(t,i,{followAttachmentTimeline:n}),!0}catch{return!1}}detachSlotObject(e,t,i){var r,o;const n=(r=this.entries.get(e))==null?void 0:r.spine;try{(o=n==null?void 0:n.removeSlotObject)==null||o.call(n,t,i)}catch{}}destroyEntry(e){var t,i;try{(i=(t=e.spine)==null?void 0:t.removeSlotObjects)==null||i.call(t)}catch{}this.container.removeChild(e.root),e.root.destroy({children:!0})}sync(e,t,i){var n;for(const[r,o]of this.entries)e.some(a=>a.id===r)||(this.destroyEntry(o),this.entries.delete(r));for(const r of e){const o=ER(r.id);let a=this.entries.get(r.id);if(a&&a.assetVersion!==r.assetVersion&&!o&&(this.destroyEntry(a),this.entries.delete(r.id),a=void 0),(!a||a.assetVersion!==r.assetVersion)&&o){a&&this.destroyEntry(a);const d=new gi,f=new o.SpineClass({skeletonData:o.skeletonData,autoUpdate:!1,darkTint:!1});o.skeletonData.defaultSkin&&f.skeleton.setSkin(o.skeletonData.defaultSkin),o.runtimeVersion==="4.3"?f.skeleton.setupPoseSlots():f.skeleton.setSlotsToSetupPose(),d.addChild(f),this.container.addChild(d),a={root:d,spine:f,runtimeVersion:o.runtimeVersion,assetVersion:r.assetVersion,animation:""},this.entries.set(r.id,a)}if(!a)continue;const c=a.root,l=a.spine,h=r.visible!==!1&&r.enabled;c.visible=h,c.renderable=h,c.position.set(r.x,-r.y),c.rotation=-r.rotation*Math.PI/180,c.scale.set(r.scaleX,r.scaleY),a.animation!==r.selectedAnimation&&(a.animation=r.selectedAnimation,a.runtimeVersion==="4.3"?l.skeleton.setupPose():l.skeleton.setToSetupPose(),l.state.clearTracks(),a.animation&&l.state.setAnimation(0,a.animation,!1));const u=a.runtimeVersion==="4.3"?l.state.getTrack(0):l.state.getCurrent(0);if(u){const d=((n=r.animations.find(m=>m.name===r.selectedAnimation))==null?void 0:n.duration)||0,f=Math.max(0,t/Math.max(1,i)-r.timeOffset);u.trackTime=d>0?Math.min(f,d):f}l.update(0)}}getBoneWorldTransform(e,t){const i=this.entries.get(e),n=i==null?void 0:i.spine.skeleton.findBone(t);if(!i||!n||!n.active)return null;const r=i.runtimeVersion==="4.3"?n.appliedPose:n,o=i.root,a=Math.cos(o.rotation),c=Math.sin(o.rotation),l=a*o.scale.x,h=-c*o.scale.y,u=c*o.scale.x,d=a*o.scale.y,f=l*r.a+h*r.c,m=l*r.b+h*r.d,p=u*r.a+d*r.c,g=u*r.b+d*r.d,x=o.position.x+l*r.worldX+h*r.worldY,v=o.position.y+u*r.worldX+d*r.worldY;return{x,y:-v,rotation:-Math.atan2(p,f)*180/Math.PI,scaleX:Math.max(1e-4,Math.hypot(f,p)),scaleY:Math.max(1e-4,Math.hypot(m,g))}}destroy(){for(const e of this.entries.values())this.destroyEntry(e);this.entries.clear(),this.container.removeFromParent(),this.container.destroy({children:!0})}}let D1=class{constructor(){M(this,"entries",{});M(this,"size",0)}add(e){let t=this.entries[e];return this.entries[e]=!0,t?!1:(this.size++,!0)}addAll(e){let t=this.size;for(var i=0,n=e.length;i1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(e,t){e.r=((t&4278190080)>>>24)/255,e.g=((t&16711680)>>>16)/255,e.b=((t&65280)>>>8)/255,e.a=(t&255)/255}static rgb888ToColor(e,t){e.r=((t&16711680)>>>16)/255,e.g=((t&65280)>>>8)/255,e.b=(t&255)/255}toRgb888(){const e=t=>("0"+(t*255).toString(16)).slice(-2);return+("0x"+e(this.r)+e(this.g)+e(this.b))}static fromString(e,t=new Ai){return t.setFromString(e)}},M(Ai,"WHITE",new Ai(1,1,1,1)),M(Ai,"RED",new Ai(1,0,0,1)),M(Ai,"GREEN",new Ai(0,1,0,1)),M(Ai,"BLUE",new Ai(0,0,1,1)),M(Ai,"MAGENTA",new Ai(1,0,1,1)),Ai);var ii;let Re=(ii=class{static clamp(e,t,i){return ei?i:e}static cosDeg(e){return Math.cos(e*ii.degRad)}static sinDeg(e){return Math.sin(e*ii.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*ii.degRad}static signum(e){return e>0?1:e<0?-1:0}static toInt(e){return e>0?Math.floor(e):Math.ceil(e)}static cbrt(e){let t=Math.pow(Math.abs(e),.3333333333333333);return e<0?-t:t}static randomTriangular(e,t){return ii.randomTriangularWith(e,t,(e+t)*.5)}static randomTriangularWith(e,t,i){let n=Math.random(),r=t-e;return n<=(i-e)/r?e+Math.sqrt(n*r*(i-e)):t-Math.sqrt((1-n)*r*(t-i))}static isPowerOfTwo(e){return e&&(e&e-1)===0}},M(ii,"PI",3.1415927),M(ii,"PI2",ii.PI*2),M(ii,"invPI2",1/ii.PI2),M(ii,"radiansToDegrees",180/ii.PI),M(ii,"radDeg",ii.radiansToDegrees),M(ii,"degreesToRadians",ii.PI/180),M(ii,"degRad",ii.degreesToRadians),ii);var Is;let Pe=(Is=class{static arrayCopy(e,t,i,n,r){for(let o=t,a=n;o=t?e:Is.setArraySize(e,t,i)}static newArray(e,t){let i=new Array(e);for(let n=0;n0?this.items.pop():this.instantiator()}free(e){e.reset&&e.reset(),this.items.push(e)}freeAll(e){for(let t=0;t>1)*a;let c=t.bone.skeleton,l=t.deform,h=this.vertices,u=this.bones;if(!u){l.length>0&&(h=l);let p=t.bone,g=p.worldX,x=p.worldY,v=p.a,y=p.b,S=p.c,C=p.d;for(let w=i,b=o;b=this.regions.length&&(i=this.regions.length-1);let n=this.regions[i];t.region!=n&&(t.region=n,t.updateRegion())}getPath(e,t){let i=e,n=(this.start+t).toString();for(let r=this.digits-n.length;r>0;r--)i+="0";return i+=n,i}static nextID(){return Nn._nextID++}},M(Nn,"_nextID",0),Nn);var Ti;(function(s){s[s.hold=0]="hold",s[s.once=1]="once",s[s.loop=2]="loop",s[s.pingpong=3]="pingpong",s[s.onceReverse=4]="onceReverse",s[s.loopReverse=5]="loopReverse",s[s.pingpongReverse=6]="pingpongReverse"})(Ti||(Ti={}));const X1=[Ti.hold,Ti.once,Ti.loop,Ti.pingpong,Ti.onceReverse,Ti.loopReverse,Ti.pingpongReverse];let Cp=class{constructor(e,t,i){M(this,"name");M(this,"timelines",[]);M(this,"timelineIds",new D1);M(this,"duration");if(!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(t),this.duration=i}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e,this.timelineIds.clear();for(var t=0;t0&&(t%=this.duration));let l=this.timelines;for(let h=0,u=l.length;ht)return n-1;return i-1}static search(e,t,i){let n=e.length;for(let r=i;rt)return r-i;return n-i}},pn=class extends Yt{constructor(t,i,n){super(t,n);M(this,"curves");this.curves=Pe.newFloatArray(t+i*18),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let i=this.getFrameCount()+t*18;if(this.curves.length>i){let n=Pe.newFloatArray(i);Pe.arrayCopy(this.curves,0,n,0,i),this.curves=n}}setBezier(t,i,n,r,o,a,c,l,h,u,d){let f=this.curves,m=this.getFrameCount()+t*18;n==0&&(f[i]=2+m);let p=(r-a*2+l)*.03,g=(o-c*2+h)*.03,x=((a-l)*3-r+u)*.006,v=((c-h)*3-o+d)*.006,y=p*2+x,S=g*2+v,C=(a-r)*.3+p+x*.16666667,w=(c-o)*.3+g+v*.16666667,b=r+C,_=o+w;for(let A=m+18;mt){let h=this.frames[i],u=this.frames[i+n];return u+(t-h)/(o[r]-h)*(o[r+1]-u)}let a=r+18;for(r+=2;r=t){let h=o[r-2],u=o[r-1];return u+(t-h)/(o[r]-h)*(o[r+1]-u)}i+=this.getFrameEntries();let c=o[a-2],l=o[a-1];return l+(t-c)/(this.frames[i]-c)*(this.frames[i+n]-l)}},Us=class extends pn{constructor(e,t,i){super(e,t,[i])}getFrameEntries(){return 2}setFrame(e,t,i){e<<=1,this.frames[e]=t,this.frames[e+1]=i}getCurveValue(e){let t=this.frames,i=t.length-2;for(let r=2;r<=i;r+=2)if(t[r]>e){i=r-2;break}let n=this.curves[i>>1];switch(n){case 0:let r=t[i],o=t[i+1];return o+(e-r)/(t[i+2]-r)*(t[i+2+1]-o);case 1:return t[i+1]}return this.getBezierValue(e,i,1,n-2)}getRelativeValue(e,t,i,n,r){if(e>2];switch(g){case 0:let x=h[p];d=h[p+1],f=h[p+2],m=h[p+3];let v=(n-x)/(h[p+4]-x);d+=(h[p+4+1]-d)*v,f+=(h[p+4+2]-f)*v,m+=(h[p+4+3]-m)*v;break;case 1:d=h[p+1],f=h[p+2],m=h[p+3];break;default:d=this.getBezierValue(n,p,1,g-2),f=this.getBezierValue(n,p,2,g+18-2),m=this.getBezierValue(n,p,3,g+36-2)}if(o==1)u.r=d,u.g=f,u.b=m;else{if(a==ye.setup){let x=l.data.color;u.r=x.r,u.g=x.g,u.b=x.b}u.r+=(d-u.r)*o,u.g+=(f-u.g)*o,u.b+=(m-u.b)*o}}},ew=class extends Us{constructor(t,i,n){super(t,i,ht.alpha+"|"+n);M(this,"slotIndex",0);this.slotIndex=n}apply(t,i,n,r,o,a,c){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=l.color;if(n>3];switch(C){case 0:let w=h[S];f=h[S+1],m=h[S+2],p=h[S+3],g=h[S+4],x=h[S+5],v=h[S+6],y=h[S+7];let b=(n-w)/(h[S+8]-w);f+=(h[S+8+1]-f)*b,m+=(h[S+8+2]-m)*b,p+=(h[S+8+3]-p)*b,g+=(h[S+8+4]-g)*b,x+=(h[S+8+5]-x)*b,v+=(h[S+8+6]-v)*b,y+=(h[S+8+7]-y)*b;break;case 1:f=h[S+1],m=h[S+2],p=h[S+3],g=h[S+4],x=h[S+5],v=h[S+6],y=h[S+7];break;default:f=this.getBezierValue(n,S,1,C-2),m=this.getBezierValue(n,S,2,C+18-2),p=this.getBezierValue(n,S,3,C+36-2),g=this.getBezierValue(n,S,4,C+54-2),x=this.getBezierValue(n,S,5,C+72-2),v=this.getBezierValue(n,S,6,C+90-2),y=this.getBezierValue(n,S,7,C+108-2)}if(o==1)u.set(f,m,p,g),d.r=x,d.g=v,d.b=y;else{if(a==ye.setup){u.setFromColor(l.data.color);let w=l.data.darkColor;d.r=w.r,d.g=w.g,d.b=w.b}u.add((f-u.r)*o,(m-u.g)*o,(p-u.b)*o,(g-u.a)*o),d.r+=(x-d.r)*o,d.g+=(v-d.g)*o,d.b+=(y-d.b)*o}}},iw=class extends pn{constructor(t,i,n){super(t,i,[ht.rgb+"|"+n,ht.rgb2+"|"+n]);M(this,"slotIndex",0);this.slotIndex=n}getFrameEntries(){return 7}setFrame(t,i,n,r,o,a,c,l){t*=7,this.frames[t]=i,this.frames[t+1]=n,this.frames[t+2]=r,this.frames[t+3]=o,this.frames[t+4]=a,this.frames[t+5]=c,this.frames[t+6]=l}apply(t,i,n,r,o,a,c){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=this.frames,u=l.color,d=l.darkColor;if(nt){let l=this.frames[i];return n[r+1]*(t-l)/(n[r]-l)}let o=r+18;for(r+=2;r=t){let l=n[r-2],h=n[r-1];return h+(t-l)/(n[r]-l)*(n[r+1]-h)}let a=n[o-2],c=n[o-1];return c+(1-c)*(t-a)/(this.frames[i+this.getFrameEntries()]-a)}apply(t,i,n,r,o,a,c){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=l.getAttachment();if(!h||!(h instanceof zn)||h.timelineAttachment!=this.attachment)return;let u=l.deform;u.length==0&&(a=ye.setup);let d=this.vertices,f=d[0].length,m=this.frames;if(n=m[m.length-1]){let S=d[m.length-1];if(o==1)if(a==ye.add){let C=h;if(C.bones)for(let w=0;wn)this.apply(t,i,Number.MAX_VALUE,r,o,a,c),i=-1;else if(i>=l[h-1])return;if(n0&&l[u-1]==d;)u--}for(;u=l[u];u++)r.push(this.events[u])}},M(eo,"propertyIds",[""+ht.event]),eo);var to;let el=(to=class extends Yt{constructor(t){super(t,to.propertyIds);M(this,"drawOrders");this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,i,n){this.frames[t]=i,this.drawOrders[t]=n}apply(t,i,n,r,o,a,c){if(c==ki.mixOut){a==ye.setup&&Pe.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}if(n>2];switch(p){case 0:let g=h[m];u=h[m+1],d=h[m+2],f=h[m+3];let x=(n-g)/(h[m+4]-g);u+=(h[m+4+1]-u)*x,d+=(h[m+4+2]-d)*x,f+=(h[m+4+3]-f)*x;break;case 1:u=h[m+1],d=h[m+2],f=h[m+3];break;default:u=this.getBezierValue(n,m,1,p-2),d=this.getBezierValue(n,m,2,p+18-2),f=this.getBezierValue(n,m,3,p+36-2)}if(a==ye.setup){let g=l.data;l.mixRotate=g.mixRotate+(u-g.mixRotate)*o,l.mixX=g.mixX+(d-g.mixX)*o,l.mixY=g.mixY+(f-g.mixY)*o}else l.mixRotate+=(u-l.mixRotate)*o,l.mixX+=(d-l.mixX)*o,l.mixY+=(f-l.mixY)*o}},xo=class extends Us{constructor(t,i,n,r){super(t,i,r+"|"+n);M(this,"constraintIndex",0);this.constraintIndex=n}apply(t,i,n,r,o,a,c){let l;if(this.constraintIndex==-1){const h=n>=this.frames[0]?this.getCurveValue(n):0;for(const u of t.physicsConstraints)u.active&&this.global(u.data)&&this.set(u,this.getAbsoluteValue2(n,o,a,this.get(u),this.setup(u),h))}else l=t.physicsConstraints[this.constraintIndex],l.active&&this.set(l,this.getAbsoluteValue(n,o,a,this.get(l),this.setup(l)))}},cw=class extends xo{constructor(e,t,i){super(e,t,i,ht.physicsConstraintInertia)}setup(e){return e.data.inertia}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}},hw=class extends xo{constructor(e,t,i){super(e,t,i,ht.physicsConstraintStrength)}setup(e){return e.data.strength}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}},uw=class extends xo{constructor(e,t,i){super(e,t,i,ht.physicsConstraintDamping)}setup(e){return e.data.damping}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}},dw=class extends xo{constructor(e,t,i){super(e,t,i,ht.physicsConstraintMass)}setup(e){return 1/e.data.massInverse}get(e){return 1/e.massInverse}set(e,t){e.massInverse=1/t}global(e){return e.massGlobal}},fw=class extends xo{constructor(e,t,i){super(e,t,i,ht.physicsConstraintWind)}setup(e){return e.data.wind}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}},mw=class extends xo{constructor(e,t,i){super(e,t,i,ht.physicsConstraintGravity)}setup(e){return e.data.gravity}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}},pw=class extends xo{constructor(e,t,i){super(e,t,i,ht.physicsConstraintMix)}setup(e){return e.data.mix}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}};var io;let gw=(io=class extends Yt{constructor(t,i){super(t,io.propertyIds);M(this,"constraintIndex");this.constraintIndex=i}getFrameCount(){return this.frames.length}setFrame(t,i){this.frames[t]=i}apply(t,i,n,r,o,a,c){let l;if(this.constraintIndex!=-1&&(l=t.physicsConstraints[this.constraintIndex],!l.active))return;const h=this.frames;if(i>n)this.apply(t,i,Number.MAX_VALUE,[],o,a,c),i=-1;else if(i>=h[h.length-1])return;if(!(n=h[Yt.search1(h,i)+1]))if(l!=null)l.reset();else for(const u of t.physicsConstraints)u.active&&u.reset()}},M(io,"propertyIds",[ht.physicsConstraintReset.toString()]),io);var Di;let vw=(Di=class extends Yt{constructor(t,i,n){super(t,[ht.sequence+"|"+i+"|"+n.sequence.id]);M(this,"slotIndex");M(this,"attachment");this.slotIndex=i,this.attachment=n}getFrameEntries(){return Di.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,i,n,r,o){let a=this.frames;t*=Di.ENTRIES,a[t]=i,a[t+Di.MODE]=n|r<<4,a[t+Di.DELAY]=o}apply(t,i,n,r,o,a,c){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=l.attachment,u=this.attachment;if(h!=u&&(!(h instanceof zn)||h.timelineAttachment!=u))return;if(c==ki.mixOut){a==ye.setup&&(l.sequenceIndex=-1);return}let d=this.frames;if(n>4,v=this.attachment.sequence.regions.length,y=X1[p&15];if(y!=Ti.hold)switch(x+=(n-m)/g+1e-5|0,y){case Ti.once:x=Math.min(v-1,x);break;case Ti.loop:x%=v;break;case Ti.pingpong:{let S=(v<<1)-2;x=S==0?0:x%S,x>=v&&(x=S-x);break}case Ti.onceReverse:x=Math.max(v-1-x,0);break;case Ti.loopReverse:x=v-1-x%v;break;case Ti.pingpongReverse:{let S=(v<<1)-2;x=S==0?0:(x+v-1)%S,x>=v&&(x=S-x)}}l.sequenceIndex=x}},M(Di,"ENTRIES",3),M(Di,"MODE",1),M(Di,"DELAY",2),Di);var Dn;let nP=(Dn=class{constructor(e){M(this,"data");M(this,"tracks",new Array);M(this,"timeScale",1);M(this,"unkeyedState",0);M(this,"events",new Array);M(this,"listeners",new Array);M(this,"queue",new oP(this));M(this,"propertyIDs",new D1);M(this,"animationsChanged",!1);M(this,"trackEntryPool",new xh(()=>new rP));this.data=e}static emptyAnimation(){return Dn._emptyAnimation}update(e){e*=this.timeScale;let t=this.tracks;for(let i=0,n=t.length;i0){if(r.delay-=o,r.delay>0)continue;o=-r.delay,r.delay=0}let a=r.next;if(a){let c=r.trackLast-a.delay;if(c>=0){for(a.delay=0,a.trackTime+=r.timeScale==0?0:(c/r.timeScale+e)*a.timeScale,r.trackTime+=o,this.setCurrent(i,a,!0);a.mixingFrom;)a.mixTime+=e,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){t[i]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,e)){let c=r.mixingFrom;for(r.mixingFrom=null,c&&(c.mixingTo=null);c;)this.queue.end(c),c=c.mixingFrom}r.trackTime+=o}this.queue.drain()}updateMixingFrom(e,t){let i=e.mixingFrom;if(!i)return!0;let n=this.updateMixingFrom(i,t);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,e.nextTrackLast!=-1&&e.mixTime>=e.mixDuration?((i.totalAlpha==0||e.mixDuration==0)&&(e.mixingFrom=i.mixingFrom,i.mixingFrom!=null&&(i.mixingFrom.mixingTo=e),e.interruptAlpha=i.interruptAlpha,this.queue.end(i)),n):(i.trackTime+=t*i.timeScale,e.mixTime+=t,!1)}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let t=this.events,i=this.tracks,n=!1;for(let d=0,f=i.length;d0)continue;n=!0;let p=d==0?ye.first:m.mixBlend,g=m.alpha;m.mixingFrom?g*=this.applyMixingFrom(m,e,p):m.trackTime>=m.trackEnd&&!m.next&&(g=0);let x=g>=m.alphaAttachmentThreshold,v=m.animationLast,y=m.getAnimationTime(),S=y,C=t;m.reverse&&(S=m.animation.duration-S,C=null);let w=m.animation.timelines,b=w.length;if(d==0&&g==1||p==ye.add){d==0&&(x=!0);for(let _=0;_1&&(r=1),i!=ye.first&&(i=n.mixBlend));let o=r=n.alphaAttachmentThreshold):(a&&C instanceof el&&b==ye.setup&&(w=ki.mixIn),C.apply(t,d,m,p,_,b,w))}}return e.mixDuration>0&&this.queueEvents(n,f),this.events.length=0,n.nextAnimationLast=f,n.nextTrackLast=n.trackTime,r}applyAttachmentTimeline(e,t,i,n,r){var o=t.slots[e.slotIndex];o.bone.active&&(i=0,y=p>=0;Math.abs(g)<=90&&Re.signum(g)!=Re.signum(m)&&(Math.abs(p-x)>180?(f+=360*Re.signum(p),y=v):x!=0?f-=360*Re.signum(p):y=v),y!=v&&(f+=360*Re.signum(p)),o[a]=f}o[a+1]=m,l.rotation=u+f*n}queueEvents(e,t){let i=e.animationStart,n=e.animationEnd,r=n-i,o=e.trackLast%r,a=this.events,c=0,l=a.length;for(;cn||this.queue.event(e,u)}let h=!1;if(e.loop)if(r==0)h=!0;else{const u=Math.floor(e.trackTime/r);h=u>0&&u>Math.floor(e.trackLast/r)}else h=t>=n&&e.animationLast=this.tracks.length)return;let t=this.tracks[e];if(!t)return;this.queue.end(t),this.clearNext(t);let i=t;for(;;){let n=i.mixingFrom;if(!n)break;this.queue.end(n),i.mixingFrom=null,i.mixingTo=null,i=n}this.tracks[t.trackIndex]=null,this.queue.drain()}setCurrent(e,t,i){let n=this.expandToIndex(e);this.tracks[e]=t,t.previous=null,n&&(i&&this.queue.interrupt(n),t.mixingFrom=n,n.mixingTo=t,t.mixTime=0,n.mixingFrom&&n.mixDuration>0&&(t.interruptAlpha*=Math.min(1,n.mixTime/n.mixDuration)),n.timelinesRotation.length=0),this.queue.start(t)}setAnimation(e,t,i=!1){let n=this.data.skeletonData.findAnimation(t);if(!n)throw new Error("Animation not found: "+t);return this.setAnimationWith(e,n,i)}setAnimationWith(e,t,i=!1){if(!t)throw new Error("animation cannot be null.");let n=!0,r=this.expandToIndex(e);r&&(r.nextTrackLast==-1?(this.tracks[e]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,n=!1):this.clearNext(r));let o=this.trackEntry(e,t,i,r);return this.setCurrent(e,o,n),this.queue.drain(),o}addAnimation(e,t,i=!1,n=0){let r=this.data.skeletonData.findAnimation(t);if(!r)throw new Error("Animation not found: "+t);return this.addAnimationWith(e,r,i,n)}addAnimationWith(e,t,i=!1,n=0){if(!t)throw new Error("animation cannot be null.");let r=this.expandToIndex(e);if(r)for(;r.next;)r=r.next;let o=this.trackEntry(e,t,i,r);return r?(r.next=o,o.previous=r,n<=0&&(n=Math.max(n+r.getTrackComplete()-o.mixDuration,0))):(this.setCurrent(e,o,!0),this.queue.drain(),n<0&&(n=0)),o.delay=n,o}setEmptyAnimation(e,t=0){let i=this.setAnimationWith(e,Dn.emptyAnimation(),!1);return i.mixDuration=t,i.trackEnd=t,i}addEmptyAnimation(e,t=0,i=0){let n=this.addAnimationWith(e,Dn.emptyAnimation(),!1,i);return i<=0&&(n.delay=Math.max(n.delay+n.mixDuration-t,0)),n.mixDuration=t,n.trackEnd=t,n}setEmptyAnimations(e=0){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let i=0,n=this.tracks.length;i0){r[c]=aP,o[c]=u;continue e}break}r[c]=ff}}}getCurrent(e){return e>=this.tracks.length?null:this.tracks[e]}addListener(e){if(!e)throw new Error("listener cannot be null.");this.listeners.push(e)}removeListener(e){let t=this.listeners.indexOf(e);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},M(Dn,"_emptyAnimation",new Cp("",[],0)),Dn),rP=class{constructor(){M(this,"animation",null);M(this,"previous",null);M(this,"next",null);M(this,"mixingFrom",null);M(this,"mixingTo",null);M(this,"listener",null);M(this,"trackIndex",0);M(this,"loop",!1);M(this,"holdPrevious",!1);M(this,"reverse",!1);M(this,"shortestRotation",!1);M(this,"eventThreshold",0);M(this,"mixAttachmentThreshold",0);M(this,"alphaAttachmentThreshold",0);M(this,"mixDrawOrderThreshold",0);M(this,"animationStart",0);M(this,"animationEnd",0);M(this,"animationLast",0);M(this,"nextAnimationLast",0);M(this,"delay",0);M(this,"trackTime",0);M(this,"trackLast",0);M(this,"nextTrackLast",0);M(this,"trackEnd",0);M(this,"timeScale",0);M(this,"alpha",0);M(this,"mixTime",0);M(this,"_mixDuration",0);M(this,"interruptAlpha",0);M(this,"totalAlpha",0);M(this,"mixBlend",ye.replace);M(this,"timelineMode",new Array);M(this,"timelineHoldMix",new Array);M(this,"timelinesRotation",new Array)}get mixDuration(){return this._mixDuration}set mixDuration(e){this._mixDuration=e}setMixDurationWithDelay(e,t){this._mixDuration=e,t<=0&&(this.previous!=null?t=Math.max(t+this.previous.getTrackComplete()-e,0):t=0),this.delay=t}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let e=this.animationEnd-this.animationStart;return e==0?this.animationStart:this.trackTime%e+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(e){this.animationLast=e,this.nextAnimationLast=e}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let e=this.animationEnd-this.animationStart;if(e!=0){if(this.loop)return e*(1+(this.trackTime/e|0));if(this.trackTime=0}},oP=class{constructor(e){M(this,"objects",[]);M(this,"drainDisabled",!1);M(this,"animState");this.animState=e}start(e){this.objects.push(Hi.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(Hi.interrupt),this.objects.push(e)}end(e){this.objects.push(Hi.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(Hi.dispose),this.objects.push(e)}complete(e){this.objects.push(Hi.complete),this.objects.push(e)}event(e,t){this.objects.push(Hi.event),this.objects.push(e),this.objects.push(t)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let e=this.objects;for(let t=0;t{h.width=parseInt(i[1]),h.height=parseInt(i[2])},n.format=()=>{},n.filter=h=>{h.minFilter=Pe.enumValue(yi,i[1]),h.magFilter=Pe.enumValue(yi,i[2])},n.repeat=h=>{i[1].indexOf("x")!=-1&&(h.uWrap=Vn.Repeat),i[1].indexOf("y")!=-1&&(h.vWrap=Vn.Repeat)},n.pma=h=>{h.pma=i[1]=="true"};var r={};r.xy=h=>{h.x=parseInt(i[1]),h.y=parseInt(i[2])},r.size=h=>{h.width=parseInt(i[1]),h.height=parseInt(i[2])},r.bounds=h=>{h.x=parseInt(i[1]),h.y=parseInt(i[2]),h.width=parseInt(i[3]),h.height=parseInt(i[4])},r.offset=h=>{h.offsetX=parseInt(i[1]),h.offsetY=parseInt(i[2])},r.orig=h=>{h.originalWidth=parseInt(i[1]),h.originalHeight=parseInt(i[2])},r.offsets=h=>{h.offsetX=parseInt(i[1]),h.offsetY=parseInt(i[2]),h.originalWidth=parseInt(i[3]),h.originalHeight=parseInt(i[4])},r.rotate=h=>{let u=i[1];u=="true"?h.degrees=90:u!="false"&&(h.degrees=parseInt(u))},r.index=h=>{h.index=parseInt(i[1])};let o=t.readLine();for(;o&&o.trim().length==0;)o=t.readLine();for(;!(!o||o.trim().length==0||t.readEntry(i,o)==0);)o=t.readLine();let a=null,c=null,l=null;for(;o!==null;)if(o.trim().length==0)a=null,o=t.readLine();else if(a){let h=new Sw(a,o);for(;;){let u=t.readEntry(i,o=t.readLine());if(u==0)break;let d=r[i[0]];if(d)d(h);else{c||(c=[]),l||(l=[]),c.push(i[0]);let f=[];for(let m=0;m0&&l&&l.length>0&&(h.names=c,h.values=l,c=null,l=null),h.u=h.x/a.width,h.v=h.y/a.height,h.degrees==90?(h.u2=(h.x+h.height)/a.width,h.v2=(h.y+h.width)/a.height):(h.u2=(h.x+h.width)/a.width,h.v2=(h.y+h.height)/a.height),this.regions.push(h)}else{for(a=new fP(o.trim());t.readEntry(i,o=t.readLine())!=0;){let h=n[i[0]];h&&h(a)}this.pages.push(a)}}findRegion(e){for(let t=0;t=this.lines.length?null:this.lines[this.index++]}readEntry(e,t){if(!t||(t=t.trim(),t.length==0))return 0;let i=t.indexOf(":");if(i==-1)return 0;e[0]=t.substr(0,i).trim();for(let n=1,r=i+1;;n++){let o=t.indexOf(",",r);if(o==-1)return e[n]=t.substr(r).trim(),n;if(e[n]=t.substr(r,o-r).trim(),r=o+1,n==4)return 4}}},fP=class{constructor(e){M(this,"name");M(this,"minFilter",yi.Nearest);M(this,"magFilter",yi.Nearest);M(this,"uWrap",Vn.ClampToEdge);M(this,"vWrap",Vn.ClampToEdge);M(this,"texture",null);M(this,"width",0);M(this,"height",0);M(this,"pma",!1);M(this,"regions",new Array);this.name=e}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap);for(let t of this.regions)t.texture=e}},Sw=class extends uP{constructor(t,i){super();M(this,"page");M(this,"name");M(this,"x",0);M(this,"y",0);M(this,"offsetX",0);M(this,"offsetY",0);M(this,"originalWidth",0);M(this,"originalHeight",0);M(this,"index",0);M(this,"degrees",0);M(this,"names",null);M(this,"values",null);this.page=t,this.name=i,t.regions.push(this)}},Ol=class wm extends zn{constructor(t,i){super(t);M(this,"region",null);M(this,"path");M(this,"regionUVs",[]);M(this,"uvs",[]);M(this,"triangles",[]);M(this,"color",new lt(1,1,1,1));M(this,"width",0);M(this,"height",0);M(this,"hullLength",0);M(this,"edges",[]);M(this,"parentMesh",null);M(this,"sequence",null);M(this,"tempColor",new lt(0,0,0,0));this.path=i}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;(!this.uvs||this.uvs.length!=t.length)&&(this.uvs=Pe.newFloatArray(t.length));let i=this.uvs,n=this.uvs.length,r=this.region.u,o=this.region.v,a=0,c=0;if(this.region instanceof Sw){let l=this.region,h=l.page,u=h.width,d=h.height;switch(l.degrees){case 90:r-=(l.originalHeight-l.offsetY-l.height)/u,o-=(l.originalWidth-l.offsetX-l.width)/d,a=l.originalHeight/u,c=l.originalWidth/d;for(let f=0;f= 0.");if(!t)throw new Error("name cannot be null.");this.index=e,this.name=t,this.parent=i}};var qt;(function(s){s[s.Normal=0]="Normal",s[s.OnlyTranslation=1]="OnlyTranslation",s[s.NoRotationOrReflection=2]="NoRotationOrReflection",s[s.NoScale=3]="NoScale",s[s.NoScaleOrReflection=4]="NoScaleOrReflection"})(qt||(qt={}));let Kv=class{constructor(e,t,i){M(this,"data");M(this,"skeleton");M(this,"parent",null);M(this,"children",new Array);M(this,"x",0);M(this,"y",0);M(this,"rotation",0);M(this,"scaleX",0);M(this,"scaleY",0);M(this,"shearX",0);M(this,"shearY",0);M(this,"ax",0);M(this,"ay",0);M(this,"arotation",0);M(this,"ascaleX",0);M(this,"ascaleY",0);M(this,"ashearX",0);M(this,"ashearY",0);M(this,"a",0);M(this,"b",0);M(this,"c",0);M(this,"d",0);M(this,"worldY",0);M(this,"worldX",0);M(this,"inherit",qt.Normal);M(this,"sorted",!1);M(this,"active",!1);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=t,this.parent=i,this.setToSetupPose()}isActive(){return this.active}update(e){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(e,t,i,n,r,o,a){this.ax=e,this.ay=t,this.arotation=i,this.ascaleX=n,this.ascaleY=r,this.ashearX=o,this.ashearY=a;let c=this.parent;if(!c){let f=this.skeleton;const m=f.scaleX,p=f.scaleY,g=(i+o)*Re.degRad,x=(i+90+a)*Re.degRad;this.a=Math.cos(g)*n*m,this.b=Math.cos(x)*r*m,this.c=Math.sin(g)*n*p,this.d=Math.sin(x)*r*p,this.worldX=e*m+f.x,this.worldY=t*p+f.y;return}let l=c.a,h=c.b,u=c.c,d=c.d;switch(this.worldX=l*e+h*t+c.worldX,this.worldY=u*e+d*t+c.worldY,this.inherit){case qt.Normal:{const f=(i+o)*Re.degRad,m=(i+90+a)*Re.degRad,p=Math.cos(f)*n,g=Math.cos(m)*r,x=Math.sin(f)*n,v=Math.sin(m)*r;this.a=l*p+h*x,this.b=l*g+h*v,this.c=u*p+d*x,this.d=u*g+d*v;return}case qt.OnlyTranslation:{const f=(i+o)*Re.degRad,m=(i+90+a)*Re.degRad;this.a=Math.cos(f)*n,this.b=Math.cos(m)*r,this.c=Math.sin(f)*n,this.d=Math.sin(m)*r;break}case qt.NoRotationOrReflection:{let f=1/this.skeleton.scaleX,m=1/this.skeleton.scaleY;l*=f,u*=m;let p=l*l+u*u,g=0;p>1e-4?(p=Math.abs(l*d*m-h*f*u)/p,h=u*p,d=l*p,g=Math.atan2(u,l)*Re.radDeg):(l=0,u=0,g=90-Math.atan2(d,h)*Re.radDeg);const x=(i+o-g)*Re.degRad,v=(i+a-g+90)*Re.degRad,y=Math.cos(x)*n,S=Math.cos(v)*r,C=Math.sin(x)*n,w=Math.sin(v)*r;this.a=l*y-h*C,this.b=l*S-h*w,this.c=u*y+d*C,this.d=u*S+d*w;break}case qt.NoScale:case qt.NoScaleOrReflection:{i*=Re.degRad;const f=Math.cos(i),m=Math.sin(i);let p=(l*f+h*m)/this.skeleton.scaleX,g=(u*f+d*m)/this.skeleton.scaleY,x=Math.sqrt(p*p+g*g);x>1e-5&&(x=1/x),p*=x,g*=x,x=Math.sqrt(p*p+g*g),this.inherit==qt.NoScale&&l*d-h*u<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(x=-x),i=Math.PI/2+Math.atan2(g,p);const v=Math.cos(i)*x,y=Math.sin(i)*x;o*=Re.degRad,a=(90+a)*Re.degRad;const S=Math.cos(o)*n,C=Math.cos(a)*r,w=Math.sin(o)*n,b=Math.sin(a)*r;this.a=p*S+v*w,this.b=p*C+v*b,this.c=g*S+y*w,this.d=g*C+y*b;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let e=this.data;this.x=e.x,this.y=e.y,this.rotation=e.rotation,this.scaleX=e.scaleX,this.scaleY=e.scaleY,this.shearX=e.shearX,this.shearY=e.shearY,this.inherit=e.inherit}updateAppliedTransform(){let e=this.parent;if(!e){this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*Re.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*Re.radDeg;return}let t=e.a,i=e.b,n=e.c,r=e.d,o=1/(t*r-i*n),a=r*o,c=i*o,l=n*o,h=t*o,u=this.worldX-e.worldX,d=this.worldY-e.worldY;this.ax=u*a-d*c,this.ay=d*h-u*l;let f,m,p,g;if(this.inherit==qt.OnlyTranslation)f=this.a,m=this.b,p=this.c,g=this.d;else{switch(this.inherit){case qt.NoRotationOrReflection:{let C=Math.abs(t*r-i*n)/(t*t+n*n);i=-n*this.skeleton.scaleX*C/this.skeleton.scaleY,r=t*this.skeleton.scaleY*C/this.skeleton.scaleX,o=1/(t*r-i*n),a=r*o,c=i*o;break}case qt.NoScale:case qt.NoScaleOrReflection:let x=Re.cosDeg(this.rotation),v=Re.sinDeg(this.rotation);t=(t*x+i*v)/this.skeleton.scaleX,n=(n*x+r*v)/this.skeleton.scaleY;let y=Math.sqrt(t*t+n*n);y>1e-5&&(y=1/y),t*=y,n*=y,y=Math.sqrt(t*t+n*n),this.inherit==qt.NoScale&&o<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(y=-y);let S=Re.PI/2+Math.atan2(n,t);i=Math.cos(S)*y,r=Math.sin(S)*y,o=1/(t*r-i*n),a=r*o,c=i*o,l=n*o,h=t*o}f=a*this.a-c*this.c,m=a*this.b-c*this.d,p=h*this.c-l*this.a,g=h*this.d-l*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+p*p),this.ascaleX>1e-4){let x=f*g-m*p;this.ascaleY=x/this.ascaleX,this.ashearY=-Math.atan2(f*m+p*g,x)*Re.radDeg,this.arotation=Math.atan2(p,f)*Re.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(m*m+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,m)*Re.radDeg}getWorldRotationX(){return Math.atan2(this.c,this.a)*Re.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*Re.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}worldToLocal(e){let t=1/(this.a*this.d-this.b*this.c),i=e.x-this.worldX,n=e.y-this.worldY;return e.x=i*this.d*t-n*this.b*t,e.y=n*this.a*t-i*this.c*t,e}localToWorld(e){let t=e.x,i=e.y;return e.x=t*this.a+i*this.b+this.worldX,e.y=t*this.c+i*this.d+this.worldY,e}worldToParent(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.worldToLocal(e)}parentToWorld(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.localToWorld(e)}worldToLocalRotation(e){let t=Re.sinDeg(e),i=Re.cosDeg(e);return Math.atan2(this.a*t-this.c*i,this.d*i-this.b*t)*Re.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let t=Re.sinDeg(e),i=Re.cosDeg(e);return Math.atan2(i*this.c+t*this.d,i*this.a+t*this.b)*Re.radDeg}rotateWorld(e){e*=Re.degRad;const t=Math.sin(e),i=Math.cos(e),n=this.a,r=this.b;this.a=i*n-t*this.c,this.b=i*r-t*this.d,this.c=t*n+i*this.c,this.d=t*r+i*this.d}},vu=class{constructor(e,t,i){M(this,"name");M(this,"order");M(this,"skinRequired");this.name=e,this.order=t,this.skinRequired=i}},Ew=class{constructor(e,t){M(this,"data");M(this,"intValue",0);M(this,"floatValue",0);M(this,"stringValue",null);M(this,"time",0);M(this,"volume",0);M(this,"balance",0);if(!t)throw new Error("data cannot be null.");this.time=e,this.data=t}},Aw=class{constructor(e){M(this,"name");M(this,"intValue",0);M(this,"floatValue",0);M(this,"stringValue",null);M(this,"audioPath",null);M(this,"volume",0);M(this,"balance",0);this.name=e}},mP=class{constructor(e,t){M(this,"data");M(this,"bones");M(this,"target");M(this,"bendDirection",0);M(this,"compress",!1);M(this,"stretch",!1);M(this,"mix",1);M(this,"softness",0);M(this,"active",!1);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let n=0;n180?f-=360:f<-180&&(f+=360);let g=e.ascaleX,x=e.ascaleY;if(n||r){switch(e.inherit){case qt.NoScale:case qt.NoScaleOrReflection:m=t-e.worldX,p=i-e.worldY}const v=e.data.length*g;if(v>1e-4){const y=m*m+p*p;if(n&&yv*v){const S=(Math.sqrt(y)/v-1)*a+1;g*=S,o&&(x*=S)}}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+f*a,g,x,e.ashearX,e.ashearY)}apply2(e,t,i,n,r,o,a,c,l){if(e.inherit!=qt.Normal||t.inherit!=qt.Normal)return;let h=e.ax,u=e.ay,d=e.ascaleX,f=e.ascaleY,m=d,p=f,g=t.ascaleX,x=0,v=0,y=0;d<0?(d=-d,x=180,y=-1):(x=0,y=1),f<0&&(f=-f,y=-y),g<0?(g=-g,v=180):v=0;let S=t.ax,C=0,w=0,b=0,_=e.a,A=e.b,P=e.c,E=e.d,R=Math.abs(d-f)<=1e-4;!R||o?(C=0,w=_*S+e.worldX,b=P*S+e.worldY):(C=t.ay,w=_*S+A*C+e.worldX,b=P*S+E*C+e.worldY);let O=e.parent;if(!O)throw new Error("IK parent must itself have a parent.");_=O.a,A=O.b,P=O.c,E=O.d;let U=_*E-A*P,Y=w-O.worldX,$=b-O.worldY;U=Math.abs(U)<=1e-4?0:1/U;let X=(Y*E-$*A)*U-h,D=($*_-Y*P)*U-u,F=Math.sqrt(X*X+D*D),N=t.data.length*g,k,V;if(F<1e-4){this.apply1(e,i,n,!1,o,!1,l),t.updateWorldTransformWith(S,C,0,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY);return}Y=i-O.worldX,$=n-O.worldY;let G=(Y*E-$*A)*U-h,W=($*_-Y*P)*U-u,Z=G*G+W*W;if(c!=0){c*=d*(g+1)*.5;let de=Math.sqrt(Z),pe=de-F-N*d+c;if(pe>0){let he=Math.min(1,pe/(c*2))-1;he=(pe-c*(1-he*he))/de,G-=he*G,W-=he*W,Z=G*G+W*W}}e:if(R){N*=d;let de=(Z-F*F-N*N)/(2*F*N);de<-1?(de=-1,V=Math.PI*r):de>1?(de=1,V=0,o&&(_=(Math.sqrt(Z)/(F+N)-1)*l+1,m*=_,a&&(p*=_))):V=Math.acos(de)*r,_=F+N*de,A=N*Math.sin(V),k=Math.atan2(W*_-G*A,G*_+W*A)}else{_=d*N,A=f*N;let de=_*_,pe=A*A,he=Math.atan2(W,G);P=pe*F*F+de*Z-de*pe;let me=-2*pe*F,H=pe-de;if(E=me*me-4*H*P,E>=0){let ee=Math.sqrt(E);me<0&&(ee=-ee),ee=-(me+ee)*.5;let Me=ee/H,be=P/ee,ge=Math.abs(Me)=0){$=Math.sqrt(Me)*r,k=he-Math.atan2($,ge),V=Math.atan2($/f,(ge-F)/d);break e}}let z=Re.PI,K=F-_,B=K*K,L=0,j=0,ie=F+_,ue=ie*ie,fe=0;P=-_*F/(de-pe),P>=-1&&P<=1&&(P=Math.acos(P),Y=_*Math.cos(P)+F,$=A*Math.sin(P),E=Y*Y+$*$,Eue&&(j=P,ue=E,ie=Y,fe=$)),Z<=(B+ue)*.5?(k=he-Math.atan2(L*r,K),V=z*r):(k=he-Math.atan2(fe*r,ie),V=j*r)}let ne=Math.atan2(C,S)*y,oe=e.arotation;k=(k-ne)*Re.radDeg+x-oe,k>180?k-=360:k<-180&&(k+=360),e.updateWorldTransformWith(h,u,oe+k*l,m,p,0,0),oe=t.arotation,V=((V+ne)*Re.radDeg-t.ashearX)*y+v-oe,V>180?V-=360:V<-180&&(V+=360),t.updateWorldTransformWith(S,C,oe+V*l,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY)}},Iw=class extends vu{constructor(t){super(t,0,!1);M(this,"bones",new Array);M(this,"_target",null);M(this,"bendDirection",0);M(this,"compress",!1);M(this,"stretch",!1);M(this,"uniform",!1);M(this,"mix",0);M(this,"softness",0)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},Rw=class extends vu{constructor(t){super(t,0,!1);M(this,"bones",new Array);M(this,"_target",null);M(this,"positionMode",un.Fixed);M(this,"spacingMode",fi.Fixed);M(this,"rotateMode",lo.Chain);M(this,"offsetRotation",0);M(this,"position",0);M(this,"spacing",0);M(this,"mixRotate",0);M(this,"mixX",0);M(this,"mixY",0)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}};var un;(function(s){s[s.Fixed=0]="Fixed",s[s.Percent=1]="Percent"})(un||(un={}));var fi;(function(s){s[s.Length=0]="Length",s[s.Fixed=1]="Fixed",s[s.Percent=2]="Percent",s[s.Proportional=3]="Proportional"})(fi||(fi={}));var lo;(function(s){s[s.Tangent=0]="Tangent",s[s.Chain=1]="Chain",s[s.ChainScale=2]="ChainScale"})(lo||(lo={}));var Ri;let pP=(Ri=class{constructor(e,t){M(this,"data");M(this,"bones");M(this,"target");M(this,"position",0);M(this,"spacing",0);M(this,"mixRotate",0);M(this,"mixX",0);M(this,"mixY",0);M(this,"spaces",new Array);M(this,"positions",new Array);M(this,"world",new Array);M(this,"curves",new Array);M(this,"lengths",new Array);M(this,"segments",new Array);M(this,"active",!1);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let n=0,r=e.bones.length;n0){S=u/S*m;for(let w=1;w0?Re.degRad:-.01745329277777778}for(let S=0,C=3;S0){let E=w.a,R=w.b,O=w.c,U=w.d,Y=0,$=0,X=0;if(a?Y=p[C-1]:d[S+1]==0?Y=p[C+2]:Y=Math.atan2(P,A),Y-=Math.atan2(O,E),y){$=Math.cos(Y),X=Math.sin(Y);let D=w.data.length;g+=(D*($*E-X*O)-A)*i,x+=(D*(X*E+$*O)-P)*i}else Y+=v;Y>Re.PI?Y-=Re.PI2:Y<-3.1415927&&(Y+=Re.PI2),Y*=i,$=Math.cos(Y),X=Math.sin(Y),w.a=$*E-X*O,w.b=$*R-X*U,w.c=X*E+$*O,w.d=X*R+$*U}w.updateAppliedTransform()}}computeWorldPositions(e,t,i){let n=this.target,r=this.position,o=this.spaces,a=Pe.setArraySize(this.positions,t*3+2),c=this.world,l=e.closed,h=e.worldVerticesLength,u=h/6,d=Ri.NONE;if(!e.constantSpeed){let D=e.lengths;u-=l?1:2;let F=D[u];this.data.positionMode==un.Percent&&(r*=F);let N;switch(this.data.spacingMode){case fi.Percent:N=F;break;case fi.Proportional:N=F/t;break;default:N=1}c=Pe.setArraySize(this.world,8);for(let k=0,V=0,G=0;kF){d!=Ri.AFTER&&(d=Ri.AFTER,e.computeWorldVertices(n,h-6,4,c,0,2)),this.addAfterPosition(Z-F,c,0,a,V);continue}for(;;G++){let ne=D[G];if(!(Z>ne)){if(G==0)Z/=ne;else{let oe=D[G-1];Z=(Z-oe)/(ne-oe)}break}}G!=d&&(d=G,l&&G==u?(e.computeWorldVertices(n,h-4,4,c,0,2),e.computeWorldVertices(n,0,4,c,4,2)):e.computeWorldVertices(n,G*6+2,8,c,0,2)),this.addCurvePosition(Z,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],a,V,i||k>0&&W==0)}return a}l?(h+=2,c=Pe.setArraySize(this.world,h),e.computeWorldVertices(n,2,h-4,c,0,2),e.computeWorldVertices(n,0,2,c,h-4,2),c[h-2]=c[0],c[h-1]=c[1]):(u--,h-=4,c=Pe.setArraySize(this.world,h),e.computeWorldVertices(n,2,h,c,0,2));let f=Pe.setArraySize(this.curves,u),m=0,p=c[0],g=c[1],x=0,v=0,y=0,S=0,C=0,w=0,b=0,_=0,A=0,P=0,E=0,R=0,O=0,U=0;for(let D=0,F=2;Dm){this.addAfterPosition(G-m,c,h-4,a,F);continue}for(;;N++){let W=f[N];if(!(G>W)){if(N==0)G/=W;else{let Z=f[N-1];G=(G-Z)/(W-Z)}break}}if(N!=d){d=N;let W=N*6;for(p=c[W],g=c[W+1],x=c[W+2],v=c[W+3],y=c[W+4],S=c[W+5],C=c[W+6],w=c[W+7],b=(p-x*2+y)*.03,_=(g-v*2+S)*.03,A=((x-y)*3-p+C)*.006,P=((v-S)*3-g+w)*.006,E=b*2+A,R=_*2+P,O=(x-p)*.3+b+A*.16666667,U=(v-g)*.3+_+P*.16666667,X=Math.sqrt(O*O+U*U),$[0]=X,W=1;W<8;W++)O+=E,U+=R,E+=A,R+=P,X+=Math.sqrt(O*O+U*U),$[W]=X;O+=E,U+=R,X+=Math.sqrt(O*O+U*U),$[8]=X,O+=E+A,U+=R+P,X+=Math.sqrt(O*O+U*U),$[9]=X,k=0}for(G*=X;;k++){let W=$[k];if(!(G>W)){if(k==0)G/=W;else{let Z=$[k-1];G=k+(G-Z)/(W-Z)}break}}this.addCurvePosition(G*.1,p,g,x,v,y,S,C,w,a,F,i||D>0&&V==0)}return a}addBeforePosition(e,t,i,n,r){let o=t[i],a=t[i+1],c=t[i+2]-o,l=t[i+3]-a,h=Math.atan2(l,c);n[r]=o+e*Math.cos(h),n[r+1]=a+e*Math.sin(h),n[r+2]=h}addAfterPosition(e,t,i,n,r){let o=t[i+2],a=t[i+3],c=o-t[i],l=a-t[i+1],h=Math.atan2(l,c);n[r]=o+e*Math.cos(h),n[r+1]=a+e*Math.sin(h),n[r+2]=h}addCurvePosition(e,t,i,n,r,o,a,c,l,h,u,d){if(e==0||isNaN(e)){h[u]=t,h[u+1]=i,h[u+2]=Math.atan2(r-i,n-t);return}let f=e*e,m=f*e,p=1-e,g=p*p,x=g*p,v=p*e,y=v*3,S=p*y,C=y*e,w=t*x+n*S+o*C+c*m,b=i*x+r*S+a*C+l*m;h[u]=w,h[u+1]=b,d&&(e<.001?h[u+2]=Math.atan2(r-i,n-t):h[u+2]=Math.atan2(b-(i*g+r*v*2+a*f),w-(t*g+n*v*2+o*f)))}},M(Ri,"NONE",-1),M(Ri,"BEFORE",-2),M(Ri,"AFTER",-3),M(Ri,"epsilon",1e-5),Ri),gP=class{constructor(e,t){M(this,"data");M(this,"_bone",null);M(this,"inertia",0);M(this,"strength",0);M(this,"damping",0);M(this,"massInverse",0);M(this,"wind",0);M(this,"gravity",0);M(this,"mix",0);M(this,"_reset",!0);M(this,"ux",0);M(this,"uy",0);M(this,"cx",0);M(this,"cy",0);M(this,"tx",0);M(this,"ty",0);M(this,"xOffset",0);M(this,"xVelocity",0);M(this,"yOffset",0);M(this,"yVelocity",0);M(this,"rotateOffset",0);M(this,"rotateVelocity",0);M(this,"scaleOffset",0);M(this,"scaleVelocity",0);M(this,"active",!1);M(this,"skeleton");M(this,"remaining",0);M(this,"lastTime",0);this.data=e,this.skeleton=t,this.bone=t.bones[e.bone.index],this.inertia=e.inertia,this.strength=e.strength,this.damping=e.damping,this.massInverse=e.massInverse,this.wind=e.wind,this.gravity=e.gravity,this.mix=e.mix}set bone(e){this._bone=e}get bone(){if(this._bone)return this._bone;throw new Error("Bone not set.")}reset(){this.remaining=0,this.lastTime=this.skeleton.time,this._reset=!0,this.xOffset=0,this.xVelocity=0,this.yOffset=0,this.yVelocity=0,this.rotateOffset=0,this.rotateVelocity=0,this.scaleOffset=0,this.scaleVelocity=0}setToSetupPose(){const e=this.data;this.inertia=e.inertia,this.strength=e.strength,this.damping=e.damping,this.massInverse=e.massInverse,this.wind=e.wind,this.gravity=e.gravity,this.mix=e.mix}isActive(){return this.active}update(e){const t=this.mix;if(t==0)return;const i=this.data.x>0,n=this.data.y>0,r=this.data.rotate>0||this.data.shearX>0,o=this.data.scaleX>0,a=this.bone,c=a.data.length;switch(e){case pr.none:return;case pr.reset:this.reset();case pr.update:const l=this.skeleton,h=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=h,this.lastTime=l.time;const u=a.worldX,d=a.worldY;if(this._reset)this._reset=!1,this.ux=u,this.uy=d;else{let f=this.remaining,m=this.inertia,p=this.data.step,g=this.skeleton.data.referenceScale,x=-1,v=this.data.limit*h,y=v*Math.abs(l.scaleY);if(v*=Math.abs(l.scaleX),i||n){if(i){const S=(this.ux-u)*m;this.xOffset+=S>v?v:S<-v?-v:S,this.ux=u}if(n){const S=(this.uy-d)*m;this.yOffset+=S>y?y:S<-y?-y:S,this.uy=d}if(f>=p){x=Math.pow(this.damping,60*p);const S=this.massInverse*p,C=this.strength,w=this.wind*g*l.scaleX,b=this.gravity*g*l.scaleY;do i&&(this.xVelocity+=(w-this.xOffset*C)*S,this.xOffset+=this.xVelocity*p,this.xVelocity*=x),n&&(this.yVelocity-=(b+this.yOffset*C)*S,this.yOffset+=this.yVelocity*p,this.yVelocity*=x),f-=p;while(f>=p)}i&&(a.worldX+=this.xOffset*t*this.data.x),n&&(a.worldY+=this.yOffset*t*this.data.y)}if(r||o){let S=Math.atan2(a.c,a.a),C=0,w=0,b=0,_=this.cx-a.worldX,A=this.cy-a.worldY;if(_>v?_=v:_<-v&&(_=-v),A>y?A=y:A<-y&&(A=-y),r){b=(this.data.rotate+this.data.shearX)*t;let P=Math.atan2(A+this.ty,_+this.tx)-S-this.rotateOffset*b;this.rotateOffset+=(P-Math.ceil(P*Re.invPI2-.5)*Re.PI2)*m,P=this.rotateOffset*b+S,C=Math.cos(P),w=Math.sin(P),o&&(P=c*a.getWorldScaleX(),P>0&&(this.scaleOffset+=(_*C+A*w)*m/P))}else{C=Math.cos(S),w=Math.sin(S);const P=c*a.getWorldScaleX();P>0&&(this.scaleOffset+=(_*C+A*w)*m/P)}if(f=this.remaining,f>=p){x==-1&&(x=Math.pow(this.damping,60*p));const P=this.massInverse*p,E=this.strength,R=this.wind,O=Ip.yDown?-this.gravity:this.gravity,U=c/g;for(;;)if(f-=p,o&&(this.scaleVelocity+=(R*C-O*w-this.scaleOffset*E)*P,this.scaleOffset+=this.scaleVelocity*p,this.scaleVelocity*=x),r){if(this.rotateVelocity-=((R*w+O*C)*U+this.rotateOffset*E)*P,this.rotateOffset+=this.rotateVelocity*p,this.rotateVelocity*=x,f0){let f=0;this.data.rotate>0&&(f=l*this.data.rotate,h=Math.sin(f),u=Math.cos(f),d=a.b,a.b=u*d-h*a.d,a.d=h*d+u*a.d),f+=l*this.data.shearX,h=Math.sin(f),u=Math.cos(f),d=a.a,a.a=u*d-h*a.c,a.c=h*d+u*a.c}else l*=this.data.rotate,h=Math.sin(l),u=Math.cos(l),d=a.a,a.a=u*d-h*a.c,a.c=h*d+u*a.c,d=a.b,a.b=u*d-h*a.d,a.d=h*d+u*a.d}if(o){const l=1+this.scaleOffset*t*this.data.scaleX;a.a*=l,a.c*=l}e!=pr.pose&&(this.tx=c*a.a,this.ty=c*a.c),a.updateAppliedTransform()}translate(e,t){this.ux-=e,this.uy-=t,this.cx-=e,this.cy-=t}rotate(e,t,i){const n=i*Re.degRad,r=Math.cos(n),o=Math.sin(n),a=this.cx-e,c=this.cy-t;this.translate(a*r-c*o-a,a*o+c*r-c)}},vP=class{constructor(e,t){M(this,"data");M(this,"bone");M(this,"color");M(this,"darkColor",null);M(this,"attachment",null);M(this,"attachmentState",0);M(this,"sequenceIndex",-1);M(this,"deform",new Array);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("bone cannot be null.");this.data=e,this.bone=t,this.color=new lt,this.darkColor=e.darkColor?new lt:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(e){this.attachment!=e&&((!(e instanceof zn)||!(this.attachment instanceof zn)||e.timelineAttachment!=this.attachment.timelineAttachment)&&(this.deform.length=0),this.attachment=e,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}},yP=class{constructor(e,t){M(this,"data");M(this,"bones");M(this,"target");M(this,"mixRotate",0);M(this,"mixX",0);M(this,"mixY",0);M(this,"mixScaleX",0);M(this,"mixScaleY",0);M(this,"mixShearY",0);M(this,"temp",new bh);M(this,"active",!1);if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let n=0;n0?Re.degRad:-.01745329277777778,m=this.data.offsetRotation*f,p=this.data.offsetShearY*f,g=this.bones;for(let x=0,v=g.length;xRe.PI?_-=Re.PI2:_<-3.1415927&&(_+=Re.PI2),_*=e;let A=Math.cos(_),P=Math.sin(_);y.a=A*S-P*w,y.b=A*C-P*b,y.c=P*S+A*w,y.d=P*C+A*b}if(a){let S=this.temp;c.localToWorld(S.set(this.data.offsetX,this.data.offsetY)),y.worldX+=(S.x-y.worldX)*t,y.worldY+=(S.y-y.worldY)*i}if(n!=0){let S=Math.sqrt(y.a*y.a+y.c*y.c);S!=0&&(S=(S+(Math.sqrt(l*l+u*u)-S+this.data.offsetScaleX)*n)/S),y.a*=S,y.c*=S}if(r!=0){let S=Math.sqrt(y.b*y.b+y.d*y.d);S!=0&&(S=(S+(Math.sqrt(h*h+d*d)-S+this.data.offsetScaleY)*r)/S),y.b*=S,y.d*=S}if(o>0){let S=y.b,C=y.d,w=Math.atan2(C,S),b=Math.atan2(d,h)-Math.atan2(u,l)-(w-Math.atan2(y.c,y.a));b>Re.PI?b-=Re.PI2:b<-3.1415927&&(b+=Re.PI2),b=w+(b+p)*o;let _=Math.sqrt(S*S+C*C);y.b=Math.cos(b)*_,y.d=Math.sin(b)*_}y.updateAppliedTransform()}}applyRelativeWorld(){let e=this.mixRotate,t=this.mixX,i=this.mixY,n=this.mixScaleX,r=this.mixScaleY,o=this.mixShearY,a=t!=0||i!=0,c=this.target,l=c.a,h=c.b,u=c.c,d=c.d,f=l*d-h*u>0?Re.degRad:-.01745329277777778,m=this.data.offsetRotation*f,p=this.data.offsetShearY*f,g=this.bones;for(let x=0,v=g.length;xRe.PI?_-=Re.PI2:_<-3.1415927&&(_+=Re.PI2),_*=e;let A=Math.cos(_),P=Math.sin(_);y.a=A*S-P*w,y.b=A*C-P*b,y.c=P*S+A*w,y.d=P*C+A*b}if(a){let S=this.temp;c.localToWorld(S.set(this.data.offsetX,this.data.offsetY)),y.worldX+=S.x*t,y.worldY+=S.y*i}if(n!=0){let S=(Math.sqrt(l*l+u*u)-1+this.data.offsetScaleX)*n+1;y.a*=S,y.c*=S}if(r!=0){let S=(Math.sqrt(h*h+d*d)-1+this.data.offsetScaleY)*r+1;y.b*=S,y.d*=S}if(o>0){let S=Math.atan2(d,h)-Math.atan2(u,l);S>Re.PI?S-=Re.PI2:S<-3.1415927&&(S+=Re.PI2);let C=y.b,w=y.d;S=Math.atan2(w,C)+(S-Re.PI/2+p)*o;let b=Math.sqrt(C*C+w*w);y.b=Math.cos(S)*b,y.d=Math.sin(S)*b}y.updateAppliedTransform()}}applyAbsoluteLocal(){let e=this.mixRotate,t=this.mixX,i=this.mixY,n=this.mixScaleX,r=this.mixScaleY,o=this.mixShearY,a=this.target,c=this.bones;for(let l=0,h=c.length;lt.data.name==e)??null}findTransformConstraint(e){if(!e)throw new Error("constraintName cannot be null.");return this.transformConstraints.find(t=>t.data.name==e)??null}findPathConstraint(e){if(!e)throw new Error("constraintName cannot be null.");return this.pathConstraints.find(t=>t.data.name==e)??null}findPhysicsConstraint(e){if(e==null)throw new Error("constraintName cannot be null.");return this.physicsConstraints.find(t=>t.data.name==e)??null}getBoundsRect(e){let t=new bh,i=new bh;return this.getBounds(t,i,void 0,e),{x:t.x,y:t.y,width:i.x,height:i.y}}getBounds(e,t,i=new Array(2),n=null){if(!e)throw new Error("offset cannot be null.");if(!t)throw new Error("size cannot be null.");let r=this.drawOrder,o=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let h=0,u=r.length;h=n.length&&(n.length=e+1),n[e]||(n[e]={}),n[e][t]=i}addSkin(e){for(let n=0;n= 0.");if(!t)throw new Error("name cannot be null.");if(!i)throw new Error("boneData cannot be null.");this.index=e,this.name=t,this.boneData=i}};var wr;(function(s){s[s.Normal=0]="Normal",s[s.Additive=1]="Additive",s[s.Multiply=2]="Multiply",s[s.Screen=3]="Screen"})(wr||(wr={}));let Fw=class extends vu{constructor(t){super(t,0,!1);M(this,"bones",new Array);M(this,"_target",null);M(this,"mixRotate",0);M(this,"mixX",0);M(this,"mixY",0);M(this,"mixScaleX",0);M(this,"mixScaleY",0);M(this,"mixShearY",0);M(this,"offsetRotation",0);M(this,"offsetX",0);M(this,"offsetY",0);M(this,"offsetScaleX",0);M(this,"offsetScaleY",0);M(this,"offsetShearY",0);M(this,"relative",!1);M(this,"local",!1)}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},Tm=class{constructor(e){M(this,"scale",1);M(this,"attachmentLoader");M(this,"linkedMeshes",new Array);this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,i=new Sh;i.name="";let n=new xP(e),r=n.readInt32(),o=n.readInt32();i.hash=o==0&&r==0?null:o.toString(16)+r.toString(16),i.version=n.readString(),i.x=n.readFloat(),i.y=n.readFloat(),i.width=n.readFloat(),i.height=n.readFloat(),i.referenceScale=n.readFloat()*t;let a=n.readBoolean();a&&(i.fps=n.readFloat(),i.imagesPath=n.readString(),i.audioPath=n.readString());let c=0;c=n.readInt(!0);for(let h=0;h>1&3,f.rotateMode=m>>3&3,(m&128)!=0&&(f.offsetRotation=n.readFloat()),f.position=n.readFloat(),f.positionMode==un.Fixed&&(f.position*=t),f.spacing=n.readFloat(),(f.spacingMode==fi.Length||f.spacingMode==fi.Fixed)&&(f.spacing*=t),f.mixRotate=n.readFloat(),f.mixX=n.readFloat(),f.mixY=n.readFloat(),i.pathConstraints.push(f)}c=n.readInt(!0);for(let h=0,u;h>4,e.readFloat())}n.push(w);break}}}}}let o=e.readInt(!0);if(o>0){let l=new el(o),h=i.slots.length;for(let u=0;u=0;v--)m[v]=-1;let p=Pe.newArray(h-f,0),g=0,x=0;for(let v=0;v=0;v--)m[v]==-1&&(m[v]=p[--x]);l.setFrame(u,d,m)}n.push(l)}let a=e.readInt(!0);if(a>0){let l=new Ap(a);for(let h=0;h>>1^-(i&1)}readStringRef(){let e=this.readInt(!0);return e==0?null:this.strings[e-1]}readString(){let e=this.readInt(!0);switch(e){case 0:return null;case 1:return""}e--;let t="";for(let i=0;i>4){case 12:case 13:t+=String.fromCharCode((n&31)<<6|this.readByte()&63),i+=2;break;case 14:t+=String.fromCharCode((n&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),i+=3;break;default:t+=String.fromCharCode(n),i++}}return t}readFloat(){let e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!=0}},bP=class{constructor(e,t,i,n,r){M(this,"parent");M(this,"skinIndex");M(this,"slotIndex");M(this,"mesh");M(this,"inheritTimeline");this.mesh=e,this.skinIndex=t,this.slotIndex=i,this.parent=n,this.inheritTimeline=r}},wP=class{constructor(e=null,t=null,i=0){M(this,"bones");M(this,"vertices");M(this,"length");this.bones=e,this.vertices=t,this.length=i}};var Tn;(function(s){s[s.Region=0]="Region",s[s.BoundingBox=1]="BoundingBox",s[s.Mesh=2]="Mesh",s[s.LinkedMesh=3]="LinkedMesh",s[s.Path=4]="Path",s[s.Point=5]="Point",s[s.Clipping=6]="Clipping"})(Tn||(Tn={}));function Ei(s,e,t){let i=s.readFloat(),n=s.readFloat()*t;for(let r=0,o=0,a=e.getFrameCount()-1;e.setFrame(r,i,n),r!=a;r++){let c=s.readFloat(),l=s.readFloat()*t;switch(s.readByte()){case zs:e.setStepped(r);break;case qs:pt(s,e,o++,r,0,i,c,n,l,t)}i=c,n=l}return e}function mf(s,e,t){let i=s.readFloat(),n=s.readFloat()*t,r=s.readFloat()*t;for(let o=0,a=0,c=e.getFrameCount()-1;e.setFrame(o,i,n,r),o!=c;o++){let l=s.readFloat(),h=s.readFloat()*t,u=s.readFloat()*t;switch(s.readByte()){case zs:e.setStepped(o);break;case qs:pt(s,e,a++,o,0,i,l,n,h,t),pt(s,e,a++,o,1,i,l,r,u,t)}i=l,n=h,r=u}return e}function pt(s,e,t,i,n,r,o,a,c,l){e.setBezier(t,i,n,r,a,s.readFloat(),s.readFloat()*l,s.readFloat(),s.readFloat()*l,o,c)}const SP=0,MP=1,TP=2,_P=3,CP=4,EP=5,AP=6,IP=7,RP=8,PP=9,kP=10,FP=0,OP=1,LP=2,BP=3,NP=4,DP=5,UP=0,$P=1,XP=0,VP=1,YP=2,GP=0,jP=1,HP=2,WP=4,zP=5,qP=6,KP=7,ZP=8,zs=1,qs=2;class Wi{constructor(){M(this,"convexPolygons",new Array);M(this,"convexPolygonsIndices",new Array);M(this,"indicesArray",new Array);M(this,"isConcaveArray",new Array);M(this,"triangles",new Array);M(this,"polygonPool",new xh(()=>new Array));M(this,"polygonIndicesPool",new xh(()=>new Array))}triangulate(e){let t=e,i=e.length>>1,n=this.indicesArray;n.length=0;for(let a=0;a3;){let a=i-1,c=0,l=1;for(;;){e:if(!r[c]){let d=n[a]<<1,f=n[c]<<1,m=n[l]<<1,p=t[d],g=t[d+1],x=t[f],v=t[f+1],y=t[m],S=t[m+1];for(let C=(l+1)%i;C!=a;C=(C+1)%i){if(!r[C])continue;let w=n[C]<<1,b=t[w],_=t[w+1];if(Wi.positiveArea(y,S,p,g,b,_)&&Wi.positiveArea(p,g,x,v,b,_)&&Wi.positiveArea(x,v,y,S,b,_))break e}break}if(l==0){do{if(!r[c])break;c--}while(c>0);break}a=c,c=l,l=(l+1)%i}o.push(n[(i+c-1)%i]),o.push(n[c]),o.push(n[(c+1)%i]),n.splice(c,1),r.splice(c,1),i--;let h=(i+c-1)%i,u=c==i?0:c;r[h]=Wi.isConcave(h,i,t,n),r[u]=Wi.isConcave(u,i,t,n)}return i==3&&(o.push(n[2]),o.push(n[0]),o.push(n[1])),o}decompose(e,t){let i=e,n=this.convexPolygons;this.polygonPool.freeAll(n),n.length=0;let r=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(r),r.length=0;let o=this.polygonIndicesPool.obtain();o.length=0;let a=this.polygonPool.obtain();a.length=0;let c=-1,l=0;for(let h=0,u=t.length;h0?(n.push(a),r.push(o)):(this.polygonPool.free(a),this.polygonIndicesPool.free(o)),a=this.polygonPool.obtain(),a.length=0,a.push(p),a.push(g),a.push(x),a.push(v),a.push(y),a.push(S),o=this.polygonIndicesPool.obtain(),o.length=0,o.push(d),o.push(f),o.push(m),l=Wi.winding(p,g,x,v,y,S),c=d)}a.length>0&&(n.push(a),r.push(o));for(let h=0,u=n.length;h=0;h--)a=n[h],a.length==0&&(n.splice(h,1),this.polygonPool.free(a),o=r[h],r.splice(h,1),this.polygonIndicesPool.free(o));return n}static isConcave(e,t,i,n){let r=n[(t+e-1)%t]<<1,o=n[e]<<1,a=n[(e+1)%t]<<1;return!this.positiveArea(i[r],i[r+1],i[o],i[o+1],i[a],i[a+1])}static positiveArea(e,t,i,n,r,o){return e*(o-n)+i*(t-o)+r*(n-t)>=0}static winding(e,t,i,n,r,o){let a=i-e,c=n-t;return r*c-o*a+a*t-e*c>=0?1:-1}}class Mh{constructor(){M(this,"triangulator",new Wi);M(this,"clippingPolygon",new Array);M(this,"clipOutput",new Array);M(this,"clippedVertices",new Array);M(this,"clippedUVs",new Array);M(this,"clippedTriangles",new Array);M(this,"scratch",new Array);M(this,"clipAttachment",null);M(this,"clippingPolygons",null)}clipStart(e,t){if(this.clipAttachment)return 0;this.clipAttachment=t;let i=t.worldVerticesLength,n=Pe.setArraySize(this.clippingPolygon,i);t.computeWorldVertices(e,0,i,n,0,2);let r=this.clippingPolygon;Mh.makeClockwise(r);let o=this.clippingPolygons=this.triangulator.decompose(r,this.triangulator.triangulate(r));for(let a=0,c=o.length;a>1,w=this.clipOutput,b=Pe.setArraySize(r,y+C*2);for(let A=0;A>1,V=this.clipOutput,G=Pe.setArraySize(l,U+k*f);for(let Z=0;Z>1,F=this.clipOutput,N=Pe.setArraySize(o,E+D*2),k=Pe.setArraySize(a,E+D*2);for(let G=0;G=2?(u=c,c=this.scratch):u=this.scratch,u.length=0,u.push(e),u.push(t),u.push(i),u.push(n),u.push(r),u.push(o),u.push(e),u.push(t),c.length=0;let d=a.length-4,f=a;for(let m=0;;m+=2){let p=f[m],g=f[m+1],x=p-f[m+2],v=g-f[m+3],y=c.length,S=u;for(let w=0,b=u.length-2;wx*(g-E),O=v*(p-_)-x*(g-A);if(O>0){if(R){c.push(P),c.push(E);continue}let U=P-_,Y=E-A,$=O/(U*v-Y*x);if($>=0&&$<=1)c.push(_+U*$),c.push(A+Y*$);else{c.push(P),c.push(E);continue}}else if(R){let U=P-_,Y=E-A,$=O/(U*v-Y*x);if($>=0&&$<=1)c.push(_+U*$),c.push(A+Y*$),c.push(P),c.push(E);else{c.push(P),c.push(E);continue}}h=!0}if(y==c.length)return l.length=0,!0;if(c.push(c[0]),c.push(c[1]),m==d)break;let C=c;c=u,c.length=0,u=C}if(l!=c){l.length=0;for(let m=0,p=c.length-2;m>1;l0){let h=i.findPhysicsConstraint(a);if(!h)throw new Error("Physics constraint not found: "+a);l=i.physicsConstraints.indexOf(h)}for(let h in c){let u=c[h],d=u[0];if(!d)continue;let f=u.length;if(h=="reset"){const p=new gw(f,l);for(let g=0;d!=null;d=u[g+1],g++)p.setFrame(g,se(d,"time",0));r.push(p);continue}let m;if(h=="inertia")m=new cw(f,f,l);else if(h=="strength")m=new hw(f,f,l);else if(h=="damping")m=new uw(f,f,l);else if(h=="mass")m=new dw(f,f,l);else if(h=="wind")m=new fw(f,f,l);else if(h=="gravity")m=new mw(f,f,l);else if(h=="mix")m=new pw(f,f,l);else continue;r.push(Ts(u,m,0,1))}}if(e.attachments)for(let a in e.attachments){let c=e.attachments[a],l=i.findSkin(a);if(!l)throw new Error("Skin not found: "+a);for(let h in c){let u=c[h],d=i.findSlot(h);if(!d)throw new Error("Slot not found: "+h);let f=d.index;for(let m in u){let p=u[m],g=l.getAttachment(f,m);for(let x in p){let v=p[x],y=v[0];if(y){if(x=="deform"){let S=g.bones,C=g.vertices,w=S?C.length/3*2:C.length,b=new sw(v.length,v.length,f,g),_=se(y,"time",0);for(let A=0,P=0;;A++){let E,R=se(y,"vertices",null);if(!R)E=S?Pe.newFloatArray(w):C;else{E=Pe.newFloatArray(w);let $=se(y,"offset",0);if(Pe.arrayCopy(R,0,E,$,R.length),n!=1)for(let X=$,D=X+R.length;X=0;x--)d[x]==-1&&(d[x]=m[--g])}a.setFrame(l,se(u,"time",0),d)}r.push(a)}if(e.events){let a=new Ap(e.events.length),c=0;for(let l=0;l"u"&&(Math.fround=(function(s){return function(e){return s[0]=e,s[0]}})(new Float32Array(1)));if(typeof window<"u"&&window.PIXI){let s=window.require;window.require=e=>{if(s)return s(e);if(e.startsWith("@pixi/"))return window.PIXI}}const Cn=class Cn extends hP{constructor(t){super(t.resource.source);M(this,"texture");this.texture=Ke.from(t)}static from(t){return Cn.textureMap.has(t)?Cn.textureMap.get(t):new Cn(t)}setFilters(t,i){this.texture.baseTexture.scaleMode=Cn.toPixiTextureFilter(t),this.texture.baseTexture.mipmap=Cn.toPixiMipMap(t)}setWraps(t,i){this.texture.baseTexture.wrapMode=Cn.toPixiTextureWrap(t)}dispose(){this.texture.destroy()}static toPixiTextureFilter(t){switch(t){case yi.Nearest:case yi.MipMapNearestLinear:case yi.MipMapNearestNearest:return Rs.NEAREST;case yi.Linear:case yi.MipMapLinearLinear:case yi.MipMapLinearNearest:return Rs.LINEAR;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiMipMap(t){switch(t){case yi.Nearest:case yi.Linear:return vs.OFF;case yi.MipMapNearestLinear:case yi.MipMapNearestNearest:case yi.MipMapLinearLinear:case yi.MipMapLinearNearest:return vs.ON;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiTextureWrap(t){switch(t){case Vn.ClampToEdge:return Os.CLAMP;case Vn.MirroredRepeat:return Os.MIRRORED_REPEAT;case Vn.Repeat:return Os.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(t)}`)}}static toPixiBlending(t){switch(t){case wr.Normal:return We.NORMAL;case wr.Additive:return We.ADD;case wr.Multiply:return We.MULTIPLY;case wr.Screen:return We.SCREEN;default:throw new Error(`Unknown blendMode: ${String(t)}`)}}};M(Cn,"textureMap",new Map);let mo=Cn;const En=class En extends bl{constructor(){const t=new Mp;t.getBuffer("aVertexPosition").static=!1,t.getBuffer("aTextureCoord").static=!1;const i=new ph(Ke.EMPTY);super(t,i);M(this,"name","");M(this,"warnedTwoTint",!1)}updateFromSpineData(t,i,n,r,o,a,c,l){var x,v;this.texture=t.texture;const h=o/(l?12:8)*2,u=this.geometry.getBuffer("aTextureCoord");((x=u.data)==null?void 0:x.length)!==h&&(u.data=new Float32Array(h));const d=this.geometry.getBuffer("aVertexPosition");((v=d.data)==null?void 0:v.length)!==h&&(d.data=new Float32Array(h));let f=0,m=u.data,p=d.data;for(let y=0;ynew _m);M(this,"beforeUpdateWorldTransforms",()=>{});M(this,"afterUpdateWorldTransforms",()=>{});M(this,"_autoUpdate",!1);M(this,"_ticker",Yi.shared);M(this,"meshesCache",new Map);M(this,"lightColor",new lt);M(this,"darkColor",new lt);M(this,"_boundsProvider");M(this,"_boundsPoint",new St);M(this,"_boundsSpineID",-1);M(this,"_boundsSpineDirty",!0);M(this,"slotsObject",new Map);M(this,"verticesCache",Pe.newFloatArray(1024));M(this,"clippingSlotToPixiMasks",{});M(this,"currentClippingSlot");const n=t instanceof Sh?t:t.skeletonData;this.skeleton=new Ip(n);const r=new cP(n);this.state=new nP(r),(t==null?void 0:t.darkTint)!==void 0||(i==null?void 0:i.slotMeshFactory)===void 0?(this.darkTint=(t==null?void 0:t.darkTint)===void 0?this.skeleton.slots.some(o=>!!o.data.darkColor):t==null?void 0:t.darkTint,this.darkTint&&(this.slotMeshFactory=()=>new tl)):this.initializeMeshFactory(i==null?void 0:i.slotMeshFactory),t!=null&&t.ticker&&(this._ticker=t.ticker),this.autoUpdate=(t==null?void 0:t.autoUpdate)??!0,this.boundsProvider=t.boundsProvider}get debug(){return this._debug}set debug(t){this._debug&&this._debug.unregisterSpine(this),t&&t.registerSpine(this),this._debug=t}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t&&!this._autoUpdate?this._ticker.add(this.internalUpdate,this):!t&&this._autoUpdate&&this._ticker.remove(this.internalUpdate,this),this._autoUpdate=t}get ticker(){return this._ticker}set ticker(t){t=t??Yi.shared,this._ticker!==t&&(this._autoUpdate&&(this._ticker.remove(this.internalUpdate,this),t.add(this.internalUpdate,this)),this._ticker=t)}get boundsProvider(){return this._boundsProvider}set boundsProvider(t){this._boundsProvider=t,t?(this._boundsSpineID=-1,this._boundsSpineDirty=!0,this.interactiveChildren=!1):(this.interactiveChildren=!0,this.hitArea=null),this.hasNeverUpdated||this.calculateBounds()}initializeMeshFactory(t){if(t){this.slotMeshFactory=t;const i=this.slotMeshFactory();i instanceof tl&&(this.darkTint=!0),i.destroy()}else for(let i=0;inew tl,this.darkTint=!0;break}}update(t){this.internalUpdate(0,t)}internalUpdate(t,i){this.hasNeverUpdated=!1;const n=i??this._ticker.deltaMS/1e3;this.state.update(n),this.state.apply(this.skeleton),this.beforeUpdateWorldTransforms(this),this.skeleton.update(n),this.skeleton.updateWorldTransform(pr.update),this.afterUpdateWorldTransforms(this)}updateTransform(){var t;this.renderMeshes(),this.sortChildren(),(t=this.debug)==null||t.renderDebug(this),super.updateTransform()}destroy(t){var i;this.autoUpdate&&(this.autoUpdate=!1),this._ticker=null;for(const[,n]of this.meshesCache)n==null||n.destroy();this.state.clearListeners(),this.debug=void 0,this.meshesCache.clear(),this.slotsObject.clear();for(let n in this.clippingSlotToPixiMasks)(i=this.clippingSlotToPixiMasks[n].mask)==null||i.destroy(),delete this.clippingSlotToPixiMasks[n];super.destroy(t)}resetMeshes(){for(const[,t]of this.meshesCache)t.zIndex=-1,t.visible=!1}_calculateBounds(){this.hasNeverUpdated&&(this.internalUpdate(0,0),this.renderMeshes())}hasMeshForSlot(t){return this.meshesCache.has(t)}getMeshForSlot(t){if(this.hasMeshForSlot(t)){let i=this.meshesCache.get(t);return i.visible=!0,i}else{let i=this.slotMeshFactory();return this.addChild(i),this.meshesCache.set(t,i),i}}getSlotFromRef(t){let i;if(typeof t=="number"?i=this.skeleton.slots[t]:typeof t=="string"?i=this.skeleton.findSlot(t):i=t,!i)throw new Error(`No slot found with the given slot reference: ${t}`);return i}addSlotObject(t,i,n){var a;let r=this.getSlotFromRef(t);const o=(a=this.slotsObject.get(r))==null?void 0:a.container;if(!(o&&o===i)){for(const[c,{container:l}]of this.slotsObject)if(c!==r&&l===i){this.removeSlotObject(c,i);break}o&&this.removeChild(o),this.slotsObject.set(r,{container:i,followAttachmentTimeline:(n==null?void 0:n.followAttachmentTimeline)||!1,followSlotColor:(n==null?void 0:n.followSlotColor)||!1}),this.addChild(i)}}getSlotObject(t){const i=this.slotsObject.get(this.getSlotFromRef(t));return i?i.container:void 0}removeSlotObject(t,i){var o;let n=this.getSlotFromRef(t),r=(o=this.slotsObject.get(n))==null?void 0:o.container;r&&(i&&i!==r||(this.removeChild(r),this.slotsObject.delete(n)))}removeSlotObjects(){for(const[,t]of this.slotsObject)t.container.removeFromParent();this.slotsObject.clear()}updateSlotObject(t,i,n){const{container:r,followAttachmentTimeline:o}=t,a=o?!!i.attachment:!0;if(r.visible=this.skeleton.drawOrder.includes(i)&&a,r.visible){let c=i.bone;const l=r.localTransform;l.a=c.a,l.b=c.c,l.c=-c.b,l.d=-c.d,l.tx=c.worldX,l.ty=c.worldY,r.transform.setFromMatrix(l),r.zIndex=n,r.alpha=this.skeleton.color.a*i.color.a,t.followSlotColor&&this.setSlotObjectTint(r,255*this.skeleton.color.r*i.color.r<<16|255*this.skeleton.color.g*i.color.g<<8|255*this.skeleton.color.b*i.color.b)}}setSlotObjectTint(t,i){const n=t;"tint"in n&&(n.tint=i);for(const r of n.children??[])this.setSlotObjectTint(r,i)}updateAndSetPixiMask(t,i){var a,c;const n=t.attachment;if(n&&n instanceof na){const l=(a=this.clippingSlotToPixiMasks)[c=t.data.name]||(a[c]={slot:t,vertices:new Array});l.maskComputed=!1,this.currentClippingSlot=l;return}let r=this.currentClippingSlot;const o=this.slotsObject.get(t);if(r&&o){let l=r.mask;if(l||(l=Jv.obtain(),r.mask=l,this.addChild(l)),!r.maskComputed){let h=r.slot,u=h.attachment;r.maskComputed=!0;const d=u.worldVerticesLength,f=r.vertices;u.computeWorldVertices(h,0,d,f,0,2),l.clear().lineStyle(0).beginFill(0).drawPolygon(f).endFill()}o.container.mask=l}else o!=null&&o.container.mask&&(o.container.mask=null);if(r&&r.slot.attachment.endSlot==t.data&&(this.currentClippingSlot=void 0),i){for(const l in this.clippingSlotToPixiMasks){const h=this.clippingSlotToPixiMasks[l];(!(h.slot.attachment instanceof na)||!h.maskComputed)&&h.mask&&(this.removeChild(h.mask),Jv.free(h.mask),h.mask=void 0)}this.currentClippingSlot=void 0}}renderMeshes(){var r,o;this.resetMeshes();let t=null,i=null;const n=this.skeleton.drawOrder;for(let a=0,c=n.length,l=0;a>1)*m,v>this.verticesCache.length&&(this.verticesCache=Pe.newFloatArray(v)),y.computeWorldVertices(h,0,y.worldVerticesLength,this.verticesCache,0,m),t=y.triangles,i=y.uvs,x=(o=y.region)==null?void 0:o.texture}else if(p instanceof na){Mt.clipper.clipStart(h,p);continue}else{this.hasMeshForSlot(h)&&(this.getMeshForSlot(h).visible=!1),Mt.clipper.clipEndWithSlot(h);continue}if(x!=null){const S=h.bone.skeleton.color,C=h.color,w=S.a*C.a*g.a;this.lightColor.set(S.r*C.r*g.r,S.g*C.g*g.g,S.b*C.b*g.b,w),h.darkColor!=null?this.darkColor.set(h.darkColor.r,h.darkColor.g,h.darkColor.b,1):this.darkColor.set(0,0,0,1);let b,_,A,P;if(Mt.clipper.isClipping())Mt.clipper.clipTriangles(this.verticesCache,t,t.length,i,this.lightColor,this.darkColor,f),b=Mt.clipper.clippedVertices,_=b.length,A=Mt.clipper.clippedTriangles,P=A.length;else{const R=this.verticesCache;for(let O=2,U=0,Y=v;Onew Ni);Ip.yDown=!0;const wc="spineTextureAtlasLoader",nk={extension:ke.Asset,resolver:{test:s=>Ki(s,".atlas"),parse:s=>{var t,i;const e=s.split(".");return{resolution:parseFloat(((i=(t=Be.RETINA_PREFIX)==null?void 0:t.exec(s))==null?void 0:i[1])??"1"),format:e[e.length-2],src:s}}},loader:{name:wc,extension:{type:ke.LoadParser,priority:os.Normal,name:wc},test(s){return Ki(s,".atlas")},async load(s){const e=await Be.ADAPTER.fetch(s);if(!e.ok)throw new Error(`[${wc}] Failed to fetch ${s}: ${e.status} ${e.statusText}`);return await e.text()},testParse(s,e){const t=Ki(e.src,".atlas"),i=typeof s=="string",n=e.loadParser===wc;return Promise.resolve((t||n)&&i)},unload(s){s.dispose()},async parse(s,e,t){var c;const i=e.data||{};let n=si.dirname(e.src);n&&n.lastIndexOf("/")!==n.length-1&&(n+="/");const r=new ww(s);if(i.images instanceof it||typeof i.images=="string"){const l=i.images;i.images={},i.images[r.pages[0].name]=l}const o=[];let a=!0;for(const l of t.parsers)if(l.name=="loadTextures"){a=(c=l.config)==null?void 0:c.preferCreateImageBitmap;break}ln.setPreferences({preferCreateImageBitmap:!1});for(const l of r.pages){const h=l.name,u=i!=null&&i.images?i.images[h]:void 0;if(u instanceof it)l.setTexture(mo.from(u));else{const d=u??si.normalize([...n.split(si.sep),h].join(si.sep)),f={src:hh(d,e.src),data:{...i.imageMetadata,alphaMode:l.pma?bi.PMA:bi.UNPACK}},m=t.load(f).then(p=>{l.setTexture(mo.from(p.baseTexture))});o.push(m)}}return await Promise.all(o),ln.setPreferences({preferCreateImageBitmap:a}),r}}};$e.add(nk);const Sc="spineSkeletonLoader";function rk(s){return s.hasOwnProperty("bones")}function ok(s){return s instanceof Uint8Array}const ak={extension:ke.Asset,loader:{name:Sc,extension:{type:ke.LoadParser,priority:os.Normal,name:Sc},test(s){return Ki(s,".skel")},async load(s){const e=await Be.ADAPTER.fetch(s);if(!e.ok)throw new Error(`[${Sc}] Failed to fetch ${s}: ${e.status} ${e.statusText}`);return new Uint8Array(await e.arrayBuffer())},testParse(s,e){const t=Ki(e.src,".json")&&rk(s),i=Ki(e.src,".skel")&&ok(s),n=e.loadParser===Sc;return Promise.resolve(t||i||n)}}};$e.add(ak);class lk extends fn{constructor(t=!1){super();M(this,"_buffer");M(this,"_indexBuffer");this._buffer=new $t(void 0,t,!1),this._indexBuffer=new $t(void 0,t,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Ue.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Ue.FLOAT).addAttribute("aColor",this._buffer,4,!0,Ue.UNSIGNED_BYTE).addAttribute("aDarkColor",this._buffer,4,!0,Ue.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Ue.FLOAT).addIndex(this._indexBuffer)}}const ck=` +precision highp float; +attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; +attribute vec4 aColor; +attribute vec4 aDarkColor; +attribute float aTextureId; + +uniform mat3 projectionMatrix; +uniform mat3 translationMatrix; +uniform vec4 tint; + +varying vec2 vTextureCoord; +varying vec4 vColor; +varying vec4 vDarkColor; +varying float vTextureId; + +void main(void){ + gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + + vTextureCoord = aTextureCoord; + vTextureId = aTextureId; + vColor = aColor * tint; + vDarkColor = aDarkColor * tint; + +} +`,hk=` +varying vec2 vTextureCoord; +varying vec4 vColor; +varying vec4 vDarkColor; +varying float vTextureId; +uniform sampler2D uSamplers[%count%]; + +void main(void){ + vec4 color; + %forloop% + + + gl_FragColor.a = color.a * vColor.a; + gl_FragColor.rgb = ((color.a - 1.0) * vDarkColor.a + 1.0 - color.rgb) * vDarkColor.rgb + color.rgb * vColor.rgb; +} +`;class Ow extends cr{constructor(e){super(e),this.shaderGenerator=new bb(ck,hk),this.geometryClass=lk,this.vertexSize=7}packInterleavedGeometry(e,t,i,n,r){const{uint32View:o,float32View:a}=t,c=n/this.vertexSize,l=e.uvs,h=e.indices,u=e.vertexData,d=e._texture.baseTexture._batchLocation,f=Math.min(e.worldAlpha,1),m=At.shared.setValue(e._tintRGB).toPremultiplied(f,!0),p=At.shared.setValue(e._darkTintRGB).premultiply(f,!0).toPremultiplied(1,!1);for(let g=0;g0){let o=function(l){return Promise.all(l.map(h=>Promise.resolve(h).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));n=o(t.map(l=>{if(l=pk(l),l in Qv)return;Qv[l]=!0;const h=l.endsWith(".css"),u=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const d=document.createElement("link");if(d.rel=h?"stylesheet":mk,h||(d.as="script"),d.crossOrigin="",d.href=l,c&&d.setAttribute("nonce",c),document.head.appendChild(d),h)return new Promise((f,m)=>{d.addEventListener("load",f),d.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}function r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return n.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})};async function Bw(){const[s,e]=await Promise.all([ey(()=>import("./index-CT90mgj8.js"),[]),ey(()=>import("./index-8-FN8Glu.js"),__vite__mapDeps([0,1]))]);return{core:s,pixi:e}}async function gk(s,e,t){const{core:i,pixi:n}=await Bw(),r=new i.TextureAtlas(e);return Rp(r,t,n.SpineTexture),{skeletonData:new i.SkeletonJson(new i.AtlasAttachmentLoader(r)).readSkeletonData(s),SpineClass:n.Spine}}async function vk(s,e,t){const{core:i,pixi:n}=await Bw(),r=new i.TextureAtlas(e);return Rp(r,t,n.SpineTexture),{skeletonData:new i.SkeletonBinary(new i.AtlasAttachmentLoader(r)).readSkeletonData(s),SpineClass:n.Spine}}function gr(s,e,t){const i=Number(s[e]);return Number.isFinite(i)?i:t}function qi(s,e,t,i){s[e]==null&&(s[e]=gr(s,t,i))}function Pp(s,e,t){if(typeof s.curve!="number")return;const i=gr(s,"time",0),r=gr(e,"time",0)-i,o=s.curve,a=gr(s,"c2",0),c=gr(s,"c3",1),l=gr(s,"c4",1);s.curve=t.flatMap(([h,u])=>[i+r*o,h+(u-h)*a,i+r*c,h+(u-h)*l]),delete s.c2,delete s.c3,delete s.c4}function Sr(s,e){if(Array.isArray(s))for(let t=0;t[gr(i,r,o),gr(n,r,o)]))}}function yk(s){if(Array.isArray(s))for(let e=0;eNumber.parseInt(i.slice(r,r+2),16)/255);return e?n:n.slice(0,3)}function ty(s,e){if(Array.isArray(s))for(let t=0;t[a,o[c]]))}}function xk(s){for(const e of s.bones||[])e.inherit==null&&e.transform!=null&&(e.inherit=e.transform);for(const e of s.transform||[])qi(e,"mixRotate","rotateMix",1),qi(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX),qi(e,"mixScaleX","scaleMix",1),e.mixScaleY==null&&(e.mixScaleY=e.mixScaleX),qi(e,"mixShearY","shearMix",1);for(const e of s.path||[])qi(e,"mixRotate","rotateMix",1),qi(e,"mixX","translateMix",1),e.mixY==null&&(e.mixY=e.mixX)}function bk(s){for(const e of s.skins||[])for(const t of Object.values(e.attachments||{}))for(const i of Object.values(t||{}))i.parent!=null&&i.timelines==null&&i.deform!=null&&(i.timelines=i.deform)}function wk(s){for(const e of Object.values(s.slots||{}))e.color&&!e.rgba&&(e.rgba=e.color,delete e.color),e.twoColor&&!e.rgba2&&(e.rgba2=e.twoColor,delete e.twoColor),ty(e.rgba,!1),ty(e.rgba2,!0)}function Sk(s){for(const e of Object.values(s.bones||{})){for(const t of e.rotate||[])qi(t,"value","angle",0);Sr(e.rotate,[{key:"value",fallback:0}]),Sr(e.translate,[{key:"x",fallback:0},{key:"y",fallback:0}]),Sr(e.scale,[{key:"x",fallback:1},{key:"y",fallback:1}]),Sr(e.shear,[{key:"x",fallback:0},{key:"y",fallback:0}])}}function Mk(s){for(const e of Object.values(s.ik||{}))Sr(e,[{key:"mix",fallback:1},{key:"softness",fallback:0}])}function Tk(s){for(const e of Object.values(s.transform||{})){for(const t of e)qi(t,"mixRotate","rotateMix",1),qi(t,"mixX","translateMix",1),t.mixY==null&&(t.mixY=t.mixX),qi(t,"mixScaleX","scaleMix",1),t.mixScaleY==null&&(t.mixScaleY=t.mixScaleX),qi(t,"mixShearY","shearMix",1);Sr(e,[{key:"mixRotate",fallback:1},{key:"mixX",fallback:1},{key:"mixY",fallback:1},{key:"mixScaleX",fallback:1},{key:"mixScaleY",fallback:1},{key:"mixShearY",fallback:1}])}}function _k(s){for(const e of Object.values(s.path||{})){for(const i of["position","spacing"]){const n=e[i];for(const r of n||[])qi(r,"value",i,0);Sr(n,[{key:"value",fallback:0}])}const t=e.mix;for(const i of t||[])qi(i,"mixRotate","rotateMix",1),qi(i,"mixX","translateMix",1),i.mixY==null&&(i.mixY=i.mixX);Sr(t,[{key:"mixRotate",fallback:1},{key:"mixX",fallback:1},{key:"mixY",fallback:1}])}}function Ck(s){if(!s.deform)return;const e=s.attachments||(s.attachments={});for(const[t,i]of Object.entries(s.deform)){const n=e[t]||(e[t]={});for(const[r,o]of Object.entries(i)){const a=n[r]||(n[r]={});for(const[c,l]of Object.entries(o)){const h=a[c]||(a[c]={});h.deform=l,yk(l)}}}delete s.deform}function Nw(s){xk(s),bk(s);for(const e of Object.values(s.animations||{}))wk(e),Sk(e),Mk(e),Tk(e),_k(e),Ck(e),!e.drawOrder&&e.draworder&&(e.drawOrder=e.draworder);return s}function Ek(s){return s.replace(/\\/g,"/").split("/").pop()||s}async function Ak(s){const e=await Promise.all(s.map(async t=>{const i=URL.createObjectURL(t);try{return[Ek(t.name).toLowerCase(),await Ke.fromURL(i)]}finally{URL.revokeObjectURL(i)}}));return new Map(e)}function Ik(s){const e=new Map;return s.bones.map(t=>{var r;const i=((r=t.parent)==null?void 0:r.name)||null,n=i?(e.get(i)||0)+1:0;return e.set(t.name,n),{name:t.name,parent:i,depth:n}})}function Rk(s){return s.slots.map(e=>{var t;return{name:e.name,order:Number(e.index)||0,bone:((t=e.boneData)==null?void 0:t.name)||"",attachment:e.attachmentName||""}})}async function Dw(s,e,t){var o;if(!/\.(json|skel)$/i.test(s.name))throw new Error("Spine 数据仅支持 .json 或 .skel");if(!/\.atlas$/i.test(e.name))throw new Error("图集文件仅支持 .atlas");if(!t.length)throw new Error("请至少选择一张纹理图片");const i=await e.text(),n=await Ak(t),r=[...n.values()];try{let a,c,l=null,h;if(/\.skel$/i.test(s.name)){const u=await s.arrayBuffer();try{({skeletonData:a,SpineClass:c}=await vk(u,i,n)),h="4.3"}catch(d){try{({skeletonData:a,SpineClass:c}=fk(u,i,n)),h="4.2"}catch(f){const m=d instanceof Error?d.message:String(d),p=f instanceof Error?f.message:String(f);throw new Error(`Spine 二进制解析失败(4.3:${m};旧版:${p})`)}}l=yh(a.version)}else{let u;try{u=JSON.parse(await s.text())}catch{throw new Error("Spine JSON 文件格式无效")}if(l=yh((o=u==null?void 0:u.skeleton)==null?void 0:o.spine),!l)throw new Error(`Spine JSON 版本不受支持,仅支持 ${xm()}`);h=RR(l),l==="3.8"&&Nw(u);const d=h==="4.3"?await gk(u,i,n):dk(u,i,n);a=d.skeletonData,c=d.SpineClass}if(!l)throw new Error(`Spine 数据版本不受支持,仅支持 ${xm()}`);return{skeletonData:a,textures:r,runtimeVersion:h,SpineClass:c,dataVersion:l,animations:a.animations.map(u=>({name:u.name,duration:u.duration})),bones:Ik(a),slots:Rk(a)}}catch(a){for(const c of r)c.destroy(!0);throw a}}function $c(s){return new Promise((e,t)=>{const i=new FileReader;i.onload=()=>e(String(i.result||"")),i.onerror=()=>t(i.error),i.readAsDataURL(s)})}async function Pk(s,e,t){return{skeleton:{name:s.name,dataUrl:await $c(s)},atlas:{name:e.name,dataUrl:await $c(e)},textures:await Promise.all(t.map(async i=>({name:i.name,dataUrl:await $c(i)})))}}async function gf(s){const e=await fetch(s.dataUrl);if(!e.ok)throw new Error(`无法读取内嵌 Spine 文件:${s.name}`);return new File([await e.blob()],s.name)}async function kk(s){return{skeleton:await gf(s.skeleton),atlas:await gf(s.atlas),textures:await Promise.all(s.textures.map(gf))}}const Uw="SpineParticle.EditorConfig",$w=1;function Xw(s){return{backgroundX:s.backgroundX,backgroundY:s.backgroundY,backgroundOpacity:s.backgroundOpacity,backgroundImageName:s.backgroundImageName,backgroundImageData:s.backgroundImageData,showGrid:s.showGrid,exportSettings:Vt(s.exportSettings)}}function Fk(s){return JSON.parse(JSON.stringify(s,(e,t)=>{if(!(e==="texture"||e==="trailTexture"||e==="frames"))return t}))}function Vw(s){const e=Vt(s);return delete e.tags,delete e.selectedTag,e}function Ok(s){const e=Xw(s.settings),t=s.timeline.playbackEnd>=Math.max(1,s.timeline.totalFrames-1);return Fk({format:Uw,version:$w,savedAt:new Date().toISOString(),editor:Vt(s.editor),settings:e,timeline:{fps:s.timeline.fps,loop:s.timeline.loop,playbackStart:s.timeline.playbackStart,playbackEnd:s.timeline.playbackEnd,playbackEndAuto:t,abLoop:s.timeline.abLoop,animations:[...s.timeline.animations]},selection:{type:s.activeObjectType,id:s.activeObjectId},scene:{systems:s.systems.map(i=>({...Vt(i),frames:void 0})),colliders:s.colliders.map(Vw),paths:Vt(s.paths),spines:Vt(s.spines)}})}function Lk(s,e,t,i){const n=Math.max(1,i);let r=0;for(const o of s){const a=o.config,c=Math.max(0,Number(a.lifeMin)||0),l=Math.max(0,Number(a.lifeMax)||0),h=a.lifeMode==="fixed"?c:Math.max(c,l),u=a.mode==="stream"?a.streamBehavior==="loop"?Ps(a,n).total/n:Math.max(1/n,Number(a.duration)||0):0;let d=Math.max(0,Number(a.delay)||0)+u+h;a.mode==="stream"&&a.streamBehavior==="loop"&&(d=Math.max(0,Number(a.delay)||0)+Ps(a,n).total/n),r=Math.max(r,d)}for(const o of t){const a=o.animations.find(c=>c.name===o.selectedAnimation);a&&(r=Math.max(r,Math.max(0,Number(o.timeOffset)||0)+Math.max(0,a.duration||0)))}for(const o of e)o.followPath&&o.followPathId&&(r=Math.max(r,Math.max(0,o.followDuration)||0));return F1(r,n)}function Bk(){return`SpineParticle-${new Date().toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"").replace("T","-")}.json`}function Yw(s){const e=Ok(s),t=new Blob([JSON.stringify(e,null,2)],{type:"application/json;charset=utf-8"}),i=URL.createObjectURL(t),n=document.createElement("a");return n.href=i,n.download=Bk(),document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(i),0),e}function Gw(s){let e;try{e=JSON.parse(s)}catch{throw new Error("配置文件不是有效的 JSON")}const t=e;if(t.format!==Uw)throw new Error("不是 SpineParticle 编辑器配置文件");if(t.version!==$w)throw new Error(`暂不支持配置版本:${t.version??"未知"}`);if(!t.scene||!Array.isArray(t.scene.systems)||!Array.isArray(t.scene.colliders)||!Array.isArray(t.scene.paths)||!Array.isArray(t.scene.spines))throw new Error("配置文件缺少完整场景数据");return t}async function Nk(s){const e=new Map,t=n=>{const r=n==="/particles/star.png"?"/images/star.png":n==="/trails/trail.png"?"/images/trail.png":n||"/images/star.png";let o=e.get(r);return o||(o=Ke.fromURL(r).then(a=>vr(a)),e.set(r,o)),o},i=await t("/images/star.png");await Promise.all(s.map(async n=>{var o;const r=Xn(n.config);r.texture=i,await Promise.all(r.imageResources.map(async a=>{a.texture=await t(a.previewUrl||"/images/star.png"),await Promise.all(a.sequenceFrames.map(async c=>{c.texture=await t(c.previewUrl||a.previewUrl||"/images/star.png")}))})),await Promise.all(r.trailResources.map(async a=>{a.texture=await t(a.previewUrl||"/images/trail.png")})),r.trailTexture=((o=r.trailResources[0])==null?void 0:o.texture)||null,n.frames=[]}))}async function Dk(s){const e=new Map;try{for(const t of s){if(!t.sourceBundle)continue;const i=await kk(t.sourceBundle);e.set(t.id,await Dw(i.skeleton,i.atlas,i.textures))}return e}catch(t){for(const i of e.values())for(const n of i.textures)n.destroy(!0);throw t}}function Uk(s,e){const t=(e==null?void 0:e.type)||"particle",i=Number(e==null?void 0:e.id)||0;(t==="particle"?s.systems.some(r=>r.id===i):t==="collision"?s.colliders.some(r=>r.id===i):t==="path"?s.paths.some(r=>r.id===i):s.spines.some(r=>r.id===i))?s.selectSceneObject(t,i):s.systems[0]?s.selectSceneObject("particle",s.systems[0].id):s.colliders[0]?s.selectSceneObject("collision",s.colliders[0].id):s.paths[0]?s.selectSceneObject("path",s.paths[0].id):s.spines[0]?s.selectSceneObject("spine",s.spines[0].id):(s.activeObjectType="particle",s.activeObjectId=0,s.activeId=0)}async function $k(s,e){var d,f,m,p,g,x,v,y,S;const t=Gw(JSON.stringify(e)),i=Vt(t.scene.systems),n=t.scene.colliders.map(Vw),r=Vt(t.scene.paths),o=Vt(t.scene.spines);for(const C of o)C.sourceBundle==null&&(C.sourceBundle=null),C.dataVersion==null&&(C.dataVersion=""),Array.isArray(C.slots)||(C.slots=[]),typeof C.selectedBone!="string"&&(C.selectedBone=""),typeof C.selectedSlot!="string"&&(C.selectedSlot="");await Nk(i);const a=await Dk(o),c=new Map(s.spines.map(C=>[C.id,C.assetVersion]));for(const C of s.spines)Fl(C.id);s.systems=i,s.colliders=n,s.paths=r,s.spines=o,Object.assign(s.editor,Vt(t.editor||{}));const l=t.settings;if(l)for(const C of["backgroundX","backgroundY","backgroundOpacity","backgroundImageName","backgroundImageData","showGrid"])Object.prototype.hasOwnProperty.call(l,C)&&(s.settings[C]=l[C]);s.settings.exportSettings=I1((d=t.settings)==null?void 0:d.exportSettings),s.settings.undoLimit=Math.min(200,Math.max(1,Math.round(Number(s.settings.undoLimit)||20))),s.timeline.fps=Math.max(1,Math.round(Number((f=t.timeline)==null?void 0:f.fps)||30));const h=Math.max(1,Math.floor(Number((m=t.timeline)==null?void 0:m.playbackEnd)||Number.MAX_SAFE_INTEGER)),u=((p=t.timeline)==null?void 0:p.playbackEndAuto)??h>=Lk(i,n,o,s.timeline.fps);s.timeline.abLoop=((g=t.timeline)==null?void 0:g.abLoop)===!0,s.timeline.loop=((x=t.timeline)==null?void 0:x.loop)!==!1,s.timeline.animations=Array.isArray((v=t.timeline)==null?void 0:v.animations)&&t.timeline.animations.length?[...new Set(t.timeline.animations.filter(C=>typeof C=="string"&&C.trim()).map(C=>C.trim()))]:["animation"];for(const C of s.spines){const w=a.get(C.id);if(C.assetVersion=Math.max(Number(C.assetVersion)||0,c.get(C.id)||0)+1,!w){C.status="empty",C.error=C.skeletonFileName?"配置未包含可复用的 Spine 原始资源":"",C.animations=[],C.bones=[],C.slots=[],C.selectedAnimation="";continue}pu(C.id,w),C.dataVersion=w.dataVersion,C.animations=w.animations,C.bones=w.bones,C.slots=w.slots,w.animations.some(b=>b.name===C.selectedAnimation)||(C.selectedAnimation=((y=w.animations[0])==null?void 0:y.name)||""),C.status="ready",C.error=""}s.syncSceneSequences(),Uk(s,t.selection),s.timeline.playbackStart=Math.max(0,Math.floor(Number((S=t.timeline)==null?void 0:S.playbackStart)||0)),s.timeline.playbackEnd=h,s.timeline.frame=0,s.timeline.recorded=!1,s.timeline.playing=!0;for(const C of s.systems)s.timeline.animations.includes(C.animation)||(C.animation=s.timeline.animations[0]);return s.recalcTotalFrames(),u&&(s.timeline.playbackEnd=s.timeline.totalFrames-1),s.timeline.frame=s.timeline.playbackStart,t}async function jw(s,e){return $k(s,Gw(e))}async function Xk(s,e){if(!/\.json$/i.test(e.name))throw new Error("请选择 .json 配置文件");return jw(s,await e.text())}const yu=po({undoCount:0});let Ch=null,On=null,Tr=[],Ba=null,Ln=null,Eh=!1;function kp(s){return{systems:s.systems.map(t=>{const i=Vt(t);return i.frames=void 0,i}),colliders:Vt(s.colliders),paths:Vt(s.paths),spines:Vt(s.spines),animations:[...s.timeline.animations],settings:Xw(s.settings)}}function Fp(s){return JSON.stringify(s,(e,t)=>e==="texture"||e==="trailTexture"?null:typeof t=="string"&&t.startsWith("data:")&&t.length>256?`${t.length}:${t.slice(0,96)}:${t.slice(-48)}`:t)}function Hw(s,e=kp(s),t=Fp(e)){const i=new Map;for(const n of e.spines){const r=AR(n.id);r&&i.set(n.id,r)}return{data:e,signature:t,spineAssets:i}}function Ah(s){if(s){for(const e of s.spineAssets.values())CR(e);s.spineAssets.clear()}}function Ww(s){for(;Tr.length>s;)Ah(Tr.shift()||null);yu.undoCount=Tr.length}function zw(){const s=Ch;if(!s||!On||Eh)return;const e=kp(s),t=Fp(e);t!==On.signature&&(Tr.push(On),On=Hw(s,e,t),Ww(s.settings.undoLimit))}function Vk(){Eh||(Ln&&clearTimeout(Ln),Ln=setTimeout(()=>{Ln=null,zw()},250))}function Yk(s){const e=s.activeObjectId;return s.activeObjectType==="particle"?s.systems.some(t=>t.id===e):s.activeObjectType==="collision"?s.colliders.some(t=>t.id===e):s.activeObjectType==="path"?s.paths.some(t=>t.id===e):s.spines.some(t=>t.id===e)}function Gk(s){var t,i;if(!Yk(s)){const n=s.systems[0],r=s.colliders[0],o=s.paths[0],a=s.spines[0];n?(s.activeObjectType="particle",s.activeObjectId=n.id):r?(s.activeObjectType="collision",s.activeObjectId=r.id):o?(s.activeObjectType="path",s.activeObjectId=o.id):(s.activeObjectType="spine",s.activeObjectId=(a==null?void 0:a.id)||0)}const e=s.activeObjectType==="particle"?s.systems.find(n=>n.id===s.activeObjectId):s.systems.find(n=>n.id===s.activeId);s.activeId=(e==null?void 0:e.id)||((t=s.systems[0])==null?void 0:t.id)||0,s.timeline.animation=(e==null?void 0:e.animation)||((i=s.systems[0])==null?void 0:i.animation)||s.timeline.animations[0]||"animation"}function jk(s,e){const t=On;Eh=!0;try{for(const i of s.spines)Fl(i.id);s.systems=Vt(e.data.systems),s.colliders=Vt(e.data.colliders),s.paths=Vt(e.data.paths),s.spines=Vt(e.data.spines),s.timeline.animations=[...e.data.animations],Object.assign(s.settings,Vt(e.data.settings));for(const[i,n]of e.spineAssets)pu(i,n);for(const i of s.systems)i.frames=[];s.timeline.recorded=!1,s.timeline.playing=!1,Gk(s),s.recalcTotalFrames(),On=e}finally{Eh=!1,Ah(t)}}function Hk(s){if(!(Ch===s&&Ba)){Ba==null||Ba(),Ln&&clearTimeout(Ln),Ah(On);for(const e of Tr)Ah(e);Tr=[],Ch=s,On=Hw(s),yu.undoCount=0,Ba=ai(()=>Fp(kp(s)),Vk,{flush:"post"})}}function Wk(s,e){const t=Math.min(200,Math.max(1,Math.round(Number(e)||20)));s.settings.undoLimit=t,Ww(t)}function qw(){const s=Ch;if(!s||!On)return!1;Ln&&(clearTimeout(Ln),Ln=null),zw();const e=Tr.pop();return e?(jk(s,e),yu.undoCount=Tr.length,!0):!1}function zk(s){const e=s instanceof HTMLElement?s:null;return!!(e!=null&&e.closest('input, textarea, select, [contenteditable="true"]'))}function qk(s){function e(i){var r;const n=i.target instanceof Node?i.target:null;s.canvasFocused.value=!!n&&!!((r=s.canvasElement.value)!=null&&r.contains(n))}function t(i){const n=i.key.toLowerCase();if((i.ctrlKey||i.metaKey)&&!i.altKey&&n==="s"){i.preventDefault(),i.stopPropagation(),s.save();return}if((i.ctrlKey||i.metaKey)&&!i.altKey&&n==="z"){i.preventDefault(),i.stopPropagation(),s.undo();return}if(i.ctrlKey||i.metaKey||i.altKey||zk(i.target))return;if(n==="d"){i.preventDefault(),s.togglePlay();return}if(n==="s"){i.preventDefault(),s.toStart();return}if(!s.canvasFocused.value)return;const r={q:"",w:"translate",e:"rotate",r:"scale"};n in r&&(i.preventDefault(),s.setTool(r[n]))}ys(()=>{document.addEventListener("pointerdown",e,!0),window.addEventListener("keydown",t,!0)}),Al(()=>{document.removeEventListener("pointerdown",e,!0),window.removeEventListener("keydown",t,!0)})}const Kk={class:"help-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"help-title"},Zk={class:"help-body"},Jk=["aria-expanded"],Qk={class:"caret"},eF={class:"help-module-body"},tF=["aria-expanded"],iF={class:"caret"},sF={class:"help-module-body"},nF=["aria-expanded"],rF={class:"caret"},oF={class:"help-module-body"},aF=["aria-expanded"],lF={class:"caret"},cF={class:"help-module-body"},hF=["aria-expanded"],uF={class:"caret"},dF={class:"help-module-body"},fF=["aria-expanded"],mF={class:"caret"},pF={class:"help-module-body"},gF=["aria-expanded"],vF={class:"caret"},yF={class:"help-module-body"},xF=["aria-expanded"],bF={class:"caret"},wF={class:"help-module-body"},SF=["aria-expanded"],MF={class:"caret"},TF={class:"help-module-body"},_F=Zt({__name:"HelpDialog",props:{show:{type:Boolean}},emits:["close"],setup(s,{emit:e}){const t=e,i=Fe(Array.from({length:9},()=>!1));function n(){t("close")}function r(o){o.key==="Escape"&&n()}return ys(()=>window.addEventListener("keydown",r)),Rr(()=>window.removeEventListener("keydown",r)),(o,a)=>s.show?(q(),J("div",{key:0,class:"help-overlay",role:"presentation",onClick:qe(n,["self"])},[T("section",Kk,[T("header",{class:"help-head"},[a[9]||(a[9]=T("div",null,[T("h2",{id:"help-title"},"使用说明"),T("p",null,"从创建粒子到保存、导出的快速入门")],-1)),T("button",{class:"help-close","aria-label":"关闭使用说明",title:"关闭 (Esc)",onClick:n},"✕")]),T("div",Zk,[a[37]||(a[37]=is('

快速开始

  1. 创建对象:在左侧“场景对象”中用 +粒子 / +碰撞 / +路径 / +Spine 添加场景对象。
  2. 编辑粒子:选中某个粒子系统,依次调整“发射模式 → 发射器形状 → 粒子属性 → 外观与资源 → 修改器”。
  3. 查看效果:底部时间轴可播放、暂停、逐帧或拖动;修改任意参数后会自动重新计算。
  4. 保存与导出:用“保存配置”保留工程;“导出 Spine Json / images 包 / .spine 包”输出成品。

每个模块组标题右侧的“重置”可把该组参数恢复默认;系统设置会自动保存在当前浏览器。

常用操作

小眼睛
单独显示/隐藏对象;隐藏的粒子系统不会被导出。
+Copy
完整复制当前选中对象,方便对比不同参数。
背景图
上传参考图并调整位置和透明度,只用于画布预览。
系统设置
管理界面布局、辅助显示、刻度等,自动存入浏览器。
撤销/重做
Ctrl+Z 撤回一步;可达成的步数在系统设置中调整。
Spine 骨骼
在层级树搜索并选择骨骼,可用于粒子发射器跟随。

快捷键

Ctrl/⌘+Z撤回上一步
Ctrl/⌘+S保存配置
Q拖动画布
W位移工具
E旋转工具
R缩放工具
D播放 / 暂停
S回到第一帧

Q / W / E / R 需先点击画布;光标位于输入框时,单键快捷键不会触发。

功能模块详解
',3)),T("section",{class:Ce(["help-section help-module",{open:i.value[0]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[0]?"true":"false",onClick:a[0]||(a[0]=c=>i.value[0]=!i.value[0])},[a[10]||(a[10]=T("span",{class:"mnum"},"1",-1)),a[11]||(a[11]=T("span",{class:"mtitle"},"配置管理",-1)),T("span",Qk,ve(i.value[0]?"▾":"▸"),1)],8,Jk),ce(T("div",eF,[...a[12]||(a[12]=[is('
保存配置
把当前全部场景对象和参数保存为工程 JSON 文件(也支持 Ctrl+S)。
加载配置
选择本地配置文件,恢复完整工程。
预设
从下拉中选择已保存的预设快速套用;点击下拉即可刷新列表。
范围
配置只含对象与参数,不含“系统设置”;系统设置单独存于浏览器。
',1)])],512),[[Si,i.value[0]]])],2),T("section",{class:Ce(["help-section help-module",{open:i.value[1]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[1]?"true":"false",onClick:a[1]||(a[1]=c=>i.value[1]=!i.value[1])},[a[13]||(a[13]=T("span",{class:"mnum"},"2",-1)),a[14]||(a[14]=T("span",{class:"mtitle"},"场景对象",-1)),T("span",iF,ve(i.value[1]?"▾":"▸"),1)],8,tF),ce(T("div",sF,[...a[15]||(a[15]=[is('
粒子
核心对象。可设名称、位置 X/Y、偏移、旋转、缩放 X/Y,以及“随机种子”——相同种子可精确复现同一次效果。
碰撞
圆形/椭圆/矩形/多边形/自定义;启用开关、碰撞响应(物理弹跳/暂停/销毁)、弹性与摩擦,还可沿某条路径移动并带进度曲线。
路径
贝塞尔路径,可双击新建/删除锚点、拖手柄调曲线;内置圆/方/多边形/星形预设,支持闭合与颜色。
Spine
加载 .json+.atlas+.png 预览骨骼动画,可查看/搜索骨骼层级树,用于粒子“发射器跟随”。
通用
每个对象都有小眼睛显隐;“+Copy”可以复制当前对象;隐藏的粒子系统不会进入导出。
',1)])],512),[[Si,i.value[1]]])],2),T("section",{class:Ce(["help-section help-module",{open:i.value[2]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[2]?"true":"false",onClick:a[2]||(a[2]=c=>i.value[2]=!i.value[2])},[a[16]||(a[16]=T("span",{class:"mnum"},"3",-1)),a[17]||(a[17]=T("span",{class:"mtitle"},"发射模式",-1)),T("span",rF,ve(i.value[2]?"▾":"▸"),1)],8,nF),ce(T("div",oF,[...a[18]||(a[18]=[is('
持续
按“每秒发射数量”持续喷射;再分“常规持续”(发射时长)与“循环持续”(三段式:开始循环 / 纯循环 / 结束循环,可自动或自定义帧长,做到无缝衔接)。
爆发
一次性发射“单次数量”颗粒子。
延迟时间
粒子条左端位置,表示发射开始前的等待时间。
注意
循环持续模式不支持骨骼跟随和路径跟随;开关时会把跟随设置恢复默认。
',1)])],512),[[Si,i.value[2]]])],2),T("section",{class:Ce(["help-section help-module",{open:i.value[3]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[3]?"true":"false",onClick:a[3]||(a[3]=c=>i.value[3]=!i.value[3])},[a[19]||(a[19]=T("span",{class:"mnum"},"4",-1)),a[20]||(a[20]=T("span",{class:"mtitle"},"发射器形状",-1)),T("span",lF,ve(i.value[3]?"▾":"▸"),1)],8,aF),ce(T("div",cF,[...a[21]||(a[21]=[is('
形状
点 / 圆形 / 矩形 / 锥形 / 路径。
圆·锥
内半径与外半径,形成环形或锥形发射区;锥形额外有“锥形朝向”和“开口角度”。
矩形
“外框 − 内框”形成环带,可分别设置内外宽高。
路径
选一条场景路径作为出生线;出生分布可选等距固定或随机。
发射角度
固定 / 随机(基准角度 + 随机范围)/ 径向(圆、矩、锥中心向外)/ 垂直于路径 / 沿路径方向。
',1)])],512),[[Si,i.value[3]]])],2),T("section",{class:Ce(["help-section help-module",{open:i.value[4]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[4]?"true":"false",onClick:a[4]||(a[4]=c=>i.value[4]=!i.value[4])},[a[22]||(a[22]=T("span",{class:"mnum"},"5",-1)),a[23]||(a[23]=T("span",{class:"mtitle"},"粒子属性",-1)),T("span",uF,ve(i.value[4]?"▾":"▸"),1)],8,hF),ce(T("div",dF,[...a[24]||(a[24]=[T("dl",{class:"help-list"},[T("div",null,[T("dt",null,"初始参数"),T("dd",null,"生命周期、速度、缩放(统一或 X/Y 分离)、初始旋转(可跟随发射方向)。每个属性支持固定 / 随机 / 曲线三种取值。")]),T("div",null,[T("dt",null,"生命周期变化"),T("dd",null,"速度倍率、缩放倍率(统一/分离)、旋转速度,均可用“生命周期 → 倍率”曲线控制。")]),T("div",null,[T("dt",null,"曲线含义"),T("dd",null,"横轴为粒子生命周期 0→1,纵轴为倍率或对应数值。")])],-1)])],512),[[Si,i.value[4]]])],2),T("section",{class:Ce(["help-section help-module",{open:i.value[5]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[5]?"true":"false",onClick:a[5]||(a[5]=c=>i.value[5]=!i.value[5])},[a[25]||(a[25]=T("span",{class:"mnum"},"6",-1)),a[26]||(a[26]=T("span",{class:"mtitle"},"外观与资源",-1)),T("span",mF,ve(i.value[5]?"▾":"▸"),1)],8,fF),ce(T("div",pF,[...a[27]||(a[27]=[T("dl",{class:"help-list"},[T("div",null,[T("dt",null,"透明度"),T("dd",null,"曲线或固定;曲线模式可选“跟随导出 / 线性 / 贝塞尔”。")]),T("div",null,[T("dt",null,"图片资源"),T("dd",null,"“+”新增,可上传单图或序列帧;多张图片按权重随机。每张可调缩放、轴心、颜色(固定/随机/生命周期渐变)、混合模式(正常/相加/相乘/滤色)、独立透明度(关/固定/曲线)。")]),T("div",null,[T("dt",null,"序列帧"),T("dd",null,"播放方式:单次隐藏 / 单次定格 / 正向循环 / 反向循环,可设每秒帧数。")])],-1)])],512),[[Si,i.value[5]]])],2),T("section",{class:Ce(["help-section help-module",{open:i.value[6]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[6]?"true":"false",onClick:a[6]||(a[6]=c=>i.value[6]=!i.value[6])},[a[28]||(a[28]=T("span",{class:"mnum"},"7",-1)),a[29]||(a[29]=T("span",{class:"mtitle"},"修改器",-1)),T("span",vF,ve(i.value[6]?"▾":"▸"),1)],8,gF),ce(T("div",yF,[...a[30]||(a[30]=[is('
移动噪声
强度、波动范围、时间流速,让粒子轨迹产生抖动。
重力 / 风力
固定或随机强度、方向,以及生命周期内强度曲线。
力场
中心 X/Y、强度(正吸负斥)、半径、衰减(恒定/线性/反比)。
吸附
延迟后把粒子吸到指定点,到达范围即死亡;可直线或曲线。
拖尾
独立拖尾图片(多资源按权重)、旋转、拖尾骨骼数、拖尾比例;长度/宽度可固定或随机并支持放大;可加生命周期长度曲线与形状曲线;颜色/透明度可跟随粒子、固定或曲线。
发射器跟随
跟随某条路径(局部/世界、正/反向、进度曲线),或跟随 Spine 骨骼(选中的骨骼 + 偏移)。
碰撞 + 阻尼
选择场景中已启用的碰撞对象参与,并设置速度阻尼。
',1)])],512),[[Si,i.value[6]]])],2),T("section",{class:Ce(["help-section help-module",{open:i.value[7]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[7]?"true":"false",onClick:a[7]||(a[7]=c=>i.value[7]=!i.value[7])},[a[31]||(a[31]=T("span",{class:"mnum"},"8",-1)),a[32]||(a[32]=T("span",{class:"mtitle"},"导出设置",-1)),T("span",bF,ve(i.value[7]?"▾":"▸"),1)],8,xF),ce(T("div",wF,[...a[33]||(a[33]=[is('
图片路径
写入 Spine 的 images 路径,例如 ./images/。
Spine 版本
3.8 / 4.0 / 4.1 / 4.2 / 4.3。
关键帧曲线
线性或平滑贝塞尔;出生、死亡、突变仍使用阶跃关键帧。
导出 FPS
修改 FPS 会保持动画实际秒数不变;“不写 fps”只省略元数据。
其它
整数帧对齐、骨骼对象池、排除无内容动画。
导出按钮
“导出 Spine Json”生成骨骼动画文件;“导出 images 包”单独下载图片 ZIP;“导出 .spine 包”需要连接器。
',1)])],512),[[Si,i.value[7]]])],2),T("section",{class:Ce(["help-section help-module help-connector",{open:i.value[8]}])},[T("button",{type:"button",class:"help-module-head","aria-expanded":i.value[8]?"true":"false",onClick:a[8]||(a[8]=c=>i.value[8]=!i.value[8])},[a[34]||(a[34]=T("span",{class:"mnum"},"9",-1)),a[35]||(a[35]=T("span",{class:"mtitle"},"连接器(Spine 连接器)使用说明",-1)),T("span",MF,ve(i.value[8]?"▾":"▸"),1)],8,SF),ce(T("div",TF,[...a[36]||(a[36]=[is('

连接器用于把网页生成的 JSON 和图片,调用你电脑上已安装并激活的 Spine,转换成可编辑的 .spine 工程。

前置
电脑已安装并激活 Spine;并已启动桌面版连接器APP。
网页端
导出区状态显示“连接器可用 · Spine 已就绪”后,点击“导出 .spine 包”。
首次授权
生产网站首次连接会显示“授权当前网站”;点击后在本机确认页核对完整来源(协议 + 域名 + 端口),再点“允许此网站”。授权一次后本机会保存白名单。本地 127.0.0.1:5173 默认允许。
路径设置
连接器自动检测 Spine 安装位置;检测不到时可在桌面窗口手动指定:Windows 选 Spine.com,macOS 选 Spine.app/Contents/MacOS/Spine。
下载结果
得到 ZIP 包,内含 .spine 工程和图片目录(如 images/star.png)。
版本
连接器按请求与 JSON 内的版本自动匹配 3.8~4.3,使用最新可用补丁。
安全
仅监听本机 127.0.0.1:27843;授权与白名单保存在连接器里;文件在临时目录转换后清理,并有大小限制。
',2)])],512),[[Si,i.value[8]]])],2),a[38]||(a[38]=T("section",{class:"help-section help-export"},[T("h3",null,"配置与导出有什么区别?"),T("p",null,[T("b",null,"保存配置"),ft("会保存编辑器中的全部对象和参数,之后可以继续修改;"),T("b",null,"导出 Spine Json"),ft("只导出显示中的粒子系统,并把跟随、碰撞和拖尾结果烘焙为独立动画数据。")])],-1))])])])):xe("",!0)}}),Jt=(s,e)=>{const t=s.__vccOpts||s;for(const[i,n]of e)t[i]=n;return t},CF=Jt(_F,[["__scopeId","data-v-78204b9d"]]);function ra(s){const e=()=>{window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",e),window.removeEventListener("pointercancel",e)};window.addEventListener("pointermove",s),window.addEventListener("pointerup",e),window.addEventListener("pointercancel",e)}function ds(s,e,t){const i=s.holder.value,n=s.app(),r=i.getBoundingClientRect(),o=Math.max(1e-4,s.store.editor.viewScale),a=e-r.left,c=t-r.top;return{x:(a-n.screen.width/2-s.store.editor.viewX)/o,y:-(c-n.screen.height*.5-s.store.editor.viewY)/o}}function EF(s,e){const t=s.holder.value,i=s.app(),n=s.store,r=t.getBoundingClientRect(),o=e.clientX-r.left,a=e.clientY-r.top,c=e.deltaY<0?1.12:1/1.12,l=n.editor.viewScale,h=Math.max(.01,l*c),u=i.screen.width/2,d=i.screen.height*.5,f=n.editor.viewX,m=n.editor.viewY,p=(o-u-f)/l,g=(a-d-m)/l;n.editor.viewX=o-u-p*h,n.editor.viewY=a-d-g*h,n.editor.viewScale=h}function AF(s,e,t){const i=s.store,n=i.editor.viewX,r=i.editor.viewY;ra(o=>{i.editor.viewX=n+(o.clientX-e),i.editor.viewY=r+(o.clientY-t)})}function Kw(s,e){const t=Math.max(.01,s.store.editor.viewScale*e);s.store.editor.viewScale=t}function IF(s){Kw(s,1.2)}function RF(s){Kw(s,1/1.2)}function PF(s){s.store.editor.viewScale=1,s.store.editor.viewX=0,s.store.editor.viewY=0}function kF(s){s.store.editor.viewScale=1,s.store.editor.viewX=0,s.store.editor.viewY=0}function FF(s){s.store.settings.showGrid=!s.store.settings.showGrid}const OF={class:"topbar"},LF=["disabled"],BF={class:"tool-group"},NF={class:"tool-group"},DF={key:0,class:"background-panel"},UF=["disabled"],$F=["title"],XF={class:"background-position-row"},VF={class:"background-opacity-row"},YF={class:"zoom-pct"},GF=Zt({__name:"StageToolbar",props:{ctx:{},activeTool:{},showSettings:{type:Boolean},showHelp:{type:Boolean}},emits:["update:activeTool","update:showSettings","update:showHelp","clear-background","background-file"],setup(s,{emit:e}){const t=s,i=e,n=yo(),r=Fe(!1),o=Fe(null),a=Le(()=>n.settings.backgroundImageName);function c(p){i("update:activeTool",t.activeTool===p?"":p)}function l(){r.value=!r.value,r.value&&i("update:showSettings",!1)}function h(){const p=!t.showSettings;i("update:showSettings",p),p&&(r.value=!1)}function u(){i("update:showHelp",!0),r.value=!1,i("update:showSettings",!1)}function d(p){i("background-file",p)}function f(p=!0){o.value&&(o.value.value=""),i("clear-background",p)}function m(){qw()}return(p,g)=>(q(),J("div",OF,[T("button",{class:"settings-btn",onClick:h,title:"系统设置"},"系统设置"),T("button",{class:"undo-btn",disabled:I(yu).undoCount===0,onClick:m,title:"撤回上一步 (Ctrl+Z)"},"↶",8,LF),T("div",BF,[T("button",{class:Ce(["tool-btn",{on:s.activeTool===""}]),onClick:g[0]||(g[0]=x=>c("")),title:"拖动画布 (Q)"},"✋",2),T("button",{class:Ce(["tool-btn",{on:s.activeTool==="translate"}]),onClick:g[1]||(g[1]=x=>c("translate")),title:"位移 (W)"},"✥",2),T("button",{class:Ce(["tool-btn",{on:s.activeTool==="rotate"}]),onClick:g[2]||(g[2]=x=>c("rotate")),title:"旋转 (E)"},"⟳",2),T("button",{class:Ce(["tool-btn",{on:s.activeTool==="scale"}]),onClick:g[3]||(g[3]=x=>c("scale")),title:"缩放 (R)"},"⤢",2)]),T("div",NF,[T("button",{class:"tool-btn",onClick:g[4]||(g[4]=x=>I(IF)(s.ctx)),title:"放大"},"+"),T("button",{class:"tool-btn",onClick:g[5]||(g[5]=x=>I(RF)(s.ctx)),title:"缩小"},"-"),T("button",{class:"tool-btn",onClick:g[6]||(g[6]=x=>I(PF)(s.ctx)),title:"适配画布"},"⤢"),T("button",{class:Ce(["tool-btn",{on:I(n).settings.showGrid}]),onClick:g[7]||(g[7]=x=>I(FF)(s.ctx)),title:"切换网格"},"▦",2),T("button",{class:"tool-btn",onClick:g[8]||(g[8]=x=>I(kF)(s.ctx)),title:"重置视图"},"⟳")]),T("div",{class:"background-menu",onClick:g[14]||(g[14]=qe(()=>{},["stop"]))},[T("button",{class:Ce(["background-btn",{on:r.value}]),title:"背景图显示设置",onClick:l},"背景图",2),r.value?(q(),J("div",DF,[T("button",{class:"background-upload",onClick:g[9]||(g[9]=x=>{var v;return(v=o.value)==null?void 0:v.click()})},ve(a.value?"更换图像":"上传图像"),1),T("button",{class:"background-clear",disabled:!a.value,onClick:g[10]||(g[10]=x=>f())},"清除背景",8,UF),T("input",{ref_key:"backgroundFileInput",ref:o,class:"background-file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:d},null,544),T("div",{class:"background-file-name",title:a.value},ve(a.value||"未上传图像"),9,$F),T("div",XF,[T("label",null,[g[15]||(g[15]=T("span",null,"X",-1)),ce(T("input",{"onUpdate:modelValue":g[11]||(g[11]=x=>I(n).settings.backgroundX=x),type:"number",step:"1","aria-label":"背景图 X 偏移"},null,512),[[He,I(n).settings.backgroundX,void 0,{number:!0}]])]),T("label",null,[g[16]||(g[16]=T("span",null,"Y",-1)),ce(T("input",{"onUpdate:modelValue":g[12]||(g[12]=x=>I(n).settings.backgroundY=x),type:"number",step:"1","aria-label":"背景图 Y 偏移"},null,512),[[He,I(n).settings.backgroundY,void 0,{number:!0}]])])]),T("label",VF,[g[17]||(g[17]=T("span",null,"透明度",-1)),ce(T("input",{"onUpdate:modelValue":g[13]||(g[13]=x=>I(n).settings.backgroundOpacity=x),type:"range",min:"0",max:"1",step:"0.01","aria-label":"背景图透明度"},null,512),[[He,I(n).settings.backgroundOpacity,void 0,{number:!0}]]),T("b",null,ve(Math.round(I(n).settings.backgroundOpacity*100))+"%",1)])])):xe("",!0)]),T("button",{class:Ce(["help-btn",{on:s.showHelp}]),title:"查看使用说明",onClick:u},"使用说明",2),T("span",YF,ve(Math.round(I(n).editor.viewScale*100))+"%",1)]))}}),jF=Jt(GF,[["__scopeId","data-v-4749834a"]]),HF={key:0,class:"settings-panel"},WF={class:"sp-head"},zF={class:"sp-switch-row"},qF={class:"sp-switch-control"},KF={class:"sp-row"},ZF={class:"sp-chk"},JF={class:"sp-chk"},QF={class:"sp-row"},e3={class:"sp-row"},t3={class:"sp-chk"},i3={class:"sp-chk"},s3={class:"sp-row"},n3={class:"sp-row"},r3={class:"sp-row"},o3={class:"sp-hex"},a3={class:"sp-chk"},l3=Zt({__name:"StageSettingsPanel",props:{show:{type:Boolean}},emits:["close"],setup(s,{emit:e}){const t=e,i=yo();function n(o){Wk(i,Number(o.target.value))}function r(){i.settings.bonePointDrawSize=Math.min(10,Math.max(.1,Number(i.settings.bonePointDrawSize)||1)),i.settings.boneAxisDrawSize=Math.min(10,Math.max(.1,Number(i.settings.boneAxisDrawSize)||2))}return(o,a)=>s.show?(q(),J("div",HF,[T("div",WF,[a[15]||(a[15]=ft("系统设置 ",-1)),T("button",{class:"sp-close",onClick:a[0]||(a[0]=c=>t("close"))},"✕")]),a[29]||(a[29]=T("div",{class:"sp-section-title"},"界面布局",-1)),T("label",zF,[a[17]||(a[17]=T("span",null,"参数面板位置",-1)),T("span",qF,[ce(T("input",{type:"checkbox","onUpdate:modelValue":a[1]||(a[1]=c=>I(i).settings.parameterPanelOnRight=c),"aria-label":"参数面板显示在右侧"},null,512),[[wt,I(i).settings.parameterPanelOnRight]]),a[16]||(a[16]=T("span",{class:"sp-switch-ui","aria-hidden":"true"},null,-1)),T("b",null,ve(I(i).settings.parameterPanelOnRight?"右侧":"左侧"),1)])]),a[30]||(a[30]=T("div",{class:"sp-divider"},null,-1)),a[31]||(a[31]=T("div",{class:"sp-section-title"},"操作历史",-1)),T("label",KF,[a[18]||(a[18]=T("span",null,"最大撤回步数",-1)),ce(T("input",{class:"sp-num sp-undo-limit",type:"number",min:"1",max:"200","onUpdate:modelValue":a[2]||(a[2]=c=>I(i).settings.undoLimit=c),"aria-label":"最大撤回步数",onChange:n},null,544),[[He,I(i).settings.undoLimit,void 0,{number:!0}]])]),a[32]||(a[32]=T("div",{class:"sp-divider"},null,-1)),a[33]||(a[33]=T("div",{class:"sp-section-title"},"画布辅助显示",-1)),T("label",ZF,[ce(T("input",{type:"checkbox","onUpdate:modelValue":a[3]||(a[3]=c=>I(i).settings.showEmitter=c)},null,512),[[wt,I(i).settings.showEmitter]]),a[19]||(a[19]=ft("发射点",-1))]),T("label",JF,[ce(T("input",{type:"checkbox","onUpdate:modelValue":a[4]||(a[4]=c=>I(i).settings.showBones=c)},null,512),[[wt,I(i).settings.showBones]]),a[20]||(a[20]=ft("骨骼连线",-1))]),I(i).settings.showBones?(q(),J(_e,{key:0},[T("label",QF,[a[21]||(a[21]=T("span",null,"骨骼点绘制大小",-1)),ce(T("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":a[5]||(a[5]=c=>I(i).settings.bonePointDrawSize=c),"aria-label":"骨骼点绘制大小",onChange:r},null,544),[[He,I(i).settings.bonePointDrawSize,void 0,{number:!0}]])]),T("label",e3,[a[22]||(a[22]=T("span",null,"坐标轴绘制大小",-1)),ce(T("input",{class:"sp-num",type:"number",min:"0.1",max:"10",step:"0.1","onUpdate:modelValue":a[6]||(a[6]=c=>I(i).settings.boneAxisDrawSize=c),"aria-label":"坐标轴绘制大小",onChange:r},null,544),[[He,I(i).settings.boneAxisDrawSize,void 0,{number:!0}]])])],64)):xe("",!0),T("label",t3,[ce(T("input",{type:"checkbox","onUpdate:modelValue":a[7]||(a[7]=c=>I(i).settings.showSkinMesh=c)},null,512),[[wt,I(i).settings.showSkinMesh]]),a[23]||(a[23]=ft("蒙皮网格",-1))]),a[34]||(a[34]=T("div",{class:"sp-divider"},null,-1)),T("label",i3,[ce(T("input",{type:"checkbox","onUpdate:modelValue":a[8]||(a[8]=c=>I(i).settings.tickEnabled=c)},null,512),[[wt,I(i).settings.tickEnabled]]),a[24]||(a[24]=ft("启用刻度",-1))]),I(i).settings.tickEnabled?(q(),J(_e,{key:1},[T("label",s3,[a[25]||(a[25]=T("span",null,"刻度文字大小",-1)),ce(T("input",{type:"range",min:"8",max:"40",step:"1","onUpdate:modelValue":a[9]||(a[9]=c=>I(i).settings.axisFontSize=c)},null,512),[[He,I(i).settings.axisFontSize,void 0,{number:!0}]]),ce(T("input",{type:"number",min:"8",max:"40","onUpdate:modelValue":a[10]||(a[10]=c=>I(i).settings.axisFontSize=c),class:"sp-num"},null,512),[[He,I(i).settings.axisFontSize,void 0,{number:!0}]])]),T("label",n3,[a[26]||(a[26]=T("span",null,"刻度线粗细",-1)),ce(T("input",{type:"range",min:"1",max:"5",step:"0.5","onUpdate:modelValue":a[11]||(a[11]=c=>I(i).settings.tickWidth=c)},null,512),[[He,I(i).settings.tickWidth,void 0,{number:!0}]]),ce(T("input",{type:"number",min:"1",max:"5","onUpdate:modelValue":a[12]||(a[12]=c=>I(i).settings.tickWidth=c),class:"sp-num"},null,512),[[He,I(i).settings.tickWidth,void 0,{number:!0}]])]),T("label",r3,[a[27]||(a[27]=T("span",null,"坐标轴颜色",-1)),ce(T("input",{type:"color","onUpdate:modelValue":a[13]||(a[13]=c=>I(i).settings.axisColor=c),class:"sp-colr"},null,512),[[He,I(i).settings.axisColor]]),T("span",o3,ve(I(i).settings.axisColor),1)]),T("label",a3,[ce(T("input",{type:"checkbox","onUpdate:modelValue":a[14]||(a[14]=c=>I(i).settings.showAxisLabels=c)},null,512),[[wt,I(i).settings.showAxisLabels]]),a[28]||(a[28]=ft("显示刻度数值",-1))])],64)):xe("",!0),a[35]||(a[35]=T("div",{class:"sp-cache-note"},"整个系统设置会自动保存到当前浏览器",-1))])):xe("",!0)}}),c3=Jt(l3,[["__scopeId","data-v-1bba85d9"]]);class vf{constructor(){M(this,"sprite",null);M(this,"texture",null);M(this,"loadVersion",0)}createSprite(e){const t=new Pr(Ke.EMPTY);return t.anchor.set(.5),t.visible=!1,e.addChild(t),this.sprite=t,t}applyTransform(e,t,i){this.sprite&&(this.sprite.position.set(Number(e)||0,-(Number(t)||0)),this.sprite.alpha=Math.min(1,Math.max(0,Number(i)||0)))}async syncTexture(e){const t=++this.loadVersion;if(!e){this.sprite&&(this.sprite.texture=Ke.EMPTY,this.sprite.visible=!1),this.texture&&this.texture.destroy(!0),this.texture=null;return}try{const i=await Ke.fromURL(e);if(t!==this.loadVersion||!this.sprite){i.destroy(!0);return}const n=this.texture;this.texture=i,this.sprite.texture=i,this.sprite.visible=!0,n&&n.destroy(!0)}catch(i){console.error("背景图恢复失败",i)}}static clearStoreBackground(e,t){e.settings.backgroundImageData="",e.settings.backgroundImageName="",t&&(e.settings.backgroundX=0,e.settings.backgroundY=0,e.settings.backgroundOpacity=1)}static async handleFileChange(e,t){var r;const i=t.target,n=(r=i.files)==null?void 0:r[0];if(n)try{e.settings.backgroundImageData=await $c(n),e.settings.backgroundImageName=n.name}catch(o){console.error("背景图加载失败",o)}finally{i.value=""}}destroy(){this.loadVersion++,this.texture&&this.texture.destroy(!0),this.texture=null,this.sprite=null}}class h3{constructor(e){M(this,"selectedNodes",new Set);M(this,"suppressNextDoubleClick",!1);this.ctx=e}resetSelection(){this.selectedNodes.clear()}activePath(){const e=this.ctx.store;if(e.activeObjectType!=="path")return null;const t=e.paths.find(i=>i.id===e.activeObjectId)||null;return(t==null?void 0:t.visible)===!1?null:t}pathInsertIndex(e,t,i){if(e.points.length<2)return e.points.length;const n=e.closed?e.points.length:e.points.length-1;let r=e.points.length,o=1/0;for(let a=0;aMath.hypot(c.x-n.x,c.y-n.y)<=r);if(o>=0){t.points.splice(o,1),this.selectedNodes.clear();return}const a=this.pathInsertIndex(t,n.x,n.y);t.points.splice(a,0,{x:n.x,y:n.y,inX:0,inY:0,outX:0,outY:0}),this.selectedNodes.clear(),this.selectedNodes.add(a)}onPointerDown(e){const t=this.activePath();if(!t||!t.enabled)return!1;const i=ds(this.ctx,e.clientX,e.clientY),n=Ro(t,i.x,i.y),r=9/Math.max(.01,this.ctx.store.editor.viewScale);if(e.detail>=2){if(t.points.findIndex(u=>Math.hypot(u.x-n.x,u.y-n.y)<=r)>=0)return!0;const l={x:n.x,y:n.y,inX:0,inY:0,outX:0,outY:0},h=this.pathInsertIndex(t,n.x,n.y);return t.points.splice(h,0,l),this.selectedNodes.clear(),this.selectedNodes.add(h),this.suppressNextDoubleClick=!0,ra(u=>{const d=ds(this.ctx,u.clientX,u.clientY),f=Ro(t,d.x,d.y);l.outX=f.x-l.x,l.outY=f.y-l.y,l.inX=-l.outX,l.inY=-l.outY}),!0}let o=null;for(const c of this.selectedNodes){const l=t.points[c];l&&(Math.hypot(l.x+l.inX-n.x,l.y+l.inY-n.y)<=r&&(o={index:c,side:"in"}),Math.hypot(l.x+l.outX-n.x,l.y+l.outY-n.y)<=r&&(o={index:c,side:"out"}))}if(o){const c=t.points[o.index],l=o.side==="in"?Math.hypot(c.outX,c.outY):Math.hypot(c.inX,c.inY);return ra(u=>{const d=ds(this.ctx,u.clientX,u.clientY),f=Ro(t,d.x,d.y),m=f.x-c.x,p=f.y-c.y;if(o.side==="in"?(c.inX=m,c.inY=p):(c.outX=m,c.outY=p),!u.altKey){const g=Math.max(1e-4,Math.hypot(m,p)),x=u.shiftKey?g:l;o.side==="in"?(c.outX=-m/g*x,c.outY=-p/g*x):(c.inX=-m/g*x,c.inY=-p/g*x)}}),!0}const a=t.points.findIndex(c=>Math.hypot(c.x-n.x,c.y-n.y)<=r);if(a>=0){if(e.altKey)return this.selectedNodes.delete(a),!0;e.ctrlKey||e.metaKey?this.selectedNodes.add(a):this.selectedNodes.has(a)||(this.selectedNodes.clear(),this.selectedNodes.add(a));const c=n,l=[...this.selectedNodes].map(u=>({index:u,x:t.points[u].x,y:t.points[u].y}));return ra(u=>{const d=ds(this.ctx,u.clientX,u.clientY),f=Ro(t,d.x,d.y);for(const m of l)t.points[m.index].x=m.x+f.x-c.x,t.points[m.index].y=m.y+f.y-c.y}),!0}if(e.altKey&&!e.ctrlKey&&!e.metaKey)return this.selectedNodes.clear(),!0;if(e.ctrlKey||e.metaKey||e.altKey){const c=n,l=e.altKey,h=u=>{const d=ds(this.ctx,u.clientX,u.clientY),f=Ro(t,d.x,d.y),m=Math.min(c.x,f.x),p=Math.max(c.x,f.x),g=Math.min(c.y,f.y),x=Math.max(c.y,f.y);t.points.forEach((v,y)=>{v.x>=m&&v.x<=p&&v.y>=g&&v.y<=x&&(l?this.selectedNodes.delete(y):this.selectedNodes.add(y))}),window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h)};return window.addEventListener("pointerup",h),window.addEventListener("pointercancel",h),!0}return!1}}class u3{constructor(e,t){this.ctx=e,this.getTool=t}onColliderPointerDown(e){const t=this.ctx.store;if(t.activeObjectType!=="collision")return!1;const i=t.colliders.find(v=>v.id===t.activeObjectId);if(!(i!=null&&i.enabled)||i.visible===!1)return!1;const n=ds(this.ctx,e.clientX,e.clientY),r=i.rotation*Math.PI/180,o=Math.cos(r),a=Math.sin(r),c=Math.max(1e-4,Math.abs(i.scaleX??1)),l=Math.max(1e-4,Math.abs(i.scaleY??1)),h=n.x-i.x,u=n.y-i.y,d=(o*h+a*u)/c,f=(-a*h+o*u)/l;if(!(i.shape==="circle"?Math.hypot(d,f)<=i.radius:i.shape==="ellipse"?Math.hypot(d/Math.max(1,i.radiusX),f/Math.max(1,i.radiusY))<=1:Math.abs(d)<=i.width*.5&&Math.abs(f)<=i.height*.5))return!1;const p=i.x,g=i.y,x=n;return ra(v=>{const y=ds(this.ctx,v.clientX,v.clientY);i.x=p+y.x-x.x,i.y=g+y.y-x.y}),!0}onForceFieldDown(e){const t=this.ctx.store.systems.find(h=>h.id===this.ctx.store.activeId);if((t==null?void 0:t.visible)===!1)return!1;const i=t==null?void 0:t.config;if(!(i!=null&&i.forceField)||!i.showForceFieldShape||i.forceRadius<=0)return!1;const n=ds(this.ctx,e.clientX,e.clientY);if(Math.hypot(n.x-i.forceCenterX,n.y-i.forceCenterY)>i.forceRadius)return!1;const o=i.forceCenterX,a=i.forceCenterY;this.ctx.holder.value&&(this.ctx.holder.value.style.cursor="grabbing");const c=h=>{const u=ds(this.ctx,h.clientX,h.clientY);i.forceCenterX=o+u.x-n.x,i.forceCenterY=a+u.y-n.y},l=()=>{this.ctx.holder.value&&(this.ctx.holder.value.style.cursor=""),window.removeEventListener("pointermove",c),window.removeEventListener("pointerup",l),window.removeEventListener("pointercancel",l)};return window.addEventListener("pointermove",c),window.addEventListener("pointerup",l),window.addEventListener("pointercancel",l),e.preventDefault(),!0}onAttractionDown(e){const t=this.ctx.store.systems.find(u=>u.id===this.ctx.store.activeId);if((t==null?void 0:t.visible)===!1)return!1;const i=t==null?void 0:t.config;if(!(i!=null&&i.attraction)||!i.showAttractionShape)return!1;const n=ds(this.ctx,e.clientX,e.clientY),r=Math.max(i.attractionRadius,12/Math.max(1e-4,this.ctx.store.editor.viewScale));if(Math.hypot(n.x-i.attractionCenterX,n.y-i.attractionCenterY)>r)return!1;const a=i.attractionCenterX,c=i.attractionCenterY;this.ctx.holder.value&&(this.ctx.holder.value.style.cursor="grabbing");const l=u=>{const d=ds(this.ctx,u.clientX,u.clientY);i.attractionCenterX=a+d.x-n.x,i.attractionCenterY=c+d.y-n.y},h=()=>{this.ctx.holder.value&&(this.ctx.holder.value.style.cursor=""),window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h)};return window.addEventListener("pointermove",l),window.addEventListener("pointerup",h),window.addEventListener("pointercancel",h),e.preventDefault(),!0}selectedTransformTarget(){const e=this.ctx.store,t=e.activeObjectId;if(e.activeObjectType==="particle"){const r=e.systems.find(a=>a.id===t);if(!r||r.visible===!1)return null;const o=r.config;return{x:o.centerX,y:o.centerY,rotation:o.rootRotation,scaleX:o.rootScaleX??1,scaleY:o.rootScaleY??1,setPosition:(a,c)=>{o.centerX=a,o.centerY=c},setRotation:a=>{o.rootRotation=a},setScale:(a,c)=>{o.rootScaleX=a,o.rootScaleY=c}}}const n=(e.activeObjectType==="collision"?e.colliders:e.activeObjectType==="path"?e.paths:e.spines).find(r=>r.id===t);return!n||n.visible===!1?null:{x:Number(n.x)||0,y:Number(n.y)||0,rotation:Number(n.rotation)||0,scaleX:Math.max(.05,Number(n.scaleX)||1),scaleY:Math.max(.05,Number(n.scaleY)||1),setPosition:(r,o)=>{n.x=r,n.y=o},setRotation:r=>{n.rotation=r},setScale:(r,o)=>{n.scaleX=r,n.scaleY=o}}}onGizmoDown(e){const t=this.selectedTransformTarget();if(!t)return;const i=this.ctx.app(),n=this.ctx.store,r=n.editor.viewScale,o=this.ctx.holder.value.getBoundingClientRect(),a=o.left+i.screen.width/2+n.editor.viewX+t.x*r,c=o.top+i.screen.height*.5+n.editor.viewY+-t.y*r,l=e.clientX,h=e.clientY,u=this.getTool(),d=t.x,f=t.y,m=t.rotation,p=t.scaleX,g=t.scaleY,x=Math.hypot(l-a,h-c)||1,v=Math.atan2(h-c,l-a);ra(S=>{const C=(S.clientX-l)/r,w=(S.clientY-h)/r;if(u==="translate")t.setPosition(d+C,f-w);else if(u==="rotate"){const b=Math.atan2(S.clientY-c,S.clientX-a);t.setRotation(m-(b-v)*180/Math.PI)}else if(u==="scale"){const _=Math.hypot(S.clientX-a,S.clientY-c)/x;t.setScale(Math.max(.05,p*_),Math.max(.05,g*_))}})}}function iy(s,e,t,i,n){const r=1-n;return r*r*r*s+3*r*r*n*e+3*r*n*n*t+n*n*n*i}function sy(s,e,t){const i=s.rotation*Math.PI/180,n=Math.cos(i),r=Math.sin(i),o=Math.max(1e-4,Math.abs(s.scaleX??1)),a=Math.max(1e-4,Math.abs(s.scaleY??1));return{x:s.x+n*e*o-r*t*a,y:s.y+r*e*o+n*t*a}}function Op(s,e){if(!s.points.length)return null;if(s.points.length===1)return{...sy(s,s.points[0].x,s.points[0].y),angle:s.rotation};const t=s.closed?s.points.length:s.points.length-1,i=[];let n=0;for(let m=0;m0&&x===0)continue;const v=x/20,y=iy(p.x,p.x+p.outX,g.x+g.inX,g.x,v),S=iy(p.y,p.y+p.outY,g.y+g.inY,g.y,v),C=sy(s,y,S),w=i[i.length-1];w&&(n+=Math.hypot(C.x-w.x,C.y-w.y)),i.push({...C,distance:n})}}const r=Math.min(1,Math.max(0,e))*n;let o=i.findIndex(m=>m.distance>=r);o<0&&(o=i.length-1);const a=i[o],c=i[Math.max(0,o-1)],l=i[Math.min(i.length-1,o+1)],h=c.distance,u=o>0?(r-h)/Math.max(1e-4,a.distance-h):0,d=c.x+(a.x-c.x)*Math.min(1,Math.max(0,u)),f=c.y+(a.y-c.y)*Math.min(1,Math.max(0,u));return{x:d,y:f,angle:Math.atan2(l.y-c.y,l.x-c.x)*180/Math.PI}}function d3(s,e,t){if(e.renderLayerMode!=="slot")return null;const i=s.find(o=>o.id===e.renderLayerSpineId&&o.enabled&&o.status==="ready");if(!i)return null;const n=i.slots||[],r=n.find(o=>o.name===e.renderLayerSlotName);if(!r)return null;if(e.renderLayerSlotPosition==="below"){let o="";if(t!=null&&t.length){const a=t.indexOf(r.name);if(a===0)return null;a>0&&(o=t[a-1])}if(!o){const a=n.filter(c=>c.orderl.order-c.order)[0];if(!a)return null;o=a.name}return{spineId:i.id,slotName:o,targetSlotName:r.name,followAttachment:!1}}return{spineId:i.id,slotName:r.name,targetSlotName:r.name,followAttachment:e.renderLayerFollowAttachment}}function Ih(s,e,t,i=Math.max(1e-4,Math.abs(s.rootScaleX)),n=Math.max(1e-4,Math.abs(s.rootScaleY))){const r=-s.rootRotation*Math.PI/180,o=Math.cos(r),a=Math.sin(r),c=e-s.centerX,l=-t+s.centerY;return{x:(o*c+a*l)/i,y:(-a*c+o*l)/n}}function f3(s,e,t){const i=Op(e,t);if(!i)return null;const n=Ih(s,i.x,i.y),r=i.angle*Math.PI/180,o=Ih(s,i.x+Math.cos(r),i.y+Math.sin(r)),a=Math.atan2(o.y-n.y,o.x-n.x)*180/Math.PI;return{...n,angle:a}}function m3(s,e){return s.colliders.map(t=>{if(!t.followPath||!t.followPathId)return t;const i=s.paths.find(h=>h.id===t.followPathId&&h.enabled);if(!(i!=null&&i.points.length))return t;const n=Math.max(.05,Number(t.followDuration)||2),r=Math.min(1,Math.max(0,e/n)),o=Array.isArray(t.followCurve)?t.followCurve:[{x:0,y:0},{x:1,y:1}],a=t.followCurveMode==="跟随导出"?s.settings.exportSettings.keyframeCurve==="bezier"?"bezier":"linear":t.followCurveMode==="贝塞尔"?"bezier":"linear",c=Math.min(1,Math.max(0,N1(o,r,a))),l=Op(i,c);return l?{...t,x:l.x,y:l.y,rotation:t.rotation+(t.followPathRotation?l.angle:0)}:t})}class p3{constructor(){M(this,"emitters",new Map);M(this,"configs",new Map);M(this,"store",null);M(this,"eventsSuspended",!1);M(this,"subEmitterState",new Map);M(this,"slotGroups",new Map)}sync(e,t,i,n,r=null){this.store=e;for(const[c,l]of this.emitters){const h=e.systems.find(u=>u.id===c);(!h||this.configs.get(c)!==h.config)&&(l.removeFromParent(),l.destroy({children:!0}),this.emitters.delete(c),this.configs.delete(c))}for(const c of e.systems){i&&!c.config.texture&&(c.config.texture=i);const l=Xn(c.config);if(n)for(const u of l.trailResources)!u.texture&&(u.previewUrl==="/images/trail.png"||u.previewUrl==="/trails/trail.png")&&(u.texture=n);if(i)for(const u of l.imageResources)!u.texture&&u.textureName==="star"&&(u.texture=i);if(this.emitters.has(c.id))continue;const h=new Xv(c.config);h.onParticleEvent=u=>this.handleParticleEvent(c.id,u),t.addChild(h),this.emitters.set(c.id,h),this.configs.set(c.id,c.config)}const o=Sl(e.systems);for(const c of e.systems){const l=this.emitters.get(c.id);if(!l)continue;l.onParticleEvent||(l.onParticleEvent=u=>this.handleParticleEvent(c.id,u));const h=o.has(c.id);this.subEmitterState.get(c.id)!==h&&(h&&l.clear(),this.subEmitterState.set(c.id,h)),l.setAutoEmission(!h)}const a=new Set;for(const c of e.systems){const l=this.emitters.get(c.id);if(!l)continue;const h=r&&c.config.renderLayerMode==="slot"?r.getDrawOrder(c.config.renderLayerSpineId):null,u=d3(e.spines,c.config,h),d=u&&r?this.ensureSlotGroup(u,r,c.config):null;d?(a.add(d.key),l.parent!==d.compensator&&d.compensator.addChild(l)):l.parent!==t&&t.addChild(l)}for(const[c,l]of[...this.slotGroups])if(!a.has(c)){for(const h of[...l.compensator.children])h instanceof Xv&&h.parent===l.compensator&&t.addChild(h);r==null||r.detachSlotObject(l.spineId,l.slotName,l.wrapper),l.wrapper.removeFromParent(),l.wrapper.removeChild(l.compensator),l.compensator.destroy(),l.wrapper.destroy(),this.slotGroups.delete(c)}}ensureSlotGroup(e,t,i){const n=`${e.spineId}:${e.targetSlotName}:${i.renderLayerSlotPosition}`;let r=this.slotGroups.get(n);if(!r){const o=new gi,a=new gi;o.addChild(a),r={key:n,spineId:e.spineId,slotName:e.slotName,wrapper:o,compensator:a,followAttachment:i.renderLayerFollowAttachment,attached:!1},this.slotGroups.set(n,r)}return(!r.attached||!r.wrapper.parent||r.slotName!==e.slotName)&&(r.wrapper.parent&&t.detachSlotObject(r.spineId,r.slotName,r.wrapper),r.slotName=e.slotName,r.attached=t.attachSlotObject(r.spineId,r.slotName,r.wrapper,e.followAttachment)),r.attached?r:null}updateRenderCompensation(e,t){if(t)for(const i of this.slotGroups.values()){if(!i.attached||!i.wrapper.parent)continue;const n=e.spines.find(o=>o.id===i.spineId);if(!n)continue;const r=t.getSlotParentMatrix(i.spineId,i.slotName,n);r&&(r.invert(),i.compensator.transform.setFromMatrix(r))}}suspendEvents(e){this.eventsSuspended=e}handleParticleEvent(e,t){if(this.eventsSuspended)return;const i=this.store;if(!i)return;const n=i.systems.find(o=>o.id===e),r=n==null?void 0:n.config;if(!(!(r!=null&&r.eventEnabled)||!Array.isArray(r.events)||!r.events.length)&&!(t.depth>=2))for(const o of r.events){if(o.event!==t.kind||o.event==="collision"&&t.collisionCount>o.collisionLimit||o.targetSystemId<=0||o.targetSystemId===e)continue;const a=Math.min(1,Math.max(0,Number(o.probability)||0));if(a<=0)continue;const c=(Math.imul(o.id+1,2654435761)^Math.imul(t.depth+1,2246822507))>>>0;if(ar(r.seed>>>0,t.spawnId+1,c)>=a)continue;const h=this.emitters.get(o.targetSystemId);if(!h)continue;const u=Array.isArray(o.inherit)?o.inherit:[],d=u.length?{attributes:u,colorMode:o.colorInheritMode==="replace"?"replace":"add",data:{colorHex:t.colorHex,scaleX:t.scaleX,scaleY:t.scaleY,rotation:t.rotation,life:t.maxLife}}:void 0;h.spawnEventParticle(t.worldX,t.worldY,t.depth+1,d)}}destroy(e){for(const t of this.slotGroups.values()){for(const i of[...t.compensator.children])t.compensator.removeChild(i);t.wrapper.removeFromParent(),t.compensator.destroy(),t.wrapper.destroy()}this.slotGroups.clear();for(const[t,i]of this.emitters)i.removeFromParent(),i.destroy({children:!0}),this.emitters.delete(t),this.configs.delete(t)}}async function g3(){const[s,e]=await Promise.all([Ke.fromURL("/images/star.png"),Ke.fromURL("/images/trail.png")]);return{dotTex:s,trailTex:e}}function v3(s,e,t){for(const i of s.systems){i.config.texture=e;const n=Xn(i.config);if(t)for(const r of n.trailResources)!r.texture&&(r.previewUrl==="/images/trail.png"||r.previewUrl==="/trails/trail.png")&&(r.texture=t);for(const r of n.imageResources)!r.texture&&r.textureName==="star"&&(r.texture=e)}}const y3={class:"stage-wrap"},x3={key:0,class:"hud"},b3={class:"hud-number hud-system-count"},w3={class:"hud-number hud-particle-count"},S3=Zt({__name:"Stage",setup(s){const e=yo(),t=Fe(null),i=Fe(null),n=Fe(!1),r=Fe(!1),o=Fe(""),a=Fe(!1);e.settings.undoLimit>0||(e.settings.undoLimit=20),e.settings.parameterPanelOnRight==null&&(e.settings.parameterPanelOnRight=!0),Number.isFinite(e.settings.backgroundX)||(e.settings.backgroundX=0),Number.isFinite(e.settings.backgroundY)||(e.settings.backgroundY=0),Number.isFinite(e.settings.backgroundOpacity)||(e.settings.backgroundOpacity=1),e.settings.backgroundImageName==null&&(e.settings.backgroundImageName=""),e.settings.backgroundImageData==null&&(e.settings.backgroundImageData=""),e.settings.showEmitter==null&&(e.settings.showEmitter=!0),e.settings.showBones==null&&(e.settings.showBones=!1),e.settings.bonePointDrawSize>0||(e.settings.bonePointDrawSize=1),e.settings.boneAxisDrawSize>0||(e.settings.boneAxisDrawSize=2),e.settings.showSkinMesh==null&&(e.settings.showSkinMesh=!1),e.settings.showGrid==null&&(e.settings.showGrid=!0);let c=null,l=null,h=null,u=null,d=null,f=null,m=null,p=null,g=null,x=null,v=null,y=null,S=null,C=null,w=null,b=[],_=0,A=0,P=0,E=0,R=null,O=null;const U=new vf,Y=new p3,$={store:e,holder:t,app:()=>c},X=new h3($),D=new u3($,()=>o.value);let F=[];const N=new Map;function k(){l=new gi,c.stage.addChild(l),C=new gi,c.stage.addChild(C),U.createSprite(l),S=new Ni,l.addChild(S),w=new sP,l.addChild(w.container),u=new Ni,l.addChild(u),h=new Ni,l.addChild(h),f=new Ni,l.addChild(f),m=new Ni,l.addChild(m),p=new Ni,l.addChild(p),g=new Ni,l.addChild(g),x=new Ni,l.addChild(x),v=new Ni,l.addChild(v),y=new Ni,l.addChild(y),d=new Ni,l.addChild(d)}function V(me){if(me.button===0){if(o.value&&D.selectedTransformTarget()){D.onGizmoDown(me);return}X.onPointerDown(me)||D.onColliderPointerDown(me)||D.onAttractionDown(me)||D.onForceFieldDown(me)||AF($,me.clientX,me.clientY)}}function G(me){X.onStageDoubleClick(me)}function W(me){EF($,me)}function Z(me=!0){vf.clearStoreBackground(e,me)}async function ne(me){await vf.handleFileChange(e,me)}qk({canvasElement:t,canvasFocused:a,undo:qw,save:()=>Yw(e),togglePlay:()=>e.togglePlay(),toStart:()=>e.toStart(),setTool:me=>{o.value=me}});function oe(){l&&Y.sync(e,l,R,O,w)}function de(me,H,z,K){const B=Math.max(2,Math.floor(K)||2);if(me.config.mode==="stream"&&me.config.streamBehavior==="loop"){Hv(me,H,z,B);return}H.reset();const L=1/Math.max(1,z),j=[];for(let ie=0;ie=H)continue;const j=Y.emitters.get(L.id);if(!j){K=!1;continue}de(L,j,me,H)}}finally{Y.suspendEvents(!1)}K&&(e.timeline.recorded=!0)}function he(){var z,K,B,L;E=requestAnimationFrame(he);const me=performance.now()/1e3;let H=me-_;if(_=me,H>.1&&(H=.1),c&&l){l.scale.set(e.editor.viewScale),l.position.set(c.screen.width/2+e.editor.viewX,c.screen.height*.5+e.editor.viewY),U.applyTransform(e.settings.backgroundX,e.settings.backgroundY,e.settings.backgroundOpacity),UR(e,c,S,C,b);const j=Math.max(1,e.timeline.fps),ie=e.timeline.frame,ue=ie/j;w==null||w.sync(e.spines,ie,j),oe(),Y.updateRenderCompensation(e,w),F=m3(e,ue);for(const je of e.systems){const Ae=Y.emitters.get(je.id);if(!Ae)continue;Ae.setFollowExportCurveMode(e.settings.exportSettings.keyframeCurve==="bezier"?"贝塞尔":"线性");const Qe=je.visible!==!1;Ae.visible=Qe,Ae.renderable=Qe;const Ee=je.config;Ae.scale.set(Ee.rootScaleX,Ee.rootScaleY);const Qt=new Set(Ee.collisionColliderIds);Ae.setColliders(Ee.collision?F.filter(Xt=>Qt.has(Xt.id)):[]),Ae.setEmitterFollowSpawn(0,0,0);let ut={x:Ee.centerX,y:Ee.centerY,rotation:Ee.rootRotation};const re=Ee.emitterFollow&&Ee.emitterFollowMode==="bone"?e.spines.find(Xt=>Xt.id===Ee.emitterFollowSpineId&&Xt.enabled&&Xt.status==="ready"):null,ae=re&&(w==null?void 0:w.getBoneWorldTransform(re.id,Ee.emitterFollowBoneName))||null,et=Ee.emitterFollow&&Ee.emitterFollowMode==="path"?e.paths.find(Xt=>Xt.id===Ee.emitterFollowPathId&&Xt.enabled):null,It=Math.max(.05,Ee.emitterFollowDuration),kt=Math.min(1,Math.max(0,ue/It)),ot=Math.min(1,Math.max(0,N1(Ee.emitterFollowCurve,kt))),Gi=Math.min(1,Math.max(0,Ee.emitterFollowOffset)),xs=Ee.emitterFollowDirection==="reverse"?(1-Gi)*(1-ot):Gi+(1-Gi)*ot,Nt=et?Op(et,xs):null;if(ae){const Xt=Ee.emitterFollowBoneOffsetX,ji=Ee.emitterFollowBoneOffsetY,ni=ae.x+Xt,bs=ae.y+ji,ws=Ee.rootRotation+Ee.emitterFollowBoneRotation,$s=Math.max(1e-4,Math.abs(Ee.rootScaleX*Ee.emitterFollowBoneScaleX)),Zi=Math.max(1e-4,Math.abs(Ee.rootScaleY*Ee.emitterFollowBoneScaleY));if(ut={x:ni,y:bs,rotation:ws},Ee.emitterFollowSpace==="local")Ae.position.set(ni,-bs),Ae.rotation=-ws*Math.PI/180,Ae.scale.set($s,Zi),Ae.setSimulationTransform(ni,bs,ws,$s,Zi);else{Ae.position.set(Ee.centerX,-Ee.centerY),Ae.rotation=-Ee.rootRotation*Math.PI/180,Ae.scale.set($s,Zi),Ae.setSimulationTransform(Ee.centerX,Ee.centerY,Ee.rootRotation,$s,Zi);const Zn=Ih(Ee,ni,bs,$s,Zi),gn=-(ws-Ee.rootRotation);Ae.setEmitterFollowSpawn(Zn.x,Zn.y,gn)}}else if(Nt){const Xt=Nt.angle+(Ee.emitterFollowDirection==="reverse"?180:0),ji=Ee.emitterAngleMode==="direction"?Xt:Ee.rootRotation;if(ut={x:Nt.x,y:Nt.y,rotation:ji},Ee.emitterFollowSpace==="local")Ae.position.set(Nt.x,-Nt.y),Ae.rotation=-ji*Math.PI/180,Ae.setSimulationTransform(Nt.x,Nt.y,ji);else{Ae.position.set(Ee.centerX,-Ee.centerY),Ae.rotation=-Ee.rootRotation*Math.PI/180,Ae.setSimulationTransform(Ee.centerX,Ee.centerY,Ee.rootRotation);const ni=Ih(Ee,Nt.x,Nt.y),bs=Ee.emitterAngleMode==="direction"?-(Xt-Ee.rootRotation):0;Ae.setEmitterFollowSpawn(ni.x,ni.y,bs)}}else Ae.position.set(Ee.centerX,-Ee.centerY),Ae.rotation=-Ee.rootRotation*Math.PI/180,Ae.setSimulationTransform(Ee.centerX,Ee.centerY,Ee.rootRotation);const vi=Ee.shape==="path"&&Ee.spawnPathId>0&&e.paths.find(Xt=>Xt.id===Ee.spawnPathId&&Xt.enabled&&Xt.points.length>0)||null;Ae.setSpawnPathSampler(vi?Xt=>f3(Ee,vi,Xt):null,(vi==null?void 0:vi.closed)===!0),N.set(je.id,ut)}let fe=0;const ee=[],Me=e.settings.showBones&&e.activeObjectType==="particle"?e.activeObjectId:0,be=(je,Ae,Qe)=>{!je||je.id!==Me||je.visible===!1||ZR(ee,Qe,Ae.position.x,Ae.position.y)},ge=e.timeline,Ne=e.playbackRange,Ve=ge.fps,Ze=1/Math.max(1,Ve);let rt=P,Je=0;if(ge.playing?(A+=H,Je=Math.floor(A/Ze),Je>0&&(A-=Je*Ze)):(A=0,pe(Ve)),ge.playing&&Je>0)for(let je=0;jeut.id===e.activeId),Qe=(Ae==null?void 0:Ae.config.mode)==="stream"&&Ae.config.streamBehavior==="loop"?P1(Ae.config,Ve):null,Qt=ge.loop&&ge.abLoop&&(Qe==null?void 0:Qe.start)===Ne.start&&Qe.end===Ne.end?Ne.end-1:Ne.end;if(ge.frame>Qt)if(ge.loop)ge.frame=Ne.start;else{ge.frame=Ne.end,ge.playing=!1;break}}else{Y.suspendEvents(!0);try{const Ae=Sl(e.systems);for(const Qe of e.systems){const Ee=Y.emitters.get(Qe.id);if(!Ee)continue;!Ae.has(Qe.id)&&Qe.config.mode==="stream"&&Qe.config.streamBehavior==="loop"?(z=Qe.frames)!=null&&z.length||Hv(Qe,Ee,Ve,ge.totalFrames):ge.frame===0&&Ee.reset()}}finally{Y.suspendEvents(!1)}for(const[Ae,Qe]of Y.emitters){const Ee=e.systems.find(et=>et.id===Ae),Qt=(Ee==null?void 0:Ee.config.mode)==="stream"&&Ee.config.streamBehavior==="loop",ut=Qt?(K=Ee.frames)==null?void 0:K[ge.frame]:void 0,re=ge.frame===0&&!Qt,ae=re?[]:ut||Qe.update(Ze);if(re?Qe.apply([]):ut&&Qe.apply(ut),(Ee==null?void 0:Ee.visible)!==!1)for(const et of ae)et.active&&be(Ee,Qe,et);fe+=ae.length}for(const Ae of e.systems){if(!Ae.config.texture)continue;Ae.frames=Ae.frames||[];const Qe=Y.emitters.get(Ae.id);Qe&&!(Ae.config.mode==="stream"&&Ae.config.streamBehavior==="loop")&&(Ae.frames[ge.frame]=Qe.capture())}ge.frame++,ge.frame>=ge.totalFrames&&(ge.frame=Ne.start,ge.recorded=!0)}else{ge.playing||(rt=ge.frame);for(const je of e.systems){const Ae=Y.emitters.get(je.id),Qe=ge.playing?P:ge.frame,Ee=(L=je.frames)==null?void 0:L[Qe],Qt=je.config.mode==="stream"&&je.config.streamBehavior==="loop"&&!!Ee;if((ge.recorded||Qt)&&Ae&&Ee){Ae.apply(Ee);for(const ut of Ee)ut.active&&(be(je,Ae,ut),fe++)}else if(Ae){const ut=ge.frame===0?[]:Ae.update(0);if(ge.frame===0&&Ae.apply([]),je.visible!==!1)for(const re of ut)re.active&&be(je,Ae,re);fe+=Ae.activeCount}}}P=rt,w==null||w.sync(e.spines,rt,Ve);for(const[,je]of Y.emitters)je.drawTrailMeshDebug(e.settings.showSkinMesh);qR(e,F,x),KR(e,X.selectedNodes,v),HR(e,w,u),$R(e,N,h),XR(e,N,f),VR(e,m),YR(e,p),GR(e,g),WR(o,D.selectedTransformTarget.bind(D),y),JR(ee,e,d),i.value&&(i.value.systems=e.systems.length,i.value.particles=fe)}}return ys(async()=>{const me=t.value;c=new i1({width:me.clientWidth||800,height:me.clientHeight||600,backgroundAlpha:0,antialias:!0}),me.appendChild(c.view),k(),ai(()=>e.settings.backgroundImageData,z=>U.syncTexture(z),{immediate:!0});const H=await g3();R=H.dotTex,O=H.trailTex,v3(e,R,O),i.value={systems:e.systems.length,particles:0},e.timeline.recorded=!1,e.timeline.frame=0,A=0,P=0,e.timeline.playing=!0,e.timeline.loop=!0;for(const z of e.systems)z.frames=[];e.recalcTotalFrames(),_=performance.now()/1e3,he(),ai(()=>e.systems.map(z=>JSON.stringify(z.config,(K,B)=>K==="texture"||K==="trailTexture"||K==="previewUrl"?void 0:B)).join("|")+`|colliders:${JSON.stringify(e.colliders)}|paths:${JSON.stringify(e.paths)}`,()=>{e.recalcTotalFrames(),e.timeline.recorded=!1,e.timeline.frame=0;for(const z of e.systems)z.frames=[];e.timeline.playing=!0,e.timeline.loop=!0}),Hk(e)}),Al(()=>{cancelAnimationFrame(E),w==null||w.destroy(),w=null,U.destroy(),l&&c&&Y.destroy(l),c&&(c.destroy(!0,{children:!0}),c=null)}),ai(()=>[e.activeObjectType,e.activeObjectId],()=>X.resetSelection()),(me,H)=>(q(),J("div",y3,[T("div",{ref_key:"holder",ref:t,class:Ce(["stage-holder",{grid:I(e).settings.showGrid}]),tabindex:"0",onWheel:qe(W,["prevent"]),onPointerdown:V,onDblclick:qe(G,["prevent"])},null,34),we(jF,{ctx:$,"active-tool":o.value,"show-settings":n.value,"show-help":r.value,"onUpdate:activeTool":H[0]||(H[0]=z=>o.value=z),"onUpdate:showSettings":H[1]||(H[1]=z=>n.value=z),"onUpdate:showHelp":H[2]||(H[2]=z=>r.value=z),onClearBackground:Z,onBackgroundFile:ne},null,8,["active-tool","show-settings","show-help"]),we(c3,{show:n.value,onClose:H[3]||(H[3]=z=>n.value=!1)},null,8,["show"]),we(CF,{show:r.value,onClose:H[4]||(H[4]=z=>r.value=!1)},null,8,["show"]),i.value?(q(),J("div",x3,[H[5]||(H[5]=ft(" 系统: ",-1)),T("b",b3,ve(i.value.systems),1),H[6]||(H[6]=ft(" · 粒子(骨骼): ",-1)),T("b",w3,ve(i.value.particles),1),H[7]||(H[7]=ft(" · 根骨骼: ",-1)),H[8]||(H[8]=T("b",null,"root",-1)),H[9]||(H[9]=T("span",{class:"hud-tip"},"滚轮缩放 · 左键拖动画布",-1))])):xe("",!0)]))}}),M3=Jt(S3,[["__scopeId","data-v-c9db9503"]]),T3=[{x:0,y:0},{x:1,y:1}],Cm=[{x:0,y:1},{x:1,y:1}],_3=[{x:0,y:0},{x:.2,y:1},{x:.8,y:1},{x:1,y:0}],Em=[{x:0,y:0},{x:.1,y:1},{x:.9,y:1},{x:1,y:0}],Am=[{x:0,y:1},{x:1,y:1}],Im=[{x:0,y:1},{x:1,y:1}],ti=po({visible:!1,title:"",detail:"",progress:0,indeterminate:!1,failed:!1});let Mc=0;function C3(s){return new Promise(e=>window.setTimeout(e,s))}function Zw(s,e){const t=++Mc,i=performance.now();Object.assign(ti,{visible:!0,title:s,detail:e,progress:0,indeterminate:!1,failed:!1});const n=(o,a)=>{t===Mc&&(ti.indeterminate=o==null,o!=null&&(ti.progress=Math.min(100,Math.max(0,o))),a&&(ti.detail=a))},r=async(o,a)=>{if(t!==Mc)return;ti.failed=o,ti.indeterminate=!1,ti.progress=o?ti.progress:100,ti.detail=a,await C3(Math.max(180,(o?850:450)-(performance.now()-i))),t===Mc&&(ti.visible=!1)};return{update:n,paint:()=>new Promise(o=>requestAnimationFrame(()=>o())),finish:(o="已完成")=>r(!1,o),fail:(o="操作失败")=>r(!0,o)}}async function E3(s,e){if(!s.body)return e(null),s.text();const t=Number(s.headers.get("content-length")),i=Number.isFinite(t)&&t>0,n=s.body.getReader(),r=new TextDecoder;let o=0,a="";for(e(i?0:null);;){const{done:c,value:l}=await n.read();if(c)break;o+=l.byteLength,a+=r.decode(l,{stream:!0}),e(i?Math.min(1,o/t):null)}return a+=r.decode(),i&&e(1),a}const A3="3.8";function fs(s,e,t){s[e]==null&&s[t]!=null&&(s[e]=s[t]),delete s[t]}function Rm(s){if(!s||typeof s!="object")return;if(Array.isArray(s)){for(const t of s)Rm(t);return}const e=s;Array.isArray(e.curve)&&delete e.curve;for(const t of Object.values(e))Rm(t)}function I3(s){for(const e of s.bones)fs(e,"transform","inherit");for(const e of s.transform||[])fs(e,"rotateMix","mixRotate"),e.translateMix==null&&(e.translateMix=e.mixX??e.mixY),e.scaleMix==null&&(e.scaleMix=e.mixScaleX??e.mixScaleY),fs(e,"shearMix","mixShearY"),delete e.mixX,delete e.mixY,delete e.mixScaleX,delete e.mixScaleY;for(const e of s.path||[])fs(e,"rotateMix","mixRotate"),e.translateMix==null&&(e.translateMix=e.mixX??e.mixY),delete e.mixX,delete e.mixY;for(const e of s.skins)for(const t of Object.values(e.attachments||{}))for(const i of Object.values(t||{}))i.parent!=null&&fs(i,"deform","timelines")}function R3(s){for(const e of Object.values(s.slots||{}))fs(e,"color","rgba"),fs(e,"twoColor","rgba2")}function P3(s){for(const e of Object.values(s.bones||{}))for(const t of e.rotate||[])fs(t,"angle","value")}function k3(s){for(const e of Object.values(s.transform||{}))for(const t of e)fs(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),t.scaleMix==null&&(t.scaleMix=t.mixScaleX??t.mixScaleY),fs(t,"shearMix","mixShearY"),delete t.mixX,delete t.mixY,delete t.mixScaleX,delete t.mixScaleY}function F3(s){for(const e of Object.values(s.path||{})){for(const t of["position","spacing"])for(const i of e[t]||[])fs(i,t,"value");for(const t of e.mix||[])fs(t,"rotateMix","mixRotate"),t.translateMix==null&&(t.translateMix=t.mixX??t.mixY),delete t.mixX,delete t.mixY}}function O3(s){if(!s.attachments)return;const e=s.deform||(s.deform={});for(const[t,i]of Object.entries(s.attachments)){const n=e[t]||(e[t]={});for(const[r,o]of Object.entries(i)){const a=n[r]||(n[r]={});for(const[c,l]of Object.entries(o))l.deform&&(a[c]=l.deform)}}delete s.attachments}function L3(s){s.skeleton.spine=A3,I3(s);for(const e of Object.values(s.animations))R3(e),P3(e),k3(e),F3(e),O3(e);return Rm(s.animations),s}function B3(s,e,t,i,n=!1){if(n){let c=0;for(let l=0;l[...n].sort((a,c)=>a-c);let o=!0;for(;o;){o=!1;const a=r();for(let c=0;cf&&(f=p,d=m)}d>=0&&(n.add(d),o=!0)}}return r().map(a=>s[a])}function ny(s,e,t,i,n){const r=t-e+1;if(r<2)return 0;const o=n?e:t,a=n?e+1:t-1,c=n?e+2:t-2,l=Math.abs(s[a].frame-s[o].frame);if(r>=3&&l>0&&Math.abs(Math.abs(s[c].frame-s[a].frame)-l)<1e-6){const u=s[o].values[i],d=s[a].values[i],f=s[c].values[i];return n?(-3*u+4*d-f)/(2*l):(3*u-4*d+f)/(2*l)}const h=s[a].frame-s[o].frame;return h?(s[a].values[i]-s[o].values[i])/h:0}function ry(s,e,t){const i=s[t].frame-s[e].frame,n=[];for(let r=0;rd.values[r])),l=Math.max(...s.slice(e,t+1).map(d=>d.values[r])),h=o+ny(s,e,t,r,!0)*i/3,u=a-ny(s,e,t,r,!1)*i/3;n.push([Math.max(c,Math.min(l,h)),Math.max(c,Math.min(l,u))])}return{values:n}}function N3(s,e,t,i,n){const r=1-n;return r*r*r*s+3*r*r*n*e+3*r*n*n*t+n*n*n*i}function D3(s,e,t,i,n,r=!1){if(r){let l=0;for(let h=0;h[...n].sort((c,l)=>c-l);let o=!0;for(;o;){o=!1;const c=r();for(let l=0;lp&&(p=x,m=g)}m>=0&&(n.add(m),o=!0)}}const a=r();return{samples:a.map(c=>s[c]),controls:a.slice(0,-1).map((c,l)=>ry(s,c,a[l+1]))}}function U3(s){if(!s.length)return[];const e=[s[0]];for(let t=1;t180;)i-=360;for(;i-e[t-1]<-180;)i+=360;e.push(i)}return e}function oi(s){if(!Number.isFinite(s))return 0;const e=Math.round(s*1e5)/1e5;return Object.is(e,-0)?0:e}function $3(s,e,t,i){const n=Math.max(2,Math.min(16,Math.round(Number(s.trailGridRows)||2))),r=Math.max(2,Math.min(32,Math.round(Number(s.trailGridCols)||2))),o=Math.max(2,t.length),a=e.lengthMode==="random"?Math.max(1,Number(e.lengthMin)||0,Number(e.lengthMax)||0):Math.max(.001,Number(e.length)||100),c=e.widthSizeMode==="random"?Math.max(1,Number(e.widthMin)||0,Number(e.widthMax)||0):Math.max(.001,Number(e.width)||100),l=(Number(e.rotation)||0)*Math.PI/180,h=Math.cos(l),u=Math.sin(l),d=[],f=[],m=[],p=[],g=[];for(let y=0;y=0;y--)g.push({col:y,row:n-1});for(let y=n-2;y>=1;y--)g.push({col:0,row:y});const x=g.length;for(let y=1;y|\s]+/g,"_").replace(/^_+|_+$/g,"")||e}function eS(s,e){let t=s,i=2;for(;e.has(t);)t=`${s}_${i++}`;return e.add(t),t}function V3(s){return s.replace(/\.[^./\\]+$/,"")}function tS(s,e){return V3([s,e].filter(Boolean).join("/").replace(/\\/g,"/").replace(/\/{2,}/g,"/").replace(/^\.\//,""))}function Y3(s){var i,n;const e=Number(((i=s==null?void 0:s.orig)==null?void 0:i.width)??(s==null?void 0:s.width))||0,t=Number(((n=s==null?void 0:s.orig)==null?void 0:n.height)??(s==null?void 0:s.height))||0;return{width:e,height:t}}function _c(s){return Math.round(Math.max(0,Math.min(1,s))*255).toString(16).padStart(2,"0")}function hy(s,e){return[(s>>16&255)/255,(s>>8&255)/255,(s&255)/255,Math.max(0,Math.min(1,e))]}function il(s,e){return oi(s/e)}function G3(s,e){const t=s.config,i=t.lifeMode==="fixed"?Math.max(0,Number(t.lifeMin)||0):Math.max(0,Number(t.lifeMin)||0,Number(t.lifeMax)||0),n=Math.max(0,Number(t.delay)||0);let r;return t.mode!=="stream"?r=n+i:t.streamBehavior!=="loop"?r=n+Math.max(1/e,Number(t.duration)||0)+i:r=n+Ps(t,e).total/e,Math.max(1,Math.ceil(r*e)+1)}function j3(s,e,t){const i=s.config;if(i.mode!=="stream"||i.streamBehavior!=="loop")return new Set;const n=P1(i,e),r=Math.max(1,t)/Math.max(1,e);return new Set([Math.round(n.start*r),Math.round(n.end*r)])}function Rh(s,e){return e?s.boneName:`${s.spawnId??"legacy"}_${s.boneName}`}function H3(s,e,t,i){const n=new Set;for(const r of s)for(const o of r)n.add(Rh(o,e));return[...n].sort().map((r,o)=>({key:r,name:eS(`${i}_${o}`,t),states:s.map(a=>a.find(c=>Rh(c,e)===r)||null)}))}function uy(s,e){const t=new Set(e.states.map(i=>i==null?void 0:i.resourceId).filter(i=>typeof i=="number"));return s.config.imageResources.filter(i=>t.has(i.id))}function W3(s,e,t,i){const n=e*t/i,r=Math.min(s.states.length-1,Math.max(0,Math.floor(n))),o=Math.min(s.states.length-1,r+1),a=s.states[r],c=s.states[o];if(!a||!c||Rh(a,!0)!==Rh(c,!0)||a.spawnId!==c.spawnId)return a;const l=n-r;if(l<=1e-6)return a;const h=(d,f)=>(d??0)+((f??d??0)-(d??0))*l,u=a.trailState&&c.trailState&&a.trailState.resourceId===c.trailState.resourceId?{...a.trailState,width:h(a.trailState.width,c.trailState.width),alpha:h(a.trailState.alpha,c.trailState.alpha),bones:a.trailState.bones.map((d,f)=>{const m=c.trailState.bones[f]||d;return{...d,worldX:h(d.worldX??d.x,m.worldX??m.x),worldY:h(d.worldY??d.y,m.worldY??m.y),worldRotation:h(d.worldRotation??-d.rotation,m.worldRotation??-m.rotation)}})}:a.trailState;return{...a,worldX:h(a.worldX,c.worldX),worldY:h(a.worldY,c.worldY),worldRotation:h(a.worldRotation,c.worldRotation),worldScaleX:h(a.worldScaleX,c.worldScaleX),worldScaleY:h(a.worldScaleY,c.worldScaleY),alpha:h(a.alpha,c.alpha),trailState:u}}function dy(s,e){return!s||s==="跟随导出"?e.keyframeCurve:s==="贝塞尔"?"bezier":"linear"}function ko(s,e,t,i,n,r=new Set,o=new Set,a=n.keyframeCurve){if(!s.length)return[];const c=new Set(r);for(const u of o)c.add(u);const l=a==="bezier"&&n.spineVersion!=="3.8"?Qw(s,i,c,o):{samples:Jw(s,i,c,o),controls:[]},h=l.samples.map(u=>{const d={time:il(u.frame,e)};return t.forEach((f,m)=>{d[f]=oi(u.values[m])}),o.has(u.frame)&&(d.curve="stepped"),d});for(let u=0;u0&&n&&e.add(t-1),i&&e.add(t))}return e}function q3(s){const e=new Set;for(let t=0;t0&&n&&e.add(t-1),i&&e.add(t))}return e}function J3(s,e){var i;if(!s.shapeEnabled||!((i=s.shapeCurve)!=null&&i.length))return 1;const t=[...s.shapeCurve].sort((n,r)=>n.x-r.x);if(e<=t[0].x)return Math.max(0,t[0].y);for(let n=1;n{(o!==r||i.has(a))&&(n.push(t(o,a)),r=o)}),n}function eO(s,e,t){const i=s.imageMode==="sequence"?s.sequenceFrames[e]:void 0,n=(i==null?void 0:i.name)||s.textureName||`image_${s.id}`,r=(i==null?void 0:i.texture)||s.texture,o=Y3(r);(!o.width||!o.height)&&t.push({code:"missing-image",message:`图片“${n}”缺失或尺寸不可读,已保留路径。`});const a=o.width||1,c=o.height||1;return{path:tS(s.textureFolder,n),x:oi((.5-s.anchorX)*a),y:oi((s.anchorY-.5)*c),width:oi(a),height:oi(c)}}function fy(s,e){const t=[];for(const n of e){const r=n.imageMode==="sequence"?Math.max(1,n.sequenceFrames.length):1;for(let o=0;o1;return new Map(t.map((n,r)=>[n,i?`${s}_${r}`:s]))}function tO(s,e,t,i,n=i.keyframeCurve,r=new Set,o=new Set){if(!s.length)return[];const a=new Set;for(let d=1;d({frame:f,values:d})),l=1/255,h=n==="bezier"&&i.spineVersion!=="3.8"?Qw(c,[l,l,l,.01],a,r):{samples:Jw(c,[l,l,l,.01],a,r),controls:[]},u=h.samples.map(d=>{const f={time:il(d.frame,t),color:`${_c(d.values[0])}${_c(d.values[1])}${_c(d.values[2])}${_c(d.values[3])}`};return r.has(d.frame)&&(f.curve="stepped"),f});if(h.controls.length)for(let d=0;d({time:il(m,n),name:f??null}),c);h.length&&(l.attachment=h);const u=tO(i,t,n,r,o,a,c);u.length&&(l.rgba=u)}function py(s){var m;const e=s.settings,t=Math.max(1,Number(s.timeline.fps)||30),i=Math.max(1,Math.round(e.fps||30)),n=e.integerFrameAlignment?i:t,r=[],o=s.systems.filter(p=>p.visible!==!1),a={skeleton:{hash:"",spine:e.spineVersion,x:0,y:0,width:0,height:0,images:e.imagesPath||"./images/"},bones:[{name:"root"}],slots:[],skins:[{name:"default",attachments:{}}],animations:{}};e.omitFps||(a.skeleton.fps=i);const c=a.skins[0].attachments,l=new Set(["root"]),h=[...new Set([...s.timeline.animations.length?s.timeline.animations:["animation"],...o.map(p=>p.animation||"animation")])],u=new Map;for(const p of o){const g=Math.min(((m=p.frames)==null?void 0:m.length)||0,G3(p,t)),x=(p.frames||[]).slice(0,g);x.length||r.push({code:"empty-cache",message:`“${p.config.name}”没有可用帧缓存。`});const v=eS(X3(p.config.name,`system_${p.id}`),l);a.bones.push({name:v,parent:"root"});const y=H3(x,e.bonePool,l,v),S=Math.max(0,(g-1)/t),C=Math.max(1,Math.ceil(S*n)+1),w=j3(p,t,n),b=u.get(p.animation)||[];b.push({system:p,tracks:y,targetFrames:C,boundaryFrames:w,attachmentPrefix:v}),u.set(p.animation,b);for(const _ of y){a.bones.push({name:_.name,parent:v});const A=uy(p,_),P=new Set(A.map(Y=>Y.blend)),E=[],R=[];for(const Y of P){const $=`${_.name}_${Y}`;E.push($),a.slots.push({name:$,bone:_.name,color:"ffffff00",blend:oy[Y]});const X=c[$]||(c[$]={}),D=A.filter(N=>N.blend===Y),F=fy(v,D);for(const N of D){const k=N.imageMode==="sequence"?Math.max(1,N.sequenceFrames.length):1;for(let V=0;V{var V;return((V=k==null?void 0:k.trailState)==null?void 0:V.resourceId)===Y.id}))continue;const $=Math.max(2,Math.min(16,Math.round(Y.boneCount||3))),X=[];for(let k=0;k<$;k++){const V=`${_.name}_trail_${Y.id}_${k}`;X.push(V),a.bones.push({name:V,parent:v})}const D=`${_.name}_trail_${Y.id}`;R.push(D),a.slots.push({name:D,bone:X[0],color:"ffffff00",blend:oy[Y.blend]});const F=X.map(k=>a.bones.findIndex(V=>V.name===k)),N=tS("",Y.textureName||`trail_${Y.id}`);(c[D]||(c[D]={}))[`trail_${Y.id}`]=$3(p.config,Y,F,N),Y.texture||r.push({code:"missing-image",message:`拖尾图片“${Y.textureName||Y.id}”缺失,已保留路径。`})}const O=new Set([...E,...R]),U=a.slots.filter(Y=>O.has(String(Y.name)));U.length&&(a.slots=a.slots.filter(Y=>!U.includes(Y)),a.slots.push(...U.filter(Y=>R.includes(String(Y.name))),...U.filter(Y=>E.includes(String(Y.name)))))}}for(const p of h){const g=u.get(p)||[],x={bones:{},slots:{}};let v=!1;for(const{system:y,tracks:S,targetFrames:C,boundaryFrames:w,attachmentPrefix:b}of g)for(const _ of S){const A=Array.from({length:C},(W,Z)=>W3(_,Z,t,n)),P=A.map(W=>!!(W!=null&&W.active)),E=[],R=[],O=[];A.forEach((W,Z)=>{W!=null&&W.active&&(E.push({frame:Z,values:[W.worldX??W.x,W.worldY??W.y]}),R.push(W.worldRotation??W.rotation),O.push({frame:Z,values:[W.worldScaleX??W.scaleX,W.worldScaleY??W.scaleY]}))});const U=U3(R),Y=E.map((W,Z)=>({frame:W.frame,values:[U[Z]??0]})),$=z3(A);for(const W of w)$.add(W);const X=q3(A),D={},F=ko(E,n,["x","y"],[ay,ay],e,$,X),N=ko(Y,n,["value"],[cy],e,$,X),k=ko(O,n,["x","y"],[Tc,Tc],e,$,X);F.length&&(D.translate=F),N.length&&(D.rotate=N),k.length&&(D.scale=k),Object.keys(D).length&&(x.bones[_.name]=D,v=!0);const V=uy(y,_),G=new Set(V.map(W=>W.blend));for(const W of G){const Z=V.filter(H=>H.blend===W),ne=fy(b,Z),oe=[],de=[];let pe=16777215;for(let H=0;Hj.id===z.resourceId):void 0,B=!!z&&P[H]&&z.imageVisible!==!1&&(K==null?void 0:K.blend)===W;z&&(K==null?void 0:K.blend)===W&&(pe=z.colorHex);const L=B?ne.get(`${K.id}_${z.imageFrameIndex??0}`):void 0;oe.push(L??null),de.push(hy(pe,B?z.alpha:0))}const he=Z.filter(H=>H.independentAlpha==="curve").map(H=>dy(H.alphaCurveMode,e)),me=he.length?he.includes("bezier")?"bezier":"linear":dy(y.config.alphaMode==="curve"?y.config.curveMode:void 0,e);my(x,`${_.name}_${W}`,oe,de,n,e,me,X,w),oe.some(Boolean)&&(v=!0)}if(y.config.trail)for(const W of y.config.trailResources){const Z=Math.max(2,Math.min(16,Math.round(W.boneCount||3))),ne=A.map(L=>{var j;return((j=L==null?void 0:L.trailState)==null?void 0:j.resourceId)===W.id?L.trailState:void 0}),oe=ne.find(L=>!!L);if(!oe)continue;const de=Z3(ne),pe=K3(ne),he=W.widthSizeMode==="random"?Math.max(1,Number(W.widthMin)||0,Number(W.widthMax)||0):Math.max(.001,Number(W.width)||100);let me=oe;const H=ne.map(L=>(L&&(me=L),me));for(let L=0;L{const Je=Ze==null?void 0:Ze.bones[Math.min(Ze.bones.length-1,L)];if(!Je)return;const je={x:Je.worldX??Je.x,y:Je.worldY??Je.y,rotation:Je.worldRotation??-Je.rotation};j.push({frame:rt,values:[je.x,je.y]}),ie.push({frame:rt,values:[je.rotation]}),ue.push({frame:rt,values:[1,Math.max(0,Ze.width/he)*ee]})});const Me=`${_.name}_trail_${W.id}_${L}`,be={},ge=ko(j,n,["x","y"],[ly,ly],e,fe,pe),Ne=ko(ie,n,["value"],[cy],e,fe,pe),Ve=ko(ue,n,["x","y"],[Tc,Tc],e,fe,pe);ge.length&&(be.translate=ge),Ne.length&&(be.rotate=Ne),Ve.length&&(be.scale=Ve),Object.keys(be).length&&(x.bones[Me]=be)}const z=ne.map(()=>`trail_${W.id}`);let K=oe.colorHex;const B=ne.map(L=>(L&&(K=L.colorHex),hy(K,L?L.alpha:0)));my(x,`${_.name}_trail_${W.id}`,z,B,n,e,e.keyframeCurve,pe,w),v=!0}}(v||!e.excludeEmptyAnimations)&&(a.animations[p]=x)}!Object.keys(a.animations).length&&!e.excludeEmptyAnimations&&(a.animations.animation={bones:{},slots:{}});const d=e.spineVersion==="3.8"?L3(a):a,f=JSON.stringify(d,null,2);return{json:d,text:f,warnings:r,particleSystemCount:o.length,animationCount:Object.keys(d.animations).length,boneCount:d.bones.length}}function iO(s,e){const t=new Blob([s.text],{type:"application/json;charset=utf-8"}),i=URL.createObjectURL(t),n=document.createElement("a");n.href=i,n.download=/\.json$/i.test(e)?e:`${e||"SpineParticle"}.json`,n.style.display="none",document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(i),1e3)}class CV{constructor(){M(this,"array",[])}add(e){const t=this.contains(e);return this.array[e|0]=e|0,!t}contains(e){return this.array[e|0]!==void 0}remove(e){this.array[e|0]=void 0}clear(){this.array.length=0}}class sO{constructor(){M(this,"entries",{});M(this,"size",0)}add(e){const t=this.entries[e];return this.entries[e]=!0,t?!1:(this.size++,!0)}addAll(e){const t=this.size;for(let i=0,n=e.length;i1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(e,t){e.r=((t&4278190080)>>>24)/255,e.g=((t&16711680)>>>16)/255,e.b=((t&65280)>>>8)/255,e.a=(t&255)/255}static rgb888ToColor(e,t){e.r=((t&16711680)>>>16)/255,e.g=((t&65280)>>>8)/255,e.b=(t&255)/255}toRgb888(){const e=t=>`0${(t*255).toString(16)}`.slice(-2);return+`0x${e(this.r)}${e(this.g)}${e(this.b)}`}static fromString(e,t=new ts){return t.setFromString(e)}};M(ts,"WHITE",new ts(1,1,1,1)),M(ts,"RED",new ts(1,0,0,1)),M(ts,"GREEN",new ts(0,1,0,1)),M(ts,"BLUE",new ts(0,0,1,1)),M(ts,"MAGENTA",new ts(1,0,1,1));let nt=ts;const Ht=class Ht{static clamp(e,t,i){return ei?i:e}static cosDeg(e){return Math.cos(e*Ht.degRad)}static sinDeg(e){return Math.sin(e*Ht.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*Ht.radDeg}static signum(e){return e>0?1:e<0?-1:0}static toInt(e){return e>0?Math.floor(e):Math.ceil(e)}static cbrt(e){const t=Math.pow(Math.abs(e),.3333333333333333);return e<0?-t:t}static randomTriangular(e,t){return Ht.randomTriangularWith(e,t,(e+t)*.5)}static randomTriangularWith(e,t,i){const n=Math.random(),r=t-e;return n<=(i-e)/r?e+Math.sqrt(n*r*(i-e)):t-Math.sqrt((1-n)*r*(t-i))}static isPowerOfTwo(e){return e&&(e&e-1)===0}};M(Ht,"epsilon",1e-5),M(Ht,"epsilon2",Ht.epsilon*Ht.epsilon),M(Ht,"PI",3.1415927),M(Ht,"PI2",Ht.PI*2),M(Ht,"invPI2",1/Ht.PI2),M(Ht,"radiansToDegrees",180/Ht.PI),M(Ht,"radDeg",Ht.radiansToDegrees),M(Ht,"degreesToRadians",Ht.PI/180),M(Ht,"degRad",Ht.degreesToRadians);let Ie=Ht;const ls=class ls{apply(e,t,i){return t===void 0||i===void 0?this.applyInternal(e):e+(t-e)*this.applyInternal(i)}};M(ls,"linear",new class extends ls{applyInternal(e){return e}}),M(ls,"smooth",new class extends ls{applyInternal(e){return e*e*(3-2*e)}}),M(ls,"slowFast",new class extends ls{applyInternal(e){return e*e}}),M(ls,"fastSlow",new class extends ls{applyInternal(e){return(e-1)*(e-1)*-1+1}}),M(ls,"circle",new class extends ls{applyInternal(e){return e<=.5?(e*=2,(1-Math.sqrt(1-e*e))/2):(e--,e*=2,(Math.sqrt(1-e*e)+1)/2)}});let oa=ls;class nO extends oa{constructor(t){super();M(this,"power",2);this.power=t}applyInternal(t){return t<=.5?Math.pow(t*2,this.power)/2:Math.pow((t-1)*2,this.power)/(this.power%2===0?-2:2)+1}}class EV extends nO{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2===0?-1:1)+1}}const dr=class dr{static arrayCopy(e,t,i,n,r){for(let o=t,a=n;o=t?e:dr.setArraySize(e,t,i)}static newArray(e,t){const i=[];for(let n=0;n0?this.items.pop():this.instantiator()}free(e){var t;(t=e.reset)==null||t.call(e),this.items.push(e)}freeAll(e){for(let t=0;tthis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=e,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}}class RV{constructor(e=32){M(this,"values");M(this,"addedValues",0);M(this,"lastValue",0);M(this,"mean",0);M(this,"dirty",!0);this.values=new Array(e)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(e){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let e=0;for(let t=0;t{h.width=parseInt(i[1]),h.height=parseInt(i[2])},n.format=()=>{},n.filter=h=>{h.minFilter=Ge.enumValue(ha,i[1]),h.magFilter=Ge.enumValue(ha,i[2])},n.repeat=h=>{i[1].indexOf("x")!==-1&&(h.uWrap=ua.Repeat),i[1].indexOf("y")!==-1&&(h.vWrap=ua.Repeat)},n.pma=h=>{h.pma=i[1]==="true"};var r={};r.xy=h=>{h.x=parseInt(i[1]),h.y=parseInt(i[2])},r.size=h=>{h.width=parseInt(i[1]),h.height=parseInt(i[2])},r.bounds=h=>{h.x=parseInt(i[1]),h.y=parseInt(i[2]),h.width=parseInt(i[3]),h.height=parseInt(i[4])},r.offset=h=>{h.offsetX=parseInt(i[1]),h.offsetY=parseInt(i[2])},r.orig=h=>{h.originalWidth=parseInt(i[1]),h.originalHeight=parseInt(i[2])},r.offsets=h=>{h.offsetX=parseInt(i[1]),h.offsetY=parseInt(i[2]),h.originalWidth=parseInt(i[3]),h.originalHeight=parseInt(i[4])},r.rotate=h=>{const u=i[1];u==="true"?h.degrees=90:u!=="false"&&(h.degrees=parseInt(u))},r.index=h=>{h.index=parseInt(i[1])};let o=t.readLine();for(;o&&o.trim().length===0;)o=t.readLine();for(;!(!o||o.trim().length===0||t.readEntry(i,o)===0);)o=t.readLine();let a=null,c=null,l=null;for(;o!==null;)if(o.trim().length===0)a=null,o=t.readLine();else if(a){const h=new sS(a,o);for(;;){const u=t.readEntry(i,o=t.readLine());if(u===0)break;const d=r[i[0]];if(d)d(h);else{c||(c=[]),l||(l=[]),c.push(i[0]);const f=[];for(let m=0;m0&&l&&l.length>0&&(h.names=c,h.values=l,c=null,l=null),h.u=h.x/a.width,h.v=h.y/a.height,h.degrees===90?(h.u2=(h.x+h.height)/a.width,h.v2=(h.y+h.width)/a.height):(h.u2=(h.x+h.width)/a.width,h.v2=(h.y+h.height)/a.height),this.regions.push(h)}else{for(a=new lO(o.trim());t.readEntry(i,o=t.readLine())!==0;){const h=n[i[0]];h&&h(a)}this.pages.push(a)}}findRegion(e){for(let t=0;t=this.lines.length?null:this.lines[this.index++]}readEntry(e,t){if(!t||(t=t.trim(),t.length===0))return 0;const i=t.indexOf(":");if(i===-1)return 0;e[0]=t.substr(0,i).trim();for(let n=1,r=i+1;;n++){const o=t.indexOf(",",r);if(o===-1)return e[n]=t.substr(r).trim(),n;if(e[n]=t.substr(r,o-r).trim(),r=o+1,n===4)return 4}}}class lO{constructor(e){M(this,"name");M(this,"minFilter",ha.Nearest);M(this,"magFilter",ha.Nearest);M(this,"uWrap",ua.ClampToEdge);M(this,"vWrap",ua.ClampToEdge);M(this,"texture",null);M(this,"width",0);M(this,"height",0);M(this,"pma",!1);M(this,"regions",[]);this.name=e}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap);for(const t of this.regions)t.texture=e}}class sS extends iS{constructor(t,i){super();M(this,"page");M(this,"name");M(this,"x",0);M(this,"y",0);M(this,"offsetX",0);M(this,"offsetY",0);M(this,"originalWidth",0);M(this,"originalHeight",0);M(this,"index",0);M(this,"degrees",0);M(this,"names",null);M(this,"values",null);this.page=t,this.name=i,t.regions.push(this)}}const Nh=class Nh{constructor(e){M(this,"name");M(this,"timelineAttachment");M(this,"timelineSlots",Nh.empty);if(!e)throw new Error("name cannot be null.");this.name=e,this.timelineAttachment=this}isTimelineActive(e,t,i){let n=e[t];if(n.bone.isActive()){const r=(i?n.getAppliedPose():n.getPose()).getAttachment();if(r!=null&&r.timelineAttachment===this)return!0}for(let r=0,o=this.timelineSlots.length;r>1)*c;const l=i.appliedPose.deform;let h=this.vertices;const u=this.bones;if(!u){l.length>0&&(h=l);const p=i.bone.appliedPose,g=p.worldX,x=p.worldY,v=p.a,y=p.b,S=p.c,C=p.d;for(let w=n,b=a;b=this.regions.length&&(t=this.regions.length-1),t}getUVs(e){return this.uvs[e]}hasPathSuffix(){return this.pathSuffix}getPath(e,t){if(!this.pathSuffix)return e;let i=e;const n=(this.start+t).toString();for(let r=this.digits-n.length;r>0;r--)i+="0";return i+=n,i}static nextID(){return Go._nextID++}};M(Go,"_nextID",0);let fa=Go;var _i;(function(s){s[s.hold=0]="hold",s[s.once=1]="once",s[s.loop=2]="loop",s[s.pingpong=3]="pingpong",s[s.onceReverse=4]="onceReverse",s[s.loopReverse=5]="loopReverse",s[s.pingpongReverse=6]="pingpongReverse"})(_i||(_i={}));const nS=[_i.hold,_i.once,_i.loop,_i.pingpong,_i.onceReverse,_i.loopReverse,_i.pingpongReverse];class Lp{constructor(e,t,i){M(this,"name");M(this,"timelines",[]);M(this,"timelineIds");M(this,"bones");M(this,"color",new nt(1,1,1,1));M(this,"duration");if(!e)throw new Error("name cannot be null.");this.name=e,this.duration=i,this.timelineIds=new sO,this.bones=[],this.setTimelines(t)}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e;const t=e.length;this.timelineIds.clear(),this.bones.length=0;const i=new Set,n=e;for(let r=0;r0&&(t%=this.duration));const u=this.timelines;for(let d=0,f=u.length;dt)return r-i;return n-i}};function cO(s){return typeof s=="object"&&s!==null&&typeof s.slotIndex=="number"}class bo extends Bt{constructor(t,i,...n){super(t,...n);M(this,"curves");this.curves=Ge.newFloatArray(t+i*18),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){const i=this.getFrameCount()+t*18;if(this.curves.length>i){const n=Ge.newFloatArray(i);Ge.arrayCopy(this.curves,0,n,0,i),this.curves=n}}setBezier(t,i,n,r,o,a,c,l,h,u,d){const f=this.curves;let m=this.getFrameCount()+t*18;n===0&&(f[i]=2+m);const p=(r-a*2+l)*.03,g=(o-c*2+h)*.03,x=((a-l)*3-r+u)*.006,v=((c-h)*3-o+d)*.006;let y=p*2+x,S=g*2+v,C=(a-r)*.3+p+x*.16666667,w=(c-o)*.3+g+v*.16666667,b=r+C,_=o+w;for(let A=m+18;mt){const h=this.frames[i],u=this.frames[i+n];return u+(t-h)/(o[r]-h)*(o[r+1]-u)}const a=r+18;for(r+=2;r=t){const h=o[r-2],u=o[r-1];return u+(t-h)/(o[r]-h)*(o[r+1]-u)}i+=this.getFrameEntries();const c=o[a-2],l=o[a-1];return l+(t-c)/(this.frames[i]-c)*(this.frames[i+n]-l)}}class Bn extends bo{constructor(e,t,i){super(e,t,i)}getFrameEntries(){return 2}setFrame(e,t,i){e<<=1,this.frames[e]=t,this.frames[e+1]=i}getCurveValue(e){const t=this.frames;let i=t.length-2;for(let r=2;r<=i;r+=2)if(t[r]>e){i=r-2;break}const n=this.curves[i>>1];switch(n){case 0:{const r=t[i],o=t[i+1];return o+(e-r)/(t[i+2]-r)*(t[i+2+1]-o)}case 1:return t[i+1]}return this.getBezierValue(e,i,1,n-2)}getRelativeValue(e,t,i,n,r,o){if(e>2];switch(f){case 0:{const m=u[d];c=u[d+1],l=u[d+2],h=u[d+3];const p=(i-m)/(u[d+4]-m);c+=(u[d+4+1]-c)*p,l+=(u[d+4+2]-l)*p,h+=(u[d+4+3]-h)*p;break}case 1:c=u[d+1],l=u[d+2],h=u[d+3];break;default:c=this.getBezierValue(i,d,1,f-2),l=this.getBezierValue(i,d,2,f+18-2),h=this.getBezierValue(i,d,3,f+36-2)}if(n!==1)if(r===Xe.setup){const m=e.data.setupPose.color;c=m.r+(c-m.r)*n,l=m.g+(l-m.g)*n,h=m.b+(h-m.b)*n}else c=a.r+(c-a.r)*n,l=a.g+(l-a.g)*n,h=a.b+(h-a.b)*n;a.r=c<0?0:c>1?1:c,a.g=l<0?0:l>1?1:l,a.b=h<0?0:h>1?1:h}}class vS extends Bn{constructor(t,i,n){super(t,i,`${st.alpha}|${n}`);M(this,"slotIndex",0);this.slotIndex=n}apply(t,i,n,r,o,a,c,l,h){const u=t.slots[this.slotIndex];if(!u.bone.active)return;const d=(h?u.appliedPose:u.pose).color;let f=0;const m=this.frames;if(n1?1:f}}class yS extends xu{constructor(e,t,i){super(e,t,i,`${st.rgb}|${i}`,`${st.alpha}|${i}`,`${st.rgb2}|${i}`)}getFrameEntries(){return 8}setFrame(e,t,i,n,r,o,a,c,l){e<<=3,this.frames[e]=t,this.frames[e+1]=i,this.frames[e+2]=n,this.frames[e+3]=r,this.frames[e+4]=o,this.frames[e+5]=a,this.frames[e+6]=c,this.frames[e+7]=l}apply1(e,t,i,n,r,o){const a=t.color,c=t.darkColor;let l=0,h=0,u=0;const d=this.frames;if(i>3];switch(v){case 0:{const y=d[x];f=d[x+1],m=d[x+2],p=d[x+3],g=d[x+4],l=d[x+5],h=d[x+6],u=d[x+7];const S=(i-y)/(d[x+8]-y);f+=(d[x+8+1]-f)*S,m+=(d[x+8+2]-m)*S,p+=(d[x+8+3]-p)*S,g+=(d[x+8+4]-g)*S,l+=(d[x+8+5]-l)*S,h+=(d[x+8+6]-h)*S,u+=(d[x+8+7]-u)*S;break}case 1:f=d[x+1],m=d[x+2],p=d[x+3],g=d[x+4],l=d[x+5],h=d[x+6],u=d[x+7];break;default:f=this.getBezierValue(i,x,1,v-2),m=this.getBezierValue(i,x,2,v+18-2),p=this.getBezierValue(i,x,3,v+36-2),g=this.getBezierValue(i,x,4,v+54-2),l=this.getBezierValue(i,x,5,v+72-2),h=this.getBezierValue(i,x,6,v+90-2),u=this.getBezierValue(i,x,7,v+108-2)}if(n===1)a.set(f,m,p,g);else if(r===Xe.setup){const y=e.data.setupPose;let S=y.color;a.set(S.r+(f-S.r)*n,S.g+(m-S.g)*n,S.b+(p-S.b)*n,S.a+(g-S.a)*n),S=y.darkColor,l=S.r+(l-S.r)*n,h=S.g+(h-S.g)*n,u=S.b+(u-S.b)*n}else a.add((f-a.r)*n,(m-a.g)*n,(p-a.b)*n,(g-a.a)*n),l=c.r+(l-c.r)*n,h=c.g+(h-c.g)*n,u=c.b+(u-c.b)*n;c.r=l<0?0:l>1?1:l,c.g=h<0?0:h>1?1:h,c.b=u<0?0:u>1?1:u}}class xS extends xu{constructor(e,t,i){super(e,t,i,`${st.rgb}|${i}`,`${st.rgb2}|${i}`)}getFrameEntries(){return 7}setFrame(e,t,i,n,r,o,a,c){e*=7,this.frames[e]=t,this.frames[e+1]=i,this.frames[e+2]=n,this.frames[e+3]=r,this.frames[e+4]=o,this.frames[e+5]=a,this.frames[e+6]=c}apply1(e,t,i,n,r,o){const a=t.color,c=t.darkColor;let l=0,h=0,u=0,d=0,f=0,m=0;const p=this.frames;if(i1?1:l,a.g=h<0?0:h>1?1:h,a.b=u<0?0:u>1?1:u,c.r=d<0?0:d>1?1:d,c.g=f<0?0:f>1?1:f,c.b=m<0?0:m>1?1:m}}class sl extends Bt{constructor(t,i){super(t,`${st.attachment}|${i}`);M(this,"slotIndex",0);M(this,"attachmentNames");this.slotIndex=i,this.attachmentNames=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,i,n){this.frames[t]=i,this.attachmentNames[t]=n}apply(t,i,n,r,o,a,c,l,h){const u=t.slots[this.slotIndex];if(!u.bone.active)return;const d=h?u.appliedPose:u.pose;l||nt){const l=this.frames[i];return n[r+1]*(t-l)/(n[r]-l)}const o=r+18;for(r+=2;r=t){const l=n[r-2],h=n[r-1];return h+(t-l)/(n[r]-l)*(n[r+1]-h)}const a=n[o-2],c=n[o-1];return c+(1-c)*(t-a)/(this.frames[i+this.getFrameEntries()]-a)}apply(t,i,n,r,o,a,c,l,h){const u=t.slots;if(!this.attachment.isTimelineActive(u,this.slotIndex,h))return;const d=this.attachment.timelineSlots,f=this.frames;if(n=f[f.length-1])g=0,m=this.vertices[f.length-1],p=null;else{const v=Bt.search(f,n);g=this.getCurvePercent(n,v),m=this.vertices[v],p=this.vertices[v+1]}const x=this.vertices[0].length;this.applyToSlot(u[this.slotIndex],h,m,p,g,x,o,a,c);for(const v of d)this.applyToSlot(u[v],h,m,p,g,x,o,a,c)}applyBeforeFirst(t,i,n,r){if(!t.bone.active)return;const o=i?t.appliedPose:t.pose;if(o.attachment==null||o.attachment.timelineAttachment!==this.attachment)return;const a=o.deform;switch(a.length===0&&(r=Xe.setup),r){case Xe.setup:a.length=0;break;case Xe.first:{if(n===1){a.length=0;return}const c=this.vertices[0].length;a.length=c;const l=a,h=o.attachment;if(h.bones===null){const u=h.vertices;for(let d=0;d>4,h=c.attachment.sequence.regions.length;const u=nS[o&15];if(u!==_i.hold)switch(l+=(n-r)/a+1e-5|0,u){case _i.once:l=Math.min(h-1,l);break;case _i.loop:l%=h;break;case _i.pingpong:{const d=(h<<1)-2;l=d===0?0:l%d,l>=h&&(l=d-l);break}case _i.onceReverse:l=Math.max(h-1-l,0);break;case _i.loopReverse:l=h-1-l%h;break;case _i.pingpongReverse:{const d=(h<<1)-2;l=d===0?0:(l+h-1)%d,l>=h&&(l=d-l)}}c.sequenceIndex=l}};M(cs,"ENTRIES",3),M(cs,"MODE",1),M(cs,"DELAY",2);let Fh=cs;const Uh=class Uh extends Bt{constructor(t){super(t,...Uh.propertyIds);M(this,"events");this.events=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,i){this.frames[t]=i.time,this.events[t]=i}apply(t,i,n,r,o,a,c,l,h){if(!r)return;const u=this.frames,d=this.frames.length;if(i>n)this.apply(null,i,Number.MAX_VALUE,r,0,a,!1,!1,!1),i=-1;else if(i>=u[d-1])return;if(n0&&u[f-1]===m;)f--}for(;f=u[f];f++)r.push(this.events[f])}};M(Uh,"propertyIds",[`${st.event}`]);let Tl=Uh;const jo=class jo extends Bt{constructor(t){super(t,...jo.propertyIds);M(this,"drawOrders");this.drawOrders=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,i,n){this.frames[t]=i,this.drawOrders[t]=n}apply(t,i,n,r,o,a,c,l,h){const u=h?t.drawOrder.appliedPose:t.drawOrder.pose,d=t.slots;if(l||n>2];switch(v){case 0:{const S=f[x];m=f[x+1],p=f[x+2],g=f[x+3];const C=(n-S)/(f[x+4]-S);m+=(f[x+4+1]-m)*C,p+=(f[x+4+2]-p)*C,g+=(f[x+4+3]-g)*C;break}case 1:m=f[x+1],p=f[x+2],g=f[x+3];break;default:m=this.getBezierValue(n,x,1,v-2),p=this.getBezierValue(n,x,2,v+18-2),g=this.getBezierValue(n,x,3,v+36-2)}const y=a===Xe.setup?u.data.setupPose:d;c?(d.mixRotate=y.mixRotate+m*o,d.mixX=y.mixX+p*o,d.mixY=y.mixY+g*o):(d.mixRotate=y.mixRotate+(m-y.mixRotate)*o,d.mixX=y.mixX+(p-y.mixX)*o,d.mixY=y.mixY+(g-y.mixY)*o)}}class kr extends Ll{constructor(e,t,i,n){super(e,t,i,n)}apply(e,t,i,n,r,o,a,c,l){if(a&&!this.additive&&(a=!1),this.constraintIndex===-1){const h=i>=this.frames[0]?this.getCurveValue(i):0,u=e.physics;for(const d of u)if(d.active&&this.global(d.data)){const f=l?d.appliedPose:d.pose;this.set(f,this.getAbsoluteValue(i,r,o,a,this.get(f),this.get(d.data.setupPose),h))}}else{const h=e.constraints[this.constraintIndex];if(h.active){const u=l?h.appliedPose:h.pose;this.set(u,this.getAbsoluteValue(i,r,o,a,this.get(u),this.get(h.data.setupPose)))}}}}class CS extends kr{constructor(e,t,i){super(e,t,i,st.physicsConstraintInertia)}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}}class ES extends kr{constructor(e,t,i){super(e,t,i,st.physicsConstraintStrength)}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}}class AS extends kr{constructor(e,t,i){super(e,t,i,st.physicsConstraintDamping)}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}}class IS extends kr{constructor(e,t,i){super(e,t,i,st.physicsConstraintMass)}get(e){return 1/e.massInverse}set(e,t){e.massInverse=1/t}global(e){return e.massGlobal}}class RS extends kr{constructor(e,t,i){super(e,t,i,st.physicsConstraintWind),this.additive=!0}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}}class PS extends kr{constructor(e,t,i){super(e,t,i,st.physicsConstraintGravity),this.additive=!0}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}}class kS extends kr{constructor(e,t,i){super(e,t,i,st.physicsConstraintMix)}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}}const $h=class $h extends Bt{constructor(t,i){super(t,...$h.propertyIds);M(this,"constraintIndex");this.constraintIndex=i,this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,i){this.frames[t]=i}apply(t,i,n,r,o,a,c,l,h){let u;if(this.constraintIndex!==-1&&(u=t.constraints[this.constraintIndex],!u.active))return;const d=this.frames;if(i>n)this.apply(t,i,Number.MAX_VALUE,[],o,a,!1,!1,!1),i=-1;else if(i>=d[d.length-1])return;if(!(n=d[Bt.search(d,i)+1]))if(u!=null)u.reset(t);else for(const f of t.physics)f.active&&f.reset(t)}};M($h,"propertyIds",[st.physicsConstraintReset.toString()]);let Oh=$h;class FS extends Ll{constructor(e,t,i){super(e,t,i,st.sliderTime)}apply(e,t,i,n,r,o,a,c,l){const h=e.constraints[this.constraintIndex];if(h.active){const u=l?h.appliedPose:h.pose;u.time=this.getAbsoluteValue(i,r,o,a,u.time,h.data.setupPose.time)}}}class OS extends Ll{constructor(e,t,i){super(e,t,i,st.sliderMix),this.additive=!0}apply(e,t,i,n,r,o,a,c,l){const h=e.constraints[this.constraintIndex];if(h.active){const u=l?h.appliedPose:h.pose;u.mix=this.getAbsoluteValue(i,r,o,a,u.mix,h.data.setupPose.mix)}}}const ol=class ol{constructor(e){M(this,"data");M(this,"tracks",[]);M(this,"timeScale",1);M(this,"unkeyedState",0);M(this,"events",[]);M(this,"listeners",[]);M(this,"queue",new fO(this));M(this,"propertyIds",new Map);M(this,"animationsChanged",!1);M(this,"trackEntryPool",new rO(()=>new dO));this.data=e}update(e){e*=this.timeScale;const t=this.tracks;for(let i=0,n=t.length;i0){if(r.delay-=o,r.delay>0)continue;o=-r.delay,r.delay=0}let a=r.next;if(a){const c=r.trackLast-a.delay;if(c>=0){for(a.delay=0,a.trackTime+=r.timeScale===0?0:(c/r.timeScale+e)*a.timeScale,r.trackTime+=o,this.setTrack(i,a,!0);a.mixingFrom;)a.mixTime+=e,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){t[i]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,e)){let c=r.mixingFrom;for(r.mixingFrom=null,c&&(c.mixingTo=null);c;)this.queue.end(c),c=c.mixingFrom}r.trackTime+=o}this.queue.drain()}updateMixingFrom(e,t){const i=e.mixingFrom;if(!i)return!0;const n=this.updateMixingFrom(i,t);if(i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,e.nextTrackLast!==-1&&e.mixTime>=e.mixDuration){if(i.totalAlpha===0||e.mixDuration===0){if(e.mixingFrom=i.mixingFrom,i.mixingFrom!=null&&(i.mixingFrom.mixingTo=e),i.totalAlpha===0)for(let r=e;r.mixingTo!=null;r=r.mixingTo)r.keepHold=!0;this.queue.end(i)}return n}return i.trackTime+=t*i.timeScale,e.mixTime+=t,!1}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();const t=this.events,i=this.tracks;let n=!1;for(let a=0,c=i.length;a0)continue;n=!0;let h=l.alpha;l.mixingFrom?h*=this.applyMixingFrom(l,e):l.trackTime>=l.trackEnd&&!l.next&&(h=0);let u=l.animationLast,d=l.getAnimationTime(),f=d,m=t;l.reverse&&(f=l.animation.duration-f,m=null);const p=l.animation.timelines,g=p.length;if(a===0&&h===1)for(let x=0;x=l.alphaAttachmentThreshold,y=l.additive,S=y||l.shortestRotation,C=!S&&l.timelinesRotation.length!==g<<1;C&&(l.timelinesRotation.length=g<<1);for(let w=0;w0?c/a:o,h=i.animation.timelines,u=h.length,d=i.timelineMode,f=i.timelineHoldMix,m=r=i.alphaAttachmentThreshold);else{const O=!p||!(A instanceof _r)||E===Xe.current;A.apply(t,S,w,b,R,E,g,O,!1)}}return i.reverse&&r0&&this.queueEvents(i,C),this.events.length=0,i.nextAnimationLast=C,i.nextTrackLast=i.trackTime,r}applyAttachmentTimeline(e,t,i,n,r){const o=t.slots[e.slotIndex];if(!o.bone.active||!r&&o.attachmentState===this.unkeyedState+Sy)return;let a=i=0,C=x>=0;Math.abs(v)<=90&&Ie.signum(v)!==Ie.signum(g)&&(Math.abs(x-y)>180?(p+=360*Ie.signum(x),C=S):y!==0?p-=360*Ie.signum(x):C=S),C!==S&&(p+=360*Ie.signum(x)),o[a]=p}o[a+1]=g,h.rotation=f+p*n}queueEvents(e,t){const i=e.animationStart,n=e.animationEnd,r=n-i,o=e.reverse;let a=e.trackLast%r;o&&(a=r-a);const c=this.events;let l=0,h=c.length;for(;l=i&&d.time<=n&&this.queue.event(e,d)}let u=!1;if(e.loop)if(r===0)u=!0;else{const d=Math.floor(e.trackTime/r);u=d>0&&d>Math.floor(e.trackLast/r)}else u=t>=n&&e.animationLast=i&&d.time<=n&&this.queue.event(e,d)}}eventsReverse(e,t,i){const n=e.animation.duration,r=n-t,o=n-i,a=e.animation.timelines;for(let c=0,l=e.animation.timelines.length;c=o){for(let m=0;m=r)break;this.events.push(u[m])}}else{for(let p=0;p=r);p++)this.events.push(u[p]);let m=0;for(;m=o);m++);for(;m= 0.");if(e>=this.tracks.length)return;const t=this.tracks[e];if(!t)return;this.queue.end(t),this.clearNext(t);let i=t;for(;;){const n=i.mixingFrom;if(!n)break;this.queue.end(n),i.mixingFrom=null,i.mixingTo=null,i=n}this.tracks[t.trackIndex]=null,this.queue.drain()}setTrack(e,t,i){const n=this.expandToIndex(e);this.tracks[e]=t,t.previous=null,n&&(n.next=null,i&&this.queue.interrupt(n),t.mixingFrom=n,n.mixingTo=t,t.mixTime=0,n.timelinesRotation.length=0),this.queue.start(t)}setAnimation(e,t,i=!1){return typeof t=="string"?this.setAnimation1(e,t,i):this.setAnimation2(e,t,i)}setAnimation1(e,t,i=!1){const n=this.data.skeletonData.findAnimation(t);if(!n)throw new Error(`Animation not found: ${t}`);return this.setAnimation2(e,n,i)}setAnimation2(e,t,i=!1){if(e<0)throw new Error("trackIndex must be >= 0.");if(!t)throw new Error("animation cannot be null.");let n=!0,r=this.expandToIndex(e);r&&(r.nextTrackLast===-1&&r.animation===t?(this.tracks[e]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,n=!1):this.clearNext(r));const o=this.trackEntry(e,t,i,r);return this.setTrack(e,o,n),this.queue.drain(),o}addAnimation(e,t,i=!1,n=0){return typeof t=="string"?this.addAnimation1(e,t,i,n):this.addAnimation2(e,t,i,n)}addAnimation1(e,t,i=!1,n=0){const r=this.data.skeletonData.findAnimation(t);if(!r)throw new Error(`Animation not found: ${t}`);return this.addAnimation2(e,r,i,n)}addAnimation2(e,t,i=!1,n=0){if(e<0)throw new Error("trackIndex must be >= 0.");if(!t)throw new Error("animation cannot be null.");let r=this.expandToIndex(e);if(r)for(;r.next;)r=r.next;const o=this.trackEntry(e,t,i,r);return r?(r.next=o,o.previous=r,n<=0&&(n=Math.max(n+r.getTrackComplete()-o.mixDuration,0))):(this.setTrack(e,o,!0),this.queue.drain(),n<0&&(n=0)),o.delay=n,o}setEmptyAnimation(e,t=0){const i=this.setAnimation(e,ol.emptyAnimation,!1);return i.mixDuration=t,i.trackEnd=t,i}addEmptyAnimation(e,t=0,i=0){const n=this.addAnimation(e,ol.emptyAnimation,!1,i);return i<=0&&(n.delay=Math.max(n.delay+n.mixDuration-t,0)),n.mixDuration=t,n.trackEnd=t,n}setEmptyAnimations(e=0){const t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let i=0,n=this.tracks.length;i0&&(o[d]=x);break}}c&&(g=g&~Cc|r[d]&Cc),r[d]=g}}from(e,t,i){const n=this.propertyIds;let r=mO;for(let o=0,a=i.length;o= 0.");return e>=this.tracks.length?null:this.tracks[e]}addListener(e){if(!e)throw new Error("listener cannot be null.");this.listeners.push(e)}removeListener(e){const t=this.listeners.indexOf(e);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}};M(ol,"emptyAnimation",new Lp("",[],0));let vy=ol;class dO{constructor(){M(this,"animation",null);M(this,"previous",null);M(this,"next",null);M(this,"mixingFrom",null);M(this,"mixingTo",null);M(this,"listener",null);M(this,"trackIndex",0);M(this,"loop",!1);M(this,"additive",!1);M(this,"reverse",!1);M(this,"shortestRotation",!1);M(this,"keepHold",!1);M(this,"eventThreshold",0);M(this,"mixAttachmentThreshold",0);M(this,"alphaAttachmentThreshold",0);M(this,"mixDrawOrderThreshold",0);M(this,"animationStart",0);M(this,"animationEnd",0);M(this,"animationLast",0);M(this,"nextAnimationLast",0);M(this,"delay",0);M(this,"trackTime",0);M(this,"trackLast",0);M(this,"nextTrackLast",0);M(this,"trackEnd",0);M(this,"timeScale",0);M(this,"alpha",0);M(this,"mixTime",0);M(this,"mixDuration",0);M(this,"totalAlpha",0);M(this,"mixInterpolation",oa.linear);M(this,"timelineMode",[]);M(this,"timelineHoldMix",[]);M(this,"timelinesRotation",[])}setMixDuration(e,t){this.mixDuration=e,t!==void 0&&(t<=0&&(t=this.previous==null?0:Math.max(t+this.previous.getTrackComplete()-e,0)),this.delay=t)}setMixInterpolation(e){if(!e)throw new Error("mixInterpolation cannot be null.");this.mixInterpolation=e}mix(){if(this.mixDuration===0)return 1;let e=this.mixTime/this.mixDuration;return e>=1?1:this.mixInterpolation===oa.linear?e:(e=this.mixInterpolation.apply(e),e<0?0:e>1?1:e)}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.mixInterpolation=oa.linear,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(!this.loop)return Math.min(this.trackTime+this.animationStart,this.animationEnd);const e=this.animationEnd-this.animationStart;return e===0?this.animationStart:this.trackTime%e+this.animationStart}setAnimationLast(e){this.animationLast=e,this.nextAnimationLast=e}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){const e=this.animationEnd-this.animationStart;if(e!==0){if(this.loop)return e*(1+(this.trackTime/e|0));if(this.trackTime=0}}class fO{constructor(e){M(this,"objects",[]);M(this,"drainDisabled",!1);M(this,"animState");this.animState=e}start(e){this.objects.push(zi.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(zi.interrupt),this.objects.push(e)}end(e){this.objects.push(zi.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(zi.dispose),this.objects.push(e)}complete(e){this.objects.push(zi.complete),this.objects.push(e)}event(e,t){this.objects.push(zi.event),this.objects.push(e),this.objects.push(t)}drain(){var e,t,i,n,r,o;if(!this.drainDisabled){this.drainDisabled=!0;for(let a=0;a= 0.");if(!i)throw new Error("name cannot be null.");this.index=t,this.parent=n}copy(t){const i=new wu(this.index,this.name,t);return i.length=this.length,i.setupPose.set(this.setupPose),i}}var zt;(function(s){s[s.Normal=0]="Normal",s[s.OnlyTranslation=1]="OnlyTranslation",s[s.NoRotationOrReflection=2]="NoRotationOrReflection",s[s.NoScale=3]="NoScale",s[s.NoScaleOrReflection=4]="NoScaleOrReflection"})(zt||(zt={}));class Pm{constructor(){M(this,"bone");M(this,"x",0);M(this,"y",0);M(this,"rotation",0);M(this,"scaleX",0);M(this,"scaleY",0);M(this,"shearX",0);M(this,"shearY",0);M(this,"inherit",zt.Normal);M(this,"a",0);M(this,"b",0);M(this,"c",0);M(this,"d",0);M(this,"worldY",0);M(this,"worldX",0);M(this,"world",0);M(this,"local",0)}set(e){if(e==null)throw new Error("pose cannot be null.");this.x=e.x,this.y=e.y,this.rotation=e.rotation,this.scaleX=e.scaleX,this.scaleY=e.scaleY,this.shearX=e.shearX,this.shearY=e.shearY,this.inherit=e.inherit}setPosition(e,t){this.x=e,this.y=t}setScale(e,t){this.scaleX=e,this.scaleY=t===void 0?e:t}getInherit(){return this.inherit}setInherit(e){if(e==null)throw new Error("inherit cannot be null.");this.inherit=e}update(e,t){this.world!==e._update&&this.updateWorldTransform(e)}updateWorldTransform(e){this.local===e._update?this.updateLocalTransform(e):this.world=e._update;const t=this.rotation,i=this.scaleX,n=this.scaleY,r=this.shearX,o=this.shearY;if(!this.bone.parent){const d=e.scaleX,f=e.scaleY,m=(t+r)*Ie.degRad,p=(t+90+o)*Ie.degRad;this.a=Math.cos(m)*i*d,this.b=Math.cos(p)*n*d,this.c=Math.sin(m)*i*f,this.d=Math.sin(p)*n*f,this.worldX=this.x*d+e.x,this.worldY=this.y*f+e.y;return}const a=this.bone.parent.appliedPose;let c=a.a,l=a.b,h=a.c,u=a.d;switch(this.worldX=c*this.x+l*this.y+a.worldX,this.worldY=h*this.x+u*this.y+a.worldY,this.inherit){case zt.Normal:{const d=(t+r)*Ie.degRad,f=(t+90+o)*Ie.degRad,m=Math.cos(d)*i,p=Math.cos(f)*n,g=Math.sin(d)*i,x=Math.sin(f)*n;this.a=c*m+l*g,this.b=c*p+l*x,this.c=h*m+u*g,this.d=h*p+u*x;return}case zt.OnlyTranslation:{const d=e.scaleX,f=e.scaleY,m=(t+r)*Ie.degRad,p=(t+90+o)*Ie.degRad;this.a=Math.cos(m)*i*d,this.b=Math.cos(p)*n*d,this.c=Math.sin(m)*i*f,this.d=Math.sin(p)*n*f;break}case zt.NoRotationOrReflection:{const d=e.scaleX,f=e.scaleY,m=1/d,p=1/f;c*=m,h*=p;let g=c*c+h*h,x=0;g>Ie.epsilon2?(g=Math.abs(c*u*p-l*m*h)/g,l=h*g,u=c*g,x=t-Ie.atan2Deg(h,c)):(c=0,h=0,x=t-90+Ie.atan2Deg(u,l));const v=(x+r)*Ie.degRad,y=(x+o+90)*Ie.degRad,S=Math.cos(v)*i,C=Math.cos(y)*n,w=Math.sin(v)*i,b=Math.sin(y)*n;this.a=(c*S-l*w)*d,this.b=(c*C-l*b)*d,this.c=(h*S+u*w)*f,this.d=(h*C+u*b)*f;break}case zt.NoScale:case zt.NoScaleOrReflection:{const d=e.scaleX,f=e.scaleY,m=1/d,p=1/f,g=t*Ie.degRad,x=Math.cos(g),v=Math.sin(g);let y=(c*x+l*v)*m,S=(h*x+u*v)*p;const C=1/Math.sqrt(y*y+S*S);y*=C,S*=C;let w=-S,b=y;this.inherit===zt.NoScale&&c*u-l*h<0!=(d<0!=f<0)&&(w=-w,b=-b);const _=r*Ie.degRad,A=(90+o)*Ie.degRad,P=Math.cos(_)*i,E=Math.cos(A)*n,R=Math.sin(_)*i,O=Math.sin(A)*n;this.a=(y*P+w*R)*d,this.b=(y*E+w*O)*d,this.c=(S*P+b*R)*f,this.d=(S*E+b*O)*f;break}}}updateLocalTransform(e){this.local=0,this.world=e._update;const t=e.scaleX,i=e.scaleY;if(!this.bone.parent){const x=1/t,v=1/i;this.x=(this.worldX-e.x)*x,this.y=(this.worldY-e.y)*v,this.set5(this.a*x,this.b*x,this.c*v,this.d*v,0);return}const n=this.bone.parent.appliedPose;let r=n.a,o=n.b,a=n.c,c=n.d;const l=r*c-o*a,h=1/(r*c-o*a),u=c*h,d=o*h,f=a*h,m=r*h,p=this.worldX-n.worldX,g=this.worldY-n.worldY;switch(this.x=p*u-g*d,this.y=g*m-p*f,this.inherit){case zt.Normal:this.set5(u*this.a-d*this.c,u*this.b-d*this.d,m*this.c-f*this.a,m*this.d-f*this.b,0);break;case zt.OnlyTranslation:{const x=1/t,v=1/i;this.set5(this.a*x,this.b*x,this.c*v,this.d*v,0);break}case zt.NoRotationOrReflection:{const x=1/t,v=1/i;r*=x,a*=v;const y=this.a*x,S=this.b*x,C=this.c*v,w=this.d*v,b=1/(r*r+a*a),_=1/Math.abs(l*x*v);this.set5((r*y+a*C)*b,(r*S+a*w)*b,(r*C-a*y)*_,(r*w-a*S)*_,Ie.atan2Deg(a,r));break}case zt.NoScale:case zt.NoScaleOrReflection:{const x=1/t,v=1/i,y=this.a*x,S=this.b*x,C=this.c*v,w=this.d*v;let b=c*this.a-o*this.c,_=r*this.c-a*this.a;l<0&&(b=-b,_=-_);let A=Ie.atan2Deg(_,b);this.rotation=A,A*=Ie.degRad;const P=Math.cos(A),E=Math.sin(A);let R=(r*P+o*E)*x,O=(a*P+c*E)*v;const U=1/Math.sqrt(R*R+O*O);R*=U,O*=U;const Y=this.inherit===zt.NoScale&&l<0!=(t<0!=i<0)?-1:1;this.set4(R*y+O*C,R*S+O*w,(R*C-O*y)*Y,(R*w-O*S)*Y)}}}set4(e,t,i,n){const r=e*e+i*i,o=t*t+n*n;r>Ie.epsilon2?(this.shearX=Ie.atan2Deg(i,e),this.scaleX=Math.sqrt(r)):(this.shearX=0,this.scaleX=0),this.scaleY=Math.sqrt(o),o>Ie.epsilon2?(this.shearY=Ie.atan2Deg(n,t),e*n-t*i<0?(this.scaleY=-this.scaleY,this.shearY+=90):this.shearY-=90,this.shearY>180?this.shearY-=360:this.shearY<=-180&&(this.shearY+=360)):this.shearY=0}set5(e,t,i,n,r){this.shearX=0;const o=e*e+i*i,a=t*t+n*n;if(o>Ie.epsilon2){const c=Ie.atan2Deg(i,e);this.rotation=c+r,this.scaleX=Math.sqrt(o),this.scaleY=Math.sqrt(a),a>Ie.epsilon2?(this.shearY=Ie.atan2Deg(n,t),e*n-t*i<0?(this.scaleY=-this.scaleY,this.shearY+=90-c):this.shearY-=90+c,this.shearY>180?this.shearY-=360:this.shearY<=-180&&(this.shearY+=360)):this.shearY=0}else this.scaleX=0,this.scaleY=Math.sqrt(a),this.shearY=0,this.rotation=a>Ie.epsilon2?Ie.atan2Deg(n,t)-90+r:r}validateLocalTransform(e){this.local===e._update&&this.updateLocalTransform(e)}modifyLocal(e){this.local===e._update&&this.updateLocalTransform(e),this.world=0,this.resetWorld(e,e._update)}modifyWorld(e){const t=e._update;this.local=t,this.world=t,this.resetWorld(e,t)}resetWorld(e,t){const i=this.bone.children;for(let n=0,r=i.length;n1&&t.constrained(this.bones[1].bone)}isSourceActive(){return this.target.active}static apply(t,i,n,r,o,a,c,l,h,u){typeof n=="number"?ur.apply1(t,i,n,r,o,a,c,l):ur.apply2(t,i,n,r,o,a,c,l,h,u)}static apply1(t,i,n,r,o,a,c,l){i.modifyLocal(t);const h=i.bone.parent.appliedPose;let u=h.a,d=h.b,f=h.c,m=h.d,p=-i.shearX-i.rotation,g=0,x=0;switch(i.inherit){case zt.OnlyTranslation:g=(n-i.worldX)*Ie.signum(t.scaleX),x=(r-i.worldY)*Ie.signum(t.scaleY);break;case zt.NoRotationOrReflection:{const v=Math.abs(u*m-d*f)/Math.max(Ie.epsilon,u*u+f*f),y=u/t.scaleX,S=f/t.scaleY;d=-S*v*t.scaleX,m=y*v*t.scaleY,p+=Ie.atan2Deg(S,y)}default:{const v=n-h.worldX,y=r-h.worldY,S=u*m-d*f;Math.abs(S)<=Ie.epsilon?(g=0,x=0):(g=(v*m-y*d)/S-i.x,x=(y*u-v*f)/S-i.y)}}if(p+=Ie.atan2Deg(x,g),i.scaleX<0&&(p+=180),p>180?p-=360:p<=-180&&(p+=360),i.rotation+=p*l,o||a){switch(i.inherit){case zt.NoScale:case zt.NoScaleOrReflection:g=n-i.worldX,x=r-i.worldY}const v=i.bone.data.length*i.scaleX;if(v>Ie.epsilon){const y=g*g+x*x;if(o&&yv*v){const S=(Math.sqrt(y)/v-1)*l+1;switch(i.scaleX*=S,c){case Xi.Uniform:i.scaleY*=S;break;case Xi.Volume:i.scaleY/=S<.7?.25+.642857*S:S}}}}}static apply2(t,i,n,r,o,a,c,l,h,u){if(i.inherit!==zt.Normal||n.inherit!==zt.Normal)return;i.modifyLocal(t),n.modifyLocal(t);let d=i.x,f=i.y,m=i.scaleX,p=i.scaleY,g=n.scaleX,x=0,v=0,y=0;m<0?(m=-m,x=180,y=-1):(x=0,y=1),p<0&&(p=-p,y=-y),g<0?(g=-g,v=180):v=0;let S=0,C=0,w=i.a,b=i.b,_=i.c,A=i.d;const P=Math.abs(m-p)<=Ie.epsilon;!P||c?(n.y=0,S=w*n.x+i.worldX,C=_*n.x+i.worldY):(S=w*n.x+b*n.y+i.worldX,C=_*n.x+A*n.y+i.worldY);const E=i.bone.parent.appliedPose;w=E.a,b=E.b,_=E.c,A=E.d;let R=w*A-b*_,O=S-E.worldX,U=C-E.worldY;R=Math.abs(R)<=Ie.epsilon?0:1/R;const Y=(O*A-U*b)*R-d,$=(U*w-O*_)*R-f;let X=Math.sqrt(Y*Y+$*$),D=n.bone.data.length*g,F,N;if(X0){let oe=Math.min(1,ne/(h*2))-1;oe=(ne-h*(1-oe*oe))/Z,k-=oe*k,V-=oe*V,G=k*k+V*V}}e:if(P){D*=m;let Z=(G-X*X-D*D)/(2*X*D);if(Z<-1)Z=-1,N=Math.PI*a;else if(Z>1){if(Z=1,N=0,c)switch(w=(Math.sqrt(G)/(X+D)-1)*u+1,i.scaleX*=w,l){case Xi.Uniform:i.scaleY*=w;break;case Xi.Volume:i.scaleY/=w<.7?.25+.642857*w:w}}else N=Math.acos(Z)*a;w=X+D*Z,b=D*Math.sin(N),F=Math.atan2(V*w-k*b,k*w+V*b)}else{w=m*D,b=p*D;const Z=w*w,ne=b*b,oe=Math.atan2(V,k);_=ne*X*X+Z*G-Z*ne;const de=-2*ne*X,pe=ne-Z;if(A=de*de-4*pe*_,A>=0){let ie=Math.sqrt(A);de<0&&(ie=-ie),ie=-(de+ie)*.5;let ue=ie/pe,fe=_/ie;const ee=Math.abs(ue)=0){U=Math.sqrt(ue)*a,F=oe-Math.atan2(U,ee),N=Math.atan2(U/p,(ee-X)/m);break e}}let he=Ie.PI,me=X-w,H=me*me,z=0,K=0,B=X+w,L=B*B,j=0;_=-w*X/(Z-ne),_>=-1&&_<=1&&(_=Math.acos(_),O=w*Math.cos(_)+X,U=b*Math.sin(_),A=O*O+U*U,AL&&(K=_,L=A,B=O,j=U)),G<=(H+L)*.5?(F=oe-Math.atan2(z*a,me),N=he*a):(F=oe-Math.atan2(j*a,B),N=K*a)}const W=Math.atan2(n.y,n.x)*y;F=(F-W)*Ie.radDeg+x-i.rotation,F>180?F-=360:F<=-180&&(F+=360),i.rotation+=F*u,N=((N+W)*Ie.radDeg-n.shearX)*y+v-n.rotation,N>180?N-=360:N<=-180&&(N+=360),n.rotation+=N*u}}class Xc extends Nl{constructor(t){super(t,new km);M(this,"bones",[]);M(this,"_target",null);M(this,"_scaleYMode",Xi.None)}set target(t){this._target=t}get target(){if(!this._target)throw new Error("target cannot be null.");return this._target}set scaleYMode(t){this._scaleYMode=t}get scaleYMode(){if(this._scaleYMode==null)throw new Error("scaleYMode cannot be null.");return this._scaleYMode}create(t){return new ur(this,t)}}class Fm{constructor(){M(this,"position",0);M(this,"spacing",0);M(this,"mixRotate",0);M(this,"mixX",0);M(this,"mixY",0)}set(e){this.position=e.position,this.spacing=e.spacing,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY}}class Vc extends Nl{constructor(t){super(t,new Fm);M(this,"bones",[]);M(this,"_slot",null);M(this,"positionMode",dn.Fixed);M(this,"spacingMode",mi.Fixed);M(this,"rotateMode",co.Chain);M(this,"offsetRotation",0)}set slot(t){this._slot=t}get slot(){if(this._slot)return this._slot;throw new Error("SlotData not set.")}create(t){return new Om(this,t)}}var dn;(function(s){s[s.Fixed=0]="Fixed",s[s.Percent=1]="Percent"})(dn||(dn={}));var mi;(function(s){s[s.Length=0]="Length",s[s.Fixed=1]="Fixed",s[s.Percent=2]="Percent",s[s.Proportional=3]="Proportional"})(mi||(mi={}));var co;(function(s){s[s.Tangent=0]="Tangent",s[s.Chain=1]="Chain",s[s.ChainScale=2]="ChainScale"})(co||(co={}));const Es=class Es extends Bl{constructor(t,i){super(t,new Fm,new Fm);M(this,"data");M(this,"bones");M(this,"slot");M(this,"spaces",[]);M(this,"positions",[]);M(this,"world",[]);M(this,"curves",[]);M(this,"lengths",[]);M(this,"segments",[]);if(!i)throw new Error("skeleton cannot be null.");this.data=t,this.bones=[];for(const n of this.data.bones)this.bones.push(i.bones[n.index].constrainedPose);this.slot=i.slots[t.slot.index]}copy(t){var i=new Es(this.data,t);return i.pose.set(this.pose),i}update(t,i){const n=this.slot.appliedPose.attachment;if(!(n instanceof _l))return;const r=this.appliedPose,o=r.mixRotate,a=r.mixX,c=r.mixY;if(o===0&&a===0&&c===0)return;const l=this.data,h=l.rotateMode===co.Tangent,u=l.rotateMode===co.ChainScale,d=this.bones,f=d.length,m=h?f:f+1,p=Ge.setArraySize(this.spaces,m),g=u?this.lengths=Ge.setArraySize(this.lengths,f):[],x=r.spacing;switch(l.spacingMode){case mi.Percent:if(u)for(let b=0,_=m-1;b<_;b++){const A=d[b],P=A.bone.data.length,E=P*A.a,R=P*A.c;g[b]=Math.sqrt(E*E+R*R)}Ge.arrayFill(p,1,m,x);break;case mi.Proportional:{let b=0;for(let _=0,A=m-1;_0){b=m/b*x;for(let _=1;_0?Ie.degRad:-Ie.degRad}for(let b=0,_=3;b0){let U=A.a,Y=A.b,$=A.c,X=A.d,D=0,F=0,N=0;if(h?D=v[_-1]:p[b+1]===0?D=v[_+2]:D=Math.atan2(O,R),D-=Math.atan2($,U),w){F=Math.cos(D),N=Math.sin(D);const k=A.bone.data.length;y+=(k*(F*U-N*$)-R)*o,S+=(k*(N*U+F*$)-O)*o}else D+=C;D>Ie.PI?D-=Ie.PI2:D<-Ie.PI&&(D+=Ie.PI2),D*=o,F=Math.cos(D),N=Math.sin(D),A.a=F*U-N*$,A.b=F*Y-N*X,A.c=N*U+F*$,A.d=N*Y+F*X}}}computeWorldPositions(t,i,n,r){const o=this.slot;let a=this.appliedPose.position,c=this.spaces,l=Ge.setArraySize(this.positions,n*3+2),h=this.world;const u=i.closed;let d=i.worldVerticesLength,f=d/6,m=Es.NONE;if(!i.constantSpeed){const N=i.lengths;f-=u?1:2;const k=N[f];this.data.positionMode===dn.Percent&&(a*=k);let V;switch(this.data.spacingMode){case mi.Percent:V=k;break;case mi.Proportional:V=k/n;break;default:V=1}h=Ge.setArraySize(this.world,8);for(let G=0,W=0,Z=0;Gk){m!==Es.AFTER&&(m=Es.AFTER,i.computeWorldVertices(t,o,d-6,4,h,0,2)),this.addAfterPosition(oe-k,h,0,l,W);continue}for(;;Z++){const de=N[Z];if(!(oe>de)){if(Z===0)oe/=de;else{const pe=N[Z-1];oe=(oe-pe)/(de-pe)}break}}Z!==m&&(m=Z,u&&Z===f?(i.computeWorldVertices(t,o,d-4,4,h,0,2),i.computeWorldVertices(t,o,0,4,h,4,2)):i.computeWorldVertices(t,o,Z*6+2,8,h,0,2)),this.addCurvePosition(oe,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],l,W,r||G>0&&ne===0)}return l}u?(d+=2,h=Ge.setArraySize(this.world,d),i.computeWorldVertices(t,o,2,d-4,h,0,2),i.computeWorldVertices(t,o,0,2,h,d-4,2),h[d-2]=h[0],h[d-1]=h[1]):(f--,d-=4,h=Ge.setArraySize(this.world,d),i.computeWorldVertices(t,o,2,d,h,0,2));const p=Ge.setArraySize(this.curves,f);let g=0,x=h[0],v=h[1],y=0,S=0,C=0,w=0,b=0,_=0,A=0,P=0,E=0,R=0,O=0,U=0,Y=0,$=0;for(let N=0,k=2;Ng){this.addAfterPosition(Z-g,h,d-4,l,k);continue}for(;;V++){const ne=p[V];if(!(Z>ne)){if(V===0)Z/=ne;else{const oe=p[V-1];Z=(Z-oe)/(ne-oe)}break}}if(V!==m){m=V;let ne=V*6;for(x=h[ne],v=h[ne+1],y=h[ne+2],S=h[ne+3],C=h[ne+4],w=h[ne+5],b=h[ne+6],_=h[ne+7],A=(x-y*2+C)*.03,P=(v-S*2+w)*.03,E=((y-C)*3-x+b)*.006,R=((S-w)*3-v+_)*.006,O=A*2+E,U=P*2+R,Y=(y-x)*.3+A+E*.16666667,$=(S-v)*.3+P+R*.16666667,F=Math.sqrt(Y*Y+$*$),D[0]=F,ne=1;ne<8;ne++)Y+=O,$+=U,O+=E,U+=R,F+=Math.sqrt(Y*Y+$*$),D[ne]=F;Y+=O,$+=U,F+=Math.sqrt(Y*Y+$*$),D[8]=F,Y+=O+E,$+=U+R,F+=Math.sqrt(Y*Y+$*$),D[9]=F,G=0}for(Z*=F;;G++){const ne=D[G];if(!(Z>ne)){if(G===0)Z/=ne;else{const oe=D[G-1];Z=G+(Z-oe)/(ne-oe)}break}}this.addCurvePosition(Z*.1,x,v,y,S,C,w,b,_,l,k,r||N>0&&W===0)}return l}addBeforePosition(t,i,n,r,o){const a=i[n],c=i[n+1],l=i[n+2]-a,h=i[n+3]-c,u=Math.atan2(h,l);r[o]=a+t*Math.cos(u),r[o+1]=c+t*Math.sin(u),r[o+2]=u}addAfterPosition(t,i,n,r,o){const a=i[n+2],c=i[n+3],l=a-i[n],h=c-i[n+1],u=Math.atan2(h,l);r[o]=a+t*Math.cos(u),r[o+1]=c+t*Math.sin(u),r[o+2]=u}addCurvePosition(t,i,n,r,o,a,c,l,h,u,d,f){if(t===0||Number.isNaN(t)){u[d]=i,u[d+1]=n,u[d+2]=Math.atan2(o-n,r-i);return}const m=t*t,p=m*t,g=1-t,x=g*g,v=x*g,y=g*t,S=y*3,C=g*S,w=S*t,b=i*v+r*C+a*w+l*p,_=n*v+o*C+c*w+h*p;u[d]=b,u[d+1]=_,f&&(t<.001?u[d+2]=Math.atan2(o-n,r-i):u[d+2]=Math.atan2(_-(n*x+o*y*2+c*m),b-(i*x+r*y*2+a*m)))}sort(t){const i=this.slot.data.index,n=this.slot.bone;t.skin!=null&&this.sortPathSlot(t,t.skin,i,n),t.data.defaultSkin!=null&&t.data.defaultSkin!==t.skin&&this.sortPathSlot(t,t.data.defaultSkin,i,n),this.sortPath(t,this.slot.pose.attachment,n);const r=this.bones,o=this.bones.length;for(let a=0;a0,a=this.data.y>0,c=this.data.rotate>0||this.data.shearX>0,l=this.data.scaleX>0,h=this.bone;let u=h.bone.data.length,d=this.data.step,f=0;if(i!==Kr.none){switch(h.modifyWorld(t),i){case Kr.reset:this.reset(t);case Kr.update:{const m=Math.max(t.time-this.lastTime,0),p=this.remaining;this.remaining+=m,this.lastTime=t.time;const g=h.worldX,x=h.worldY;if(this._reset)this._reset=!1,this.ux=g,this.uy=x;else{let v=this.remaining,y=n.inertia,S=t.data.referenceScale,C=-1,w=0,b=0,_=this.data.limit*m,A=_*Math.abs(t.scaleY);if(_*=Math.abs(t.scaleX),o||a){if(o){const P=(this.ux-g)*y;this.xOffset+=P>_?_:P<-_?-_:P,this.ux=g}if(a){const P=(this.uy-x)*y;this.yOffset+=P>A?A:P<-A?-A:P,this.uy=x}if(v>=d){const P=this.xOffset,E=this.yOffset;C=n.damping**(60*d),w=d*n.massInverse,b=n.strength;const R=S*n.wind,O=S*n.gravity,U=(R*t.windX+O*t.gravityX)*t.scaleX,Y=(R*t.windY+O*t.gravityY)*t.scaleY;do o&&(this.xVelocity+=(U-this.xOffset*b)*w,this.xOffset+=this.xVelocity*d,this.xVelocity*=C),a&&(this.yVelocity-=(Y+this.yOffset*b)*w,this.yOffset+=this.yVelocity*d,this.yVelocity*=C),v-=d;while(v>=d);this.xLag=this.xOffset-P,this.yLag=this.yOffset-E}f=Math.max(0,1-v/d),o&&(h.worldX+=(this.xOffset-this.xLag*f)*r*this.data.x),a&&(h.worldY+=(this.yOffset-this.yLag*f)*r*this.data.y)}if(c||l){let P=Math.atan2(h.c,h.a),E=0,R=0,O=0,U=this.cx-h.worldX,Y=this.cy-h.worldY;if(U>_?U=_:U<-_&&(U=-_),Y>A?Y=A:Y<-A&&(Y=-A),v=this.remaining,c){O=(this.data.rotate+this.data.shearX)*r,f=this.rotateLag*Math.max(0,1-p/d);let $=Math.atan2(Y+this.ty,U+this.tx)-P-(this.rotateOffset-f)*O;this.rotateOffset+=($-Math.ceil($*Ie.invPI2-.5)*Ie.PI2)*y,$=(this.rotateOffset-f)*O+P,E=Math.cos($),R=Math.sin($),l&&($=u*h.getWorldScaleX(),$>0&&(this.scaleOffset+=(U*E+Y*R)*y/$))}else{E=Math.cos(P),R=Math.sin(P);const $=u*h.getWorldScaleX()-this.scaleLag*Math.max(0,1-p/d);$>0&&(this.scaleOffset+=(U*E+Y*R)*y/$)}if(v>=d){C===-1&&(C=n.damping**(60*d),w=d*n.massInverse,b=n.strength);const $=n.wind*t.windX+n.gravity*t.gravityX,X=(n.wind*t.windY+n.gravity*t.gravityY)*Nm.yDir,D=this.rotateOffset,F=this.scaleOffset,N=u/S;for(;;)if(v-=d,l&&(this.scaleVelocity+=($*E-X*R-this.scaleOffset*b)*w,this.scaleOffset+=this.scaleVelocity*d,this.scaleVelocity*=C),c){if(this.rotateVelocity-=(($*R+X*E)*N+this.rotateOffset*b)*w,this.rotateOffset+=this.rotateVelocity*d,this.rotateVelocity*=C,v0){let v=0;this.data.rotate>0&&(v=m*this.data.rotate,p=Math.sin(v),g=Math.cos(v),x=h.b,h.b=g*x-p*h.d,h.d=p*x+g*h.d),v+=m*this.data.shearX,p=Math.sin(v),g=Math.cos(v),x=h.a,h.a=g*x-p*h.c,h.c=p*x+g*h.c}else m*=this.data.rotate,p=Math.sin(m),g=Math.cos(m),x=h.a,h.a=g*x-p*h.c,h.c=p*x+g*h.c,x=h.b,h.b=g*x-p*h.d,h.d=p*x+g*h.d}if(l){let m=1+(this.scaleOffset-this.scaleLag*f)*r*this.data.scaleX;switch(h.a*=m,h.c*=m,this.data.scaleYMode){case Xi.Uniform:h.b*=m,h.d*=m;break;case Xi.Volume:m=Math.abs(m),m=m>=.7?1/m:4-3.67347*m,h.b*=m,h.d*=m}}i!==Kr.pose&&(this.tx=u*h.a,this.ty=u*h.c)}}sort(t){const i=this.bone.bone;t.sortBone(i),t._updateCache.push(this),t.sortReset(i.children),t.constrained(i)}isSourceActive(){return this.bone.bone.active}}class Yc extends Nl{constructor(t){super(t,new Lm);M(this,"_bone",null);M(this,"x",0);M(this,"y",0);M(this,"rotate",0);M(this,"scaleX",0);M(this,"shearX",0);M(this,"limit",0);M(this,"step",0);M(this,"inertiaGlobal",!1);M(this,"strengthGlobal",!1);M(this,"dampingGlobal",!1);M(this,"massGlobal",!1);M(this,"windGlobal",!1);M(this,"gravityGlobal",!1);M(this,"mixGlobal",!1);M(this,"_scaleYMode",Xi.None)}set bone(t){this._bone=t}get bone(){if(this._bone)return this._bone;throw new Error("BoneData not set.")}get scaleYMode(){return this._scaleYMode}set scaleYMode(t){if(t==null)throw new Error("scaleYMode cannot be null.");this._scaleYMode=t}create(t){return new Su(this,t)}}typeof Math.fround>"u"&&(Math.fround=(s=>e=>(s[0]=e,s[0]))(new Float32Array(1)));class Dm{constructor(){M(this,"time",0);M(this,"mix",0)}set(e){this.time=e.time,this.mix=e.mix}}const al=class al extends Bl{constructor(t,i){super(t,new Dm,new Dm);M(this,"bone",null);if(!i)throw new Error("skeleton cannot be null.");t.bone!=null&&(this.bone=i.bones[t.bone.index])}copy(t){var i=new al(this.data,t);return i.pose.set(this.pose),i}update(t,i){const n=this.appliedPose;if(n.mix===0)return;const r=this.data,o=r.animation,a=this.bone;if(a!==null){if(!a.active)return;r.local&&a.appliedPose.validateLocalTransform(t),n.time=r.offset+(r.property.value(t,a.appliedPose,r.local,al.offsets)-r.property.offset)*r.scale,r.loop?n.time=o.duration+n.time%o.duration:n.time=Math.max(0,n.time)}const c=t.bones,l=o.bones;for(let h=0,u=o.bones.length;h=n.length&&(n.length=e+1),n[e]||(n[e]={}),n[e][t]=i}addSkin(e){for(let i=0;i= 0.");if(!n)throw new Error("boneData cannot be null.");this.index=t,this.boneData=n}}var Lh;(function(s){s[s.Normal=0]="Normal",s[s.Additive=1]="Additive",s[s.Multiply=2]="Multiply",s[s.Screen=3]="Screen"})(Lh||(Lh={}));class Xm{constructor(){M(this,"mixRotate",0);M(this,"mixX",0);M(this,"mixY",0);M(this,"mixScaleX",0);M(this,"mixScaleY",0);M(this,"mixShearY",0)}set(e){this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY}}class Vp extends Bl{constructor(t,i){super(t,new Xm,new Xm);M(this,"bones");M(this,"source");if(!i)throw new Error("skeleton cannot be null.");this.bones=[];for(const r of t.bones)this.bones.push(i.bones[r.index].constrainedPose);const n=i.bones[t.source.index];if(n==null)throw new Error("source cannot be null.");this.source=n}copy(t){var i=new Vp(this.data,t);return i.pose.set(this.pose),i}update(t,i){const n=this.appliedPose;if(n.mixRotate===0&&n.mixX===0&&n.mixY===0&&n.mixScaleX===0&&n.mixScaleY===0&&n.mixShearY===0)return;const r=this.data,o=r.localSource,a=r.localTarget,c=r.additive,l=r.clamp,h=r.offsets,u=this.source.appliedPose;o&&u.validateLocalTransform(t);const d=r.properties,f=r.properties.length,m=this.bones;for(let p=0,g=this.bones.length;p0?n[_t.ROTATION]:-n[_t.ROTATION]);return a<0&&(a+=360),a}}class $S extends ba{mix(e){return e.mixRotate}apply(e,t,i,n,r,o){if(r)i.rotation+=(o?n:n-i.rotation)*t.mixRotate;else{const a=e.scaleX,c=e.scaleY,l=1/a,h=1/c,u=i.a*l,d=i.b*l,f=i.c*h,m=i.d*h;n*=Ie.degRad,o||(n-=Math.atan2(f,u)),n>Ie.PI?n-=Ie.PI2:n<-Ie.PI&&(n+=Ie.PI2),n*=t.mixRotate;const p=Math.cos(n),g=Math.sin(n);i.a=(p*u-g*f)*a,i.b=(p*d-g*m)*a,i.c=(g*u+p*f)*c,i.d=(g*d+p*m)*c}}}class Ym extends xa{value(e,t,i,n){return i?t.x+n[_t.X]:(n[_t.X]*t.a+n[_t.Y]*t.b+t.worldX)/e.scaleX}}class XS extends ba{mix(e){return e.mixX}apply(e,t,i,n,r,o){r?i.x+=(o?n:n-i.x)*t.mixX:(o||(n-=i.worldX/e.scaleX),i.worldX+=n*t.mixX*e.scaleX)}}class Gm extends xa{value(e,t,i,n){return i?t.y+n[_t.Y]:(n[_t.X]*t.c+n[_t.Y]*t.d+t.worldY)/e.scaleY}}class VS extends ba{mix(e){return e.mixY}apply(e,t,i,n,r,o){r?i.y+=(o?n:n-i.y)*t.mixY:(o||(n-=i.worldY/e.scaleY),i.worldY+=n*t.mixY*e.scaleY)}}class jm extends xa{value(e,t,i,n){if(i)return t.scaleX+n[_t.SCALEX];const r=t.a/e.scaleX,o=t.c/e.scaleY;return Math.sqrt(r*r+o*o)+n[_t.SCALEX]}}class YS extends ba{mix(e){return e.mixScaleX}apply(e,t,i,n,r,o){if(r)o?i.scaleX*=1+(n-1)*t.mixScaleX:i.scaleX!==0&&(i.scaleX+=(n-i.scaleX)*t.mixScaleX);else if(o){const a=1+(n-1)*t.mixScaleX;i.a*=a,i.c*=a}else{let a=i.a/e.scaleX,c=i.c/e.scaleY,l=Math.sqrt(a*a+c*c);l!==0&&(l=1+(n-l)*t.mixScaleX/l,i.a*=l,i.c*=l)}}}class Hm extends xa{value(e,t,i,n){if(i)return t.scaleY+n[_t.SCALEY];const r=t.b/e.scaleX,o=t.d/e.scaleY;return Math.sqrt(r*r+o*o)+n[_t.SCALEY]}}class GS extends ba{mix(e){return e.mixScaleY}apply(e,t,i,n,r,o){if(r)o?i.scaleY*=1+(n-1)*t.mixScaleY:i.scaleY!==0&&(i.scaleY+=(n-i.scaleY)*t.mixScaleY);else if(o){const a=1+(n-1)*t.mixScaleY;i.b*=a,i.d*=a}else{let a=i.b/e.scaleX,c=i.d/e.scaleY,l=Math.sqrt(a*a+c*c);l!==0&&(l=1+(n-l)*t.mixScaleY/l,i.b*=l,i.d*=l)}}}class Wm extends xa{value(e,t,i,n){if(i)return t.shearY+n[_t.SHEARY];const r=1/e.scaleX,o=1/e.scaleY;return(Math.atan2(t.d*o,t.b*r)-Math.atan2(t.c*o,t.a*r))*Ie.radDeg-90+n[_t.SHEARY]}}class jS extends ba{mix(e){return e.mixShearY}apply(e,t,i,n,r,o){if(r)o||(n-=i.shearY),i.shearY+=n*t.mixShearY;else{const a=e.scaleX,c=e.scaleY,l=i.b/a,h=i.d/c,u=Math.atan2(h,l);n=(n+90)*Ie.degRad,o?n-=Ie.PI/2:(n-=u-Math.atan2(i.c/c,i.a/a),n>Ie.PI?n-=Ie.PI2:n<-Ie.PI&&(n+=Ie.PI2)),n=u+n*t.mixShearY;const d=Math.sqrt(l*l+h*h);i.b=Math.cos(n)*d*a,i.d=Math.sin(n)*d*c}}}class BV{constructor(e){M(this,"scale",1);M(this,"attachmentLoader");M(this,"linkedMeshes",[]);this.attachmentLoader=e}readSkeletonData(e){const t=this.scale,i=new DS;i.name="";const n=new gO(e),r=n.readInt32(),o=n.readInt32();i.hash=o===0&&r===0?null:o.toString(16)+r.toString(16),i.version=n.readString(),i.x=n.readFloat(),i.y=n.readFloat(),i.width=n.readFloat(),i.height=n.readFloat(),i.referenceScale=n.readFloat()*t;const a=n.readBoolean();a&&(i.fps=n.readFloat(),i.imagesPath=n.readString(),i.audioPath=n.readString());let c=0;c=n.readInt(!0);for(let m=0;m>5;for(let S=0,C;S>1&1,x.spacingMode=v>>2&3,x.rotateMode=v>>4&3,(v&128)!==0&&(x.offsetRotation=n.readFloat());const y=x.setupPose;y.position=n.readFloat(),x.positionMode===dn.Fixed&&(y.position*=t),y.spacing=n.readFloat(),(x.spacingMode===mi.Length||x.spacingMode===mi.Fixed)&&(y.spacing*=t),y.mixRotate=n.readFloat(),y.mixX=n.readFloat(),y.mixY=n.readFloat(),h.push(x);break}case $O:{const x=new Yc(p);x.bone=l[n.readInt(!0)];let v=n.readByte();if(x.skinRequired=(v&1)!==0,(v&2)!==0&&(x.x=n.readFloat()),(v&4)!==0&&(x.y=n.readFloat()),(v&8)!==0&&(x.rotate=n.readFloat()),(v&16)!==0){let S=n.readFloat();S<-2?(x.scaleYMode=Xi.Volume,S=-2-S):S<0&&(x.scaleYMode=Xi.Uniform,S=-1-S),x.scaleX=S}(v&32)!==0&&(x.shearX=n.readFloat()),x.limit=((v&64)!==0?n.readFloat():5e3)*t,x.step=1/n.readUnsignedByte();const y=x.setupPose;y.inertia=n.readFloat(),y.strength=n.readFloat(),y.damping=n.readFloat(),y.massInverse=(v&128)!==0?n.readFloat():1,y.wind=n.readFloat(),y.gravity=n.readFloat(),v=n.readByte(),(v&1)!==0&&(x.inertiaGlobal=!0),(v&2)!==0&&(x.strengthGlobal=!0),(v&4)!==0&&(x.dampingGlobal=!0),(v&8)!==0&&(x.massGlobal=!0),(v&16)!==0&&(x.windGlobal=!0),(v&32)!==0&&(x.gravityGlobal=!0),(v&64)!==0&&(x.mixGlobal=!0),y.mix=(v&128)!==0?n.readFloat():1,h.push(x);break}case XO:{const x=new Jr(p),v=n.readByte();if(x.skinRequired=(v&1)!==0,x.loop=(v&2)!==0,x.additive=(v&4)!==0,(v&8)!==0){const y=n.readFloat();a&&(v&64)!==0?x.max=y:x.setupPose.time=y}if((v&16)!==0&&(x.setupPose.mix=(v&32)!==0?n.readFloat():1),(v&64)!==0){x.local=(v&128)!==0,x.bone=l[n.readInt(!0)];const y=n.readFloat();let S=1;switch(n.readByte()){case 0:x.property=new Vm;break;case 1:{S=t,x.property=new Ym;break}case 2:{S=t,x.property=new Gm;break}case 3:x.property=new jm;break;case 4:x.property=new Hm;break;case 5:x.property=new Wm;break;default:continue}x.property.offset=y*S,x.offset=n.readFloat(),x.scale=n.readFloat()/S}h.push(x);break}}}const d=this.readSkin(n,i,!0,a);d&&(i.defaultSkin=d,i.skins.push(d));{let m=i.skins.length;for(Ge.setArraySize(i.skins,c=m+n.readInt(!0));m0){v=[];for(let b=0;b>4,e.readFloat())}r.push(P);break}}}}}const a=i.slots.length,c=e.readInt(!0);if(c>0){const f=new _r(c);for(let m=0;m0){const f=new Tl(h);for(let m=0;m>>1^-(i&1)}readStringRef(){const e=this.readInt(!0);return e===0?null:this.strings[e-1]}readString(){let e=this.readInt(!0);switch(e){case 0:return null;case 1:return""}e--;let t="";for(let i=0;i>4){case 12:case 13:t+=String.fromCharCode((n&31)<<6|this.readByte()&63),i+=2;break;case 14:t+=String.fromCharCode((n&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),i+=3;break;default:t+=String.fromCharCode(n),i++}}return t}readFloat(){const e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!==0}}let vO=class{constructor(e,t,i,n,r,o){M(this,"source");M(this,"skinIndex");M(this,"slotIndex");M(this,"sourceIndex");M(this,"mesh");M(this,"inheritTimelines");this.mesh=e,this.skinIndex=t,this.slotIndex=i,this.sourceIndex=n,this.source=r,this.inheritTimelines=o}};class Ty{constructor(e=null,t,i=0){M(this,"bones");M(this,"vertices");M(this,"length");this.bones=e,this.vertices=t,this.length=i}}var _n;(function(s){s[s.Region=0]="Region",s[s.BoundingBox=1]="BoundingBox",s[s.Mesh=2]="Mesh",s[s.LinkedMesh=3]="LinkedMesh",s[s.Path=4]="Path",s[s.Point=5]="Point",s[s.Clipping=6]="Clipping"})(_n||(_n={}));function ri(s,e,t,i){t instanceof Bn?yO(s,e,t,i):xO(s,e,t,i)}function yO(s,e,t,i){let n=s.readFloat(),r=s.readFloat()*i;for(let o=0,a=0,c=t.getFrameCount()-1;t.setFrame(o,n,r),o!==c;o++){const l=s.readFloat(),h=s.readFloat()*i;switch(s.readByte()){case Ks:t.setStepped(o);break;case Zs:gt(s,t,a++,o,0,n,l,r,h,i)}n=l,r=h}e.push(t)}function xO(s,e,t,i){let n=s.readFloat(),r=s.readFloat()*i,o=s.readFloat()*i;for(let a=0,c=0,l=t.getFrameCount()-1;t.setFrame(a,n,r,o),a!==l;a++){const h=s.readFloat(),u=s.readFloat()*i,d=s.readFloat()*i;switch(s.readByte()){case Ks:t.setStepped(a);break;case Zs:gt(s,t,c++,a,0,n,h,r,u,i),gt(s,t,c++,a,1,n,h,o,d,i)}n=h,r=u,o=d}e.push(t)}function _y(s,e){const t=s.readInt(!0);if(t===0)return null;const i=new Array(e).fill(-1),n=new Array(e-t);let r=0,o=0;for(let a=0;a=0;a--)i[a]===-1&&(i[a]=n[--o]);return i}function gt(s,e,t,i,n,r,o,a,c,l){e.setBezier(t,i,n,r,a,s.readFloat(),s.readFloat()*l,s.readFloat(),s.readFloat()*l,o,c)}const bO=0,wO=1,SO=2,MO=3,TO=4,_O=5,CO=6,EO=7,AO=8,IO=9,RO=10,PO=0,kO=1,FO=2,OO=3,LO=4,BO=5,NO=0,DO=1,UO=2,$O=3,XO=4,VO=0,YO=1,GO=0,jO=1,HO=2,WO=0,zO=1,qO=2,KO=4,ZO=5,JO=6,QO=7,eL=8,tL=0,iL=1,Ks=1,Zs=2;class sL{constructor(e){M(this,"attachmentLoader");M(this,"scale",1);M(this,"linkedMeshes",[]);this.attachmentLoader=e}readSkeletonData(e){const t=this.scale,i=new DS,n=typeof e=="string"?JSON.parse(e):e,r=n.skeleton;if(r&&(i.hash=r.hash,i.version=r.spine,i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height,i.referenceScale=te(r,"referenceScale",100)*t,i.fps=r.fps,i.imagesPath=r.images??null,i.audioPath=r.audio??null),n.bones)for(let o=0;o0&&l.properties.push(w)}l.offsets[_t.ROTATION]=te(o,"rotation",0),l.offsets[_t.X]=te(o,"x",0)*t,l.offsets[_t.Y]=te(o,"y",0)*t,l.offsets[_t.SCALEX]=te(o,"scaleX",0),l.offsets[_t.SCALEY]=te(o,"scaleY",0),l.offsets[_t.SHEARY]=te(o,"shearY",0);const y=l.setupPose;d&&(y.mixRotate=te(o,"mixRotate",1)),f&&(y.mixX=te(o,"mixX",1)),m&&(y.mixY=te(o,"mixY",y.mixX)),p&&(y.mixScaleX=te(o,"mixScaleX",1)),g&&(y.mixScaleY=te(o,"mixScaleY",y.mixScaleX)),x&&(y.mixShearY=te(o,"mixShearY",1)),i.constraints.push(l);break}case"path":{const l=new Vc(a);l.skinRequired=c;for(let f=0;f0){const d=i.findConstraint(l,Yc);if(!d)throw new Error(`Physics constraint not found: ${l}`);u=i.constraints.indexOf(d)}for(const d in h){const f=h[d];let m=f[0];if(!m)continue;const p=f.length;let g,x=0;if(d==="reset"){const v=new Oh(p,u);for(let y=0;m!=null;m=f[y+1],y++)v.setFrame(y,te(m,"time",0));r.push(v);continue}switch(d){case"inertia":g=new CS(p,p,u);break;case"strength":g=new ES(p,p,u);break;case"damping":g=new AS(p,p,u);break;case"mass":g=new IS(p,p,u);break;case"wind":g=new RS(p,p,u);break;case"gravity":g=new PS(p,p,u);break;case"mix":{x=1,g=new kS(p,p,u);break}default:continue}Qi(r,f,g,x,1)}}if(e.slider)for(const l in e.slider){const h=e.slider[l],u=i.findConstraint(l,Jr);if(!u)throw new Error(`Slider not found: ${l}`);const d=i.constraints.indexOf(u);for(const f in h){const m=h[f];if(!m[0])continue;const g=m.length;switch(f){case"time":Qi(r,m,new FS(g,g,d),1,1);break;case"mix":Qi(r,m,new OS(g,g,d),1,1);break}}}if(e.attachments)for(const l in e.attachments){const h=e.attachments[l],u=i.findSkin(l);if(!u)throw new Error(`Skin not found: ${l}`);for(const d in h){const f=h[d],m=i.findSlot(d);if(!m)throw new Error(`Attachment slot not found: ${d}`);const p=m.index;for(const g in f){const x=f[g],v=u.getAttachment(p,g);if(!v)throw new Error(`Timeline attachment not found: ${g}`);for(const y in x){const S=x[y];let C=S[0];if(C){if(y==="deform"){const w=v.bones,b=v.vertices,_=w?b.length/3*2:b.length,A=new bS(S.length,S.length,p,v);let P=te(C,"time",0);for(let E=0,R=0;;E++){let O;const U=te(C,"vertices",null);if(!U)O=w?Ge.newFloatArray(_):b;else{O=Ge.newFloatArray(_);const D=te(C,"offset",0);if(Ge.arrayCopy(U,0,O,D,U.length),n!==1)for(let F=D,N=F+U.length;F=0;l--)r[l]===-1&&(r[l]=o[--c]);return r}function xt(s,e,t,i,n,r,o,a,c,l){if(s==="stepped")return e.setStepped(i),t;const h=n<<2,u=s[h],d=s[h+1]*l,f=s[h+2],m=s[h+3]*l;return e.setBezier(t,i,n,r,a,u,d,f,m,o,c),t+1}function te(s,e,t){return s[e]!==void 0?s[e]:t}class rL{newRegionAttachment(e,t,i,n){return new gu(t,i)}newMeshAttachment(e,t,i,n){return new Ol(t,i)}newBoundingBoxAttachment(e,t){return new yw(t)}newPathAttachment(e,t){return new Ml(t)}newPointAttachment(e,t){return new Tw(t)}newClippingAttachment(e,t){return new na(t)}}class oL{sequence(e){for(let t=0;t!Number.isInteger(h)||h<0||h>=o))throw new Error(`拖尾网格“${e}”的三角形索引越界`);const a=Number(s.hull)||0;if(!Number.isInteger(a)||a<0||a>o)throw new Error(`拖尾网格“${e}”的外轮廓数量无效`);if(Array.isArray(s.edges)&&s.edges.some(h=>!Number.isInteger(h)||h<0||h>=o*2||h%2))throw new Error(`拖尾网格“${e}”的外轮廓边索引越界`);if(n.length===i.length)return;let c=0,l=0;for(;c=t)throw new Error(`拖尾网格“${e}”引用了不存在的骨骼`);if(![m,p,g].every(Number.isFinite)||g<0)throw new Error(`拖尾网格“${e}”包含无效权重数据`);u+=g}if(Math.abs(u-1)>.001)throw new Error(`拖尾网格“${e}”的顶点权重之和不为 1`);l++}if(c!==n.length||l!==o)throw new Error(`拖尾网格“${e}”的顶点数量与 UV 不一致`)}function cL(s,e){var r,o,a,c;const t=Array.isArray(s.bones)?s.bones:[],i=new Map(t.map(l=>[String(l.name||""),l])),n=new Set;for(const l of t){if(l.inherit!=null&&!aL.has(l.inherit))throw new Error(`骨骼“${l.name||""}”的 inherit 值“${l.inherit}”不符合 Spine ${e} JSON 格式`);if(/_trail_\d+_\d+$/.test(String(l.name||""))){const h=i.get(String(l.parent||""));if(!h||/_trail_\d+_\d+$/.test(String(h.name||"")))throw new Error(`拖尾骨骼“${l.name||""}”必须直接挂在粒子系统骨骼下,不能组成骨骼链`)}}for(const l of Array.isArray(s.skins)?s.skins:[]){const h=(l==null?void 0:l.attachments)||{};for(const u of Object.keys(h))for(const d of Object.keys(h[u]||{})){const f=h[u][d];(f==null?void 0:f.type)==="mesh"&&(lL(f,d,t.length),((r=f.vertices)==null?void 0:r.length)!==((o=f.uvs)==null?void 0:o.length)&&n.add(u))}}for(const l of Object.values(s.animations||{}))for(const h of n){const u=(c=(a=l==null?void 0:l.slots)==null?void 0:a[h])==null?void 0:c.attachment;if(Array.isArray(u)&&u.some(d=>!(d!=null&&d.name)))throw new Error(`加权拖尾插槽“${h}”不能使用空附件,未出现或死亡阶段应将对应骨骼缩放设为 0`)}}function hL(s){var e;if(String(((e=s==null?void 0:s.skeleton)==null?void 0:e.spine)||"")!=="3.8")throw new Error("Spine 3.8 导出的版本标识必须为 3.8");for(const t of s.bones||[])if(t.inherit!=null)throw new Error(`Spine 3.8 骨骼“${t.name||""}”应使用 transform,不能使用 inherit`);for(const t of Object.values(s.animations||{})){for(const n of Object.values(t.slots||{})){if(n.rgba||n.rgba2)throw new Error("Spine 3.8 插槽颜色时间轴必须使用 color / twoColor");for(const r of n.attachment||[])if(!Object.prototype.hasOwnProperty.call(r,"name"))throw new Error("Spine 3.8 附件时间轴的隐藏帧必须显式写入 name: null")}for(const n of Object.values(t.bones||{}))for(const r of n.rotate||[])if(r.value!=null||r.angle==null)throw new Error("Spine 3.8 旋转时间轴必须使用 angle");const i=[t];for(;i.length;){const n=i.pop();if(!(!n||typeof n!="object")){if(!Array.isArray(n)&&Array.isArray(n.curve))throw new Error("Spine 3.8 不支持 4.x 数组曲线格式");i.push(...Object.values(n))}}}}function Ey(s,e){var o;const t=JSON.parse(s),i=yh((o=t==null?void 0:t.skeleton)==null?void 0:o.spine);if(!i)throw new Error(`导出版本不受支持,仅支持 Spine ${xm()}`);if(e&&i!==e)throw new Error(`导出版本不一致:设置为 Spine ${e},JSON 标记为 Spine ${i}`);cL(t,i),i==="3.8"&&hL(t);const n=i==="3.8"?Nw(JSON.parse(JSON.stringify(t))):t,r=i==="4.3"?new sL(new oL).readSkeletonData(n):new Th(new rL).readSkeletonData(n);if(!r.bones.length)throw new Error("导出结果缺少骨骼");return{version:i,bones:r.bones.length,slots:r.slots.length,animations:r.animations.length}}const HS="http://127.0.0.1:27843";class Bh extends Error{constructor(t,i="CONNECTOR_ERROR",n){super(t);M(this,"code");M(this,"pairUrl");this.name="SpineConnectorError",this.code=i,this.pairUrl=n}}function zm(s,e){return String(s||"").trim().replace(/[\\/:*?"<>|]+/g,"_").replace(/^\.+/,"")||e}function uL(s,e){const t=/\.([a-z0-9]{2,5})$/i.exec(s);return t?`.${t[1].toLowerCase()}`:e.includes("jpeg")?".jpg":e.includes("webp")?".webp":e.includes("gif")?".gif":".png"}function dL(s,e,t){const i=String(s||"").replace(/\\/g,"/").split("/").filter(Boolean).map(r=>zm(r,"images")),n=zm(e.replace(/\.[^./\\]+$/,""),"image");return[...i,`${n}${uL(e,t)}`].join("/")}async function xf(s,e,t){if(!s)return null;const i=await fetch(s);if(!i.ok)throw new Error(`无法读取导出图片:${t}`);const n=await i.blob(),r=new Uint8Array(await n.arrayBuffer());let o="";const a=32768;for(let c=0;co.finally(()=>{i++,e==null||e(i,t.length)});for(const o of s.filter(a=>a.visible!==!1)){for(const a of o.config.imageResources)if(a.imageMode==="sequence"&&a.sequenceFrames.length)for(const c of a.sequenceFrames)t.push(n(xf(c.previewUrl,a.textureFolder,c.name||a.textureName)));else t.push(n(xf(a.previewUrl,a.textureFolder,a.textureName)));if(o.config.trail)for(const a of o.config.trailResources)t.push(n(xf(a.previewUrl,"",a.textureName)))}const r=new Map;for(const o of await Promise.all(t))o&&!r.has(o.path)&&r.set(o.path,o);return[...r.values()]}async function fL(){try{const s=await fetch(`${HS}/v1/health`,{cache:"no-store"});if(!s.ok)throw new Error(`HTTP ${s.status}`);return{available:!0,...await s.json()}}catch(s){return{available:!1,authorized:!1,error:s instanceof Error?s.message:String(s)}}}async function mL(s,e){const t=await WS(s.systems,(n,r)=>{e==null||e({phase:"images",progress:r?n/r:1})}),i=JSON.stringify({schemaVersion:1,projectName:s.projectName,spineVersion:s.spineVersion,skeletonJson:s.skeletonJson,images:t});return new Promise((n,r)=>{const o=new XMLHttpRequest;o.open("POST",`${HS}/v1/convert`),o.responseType="blob",o.setRequestHeader("Content-Type","application/json"),o.upload.onprogress=a=>{e==null||e({phase:"upload",progress:a.lengthComputable&&a.total>0?a.loaded/a.total:null})},o.upload.onloadend=()=>e==null?void 0:e({phase:"processing",progress:null}),o.onprogress=a=>{e==null||e({phase:"download",progress:a.lengthComputable&&a.total>0?a.loaded/a.total:null})},o.onerror=()=>r(new Bh("未检测到本地 Spine 连接器,请先启动连接器","CONNECTOR_OFFLINE")),o.onload=async()=>{const a=o.response;if(o.status<200||o.status>=300){let h={};try{h=JSON.parse(await a.text())}catch{}r(new Bh(h.message||`Spine 连接器返回错误:HTTP ${o.status}`,h.code,h.pairUrl));return}const c=o.getResponseHeader("X-Spine-File-Name");let l=`${zm(s.projectName,"SpineParticle")}.zip`;if(c)try{l=decodeURIComponent(c)}catch{}n({blob:a,fileName:l,spineEditorVersion:o.getResponseHeader("X-Spine-Editor-Version")||s.spineVersion,imageCount:t.length})},o.send(i)})}function pL(s,e){const t=URL.createObjectURL(s),i=document.createElement("a");i.href=t,i.download=/\.zip$/i.test(e)?e:`${e}.zip`,i.style.display="none",document.body.appendChild(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(t),1e3)}const gL=Array.from({length:256},(s,e)=>{let t=e;for(let i=0;i<8;i++)t=t&1?3988292384^t>>>1:t>>>1;return t>>>0});function vL(s){let e=4294967295;for(const t of s)e=gL[(e^t)&255]^e>>>8;return(e^4294967295)>>>0}function yL(s){const e=String(s||"").replace(/\\/g,"/").split("/").filter(t=>t&&t!==".");if(!e.length||e.some(t=>t===".."))throw new Error("ZIP 文件路径无效");return e.join("/")}function xL(s=new Date){const e=Math.max(1980,s.getFullYear());return{time:s.getHours()<<11|s.getMinutes()<<5|Math.floor(s.getSeconds()/2),date:e-1980<<9|s.getMonth()+1<<5|s.getDate()}}function bf(s){const e=new Uint8Array(s);return{bytes:e,view:new DataView(e.buffer)}}function Ay(s){const e=new Uint8Array(s.reduce((i,n)=>i+n.length,0));let t=0;for(const i of s)e.set(i,t),t+=i.length;return e}function bL(s){const e=new TextEncoder,t=[],i=[],n=xL();let r=0;for(const c of s){const l=e.encode(yL(c.name)),h=vL(c.data),u=bf(30);u.view.setUint32(0,67324752,!0),u.view.setUint16(4,20,!0),u.view.setUint16(6,2048,!0),u.view.setUint16(10,n.time,!0),u.view.setUint16(12,n.date,!0),u.view.setUint32(14,h,!0),u.view.setUint32(18,c.data.length,!0),u.view.setUint32(22,c.data.length,!0),u.view.setUint16(26,l.length,!0),t.push(u.bytes,l,c.data);const d=bf(46);d.view.setUint32(0,33639248,!0),d.view.setUint16(4,20,!0),d.view.setUint16(6,20,!0),d.view.setUint16(8,2048,!0),d.view.setUint16(12,n.time,!0),d.view.setUint16(14,n.date,!0),d.view.setUint32(16,h,!0),d.view.setUint32(20,c.data.length,!0),d.view.setUint32(24,c.data.length,!0),d.view.setUint16(28,l.length,!0),d.view.setUint32(42,r,!0),i.push(d.bytes,l),r+=u.bytes.length+l.length+c.data.length}const o=Ay(i),a=bf(22);return a.view.setUint32(0,101010256,!0),a.view.setUint16(8,s.length,!0),a.view.setUint16(10,s.length,!0),a.view.setUint32(12,o.length,!0),a.view.setUint32(16,r,!0),new Blob([Ay([...t,o,a.bytes])],{type:"application/zip"})}function wL(s){const e=atob(s),t=new Uint8Array(e.length);for(let i=0;ii===".."||/^[a-z]+:/i.test(i))?"images":t.join("/")}function ML(s){return String(s||"SpineParticle").replace(/\.json$/i,"").replace(/[\\/:*?"<>|]+/g,"_").replace(/^\.+/,"")||"SpineParticle"}async function TL(s){const e=await WS(s.systems);if(!e.length)throw new Error("当前可见粒子系统没有可导出的图片");const t=SL(s.imagesPath);return{blob:bL(e.map(n=>({name:`${t}/${n.path}`,data:wL(n.dataBase64)}))),imageCount:e.length,folder:t}}function _L(s,e){const t=`${ML(e)}-images.zip`,i=URL.createObjectURL(s),n=document.createElement("a");return n.href=i,n.download=t,n.style.display="none",document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(i),1e3),t}function CL(s){s.settings.exportSettings=I1(s.settings.exportSettings);const e=Le(()=>s.settings.exportSettings),t=Fe(!1),i=Fe(null),n=Fe(""),r=Fe(!1),o=Fe(null),a=Fe(""),c=Fe(""),l=Le(()=>{const b=o.value;return b?b.available?b.spineFound?b.authorized?"连接器可用 · Spine 已就绪":"连接器已启动,当前网站尚未授权":"连接器已启动,但未找到 Spine":"本地 Spine 连接器未启动":"正在检测本地 Spine 连接器…"}),h=Le(()=>{var b,_,A,P,E,R;return{ready:!!((b=o.value)!=null&&b.available)&&!!((_=o.value)!=null&&_.spineFound)&&!!((A=o.value)!=null&&A.authorized),warning:!!((P=o.value)!=null&&P.available)&&(!((E=o.value)!=null&&E.spineFound)||!((R=o.value)!=null&&R.authorized))}}),u=Le(()=>{var b,_,A;return!!((b=o.value)!=null&&b.available)&&!!((_=o.value)!=null&&_.spineFound)&&!!((A=o.value)!=null&&A.authorized)}),d=Le(()=>{const b=o.value;return!(b!=null&&b.available)||!b.spineFound||b.authorized||typeof window>"u"?"":`http://127.0.0.1:27843/pair?origin=${encodeURIComponent(window.location.origin)}`}),f=Le(()=>{const b=o.value;return b?b.available?b.spineFound?b.authorized?"":"未授权":"未找到 Spine":"未启动":"检测中"}),m=Le(()=>t.value?"正在重新计算并生成 Spine 工程":f.value?`暂不可用:${f.value}`:`调用本机 Spine 自动生成 ${e.value.spineVersion} 工程`);ys(()=>{x(),p=window.setInterval(x,3e3)});let p,g=0;Rr(()=>{p!==void 0&&window.clearInterval(p)});async function x(){const b=++g,_=await fL();if(b!==g)return;o.value=_;const A=c.value;(A==="CONNECTOR_OFFLINE"?_.available:A==="SPINE_NOT_FOUND"?_.available&&_.spineFound:A==="ORIGIN_NOT_ALLOWED"?_.available&&_.spineFound&&_.authorized:!!A&&_.available&&_.spineFound&&_.authorized)&&(c.value="",a.value="",r.value&&(r.value=!1,n.value=""))}function v(){return new Promise(b=>requestAnimationFrame(()=>b()))}async function y(b){s.timeline.playing=!1,s.timeline.frame=0,s.timeline.recorded=!1;for(const P of s.systems)P.frames=void 0;s.recalcTotalFrames(),await v(),s.timeline.playing=!0;const _=s.timeline.totalFrames/Math.max(1,s.timeline.fps)*1e3,A=performance.now()+Math.max(8e3,_*2.5+3e3);for(;!s.timeline.recorded;){if(performance.now()>A)throw new Error("重新计算动画超时,请确认页面仍在运行后重试");b==null||b(Math.min(.98,s.timeline.frame/Math.max(1,s.timeline.totalFrames-1))),await new Promise(P=>setTimeout(P,50))}b==null||b(1)}async function S(){if(!t.value){t.value=!0,i.value="json",r.value=!1,c.value="",a.value="",n.value="正在重新计算粒子动画…";try{await y();const b=py({systems:s.systems,timeline:s.timeline,settings:e.value});Ey(b.text,e.value.spineVersion),iO(b,e.value.fileName);const _=b.warnings.length?`;${b.warnings.length} 条资源提示(缺图仍已导出)`:"";n.value=`已导出 Spine ${e.value.spineVersion}:${b.particleSystemCount} 个粒子系统、${b.animationCount} 个动画、${b.boneCount} 根骨骼${_}`}catch(b){r.value=!0,n.value=b instanceof Error?b.message:String(b)}finally{t.value=!1,i.value=null}}}async function C(){if(t.value)return;t.value=!0,i.value="spine",r.value=!1,c.value="",a.value="",n.value="正在重新计算粒子动画…";const b=Zw("导出 Spine 包","正在重新计算粒子动画…");try{await b.paint(),await y(E=>b.update(E*18,"正在重新计算粒子动画…")),b.update(20,"正在生成 Spine JSON…");const _=py({systems:s.systems,timeline:s.timeline,settings:e.value});Ey(_.text,e.value.spineVersion),n.value="正在整理图片并调用本机 Spine…";const A=e.value.fileName.replace(/\.json$/i,"")||"SpineParticle",P=await mL({projectName:A,spineVersion:e.value.spineVersion,skeletonJson:_.text,systems:s.systems},({phase:E,progress:R})=>{E==="images"?b.update(R==null?null:22+R*18,"正在整理工程图片…"):E==="upload"?b.update(R==null?null:40+R*30,"正在上传数据到 Spine 连接器…"):E==="processing"?b.update(null,"Spine 正在转换工程,请稍候…"):b.update(R==null?null:82+R*16,"正在下载生成的 Spine 工程包…")});b.update(99,"正在交给浏览器下载…"),pL(P.blob,P.fileName),n.value=`已生成 ${P.fileName}:包含 .spine 工程和 ${P.imageCount} 张图片,Spine ${P.spineEditorVersion}`,await x(),await b.finish("Spine 工程包已开始下载")}catch(_){const A=_ instanceof Error?_.message:String(_);r.value=!0,c.value=_ instanceof Bh?_.code:"",_ instanceof Bh&&_.pairUrl&&(a.value=_.pairUrl),n.value=A,await x(),await b.fail(A)}finally{t.value=!1,i.value=null}}async function w(){if(!t.value){t.value=!0,i.value="images",r.value=!1,c.value="",a.value="",n.value="正在整理当前粒子系统使用的图片…";try{const b=await TL({systems:s.systems,imagesPath:e.value.imagesPath}),_=_L(b.blob,e.value.fileName);n.value=`已生成 ${_}:${b.folder}/ 内包含 ${b.imageCount} 张图片`}catch(b){r.value=!0,n.value=b instanceof Error?b.message:String(b)}finally{t.value=!1,i.value=null}}}return{exportSettings:e,exportBusy:t,exportTarget:i,exportMessage:n,exportError:r,connectorHealth:o,connectorPairUrl:a,connectorExportErrorCode:c,connectorStatusText:l,connectorStatusClass:h,connectorReady:u,connectorAuthorizationUrl:d,connectorDisabledReason:f,connectorButtonTitle:m,connectorHealthTimer:p,connectorHealthRequestId:g,refreshConnectorHealth:x,nextPaint:v,prepareExportFrames:y,exportSpineJson:S,exportSpineProject:C,exportSpineImages:w}}function EL(s){const e=Fe(null),t=Fe(""),i=Fe([]),n=Fe(!1),r=Fe(""),o=Fe(!1);function a(){Yw(s),o.value=!1,r.value="配置已保存到本地"}async function c(u){var m;const d=u.target,f=(m=d.files)==null?void 0:m[0];if(f){r.value="正在加载配置…",o.value=!1;try{await Xk(s,f),r.value=`已加载:${f.name}`}catch(p){o.value=!0,r.value=p instanceof Error?p.message:String(p)}finally{d.value=""}}}async function l(){try{const u=await fetch(`/Preset/index.json?t=${Date.now()}`,{cache:"no-store"});if(!u.ok)throw new Error("无法读取预设列表");const d=await u.json();i.value=Array.isArray(d)?d.filter(f=>!!f&&typeof f.name=="string"&&typeof f.file=="string"):[]}catch{i.value=[]}}async function h(){const u=t.value;if(!u)return;n.value=!0,o.value=!1,r.value="正在加载预设…";const d=Zw("加载预设",`正在下载 ${u}…`);try{await d.paint();const f=await fetch(`/Preset/${encodeURIComponent(u)}`,{cache:"no-store"});if(!f.ok)throw new Error(`无法读取预设:${u}`);const m=await E3(f,p=>{d.update(p==null?null:p*55,`正在下载 ${u}…`)});d.update(58,"正在解析预设配置…"),d.update(70,"正在解析并恢复预设资源…"),await jw(s,m),r.value=`已加载预设:${u.replace(/\.json$/i,"")}`,await d.finish("预设加载完成")}catch(f){o.value=!0;const m=f instanceof Error?f.message:String(f);r.value=`${m},请检查预设文件命名`,await d.fail(m)}finally{n.value=!1,t.value=""}}return ys(l),{configFileInput:e,selectedPreset:t,presetOptions:i,presetLoading:n,configMessage:r,configError:o,saveConfig:a,onConfigFileChange:c,refreshPresets:l,loadSelectedPreset:h}}function AL(s){const e=Fe(null),t=Fe(null),i=Fe(null),n=Fe(null),r=Fe(null);function o(){var k;const F=(k=s.value)==null?void 0:k.config;if(!F)return;const N=Math.max(0,...F.trailResources.map(V=>V.id))+1;F.trailResources.push({id:N,texture:null,textureName:"trail",previewUrl:"/images/trail.png",weight:100,locked:!1,rotation:0,colorMode:"particle",color:"#ffffff",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],blend:"normal",alphaMode:"particle",alpha:1,alphaCurve:Am.map(V=>({...V})),boneCount:3,trailRatio:100,lengthMode:"fixed",length:100,lengthMin:100,lengthMax:100,widthSizeMode:"fixed",width:100,widthMin:100,widthMax:100,widthMode:"particle",lifeLengthEnabled:!1,lifeLengthCurve:Cm.map(V=>({...V})),shapeEnabled:!1,shapeCurve:Im.map(V=>({...V}))}),m()}function a(F){var N;r.value=F,(N=n.value)==null||N.click()}function c(F,N){var G;const k=(G=s.value)==null?void 0:G.config;if(!k)return;const V=F==="trailGridCols"?32:16;k[F]=Math.min(V,Math.max(2,Math.round(Number(N)||2)))}function l(F,N){var V;const k=(V=s.value)==null?void 0:V.config.trailResources.find(G=>G.id===F);k&&(k.boneCount=Math.min(16,Math.max(2,Math.round(Number(N)||2))))}function h(F,N){var V;const k=(V=s.value)==null?void 0:V.config.trailResources.find(G=>G.id===F);k&&(k.rotation=Math.max(-360,Math.min(360,Number(N)||0)))}async function u(F){var Z,ne;const N=F.target,k=(Z=N.files)==null?void 0:Z[0],V=(ne=s.value)==null?void 0:ne.config,G=V==null?void 0:V.trailResources.find(oe=>oe.id===r.value);if(!k||!G){N.value="";return}const W=await _(k);G.texture=vr(await Ke.fromURL(W)),G.previewUrl=W,G.textureName=k.name.replace(/\.[^.]+$/,"")||"trail",N.value="",r.value=null}async function d(F){var V;const N=(V=s.value)==null?void 0:V.config,k=N==null?void 0:N.trailResources.find(G=>G.id===F);k&&(k.texture=vr(await Ke.fromURL("/images/trail.png")),k.previewUrl="/images/trail.png",k.textureName="trail",k.weight=100,k.locked=!1,k.rotation=0,k.boneCount=3,k.trailRatio=100,k.lengthMode="fixed",k.length=100,k.lengthMin=100,k.lengthMax=100,k.widthSizeMode="fixed",k.width=100,k.widthMin=100,k.widthMax=100,k.widthMode="particle",k.lifeLengthEnabled=!1,k.lifeLengthCurve=Cm.map(G=>({...G})),k.shapeEnabled=!1,k.shapeCurve=Im.map(G=>({...G})),k.colorMode="particle",k.color="#ffffff",k.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ffffff"}],k.blend="normal",k.alphaMode="particle",k.alpha=1,k.alphaCurve=Am.map(G=>({...G})),m())}function f(F){var V;const N=(V=s.value)==null?void 0:V.config.trailResources;if(!N||N.length<=1)return;const k=N.findIndex(G=>G.id===F);k>=0&&N.splice(k,1),m()}function m(){var G;const F=(G=s.value)==null?void 0:G.config.trailResources;if(!(F!=null&&F.length))return;if(F.length===1){F[0].weight=100,F[0].locked=!1;return}const N=F.filter(W=>W.locked),k=F.filter(W=>!W.locked);let V=N.reduce((W,Z)=>W+Math.max(0,Number(Z.weight)||0),0);V>100&&(Y(N,100,!0),V=100),Y(k,100-V)}function p(F,N){var ne;const k=(ne=s.value)==null?void 0:ne.config.trailResources;if(!(k!=null&&k.length))return;if(k.length===1){k[0].weight=100,k[0].locked=!1;return}const V=k.find(oe=>oe.id===F);if(!V||V.locked)return;const G=k.filter(oe=>oe.id!==F&&oe.locked).reduce((oe,de)=>oe+Math.max(0,Number(de.weight)||0),0),W=Math.max(0,100-G),Z=k.filter(oe=>oe.id!==F&&!oe.locked);V.weight=U(Math.min(W,Math.max(0,Number(N)||0))),Z.length?Y(Z,W-V.weight,!0):V.weight=U(W)}function g(F){var V;const N=(V=s.value)==null?void 0:V.config.trailResources;if(!N||N.length===1)return;const k=N.find(G=>G.id===F);k&&(k.locked=!k.locked)}function x(F,N){const k=N.target;F.color=P(k.value,F.color),k.value=F.color}function v(F,N){x(F,N),N.target.blur()}function y(){var k;const F=(k=s.value)==null?void 0:k.config;if(!F)return;const N=Math.max(0,...F.imageResources.map(V=>V.id))+1;F.imageResources.push({id:N,texture:F.texture,textureName:"star",textureFolder:"",previewUrl:"/images/star.png",imageMode:"fixed",sequencePlayback:"loop-forward",sequenceFps:30,sequenceFrames:[],weight:100,locked:!1,scale:1,anchorX:.5,anchorY:.5,colorMode:"fixed",colorStart:"#ffffff",colorEnd:"#ff4d4d",colorGradient:[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],blend:"normal",independentAlpha:"off",alpha:1,alphaCurveMode:"跟随导出",alphaCurve:Em.map(V=>({...V}))}),$()}function S(F){var N;i.value=F,(N=e.value)==null||N.click()}function C(F){var N;i.value=F,(N=t.value)==null||N.click()}async function w(F){var ne,oe;const N=F.target,k=(ne=N.files)==null?void 0:ne[0],V=(oe=s.value)==null?void 0:oe.config,G=V==null?void 0:V.imageResources.find(de=>de.id===i.value);if(!k||!G){N.value="";return}const W=await _(k),Z=vr(await Ke.fromURL(W));G.texture=Z,G.previewUrl=W,G.textureFolder="",G.textureName=k.name.replace(/\.[^.]+$/,"")||"particle",N.value="",i.value=null}async function b(F){var W;const N=F.target,k=Array.from(N.files||[]).sort((Z,ne)=>Z.name.localeCompare(ne.name,void 0,{numeric:!0,sensitivity:"base"})),V=(W=s.value)==null?void 0:W.config,G=V==null?void 0:V.imageResources.find(Z=>Z.id===i.value);if(!k.length||!G){N.value="";return}G.sequenceFrames=await Promise.all(k.map(async Z=>{const ne=await _(Z);return{name:Z.name,previewUrl:ne,texture:vr(await Ke.fromURL(ne))}})),G.imageMode="sequence",N.value="",i.value=null}function _(F){return new Promise((N,k)=>{const V=new FileReader;V.onload=()=>N(String(V.result||"")),V.onerror=()=>k(V.error),V.readAsDataURL(F)})}function A(F){var V;const N=(V=s.value)==null?void 0:V.config,k=N==null?void 0:N.imageResources.find(G=>G.id===F);!N||!k||(k.texture=N.texture,k.textureName="star",k.textureFolder="",k.previewUrl="/images/star.png",k.imageMode="fixed",k.sequencePlayback="loop-forward",k.sequenceFps=30,k.sequenceFrames=[],k.scale=1,k.anchorX=.5,k.anchorY=.5,k.colorMode="fixed",k.colorStart="#ffffff",k.colorEnd="#ff4d4d",k.colorGradient=[{position:0,color:"#ffffff"},{position:1,color:"#ff4d4d"}],k.blend="normal",k.independentAlpha="off",k.alpha=1,k.alphaCurveMode="跟随导出",k.alphaCurve=Em.map(G=>({...G})),k.locked=!1,$())}function P(F,N){let k=F.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(k)&&(k=k.split("").map(V=>V+V).join("")),/^[0-9a-f]{6}$/i.test(k)?`#${k.toLowerCase()}`:N}function E(F,N){const k=N.target;F.colorStart=P(k.value,F.colorStart),k.value=F.colorStart}function R(F,N){E(F,N),N.target.blur()}function O(F){var V;const N=(V=s.value)==null?void 0:V.config.imageResources;if(!N||N.length<=1)return;const k=N.findIndex(G=>G.id===F);k>=0&&N.splice(k,1),$()}function U(F){return Math.round(F)}function Y(F,N,k=!1){if(!F.length)return;const V=Math.max(0,U(N)),G=k?F.reduce((Z,ne)=>Z+Math.max(0,Number(ne.weight)||0),0):0;let W=0;F.forEach((Z,ne)=>{const oe=ne===F.length-1,de=U(oe?V-W:G>0?V*Math.max(0,Number(Z.weight)||0)/G:V/F.length);Z.weight=de,W+=de})}function $(){var G;const F=(G=s.value)==null?void 0:G.config.imageResources;if(!(F!=null&&F.length))return;if(F.length===1){F[0].weight=100,F[0].locked=!1;return}const N=F.filter(W=>W.locked),k=F.filter(W=>!W.locked);let V=N.reduce((W,Z)=>W+Math.max(0,Number(Z.weight)||0),0);V>100&&(Y(N,100,!0),V=100),Y(k,100-V)}function X(F,N){var ne;const k=(ne=s.value)==null?void 0:ne.config.imageResources;if(!(k!=null&&k.length))return;if(k.length===1){k[0].weight=100,k[0].locked=!1;return}const V=k.find(oe=>oe.id===F);if(!V||V.locked)return;const G=k.filter(oe=>oe.id!==F&&oe.locked).reduce((oe,de)=>oe+Math.max(0,Number(de.weight)||0),0),W=Math.max(0,100-G),Z=k.filter(oe=>oe.id!==F&&!oe.locked);if(V.weight=U(Math.min(W,Math.max(0,Number(N)||0))),!Z.length){V.weight=U(W);return}Y(Z,W-V.weight,!0)}function D(F){var V;const N=(V=s.value)==null?void 0:V.config.imageResources;if(!N||N.length===1)return;const k=N.find(G=>G.id===F);k&&(k.locked=!k.locked)}return{textureFileInput:e,sequenceFileInput:t,pendingResourceId:i,trailTextureFileInput:n,pendingTrailResourceId:r,addTrailResource:o,openTrailTexturePicker:a,onTrailRigChange:c,onTrailResourceBoneCountChange:l,onTrailResourceRotationChange:h,onTrailTextureFile:u,resetTrailTexture:d,removeTrailResource:f,rebalanceTrailWeights:m,setTrailResourceWeight:p,toggleTrailResourceLock:g,setTrailColor:x,commitTrailColor:v,addImageResource:y,openTexturePicker:S,openSequencePicker:C,onTextureFile:w,onSequenceFiles:b,readFileAsDataUrl:_,resetTexture:A,normalizeHex:P,setResourceFixedColor:E,commitResourceFixedColor:R,removeImageResource:O,roundWeight:U,distributeImageWeights:Y,rebalanceImageWeights:$,setResourceWeight:X,toggleResourceLock:D}}function IL(){const s=yo(),{exportSettings:e,exportBusy:t,exportTarget:i,exportMessage:n,exportError:r,connectorPairUrl:o,connectorStatusText:a,connectorStatusClass:c,connectorReady:l,connectorAuthorizationUrl:h,connectorDisabledReason:u,connectorButtonTitle:d,refreshConnectorHealth:f,exportSpineJson:m,exportSpineProject:p,exportSpineImages:g}=CL(s),{configFileInput:x,selectedPreset:v,presetOptions:y,presetLoading:S,configMessage:C,configError:w,saveConfig:b,onConfigFileChange:_,refreshPresets:A,loadSelectedPreset:P}=EL(s);function E(Q){return Q==="跟随导出"?e.value.keyframeCurve==="bezier"?"bezier":"linear":Q==="贝塞尔"?"bezier":"linear"}s.systems.length||s.addSystem();const R=Le(()=>{const Q=s.systems.findIndex(le=>le.id===s.activeId);return Q>=0?Q:0}),O=Le(()=>s.systems[R.value]||null),{textureFileInput:U,sequenceFileInput:Y,trailTextureFileInput:$,addTrailResource:X,openTrailTexturePicker:D,onTrailRigChange:F,onTrailResourceBoneCountChange:N,onTrailResourceRotationChange:k,onTrailTextureFile:V,resetTrailTexture:G,removeTrailResource:W,setTrailResourceWeight:Z,toggleTrailResourceLock:ne,setTrailColor:oe,commitTrailColor:de,addImageResource:pe,openTexturePicker:he,openSequencePicker:me,onTextureFile:H,onSequenceFiles:z,resetTexture:K,setResourceFixedColor:B,commitResourceFixedColor:L,removeImageResource:j,setResourceWeight:ie,toggleResourceLock:ue}=AL(O),fe=Le(()=>O.value?R1(O.value.config,s.timeline.fps):30),ee=Le(()=>{var le;const Q=(le=O.value)==null?void 0:le.config;return Q?Math.max(1,Math.ceil(Number(Q.loopDurationFrames)||1)):1}),Me=Le(()=>s.activeObjectType),be=Le(()=>s.activeObjectType==="collision"&&s.colliders.find(Q=>Q.id===s.activeObjectId)||null),ge=Le(()=>s.activeObjectType==="path"&&s.paths.find(Q=>Q.id===s.activeObjectId)||null),Ne=Le(()=>s.activeObjectType==="spine"&&s.spines.find(Q=>Q.id===s.activeObjectId)||null),Ve=Le(()=>s.activeObjectType==="particle"?s.systems.some(Q=>Q.id===s.activeObjectId):s.activeObjectType==="collision"?s.colliders.some(Q=>Q.id===s.activeObjectId):s.activeObjectType==="path"?s.paths.some(Q=>Q.id===s.activeObjectId):s.spines.some(Q=>Q.id===s.activeObjectId)),Ze=Le(()=>{const Q=s.spines.find(le=>le.selectedBone&&le.bones.some(Se=>Se.name===le.selectedBone));return Q?{spine:Q,boneName:Q.selectedBone}:null}),rt=Le(()=>{var Se;const Q=(Se=O.value)==null?void 0:Se.config;if(!Q||Q.emitterFollowMode!=="bone")return null;const le=s.spines.find(tt=>tt.id===Q.emitterFollowSpineId);return!le||!le.bones.some(tt=>tt.name===Q.emitterFollowBoneName)?null:{spine:le,boneName:Q.emitterFollowBoneName}}),Je=Fe(!1),je=Fe(""),Ae=Le(()=>s.spines.filter(Q=>Q.enabled&&Q.visible!==!1&&Q.status==="ready")),Qe=Le(()=>s.spines.find(Q=>{var le;return Q.id===((le=O.value)==null?void 0:le.config.renderLayerSpineId)})||null),Ee=Le(()=>{const Q=Qe.value;return!!Q&&Q.enabled&&Q.visible!==!1&&Q.status==="ready"}),Qt=Le(()=>{var Q;return[...((Q=Qe.value)==null?void 0:Q.slots)||[]].sort((le,Se)=>le.order-Se.order)}),ut=Le(()=>{const Q=je.value.trim().toLocaleLowerCase();return Q?Qt.value.filter(le=>le.name.toLocaleLowerCase().includes(Q)||le.attachment.toLocaleLowerCase().includes(Q)):Qt.value}),re=Le(()=>Qt.value.find(Q=>{var le;return Q.name===((le=O.value)==null?void 0:le.config.renderLayerSlotName)})||null),ae=Le(()=>{const Q=re.value;return Q&&Qt.value.filter(le=>le.orderSe.order-le.order)[0]||null}),et=Le(()=>{var tt;const Q=(tt=O.value)==null?void 0:tt.config,le=Qe.value,Se=re.value;return!Q||!le||!Se?"":`${le.name} / ${Se.name} · 图片${Q.renderLayerSlotPosition==="below"?"之下":"之上"}`}),It=Le(()=>{var Se;const Q=(Se=O.value)==null?void 0:Se.config,le=re.value;return!Q||!le?"":Q.renderLayerSlotPosition==="above"?`渲染在 ${le.name} 图片之上、其后插槽之下`:ae.value?`渲染在 ${ae.value.name} 与 ${le.name} 之间`:""}),kt=Le(()=>{var Se;const Q=(Se=O.value)==null?void 0:Se.config;if(!Q||Q.renderLayerMode!=="slot")return"";if(!Ae.value.length)return"没有已加载的 Spine,粒子临时显示在最上层。";if(!Q.renderLayerSpineId)return"尚未选择 Spine,粒子临时显示在最上层。";const le=Qe.value;return le?!le.enabled||le.status!=="ready"?"目标 Spine 未就绪,粒子临时显示在最上层。":Q.renderLayerSlotName?re.value?Q.renderLayerSlotPosition==="below"&&!ae.value?"这是第一个插槽,无法显示在其下方,粒子临时显示在最上层。":"":"目标插槽不存在(资源可能已更换),粒子临时显示在最上层。":"":"目标 Spine 不存在,粒子临时显示在最上层。"});function ot(){var le;const Q=(le=O.value)==null?void 0:le.config;Q&&(Q.renderLayerMode="slot",!Q.renderLayerSpineId&&Ae.value.length&&(Q.renderLayerSpineId=Ae.value[0].id),Je.value=!Q.renderLayerSlotName)}function Gi(Q){var Se;const le=(Se=O.value)==null?void 0:Se.config;le&&(le.renderLayerSpineId=Math.max(0,Math.round(Number(Q.target.value)||0)),le.renderLayerSlotName="",Je.value=!0)}function xs(Q){var Se;const le=(Se=O.value)==null?void 0:Se.config;le&&(le.renderLayerSlotName=Q.name,Je.value=!1,je.value="")}function Nt(){var le;const Q=(le=O.value)==null?void 0:le.config;Q&&(Q.renderLayerSlotName="",Q.renderLayerSlotPosition="above")}const vi=Fe(!1),Xt=Le(()=>{var le;const Q=new Set(((le=O.value)==null?void 0:le.config.collisionColliderIds)||[]);return s.colliders.filter(Se=>Q.has(Se.id))}),ji=Le(()=>{var le;const Q=new Set(((le=O.value)==null?void 0:le.config.collisionColliderIds)||[]);return s.colliders.filter(Se=>!Q.has(Se.id))});ai(()=>{var Q,le;return[(Q=O.value)==null?void 0:Q.id,(le=O.value)==null?void 0:le.config.collision]},()=>{vi.value=!1}),ai(()=>{var Q;return(Q=O.value)==null?void 0:Q.id},()=>{Je.value=!1,je.value=""});function ni(Q){var Se;const le=(Se=O.value)==null?void 0:Se.config;!le||le.collisionColliderIds.includes(Q)||(le.collisionColliderIds.push(Q),vi.value=!1)}function bs(Q){var Se;const le=(Se=O.value)==null?void 0:Se.config;le&&(le.collisionColliderIds=le.collisionColliderIds.filter(tt=>tt!==Q))}Lo(()=>{for(const Q of s.systems)Q.visible==null&&(Q.visible=!0);for(const Q of s.colliders)Q.visible==null&&(Q.visible=!0);for(const Q of s.paths)Q.visible==null&&(Q.visible=!0);for(const Q of s.spines)Q.visible==null&&(Q.visible=!0)}),Lo(()=>{if(!O.value)return;const Q=Xn(O.value.config);Q.lifeMode==="curve"&&(Q.lifeMode="random"),Q.speedMode==="curve"&&(Q.speedMode="random"),Q.scaleMode==="curve"&&(Q.scaleMode="random"),Q.initialRotationMode==="curve"&&(Q.initialRotationMode="random"),Q.mode==="stream"&&!(Q.duration>0)&&(Q.duration=1),Q.streamBehavior==="loop"&&(Q.emitterFollow||Q.emitterFollowMode!=="none")&&gn(Q)}),Lo(()=>{const Q=new Set(s.colliders.map(Se=>Se.id)),le=new Set(s.systems.map(Se=>Se.id));for(const Se of s.systems){const tt=Xn(Se.config),ei=tt.collisionColliderIds.filter(Ji=>Q.has(Ji));ei.length!==tt.collisionColliderIds.length&&(tt.collisionColliderIds=ei),tt.spawnPathId>0&&!s.paths.some(Ji=>Ji.id===tt.spawnPathId)&&(tt.spawnPathId=0,(tt.emissionAngleMode==="path-normal"||tt.emissionAngleMode==="path-tangent")&&(tt.emissionAngleMode="fixed"));const Mo=k1(s.systems,Se.id);for(const Ji of tt.events||[])Ji.targetSystemId>0&&(Ji.targetSystemId===Se.id||Mo.has(Ji.targetSystemId)||!le.has(Ji.targetSystemId))&&(Ji.targetSystemId=0);if(tt.emitterFollowMode!=="bone")continue;const _u=s.spines.find(Ji=>Ji.id===tt.emitterFollowSpineId);!!(_u!=null&&_u.bones.some(Ji=>Ji.name===tt.emitterFollowBoneName))||(tt.emitterFollowMode="none",tt.emitterFollowSpineId=0,tt.emitterFollowBoneName="")}}),Lo(()=>{for(const Q of s.systems){const le=Xn(Q.config);le.renderLayerMode!=="slot"||!le.renderLayerSpineId||s.spines.some(Se=>Se.id===le.renderLayerSpineId)||(le.renderLayerSpineId=0,le.renderLayerSlotName="")}}),Lo(()=>{for(const Q of s.colliders)Q.followPathId==null&&(Q.followPathId=0),Q.followDuration>0||(Q.followDuration=2),Q.followPathRotation==null&&(Q.followPathRotation=!1),["跟随导出","线性","贝塞尔"].includes(Q.followCurveMode)||(Q.followCurveMode="跟随导出"),(!Array.isArray(Q.followCurve)||Q.followCurve.length<2)&&(Q.followCurve=[{x:0,y:0},{x:1,y:1}])});const ws=po({config:!0,scene:!1,emitMode:!0,shape:!0,attr:!0,look:!0,mods:!0,export:!1});function $s(Q){ws[Q]=!ws[Q]}function Zi(Q){var Se;const le=(Se=O.value)==null?void 0:Se.config;le&&(le.mode=Q,Q==="stream"&&!(le.duration>0)&&(le.duration=1))}function Zn(Q){var tt;const le=(tt=O.value)==null?void 0:tt.config;if(!le)return;const Se=Math.min(1800,Math.max(1,Math.ceil(Number(Q)||1)));le.loopDurationFrames=Se}function gn(Q){const le=wl();Q.emitterFollow=!1,Q.emitterFollowMode="none",Q.emitterFollowPathId=le.emitterFollowPathId,Q.emitterFollowSpineId=le.emitterFollowSpineId,Q.emitterFollowBoneName=le.emitterFollowBoneName,Q.emitterFollowBoneOffsetX=le.emitterFollowBoneOffsetX,Q.emitterFollowBoneOffsetY=le.emitterFollowBoneOffsetY,Q.emitterFollowBoneRotation=le.emitterFollowBoneRotation,Q.emitterFollowBoneScaleX=le.emitterFollowBoneScaleX,Q.emitterFollowBoneScaleY=le.emitterFollowBoneScaleY,Q.emitterAngleMode=le.emitterAngleMode,Q.emitterFollowCurve=le.emitterFollowCurve.map(Se=>({...Se})),Q.emitterFollowDuration=le.emitterFollowDuration,Q.emitterFollowSpace=le.emitterFollowSpace,Q.emitterFollowDirection=le.emitterFollowDirection,Q.emitterFollowOffset=le.emitterFollowOffset}function wa(Q){var ei;const le=(ei=O.value)==null?void 0:ei.config;if(!le||le.streamBehavior===Q)return;const Se=Q==="loop",tt=Se?"进入循环持续模式后,粒子跟随设置会失效并恢复默认值。是否继续?":"退出循环持续模式后,粒子跟随设置会失效并恢复默认值。是否继续?";window.confirm(tt)&&(gn(le),le.streamBehavior=Q,Se||(le.generateLoopStartAnimation=!1,le.generateLoopEndAnimation=!1))}function Sa(Q,le){var ei;const Se=(ei=O.value)==null?void 0:ei.config;if(!Se)return;const tt=le.target.checked;Q==="start"?Se.generateLoopStartAnimation=tt:Se.generateLoopEndAnimation=tt}function Dl(Q,le){var ei;const Se=(ei=O.value)==null?void 0:ei.config;if(!Se)return;const tt=Math.min(1800,Math.max(1,Math.ceil(Number(le.target.value)||30)));Q==="start"?Se.loopStartDurationFrames=tt:Se.loopEndDurationFrames=tt}function Ul(Q,le){var ei;const Se=(ei=O.value)==null?void 0:ei.config;if(!Se)return;const tt=le.target.checked;Q==="start"?Se.loopStartUseCustomDuration=tt:Se.loopEndUseCustomDuration=tt}function Ma(Q,le){const Se=Q.target.value;if(le.emitterFollowMode=Se,Se!=="bone"){le.emitterFollowSpineId=0,le.emitterFollowBoneName="";return}Ta(le)}function Ta(Q){const le=Ze.value;if(!le){Q.emitterFollowMode="none",Q.emitterFollowSpineId=0,Q.emitterFollowBoneName="";return}Q.emitterFollowMode="bone",Q.emitterFollowSpineId=le.spine.id,Q.emitterFollowBoneName=le.boneName}const _a={emitMode:["mode","rate","streamBehavior","loopDurationFrames","generateLoopStartAnimation","loopStartUseCustomDuration","loopStartDurationFrames","generateLoopEndAnimation","loopEndUseCustomDuration","loopEndDurationFrames","burstCount","burstLoop","delay","duration"],shape:["shape","showShape","shapeRangeVersion","innerRadius","outerRadius","innerRectW","innerRectH","outerRectW","outerRectH","spawnPathId","spawnPathDistribution","radius","rectW","rectH","emissionAngleMode","direction","spread","coneDirection","coneAngle"],attr:["lifeMin","lifeMax","lifeMode","lifeCurve","speedMin","speedMax","speedMode","speedCurve","scaleMin","scaleMax","scaleMode","scaleAxisMode","scaleYMin","scaleYMax","scaleCurve","scaleYCurve","scaleEndRatio","initialRotationMode","initialRotationMin","initialRotationMax","initialRotationCurve","rotationSpeedMin","rotationSpeedMax","speedOverLifeEnabled","speedOverLifeMode","speedOverLifeMin","speedOverLifeMax","speedOverLifeCurve","scaleOverLifeEnabled","scaleOverLifeMode","scaleOverLifeAxisMode","scaleOverLifeMin","scaleOverLifeMax","scaleYOverLifeMin","scaleYOverLifeMax","scaleOverLifeCurve","scaleYOverLifeCurve","rotationOverLifeEnabled","rotationOverLifeMode","rotationOverLifeCurve"],look:["texture","imageResources","imageWeightVersion","alpha","alphaEnd","colorStart","colorEnd","colorOverLife","blend","alphaMode","curveMode","alphaCurve","textureName","textureFolder","alphaScale","anchorX","anchorY","independentAlpha","renderLayerMode","renderLayerSpineId","renderLayerSlotName","renderLayerSlotPosition","renderLayerFollowAttachment"],mods:["noise","noiseAmt","noiseRange","noiseSpeed","useGravity","gravity","gravityMode","gravityMin","gravityMax","gravityDirection","gravityCurve","wind","windX","windY","windMode","windMin","windMax","windDirection","windCurve","forceField","forceStrength","forceRadius","forceCenterX","forceCenterY","forceFalloff","showForceFieldShape","vortex","vortexStrength","vortexRadius","vortexCenterX","vortexCenterY","vortexFalloff","showVortexShape","attraction","attractionCenterX","attractionCenterY","attractionRadius","attractionDuration","attractionDelay","attractionDelayMode","attractionPath","showAttractionShape","trail","trailConfigVersion","trailResources","trailResourceVersion","trailTexture","trailTextureName","trailPreviewUrl","trailColorMode","trailColor","trailColorGradient","trailAlphaMode","trailAlpha","trailAlphaCurve","trailBoneCount","trailLength","trailWidth","trailWidthMode","trailLifeLengthEnabled","trailLifeLengthCurve","trailShapeEnabled","trailShapeCurve","trailGridRows","trailGridCols","collision","collisionColliderIds","pathFollow","eventEnabled","events","emitterFollow","emitterFollowMode","emitterFollowPathId","emitterFollowSpineId","emitterFollowBoneName","emitterFollowBoneOffsetX","emitterFollowBoneOffsetY","emitterFollowBoneRotation","emitterFollowBoneScaleX","emitterFollowBoneScaleY","emitterAngleMode","emitterFollowCurve","emitterFollowDuration","emitterFollowSpace","emitterFollowDirection","emitterFollowOffset","damping"]};function $l(Q){var tt;const le=(tt=O.value)==null?void 0:tt.config;if(Q==="export"){s.settings.exportSettings=_p();return}if(!le)return;const Se=wl();for(const ei of _a[Q])le[ei]=Se[ei]}function Mu(){e.value.fps=Math.min(240,Math.max(1,Math.round(Number(e.value.fps)||30)))}function Ca(Q){var le;s.selectSystem(((le=s.systems[Q])==null?void 0:le.id)??0)}function Jn(){s.addSystem()}function So(){s.addCollider()}function Tu(){s.addPath()}function Xl(){s.addSpine()}function ZS(){s.duplicateSelectedObject()}function vn(Q,le,Se=0,tt=0,ei=0,Mo=0){return{x:Q,y:le,inX:Se,inY:tt,outX:ei,outY:Mo}}function JS(){const Q=ge.value;if(!(!Q||!Q.preset))if(Q.preset==="circle"){const Se=60.751328;Q.points=[vn(110,0,0,-Se,0,Se),vn(0,110,Se,0,-Se,0),vn(-110,0,0,Se,0,-Se),vn(0,-110,-Se,0,Se,0)],Q.closed=!0}else if(Q.preset==="square")Q.points=[vn(-100,-100),vn(100,-100),vn(100,100),vn(-100,100)],Q.closed=!0;else{const le=Q.preset==="star"?10:6;Q.points=Array.from({length:le},(Se,tt)=>{const ei=Q.preset==="star"&&tt%2?50:110,Mo=-Math.PI*.5+tt/le*Math.PI*2;return vn(Math.cos(Mo)*ei,Math.sin(Mo)*ei)}),Q.closed=!0}}function QS(){ge.value&&(ge.value.points=[])}function eM(){O.value&&(O.value.config.seed=Math.floor(Math.random()*999999)+1)}function tM(Q){var Se;const le=(Se=O.value)==null?void 0:Se.config;!le||Q==="direction"||(le.speedOverLifeMode=Q,Q==="curve"&&le.speedOverLifeMin===le.speedOverLifeMax&&(le.speedOverLifeMin=0,le.speedOverLifeMax=1))}function Yp(){var le;const Q=(le=O.value)==null?void 0:le.config;!Q||Q.scaleOverLifeMode!=="curve"||(Q.scaleOverLifeMin===Q.scaleOverLifeMax&&(Q.scaleOverLifeMin=0,Q.scaleOverLifeMax=1),Q.scaleYOverLifeMin===Q.scaleYOverLifeMax&&(Q.scaleYOverLifeMin=0,Q.scaleYOverLifeMax=1))}function iM(Q){var Se;const le=(Se=O.value)==null?void 0:Se.config;!le||Q==="direction"||(le.scaleOverLifeMode=Q,Yp())}const sM={point:{emissionAngleMode:"random",direction:0,spread:360},circle:{innerRadius:0,outerRadius:100,emissionAngleMode:"fixed",direction:-90,spread:0},rect:{innerRectW:0,innerRectH:0,outerRectW:200,outerRectH:100,emissionAngleMode:"fixed",direction:-90,spread:0},cone:{innerRadius:0,outerRadius:100,coneAngle:90,coneDirection:90,emissionAngleMode:"random",direction:90,spread:90},path:{spawnPathId:0,spawnPathDistribution:"fixed",emissionAngleMode:"fixed",direction:0,spread:0}};function nM(){var Se;const Q=(Se=O.value)==null?void 0:Se.config;if(!Q)return;const le=sM[Q.shape];le&&Object.assign(Q,le)}function rM(){var le;const Q=(le=O.value)==null?void 0:le.config;!Q||Q.spawnPathId>0||(Q.emissionAngleMode==="path-normal"||Q.emissionAngleMode==="path-tangent")&&(Q.emissionAngleMode="fixed")}return{store:s,exportSettings:e,exportBusy:t,exportTarget:i,exportMessage:n,exportError:r,connectorPairUrl:o,connectorStatusText:a,connectorStatusClass:c,connectorReady:l,connectorAuthorizationUrl:h,connectorDisabledReason:u,connectorButtonTitle:d,refreshConnectorHealth:f,exportSpineJson:m,exportSpineProject:p,exportSpineImages:g,configFileInput:x,selectedPreset:v,presetOptions:y,presetLoading:S,configMessage:C,configError:w,saveConfig:b,onConfigFileChange:_,refreshPresets:A,loadSelectedPreset:P,resolvedCurveEditorMode:E,sys:O,textureFileInput:U,sequenceFileInput:Y,trailTextureFileInput:$,addTrailResource:X,openTrailTexturePicker:D,onTrailRigChange:F,onTrailResourceBoneCountChange:N,onTrailResourceRotationChange:k,onTrailTextureFile:V,resetTrailTexture:G,removeTrailResource:W,setTrailResourceWeight:Z,toggleTrailResourceLock:ne,setTrailColor:oe,commitTrailColor:de,addImageResource:pe,openTexturePicker:he,openSequencePicker:me,onTextureFile:H,onSequenceFiles:z,resetTexture:K,setResourceFixedColor:B,commitResourceFixedColor:L,removeImageResource:j,setResourceWeight:ie,toggleResourceLock:ue,automaticLoopDuration:fe,loopDurationFrames:ee,activeObjectType:Me,activeCollider:be,activePath:ge,activeSpine:Ne,canCopyObject:Ve,selectedSpineBone:Ze,boundSpineBone:rt,renderLayerSlotPickerOpen:Je,renderLayerSlotSearch:je,renderLayerReadySpines:Ae,renderLayerSpineReady:Ee,renderLayerSlots:Qt,renderLayerFilteredSlots:ut,renderLayerSlotLabel:et,renderLayerResolvedLabel:It,renderLayerWarning:kt,setRenderLayerSlotMode:ot,selectRenderLayerSpine:Gi,pickRenderLayerSlot:xs,clearRenderLayerSlot:Nt,collisionPickerOpen:vi,selectedCollisionBodies:Xt,availableCollisionBodies:ji,addCollisionBody:ni,removeCollisionBody:bs,collapsed:ws,toggle:$s,setEmitMode:Zi,setLoopDurationFrames:Zn,setStreamBehavior:wa,setLoopSection:Sa,setLoopSectionDuration:Dl,setLoopCustomDuration:Ul,onEmitterFollowModeChange:Ma,bindSelectedBone:Ta,resetModule:$l,normalizeExportFps:Mu,select:Ca,addSys:Jn,addCollider:So,addPath:Tu,addSpine:Xl,copySelectedObject:ZS,applyPathPreset:JS,clearPathAnchors:QS,randomizeSeed:eM,setSpeedOverLifeMode:tM,prepareScaleOverLifeCurve:Yp,setScaleOverLifeMode:iM,onShapeChange:nM,onSpawnPathChange:rM,LINEAR_CURVE:T3,FLAT_CURVE:Cm,ALPHA_CURVE:_3,RESOURCE_ALPHA_CURVE:Em,TRAIL_ALPHA_CURVE:Am,TRAIL_SHAPE_CURVE:Im}}const zS=Symbol("particle-panel");function RL(){const s=IL();return cx(zS,s),s}function Fr(){const s=qo(zS);if(!s)throw new Error("Particle panel sections require a ParticlePanel parent");return s}const PL={class:"group config-management"},kL={class:"caret"},FL={class:"group-body config-management-body"},OL={class:"config-toolbar"},LL=["disabled"],BL={value:""},NL=["value"],DL=Zt({__name:"ProjectConfigSection",setup(s){const{configFileInput:e,selectedPreset:t,presetOptions:i,presetLoading:n,configMessage:r,configError:o,saveConfig:a,onConfigFileChange:c,refreshPresets:l,loadSelectedPreset:h,collapsed:u,toggle:d,select:f}=Fr();return(m,p)=>(q(),J("div",PL,[T("div",{class:"group-head",onClick:p[0]||(p[0]=g=>I(d)("config"))},[T("span",kL,ve(I(u).config?"▸":"▾"),1),p[8]||(p[8]=T("span",null,"配置管理",-1))]),ce(T("div",FL,[T("div",OL,[T("button",{title:"保存全部编辑器配置 (Ctrl+S)",onClick:p[1]||(p[1]=(...g)=>I(a)&&I(a)(...g))},"保存配置"),T("button",{title:"加载本地编辑器配置",onClick:p[2]||(p[2]=g=>{var x;return(x=I(e))==null?void 0:x.click()})},"加载配置"),ce(T("select",{"onUpdate:modelValue":p[3]||(p[3]=g=>jt(t)?t.value=g:null),"aria-label":"预设列表",disabled:!I(i).length||I(n),onPointerdown:p[4]||(p[4]=(...g)=>I(l)&&I(l)(...g)),onFocus:p[5]||(p[5]=(...g)=>I(l)&&I(l)(...g)),onChange:p[6]||(p[6]=(...g)=>I(h)&&I(h)(...g))},[T("option",BL,ve(I(i).length?"选择预设":"无预设文件"),1),(q(!0),J(_e,null,Et(I(i),g=>(q(),J("option",{key:g.file,value:g.file},ve(g.name),9,NL))),128))],40,LL),[[bt,I(t)]]),T("input",{ref_key:"configFileInput",ref:e,hidden:"",type:"file",accept:".json,application/json",onChange:p[7]||(p[7]=(...g)=>I(c)&&I(c)(...g))},null,544)]),I(r)?(q(),J("div",{key:0,class:Ce(["config-message",{error:I(o)}])},ve(I(r)),3)):xe("",!0)],512),[[Si,!I(u).config]])]))}}),UL=Jt(DL,[["__scopeId","data-v-cb52d3e0"]]),$L={class:"ns-label"},XL=["min","max","step","value","disabled"],VL=["min","max","step","value","disabled"],YL=Zt({__name:"NumSlider",props:{label:{},modelValue:{},min:{},max:{},step:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(s,{emit:e}){const t=s,i=e,n=Fe(String(t.modelValue));ai(()=>t.modelValue,c=>{n.value=String(c)});function r(c){const l=parseFloat(c.target.value);Number.isNaN(l)||i("update:modelValue",l)}function o(c){n.value=c.target.value;const l=parseFloat(n.value);Number.isNaN(l)||i("update:modelValue",l)}function a(){const c=parseFloat(n.value);Number.isNaN(c)&&(n.value=String(t.modelValue))}return(c,l)=>(q(),J("div",{class:Ce(["ns",{disabled:s.disabled}])},[T("span",$L,ve(s.label),1),T("input",{type:"range",class:"ns-range",min:s.min,max:s.max,step:s.step,value:s.modelValue,disabled:s.disabled,onInput:r},null,40,XL),T("input",{type:"number",class:"ns-num",min:s.min,max:s.max,step:s.step,value:n.value,disabled:s.disabled,onInput:o,onBlur:a},null,40,VL)],2))}}),Oe=Jt(YL,[["__scopeId","data-v-7c2fbed0"]]),GL={class:"ce"},jL={class:"ce-editor"},HL={class:"ce-grid"},WL=["x1","x2","y2"],zL=["y1","x2","y2"],qL=["x","y","width","height"],KL=["d"],ZL={key:0,class:"ce-handles"},JL=["x1","y1","x2","y2"],QL=["cx","cy","onPointerdown"],eB=["x1","y1","x2","y2"],tB=["cx","cy","onPointerdown"],iB=["cx","cy"],sB=["cx","cy","onPointerdown","onDblclick"],nB={class:"ce-nav"},rB={class:"ce-tip"},ir=8,oB=Zt({__name:"CurveEditor",props:{modelValue:{},defaultValue:{default:()=>[{x:0,y:0},{x:1,y:1}]},mode:{default:"linear"}},emits:["update:modelValue"],setup(s,{emit:e}){const t=s,i=e,n=Fe(null),r=Fe(300),o=Fe(110);let a=null;function c(){if(!n.value)return;const E=n.value.getBoundingClientRect();r.value=E.width,o.value=E.height}function l(E){return ir+E*(r.value-ir*2)}function h(E){return ir+(1-E)*(o.value-ir*2)}function u(){return[...t.modelValue].sort((E,R)=>E.x-R.x)}function d(E){i("update:modelValue",[...E].sort((R,O)=>R.x-O.x))}function f(){d(t.defaultValue.map(E=>({...E})))}const m=Le(()=>u());function p(E){const R=m.value[E],O=m.value[Math.max(0,E-1)];return{x:R.x-(R.x-O.x)/3,y:R.y-(R.y-O.y)/3}}function g(E){const R=m.value[E],O=m.value[Math.min(m.value.length-1,E+1)];return{x:R.x+(O.x-R.x)/3,y:R.y+(O.y-R.y)/3}}function x(E){const R=m.value[E],O=p(E);return{x:R.x+(R.inX??O.x-R.x),y:R.y+(R.inY??O.y-R.y)}}function v(E){const R=m.value[E],O=g(E);return{x:R.x+(R.outX??O.x-R.x),y:R.y+(R.outY??O.y-R.y)}}const y=Le(()=>{if(!m.value.length)return"";let E=`M ${l(m.value[0].x)} ${h(m.value[0].y)}`;for(let R=1;RMath.abs(Y.x-R)>.02);U.push({x:R,y:O}),d(U)}let b={t:0,i:-1,x:0,y:0};function _(E,R){E.stopPropagation();const O=u().findIndex(X=>Math.abs(X.x-m.value[R].x)<1e-6&&Math.abs(X.y-m.value[R].y)<1e-6);if(O<0)return;const U=Date.now();if(U-b.t<300&&b.i===R&&Math.abs(E.clientX-b.x)<8&&Math.abs(E.clientY-b.y)<8){b={t:0,i:-1,x:0,y:0},P(R);return}b={t:U,i:R,x:E.clientX,y:E.clientY};const Y=X=>{(Math.abs(X.clientX-E.clientX)>8||Math.abs(X.clientY-E.clientY)>8)&&(b={t:0,i:-1,x:0,y:0});const{x:D,y:F}=S(X.clientX,X.clientY),N=u();N[O]={x:D,y:F},d(N)},$=()=>{window.removeEventListener("pointermove",Y),window.removeEventListener("pointerup",$)};window.addEventListener("pointermove",Y),window.addEventListener("pointerup",$)}function A(E,R,O){E.stopPropagation();const U=$=>{const X=S($.clientX,$.clientY),D=u(),F=D[R],N=O==="in"?D[Math.max(0,R-1)].x:F.x,k=O==="in"?F.x:D[Math.min(D.length-1,R+1)].x,V=Math.min(k,Math.max(N,X.x)),G=Math.round((V-F.x)*100)/100,W=Math.round((X.y-F.y)*100)/100;D[R]=O==="in"?{...F,inX:G,inY:W}:{...F,outX:G,outY:W},d(D)},Y=()=>{window.removeEventListener("pointermove",U),window.removeEventListener("pointerup",Y)};window.addEventListener("pointermove",U),window.addEventListener("pointerup",Y)}function P(E,R){R==null||R.stopPropagation();const O=u();O.length<=2||(C=Date.now(),d(O.filter((U,Y)=>Y!==E)))}return ys(()=>{c(),a=new ResizeObserver(c),n.value&&a.observe(n.value)}),Al(()=>{a==null||a.disconnect()}),(E,R)=>(q(),J("div",GL,[T("div",jL,[(q(),J("svg",{ref_key:"svg",ref:n,class:"ce-svg",onDblclick:w},[T("g",HL,[(q(),J(_e,null,Et([.25,.5,.75],O=>T("line",{key:"v"+O,x1:l(O),y1:"0",x2:l(O),y2:h(0)},null,8,WL)),64)),(q(),J(_e,null,Et([.25,.5,.75],O=>T("line",{key:"h"+O,x1:"0",y1:h(O),x2:l(1),y2:h(O)},null,8,zL)),64))]),T("rect",{x:l(0),y:h(1),width:l(1)-l(0),height:h(0)-h(1),class:"ce-frame",fill:"none"},null,8,qL),T("path",{d:y.value,class:"ce-line",fill:"none"},null,8,KL),s.mode==="bezier"?(q(),J("g",ZL,[(q(!0),J(_e,null,Et(m.value,(O,U)=>(q(),J(_e,{key:"handles-"+U},[U>0?(q(),J("line",{key:0,x1:l(O.x),y1:h(O.y),x2:l(x(U).x),y2:h(x(U).y)},null,8,JL)):xe("",!0),U>0?(q(),J("circle",{key:1,cx:l(x(U).x),cy:h(x(U).y),r:"4",onPointerdown:Y=>A(Y,U,"in")},null,40,QL)):xe("",!0),UA(Y,U,"out")},null,40,tB)):xe("",!0)],64))),128))])):xe("",!0),(q(!0),J(_e,null,Et(m.value,(O,U)=>(q(),J("g",{key:U},[T("circle",{cx:l(O.x),cy:h(O.y),r:"5",class:"ce-node"},null,8,iB),T("circle",{cx:l(O.x),cy:h(O.y),r:"9",class:"ce-hit",onPointerdown:Y=>_(Y,U),onDblclick:Y=>P(U,Y)},null,40,sB)]))),128))],544)),T("div",nB,[T("span",rB,ve(s.mode==="bezier"?"拖动方形手柄调整弧度·双击空白新建·双击节点删除":"双击空白新建·双击节点删除·拖动节点调整"),1)])]),T("button",{class:"ce-reset",type:"button",title:"恢复默认曲线",onClick:f},"重置")]))}}),tn=Jt(oB,[["__scopeId","data-v-9bfb7b31"]]),aB={class:"spine-editor"},lB={class:"field wide"},cB={class:"grid three"},hB={class:"field"},uB={class:"field"},dB={class:"field"},fB={class:"grid three"},mB={class:"field"},pB={class:"field"},gB={class:"field"},vB=["disabled"],yB={class:"asset-row"},xB=["title"],bB={class:"asset-row"},wB=["title"],SB={class:"asset-row"},MB=["title"],TB={class:"asset-actions"},_B=["disabled"],CB={class:"runtime-note"},EB={key:0},AB={key:0,class:"error"},IB={class:"section-box"},RB={key:0,class:"empty"},PB={key:1,class:"field wide"},kB=["value"],FB={class:"section-box"},OB={class:"tree-title-row"},LB=["disabled","title"],BB=["disabled","title"],NB={class:"tree-tabs"},DB={key:0,class:"empty"},UB={key:1,class:"bone-search"},$B={key:2,class:"empty"},XB={key:3,class:"bone-tree"},VB=["onClick","onKeydown"],YB=["title","onClick"],GB={key:1,class:"bone-leaf"},jB={class:"bone-name"},HB={key:0,class:"empty"},WB={key:1,class:"bone-search"},zB={key:2,class:"empty"},qB={key:3,class:"bone-tree slot-tree"},KB=["title","onClick","onKeydown"],ZB={class:"slot-order"},JB={class:"bone-name"},QB={class:"slot-attachment"},eN=Zt({__name:"SpineObjectPanel",props:{spineObject:{}},setup(s){const e=s,t=yo(),i=Fe(null),n=Fe(null),r=Fe(null),o=Fe(null),a=Fe(new Set),c=Fe(""),l=Fe("bone"),h=Fe(""),u=Fe(null),d=Fe(null),f=Fe([]);e.spineObject.selectedBone==null&&(e.spineObject.selectedBone=""),e.spineObject.selectedSlot==null&&(e.spineObject.selectedSlot=""),Array.isArray(e.spineObject.slots)||(e.spineObject.slots=[]),e.spineObject.sourceBundle==null&&(e.spineObject.sourceBundle=null),e.spineObject.dataVersion==null&&(e.spineObject.dataVersion="");const m=Le(()=>{var k;return((k=u.value)==null?void 0:k.name)||e.spineObject.skeletonFileName}),p=Le(()=>{var k;return((k=d.value)==null?void 0:k.name)||e.spineObject.atlasFileName}),g=Le(()=>f.value.length?f.value.map(k=>k.name):e.spineObject.textureFileNames),x=Le(()=>g.value.length?`${g.value.length} 张:${g.value.join(", ")}`:"PNG / JPEG / WebP..."),v=Le(()=>new Set(e.spineObject.bones.map(k=>k.parent).filter(k=>!!k))),y=Le(()=>new Map(e.spineObject.bones.map(k=>[k.name,k]))),S=Le(()=>e.spineObject.bones.filter(k=>{var W;const V=c.value.trim().toLocaleLowerCase();if(V)return k.name.toLocaleLowerCase().includes(V);let G=k.parent;for(;G;){if(a.value.has(G))return!1;G=((W=y.value.get(G))==null?void 0:W.parent)||null}return!0})),C=Le(()=>v.value.size>0&&[...v.value].every(k=>a.value.has(k))),w=Le(()=>{const k=h.value.trim().toLocaleLowerCase(),V=[...e.spineObject.slots].sort((G,W)=>G.order-W.order);return k?V.filter(G=>G.name.toLocaleLowerCase().includes(k)||G.attachment.toLocaleLowerCase().includes(k)):V});function b(k){const V=e.spineObject.selectedBone===k;for(const G of t.spines)G.selectedBone="";V||(e.spineObject.selectedBone=k)}function _(k){const V=e.spineObject.selectedSlot===k;for(const G of t.spines)G.selectedSlot="";V||(e.spineObject.selectedSlot=k)}function A(k){a.value.has(k)?a.value.delete(k):a.value.add(k)}function P(){a.value=C.value?new Set:new Set(v.value)}function E(k){var V;return((V=k.target.files)==null?void 0:V[0])||null}function R(k){u.value=E(k)}function O(k){d.value=E(k)}function U(k){f.value=Array.from(k.target.files||[])}function Y(k){return k.name.replace(/\.[^.]+$/,"").toLocaleLowerCase()}async function $(k){const V=Array.from(k.target.files||[]);if(!V.length)return;const G=V.filter(pe=>/\.(json|skel)$/i.test(pe.name)),W=V.filter(pe=>/\.atlas$/i.test(pe.name)),Z=V.filter(pe=>/\.(png|jpe?g|webp|wepb)$/i.test(pe.name)),ne=W.map(pe=>({atlas:pe,skeleton:G.find(he=>Y(he)===Y(pe))})).find(pe=>pe.skeleton),oe=(ne==null?void 0:ne.skeleton)||G[0]||null,de=(ne==null?void 0:ne.atlas)||W[0]||null;if(u.value=oe,d.value=de,f.value=Z,!oe||!de||!Z.length){const pe=[!oe&&"JSON / SKEL",!de&&"Atlas",!Z.length&&"纹理图片"].filter(Boolean).join("、");e.spineObject.status="error",e.spineObject.error=`所选文件夹缺少:${pe}`;return}await F()}function X(){t.recalcTotalFrames()}function D(){X(),t.timeline.frame=0}async function F(){var G;const k=u.value,V=d.value;if(!k||!V||!f.value.length){e.spineObject.status="error",e.spineObject.error="请依次选择 Spine 数据、Atlas 和全部纹理图片";return}e.spineObject.status="loading",e.spineObject.error="";try{const W=await Dw(k,V,f.value);pu(e.spineObject.id,W),e.spineObject.skeletonFileName=k.name,e.spineObject.atlasFileName=V.name,e.spineObject.textureFileNames=f.value.map(Z=>Z.name),e.spineObject.dataVersion=W.dataVersion,e.spineObject.animations=W.animations,e.spineObject.bones=W.bones,e.spineObject.slots=W.slots,e.spineObject.selectedBone="",e.spineObject.selectedSlot="",c.value="",h.value="",a.value=new Set,e.spineObject.selectedAnimation=((G=W.animations[0])==null?void 0:G.name)||"",e.spineObject.assetVersion++,e.spineObject.status="ready",X(),t.timeline.frame=0;try{e.spineObject.sourceBundle=await Pk(k,V,f.value)}catch(Z){e.spineObject.sourceBundle=null,console.warn("Spine 配置资源嵌入失败",Z)}}catch(W){e.spineObject.status="error",e.spineObject.error=W instanceof Error?W.message:String(W)}}function N(){Fl(e.spineObject.id),u.value=null,d.value=null,f.value=[],i.value&&(i.value.value=""),n.value&&(n.value.value=""),r.value&&(r.value.value=""),o.value&&(o.value.value=""),e.spineObject.skeletonFileName="",e.spineObject.atlasFileName="",e.spineObject.textureFileNames=[],e.spineObject.dataVersion="",e.spineObject.sourceBundle=null,e.spineObject.animations=[],e.spineObject.bones=[],e.spineObject.slots=[],e.spineObject.selectedBone="",e.spineObject.selectedSlot="",c.value="",h.value="",a.value=new Set,e.spineObject.selectedAnimation="",e.spineObject.assetVersion++,e.spineObject.status="empty",e.spineObject.error="",X()}return(k,V)=>(q(),J("div",aB,[V[38]||(V[38]=T("div",{class:"editor-title"},"Spine 属性",-1)),T("label",lB,[V[20]||(V[20]=T("span",null,"Spine 名称",-1)),ce(T("input",{"onUpdate:modelValue":V[0]||(V[0]=G=>s.spineObject.name=G)},null,512),[[He,s.spineObject.name]])]),T("div",cB,[T("label",hB,[V[21]||(V[21]=T("span",null,"X 位置",-1)),ce(T("input",{"onUpdate:modelValue":V[1]||(V[1]=G=>s.spineObject.x=G),type:"number"},null,512),[[He,s.spineObject.x,void 0,{number:!0}]])]),T("label",uB,[V[22]||(V[22]=T("span",null,"Y 位置",-1)),ce(T("input",{"onUpdate:modelValue":V[2]||(V[2]=G=>s.spineObject.y=G),type:"number"},null,512),[[He,s.spineObject.y,void 0,{number:!0}]])]),T("label",dB,[V[23]||(V[23]=T("span",null,"旋转",-1)),ce(T("input",{"onUpdate:modelValue":V[3]||(V[3]=G=>s.spineObject.rotation=G),type:"number"},null,512),[[He,s.spineObject.rotation,void 0,{number:!0}]])])]),T("div",fB,[T("label",mB,[V[24]||(V[24]=T("span",null,"Scale X",-1)),ce(T("input",{"onUpdate:modelValue":V[4]||(V[4]=G=>s.spineObject.scaleX=G),type:"number",step:"0.05"},null,512),[[He,s.spineObject.scaleX,void 0,{number:!0}]])]),T("label",pB,[V[25]||(V[25]=T("span",null,"Scale Y",-1)),ce(T("input",{"onUpdate:modelValue":V[5]||(V[5]=G=>s.spineObject.scaleY=G),type:"number",step:"0.05"},null,512),[[He,s.spineObject.scaleY,void 0,{number:!0}]])]),T("label",gB,[V[26]||(V[26]=T("span",null,"开始时间",-1)),ce(T("input",{"onUpdate:modelValue":V[6]||(V[6]=G=>s.spineObject.timeOffset=G),type:"number",min:"0",step:"0.033333",onChange:X},null,544),[[He,s.spineObject.timeOffset,void 0,{number:!0}]])])]),V[39]||(V[39]=T("div",{class:"divider"},null,-1)),V[40]||(V[40]=T("div",{class:"section-title"},"Spine 资源",-1)),T("input",{ref_key:"skeletonInput",ref:i,hidden:"",type:"file",accept:".json,.skel,application/json,application/octet-stream",onChange:R},null,544),T("input",{ref_key:"atlasInput",ref:n,hidden:"",type:"file",accept:".atlas,text/plain",onChange:O},null,544),T("input",{ref_key:"textureInput",ref:r,hidden:"",type:"file",multiple:"",accept:".png,.jpg,.jpeg,.webp,.wepb,image/png,image/jpeg,image/webp",onChange:U},null,544),T("input",{ref_key:"folderInput",ref:o,hidden:"",type:"file",multiple:"",webkitdirectory:"",directory:"",onChange:$},null,544),T("button",{class:"folder-select",disabled:s.spineObject.status==="loading",onClick:V[7]||(V[7]=G=>{var W;return(W=o.value)==null?void 0:W.click()})},"选择文件夹并加载",8,vB),V[41]||(V[41]=T("div",{class:"folder-hint"},"一次读取文件夹中的 JSON / SKEL、Atlas 和全部纹理;仍可在下方单独替换资源。",-1)),T("div",yB,[T("div",{class:"asset-name",title:m.value},ve(m.value||"JSON / SKEL..."),9,xB),T("button",{onClick:V[8]||(V[8]=G=>{var W;return(W=i.value)==null?void 0:W.click()})},"选择")]),T("div",bB,[T("div",{class:"asset-name",title:p.value},ve(p.value||"Atlas..."),9,wB),T("button",{onClick:V[9]||(V[9]=G=>{var W;return(W=n.value)==null?void 0:W.click()})},"选择")]),T("div",SB,[T("div",{class:"asset-name",title:g.value.join(", ")},ve(x.value),9,MB),T("button",{onClick:V[10]||(V[10]=G=>{var W;return(W=r.value)==null?void 0:W.click()})},"选择(多选)")]),T("div",TB,[T("button",{class:"load",disabled:s.spineObject.status==="loading",onClick:F},ve(s.spineObject.status==="loading"?"加载中…":"↧ 加载"),9,_B),T("button",{class:"clear",onClick:N},"清除")]),T("div",CB,[V[27]||(V[27]=ft(" 支持 Spine 3.8 / 4.0 / 4.1 / 4.2 / 4.3 JSON · 对应版本运行时按需加载 · 本地离线 ",-1)),s.spineObject.dataVersion?(q(),J("span",EB," · 当前资源 "+ve(s.spineObject.dataVersion),1)):xe("",!0)]),s.spineObject.error?(q(),J("div",AB,ve(s.spineObject.error),1)):xe("",!0),T("div",IB,[V[30]||(V[30]=T("div",{class:"section-title"},"Spine 动画",-1)),s.spineObject.animations.length?(q(),J("label",PB,[V[29]||(V[29]=T("span",null,"时间轴播放动画",-1)),ce(T("select",{"onUpdate:modelValue":V[11]||(V[11]=G=>s.spineObject.selectedAnimation=G),onChange:D},[V[28]||(V[28]=T("option",{value:""},"无",-1)),(q(!0),J(_e,null,Et(s.spineObject.animations,G=>(q(),J("option",{key:G.name,value:G.name},ve(G.name)+"("+ve(G.duration.toFixed(2))+"s) ",9,kB))),128))],544),[[bt,s.spineObject.selectedAnimation]])])):(q(),J("div",RB,"无可用动画"))]),T("div",FB,[T("div",OB,[V[37]||(V[37]=T("div",{class:"section-title"},"层级树",-1)),l.value==="bone"?(q(),J("button",{key:0,class:Ce(["selected-bone",{active:s.spineObject.selectedBone}]),disabled:!s.spineObject.selectedBone,title:s.spineObject.selectedBone?"点击清除骨骼选择":"当前未选择骨骼",onClick:V[12]||(V[12]=G=>s.spineObject.selectedBone="")},[s.spineObject.selectedBone?(q(),J(_e,{key:0},[V[31]||(V[31]=ft("清除选中骨骼:",-1)),T("strong",null,ve(s.spineObject.selectedBone),1)],64)):(q(),J(_e,{key:1},[V[32]||(V[32]=ft("当前骨骼:",-1)),V[33]||(V[33]=T("strong",null,"未选择",-1))],64))],10,LB)):(q(),J("button",{key:1,class:Ce(["selected-bone",{active:s.spineObject.selectedSlot}]),disabled:!s.spineObject.selectedSlot,title:s.spineObject.selectedSlot?"点击清除插槽选择":"当前未选择插槽",onClick:V[13]||(V[13]=G=>s.spineObject.selectedSlot="")},[s.spineObject.selectedSlot?(q(),J(_e,{key:0},[V[34]||(V[34]=ft("清除选中插槽:",-1)),T("strong",null,ve(s.spineObject.selectedSlot),1)],64)):(q(),J(_e,{key:1},[V[35]||(V[35]=ft("当前插槽:",-1)),V[36]||(V[36]=T("strong",null,"未选择",-1))],64))],10,BB)),l.value==="bone"&&s.spineObject.bones.length?(q(),J("button",{key:2,class:"tree-action",onClick:P},ve(C.value?"全部展开":"全部折叠"),1)):xe("",!0)]),T("div",NB,[T("button",{class:Ce({on:l.value==="bone"}),onClick:V[14]||(V[14]=G=>l.value="bone")},"骨骼",2),T("button",{class:Ce({on:l.value==="slot"}),onClick:V[15]||(V[15]=G=>l.value="slot")},"插槽",2)]),l.value==="bone"?(q(),J(_e,{key:0},[s.spineObject.bones.length?(q(),J("div",UB,[ce(T("input",{"onUpdate:modelValue":V[16]||(V[16]=G=>c.value=G),type:"search","aria-label":"搜索骨骼",placeholder:"搜索骨骼名称…"},null,512),[[He,c.value,void 0,{trim:!0}]]),c.value?(q(),J("button",{key:0,title:"清空搜索","aria-label":"清空骨骼搜索",onClick:V[17]||(V[17]=G=>c.value="")},"✕")):xe("",!0)])):(q(),J("div",DB,"未加载 Spine")),s.spineObject.bones.length&&!S.value.length?(q(),J("div",$B,"未找到匹配的骨骼")):s.spineObject.bones.length?(q(),J("div",XB,[(q(!0),J(_e,null,Et(S.value,G=>(q(),J("div",{key:G.name,class:Ce(["bone",{selected:s.spineObject.selectedBone===G.name}]),style:Ot({paddingLeft:`${6+G.depth*16}px`}),role:"button",tabindex:"0",onClick:W=>b(G.name),onKeydown:Mr(qe(W=>b(G.name),["prevent"]),["enter"])},[v.value.has(G.name)?(q(),J("button",{key:0,class:"bone-toggle",title:a.value.has(G.name)?"展开子骨骼":"折叠子骨骼",onClick:qe(W=>A(G.name),["stop"])},ve(a.value.has(G.name)?"▸":"▾"),9,YB)):(q(),J("span",GB,"•")),T("span",jB,ve(G.name),1)],46,VB))),128))])):xe("",!0)],64)):(q(),J(_e,{key:1},[s.spineObject.slots.length?(q(),J("div",WB,[ce(T("input",{"onUpdate:modelValue":V[18]||(V[18]=G=>h.value=G),type:"search","aria-label":"搜索插槽",placeholder:"搜索插槽或附件名称…"},null,512),[[He,h.value,void 0,{trim:!0}]]),h.value?(q(),J("button",{key:0,title:"清空搜索","aria-label":"清空插槽搜索",onClick:V[19]||(V[19]=G=>h.value="")},"✕")):xe("",!0)])):(q(),J("div",HB,"未加载 Spine 插槽")),s.spineObject.slots.length&&!w.value.length?(q(),J("div",zB,"未找到匹配的插槽")):s.spineObject.slots.length?(q(),J("div",qB,[(q(!0),J(_e,null,Et(w.value,G=>(q(),J("div",{key:G.name,class:Ce(["bone slot-row",{selected:s.spineObject.selectedSlot===G.name}]),role:"button",tabindex:"0",title:`${G.name}(骨骼:${G.bone||"-"},附件:${G.attachment||"空"})`,onClick:W=>_(G.name),onKeydown:Mr(qe(W=>_(G.name),["prevent"]),["enter"])},[T("span",ZB,ve(G.order+1),1),T("span",JB,ve(G.name),1),T("span",QB,ve(G.attachment||"空"),1)],42,KB))),128))])):xe("",!0)],64))])]))}}),tN=Jt(eN,[["__scopeId","data-v-3545b078"]]),iN={class:"group"},sN={class:"caret"},nN={class:"scene-actions"},rN=["disabled"],oN={class:"group-body"},aN={class:"tree scene-tree"},lN=["onClick"],cN={key:0,class:"sub-branch"},hN={key:1,class:"tdot"},uN={class:"tlabel"},dN=["title","aria-label","onClick"],fN={viewBox:"0 0 24 24","aria-hidden":"true"},mN={key:0,class:"eye-slash",d:"M4 4l16 16"},pN=["onClick"],gN=["onClick"],vN={class:"tlabel"},yN=["title","aria-label","onClick"],xN={viewBox:"0 0 24 24","aria-hidden":"true"},bN={key:0,class:"eye-slash",d:"M4 4l16 16"},wN=["onClick"],SN=["onClick"],MN={class:"tlabel"},TN=["title","aria-label","onClick"],_N={viewBox:"0 0 24 24","aria-hidden":"true"},CN={key:0,class:"eye-slash",d:"M4 4l16 16"},EN=["onClick"],AN=["onClick"],IN={class:"tlabel"},RN=["title","aria-label","onClick"],PN={viewBox:"0 0 24 24","aria-hidden":"true"},kN={key:0,class:"eye-slash",d:"M4 4l16 16"},FN=["onClick"],ON={key:0,class:"empty"},LN={class:"row"},BN={class:"seed-row scene-seed"},NN={class:"field-block"},DN={class:"field-grid"},UN={class:"field-block"},$N={class:"field-block check-field"},XN={class:"field-grid"},VN={class:"compact-field"},YN={class:"compact-field"},GN={class:"field-grid"},jN={class:"compact-field"},HN={class:"compact-field"},WN={key:1,class:"field-grid"},zN={class:"compact-field"},qN={class:"compact-field"},KN={key:2,class:"field-grid"},ZN={class:"compact-field"},JN={class:"compact-field"},QN={class:"field-block"},eD={key:4,class:"field-grid"},tD={class:"compact-field"},iD={class:"compact-field"},sD={class:"collider-follow-section"},nD={class:"follow-path"},rD={class:"field-block"},oD=["value"],aD={class:"field-grid"},lD={class:"compact-field"},cD={class:"compact-field"},hD={class:"follow-path"},uD={class:"field-block"},dD={class:"field-grid"},fD={class:"compact-field"},mD={class:"compact-field"},pD={class:"field-grid"},gD={class:"compact-field"},vD={class:"compact-field"},yD={class:"setting-line"},xD={class:"setting-line"},bD={class:"field-block"},wD={key:4,class:"panel-hint"},SD=Zt({__name:"SceneObjectsSection",setup(s){const{store:e,resolvedCurveEditorMode:t,sys:i,activeObjectType:n,activeCollider:r,activePath:o,activeSpine:a,canCopyObject:c,collapsed:l,toggle:h,addSys:u,addCollider:d,addPath:f,addSpine:m,copySelectedObject:p,applyPathPreset:g,clearPathAnchors:x,randomizeSeed:v,LINEAR_CURVE:y}=Fr(),S=Le(()=>{const C=new Map(e.systems.map(E=>[E.id,E])),w=new Map;for(const E of e.systems)if(E.config.eventEnabled!==!1)for(const R of E.config.events||[])R.targetSystemId<=0||R.targetSystemId===E.id||!C.has(R.targetSystemId)||w.has(R.targetSystemId)||w.set(R.targetSystemId,E.id);const b=new Map;for(const[E,R]of w){const O=b.get(R);O?O.push(E):b.set(R,[E])}const _=[],A=new Set,P=(E,R)=>{if(!A.has(E.id)){A.add(E.id),_.push({system:E,depth:R});for(const O of b.get(E.id)||[]){const U=C.get(O);U&&P(U,R+1)}}};for(const E of e.systems)w.has(E.id)||P(E,0);for(const E of e.systems)A.has(E.id)||P(E,0);return _});return(C,w)=>(q(),J("div",iN,[T("div",{class:"group-head scene-head",onClick:w[5]||(w[5]=b=>I(h)("scene"))},[T("span",sN,ve(I(l).scene?"▸":"▾"),1),w[50]||(w[50]=T("span",null,"场景对象",-1)),T("div",nN,[T("button",{class:"scene-add",title:"添加粒子系统",onClick:w[0]||(w[0]=qe((...b)=>I(u)&&I(u)(...b),["stop"]))},"+粒子"),T("button",{class:"scene-add",title:"添加碰撞体",onClick:w[1]||(w[1]=qe((...b)=>I(d)&&I(d)(...b),["stop"]))},"+碰撞"),T("button",{class:"scene-add",title:"添加路径",onClick:w[2]||(w[2]=qe((...b)=>I(f)&&I(f)(...b),["stop"]))},"+路径"),T("button",{class:"scene-add",title:"添加 Spine",onClick:w[3]||(w[3]=qe((...b)=>I(m)&&I(m)(...b),["stop"]))},"+Spine"),T("button",{class:"scene-add",disabled:!I(c),title:"复制当前选中的场景对象",onClick:w[4]||(w[4]=qe((...b)=>I(p)&&I(p)(...b),["stop"]))},"+Copy",8,rN)])]),ce(T("div",oN,[T("div",aN,[(q(!0),J(_e,null,Et(S.value,b=>(q(),J("div",{key:`particle-${b.system.id}`,class:Ce(["tree-item scene-object-item",{on:I(n)==="particle"&&b.system.id===I(e).activeObjectId,"scene-object-child":b.depth>0}]),style:Ot(b.depth>0?{paddingLeft:`${b.depth*18}px`}:void 0),onClick:_=>I(e).selectSystem(b.system.id)},[b.depth>0?(q(),J("span",cN,"└")):(q(),J("span",hN,"●")),T("span",uN,ve(b.system.config.name||"ParticleSystem"),1),T("button",{class:Ce(["scene-object-eye",{off:b.system.visible===!1}]),title:b.system.visible===!1?"显示粒子系统":"隐藏粒子系统","aria-label":b.system.visible===!1?"显示粒子系统":"隐藏粒子系统",onClick:qe(_=>b.system.visible=b.system.visible===!1,["stop"])},[(q(),J("svg",fN,[w[51]||(w[51]=T("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),w[52]||(w[52]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.system.visible===!1?(q(),J("path",mN)):xe("",!0)]))],10,dN),T("span",{class:Ce(["scene-object-kind",{"sub-emitter-kind":b.depth>0}])},ve(b.depth>0?"子发射器":"粒子"),3),T("button",{class:"scene-object-delete",title:"删除粒子系统",onClick:qe(_=>I(e).removeSystem(b.system.id),["stop"])},"✕",8,pN)],14,lN))),128)),(q(!0),J(_e,null,Et(I(e).colliders,b=>(q(),J("div",{key:`collision-${b.id}`,class:Ce(["tree-item scene-object-item",{on:I(n)==="collision"&&b.id===I(e).activeObjectId}]),onClick:_=>I(e).selectSceneObject("collision",b.id)},[w[55]||(w[55]=T("span",{class:"tdot collision-dot"},"■",-1)),T("span",vN,ve(b.name),1),T("button",{class:Ce(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示碰撞体":"隐藏碰撞体","aria-label":b.visible===!1?"显示碰撞体":"隐藏碰撞体",onClick:qe(_=>b.visible=b.visible===!1,["stop"])},[(q(),J("svg",xN,[w[53]||(w[53]=T("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),w[54]||(w[54]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(q(),J("path",bN)):xe("",!0)]))],10,yN),w[56]||(w[56]=T("span",{class:"scene-object-kind"},"碰撞",-1)),T("button",{class:"scene-object-delete",title:"删除碰撞体",onClick:qe(_=>I(e).removeCollider(b.id),["stop"])},"✕",8,wN)],10,gN))),128)),(q(!0),J(_e,null,Et(I(e).paths,b=>(q(),J("div",{key:`path-${b.id}`,class:Ce(["tree-item scene-object-item",{on:I(n)==="path"&&b.id===I(e).activeObjectId}]),onClick:_=>I(e).selectSceneObject("path",b.id)},[w[59]||(w[59]=T("span",{class:"tdot path-dot"},"◇",-1)),T("span",MN,ve(b.name),1),T("button",{class:Ce(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示路径":"隐藏路径","aria-label":b.visible===!1?"显示路径":"隐藏路径",onClick:qe(_=>b.visible=b.visible===!1,["stop"])},[(q(),J("svg",_N,[w[57]||(w[57]=T("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),w[58]||(w[58]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(q(),J("path",CN)):xe("",!0)]))],10,TN),w[60]||(w[60]=T("span",{class:"scene-object-kind"},"路径",-1)),T("button",{class:"scene-object-delete",title:"删除路径",onClick:qe(_=>I(e).removePath(b.id),["stop"])},"✕",8,EN)],10,SN))),128)),(q(!0),J(_e,null,Et(I(e).spines,b=>(q(),J("div",{key:`spine-${b.id}`,class:Ce(["tree-item scene-object-item",{on:I(n)==="spine"&&b.id===I(e).activeObjectId}]),onClick:_=>I(e).selectSceneObject("spine",b.id)},[w[63]||(w[63]=T("span",{class:"tdot spine-dot"},"◆",-1)),T("span",IN,ve(b.name),1),T("button",{class:Ce(["scene-object-eye",{off:b.visible===!1}]),title:b.visible===!1?"显示 Spine":"隐藏 Spine","aria-label":b.visible===!1?"显示 Spine":"隐藏 Spine",onClick:qe(_=>b.visible=b.visible===!1,["stop"])},[(q(),J("svg",PN,[w[61]||(w[61]=T("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z"},null,-1)),w[62]||(w[62]=T("circle",{cx:"12",cy:"12",r:"2.8"},null,-1)),b.visible===!1?(q(),J("path",kN)):xe("",!0)]))],10,RN),w[64]||(w[64]=T("span",{class:"scene-object-kind"},"Spine",-1)),T("button",{class:"scene-object-delete",title:"删除 Spine",onClick:qe(_=>I(e).removeSpine(b.id),["stop"])},"✕",8,FN)],10,AN))),128)),!I(e).systems.length&&!I(e).colliders.length&&!I(e).paths.length&&!I(e).spines.length?(q(),J("div",ON,"场景中暂无对象")):xe("",!0)]),I(n)==="particle"&&I(i)?(q(),J(_e,{key:0},[T("label",LN,[w[65]||(w[65]=T("span",null,"名称",-1)),ce(T("input",{"onUpdate:modelValue":w[6]||(w[6]=b=>I(i).config.name=b),class:"inp"},null,512),[[He,I(i).config.name]])]),we(Oe,{label:"位置X",min:-2e3,max:2e3,step:1,modelValue:I(i).config.centerX,"onUpdate:modelValue":w[7]||(w[7]=b=>I(i).config.centerX=b)},null,8,["modelValue"]),we(Oe,{label:"位置Y",min:-2e3,max:2e3,step:1,modelValue:I(i).config.centerY,"onUpdate:modelValue":w[8]||(w[8]=b=>I(i).config.centerY=b)},null,8,["modelValue"]),we(Oe,{label:"偏移X",min:-2e3,max:2e3,step:1,modelValue:I(i).config.offsetX,"onUpdate:modelValue":w[9]||(w[9]=b=>I(i).config.offsetX=b)},null,8,["modelValue"]),we(Oe,{label:"偏移Y",min:-2e3,max:2e3,step:1,modelValue:I(i).config.offsetY,"onUpdate:modelValue":w[10]||(w[10]=b=>I(i).config.offsetY=b)},null,8,["modelValue"]),we(Oe,{label:"旋转",min:-360,max:360,step:1,modelValue:I(i).config.rootRotation,"onUpdate:modelValue":w[11]||(w[11]=b=>I(i).config.rootRotation=b)},null,8,["modelValue"]),we(Oe,{label:"缩放X",min:.05,max:10,step:.05,modelValue:I(i).config.rootScaleX,"onUpdate:modelValue":w[12]||(w[12]=b=>I(i).config.rootScaleX=b)},null,8,["modelValue"]),we(Oe,{label:"缩放Y",min:.05,max:10,step:.05,modelValue:I(i).config.rootScaleY,"onUpdate:modelValue":w[13]||(w[13]=b=>I(i).config.rootScaleY=b)},null,8,["modelValue"]),T("div",BN,[w[66]||(w[66]=T("label",{for:"system-seed"},"随机种子",-1)),ce(T("input",{id:"system-seed",class:"seed-input",type:"number",min:"0",step:"1","onUpdate:modelValue":w[14]||(w[14]=b=>I(i).config.seed=b),title:"控制粒子系统内全部随机属性、资源选择与修改器随机采样"},null,512),[[He,I(i).config.seed,void 0,{number:!0}]]),T("button",{class:"seed-random",title:"生成新的全局随机种子",onClick:w[15]||(w[15]=(...b)=>I(v)&&I(v)(...b))},"⚄")]),w[67]||(w[67]=T("div",{class:"seed-hint"},"控制初始随机参数、资源选择和修改器随机采样;相同种子可复现相同效果",-1))],64)):I(r)?(q(),J(_e,{key:1},[w[92]||(w[92]=T("div",{class:"object-editor-title"},"碰撞体属性",-1)),T("label",NN,[w[68]||(w[68]=T("span",null,"碰撞体名称",-1)),ce(T("input",{"onUpdate:modelValue":w[16]||(w[16]=b=>I(r).name=b),class:"inp"},null,512),[[He,I(r).name]])]),T("div",DN,[T("label",UN,[w[70]||(w[70]=T("span",null,"类型",-1)),ce(T("select",{"onUpdate:modelValue":w[17]||(w[17]=b=>I(r).shape=b),class:"inp"},[...w[69]||(w[69]=[is('',5)])],512),[[bt,I(r).shape]])]),T("label",$N,[w[71]||(w[71]=T("span",null,"启用",-1)),ce(T("input",{"onUpdate:modelValue":w[18]||(w[18]=b=>I(r).enabled=b),type:"checkbox"},null,512),[[wt,I(r).enabled]])])]),T("div",XN,[T("label",VN,[w[72]||(w[72]=T("span",null,"X 位置",-1)),ce(T("input",{"onUpdate:modelValue":w[19]||(w[19]=b=>I(r).x=b),type:"number",class:"inp"},null,512),[[He,I(r).x,void 0,{number:!0}]])]),T("label",YN,[w[73]||(w[73]=T("span",null,"Y 位置",-1)),ce(T("input",{"onUpdate:modelValue":w[20]||(w[20]=b=>I(r).y=b),type:"number",class:"inp"},null,512),[[He,I(r).y,void 0,{number:!0}]])])]),we(Oe,{label:"旋转",min:-360,max:360,step:1,modelValue:I(r).rotation,"onUpdate:modelValue":w[21]||(w[21]=b=>I(r).rotation=b)},null,8,["modelValue"]),T("div",GN,[T("label",jN,[w[74]||(w[74]=T("span",null,"缩放 X",-1)),ce(T("input",{"onUpdate:modelValue":w[22]||(w[22]=b=>I(r).scaleX=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[He,I(r).scaleX,void 0,{number:!0}]])]),T("label",HN,[w[75]||(w[75]=T("span",null,"缩放 Y",-1)),ce(T("input",{"onUpdate:modelValue":w[23]||(w[23]=b=>I(r).scaleY=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[He,I(r).scaleY,void 0,{number:!0}]])])]),I(r).shape==="circle"?(q(),Ct(Oe,{key:0,label:"半径",min:1,max:1e3,step:1,modelValue:I(r).radius,"onUpdate:modelValue":w[24]||(w[24]=b=>I(r).radius=b)},null,8,["modelValue"])):I(r).shape==="ellipse"?(q(),J("div",WN,[T("label",zN,[w[76]||(w[76]=T("span",null,"X 半径",-1)),ce(T("input",{"onUpdate:modelValue":w[25]||(w[25]=b=>I(r).radiusX=b),type:"number",min:"1",class:"inp"},null,512),[[He,I(r).radiusX,void 0,{number:!0}]])]),T("label",qN,[w[77]||(w[77]=T("span",null,"Y 半径",-1)),ce(T("input",{"onUpdate:modelValue":w[26]||(w[26]=b=>I(r).radiusY=b),type:"number",min:"1",class:"inp"},null,512),[[He,I(r).radiusY,void 0,{number:!0}]])])])):(q(),J("div",KN,[T("label",ZN,[w[78]||(w[78]=T("span",null,"宽度",-1)),ce(T("input",{"onUpdate:modelValue":w[27]||(w[27]=b=>I(r).width=b),type:"number",min:"1",class:"inp"},null,512),[[He,I(r).width,void 0,{number:!0}]])]),T("label",JN,[w[79]||(w[79]=T("span",null,"高度",-1)),ce(T("input",{"onUpdate:modelValue":w[28]||(w[28]=b=>I(r).height=b),type:"number",min:"1",class:"inp"},null,512),[[He,I(r).height,void 0,{number:!0}]])])])),I(r).shape==="polygon"||I(r).shape==="custom"?(q(),Ct(Oe,{key:3,label:"边数",min:3,max:16,step:1,modelValue:I(r).sides,"onUpdate:modelValue":w[29]||(w[29]=b=>I(r).sides=b)},null,8,["modelValue"])):xe("",!0),T("label",QN,[w[81]||(w[81]=T("span",null,"碰撞响应",-1)),ce(T("select",{"onUpdate:modelValue":w[30]||(w[30]=b=>I(r).response=b),class:"inp"},[...w[80]||(w[80]=[T("option",{value:"physics"},"物理(弹跳/摩擦)",-1),T("option",{value:"pause"},"暂停(停止不动)",-1),T("option",{value:"destroy"},"消失(立即销毁)",-1)])],512),[[bt,I(r).response]])]),I(r).response==="physics"?(q(),J("div",eD,[T("label",tD,[w[82]||(w[82]=T("span",null,"弹性 (0-1)",-1)),ce(T("input",{"onUpdate:modelValue":w[31]||(w[31]=b=>I(r).elasticity=b),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[He,I(r).elasticity,void 0,{number:!0}]])]),T("label",iD,[w[83]||(w[83]=T("span",null,"摩擦 (0-1)",-1)),ce(T("input",{"onUpdate:modelValue":w[32]||(w[32]=b=>I(r).friction=b),type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,512),[[He,I(r).friction,void 0,{number:!0}]])])])):xe("",!0),T("div",sD,[T("label",nD,[ce(T("input",{"onUpdate:modelValue":w[33]||(w[33]=b=>I(r).followPath=b),type:"checkbox"},null,512),[[wt,I(r).followPath]]),w[84]||(w[84]=ft("跟随路径移动",-1))]),I(r).followPath?(q(),J(_e,{key:0},[T("label",rD,[w[86]||(w[86]=T("span",null,"目标路径",-1)),ce(T("select",{"onUpdate:modelValue":w[34]||(w[34]=b=>I(r).followPathId=b),class:"inp"},[w[85]||(w[85]=T("option",{value:0},"(未选择)",-1)),(q(!0),J(_e,null,Et(I(e).paths,b=>(q(),J("option",{key:b.id,value:b.id},ve(b.name),9,oD))),128))],512),[[bt,I(r).followPathId,void 0,{number:!0}]])]),T("div",aD,[T("label",lD,[w[87]||(w[87]=T("span",null,"移动时长(秒)",-1)),ce(T("input",{"onUpdate:modelValue":w[35]||(w[35]=b=>I(r).followDuration=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[He,I(r).followDuration,void 0,{number:!0}]])]),T("label",cD,[w[89]||(w[89]=T("span",null,"曲线模式",-1)),ce(T("select",{"onUpdate:modelValue":w[36]||(w[36]=b=>I(r).followCurveMode=b),class:"inp"},[...w[88]||(w[88]=[T("option",null,"跟随导出",-1),T("option",null,"线性",-1),T("option",null,"贝塞尔",-1)])],512),[[bt,I(r).followCurveMode]])])]),T("label",hD,[ce(T("input",{"onUpdate:modelValue":w[37]||(w[37]=b=>I(r).followPathRotation=b),type:"checkbox"},null,512),[[wt,I(r).followPathRotation]]),w[90]||(w[90]=ft("方向沿路径",-1))]),w[91]||(w[91]=T("div",{class:"collider-curve-title"},[ft("移动进度曲线 "),T("small",null,"横轴:实时/移动时长 纵轴:路径进度(0=起点 → 1=终点)")],-1)),we(tn,{"model-value":I(r).followCurve||I(y),"default-value":I(y),mode:I(t)(I(r).followCurveMode),"onUpdate:modelValue":w[38]||(w[38]=b=>I(r).followCurve=b)},null,8,["model-value","default-value","mode"])],64)):xe("",!0)])],64)):I(o)?(q(),J(_e,{key:2},[w[102]||(w[102]=T("div",{class:"object-editor-title"},"路径属性",-1)),T("label",uD,[w[93]||(w[93]=T("span",null,"路径名称",-1)),ce(T("input",{"onUpdate:modelValue":w[39]||(w[39]=b=>I(o).name=b),class:"inp"},null,512),[[He,I(o).name]])]),T("div",dD,[T("label",fD,[w[94]||(w[94]=T("span",null,"X 位置",-1)),ce(T("input",{"onUpdate:modelValue":w[40]||(w[40]=b=>I(o).x=b),type:"number",class:"inp"},null,512),[[He,I(o).x,void 0,{number:!0}]])]),T("label",mD,[w[95]||(w[95]=T("span",null,"Y 位置",-1)),ce(T("input",{"onUpdate:modelValue":w[41]||(w[41]=b=>I(o).y=b),type:"number",class:"inp"},null,512),[[He,I(o).y,void 0,{number:!0}]])])]),we(Oe,{label:"旋转",min:-360,max:360,step:1,modelValue:I(o).rotation,"onUpdate:modelValue":w[42]||(w[42]=b=>I(o).rotation=b)},null,8,["modelValue"]),T("div",pD,[T("label",gD,[w[96]||(w[96]=T("span",null,"缩放 X",-1)),ce(T("input",{"onUpdate:modelValue":w[43]||(w[43]=b=>I(o).scaleX=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[He,I(o).scaleX,void 0,{number:!0}]])]),T("label",vD,[w[97]||(w[97]=T("span",null,"缩放 Y",-1)),ce(T("input",{"onUpdate:modelValue":w[44]||(w[44]=b=>I(o).scaleY=b),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[He,I(o).scaleY,void 0,{number:!0}]])])]),T("label",yD,[w[98]||(w[98]=T("span",null,"闭合路径",-1)),ce(T("input",{"onUpdate:modelValue":w[45]||(w[45]=b=>I(o).closed=b),type:"checkbox"},null,512),[[wt,I(o).closed]])]),T("label",xD,[w[99]||(w[99]=T("span",null,"路径颜色",-1)),ce(T("input",{"onUpdate:modelValue":w[46]||(w[46]=b=>I(o).color=b),type:"color",class:"path-color"},null,512),[[He,I(o).color]])]),w[103]||(w[103]=is('
操作说明:
  • 双击空白处/曲线:新建锚点
  • 双击锚点:删除节点
  • 双击第二下按住拖动:新建并拉出手柄
  • 拖动锚点移动位置,拖动手柄调整曲线
  • Shift+拖动手柄:两侧完全对称
  • Alt+拖动手柄:独立控制单侧
  • Ctrl+点击/框选:加选节点
  • Alt+点击/框选:减选节点
  • Alt+单击空白处:清除全部选中
  • 选中多个节点后可整体拖动
',1)),T("label",bD,[w[101]||(w[101]=T("span",null,"应用预设形状",-1)),ce(T("select",{"onUpdate:modelValue":w[47]||(w[47]=b=>I(o).preset=b),class:"inp"},[...w[100]||(w[100]=[is('',5)])],512),[[bt,I(o).preset]])]),T("button",{class:"path-action primary",onClick:w[48]||(w[48]=(...b)=>I(g)&&I(g)(...b))},"应用预设"),T("button",{class:"path-action",onClick:w[49]||(w[49]=(...b)=>I(x)&&I(x)(...b))},"清空锚点")],64)):I(a)?(q(),Ct(tN,{key:3,"spine-object":I(a)},null,8,["spine-object"])):(q(),J("div",wD,"使用右上角按钮创建场景对象"))],512),[[Si,!I(l).scene]])]))}}),MD=Jt(SD,[["__scopeId","data-v-55dcf3b2"]]),TD={class:"group"},_D={class:"caret"},CD={class:"group-body"},ED={class:"segs"},AD={class:"segs stream-behavior-segs"},ID={key:2,class:"stream-loop-options"},RD={class:"loop-section-row"},PD={class:"switch-row"},kD=["checked"],FD={key:0,class:"loop-duration-control"},OD={class:"switch-row loop-duration-toggle"},LD=["checked"],BD={class:"loop-section-duration"},ND=["value"],DD={key:1},UD={key:2,class:"loop-auto-duration"},$D={class:"loop-section-row"},XD={class:"switch-row"},VD=["checked"],YD={key:0,class:"loop-duration-control"},GD={class:"switch-row loop-duration-toggle"},jD=["checked"],HD={class:"loop-section-duration"},WD=["value"],zD={key:1},qD={key:2,class:"loop-auto-duration"},KD={key:3,class:"modifier-hint stream-loop-hint"},ZD={class:"group"},JD={class:"caret"},QD={class:"group-body"},e4={class:"row"},t4={class:"row"},i4=["value","disabled"],s4={key:0,class:"row"},n4={class:"row"},r4={key:0,value:"radial"},o4={key:1,value:"path-normal"},a4={key:2,value:"path-tangent"},l4={key:6,class:"switch-row"},c4=Zt({__name:"EmissionSection",setup(s){const{store:e,sys:t,automaticLoopDuration:i,loopDurationFrames:n,collapsed:r,toggle:o,setEmitMode:a,setLoopDurationFrames:c,setStreamBehavior:l,setLoopSection:h,setLoopSectionDuration:u,setLoopCustomDuration:d,resetModule:f,select:m,onShapeChange:p,onSpawnPathChange:g}=Fr();return(x,v)=>(q(),J(_e,null,[T("div",TD,[T("div",{class:"group-head",onClick:v[1]||(v[1]=y=>I(o)("emitMode"))},[T("span",_D,ve(I(r).emitMode?"▸":"▾"),1),v[36]||(v[36]=T("span",null,"发射模式",-1)),T("button",{class:"group-reset",title:"重置发射模式参数",onClick:v[0]||(v[0]=qe(y=>I(f)("emitMode"),["stop"]))},"重置")]),ce(T("div",CD,[T("div",ED,[T("button",{class:Ce(["seg",{on:I(t).config.mode==="stream"}]),onClick:v[2]||(v[2]=y=>I(a)("stream"))},"持续",2),T("button",{class:Ce(["seg",{on:I(t).config.mode==="burst"}]),onClick:v[3]||(v[3]=y=>I(a)("burst"))},"爆发",2)]),I(t).config.mode==="stream"?(q(),J(_e,{key:0},[T("div",AD,[T("button",{class:Ce(["seg",{on:I(t).config.streamBehavior==="normal"}]),onClick:v[4]||(v[4]=y=>I(l)("normal"))},"常规持续",2),T("button",{class:Ce(["seg",{on:I(t).config.streamBehavior==="loop"}]),onClick:v[5]||(v[5]=y=>I(l)("loop"))},"循环持续",2)]),we(Oe,{label:"发射速率",min:1,max:300,step:1,modelValue:I(t).config.rate,"onUpdate:modelValue":v[6]||(v[6]=y=>I(t).config.rate=y)},null,8,["modelValue"]),I(t).config.streamBehavior==="normal"?(q(),Ct(Oe,{key:0,label:"发射时长",min:1/30,max:60,step:1/30,modelValue:I(t).config.duration,"onUpdate:modelValue":v[7]||(v[7]=y=>I(t).config.duration=y)},null,8,["modelValue"])):(q(),Ct(Oe,{key:1,label:"发射时长 (f)",min:1,max:1800,step:1,"model-value":I(n),"onUpdate:modelValue":I(c)},null,8,["model-value","onUpdate:modelValue"])),I(t).config.streamBehavior==="loop"?(q(),J("div",ID,[T("div",RD,[T("label",PD,[T("input",{type:"checkbox",checked:I(t).config.generateLoopStartAnimation,onChange:v[8]||(v[8]=y=>I(h)("start",y))},null,40,kD),v[37]||(v[37]=T("span",{class:"switch-ui"},null,-1)),v[38]||(v[38]=T("span",null,"生成开始循环动画",-1))]),I(t).config.generateLoopStartAnimation?(q(),J("div",FD,[T("label",OD,[T("input",{type:"checkbox",checked:I(t).config.loopStartUseCustomDuration,onChange:v[9]||(v[9]=y=>I(d)("start",y))},null,40,LD),v[39]||(v[39]=T("span",{class:"switch-ui"},null,-1)),v[40]||(v[40]=T("span",null,"指定时长",-1))]),T("label",BD,[I(t).config.loopStartUseCustomDuration?(q(),J("input",{key:0,value:I(t).config.loopStartDurationFrames,type:"number",min:"1",max:"1800",step:"1","aria-label":"开始循环段时长",onChange:v[10]||(v[10]=y=>I(u)("start",y))},null,40,ND)):xe("",!0),I(t).config.loopStartUseCustomDuration?(q(),J("span",DD,"f")):(q(),J("span",UD,"自动 "+ve(I(i))+"f",1))])])):xe("",!0)]),T("div",$D,[T("label",XD,[T("input",{type:"checkbox",checked:I(t).config.generateLoopEndAnimation,onChange:v[11]||(v[11]=y=>I(h)("end",y))},null,40,VD),v[41]||(v[41]=T("span",{class:"switch-ui"},null,-1)),v[42]||(v[42]=T("span",null,"生成结束循环动画",-1))]),I(t).config.generateLoopEndAnimation?(q(),J("div",YD,[T("label",GD,[T("input",{type:"checkbox",checked:I(t).config.loopEndUseCustomDuration,onChange:v[12]||(v[12]=y=>I(d)("end",y))},null,40,jD),v[43]||(v[43]=T("span",{class:"switch-ui"},null,-1)),v[44]||(v[44]=T("span",null,"指定时长",-1))]),T("label",HD,[I(t).config.loopEndUseCustomDuration?(q(),J("input",{key:0,value:I(t).config.loopEndDurationFrames,type:"number",min:"1",max:"1800",step:"1","aria-label":"结束循环段时长",onChange:v[13]||(v[13]=y=>I(u)("end",y))},null,40,WD)):xe("",!0),I(t).config.loopEndUseCustomDuration?(q(),J("span",zD,"f")):(q(),J("span",qD,"自动 "+ve(I(i))+"f",1))])])):xe("",!0)])])):xe("",!0),I(t).config.streamBehavior==="loop"?(q(),J("div",KD,"循环持续模式不支持骨骼跟随和路径跟随;进入或退出时会将粒子跟随设置恢复默认值。")):xe("",!0)],64)):(q(),Ct(Oe,{key:1,label:"单次数量",min:1,max:1e3,step:1,modelValue:I(t).config.burstCount,"onUpdate:modelValue":v[14]||(v[14]=y=>I(t).config.burstCount=y)},null,8,["modelValue"])),we(Oe,{label:"延迟时间",min:0,max:5,step:.1,modelValue:I(t).config.delay,"onUpdate:modelValue":v[15]||(v[15]=y=>I(t).config.delay=y)},null,8,["modelValue"])],512),[[Si,!I(r).emitMode]])]),T("div",ZD,[T("div",{class:"group-head",onClick:v[17]||(v[17]=y=>I(o)("shape"))},[T("span",JD,ve(I(r).shape?"▸":"▾"),1),v[45]||(v[45]=T("span",null,"发射器形状",-1)),T("button",{class:"group-reset",title:"重置发射器形状参数",onClick:v[16]||(v[16]=qe(y=>I(f)("shape"),["stop"]))},"重置")]),ce(T("div",QD,[T("label",e4,[v[47]||(v[47]=T("span",null,"形状",-1)),ce(T("select",{"onUpdate:modelValue":v[18]||(v[18]=y=>I(t).config.shape=y),class:"inp",onChange:v[19]||(v[19]=(...y)=>I(p)&&I(p)(...y))},[...v[46]||(v[46]=[is('',5)])],544),[[bt,I(t).config.shape]])]),I(t).config.shape==="circle"||I(t).config.shape==="cone"?(q(),J(_e,{key:0},[we(Oe,{label:I(t).config.shape==="cone"?"内径":"内半径",min:0,max:I(t).config.outerRadius,step:1,modelValue:I(t).config.innerRadius,"onUpdate:modelValue":v[20]||(v[20]=y=>I(t).config.innerRadius=y)},null,8,["label","max","modelValue"]),we(Oe,{label:I(t).config.shape==="cone"?"外径":"外半径",min:I(t).config.innerRadius,max:300,step:1,modelValue:I(t).config.outerRadius,"onUpdate:modelValue":v[21]||(v[21]=y=>I(t).config.outerRadius=y)},null,8,["label","min","modelValue"])],64)):xe("",!0),I(t).config.shape==="cone"?(q(),J(_e,{key:1},[we(Oe,{label:"锥形朝向",min:-360,max:360,step:1,modelValue:I(t).config.coneDirection,"onUpdate:modelValue":v[22]||(v[22]=y=>I(t).config.coneDirection=y)},null,8,["modelValue"]),we(Oe,{label:"锥形开口角度",min:1,max:360,step:1,modelValue:I(t).config.coneAngle,"onUpdate:modelValue":v[23]||(v[23]=y=>I(t).config.coneAngle=y)},null,8,["modelValue"])],64)):I(t).config.shape==="rect"?(q(),J(_e,{key:2},[we(Oe,{label:"内宽",min:0,max:I(t).config.outerRectW,step:1,modelValue:I(t).config.innerRectW,"onUpdate:modelValue":v[24]||(v[24]=y=>I(t).config.innerRectW=y)},null,8,["max","modelValue"]),we(Oe,{label:"内高",min:0,max:I(t).config.outerRectH,step:1,modelValue:I(t).config.innerRectH,"onUpdate:modelValue":v[25]||(v[25]=y=>I(t).config.innerRectH=y)},null,8,["max","modelValue"]),we(Oe,{label:"外宽",min:I(t).config.innerRectW,max:400,step:1,modelValue:I(t).config.outerRectW,"onUpdate:modelValue":v[26]||(v[26]=y=>I(t).config.outerRectW=y)},null,8,["min","modelValue"]),we(Oe,{label:"外高",min:I(t).config.innerRectH,max:400,step:1,modelValue:I(t).config.outerRectH,"onUpdate:modelValue":v[27]||(v[27]=y=>I(t).config.outerRectH=y)},null,8,["min","modelValue"])],64)):I(t).config.shape==="path"?(q(),J(_e,{key:3},[T("label",t4,[v[49]||(v[49]=T("span",null,"选择路径",-1)),ce(T("select",{"onUpdate:modelValue":v[28]||(v[28]=y=>I(t).config.spawnPathId=y),class:"inp",onChange:v[29]||(v[29]=(...y)=>I(g)&&I(g)(...y))},[v[48]||(v[48]=T("option",{value:0},"无路径(点发射)",-1)),(q(!0),J(_e,null,Et(I(e).paths,y=>(q(),J("option",{key:y.id,value:y.id,disabled:!y.enabled},ve(y.name),9,i4))),128))],544),[[bt,I(t).config.spawnPathId,void 0,{number:!0}]])]),I(t).config.spawnPathId>0?(q(),J("label",s4,[v[51]||(v[51]=T("span",null,"出生分布",-1)),ce(T("select",{"onUpdate:modelValue":v[30]||(v[30]=y=>I(t).config.spawnPathDistribution=y),class:"inp"},[...v[50]||(v[50]=[T("option",{value:"fixed"},"等间距固定分布",-1),T("option",{value:"random"},"随机分布",-1)])],512),[[bt,I(t).config.spawnPathDistribution]])])):xe("",!0)],64)):xe("",!0),v[57]||(v[57]=T("div",{class:"divider"},null,-1)),T("label",n4,[v[54]||(v[54]=T("span",null,"发射角度",-1)),ce(T("select",{"onUpdate:modelValue":v[31]||(v[31]=y=>I(t).config.emissionAngleMode=y),class:"inp"},[v[52]||(v[52]=T("option",{value:"fixed"},"固定",-1)),v[53]||(v[53]=T("option",{value:"random"},"随机",-1)),I(t).config.shape==="circle"||I(t).config.shape==="rect"||I(t).config.shape==="cone"?(q(),J("option",r4,"径向(中心向外)")):xe("",!0),I(t).config.shape==="path"&&I(t).config.spawnPathId>0?(q(),J("option",o4,"垂直于路径")):xe("",!0),I(t).config.shape==="path"&&I(t).config.spawnPathId>0?(q(),J("option",a4,"沿路径方向")):xe("",!0)],512),[[bt,I(t).config.emissionAngleMode]])]),I(t).config.emissionAngleMode==="fixed"?(q(),Ct(Oe,{key:4,label:"固定角度",min:-360,max:360,step:1,modelValue:I(t).config.direction,"onUpdate:modelValue":v[32]||(v[32]=y=>I(t).config.direction=y)},null,8,["modelValue"])):I(t).config.emissionAngleMode==="random"?(q(),J(_e,{key:5},[we(Oe,{label:"基准角度",min:-360,max:360,step:1,modelValue:I(t).config.direction,"onUpdate:modelValue":v[33]||(v[33]=y=>I(t).config.direction=y)},null,8,["modelValue"]),we(Oe,{label:"随机范围",min:0,max:360,step:1,modelValue:I(t).config.spread,"onUpdate:modelValue":v[34]||(v[34]=y=>I(t).config.spread=y)},null,8,["modelValue"])],64)):xe("",!0),I(t).config.shape!=="point"?(q(),J("label",l4,[ce(T("input",{type:"checkbox","onUpdate:modelValue":v[35]||(v[35]=y=>I(t).config.showShape=y)},null,512),[[wt,I(t).config.showShape]]),v[55]||(v[55]=T("span",{class:"switch-ui"},null,-1)),v[56]||(v[56]=T("span",null,"显示形状",-1))])):xe("",!0)],512),[[Si,!I(r).shape]])])],64))}}),h4=Jt(c4,[["__scopeId","data-v-f9eac627"]]),u4={class:"pac"},d4={class:"pac-head"},f4={class:"pac-label"},m4={key:0,class:"pac-modes"},p4=["onClick"],g4={class:"pac-range"},v4={class:"pac-curve"},y4={class:"pac-axis"},x4=Zt({__name:"ParticleAttributeControl",props:{label:{},mode:{},valueMin:{},valueMax:{},curve:{},defaultCurve:{default:()=>[{x:0,y:0},{x:1,y:1}]},min:{},max:{},step:{default:1},allowDirection:{type:Boolean,default:!1},allowCurve:{type:Boolean,default:!0},showModes:{type:Boolean,default:!0},curveLabel:{default:"曲线输入 →"}},emits:["update:mode","update:valueMin","update:valueMax","update:curve"],setup(s){const e=s,t=Le(()=>{const i=[{label:"固定",value:"fixed"},{label:"随机",value:"random"}];return e.allowCurve&&i.push({label:"曲线",value:"curve"}),e.allowDirection&&i.push({label:"发射方向",value:"direction"}),i});return(i,n)=>(q(),J("div",u4,[T("div",d4,[T("span",f4,ve(s.label),1),s.showModes?(q(),J("div",m4,[(q(!0),J(_e,null,Et(t.value,r=>(q(),J("button",{key:r.value,class:Ce(["pac-mode",{on:s.mode===r.value}]),onClick:o=>i.$emit("update:mode",r.value)},ve(r.label),11,p4))),128))])):xe("",!0)]),s.mode==="fixed"||s.mode==="direction"?(q(),Ct(Oe,{key:0,label:s.mode==="direction"?"角度偏移":"数值",min:s.min,max:s.max,step:s.step,"model-value":s.valueMin,"onUpdate:modelValue":n[0]||(n[0]=r=>i.$emit("update:valueMin",r))},null,8,["label","min","max","step","model-value"])):s.mode==="random"?(q(),J(_e,{key:1},[we(Oe,{label:"下限",min:s.min,max:s.max,step:s.step,"model-value":s.valueMin,"onUpdate:modelValue":n[1]||(n[1]=r=>i.$emit("update:valueMin",r))},null,8,["min","max","step","model-value"]),we(Oe,{label:"上限",min:s.min,max:s.max,step:s.step,"model-value":s.valueMax,"onUpdate:modelValue":n[2]||(n[2]=r=>i.$emit("update:valueMax",r))},null,8,["min","max","step","model-value"])],64)):(q(),J(_e,{key:2},[T("div",g4,[we(Oe,{label:"范围下限",min:s.min,max:s.max,step:s.step,"model-value":s.valueMin,"onUpdate:modelValue":n[3]||(n[3]=r=>i.$emit("update:valueMin",r))},null,8,["min","max","step","model-value"]),we(Oe,{label:"范围上限",min:s.min,max:s.max,step:s.step,"model-value":s.valueMax,"onUpdate:modelValue":n[4]||(n[4]=r=>i.$emit("update:valueMax",r))},null,8,["min","max","step","model-value"])]),T("div",v4,[we(tn,{"model-value":s.curve,"default-value":s.defaultCurve,"onUpdate:modelValue":n[5]||(n[5]=r=>i.$emit("update:curve",r))},null,8,["model-value","default-value"]),T("div",y4,[n[6]||(n[6]=T("span",null,"0",-1)),T("span",null,ve(s.curveLabel),1),n[7]||(n[7]=T("span",null,"1",-1))])])],64))]))}}),Sn=Jt(x4,[["__scopeId","data-v-238f838c"]]),b4={class:"group"},w4={class:"caret"},S4={class:"group-body attr-body"},M4={class:"attr-axis-head"},T4={class:"axis-modes"},_4={class:"life-item"},C4={class:"switch-row"},E4={class:"life-item"},A4={class:"switch-row"},I4={class:"axis-modes life-axis"},R4={class:"life-item"},P4={class:"switch-row"},k4=Zt({__name:"ParticleAttributesSection",setup(s){const{sys:e,collapsed:t,toggle:i,resetModule:n,setSpeedOverLifeMode:r,prepareScaleOverLifeCurve:o,setScaleOverLifeMode:a,LINEAR_CURVE:c,FLAT_CURVE:l}=Fr();return(h,u)=>(q(),J("div",b4,[T("div",{class:"group-head",onClick:u[1]||(u[1]=d=>I(i)("attr"))},[T("span",w4,ve(I(t).attr?"▸":"▾"),1),u[44]||(u[44]=T("span",null,"粒子属性",-1)),T("button",{class:"group-reset",title:"重置粒子属性参数",onClick:u[0]||(u[0]=qe(d=>I(n)("attr"),["stop"]))},"重置")]),ce(T("div",S4,[u[52]||(u[52]=T("div",{class:"attr-section-title"},"粒子初始参数",-1)),we(Sn,{label:"初始生命周期","allow-curve":!1,mode:I(e).config.lifeMode,"onUpdate:mode":u[2]||(u[2]=d=>I(e).config.lifeMode=d),"value-min":I(e).config.lifeMin,"onUpdate:valueMin":u[3]||(u[3]=d=>I(e).config.lifeMin=d),"value-max":I(e).config.lifeMax,"onUpdate:valueMax":u[4]||(u[4]=d=>I(e).config.lifeMax=d),curve:I(e).config.lifeCurve,"onUpdate:curve":u[5]||(u[5]=d=>I(e).config.lifeCurve=d),min:.1,max:10,step:.1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),we(Sn,{label:"初始速度","allow-curve":!1,mode:I(e).config.speedMode,"onUpdate:mode":u[6]||(u[6]=d=>I(e).config.speedMode=d),"value-min":I(e).config.speedMin,"onUpdate:valueMin":u[7]||(u[7]=d=>I(e).config.speedMin=d),"value-max":I(e).config.speedMax,"onUpdate:valueMax":u[8]||(u[8]=d=>I(e).config.speedMax=d),curve:I(e).config.speedCurve,"onUpdate:curve":u[9]||(u[9]=d=>I(e).config.speedCurve=d),min:0,max:1e3,step:1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),T("div",M4,[u[45]||(u[45]=T("span",null,"初始缩放",-1)),T("div",T4,[T("button",{class:Ce(["axis-mode",{on:I(e).config.scaleAxisMode==="uniform"}]),onClick:u[10]||(u[10]=d=>I(e).config.scaleAxisMode="uniform")},"统一",2),T("button",{class:Ce(["axis-mode",{on:I(e).config.scaleAxisMode==="separate"}]),onClick:u[11]||(u[11]=d=>I(e).config.scaleAxisMode="separate")},"XY分离",2)])]),we(Sn,{label:I(e).config.scaleAxisMode==="uniform"?"初始缩放":"缩放 X","allow-curve":!1,mode:I(e).config.scaleMode,"onUpdate:mode":u[12]||(u[12]=d=>I(e).config.scaleMode=d),"value-min":I(e).config.scaleMin,"onUpdate:valueMin":u[13]||(u[13]=d=>I(e).config.scaleMin=d),"value-max":I(e).config.scaleMax,"onUpdate:valueMax":u[14]||(u[14]=d=>I(e).config.scaleMax=d),curve:I(e).config.scaleCurve,"onUpdate:curve":u[15]||(u[15]=d=>I(e).config.scaleCurve=d),min:0,max:5,step:.05,"curve-label":"随机采样 →"},null,8,["label","mode","value-min","value-max","curve"]),I(e).config.scaleAxisMode==="separate"?(q(),Ct(Sn,{key:0,label:"缩放 Y","show-modes":!1,"allow-curve":!1,mode:I(e).config.scaleMode,"onUpdate:mode":u[16]||(u[16]=d=>I(e).config.scaleMode=d),"value-min":I(e).config.scaleYMin,"onUpdate:valueMin":u[17]||(u[17]=d=>I(e).config.scaleYMin=d),"value-max":I(e).config.scaleYMax,"onUpdate:valueMax":u[18]||(u[18]=d=>I(e).config.scaleYMax=d),curve:I(e).config.scaleYCurve,"onUpdate:curve":u[19]||(u[19]=d=>I(e).config.scaleYCurve=d),min:0,max:5,step:.05,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"])):xe("",!0),we(Sn,{label:"初始旋转","allow-direction":"","allow-curve":!1,mode:I(e).config.initialRotationMode,"onUpdate:mode":u[20]||(u[20]=d=>I(e).config.initialRotationMode=d),"value-min":I(e).config.initialRotationMin,"onUpdate:valueMin":u[21]||(u[21]=d=>I(e).config.initialRotationMin=d),"value-max":I(e).config.initialRotationMax,"onUpdate:valueMax":u[22]||(u[22]=d=>I(e).config.initialRotationMax=d),curve:I(e).config.initialRotationCurve,"onUpdate:curve":u[23]||(u[23]=d=>I(e).config.initialRotationCurve=d),min:-360,max:360,step:1,"curve-label":"随机采样 →"},null,8,["mode","value-min","value-max","curve"]),u[53]||(u[53]=T("div",{class:"attr-section-title life-title"},"粒子生命周期变化参数",-1)),T("div",_4,[T("label",C4,[ce(T("input",{type:"checkbox","onUpdate:modelValue":u[24]||(u[24]=d=>I(e).config.speedOverLifeEnabled=d)},null,512),[[wt,I(e).config.speedOverLifeEnabled]]),u[46]||(u[46]=T("span",{class:"switch-ui"},null,-1)),u[47]||(u[47]=T("span",null,"生命周期内速度",-1))]),I(e).config.speedOverLifeEnabled?(q(),Ct(Sn,{key:0,label:"速度倍率",mode:I(e).config.speedOverLifeMode,"onUpdate:mode":I(r),"value-min":I(e).config.speedOverLifeMin,"onUpdate:valueMin":u[25]||(u[25]=d=>I(e).config.speedOverLifeMin=d),"value-max":I(e).config.speedOverLifeMax,"onUpdate:valueMax":u[26]||(u[26]=d=>I(e).config.speedOverLifeMax=d),curve:I(e).config.speedOverLifeCurve,"onUpdate:curve":u[27]||(u[27]=d=>I(e).config.speedOverLifeCurve=d),"default-curve":I(l),min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["mode","onUpdate:mode","value-min","value-max","curve","default-curve"])):xe("",!0)]),T("div",E4,[T("label",A4,[ce(T("input",{type:"checkbox","onUpdate:modelValue":u[28]||(u[28]=d=>I(e).config.scaleOverLifeEnabled=d),onChange:u[29]||(u[29]=(...d)=>I(o)&&I(o)(...d))},null,544),[[wt,I(e).config.scaleOverLifeEnabled]]),u[48]||(u[48]=T("span",{class:"switch-ui"},null,-1)),u[49]||(u[49]=T("span",null,"生命周期内缩放",-1))]),I(e).config.scaleOverLifeEnabled?(q(),J(_e,{key:0},[T("div",I4,[T("button",{class:Ce(["axis-mode",{on:I(e).config.scaleOverLifeAxisMode==="uniform"}]),onClick:u[30]||(u[30]=d=>I(e).config.scaleOverLifeAxisMode="uniform")},"统一",2),T("button",{class:Ce(["axis-mode",{on:I(e).config.scaleOverLifeAxisMode==="separate"}]),onClick:u[31]||(u[31]=d=>I(e).config.scaleOverLifeAxisMode="separate")},"XY分离",2)]),we(Sn,{label:I(e).config.scaleOverLifeAxisMode==="uniform"?"缩放倍率":"倍率 X",mode:I(e).config.scaleOverLifeMode,"onUpdate:mode":I(a),"value-min":I(e).config.scaleOverLifeMin,"onUpdate:valueMin":u[32]||(u[32]=d=>I(e).config.scaleOverLifeMin=d),"value-max":I(e).config.scaleOverLifeMax,"onUpdate:valueMax":u[33]||(u[33]=d=>I(e).config.scaleOverLifeMax=d),curve:I(e).config.scaleOverLifeCurve,"onUpdate:curve":u[34]||(u[34]=d=>I(e).config.scaleOverLifeCurve=d),"default-curve":I(l),min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["label","mode","onUpdate:mode","value-min","value-max","curve","default-curve"]),I(e).config.scaleOverLifeAxisMode==="separate"?(q(),Ct(Sn,{key:0,label:"倍率 Y","show-modes":!1,mode:I(e).config.scaleOverLifeMode,"onUpdate:mode":u[35]||(u[35]=d=>I(e).config.scaleOverLifeMode=d),"value-min":I(e).config.scaleYOverLifeMin,"onUpdate:valueMin":u[36]||(u[36]=d=>I(e).config.scaleYOverLifeMin=d),"value-max":I(e).config.scaleYOverLifeMax,"onUpdate:valueMax":u[37]||(u[37]=d=>I(e).config.scaleYOverLifeMax=d),curve:I(e).config.scaleYOverLifeCurve,"onUpdate:curve":u[38]||(u[38]=d=>I(e).config.scaleYOverLifeCurve=d),"default-curve":I(l),min:0,max:3,step:.05,"curve-label":"生命周期 →"},null,8,["mode","value-min","value-max","curve","default-curve"])):xe("",!0)],64)):xe("",!0)]),T("div",R4,[T("label",P4,[ce(T("input",{type:"checkbox","onUpdate:modelValue":u[39]||(u[39]=d=>I(e).config.rotationOverLifeEnabled=d)},null,512),[[wt,I(e).config.rotationOverLifeEnabled]]),u[50]||(u[50]=T("span",{class:"switch-ui"},null,-1)),u[51]||(u[51]=T("span",null,"生命周期内旋转",-1))]),I(e).config.rotationOverLifeEnabled?(q(),Ct(Sn,{key:0,label:"旋转速度",mode:I(e).config.rotationOverLifeMode,"onUpdate:mode":u[40]||(u[40]=d=>I(e).config.rotationOverLifeMode=d),"value-min":I(e).config.rotationSpeedMin,"onUpdate:valueMin":u[41]||(u[41]=d=>I(e).config.rotationSpeedMin=d),"value-max":I(e).config.rotationSpeedMax,"onUpdate:valueMax":u[42]||(u[42]=d=>I(e).config.rotationSpeedMax=d),curve:I(e).config.rotationOverLifeCurve,"onUpdate:curve":u[43]||(u[43]=d=>I(e).config.rotationOverLifeCurve=d),"default-curve":I(c),min:-720,max:720,step:10,"curve-label":"生命周期 →"},null,8,["mode","value-min","value-max","curve","default-curve"])):xe("",!0)])],512),[[Si,!I(t).attr]])]))}}),F4=Jt(k4,[["__scopeId","data-v-cf6b86a5"]]),O4={class:"gradient-editor"},L4=["title","onClick","onDblclick","onPointerdown"],B4={key:0,class:"gradient-controls"},N4=["value"],D4=["value"],U4={class:"gradient-position"},$4=["value"],X4=["disabled"],V4=Zt({__name:"ColorGradientEditor",props:{modelValue:{}},emits:["update:modelValue"],setup(s,{emit:e}){const t=s,i=e,n=Fe(null),r=Fe(0),o=Le(()=>t.modelValue[r.value]||null),a=Le(()=>[...t.modelValue].sort((_,A)=>_.position-A.position)),c=Le(()=>{const _=a.value;return _.length?`linear-gradient(90deg, ${_.map(A=>`${A.color} ${l(A.position)*100}%`).join(", ")})`:"#ffffff"});ai(()=>t.modelValue.length,_=>{r.value>=_&&(r.value=Math.max(0,_-1))});function l(_){return Math.min(1,Math.max(0,Number(_)||0))}function h(){return t.modelValue.map(_=>({position:l(_.position),color:_.color}))}function u(_,A){const P=h();P[_]&&(P[_]={...P[_],...A},i("update:modelValue",P))}function d(_){u(r.value,{color:_.target.value})}function f(_){var E;const A=_.target,P=b(A.value,((E=o.value)==null?void 0:E.color)||"#ffffff");A.value=P,u(r.value,{color:P})}function m(_){const A=_.target;f(_),A.blur()}function p(_){const A=Number(_.target.value);Number.isFinite(A)&&u(r.value,{position:l(A/100)})}function g(_){const A=h();A.push({position:l(_),color:C(A,_)}),r.value=A.length-1,i("update:modelValue",A)}function x(_){if(!n.value)return;const A=n.value.getBoundingClientRect();g((_.clientX-A.left)/Math.max(1,A.width))}function v(){const _=a.value;let A=.5;if(_.length>1){let P=-1;for(let E=0;E<_.length-1;E++){const R=_[E+1].position-_[E].position;R>P&&(P=R,A=(_[E].position+_[E+1].position)/2)}}g(A)}function y(_){if(t.modelValue.length<=2||_<0)return;const A=h().filter((P,E)=>E!==_);r.value=Math.min(_,A.length-1),i("update:modelValue",A)}function S(_,A){if(!n.value)return;r.value=A;const P=R=>{const O=n.value.getBoundingClientRect();u(A,{position:l((R.clientX-O.left)/Math.max(1,O.width))})},E=()=>{window.removeEventListener("pointermove",P),window.removeEventListener("pointerup",E),window.removeEventListener("pointercancel",E)};window.addEventListener("pointermove",P),window.addEventListener("pointerup",E),window.addEventListener("pointercancel",E),_.preventDefault()}function C(_,A){const P=[..._].sort((E,R)=>E.position-R.position);if(!P.length)return"#ffffff";if(A<=P[0].position)return P[0].color;if(A>=P[P.length-1].position)return P[P.length-1].color;for(let E=0;EO.position)continue;const U=(A-R.position)/Math.max(1e-4,O.position-R.position);return w(R.color,O.color,U)}return P[P.length-1].color}function w(_,A,P){const E=Y=>{const $=parseInt(Y.replace("#","").padEnd(6,"0").slice(0,6),16);return[$>>16&255,$>>8&255,$&255]},R=E(_),O=E(A),U=Y=>Math.round(R[Y]+(O[Y]-R[Y])*P);return`#${[U(0),U(1),U(2)].map(Y=>Y.toString(16).padStart(2,"0")).join("")}`}function b(_,A){let P=_.trim().replace(/^#/,"");return/^[0-9a-f]{3}$/i.test(P)&&(P=P.split("").map(E=>E+E).join("")),/^[0-9a-f]{6}$/i.test(P)?`#${P.toLowerCase()}`:A}return(_,A)=>(q(),J("div",O4,[T("div",{ref_key:"bar",ref:n,class:"gradient-bar",style:Ot({background:c.value}),title:"双击色带添加色标",onDblclick:x},[(q(!0),J(_e,null,Et(s.modelValue,(P,E)=>(q(),J("button",{key:E,type:"button",class:Ce(["gradient-stop",{selected:E===r.value}]),style:Ot({left:`${l(P.position)*100}%`,"--stop-color":P.color}),title:`${Math.round(l(P.position)*100)}% · ${P.color}`,onClick:qe(R=>r.value=E,["stop"]),onDblclick:qe(R=>y(E),["stop"]),onPointerdown:qe(R=>S(R,E),["stop"])},null,46,L4))),128))],36),o.value?(q(),J("div",B4,[T("input",{type:"color",class:"gradient-color",value:o.value.color,"aria-label":"色标颜色",onInput:d},null,40,N4),T("input",{type:"text",class:"gradient-hex-input",value:o.value.color,"aria-label":"色标颜色值",spellcheck:"false",onChange:f,onKeydown:Mr(m,["enter"])},null,40,D4),T("label",U4,[T("input",{type:"number",min:"0",max:"100",step:"1",value:Math.round(l(o.value.position)*100),"aria-label":"色标位置",onInput:p},null,40,$4),A[1]||(A[1]=T("span",null,"%",-1))]),T("button",{type:"button",class:"gradient-action",title:"在中间新增颜色",onClick:v},"+"),T("button",{type:"button",class:"gradient-action danger",title:"删除当前色标",disabled:s.modelValue.length<=2,onClick:A[0]||(A[0]=P=>y(r.value))},"×",8,X4)])):xe("",!0),A[2]||(A[2]=T("div",{class:"gradient-hint"},"双击色带新增 · 拖动色标调整位置 · 双击色标删除",-1))]))}}),qS=Jt(V4,[["__scopeId","data-v-f6ab10bf"]]),Y4={class:"pivot-toolbar"},G4={class:"pivot-zoom"},j4=["disabled"],H4=["disabled"],W4=["src"],z4={key:2,class:"pivot-empty"},q4={class:"pivot-bottom"},K4={class:"pivot-card"},Z4={class:"pivot-presets"},J4=["title","aria-label","onClick"],Q4={class:"pivot-card"},e5={class:"pivot-coords"},t5=["value"],i5=["value"],s5={class:"pivot-card-head pivot-rotate-head"},n5={class:"pivot-rotate-state"},r5={class:"pivot-rotate-body"},o5={class:"pivot-rotate-modes"},a5={class:"pivot-rotate-preview"},l5=["src"],wf=1e3,c5=Zt({__name:"PivotEditor",props:{previewUrl:{},anchorX:{},anchorY:{},large:{type:Boolean,default:!1}},emits:["update:anchorX","update:anchorY","fullscreen"],setup(s,{emit:e}){const t=s,i=e,n=[{icon:"↖",label:"左上",x:0,y:0},{icon:"↑",label:"正上",x:50,y:0},{icon:"↗",label:"右上",x:100,y:0},{icon:"←",label:"正左",x:0,y:50},{icon:"◯",label:"正中",x:50,y:50},{icon:"→",label:"正右",x:100,y:50},{icon:"↙",label:"左下",x:0,y:100},{icon:"↓",label:"正下·底部",x:50,y:100},{icon:"↘",label:"右下",x:100,y:100}],r=Fe(null),o=Fe(null),a=Fe({w:0,h:0}),c=Fe({w:1,h:1}),l=Fe(100),h=Fe({x:0,y:0}),u=Fe(!1),d=Fe("static");let f=null;const m=X=>Math.min(wf,Math.max(-wf,Number.isFinite(X)?X:0)),p=Le(()=>m(t.anchorX*100).toFixed(1)),g=Le(()=>m(t.anchorY*100).toFixed(1));function x(X,D){const F=c.value.w/Math.max(1,c.value.h);let N=X,k=N/F;return k>D&&(k=D,N=k*F),{w:Math.max(1,N),h:Math.max(1,k)}}const v=Le(()=>{const X=t.large?26:12,D=Math.max(1,a.value.w-X*2),F=Math.max(1,a.value.h-X*2);return x(D,F)}),y=Le(()=>({width:`${v.value.w}px`,height:`${v.value.h}px`,transform:`translate(${h.value.x}px, ${h.value.y}px) scale(${l.value/100})`})),S=Le(()=>{const X=l.value/100;return{x:a.value.w/2+h.value.x+(m(t.anchorX*100)/100-.5)*v.value.w*X,y:a.value.h/2+h.value.y+(m(t.anchorY*100)/100-.5)*v.value.h*X}}),C=Le(()=>{const X=t.large?128:72,D=x(X,X);return{width:`${D.w}px`,height:`${D.h}px`,transformOrigin:`${m(t.anchorX*100)}% ${m(t.anchorY*100)}%`}});function w(X,D){const F=wf/100;i("update:anchorX",Math.min(F,Math.max(-F,Number.isFinite(X)?X:0))),i("update:anchorY",Math.min(F,Math.max(-F,Number.isFinite(D)?D:0)))}function b(X){const D=o.value;if(!D)return;const F=D.getBoundingClientRect();F.width<=0||F.height<=0||w((X.clientX-F.left)/F.width,(X.clientY-F.top)/F.height)}function _(X){if(!t.previewUrl)return;if(X.button===2){A(X);return}if(X.button!==0)return;X.preventDefault(),b(X);const D=N=>b(N),F=()=>{window.removeEventListener("pointermove",D),window.removeEventListener("pointerup",F),window.removeEventListener("pointercancel",F)};window.addEventListener("pointermove",D),window.addEventListener("pointerup",F),window.addEventListener("pointercancel",F)}function A(X){X.preventDefault(),u.value=!0;const D=X.clientX,F=X.clientY,N=h.value.x,k=h.value.y,V=W=>{h.value={x:N+W.clientX-D,y:k+W.clientY-F}},G=()=>{u.value=!1,window.removeEventListener("pointermove",V),window.removeEventListener("pointerup",G),window.removeEventListener("pointercancel",G)};window.addEventListener("pointermove",V),window.addEventListener("pointerup",G),window.addEventListener("pointercancel",G)}function P(X){const D=X.deltaY<0?1.12:.8928571428571428,F=Math.min(400,Math.max(100,Math.round(l.value*D)));if(F===l.value)return;const N=r.value;if(!N){l.value=F;return}const k=N.getBoundingClientRect(),V=X.clientX-k.left,G=X.clientY-k.top,W=F/l.value;h.value={x:h.value.x+(V-k.width/2-h.value.x)*(1-W),y:h.value.y+(G-k.height/2-h.value.y)*(1-W)},l.value=F}function E(X){const D=X.target;c.value={w:D.naturalWidth||1,h:D.naturalHeight||1}}function R(X){l.value=Math.min(400,Math.max(100,l.value+X))}function O(){w(.5,.5)}function U(X){w(X.x/100,X.y/100)}function Y(X){return Math.abs(m(t.anchorX*100)-X.x)<.05&&Math.abs(m(t.anchorY*100)-X.y)<.05}function $(X,D){const F=m(Number(D.target.value));i(X==="x"?"update:anchorX":"update:anchorY",F/100)}return ai(()=>t.previewUrl,()=>{c.value={w:1,h:1},h.value={x:0,y:0},l.value=100}),ys(()=>{r.value&&(f=new ResizeObserver(X=>{var F;const D=(F=X[0])==null?void 0:F.contentRect;D&&(a.value={w:D.width,h:D.height})}),f.observe(r.value))}),Rr(()=>{f==null||f.disconnect(),f=null}),(X,D)=>(q(),J("div",{class:Ce(["pivot-editor",{"pivot-large":s.large}])},[T("div",Y4,[D[9]||(D[9]=T("div",{class:"pivot-hint"},[T("span",{class:"pivot-hint-icon"},"⊕"),T("span",null,"贴图轴点")],-1)),T("div",G4,[T("button",{type:"button",disabled:l.value<=100,title:"缩小",onClick:D[0]||(D[0]=F=>R(-25))},"−",8,j4),T("span",null,ve(l.value)+"%",1),T("button",{type:"button",disabled:l.value>=400,title:"放大",onClick:D[1]||(D[1]=F=>R(25))},"+",8,H4)]),s.large?xe("",!0):(q(),J("button",{key:0,type:"button",class:"pivot-expand",title:"放大到全屏操作",onClick:D[2]||(D[2]=F=>X.$emit("fullscreen"))},"⤢"))]),T("div",{ref_key:"stageRef",ref:r,class:Ce(["pivot-stage",{panning:u.value}]),title:"左键点击/拖动设置轴点 · 右键拖动画布 · 滚轮缩放",onPointerdown:_,onWheel:qe(P,["prevent"]),onContextmenu:D[3]||(D[3]=qe(()=>{},["prevent"]))},[s.previewUrl?(q(),J("div",{key:0,ref_key:"boxRef",ref:o,class:"pivot-box",style:Ot(y.value)},[T("img",{src:s.previewUrl,alt:"轴点预览",draggable:"false",onLoad:E},null,40,W4)],4)):xe("",!0),s.previewUrl?(q(),J(_e,{key:1},[T("div",{class:"pivot-cross vertical",style:Ot({left:`${S.value.x}px`})},null,4),T("div",{class:"pivot-cross horizontal",style:Ot({top:`${S.value.y}px`})},null,4),T("div",{class:"pivot-marker",style:Ot({left:`${S.value.x}px`,top:`${S.value.y}px`})},null,4),T("div",{class:"pivot-badge",style:Ot({left:`${S.value.x}px`,top:`${S.value.y}px`})},"X: "+ve(p.value)+"% | Y: "+ve(g.value)+"%",5)],64)):(q(),J("div",z4,"未选择图片"))],34),T("div",q4,[T("div",K4,[T("div",Z4,[(q(),J(_e,null,Et(n,F=>T("button",{key:F.label,type:"button",class:Ce(["pivot-preset",{on:Y(F)}]),title:`${F.label}(${F.x}%, ${F.y}%)`,"aria-label":F.label,onClick:N=>U(F)},ve(F.icon),11,J4)),64))]),T("button",{type:"button",class:"pivot-reset",onClick:O},"↺ 复位居中 (50%, 50%)")]),T("div",Q4,[D[15]||(D[15]=T("div",{class:"pivot-card-head"},[T("span",null,[T("span",{class:"pivot-card-icon"},"◎"),ft(" 轴点坐标(%)")])],-1)),T("div",e5,[T("label",null,[D[10]||(D[10]=ft("X: ",-1)),T("input",{type:"number",min:"-1000",max:"1000",step:"0.1",value:p.value,onInput:D[4]||(D[4]=F=>$("x",F))},null,40,t5),D[11]||(D[11]=T("span",null,"%",-1))]),T("label",null,[D[12]||(D[12]=ft("Y: ",-1)),T("input",{type:"number",min:"-1000",max:"1000",step:"0.1",value:g.value,onInput:D[5]||(D[5]=F=>$("y",F))},null,40,i5),D[13]||(D[13]=T("span",null,"%",-1))])]),s.large?(q(),J(_e,{key:0},[T("div",s5,[D[14]||(D[14]=T("span",null,[T("span",{class:"pivot-card-icon"},"✥"),ft(" 轴心旋转测试")],-1)),T("span",n5,ve(d.value==="static"?"静止":d.value==="spin"?"自转":"摆动"),1)]),T("div",r5,[T("div",o5,[T("button",{type:"button",class:Ce({on:d.value==="static"}),onClick:D[6]||(D[6]=F=>d.value="static")},"静止",2),T("button",{type:"button",class:Ce({on:d.value==="spin"}),onClick:D[7]||(D[7]=F=>d.value="spin")},"↻ 自转",2),T("button",{type:"button",class:Ce({on:d.value==="swing"}),onClick:D[8]||(D[8]=F=>d.value="swing")},"⇄ 摆动",2)]),T("div",a5,[s.previewUrl?(q(),J("img",{key:0,src:s.previewUrl,alt:"旋转测试",draggable:"false",class:Ce(d.value),style:Ot(C.value)},null,14,l5)):xe("",!0)])])],64)):xe("",!0)])])],2))}}),Iy=Jt(c5,[["__scopeId","data-v-1261b03a"]]),h5={class:"image-card"},u5={class:"imgrow"},d5=["title"],f5=["src","alt"],m5={key:1,viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"#8a93bb","stroke-width":"1.6"},p5={class:"img-fields"},g5={key:0,class:"row"},v5={class:"row"},y5=["placeholder"],x5={class:"img-actions"},b5=["title"],w5=["disabled"],S5={class:"thumb-note"},M5={key:0,class:"row"},T5={class:"row"},_5={class:"row"},C5={class:"sequence-note"},E5={class:"resource-weight-row"},A5=["disabled","title"],I5={key:0,viewBox:"0 0 24 24","aria-hidden":"true"},R5={key:1,viewBox:"0 0 24 24","aria-hidden":"true"},P5={key:2,class:"pivot-toggle-row"},k5={class:"pivot-toggle-text"},F5=["title"],O5=["title"],L5={class:"pivot-modal",role:"dialog","aria-modal":"true","aria-label":"贴图旋转轴点大图精修"},B5={class:"pivot-modal-head"},N5={class:"pivot-modal-info"},D5={class:"pivot-modal-title"},U5={class:"pivot-modal-badge"},$5={class:"pivot-modal-actions"},Ry="SpineParticle.PivotPanels.v1",X5=Zt({__name:"ImageResourceCard",props:{resource:{},resourceCount:{},defaultFile:{},namePlaceholder:{default:"particle"},showFolder:{type:Boolean,default:!0},supportsSequence:{type:Boolean,default:!1},pivotKey:{}},emits:["pick","pickSequence","reset","remove","updateWeight","toggleLock"],setup(s,{emit:e}){const t=s,i=e,n=Le(()=>{var _,A;if(t.resource.imageMode==="sequence"){const P=t.resource.sequenceFrames||[];if(!P.length)return"未选择序列帧";const E=((_=P[0])==null?void 0:_.name)||"第 1 帧",R=((A=P[P.length-1])==null?void 0:A.name)||E;return P.length===1?`1 帧 · ${E}`:`${P.length} 帧 · ${E} → ${R}`}const b=t.resource.textureName||t.defaultFile.replace(/\.[^.]+$/,"");return b.includes(".")?b:`${b}.png`}),r=Le(()=>{var b,_;return t.resource.imageMode==="sequence"?((_=(b=t.resource.sequenceFrames)==null?void 0:b[0])==null?void 0:_.previewUrl)||"":t.resource.previewUrl});function o(){try{const b=JSON.parse(sessionStorage.getItem(Ry)||"{}");return b&&typeof b=="object"?b:{}}catch{return{}}}const a=o(),c=Le(()=>t.pivotKey||`particle-image:${t.resource.id}`),l=Le(()=>typeof t.resource.anchorX=="number"&&typeof t.resource.anchorY=="number"),h=Le(()=>Math.abs((t.resource.anchorX??.5)-.5)<1e-4&&Math.abs((t.resource.anchorY??.5)-.5)<1e-4),u=typeof a[c.value]=="boolean",d=Fe(u?a[c.value]:!h.value);ai(d,b=>{a[c.value]=b;try{sessionStorage.setItem(Ry,JSON.stringify(a))}catch{}}),ai(c,b=>{d.value=typeof a[b]=="boolean"?a[b]:!h.value}),ai(()=>h.value,b=>{b||(d.value=!0)},{immediate:!0});const f=Fe(!1),m=Fe(.5),p=Fe(.5),g=Le(()=>{const b=((t.resource.anchorX??.5)*100).toFixed(1),_=((t.resource.anchorY??.5)*100).toFixed(1);return d.value?`已开启:X ${b}% | Y ${_}%`:h.value?"未开启,默认围绕图片正中心 (50%, 50%)":`轴点已自定义:X ${b}% | Y ${_}%`});function x(){m.value=t.resource.anchorX??.5,p.value=t.resource.anchorY??.5,f.value=!0}function v(){d.value||(t.resource.anchorX=.5,t.resource.anchorY=.5,f.value=!1)}function y(b){b&&(t.resource.anchorX=m.value,t.resource.anchorY=p.value),f.value=!1}function S(b){b.key==="Escape"&&f.value&&y(!1)}ys(()=>window.addEventListener("keydown",S)),Rr(()=>window.removeEventListener("keydown",S));const C=Le(()=>{var P,E;const b=t.resource.sequenceFrames||[];if(!b.length)return"未选择序列帧";const _=((P=b[0])==null?void 0:P.name)||"第一张图片",A=((E=b[b.length-1])==null?void 0:E.name)||"最后一张图片";return`已选择 ${b.length} 帧,按 ${_}-${A} 顺序播放`});function w(){t.supportsSequence&&t.resource.imageMode==="sequence"?i("pickSequence",t.resource.id):i("pick",t.resource.id)}return(b,_)=>(q(),J(_e,null,[T("div",h5,[T("div",u5,[T("button",{class:"img-thumb",title:s.supportsSequence&&s.resource.imageMode==="sequence"?"选择序列帧图片":"选择本地图片",onClick:w},[r.value?(q(),J("img",{key:0,src:r.value,alt:s.resource.textureName},null,8,f5)):(q(),J("svg",m5,[..._[19]||(_[19]=[T("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"},null,-1),T("circle",{cx:"8.5",cy:"8.5",r:"1.6"},null,-1),T("path",{d:"M21 15l-5-5-9 9"},null,-1)])]))],8,d5),T("div",p5,[s.showFolder?(q(),J("label",g5,[_[20]||(_[20]=T("span",null,"子文件夹",-1)),ce(T("input",{"onUpdate:modelValue":_[0]||(_[0]=A=>s.resource.textureFolder=A),type:"text",class:"inp",placeholder:"subfolder/"},null,512),[[He,s.resource.textureFolder]])])):xe("",!0),T("label",v5,[_[21]||(_[21]=T("span",null,"名称",-1)),ce(T("input",{"onUpdate:modelValue":_[1]||(_[1]=A=>s.resource.textureName=A),type:"text",class:"inp",placeholder:s.namePlaceholder},null,8,y5),[[He,s.resource.textureName]])])]),T("div",x5,[T("button",{class:"mini-btn2",title:`恢复 ${s.defaultFile}`,onClick:_[2]||(_[2]=A=>b.$emit("reset",s.resource.id))},"⟳",8,b5),T("button",{class:"mini-btn2",title:"删除图片资源",disabled:s.resourceCount===1,onClick:_[3]||(_[3]=A=>b.$emit("remove",s.resource.id))},"🗑",8,w5)])]),T("div",S5,ve(n.value),1),s.supportsSequence?(q(),J("label",M5,[_[23]||(_[23]=T("span",null,"图片模式",-1)),ce(T("select",{"onUpdate:modelValue":_[4]||(_[4]=A=>s.resource.imageMode=A),class:"inp"},[..._[22]||(_[22]=[T("option",{value:"fixed"},"固定",-1),T("option",{value:"sequence"},"序列帧",-1)])],512),[[bt,s.resource.imageMode]])])):xe("",!0),s.supportsSequence&&s.resource.imageMode==="sequence"?(q(),J(_e,{key:1},[T("label",T5,[_[25]||(_[25]=T("span",null,"播放模式",-1)),ce(T("select",{"onUpdate:modelValue":_[5]||(_[5]=A=>s.resource.sequencePlayback=A),class:"inp"},[..._[24]||(_[24]=[T("option",{value:"once-hide"},"单次-尾帧消失",-1),T("option",{value:"once-hold"},"单次-尾帧固定",-1),T("option",{value:"loop-forward"},"正向循环",-1),T("option",{value:"loop-reverse"},"反向循环",-1)])],512),[[bt,s.resource.sequencePlayback]])]),T("label",_5,[_[26]||(_[26]=T("span",null,"播放帧率",-1)),ce(T("input",{"onUpdate:modelValue":_[6]||(_[6]=A=>s.resource.sequenceFps=A),type:"number",min:"1",max:"120",step:"1",class:"inp"},null,512),[[He,s.resource.sequenceFps,void 0,{number:!0}]])]),T("button",{class:"sequence-pick",onClick:_[7]||(_[7]=A=>b.$emit("pickSequence",s.resource.id))},"选择序列帧(多选)"),T("div",C5,ve(C.value),1)],64)):xe("",!0),T("div",E5,[we(Oe,{class:"resource-weight-control",label:"占比%",min:0,max:100,step:1,"model-value":s.resource.weight,disabled:s.resource.locked||s.resourceCount===1,"onUpdate:modelValue":_[8]||(_[8]=A=>b.$emit("updateWeight",s.resource.id,A))},null,8,["model-value","disabled"]),T("button",{class:Ce(["weight-lock",{on:s.resource.locked}]),disabled:s.resourceCount===1,title:s.resource.locked?"解除占比锁定":"锁定当前占比",onClick:_[9]||(_[9]=A=>b.$emit("toggleLock",s.resource.id))},[s.resource.locked?(q(),J("svg",I5,[..._[27]||(_[27]=[T("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"},null,-1),T("path",{d:"M8 10V7a4 4 0 0 1 8 0v3"},null,-1)])])):(q(),J("svg",R5,[..._[28]||(_[28]=[T("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"},null,-1),T("path",{d:"M16 10V7a4 4 0 0 0-7.5-2"},null,-1)])]))],10,A5)]),bT(b.$slots,"default",{},void 0),l.value?(q(),J("div",P5,[_[31]||(_[31]=T("div",{class:"pivot-toggle-icon"},"◎",-1)),T("div",k5,[_[29]||(_[29]=T("div",{class:"pivot-toggle-title"},"贴图轴点",-1)),T("div",{class:"pivot-toggle-sub",title:g.value},ve(g.value),9,F5)]),T("label",{class:"pivot-switch",title:d.value?"收起轴点调整":"展开轴点调整"},[ce(T("input",{"onUpdate:modelValue":_[10]||(_[10]=A=>d.value=A),type:"checkbox",onChange:v},null,544),[[wt,d.value]]),_[30]||(_[30]=T("span",{class:"pivot-switch-ui"},null,-1))],8,O5)])):xe("",!0),l.value&&d.value?(q(),Ct(Iy,{key:3,"preview-url":r.value,"anchor-x":s.resource.anchorX??.5,"anchor-y":s.resource.anchorY??.5,"onUpdate:anchorX":_[11]||(_[11]=A=>s.resource.anchorX=A),"onUpdate:anchorY":_[12]||(_[12]=A=>s.resource.anchorY=A),onFullscreen:x},null,8,["preview-url","anchor-x","anchor-y"])):xe("",!0)]),(q(),Ct(dx,{to:"body"},[f.value?(q(),J("div",{key:0,class:"pivot-modal-backdrop",onPointerdown:_[18]||(_[18]=qe(A=>y(!1),["self"]))},[T("div",L5,[T("div",B5,[_[34]||(_[34]=T("div",{class:"pivot-modal-icon"},"◎",-1)),T("div",N5,[T("div",D5,[_[32]||(_[32]=ft(" 贴图旋转轴点大图精修 ",-1)),T("span",U5,ve(s.resource.textureName||s.defaultFile),1)]),_[33]||(_[33]=T("div",{class:"pivot-modal-desc"},"在下方贴图上任意点击或拖拽,精确设置粒子的旋转/摆动中心",-1))]),T("button",{type:"button",class:"pivot-modal-close",title:"关闭",onClick:_[13]||(_[13]=A=>y(!1))},"✕")]),_[35]||(_[35]=T("div",{class:"pivot-modal-hint"},"支持 100% ~ 400% 放大,精确对准尖端或根部:",-1)),we(Iy,{large:"","preview-url":r.value,"anchor-x":m.value,"anchor-y":p.value,"onUpdate:anchorX":_[14]||(_[14]=A=>m.value=A),"onUpdate:anchorY":_[15]||(_[15]=A=>p.value=A)},null,8,["preview-url","anchor-x","anchor-y"]),T("div",$5,[T("button",{type:"button",class:"pivot-modal-cancel",onClick:_[16]||(_[16]=A=>y(!1))},"取消"),T("button",{type:"button",class:"pivot-modal-confirm",onClick:_[17]||(_[17]=A=>y(!0))},"确定并保存轴点")])])],32)):xe("",!0)]))],64))}}),KS=Jt(X5,[["__scopeId","data-v-cb3a8e2c"]]),V5={class:"group"},Y5={class:"caret"},G5={class:"group-body"},j5={class:"seg"},H5={class:"row"},W5={class:"curve-wrap"},z5={class:"seg"},q5={class:"row"},K5=["value"],Z5={value:0},J5=["value"],Q5={class:"render-layer-current"},e8=["title"],t8={key:0,class:"slot-picker"},i8={class:"slot-list"},s8=["onClick"],n8={class:"slot-order"},r8={class:"slot-name"},o8={class:"slot-attachment"},a8={key:0,class:"modifier-hint"},l8={class:"seg"},c8={class:"switch-row render-layer-switch"},h8=["disabled"],u8={key:0,class:"modifier-hint"},d8={key:2,class:"modifier-hint render-layer-warning"},f8={class:"look-title image-title"},m8={class:"row resource-color-row"},p8=["onUpdate:modelValue"],g8=["onUpdate:modelValue"],v8={key:0,class:"row resource-color-picker"},y8=["onUpdate:modelValue"],x8=["value","onChange","onKeydown"],b8={key:0,class:"random-color-hint"},w8={class:"resource-alpha-head"},S8={class:"alpha-modes"},M8=["onClick"],T8=["onClick"],_8=["onClick"],C8={class:"row"},E8=["onUpdate:modelValue"],A8={class:"resource-alpha-curve"},I8=Zt({__name:"ParticleAppearanceSection",setup(s){const{resolvedCurveEditorMode:e,sys:t,textureFileInput:i,sequenceFileInput:n,addImageResource:r,openTexturePicker:o,openSequencePicker:a,onTextureFile:c,onSequenceFiles:l,resetTexture:h,setResourceFixedColor:u,commitResourceFixedColor:d,removeImageResource:f,setResourceWeight:m,toggleResourceLock:p,collapsed:g,toggle:x,resetModule:v,select:y,renderLayerSlotPickerOpen:S,renderLayerSlotSearch:C,renderLayerReadySpines:w,renderLayerSpineReady:b,renderLayerFilteredSlots:_,renderLayerSlotLabel:A,renderLayerResolvedLabel:P,renderLayerWarning:E,setRenderLayerSlotMode:R,selectRenderLayerSpine:O,pickRenderLayerSlot:U,clearRenderLayerSlot:Y,ALPHA_CURVE:$,RESOURCE_ALPHA_CURVE:X}=Fr();return(D,F)=>(q(),J("div",V5,[T("div",{class:"group-head",onClick:F[1]||(F[1]=N=>I(x)("look"))},[T("span",Y5,ve(I(g).look?"▸":"▾"),1),F[19]||(F[19]=T("span",null,"外观与资源",-1)),T("button",{class:"group-reset",title:"重置外观与资源参数",onClick:F[0]||(F[0]=qe(N=>I(v)("look"),["stop"]))},"重置")]),ce(T("div",G5,[F[36]||(F[36]=T("div",{class:"look-title"},"透明度",-1)),T("div",j5,[T("button",{class:Ce(["seg-btn",{active:I(t).config.alphaMode==="curve"}]),onClick:F[2]||(F[2]=N=>I(t).config.alphaMode="curve")},"曲线",2),T("button",{class:Ce(["seg-btn",{active:I(t).config.alphaMode==="fixed"}]),onClick:F[3]||(F[3]=N=>I(t).config.alphaMode="fixed")},"固定",2)]),I(t).config.alphaMode==="fixed"?(q(),Ct(Oe,{key:0,label:"透明度",min:0,max:1,step:.01,modelValue:I(t).config.alpha,"onUpdate:modelValue":F[4]||(F[4]=N=>I(t).config.alpha=N)},null,8,["modelValue"])):(q(),J(_e,{key:1},[T("label",H5,[F[21]||(F[21]=T("span",null,"曲线模式",-1)),ce(T("select",{"onUpdate:modelValue":F[5]||(F[5]=N=>I(t).config.curveMode=N),class:"inp"},[...F[20]||(F[20]=[T("option",null,"跟随导出",-1),T("option",null,"线性",-1),T("option",null,"贝塞尔",-1)])],512),[[bt,I(t).config.curveMode]])]),T("div",W5,[we(tn,{modelValue:I(t).config.alphaCurve,"onUpdate:modelValue":F[6]||(F[6]=N=>I(t).config.alphaCurve=N),"default-value":I($),mode:I(e)(I(t).config.curveMode)},null,8,["modelValue","default-value","mode"]),F[22]||(F[22]=T("div",{class:"curve-labels"},[T("span",null,"0(透明)"),T("span",null,"生命周期 →"),T("span",null,"1(不透明)")],-1))])],64)),F[37]||(F[37]=T("div",{class:"look-title"},"渲染层级(Spine 插槽)",-1)),T("div",z5,[T("button",{class:Ce(["seg-btn",{active:I(t).config.renderLayerMode==="top"}]),onClick:F[7]||(F[7]=N=>I(t).config.renderLayerMode="top")},"最上层",2),T("button",{class:Ce(["seg-btn",{active:I(t).config.renderLayerMode==="slot"}]),onClick:F[8]||(F[8]=(...N)=>I(R)&&I(R)(...N))},"Spine 插槽",2)]),I(t).config.renderLayerMode==="slot"?(q(),J(_e,{key:2},[T("label",q5,[F[23]||(F[23]=T("span",null,"Spine",-1)),T("select",{class:"inp",value:I(t).config.renderLayerSpineId,onChange:F[9]||(F[9]=(...N)=>I(O)&&I(O)(...N))},[T("option",Z5,ve(I(w).length?"请选择 Spine":"无可用 Spine"),1),(q(!0),J(_e,null,Et(I(w),N=>(q(),J("option",{key:N.id,value:N.id},ve(N.name),9,J5))),128))],40,K5)]),I(b)?(q(),J(_e,{key:0},[T("div",Q5,[T("span",{class:"render-layer-text",title:I(A)},ve(I(A)||"尚未选择插槽"),9,e8),T("button",{class:"mini-btn",onClick:F[10]||(F[10]=N=>S.value=!I(S))},ve(I(A)?"重新选择":"选择插槽"),1),I(t).config.renderLayerSlotName?(q(),J("button",{key:0,class:"mini-btn ghost",onClick:F[11]||(F[11]=(...N)=>I(Y)&&I(Y)(...N))},"清除")):xe("",!0)]),I(S)?(q(),J("div",t8,[ce(T("input",{"onUpdate:modelValue":F[12]||(F[12]=N=>jt(C)?C.value=N:null),class:"inp",type:"search",placeholder:"搜索插槽或附件名称…","aria-label":"搜索插槽"},null,512),[[He,I(C),void 0,{trim:!0}]]),T("div",i8,[(q(!0),J(_e,null,Et(I(_),N=>(q(),J("button",{key:N.name,class:Ce(["slot-item",{on:I(t).config.renderLayerSlotName===N.name}]),onClick:k=>I(U)(N)},[T("span",n8,ve(N.order+1),1),T("span",r8,ve(N.name),1),T("span",o8,ve(N.attachment||"空插槽"),1)],10,s8))),128)),I(_).length?xe("",!0):(q(),J("div",a8,"没有匹配的插槽"))])])):xe("",!0),I(t).config.renderLayerSlotName?(q(),J(_e,{key:1},[T("div",l8,[T("button",{class:Ce(["seg-btn",{active:I(t).config.renderLayerSlotPosition==="above"}]),onClick:F[13]||(F[13]=N=>I(t).config.renderLayerSlotPosition="above")},"在此插槽图片之上",2),T("button",{class:Ce(["seg-btn",{active:I(t).config.renderLayerSlotPosition==="below"}]),onClick:F[14]||(F[14]=N=>I(t).config.renderLayerSlotPosition="below")},"在此插槽图片之下",2)]),T("label",c8,[ce(T("input",{"onUpdate:modelValue":F[15]||(F[15]=N=>I(t).config.renderLayerFollowAttachment=N),type:"checkbox",disabled:I(t).config.renderLayerSlotPosition==="below"},null,8,h8),[[wt,I(t).config.renderLayerFollowAttachment]]),F[24]||(F[24]=T("span",{class:"switch-ui"},null,-1)),F[25]||(F[25]=T("span",null,"随插槽附件显隐",-1))]),I(P)?(q(),J("div",u8,ve(I(P)),1)):xe("",!0)],64)):xe("",!0),I(E)?(q(),J("div",d8,ve(I(E)),1)):xe("",!0),F[26]||(F[26]=T("div",{class:"modifier-hint"},"调整显示层级只影响编辑器预览,不影响导出数据。",-1))],64)):xe("",!0)],64)):xe("",!0),T("div",f8,[F[27]||(F[27]=T("span",null,"图片资源",-1)),T("button",{class:"image-add",title:"新增图片资源",onClick:F[16]||(F[16]=(...N)=>I(r)&&I(r)(...N))},"+")]),(q(!0),J(_e,null,Et(I(t).config.imageResources,N=>(q(),Ct(KS,{key:`${I(t).id}:${N.id}`,resource:N,"resource-count":I(t).config.imageResources.length,"pivot-key":`${I(t).id}:${N.id}`,"supports-sequence":"","default-file":"star.png",onPick:I(o),onPickSequence:I(a),onReset:I(h),onRemove:I(f),onUpdateWeight:I(m),onToggleLock:I(p)},{default:Zh(()=>[we(Oe,{label:"缩放",min:.1,max:3,step:.05,modelValue:N.scale,"onUpdate:modelValue":k=>N.scale=k},null,8,["modelValue","onUpdate:modelValue"]),F[35]||(F[35]=T("div",{class:"resource-divider"},null,-1)),T("label",m8,[F[30]||(F[30]=T("span",null,"颜色",-1)),ce(T("select",{"onUpdate:modelValue":k=>N.colorMode=k,class:"inp"},[...F[28]||(F[28]=[T("option",{value:"fixed"},"固定色",-1),T("option",{value:"random"},"随机颜色",-1),T("option",{value:"lifetime"},"生命周期",-1)])],8,p8),[[bt,N.colorMode]]),ce(T("select",{"onUpdate:modelValue":k=>N.blend=k,class:"inp blend-select"},[...F[29]||(F[29]=[T("option",{value:"normal"},"正常",-1),T("option",{value:"add"},"相加",-1),T("option",{value:"multiply"},"相乘",-1),T("option",{value:"screen"},"滤色",-1)])],8,g8),[[bt,N.blend]])]),N.colorMode==="fixed"?(q(),J("label",v8,[F[31]||(F[31]=T("span",null,"固定色",-1)),ce(T("input",{type:"color","onUpdate:modelValue":k=>N.colorStart=k,class:"colr"},null,8,y8),[[He,N.colorStart]]),T("input",{type:"text",class:"hex-input",value:N.colorStart,spellcheck:"false","aria-label":"固定颜色值",onChange:k=>I(u)(N,k),onKeydown:Mr(k=>I(d)(N,k),["enter"])},null,40,x8)])):(q(),J(_e,{key:1},[we(qS,{modelValue:N.colorGradient,"onUpdate:modelValue":k=>N.colorGradient=k},null,8,["modelValue","onUpdate:modelValue"]),N.colorMode==="random"?(q(),J("div",b8,"每个粒子出生时从色带随机取色,生命周期内保持不变")):xe("",!0)],64)),T("div",w8,[F[32]||(F[32]=T("span",null,"独立透明度",-1)),T("div",S8,[T("button",{class:Ce({on:N.independentAlpha==="off"}),onClick:k=>N.independentAlpha="off"},"关闭",10,M8),T("button",{class:Ce({on:N.independentAlpha==="fixed"}),onClick:k=>N.independentAlpha="fixed"},"固定",10,T8),T("button",{class:Ce({on:N.independentAlpha==="curve"}),onClick:k=>N.independentAlpha="curve"},"曲线",10,_8)])]),N.independentAlpha==="fixed"?(q(),Ct(Oe,{key:2,label:"透明度",min:0,max:1,step:.01,modelValue:N.alpha,"onUpdate:modelValue":k=>N.alpha=k},null,8,["modelValue","onUpdate:modelValue"])):N.independentAlpha==="curve"?(q(),J(_e,{key:3},[T("label",C8,[F[34]||(F[34]=T("span",null,"曲线模式",-1)),ce(T("select",{"onUpdate:modelValue":k=>N.alphaCurveMode=k,class:"inp"},[...F[33]||(F[33]=[T("option",null,"跟随导出",-1),T("option",null,"线性",-1),T("option",null,"贝塞尔",-1)])],8,E8),[[bt,N.alphaCurveMode]])]),T("div",A8,[we(tn,{modelValue:N.alphaCurve,"onUpdate:modelValue":k=>N.alphaCurve=k,"default-value":I(X),mode:I(e)(N.alphaCurveMode)},null,8,["modelValue","onUpdate:modelValue","default-value","mode"])])],64)):xe("",!0)]),_:2},1032,["resource","resource-count","pivot-key","onPick","onPickSequence","onReset","onRemove","onUpdateWeight","onToggleLock"]))),128)),T("input",{ref_key:"textureFileInput",ref:i,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:F[17]||(F[17]=(...N)=>I(c)&&I(c)(...N))},null,544),T("input",{ref_key:"sequenceFileInput",ref:n,class:"file-input",type:"file",multiple:"",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:F[18]||(F[18]=(...N)=>I(l)&&I(l)(...N))},null,544)],512),[[Si,!I(g).look]])]))}}),R8=Jt(I8,[["__scopeId","data-v-5709815f"]]),P8={class:"group"},k8={class:"caret"},F8={class:"group-body"},O8={class:"modifier-item damping-item"},L8={class:"modifier-item"},B8={class:"switch-row modifier-switch"},N8={key:0,class:"modifier-params"},D8={class:"modifier-item"},U8={class:"switch-row modifier-switch"},$8={key:0,class:"modifier-params gravity-params"},X8={class:"modifier-mode-row"},V8={class:"modifier-item"},Y8={class:"switch-row modifier-switch"},G8={key:0,class:"modifier-params gravity-params"},j8={class:"modifier-mode-row"},H8={class:"modifier-item"},W8={class:"switch-row modifier-switch"},z8={key:0,class:"modifier-params"},q8={class:"row"},K8={class:"switch-row"},Z8={class:"modifier-item"},J8={class:"switch-row modifier-switch"},Q8={key:0,class:"modifier-params"},eU={class:"row"},tU={class:"switch-row"},iU={class:"modifier-item"},sU={class:"switch-row modifier-switch"},nU={key:0,class:"modifier-params"},rU={class:"row"},oU={class:"row"},aU={class:"switch-row"},lU={class:"modifier-item"},cU={class:"switch-row modifier-switch"},hU={key:0,class:"modifier-params trail-params"},uU={class:"trail-section-head"},dU={class:"row"},fU=["onUpdate:modelValue"],mU={class:"row"},pU=["onUpdate:modelValue"],gU={class:"row"},vU=["onUpdate:modelValue"],yU={class:"switch-row trail-sub-switch"},xU=["onUpdate:modelValue"],bU={class:"switch-row trail-sub-switch"},wU=["onUpdate:modelValue"],SU={class:"trail-mode-head"},MU={class:"alpha-modes"},TU=["onClick"],_U=["onClick"],CU=["onClick"],EU={class:"row"},AU=["onUpdate:modelValue"],IU={key:6,class:"row trail-fixed-color"},RU=["onUpdate:modelValue"],PU=["value","onChange","onKeydown"],kU={class:"trail-mode-head"},FU={class:"alpha-modes"},OU=["onClick"],LU=["onClick"],BU=["onClick"],NU={class:"trail-grid-row"},DU={class:"modifier-item"},UU={class:"switch-row modifier-switch"},$U=["disabled"],XU={key:0,class:"modifier-params emitter-follow-params"},VU={class:"field-block"},YU=["value"],GU={key:0,value:"bone"},jU={class:"field-block"},HU=["value"],WU={class:"field-block"},zU={class:"field-grid follow-grid"},qU={class:"compact-field"},KU={class:"compact-field"},ZU={class:"field-block"},JU={key:0,class:"bone-follow-target"},QU={key:1,class:"bone-follow-missing"},e$={class:"field-block"},t$={class:"field-grid follow-grid"},i$={class:"compact-field"},s$={class:"compact-field"},n$={class:"bone-follow-transform-grid"},r$={class:"compact-field"},o$={class:"compact-field"},a$={class:"compact-field"},l$={class:"modifier-item"},c$={class:"switch-row modifier-switch"},h$={key:0,class:"modifier-params collision-filter-params"},u$={class:"collision-filter-tags"},d$=["title"],f$=["aria-label","onClick"],m$=["disabled","title"],p$={key:0,class:"collision-filter-empty"},g$={key:1,class:"collision-filter-picker"},v$=["onClick"],y$={class:"modifier-item events-item"},x$={class:"switch-row modifier-switch"},b$={key:0,class:"event-rules"},w$={class:"event-selects"},S$=["onUpdate:modelValue"],M$=["onUpdate:modelValue"],T$=["value"],_$=["onClick"],C$={class:"event-probability"},E$=["onUpdate:modelValue"],A$={key:0,class:"event-probability event-collision-limit"},I$=["value","onInput"],R$={class:"event-probability event-inherit"},P$=["onClick"],k$={class:"inherit-summary"},F$={key:1,class:"event-probability event-color-mode"},O$=["onUpdate:modelValue"],L$={class:"inherit-check"},B$={class:"inherit-check"},N$=["onClick"],D$={class:"inherit-check"},U$=Zt({__name:"ParticleModifiersSection",setup(s){const{store:e,sys:t,trailTextureFileInput:i,addTrailResource:n,openTrailTexturePicker:r,onTrailRigChange:o,onTrailResourceBoneCountChange:a,onTrailResourceRotationChange:c,onTrailTextureFile:l,resetTrailTexture:h,removeTrailResource:u,setTrailResourceWeight:d,toggleTrailResourceLock:f,setTrailColor:m,commitTrailColor:p,selectedSpineBone:g,boundSpineBone:x,collisionPickerOpen:v,selectedCollisionBodies:y,availableCollisionBodies:S,addCollisionBody:C,removeCollisionBody:w,collapsed:b,toggle:_,onEmitterFollowModeChange:A,bindSelectedBone:P,resetModule:E,select:R,LINEAR_CURVE:O,FLAT_CURVE:U,TRAIL_ALPHA_CURVE:Y,TRAIL_SHAPE_CURVE:$}=Fr(),X=Le(()=>{var L;const K=(L=t.value)==null?void 0:L.id;if(!K)return[];const B=k1(e.systems,K);return e.systems.filter(j=>j.id!==K&&!B.has(j.id))}),D=[{key:"color",label:"颜色"},{key:"scale",label:"大小"},{key:"rotation",label:"旋转"},{key:"life",label:"生命周期"}],F=Fe(null),N=Le(()=>{var L;const K=F.value,B=(L=t.value)==null?void 0:L.config.events;return!K||!Array.isArray(B)?null:B.find(j=>j.id===K.ruleId)||null});function k(K){return Array.isArray(K.inherit)||(K.inherit=[]),K.inherit}function V(K){const B=k(K);return B.length?B.length===D.length?"所有属性":D.filter(L=>B.includes(L.key)).map(L=>L.label).join("、"):"无(默认值)"}function G(K,B){return k(K).includes(B)}function W(K,B){const L=k(K),j=L.indexOf(B);j>=0?L.splice(j,1):L.push(B)}function Z(K){k(K).splice(0)}function ne(K){k(K).splice(0,k(K).length,...D.map(B=>B.key))}function oe(K,B){var Me;if(((Me=F.value)==null?void 0:Me.ruleId)===K.id){F.value=null;return}const L=B.currentTarget;if(!L)return;const j=L.getBoundingClientRect(),ie=Math.max(168,j.width),ue=212,fe=Math.min(Math.max(8,j.left),Math.max(8,window.innerWidth-ie-8));let ee=j.bottom+4;ee+ue>window.innerHeight-8&&(ee=Math.max(8,j.top-ue-4)),F.value={ruleId:K.id,left:fe,top:ee,width:ie}}function de(){F.value=null}function pe(){de()}function he(K){K.key==="Escape"&&de()}ys(()=>{document.addEventListener("pointerdown",de),window.addEventListener("scroll",pe,!0),window.addEventListener("resize",pe),window.addEventListener("keydown",he)}),Rr(()=>{document.removeEventListener("pointerdown",de),window.removeEventListener("scroll",pe,!0),window.removeEventListener("resize",pe),window.removeEventListener("keydown",he)});function me(){var L;const K=(L=t.value)==null?void 0:L.config;if(!K)return;Array.isArray(K.events)||(K.events=[]);const B=Math.max(0,...K.events.map(j=>j.id))+1;K.events.push({id:B,event:"birth",targetSystemId:0,probability:1,collisionLimit:1,inherit:[],colorInheritMode:"add"})}function H(K){var B;(B=t.value)==null||B.config.events.splice(K,1)}function z(K,B){const L=B.target,j=Math.round(Number(L.value));K.collisionLimit=Math.min(4,Math.max(1,Number.isFinite(j)?j:1)),L.value=String(K.collisionLimit)}return(K,B)=>(q(),J(_e,null,[T("div",P8,[T("div",{class:"group-head",onClick:B[1]||(B[1]=L=>I(_)("mods"))},[T("span",k8,ve(I(b).mods?"▸":"▾"),1),B[74]||(B[74]=T("span",null,"修改器",-1)),T("button",{class:"group-reset",title:"重置修改器参数",onClick:B[0]||(B[0]=qe(L=>I(E)("mods"),["stop"]))},"重置")]),ce(T("div",F8,[T("div",O8,[we(Oe,{label:"阻尼",min:0,max:2,step:.05,modelValue:I(t).config.damping,"onUpdate:modelValue":B[2]||(B[2]=L=>I(t).config.damping=L)},null,8,["modelValue"])]),T("div",L8,[T("label",B8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":B[3]||(B[3]=L=>I(t).config.noise=L)},null,512),[[wt,I(t).config.noise]]),B[75]||(B[75]=T("span",{class:"switch-ui"},null,-1)),B[76]||(B[76]=T("span",null,"开启移动噪声",-1))]),I(t).config.noise?(q(),J("div",N8,[we(Oe,{label:"强度",min:0,max:100,step:1,modelValue:I(t).config.noiseAmt,"onUpdate:modelValue":B[4]||(B[4]=L=>I(t).config.noiseAmt=L)},null,8,["modelValue"]),we(Oe,{label:"波动范围",min:0,max:500,step:1,modelValue:I(t).config.noiseRange,"onUpdate:modelValue":B[5]||(B[5]=L=>I(t).config.noiseRange=L)},null,8,["modelValue"]),we(Oe,{label:"时间流速",min:0,max:10,step:.1,modelValue:I(t).config.noiseSpeed,"onUpdate:modelValue":B[6]||(B[6]=L=>I(t).config.noiseSpeed=L)},null,8,["modelValue"]),B[77]||(B[77]=T("div",{class:"modifier-hint"},"强度控制影响比例 · 波动范围控制最大偏移 · 时间流速控制变化速度",-1))])):xe("",!0)]),T("div",D8,[T("label",U8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":B[7]||(B[7]=L=>I(t).config.useGravity=L)},null,512),[[wt,I(t).config.useGravity]]),B[78]||(B[78]=T("span",{class:"switch-ui"},null,-1)),B[79]||(B[79]=T("span",null,"开启重力",-1))]),I(t).config.useGravity?(q(),J("div",$8,[T("div",X8,[T("button",{class:Ce(["axis-mode",{on:I(t).config.gravityMode==="fixed"}]),onClick:B[8]||(B[8]=L=>I(t).config.gravityMode="fixed")},"固定",2),T("button",{class:Ce(["axis-mode",{on:I(t).config.gravityMode==="random"}]),onClick:B[9]||(B[9]=L=>I(t).config.gravityMode="random")},"随机",2)]),I(t).config.gravityMode==="fixed"?(q(),Ct(Oe,{key:0,label:"重力强度",min:-3e3,max:3e3,step:10,modelValue:I(t).config.gravityMin,"onUpdate:modelValue":B[10]||(B[10]=L=>I(t).config.gravityMin=L)},null,8,["modelValue"])):(q(),J(_e,{key:1},[we(Oe,{label:"强度 min",min:-3e3,max:3e3,step:10,modelValue:I(t).config.gravityMin,"onUpdate:modelValue":B[11]||(B[11]=L=>I(t).config.gravityMin=L)},null,8,["modelValue"]),we(Oe,{label:"强度 max",min:-3e3,max:3e3,step:10,modelValue:I(t).config.gravityMax,"onUpdate:modelValue":B[12]||(B[12]=L=>I(t).config.gravityMax=L)},null,8,["modelValue"])],64)),we(Oe,{label:"方向",min:-360,max:360,step:1,modelValue:I(t).config.gravityDirection,"onUpdate:modelValue":B[13]||(B[13]=L=>I(t).config.gravityDirection=L)},null,8,["modelValue"]),B[80]||(B[80]=T("div",{class:"gravity-curve-title"},[T("span",null,"生命周期内重力"),T("span",null,"纵轴:强度 0~1")],-1)),we(tn,{modelValue:I(t).config.gravityCurve,"onUpdate:modelValue":B[14]||(B[14]=L=>I(t).config.gravityCurve=L),"default-value":I(U)},null,8,["modelValue","default-value"]),B[81]||(B[81]=T("div",{class:"gravity-curve-axis"},[T("span",null,"0"),T("span",null,"生命周期 →"),T("span",null,"1")],-1)),B[82]||(B[82]=T("div",{class:"modifier-hint"},"0° 向右 · -90° 向下 · 负强度会反转方向",-1))])):xe("",!0)]),T("div",V8,[T("label",Y8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":B[15]||(B[15]=L=>I(t).config.wind=L)},null,512),[[wt,I(t).config.wind]]),B[83]||(B[83]=T("span",{class:"switch-ui"},null,-1)),B[84]||(B[84]=T("span",null,"开启风力",-1))]),I(t).config.wind?(q(),J("div",G8,[T("div",j8,[T("button",{class:Ce(["axis-mode",{on:I(t).config.windMode==="fixed"}]),onClick:B[16]||(B[16]=L=>I(t).config.windMode="fixed")},"固定",2),T("button",{class:Ce(["axis-mode",{on:I(t).config.windMode==="random"}]),onClick:B[17]||(B[17]=L=>I(t).config.windMode="random")},"随机",2)]),I(t).config.windMode==="fixed"?(q(),Ct(Oe,{key:0,label:"风力强度",min:-3e3,max:3e3,step:10,modelValue:I(t).config.windMin,"onUpdate:modelValue":B[18]||(B[18]=L=>I(t).config.windMin=L)},null,8,["modelValue"])):(q(),J(_e,{key:1},[we(Oe,{label:"强度 min",min:-3e3,max:3e3,step:10,modelValue:I(t).config.windMin,"onUpdate:modelValue":B[19]||(B[19]=L=>I(t).config.windMin=L)},null,8,["modelValue"]),we(Oe,{label:"强度 max",min:-3e3,max:3e3,step:10,modelValue:I(t).config.windMax,"onUpdate:modelValue":B[20]||(B[20]=L=>I(t).config.windMax=L)},null,8,["modelValue"])],64)),we(Oe,{label:"方向",min:-360,max:360,step:1,modelValue:I(t).config.windDirection,"onUpdate:modelValue":B[21]||(B[21]=L=>I(t).config.windDirection=L)},null,8,["modelValue"]),B[85]||(B[85]=T("div",{class:"gravity-curve-title"},[T("span",null,"生命周期内风力"),T("span",null,"纵轴:强度 0~1")],-1)),we(tn,{modelValue:I(t).config.windCurve,"onUpdate:modelValue":B[22]||(B[22]=L=>I(t).config.windCurve=L),"default-value":I(U)},null,8,["modelValue","default-value"]),B[86]||(B[86]=T("div",{class:"gravity-curve-axis"},[T("span",null,"0"),T("span",null,"生命周期 →"),T("span",null,"1")],-1)),B[87]||(B[87]=T("div",{class:"modifier-hint"},"0° 向右 · -90° 向下 · 负强度会反转方向",-1))])):xe("",!0)]),T("div",H8,[T("label",W8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":B[23]||(B[23]=L=>I(t).config.forceField=L)},null,512),[[wt,I(t).config.forceField]]),B[88]||(B[88]=T("span",{class:"switch-ui"},null,-1)),B[89]||(B[89]=T("span",null,"开启力场",-1))]),I(t).config.forceField?(q(),J("div",z8,[we(Oe,{label:"中心 X",min:-5e3,max:5e3,step:1,modelValue:I(t).config.forceCenterX,"onUpdate:modelValue":B[24]||(B[24]=L=>I(t).config.forceCenterX=L)},null,8,["modelValue"]),we(Oe,{label:"中心 Y",min:-5e3,max:5e3,step:1,modelValue:I(t).config.forceCenterY,"onUpdate:modelValue":B[25]||(B[25]=L=>I(t).config.forceCenterY=L)},null,8,["modelValue"]),we(Oe,{label:"力场强度",min:-300,max:300,step:1,modelValue:I(t).config.forceStrength,"onUpdate:modelValue":B[26]||(B[26]=L=>I(t).config.forceStrength=L)},null,8,["modelValue"]),we(Oe,{label:"力场半径",min:1,max:2e3,step:1,modelValue:I(t).config.forceRadius,"onUpdate:modelValue":B[27]||(B[27]=L=>I(t).config.forceRadius=L)},null,8,["modelValue"]),T("label",q8,[B[91]||(B[91]=T("span",null,"衰减模式",-1)),ce(T("select",{"onUpdate:modelValue":B[28]||(B[28]=L=>I(t).config.forceFalloff=L),class:"inp"},[...B[90]||(B[90]=[T("option",{value:"constant"},"恒定(范围内力度不变)",-1),T("option",{value:"linear"},"线性衰减(边缘为 0)",-1),T("option",{value:"inverse"},"距离反比(中心最强)",-1)])],512),[[bt,I(t).config.forceFalloff]])]),B[94]||(B[94]=T("div",{class:"modifier-hint"},"正数吸向中心 · 负数向外排斥 · 可在画布内拖动力场圆",-1)),T("label",K8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":B[29]||(B[29]=L=>I(t).config.showForceFieldShape=L)},null,512),[[wt,I(t).config.showForceFieldShape]]),B[92]||(B[92]=T("span",{class:"switch-ui"},null,-1)),B[93]||(B[93]=T("span",null,"显示形状",-1))])])):xe("",!0)]),T("div",Z8,[T("label",J8,[ce(T("input",{type:"checkbox","onUpdate:modelValue":B[30]||(B[30]=L=>I(t).config.vortex=L)},null,512),[[wt,I(t).config.vortex]]),B[95]||(B[95]=T("span",{class:"switch-ui"},null,-1)),B[96]||(B[96]=T("span",null,"开启漩涡",-1))]),I(t).config.vortex?(q(),J("div",Q8,[we(Oe,{label:"中心 X",min:-5e3,max:5e3,step:1,modelValue:I(t).config.vortexCenterX,"onUpdate:modelValue":B[31]||(B[31]=L=>I(t).config.vortexCenterX=L)},null,8,["modelValue"]),we(Oe,{label:"中心 Y",min:-5e3,max:5e3,step:1,modelValue:I(t).config.vortexCenterY,"onUpdate:modelValue":B[32]||(B[32]=L=>I(t).config.vortexCenterY=L)},null,8,["modelValue"]),we(Oe,{label:"力场强度",min:-300,max:300,step:1,modelValue:I(t).config.vortexStrength,"onUpdate:modelValue":B[33]||(B[33]=L=>I(t).config.vortexStrength=L)},null,8,["modelValue"]),we(Oe,{label:"力场半径",min:1,max:2e3,step:1,modelValue:I(t).config.vortexRadius,"onUpdate:modelValue":B[34]||(B[34]=L=>I(t).config.vortexRadius=L)},null,8,["modelValue"]),T("label",eU,[B[98]||(B[98]=T("span",null,"衰减模式",-1)),ce(T("select",{"onUpdate:modelValue":B[35]||(B[35]=L=>I(t).config.vortexFalloff=L),class:"inp"},[...B[97]||(B[97]=[T("option",{value:"constant"},"恒定(范围内力度不变)",-1),T("option",{value:"linear"},"线性衰减(边缘为 0)",-1),T("option",{value:"inverse"},"距离反比(中心最强)",-1)])],512),[[bt,I(t).config.vortexFalloff]])]),B[101]||(B[101]=T("div",{class:"modifier-hint"},"正数逆时针 · 负数顺时针",-1)),T("label",tU,[ce(T("input",{type:"checkbox","onUpdate:modelValue":B[36]||(B[36]=L=>I(t).config.showVortexShape=L)},null,512),[[wt,I(t).config.showVortexShape]]),B[99]||(B[99]=T("span",{class:"switch-ui"},null,-1)),B[100]||(B[100]=T("span",null,"显示形状",-1))])])):xe("",!0)]),T("div",iU,[T("label",sU,[ce(T("input",{type:"checkbox","onUpdate:modelValue":B[37]||(B[37]=L=>I(t).config.attraction=L)},null,512),[[wt,I(t).config.attraction]]),B[102]||(B[102]=T("span",{class:"switch-ui"},null,-1)),B[103]||(B[103]=T("span",null,"开启吸附",-1))]),I(t).config.attraction?(q(),J("div",nU,[we(Oe,{label:"吸附点 X",min:-5e3,max:5e3,step:1,modelValue:I(t).config.attractionCenterX,"onUpdate:modelValue":B[38]||(B[38]=L=>I(t).config.attractionCenterX=L)},null,8,["modelValue"]),we(Oe,{label:"吸附点 Y",min:-5e3,max:5e3,step:1,modelValue:I(t).config.attractionCenterY,"onUpdate:modelValue":B[39]||(B[39]=L=>I(t).config.attractionCenterY=L)},null,8,["modelValue"]),we(Oe,{label:"吸附半径",min:0,max:2e3,step:1,modelValue:I(t).config.attractionRadius,"onUpdate:modelValue":B[40]||(B[40]=L=>I(t).config.attractionRadius=L)},null,8,["modelValue"]),we(Oe,{label:"吸附时长",min:.05,max:30,step:.05,modelValue:I(t).config.attractionDuration,"onUpdate:modelValue":B[41]||(B[41]=L=>I(t).config.attractionDuration=L)},null,8,["modelValue"]),we(Oe,{label:"延迟时间",min:0,max:30,step:.05,modelValue:I(t).config.attractionDelay,"onUpdate:modelValue":B[42]||(B[42]=L=>I(t).config.attractionDelay=L)},null,8,["modelValue"]),T("label",rU,[B[105]||(B[105]=T("span",null,"延迟方式",-1)),ce(T("select",{"onUpdate:modelValue":B[43]||(B[43]=L=>I(t).config.attractionDelayMode=L),class:"inp"},[...B[104]||(B[104]=[T("option",{value:"global"},"统一时间",-1),T("option",{value:"particle"},"单粒子生命",-1)])],512),[[bt,I(t).config.attractionDelayMode]])]),T("label",oU,[B[107]||(B[107]=T("span",null,"吸附方式",-1)),ce(T("select",{"onUpdate:modelValue":B[44]||(B[44]=L=>I(t).config.attractionPath=L),class:"inp"},[...B[106]||(B[106]=[T("option",{value:"linear"},"直线",-1),T("option",{value:"curve"},"曲线",-1)])],512),[[bt,I(t).config.attractionPath]])]),B[110]||(B[110]=T("div",{class:"modifier-hint"},"延迟后从当前位置开始吸附 · 到达红色范围即死亡 · 可在画布内拖动吸附圆",-1)),T("label",aU,[ce(T("input",{type:"checkbox","onUpdate:modelValue":B[45]||(B[45]=L=>I(t).config.showAttractionShape=L)},null,512),[[wt,I(t).config.showAttractionShape]]),B[108]||(B[108]=T("span",{class:"switch-ui"},null,-1)),B[109]||(B[109]=T("span",null,"显示形状",-1))])])):xe("",!0)]),T("div",lU,[T("label",cU,[ce(T("input",{type:"checkbox","onUpdate:modelValue":B[46]||(B[46]=L=>I(t).config.trail=L)},null,512),[[wt,I(t).config.trail]]),B[111]||(B[111]=T("span",{class:"switch-ui"},null,-1)),B[112]||(B[112]=T("span",null,"开启拖尾",-1))]),I(t).config.trail?(q(),J("div",hU,[T("div",uU,[B[113]||(B[113]=T("div",{class:"trail-section-title"},"拖尾独立图片",-1)),T("button",{class:"image-add",title:"增加拖尾图片资源",onClick:B[47]||(B[47]=(...L)=>I(n)&&I(n)(...L))},"+")]),(q(!0),J(_e,null,Et(I(t).config.trailResources,L=>(q(),Ct(KS,{key:L.id,resource:L,"resource-count":I(t).config.trailResources.length,"default-file":"trail.png","name-placeholder":"trail","show-folder":!1,onPick:I(r),onReset:I(h),onRemove:I(u),onUpdateWeight:I(d),onToggleLock:I(f)},{default:Zh(()=>[B[129]||(B[129]=T("div",{class:"resource-divider"},null,-1)),we(Oe,{label:"旋转",min:-360,max:360,step:1,"model-value":L.rotation,"onUpdate:modelValue":j=>I(c)(L.id,j)},null,8,["model-value","onUpdate:modelValue"]),we(Oe,{label:"拖尾骨骼数",min:2,max:16,step:1,"model-value":L.boneCount,"onUpdate:modelValue":j=>I(a)(L.id,j)},null,8,["model-value","onUpdate:modelValue"]),we(Oe,{label:"拖尾比例 (%)",min:0,max:100,step:1,modelValue:L.trailRatio,"onUpdate:modelValue":j=>L.trailRatio=j},null,8,["modelValue","onUpdate:modelValue"]),T("label",dU,[B[115]||(B[115]=T("span",null,"拖尾长度",-1)),ce(T("select",{"onUpdate:modelValue":j=>L.lengthMode=j,class:"inp"},[...B[114]||(B[114]=[T("option",{value:"fixed"},"固定",-1),T("option",{value:"random"},"随机范围",-1)])],8,fU),[[bt,L.lengthMode]])]),L.lengthMode==="fixed"?(q(),Ct(Oe,{key:0,label:"长度比例 (%)",min:0,max:500,step:1,modelValue:L.length,"onUpdate:modelValue":j=>L.length=j},null,8,["modelValue","onUpdate:modelValue"])):(q(),J(_e,{key:1},[we(Oe,{label:"长度最小 (%)",min:0,max:500,step:1,modelValue:L.lengthMin,"onUpdate:modelValue":j=>L.lengthMin=j},null,8,["modelValue","onUpdate:modelValue"]),we(Oe,{label:"长度最大 (%)",min:0,max:500,step:1,modelValue:L.lengthMax,"onUpdate:modelValue":j=>L.lengthMax=j},null,8,["modelValue","onUpdate:modelValue"])],64)),T("label",mU,[B[117]||(B[117]=T("span",null,"拖尾宽度",-1)),ce(T("select",{"onUpdate:modelValue":j=>L.widthSizeMode=j,class:"inp"},[...B[116]||(B[116]=[T("option",{value:"fixed"},"固定",-1),T("option",{value:"random"},"随机范围",-1)])],8,pU),[[bt,L.widthSizeMode]])]),L.widthSizeMode==="fixed"?(q(),Ct(Oe,{key:2,label:"宽度比例 (%)",min:0,max:500,step:1,modelValue:L.width,"onUpdate:modelValue":j=>L.width=j},null,8,["modelValue","onUpdate:modelValue"])):(q(),J(_e,{key:3},[we(Oe,{label:"宽度最小 (%)",min:0,max:500,step:1,modelValue:L.widthMin,"onUpdate:modelValue":j=>L.widthMin=j},null,8,["modelValue","onUpdate:modelValue"]),we(Oe,{label:"宽度最大 (%)",min:0,max:500,step:1,modelValue:L.widthMax,"onUpdate:modelValue":j=>L.widthMax=j},null,8,["modelValue","onUpdate:modelValue"])],64)),T("label",gU,[B[119]||(B[119]=T("span",null,"宽度缩放",-1)),ce(T("select",{"onUpdate:modelValue":j=>L.widthMode=j,class:"inp"},[...B[118]||(B[118]=[T("option",{value:"particle"},"跟随粒子",-1),T("option",{value:"fixed"},"固定",-1)])],8,vU),[[bt,L.widthMode]])]),T("label",yU,[ce(T("input",{type:"checkbox","onUpdate:modelValue":j=>L.lifeLengthEnabled=j},null,8,xU),[[wt,L.lifeLengthEnabled]]),B[120]||(B[120]=T("span",{class:"switch-ui"},null,-1)),B[121]||(B[121]=T("span",null,"生命周期长度曲线",-1))]),L.lifeLengthEnabled?(q(),Ct(tn,{key:4,modelValue:L.lifeLengthCurve,"onUpdate:modelValue":j=>L.lifeLengthCurve=j,"default-value":I(U)},null,8,["modelValue","onUpdate:modelValue","default-value"])):xe("",!0),T("label",bU,[ce(T("input",{type:"checkbox","onUpdate:modelValue":j=>L.shapeEnabled=j},null,8,wU),[[wt,L.shapeEnabled]]),B[122]||(B[122]=T("span",{class:"switch-ui"},null,-1)),B[123]||(B[123]=T("span",null,"形状曲线(首端 → 尾端宽度)",-1))]),L.shapeEnabled?(q(),Ct(tn,{key:5,modelValue:L.shapeCurve,"onUpdate:modelValue":j=>L.shapeCurve=j,"default-value":I($)},null,8,["modelValue","onUpdate:modelValue","default-value"])):xe("",!0),T("div",SU,[B[124]||(B[124]=T("span",null,"颜色模式",-1)),T("div",MU,[T("button",{class:Ce(["axis-mode",{on:L.colorMode==="particle"}]),onClick:j=>L.colorMode="particle"},"跟随粒子",10,TU),T("button",{class:Ce(["axis-mode",{on:L.colorMode==="fixed"}]),onClick:j=>L.colorMode="fixed"},"固定",10,_U),T("button",{class:Ce(["axis-mode",{on:L.colorMode==="curve"}]),onClick:j=>L.colorMode="curve"},"曲线",10,CU)])]),T("label",EU,[B[126]||(B[126]=T("span",null,"混合模式",-1)),ce(T("select",{"onUpdate:modelValue":j=>L.blend=j,class:"inp"},[...B[125]||(B[125]=[T("option",{value:"normal"},"正常",-1),T("option",{value:"add"},"相加",-1),T("option",{value:"multiply"},"相乘",-1),T("option",{value:"screen"},"滤色",-1)])],8,AU),[[bt,L.blend]])]),L.colorMode==="fixed"?(q(),J("label",IU,[B[127]||(B[127]=T("span",null,"固定颜色",-1)),ce(T("input",{class:"colr",type:"color","onUpdate:modelValue":j=>L.color=j},null,8,RU),[[He,L.color]]),T("input",{class:"hex-input",value:L.color,onChange:j=>I(m)(L,j),onKeydown:Mr(qe(j=>I(p)(L,j),["prevent"]),["enter"])},null,40,PU)])):L.colorMode==="curve"?(q(),Ct(qS,{key:7,modelValue:L.colorGradient,"onUpdate:modelValue":j=>L.colorGradient=j},null,8,["modelValue","onUpdate:modelValue"])):xe("",!0),T("div",kU,[B[128]||(B[128]=T("span",null,"透明度模式",-1)),T("div",FU,[T("button",{class:Ce(["axis-mode",{on:L.alphaMode==="particle"}]),onClick:j=>L.alphaMode="particle"},"跟随粒子",10,OU),T("button",{class:Ce(["axis-mode",{on:L.alphaMode==="fixed"}]),onClick:j=>L.alphaMode="fixed"},"固定",10,LU),T("button",{class:Ce(["axis-mode",{on:L.alphaMode==="curve"}]),onClick:j=>L.alphaMode="curve"},"曲线",10,BU)])]),L.alphaMode==="fixed"?(q(),Ct(Oe,{key:8,label:"透明度",min:0,max:1,step:.01,modelValue:L.alpha,"onUpdate:modelValue":j=>L.alpha=j},null,8,["modelValue","onUpdate:modelValue"])):xe("",!0),L.alphaMode==="curve"?(q(),Ct(tn,{key:9,modelValue:L.alphaCurve,"onUpdate:modelValue":j=>L.alphaCurve=j,"default-value":I(Y)},null,8,["modelValue","onUpdate:modelValue","default-value"])):xe("",!0)]),_:2},1032,["resource","resource-count","onPick","onReset","onRemove","onUpdateWeight","onToggleLock"]))),128)),T("input",{ref_key:"trailTextureFileInput",ref:i,class:"file-input",type:"file",accept:"image/png,image/jpeg,image/webp",onChange:B[48]||(B[48]=(...L)=>I(l)&&I(l)(...L))},null,544),T("div",NU,[we(Oe,{label:"网格行数",min:2,max:16,step:1,"model-value":I(t).config.trailGridRows,"onUpdate:modelValue":B[49]||(B[49]=L=>I(o)("trailGridRows",L))},null,8,["model-value"]),we(Oe,{label:"网格列数",min:2,max:32,step:1,"model-value":I(t).config.trailGridCols,"onUpdate:modelValue":B[50]||(B[50]=L=>I(o)("trailGridCols",L))},null,8,["model-value"])]),B[130]||(B[130]=T("div",{class:"modifier-hint"},"每个粒子按资源比例生成一组同级拖尾骨骼;随机长度与宽度在粒子出生时确定,相同种子可稳定复现",-1))])):xe("",!0)]),T("div",DU,[T("label",UU,[ce(T("input",{type:"checkbox","onUpdate:modelValue":B[51]||(B[51]=L=>I(t).config.emitterFollow=L),disabled:I(t).config.streamBehavior==="loop"},null,8,$U),[[wt,I(t).config.emitterFollow]]),B[131]||(B[131]=T("span",{class:"switch-ui"},null,-1)),B[132]||(B[132]=T("span",null,"开启发射器跟随",-1))]),I(t).config.emitterFollow&&I(t).config.streamBehavior!=="loop"?(q(),J("div",XU,[T("label",VU,[B[135]||(B[135]=T("span",null,"跟随模式",-1)),T("select",{value:I(t).config.emitterFollowMode,class:"inp",onChange:B[52]||(B[52]=L=>I(A)(L,I(t).config))},[B[133]||(B[133]=T("option",{value:"none"},"无",-1)),B[134]||(B[134]=T("option",{value:"path"},"跟随路径",-1)),I(g)||I(t).config.emitterFollowMode==="bone"?(q(),J("option",GU,"选中的骨骼")):xe("",!0)],40,YU)]),I(t).config.emitterFollowMode==="path"?(q(),J(_e,{key:0},[T("label",jU,[B[137]||(B[137]=T("span",null,"跟随路径",-1)),ce(T("select",{"onUpdate:modelValue":B[53]||(B[53]=L=>I(t).config.emitterFollowPathId=L),class:"inp"},[B[136]||(B[136]=T("option",{value:0},"无",-1)),(q(!0),J(_e,null,Et(I(e).paths,L=>(q(),J("option",{key:L.id,value:L.id},ve(L.name),9,HU))),128))],512),[[bt,I(t).config.emitterFollowPathId,void 0,{number:!0}]])]),T("label",WU,[B[139]||(B[139]=T("span",null,"发射器角度模式",-1)),ce(T("select",{"onUpdate:modelValue":B[54]||(B[54]=L=>I(t).config.emitterAngleMode=L),class:"inp"},[...B[138]||(B[138]=[T("option",{value:"fixed"},"固定角度",-1),T("option",{value:"direction"},"跟随移动方向",-1)])],512),[[bt,I(t).config.emitterAngleMode]])]),B[145]||(B[145]=T("div",{class:"gravity-curve-title"},[T("span",null,"移动进度曲线 (0→1)")],-1)),we(tn,{modelValue:I(t).config.emitterFollowCurve,"onUpdate:modelValue":B[55]||(B[55]=L=>I(t).config.emitterFollowCurve=L),"default-value":I(O)},null,8,["modelValue","default-value"]),T("div",zU,[T("label",qU,[B[140]||(B[140]=T("span",null,"移动时长 (s)",-1)),ce(T("input",{"onUpdate:modelValue":B[56]||(B[56]=L=>I(t).config.emitterFollowDuration=L),type:"number",min:"0.05",step:"0.05",class:"inp"},null,512),[[He,I(t).config.emitterFollowDuration,void 0,{number:!0}]])]),T("label",KU,[B[142]||(B[142]=T("span",null,"跟随空间",-1)),ce(T("select",{"onUpdate:modelValue":B[57]||(B[57]=L=>I(t).config.emitterFollowSpace=L),class:"inp"},[...B[141]||(B[141]=[T("option",{value:"local"},"局部空间(GEN 移动)",-1),T("option",{value:"world"},"世界空间(粒子生成点移动)",-1)])],512),[[bt,I(t).config.emitterFollowSpace]])])]),T("label",ZU,[B[144]||(B[144]=T("span",null,"移动方向",-1)),ce(T("select",{"onUpdate:modelValue":B[58]||(B[58]=L=>I(t).config.emitterFollowDirection=L),class:"inp"},[...B[143]||(B[143]=[T("option",{value:"forward"},"正向(起点 → 终点)",-1),T("option",{value:"reverse"},"反向(终点 → 起点)",-1)])],512),[[bt,I(t).config.emitterFollowDirection]])]),we(Oe,{label:"偏移起始点 (0-1)",min:0,max:1,step:.01,modelValue:I(t).config.emitterFollowOffset,"onUpdate:modelValue":B[59]||(B[59]=L=>I(t).config.emitterFollowOffset=L)},null,8,["modelValue"]),B[146]||(B[146]=T("div",{class:"modifier-hint"},"局部空间会移动整个发射器;世界空间只移动新粒子的生成点,已出生粒子留在世界位置。",-1))],64)):I(t).config.emitterFollowMode==="bone"?(q(),J(_e,{key:1},[I(x)?(q(),J("div",JU,[B[147]||(B[147]=ft("跟随目标:",-1)),T("strong",null,ve(I(x).spine.name)+" / "+ve(I(x).boneName),1)])):(q(),J("div",QU,"尚未绑定有效骨骼,请先在 Spine 层级树中选择骨骼。")),I(g)&&(!I(x)||I(g).spine.id!==I(x).spine.id||I(g).boneName!==I(x).boneName)?(q(),J("button",{key:2,class:"bone-follow-rebind",onClick:B[60]||(B[60]=L=>I(P)(I(t).config))},ve(I(x)?"重新绑定":"绑定")+"当前选中骨骼:"+ve(I(g).spine.name)+" / "+ve(I(g).boneName),1)):xe("",!0),I(x)?(q(),J(_e,{key:3},[T("label",e$,[B[149]||(B[149]=T("span",null,"跟随空间",-1)),ce(T("select",{"onUpdate:modelValue":B[61]||(B[61]=L=>I(t).config.emitterFollowSpace=L),class:"inp"},[...B[148]||(B[148]=[T("option",{value:"local"},"本地空间(随骨骼移动)",-1),T("option",{value:"world"},"世界空间(粒子生成后保持位置)",-1)])],512),[[bt,I(t).config.emitterFollowSpace]])]),T("div",t$,[T("label",i$,[B[150]||(B[150]=T("span",null,"位移偏移 X",-1)),ce(T("input",{"onUpdate:modelValue":B[62]||(B[62]=L=>I(t).config.emitterFollowBoneOffsetX=L),type:"number",step:"1",class:"inp"},null,512),[[He,I(t).config.emitterFollowBoneOffsetX,void 0,{number:!0}]])]),T("label",s$,[B[151]||(B[151]=T("span",null,"位移偏移 Y",-1)),ce(T("input",{"onUpdate:modelValue":B[63]||(B[63]=L=>I(t).config.emitterFollowBoneOffsetY=L),type:"number",step:"1",class:"inp"},null,512),[[He,I(t).config.emitterFollowBoneOffsetY,void 0,{number:!0}]])])]),T("div",n$,[T("label",r$,[B[152]||(B[152]=T("span",null,"旋转偏移",-1)),ce(T("input",{"onUpdate:modelValue":B[64]||(B[64]=L=>I(t).config.emitterFollowBoneRotation=L),type:"number",step:"1",class:"inp"},null,512),[[He,I(t).config.emitterFollowBoneRotation,void 0,{number:!0}]])]),T("label",o$,[B[153]||(B[153]=T("span",null,"缩放偏移 X",-1)),ce(T("input",{"onUpdate:modelValue":B[65]||(B[65]=L=>I(t).config.emitterFollowBoneScaleX=L),type:"number",step:"0.05",class:"inp"},null,512),[[He,I(t).config.emitterFollowBoneScaleX,void 0,{number:!0}]])]),T("label",a$,[B[154]||(B[154]=T("span",null,"缩放偏移 Y",-1)),ce(T("input",{"onUpdate:modelValue":B[66]||(B[66]=L=>I(t).config.emitterFollowBoneScaleY=L),type:"number",step:"0.05",class:"inp"},null,512),[[He,I(t).config.emitterFollowBoneScaleY,void 0,{number:!0}]])])]),B[155]||(B[155]=T("div",{class:"modifier-hint"},"发射器只跟随所选 Spine 骨骼的位置,不继承 Spine 的旋转或缩放;粒子变换使用粒子系统自身参数和上方偏移。",-1))],64)):xe("",!0)],64)):xe("",!0)])):xe("",!0)]),T("div",l$,[T("label",c$,[ce(T("input",{type:"checkbox","onUpdate:modelValue":B[67]||(B[67]=L=>I(t).config.collision=L)},null,512),[[wt,I(t).config.collision]]),B[156]||(B[156]=T("span",{class:"switch-ui"},null,-1)),B[157]||(B[157]=T("span",null,"开启碰撞",-1))]),I(t).config.collision?(q(),J("div",h$,[B[158]||(B[158]=T("div",{class:"collision-filter-title"},"参与的碰撞对象",-1)),T("div",u$,[(q(!0),J(_e,null,Et(I(y),L=>(q(),J("span",{key:L.id,class:Ce(["collision-filter-tag",{disabled:!L.enabled}]),title:L.enabled?L.name:`${L.name}(碰撞体已禁用)`},[T("span",null,ve(L.name),1),T("button",{type:"button","aria-label":`清除碰撞对象 ${L.name}`,onClick:j=>I(w)(L.id)},"×",8,f$)],10,d$))),128)),T("button",{type:"button",class:Ce(["collision-filter-add",{active:I(v)}]),disabled:I(S).length===0,title:I(S).length?"加入场景碰撞对象":"没有可加入的碰撞对象",onClick:B[68]||(B[68]=L=>v.value=!I(v))},"+",10,m$)]),I(y).length===0?(q(),J("div",p$,"未选择碰撞对象,当前粒子不会发生碰撞")):xe("",!0),I(v)&&I(S).length?(q(),J("div",g$,[(q(!0),J(_e,null,Et(I(S),L=>(q(),J("button",{key:L.id,type:"button",onClick:j=>I(C)(L.id)},[T("span",null,ve(L.name),1),T("small",null,ve(L.enabled?"可用":"已禁用"),1)],8,v$))),128))])):xe("",!0),B[159]||(B[159]=T("div",{class:"modifier-hint"},"只有已加入且启用的场景碰撞对象会参与当前粒子系统的碰撞",-1))])):xe("",!0)]),T("div",y$,[T("label",x$,[ce(T("input",{"onUpdate:modelValue":B[69]||(B[69]=L=>I(t).config.eventEnabled=L),type:"checkbox"},null,512),[[wt,I(t).config.eventEnabled]]),B[160]||(B[160]=T("span",{class:"switch-ui"},null,-1)),B[161]||(B[161]=T("span",null,"开启子发射器",-1))]),I(t).config.eventEnabled?(q(),J("div",b$,[(q(!0),J(_e,null,Et(I(t).config.events,(L,j)=>(q(),J("div",{key:L.id,class:"event-card"},[T("div",w$,[ce(T("select",{"onUpdate:modelValue":ie=>L.event=ie,class:"inp event-select",title:"选择触发时机"},[...B[162]||(B[162]=[T("option",{value:"birth"},"出生",-1),T("option",{value:"death"},"死亡",-1),T("option",{value:"collision"},"碰撞",-1)])],8,S$),[[bt,L.event]]),ce(T("select",{"onUpdate:modelValue":ie=>L.targetSystemId=ie,class:"inp event-target",title:"选择目标粒子系统"},[B[163]||(B[163]=T("option",{value:0},"无(粒子系统)",-1)),(q(!0),J(_e,null,Et(X.value,ie=>(q(),J("option",{key:ie.id,value:ie.id},ve(ie.config.name||`ParticleSystem${ie.id}`),9,T$))),128))],8,M$),[[bt,L.targetSystemId,void 0,{number:!0}]]),T("button",{type:"button",class:"event-remove",title:"删除该子发射器",onClick:ie=>H(j)},"✕",8,_$)]),T("label",C$,[B[164]||(B[164]=T("span",null,"发射概率",-1)),ce(T("input",{"onUpdate:modelValue":ie=>L.probability=ie,type:"number",min:"0",max:"1",step:"0.01",class:"inp"},null,8,E$),[[He,L.probability,void 0,{number:!0}]])]),L.event==="collision"?(q(),J("label",A$,[B[165]||(B[165]=T("span",null,"碰撞次数限制",-1)),T("input",{value:L.collisionLimit??1,type:"number",min:"1",max:"4",step:"1",class:"inp",onInput:ie=>z(L,ie)},null,40,I$)])):xe("",!0),T("div",R$,[B[167]||(B[167]=T("span",null,"继承",-1)),T("button",{type:"button",class:"inherit-trigger",onPointerdown:B[70]||(B[70]=qe(()=>{},["stop"])),onClick:qe(ie=>oe(L,ie),["stop"])},[T("span",k$,ve(V(L)),1),B[166]||(B[166]=T("i",null,"⌄",-1))],40,P$)]),G(L,"color")?(q(),J("label",F$,[B[169]||(B[169]=T("span",null,"颜色继承方式",-1)),ce(T("select",{"onUpdate:modelValue":ie=>L.colorInheritMode=ie,class:"inp"},[...B[168]||(B[168]=[T("option",{value:"add"},"相加",-1),T("option",{value:"replace"},"覆盖",-1)])],8,O$),[[bt,L.colorInheritMode]])])):xe("",!0)]))),128)),T("button",{type:"button",class:"event-add",onClick:me},"+ 新增子发射器")])):xe("",!0)])],512),[[Si,!I(b).mods]])]),(q(),Ct(dx,{to:"body"},[F.value&&N.value?(q(),J("div",{key:0,class:"inherit-menu",style:Ot({left:`${F.value.left}px`,top:`${F.value.top}px`,width:`${F.value.width}px`}),onPointerdown:B[73]||(B[73]=qe(()=>{},["stop"]))},[T("button",{type:"button",class:"inherit-option",onClick:B[71]||(B[71]=L=>Z(N.value))},[T("span",L$,ve(k(N.value).length===0?"✓":""),1),B[170]||(B[170]=ft("无(默认值) ",-1))]),T("button",{type:"button",class:"inherit-option",onClick:B[72]||(B[72]=L=>ne(N.value))},[T("span",B$,ve(k(N.value).length===4?"✓":""),1),B[171]||(B[171]=ft("所有属性 ",-1))]),B[172]||(B[172]=T("div",{class:"inherit-divider"},null,-1)),(q(),J(_e,null,Et(D,L=>T("button",{key:L.key,type:"button",class:"inherit-option",onClick:j=>W(N.value,L.key)},[T("span",D$,ve(G(N.value,L.key)?"✓":""),1),ft(ve(L.label),1)],8,N$)),64))],36)):xe("",!0)]))],64))}}),$$=Jt(U$,[["__scopeId","data-v-affb8652"]]),X$={class:"group"},V$={class:"caret"},Y$={class:"group-body export-settings"},G$={class:"export-field"},j$={class:"export-field"},H$={class:"export-field"},W$={key:0,class:"export-help"},z$={class:"export-fps-row"},q$={class:"export-field export-fps-field"},K$={class:"export-checkbox"},Z$={class:"export-switches"},J$={class:"switch-row export-switch"},Q$={class:"switch-row export-switch"},e6={class:"switch-row export-switch export-switch-last"},t6=Zt({__name:"ExportSettingsSection",setup(s){const{exportSettings:e,collapsed:t,toggle:i,resetModule:n,normalizeExportFps:r,select:o}=Fr();return(a,c)=>(q(),J("div",X$,[T("div",{class:"group-head",onClick:c[1]||(c[1]=l=>I(i)("export"))},[T("span",V$,ve(I(t).export?"▸":"▾"),1),c[11]||(c[11]=T("span",null,"导出设置",-1)),T("button",{class:"group-reset",title:"重置导出设置",onClick:c[0]||(c[0]=qe(l=>I(n)("export"),["stop"]))},"重置")]),ce(T("div",Y$,[T("label",G$,[c[12]||(c[12]=T("span",null,"图片路径 (Spine Images Path)",-1)),ce(T("input",{"onUpdate:modelValue":c[2]||(c[2]=l=>I(e).imagesPath=l),class:"inp export-input",type:"text",placeholder:"./images/"},null,512),[[He,I(e).imagesPath,void 0,{trim:!0}]])]),T("label",j$,[c[14]||(c[14]=T("span",null,"Spine 版本",-1)),ce(T("select",{"onUpdate:modelValue":c[3]||(c[3]=l=>I(e).spineVersion=l),class:"inp export-input"},[...c[13]||(c[13]=[is('',5)])],512),[[bt,I(e).spineVersion]])]),T("label",H$,[c[16]||(c[16]=T("span",null,"关键帧插值曲线",-1)),ce(T("select",{"onUpdate:modelValue":c[4]||(c[4]=l=>I(e).keyframeCurve=l),class:"inp export-input"},[...c[15]||(c[15]=[T("option",{value:"linear"},"线性 (Linear)",-1),T("option",{value:"bezier"},"平滑贝塞尔 (Smooth Bézier)",-1)])],512),[[bt,I(e).keyframeCurve]])]),c[25]||(c[25]=T("div",{class:"export-help"},"平滑贝塞尔会在误差允许范围内拟合连续运动;出生、死亡、附件切换和突变仍使用阶跃关键帧。",-1)),I(e).spineVersion==="3.8"?(q(),J("div",W$,"Spine 3.8 不支持 4.x 的逐通道数组贝塞尔,导出时会转换为经过容差精简的分段线性关键帧。")):xe("",!0),T("div",z$,[T("label",q$,[c[17]||(c[17]=T("span",null,"导出 FPS",-1)),ce(T("input",{"onUpdate:modelValue":c[5]||(c[5]=l=>I(e).fps=l),class:"inp export-input",type:"number",min:"1",max:"240",step:"1",onChange:c[6]||(c[6]=(...l)=>I(r)&&I(r)(...l))},null,544),[[He,I(e).fps,void 0,{number:!0}]])]),T("label",K$,[ce(T("input",{"onUpdate:modelValue":c[7]||(c[7]=l=>I(e).omitFps=l),type:"checkbox"},null,512),[[wt,I(e).omitFps]]),c[18]||(c[18]=ft("不写 fps",-1))])]),c[26]||(c[26]=T("div",{class:"export-help"},"修改 FPS 时保持动画实际秒数不变;“不写 fps”只省略 Spine 的 fps 元数据。",-1)),T("div",Z$,[T("label",J$,[ce(T("input",{"onUpdate:modelValue":c[8]||(c[8]=l=>I(e).integerFrameAlignment=l),type:"checkbox"},null,512),[[wt,I(e).integerFrameAlignment]]),c[19]||(c[19]=T("span",{class:"switch-ui"},null,-1)),c[20]||(c[20]=T("span",null,"整数帧对齐",-1))]),T("label",Q$,[ce(T("input",{"onUpdate:modelValue":c[9]||(c[9]=l=>I(e).bonePool=l),type:"checkbox"},null,512),[[wt,I(e).bonePool]]),c[21]||(c[21]=T("span",{class:"switch-ui"},null,-1)),c[22]||(c[22]=T("span",null,"骨骼对象池",-1))]),T("label",e6,[ce(T("input",{"onUpdate:modelValue":c[10]||(c[10]=l=>I(e).excludeEmptyAnimations=l),type:"checkbox"},null,512),[[wt,I(e).excludeEmptyAnimations]]),c[23]||(c[23]=T("span",{class:"switch-ui"},null,-1)),c[24]||(c[24]=T("span",null,"排除无内容动画",-1))])])],512),[[Si,!I(t).export]])]))}}),i6=Jt(t6,[["__scopeId","data-v-04462c7a"]]),s6={class:"spine-export-actions"},n6=["disabled","title"],r6=["disabled"],o6=["disabled","title"],a6={key:0},l6=["href"],c6=["href"],h6=Zt({__name:"ParticleExportFooter",setup(s){const{exportSettings:e,exportBusy:t,exportTarget:i,exportMessage:n,exportError:r,connectorPairUrl:o,connectorStatusText:a,connectorStatusClass:c,connectorReady:l,connectorAuthorizationUrl:h,connectorDisabledReason:u,connectorButtonTitle:d,refreshConnectorHealth:f,exportSpineJson:m,exportSpineProject:p,exportSpineImages:g}=Fr();return(x,v)=>(q(),J(_e,null,[T("div",s6,[T("button",{type:"button",class:"export-spine-json",disabled:I(t),title:I(t)?"正在重新计算并烘焙动画":`导出 Spine ${I(e).spineVersion} JSON`,onClick:v[0]||(v[0]=(...y)=>I(m)&&I(m)(...y))},ve(I(t)&&I(i)==="json"?"正在准备导出…":"导出Spine Json"),9,n6),T("button",{type:"button",class:"export-spine-images",disabled:I(t),title:"单独下载当前粒子系统使用的图片 ZIP",onClick:v[1]||(v[1]=(...y)=>I(g)&&I(g)(...y))},ve(I(t)&&I(i)==="images"?"正在整理图片…":"导出 images 包"),9,r6),T("button",{type:"button",class:"export-spine-project",disabled:I(t)||!I(l),title:I(d),onClick:v[2]||(v[2]=(...y)=>I(p)&&I(p)(...y))},[T("span",null,ve(I(t)&&I(i)==="spine"?"正在生成工程…":"导出 .spine 包"),1),!I(t)&&I(u)?(q(),J("small",a6,ve(I(u)),1)):xe("",!0)],8,o6)]),T("div",{class:Ce(["connector-status",I(c)])},[v[5]||(v[5]=T("span",{class:"connector-dot"},null,-1)),ft(ve(I(a))+" ",1),I(h)?(q(),J("a",{key:0,href:I(h),target:"_blank",rel:"noopener",title:"在本机连接器中授权当前网站"},"授权当前网站",8,l6)):xe("",!0),T("button",{type:"button",title:"重新检测连接器",onClick:v[3]||(v[3]=(...y)=>I(f)&&I(f)(...y))},"刷新")],2),I(n)?(q(),J("div",{key:0,class:Ce(["export-message",{error:I(r)}])},[ft(ve(I(n))+" ",1),I(o)?(q(),J("a",{key:0,href:I(o),target:"_blank",rel:"noopener",onClick:v[4]||(v[4]=y=>o.value="")},"授权当前网站",8,c6)):xe("",!0)],2)):xe("",!0)],64))}}),u6=Jt(h6,[["__scopeId","data-v-7ff40afe"]]),d6={class:"panel"},f6={class:"panel-scroll"},m6=Zt({__name:"ParticlePanel",setup(s){const{activeObjectType:e,sys:t}=RL();return(i,n)=>(q(),J("div",d6,[n[0]||(n[0]=T("div",{class:"panel-header"},[T("span",null,"Spine粒子编辑器-Yeomai")],-1)),T("div",f6,[we(UL),we(MD),I(e)==="particle"&&I(t)?(q(),J(_e,{key:0},[we(h4),we(F4),we(R8),we($$),we(i6)],64)):xe("",!0)]),we(u6)]))}}),p6=Jt(m6,[["__scopeId","data-v-283ef8eb"]]),Fo=s=>Math.max(0,Number(s)||0);function g6(s,e){const t=Math.max(1,e),i=new Map(s.map(v=>[v.id,v])),n=new Set;for(const v of s)if(v.config.eventEnabled)for(const y of v.config.events||[])y.targetSystemId>0&&y.targetSystemId!==v.id&&i.has(y.targetSystemId)&&n.add(y.targetSystemId);const r=new Map;for(const v of s)if(v.config.eventEnabled)for(const y of v.config.events||[]){if(y.targetSystemId<=0||y.targetSystemId===v.id||!i.has(y.targetSystemId))continue;const S=r.get(y.targetSystemId);S?S.push({parent:v,rule:y}):r.set(y.targetSystemId,[{parent:v,rule:y}])}const o=v=>Fo(v.delay),a=v=>Fo(v.delay),c=v=>{const y=o(v);return v.mode!=="stream"?y:v.streamBehavior==="loop"?y+Ps(v,t).total/t:y+Math.max(1/t,Number(v.duration)||0)},l=v=>{const y=Fo(v.lifeMin),S=Fo(v.lifeMax);return v.lifeMode==="fixed"?y:Math.min(y,S)},h=v=>{const y=Fo(v.lifeMin),S=Fo(v.lifeMax);return v.lifeMode==="fixed"?y:Math.max(y,S)},u=new Map,d=new Map,f=new Set,m=new Set,p=v=>{const y=u.get(v.id);if(y!=null)return y;if(f.has(v.id))return o(v.config);f.add(v.id);let S=1/0;for(const{parent:C,rule:w}of r.get(v.id)||[]){const b=n.has(C.id)?p(C)+a(C.config):o(C.config),_=w.event==="death"?l(C.config):0;S=Math.min(S,b+_)}return Number.isFinite(S)||(S=o(v.config)),f.delete(v.id),u.set(v.id,S),S},g=v=>{const y=d.get(v.id);if(y!=null)return y;if(m.has(v.id))return c(v.config);m.add(v.id);let S=-1/0;for(const{parent:C,rule:w}of r.get(v.id)||[]){const b=n.has(C.id)?g(C)+a(C.config):c(C.config),_=w.event==="birth"?0:h(C.config);S=Math.max(S,b+_)}return Number.isFinite(S)||(S=c(v.config)),m.delete(v.id),d.set(v.id,S),S},x=new Map;for(const v of n){const y=i.get(v);if(!y)continue;const S=p(y),C=g(y);x.set(v,{firstTrigger:S,lastTrigger:C,end:Math.max(S,C)+h(y.config)})}return x}const v6={class:"timeline"},y6={class:"tl-controls"},x6=["title"],b6={class:"tl-ab-loop"},w6={class:"tl-range",title:"自定义播放起始帧"},S6=["max","onKeydown"],M6={class:"tl-range",title:"自定义播放结束帧"},T6=["min","max","onKeydown"],_6={class:"tl-frame"},C6=["disabled"],E6=["onClick"],A6={key:0},I6={class:"tl-animation-editor"},R6={key:0,class:"tl-animation-error"},P6={class:"tl-animation-actions"},k6=["disabled"],F6={key:1,class:"tl-animation-hint"},O6={class:"tl-anim tl-spine-preview"},L6=["value","disabled"],B6={value:""},N6=["value"],D6={class:"tl-zoom"},U6={class:"tl-ticks"},$6={class:"tl-ticklabel"},X6={class:"tl-lanes"},V6=["onPointerdown"],Y6={class:"lane-name"},G6=["onPointerdown"],j6=["onPointerdown"],H6=["onPointerdown"],W6={class:"lane-name"},z6={key:0,class:"tl-empty"},q6=Zt({__name:"Timeline",setup(s){const e=yo(),t=Fe(null),i=Fe(null),n=Fe(!1),r=Fe("animation"),o=Fe("");Lo(()=>{(!Array.isArray(e.timeline.animations)||!e.timeline.animations.length)&&(e.timeline.animations=["animation"]),e.timeline.animations.includes(e.timeline.animation)||(e.timeline.animation=e.timeline.animations[0]);for(const L of e.systems)(!L.animation||!e.timeline.animations.includes(L.animation))&&(L.animation=e.timeline.animations[0])});const a=Le(()=>e.systems.find(L=>L.id===e.activeId)||null);function c(){a.value&&(n.value=!n.value,r.value=a.value.animation,o.value="")}function l(L){const j=a.value;j&&(e.setSystemAnimation(j.id,L),r.value=L,o.value="")}function h(){const L=e.addAnimation();r.value=L,o.value=""}function u(){var ie;const L=((ie=a.value)==null?void 0:ie.animation)||e.timeline.animation,j=r.value.trim();if(!j){o.value="动画名称不能为空";return}if(j!==L&&e.timeline.animations.includes(j)){o.value="动画名称不能重复";return}if(!e.renameAnimation(L,j)){o.value="无法修改动画名称";return}r.value=j,o.value=""}function d(){var ie,ue;const L=((ie=a.value)==null?void 0:ie.animation)||e.timeline.animation;if(!e.removeAnimation(L)){o.value="至少需要保留一个动画";return}const j=((ue=a.value)==null?void 0:ue.animation)||e.timeline.animation;r.value=j,o.value=""}function f(L){var j;(j=i.value)!=null&&j.contains(L.target)||(n.value=!1)}ys(()=>document.addEventListener("pointerdown",f)),Rr(()=>document.removeEventListener("pointerdown",f));const m=Le(()=>Math.max(1,e.timeline.fps||30)),p=Fe(Math.max(120,e.timeline.totalFrames)),g=Fe({}),x=Fe({}),v=Fe({}),y=Fe({}),S=Fe(String(e.timeline.playbackStart)),C=Fe(String(e.timeline.playbackEnd));ai(()=>e.timeline.playbackStart,L=>{S.value=String(L)}),ai(()=>e.timeline.playbackEnd,L=>{C.value=String(L)});const w=Le(()=>e.timeline.totalFrames);ai(w,L=>{L>p.value&&(p.value=Math.min(2e3,L))});const b=Le(()=>p.value<=30?"放大":p.value>=300?"缩小":"适中"),_=Le(()=>e.spines.filter(L=>L.selectedAnimation&&L.animations.some(j=>j.name===L.selectedAnimation&&j.duration>0))),A=Le(()=>(e.activeObjectType==="spine"?e.spines.find(j=>j.id===e.activeObjectId&&j.animations.length):null)||e.spines.find(j=>j.animations.length)||null);function P(L){const j=A.value;j&&(j.selectedAnimation=L.target.value,e.recalcTotalFrames(),e.timeline.frame=0)}function E(){e.setPlaybackStart(Number(S.value)),S.value=String(e.timeline.playbackStart)}function R(){e.setPlaybackEnd(Number(C.value)),C.value=String(e.timeline.playbackEnd)}function O(){var j;const L=((j=t.value)==null?void 0:j.clientWidth)||600;return p.value/L}const U=Le(()=>{const L=[],j=p.value;let ie=1;p.value<=10?ie=1:p.value<=50?ie=5:p.value<=200?ie=10:p.value<=500?ie=50:ie=100;for(let ue=0;ue<=j;ue+=ie)L.push({f:ue,px:ue/O()});return L}),Y=Le(()=>e.timeline.frame/O()),$=Le(()=>Sl(e.systems)),X=Le(()=>g6(e.systems,m.value));function D(L){return $.value.has(L.id)}function F(L){var ie;return(D(L)?((ie=X.value.get(L.id))==null?void 0:ie.firstTrigger)??0:0)*m.value/O()+4}function N(L){var ue;const j=L.config;if(D(L)){const fe=((ue=X.value.get(L.id))==null?void 0:ue.firstTrigger)??0,ee=g.value[L.id]??Math.max(0,Number(j.delay)||0);return(fe+ee)*m.value/O()}return(g.value[L.id]??Math.max(0,Number(j.delay)||0))*m.value/O()}function k(L){const j=L.config,ie=Math.max(0,Number(j.lifeMin)||0),ue=Math.max(0,Number(j.lifeMax)||0);return j.lifeMode==="fixed"?ie:Math.max(ie,ue)}function V(L){if(D(L)){const j=X.value.get(L.id),ie=(j==null?void 0:j.firstTrigger)??0,ue=(j==null?void 0:j.end)??ie;return Math.max(0,ue-ie)*m.value/O()}return W(L)}function G(L){if(D(L)||L.config.mode!=="stream")return 0;if(L.config.streamBehavior==="loop"){const ie=L.config;return(v.value[L.id]??Ps(ie,m.value).loop)/O()}return(x.value[L.id]??Math.max(1/m.value,Number(L.config.duration)||1))*m.value/O()}function W(L){if(D(L))return V(L);const j=L.config;return j.mode==="stream"&&j.streamBehavior==="loop"?ne(L)+G(L)+oe(L):G(L)+k(L)*m.value/O()}function Z(L){const j=L.config;return j.mode==="stream"&&j.streamBehavior==="loop"}function ne(L){return Z(L)?Ps(L.config,m.value).start/O():0}function oe(L){return Z(L)?Ps(L.config,m.value).end/O():0}function de(L){var j;return((j=L.animations.find(ie=>ie.name===L.selectedAnimation))==null?void 0:j.duration)||0}function pe(L){return(y.value[L.id]??Math.max(0,Number(L.timeOffset)||0))*m.value/O()}function he(L){return de(L)*m.value/O()}function me(L){const j=L.deltaY<0?.8:1.25;let ie=p.value*j;ie=Math.min(2e3,Math.max(10,ie)),p.value=Math.round(ie)}function H(L){const j=t.value;e.pause();const ie=fe=>{const ee=j.getBoundingClientRect(),Me=Math.floor((fe.clientX-ee.left)/ee.width*p.value);e.timeline.frame=Math.max(0,Math.min(Me,w.value-1))};ie(L);const ue=()=>{window.removeEventListener("pointermove",ie),window.removeEventListener("pointerup",ue)};window.addEventListener("pointermove",ie),window.addEventListener("pointerup",ue)}function z(L,j){L.stopPropagation();const ie=L.clientX,ue=Math.max(0,Number(j.config.delay)||0),fe=O()/m.value,ee=Ne=>{const Ve=(Ne.clientX-ie)*fe,Ze=Math.max(0,Math.min(ue+Ve,600));g.value[j.id]=Math.round(Ze*m.value)/m.value},Me=Ne=>{window.removeEventListener("pointermove",ee),window.removeEventListener("pointerup",be),window.removeEventListener("pointercancel",ge);const Ve=g.value[j.id];delete g.value[j.id],Ne&&Ve!=null&&Ve!==ue&&(j.config.delay=Ve)},be=()=>Me(!0),ge=()=>Me(!1);window.addEventListener("pointermove",ee),window.addEventListener("pointerup",be),window.addEventListener("pointercancel",ge)}function K(L,j){var Je;L.stopPropagation();const ie=Z(j),ue=Math.max(0,Number(j.config.duration)||0),fe=Ps(j.config,m.value).loop,ee=O()/m.value,Me=((Je=L.currentTarget.closest(".lane-bar"))==null?void 0:Je.getBoundingClientRect().left)??L.clientX,be=ne(j);let ge=!1;const Ne=je=>{if(ge=!0,ie){const Ae=Math.min(1800,Math.max(1,Math.round((je.clientX-Me-be)/O())));v.value[j.id]=Ae}else{const Ae=Math.max(1/m.value,Math.min((je.clientX-Me)*ee,600));x.value[j.id]=Math.round(Ae*m.value)/m.value}},Ve=je=>{window.removeEventListener("pointermove",Ne),window.removeEventListener("pointerup",Ze),window.removeEventListener("pointercancel",rt);const Ae=x.value[j.id],Qe=v.value[j.id];delete x.value[j.id],delete v.value[j.id],je&&ge&&ie&&Qe!=null&&Qe!==fe?j.config.loopDurationFrames=Qe:je&&ge&&!ie&&Ae!=null&&Ae!==ue&&(j.config.duration=Ae)},Ze=()=>Ve(!0),rt=()=>Ve(!1);window.addEventListener("pointermove",Ne),window.addEventListener("pointerup",Ze),window.addEventListener("pointercancel",rt)}function B(L,j){L.stopPropagation();const ie=L.clientX,ue=Math.max(0,Number(j.timeOffset)||0),fe=O()/m.value,ee=Ne=>{const Ve=Math.max(0,Math.min(ue+(Ne.clientX-ie)*fe,600));y.value[j.id]=Math.round(Ve*m.value)/m.value},Me=Ne=>{window.removeEventListener("pointermove",ee),window.removeEventListener("pointerup",be),window.removeEventListener("pointercancel",ge);const Ve=y.value[j.id];delete y.value[j.id],Ne&&Ve!=null&&Ve!==ue&&(j.timeOffset=Ve,e.recalcTotalFrames())},be=()=>Me(!0),ge=()=>Me(!1);window.addEventListener("pointermove",ee),window.addEventListener("pointerup",be),window.addEventListener("pointercancel",ge)}return(L,j)=>{var ie,ue,fe;return q(),J("div",v6,[T("div",y6,[T("button",{class:Ce(["tl-btn",{on:I(e).timeline.playing}]),onClick:j[0]||(j[0]=ee=>I(e).togglePlay()),title:I(e).timeline.playing?"暂停 (D)":"播放 (D)"},ve(I(e).timeline.playing?"❚❚":"▶"),11,x6),T("button",{class:"tl-btn",onClick:j[1]||(j[1]=ee=>I(e).toStart()),title:"回到第一帧 (S)"},"⏮"),T("button",{class:"tl-btn",onClick:j[2]||(j[2]=ee=>I(e).previousFrame()),title:"前一帧"},"◀"),T("button",{class:"tl-btn",onClick:j[3]||(j[3]=ee=>I(e).nextFrame()),title:"后一帧"},"▶"),T("button",{class:"tl-btn",onClick:j[4]||(j[4]=ee=>I(e).toEnd()),title:"移动到最后一帧"},"⏭"),T("button",{class:Ce(["tl-btn",{on:I(e).timeline.loop}]),title:"持续循环播放","aria-label":"持续循环播放",onClick:j[5]||(j[5]=ee=>I(e).toggleLoop())},"⟳",2),T("div",b6,[T("button",{class:Ce(["tl-ab-toggle",{on:I(e).timeline.abLoop}]),title:"独立 A/B 区间循环",onClick:j[6]||(j[6]=ee=>I(e).toggleABLoop())},[...j[12]||(j[12]=[T("span",null,"AB 循环",-1),T("i",{class:"tl-switch"},[T("b")],-1)])],2),I(e).timeline.abLoop?(q(),J("div",{key:0,class:"tl-ab-popover",onPointerdown:j[9]||(j[9]=qe(()=>{},["stop"]))},[j[15]||(j[15]=T("div",{class:"tl-ab-title"},"AB 循环区间",-1)),T("label",w6,[j[13]||(j[13]=T("span",null,"A",-1)),ce(T("input",{"onUpdate:modelValue":j[7]||(j[7]=ee=>S.value=ee),type:"number",min:"0",max:Math.max(0,I(e).timeline.playbackEnd-1),"aria-label":"播放起始帧",onChange:E,onKeydown:Mr(qe(E,["prevent"]),["enter"])},null,40,S6),[[He,S.value]])]),T("label",M6,[j[14]||(j[14]=T("span",null,"B",-1)),ce(T("input",{"onUpdate:modelValue":j[8]||(j[8]=ee=>C.value=ee),type:"number",min:I(e).timeline.playbackStart+1,max:Math.max(1,I(e).timeline.totalFrames-1),"aria-label":"播放结束帧",onChange:R,onKeydown:Mr(qe(R,["prevent"]),["enter"])},null,40,T6),[[He,C.value]])])],32)):xe("",!0)]),T("span",_6,[j[16]||(j[16]=ft("帧 ",-1)),T("b",null,ve(I(e).timeline.frame),1),j[17]||(j[17]=ft(" / ",-1)),T("b",null,ve(Math.max(0,I(e).timeline.totalFrames-1)),1)]),j[22]||(j[22]=T("span",{class:"tl-legend"},[T("i",{class:"legend-emission"}),ft("持续发射 "),T("i",{class:"legend-life"}),ft("粒子存在 "),T("i",{class:"legend-spine"}),ft("Spine 动画")],-1)),T("div",{ref_key:"animationMenuRef",ref:i,class:"tl-anim tl-owner-animation"},[j[20]||(j[20]=T("span",null,"所属动画",-1)),T("button",{class:"tl-animation-trigger",disabled:!a.value,title:"设置当前粒子系统所属的动画",onClick:qe(c,["stop"])},[T("span",null,ve(((ie=a.value)==null?void 0:ie.animation)||I(e).timeline.animation),1),j[18]||(j[18]=T("i",null,"⌄",-1))],8,C6),n.value?(q(),J("div",{key:0,class:"tl-animation-menu",onPointerdown:j[11]||(j[11]=qe(()=>{},["stop"]))},[j[19]||(j[19]=T("div",{class:"tl-animation-menu-title"},"选择所属动画",-1)),(q(!0),J(_e,null,Et(I(e).timeline.animations,ee=>{var Me,be;return q(),J("button",{key:ee,class:Ce(["tl-animation-option",{on:((Me=a.value)==null?void 0:Me.animation)===ee}]),onClick:ge=>l(ee)},[T("span",null,ve(ee),1),((be=a.value)==null?void 0:be.animation)===ee?(q(),J("i",A6,"✓")):xe("",!0)],10,E6)}),128)),T("div",I6,[ce(T("input",{"onUpdate:modelValue":j[10]||(j[10]=ee=>r.value=ee),class:"tl-animation-name",maxlength:"64","aria-label":"动画名称",onKeydown:Mr(u,["enter"])},null,544),[[He,r.value]]),T("button",{title:"重命名当前动画",onClick:u},"重命名")]),o.value?(q(),J("div",R6,ve(o.value),1)):xe("",!0),T("div",P6,[T("button",{onClick:h},"+ 新增"),T("button",{disabled:I(e).timeline.animations.length<=1,onClick:d},"删除",8,k6)]),I(e).timeline.animations.length<=1?(q(),J("div",F6,"至少需要保留一个动画")):xe("",!0)],32)):xe("",!0)],512),T("label",O6,[j[21]||(j[21]=ft("Spine 预览动画 ",-1)),T("select",{class:"tl-sel",value:((ue=A.value)==null?void 0:ue.selectedAnimation)||"",disabled:!A.value,onChange:P},[T("option",B6,ve(A.value?"无":"无可用 Spine 动画"),1),(q(!0),J(_e,null,Et(((fe=A.value)==null?void 0:fe.animations)||[],ee=>(q(),J("option",{key:ee.name,value:ee.name},ve(ee.name)+"("+ve(ee.duration.toFixed(2))+"s) ",9,N6))),128))],40,L6)]),T("span",D6,ve(b.value),1)]),T("div",{class:"tl-viewport",ref_key:"vpRef",ref:t,onWheel:qe(me,["prevent"]),onPointerdown:H},[T("div",U6,[(q(!0),J(_e,null,Et(U.value,ee=>(q(),J("div",{key:ee.f,class:"tl-tickline",style:Ot({left:ee.px+"px"})},[T("span",$6,ve(ee.f)+"f",1)],4))),128))]),T("div",{class:"tl-playhead",style:Ot({left:Y.value+"px"})},null,4),T("div",X6,[(q(!0),J(_e,null,Et(I(e).systems,(ee,Me)=>(q(),J("div",{key:ee.id,class:"tl-lane"},[T("span",{class:Ce(["lane-ico",{"sub-lane-ico":D(ee)}]),style:Ot({left:F(ee)+"px"})},"●",6),T("div",{class:Ce(["lane-bar",{"sub-emitter-bar":D(ee)}]),style:Ot({left:N(ee)+"px",width:V(ee)+"px"}),onPointerdown:qe(be=>z(be,ee),["stop"])},[T("span",Y6,ve(ee.config.name||"系统 "+(Me+1)),1),T("span",{class:Ce(["bar-life",{"loop-life":!D(ee)&&Z(ee)}]),style:Ot({width:W(ee)+"px"})},null,6),!D(ee)&&Z(ee)?(q(),J(_e,{key:0},[ne(ee)?(q(),J("span",{key:0,class:"bar-loop-transition bar-loop-start",style:Ot({width:ne(ee)+"px"})},null,4)):xe("",!0),T("span",{class:"bar-emission bar-loop",style:Ot({left:ne(ee)+"px",width:G(ee)+"px"})},[T("span",{class:"bar-handle",title:"拖动循环段时长",onPointerdown:qe(be=>K(be,ee),["stop"])},null,40,G6)],4),oe(ee)?(q(),J("span",{key:1,class:"bar-loop-transition bar-loop-end",style:Ot({left:ne(ee)+G(ee)+"px",width:oe(ee)+"px"})},null,4)):xe("",!0)],64)):!D(ee)&&ee.config.mode==="stream"?(q(),J("span",{key:1,class:"bar-emission",style:Ot({width:G(ee)+"px"})},[T("span",{class:"bar-handle",title:"拖动持续发射时长",onPointerdown:qe(be=>K(be,ee),["stop"])},null,40,j6)],4)):xe("",!0)],46,V6)]))),128)),(q(!0),J(_e,null,Et(_.value,ee=>(q(),J("div",{key:`spine-${ee.id}`,class:"tl-lane spine-lane"},[j[23]||(j[23]=T("span",{class:"lane-ico spine-ico"},"◆",-1)),T("div",{class:"spine-bar",style:Ot({left:pe(ee)+"px",width:he(ee)+"px"}),title:"拖动调整动画开始时间",onPointerdown:qe(Me=>B(Me,ee),["stop"])},[T("span",W6,ve(ee.name)+" · "+ve(ee.selectedAnimation),1)],44,H6)]))),128)),!I(e).systems.length&&!_.value.length?(q(),J("div",z6,"暂无可显示的动画数据")):xe("",!0)])],544)])}}}),K6=Jt(q6,[["__scopeId","data-v-6b4c353d"]]),Z6={class:"transfer-heading"},J6={key:0},Q6={class:"transfer-detail"},eX=Zt({__name:"TransferProgressOverlay",setup(s){const e=Fe(null);return ai(()=>ti.visible,async t=>{var i;t&&(await Kh(),(i=e.value)==null||i.focus({preventScroll:!0}))},{flush:"post"}),(t,i)=>(q(),Ct(u2,{name:"transfer-fade"},{default:Zh(()=>[I(ti).visible?(q(),J("div",{key:0,ref_key:"overlayElement",ref:e,class:"transfer-overlay",role:"dialog","aria-modal":"true","aria-live":"polite",tabindex:"-1",onPointerdown:i[0]||(i[0]=qe(()=>{},["stop","prevent"])),onPointerup:i[1]||(i[1]=qe(()=>{},["stop","prevent"])),onClick:i[2]||(i[2]=qe(()=>{},["stop","prevent"])),onDblclick:i[3]||(i[3]=qe(()=>{},["stop","prevent"])),onContextmenu:i[4]||(i[4]=qe(()=>{},["stop","prevent"])),onWheel:i[5]||(i[5]=qe(()=>{},["stop","prevent"])),onKeydown:i[6]||(i[6]=qe(()=>{},["stop","prevent"]))},[T("div",{class:Ce(["transfer-dialog",{failed:I(ti).failed}])},[T("div",Z6,[T("span",null,ve(I(ti).title),1),I(ti).indeterminate?xe("",!0):(q(),J("strong",J6,ve(Math.round(I(ti).progress))+"%",1))]),T("div",{class:Ce(["transfer-track",{indeterminate:I(ti).indeterminate}])},[T("div",{class:"transfer-bar",style:Ot(I(ti).indeterminate?void 0:{width:`${I(ti).progress}%`})},null,4)],2),T("div",Q6,ve(I(ti).detail),1)],2)],544)):xe("",!0)]),_:1}))}}),tX=Jt(eX,[["__scopeId","data-v-592b922e"]]),iX=["inert","aria-hidden"],sX={class:"right"},nX={class:"stage-area"},rX=Zt({__name:"App",setup(s){const e=yo();NR(e);const t=Fe(360),i=Fe(180);function n(o){o.preventDefault();const a=l=>{const h=e.settings.parameterPanelOnRight?window.innerWidth-l.clientX:l.clientX,u=Math.max(240,Math.min(h,window.innerWidth-200));t.value=u},c=()=>{window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",c)};window.addEventListener("pointermove",a),window.addEventListener("pointerup",c)}function r(o){o.preventDefault();const a=o.clientY,c=i.value,l=u=>{const d=Math.max(80,Math.min(c+(a-u.clientY),window.innerHeight-200));i.value=d},h=()=>{window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",h)};window.addEventListener("pointermove",l),window.addEventListener("pointerup",h)}return(o,a)=>(q(),J(_e,null,[T("div",{class:Ce(["layout",{"panel-right":I(e).settings.parameterPanelOnRight}]),inert:I(ti).visible?!0:void 0,"aria-hidden":I(ti).visible?"true":void 0},[T("div",{class:"parameter-panel",style:Ot({width:t.value+"px"})},[we(p6)],4),T("div",{class:"resizer-col",onPointerdown:n},null,32),T("div",sX,[T("div",nX,[we(M3)]),T("div",{class:"resizer-row",onPointerdown:r,title:"拖动调整时间轴高度"},null,32),T("div",{class:"timeline-area",style:Ot({height:i.value+"px"})},[we(K6)],4)])],10,iX),we(tX)],64))}}),oX=Jt(rX,[["__scopeId","data-v-42c4fa00"]]);U2(oX).use(V2()).mount("#app");export{Sy as $,ln as A,Lh as B,At as C,gi as D,ke as E,Yi as F,fn as G,nt as H,St as I,DS as J,Ni as K,os as L,vs as M,Ar as N,bu as O,an as P,xl as Q,da as R,Rs as S,oO as T,Ge as U,gy as V,Os as W,BV as X,sL as Y,_l as Z,Tp as _,Ke as a,Lm as a$,wy as a0,vS as a1,Lp as a2,OV as a3,Ph as a4,sl as a5,gO as a6,nl as a7,wu as a8,Pm as a9,Ym as aA,Gm as aB,Cc as aC,ur as aD,Xc as aE,km as aF,wS as aG,zt as aH,mS as aI,CV as aJ,oa as aK,by as aL,Ie as aM,Xe as aN,Om as aO,Vc as aP,_S as aQ,Fm as aR,MS as aS,TS as aT,Su as aU,AS as aV,Yc as aW,PS as aX,CS as aY,IS as aZ,kS as a_,wo as aa,Bp as ab,Np as ac,yy as ad,Bl as ae,Nl as af,Ll as ag,bo as ah,Bn as ai,AV as aj,bS as ak,pO as al,ma as am,_r as an,$p as ao,NS as ap,fO as aq,Tl as ar,zi as as,xy as at,PV as au,xa as av,Vm as aw,jm as ax,Hm as ay,Wm as az,ha as b,qn as b$,Oh as b0,ES as b1,kr as b2,RS as b3,Dp as b4,rO as b5,LS as b6,BS as b7,Up as b8,dn as b9,FS as bA,Xp as bB,xu as bC,US as bD,Bm as bE,mi as bF,sO as bG,lO as bH,sS as bI,iS as bJ,IV as bK,Bt as bL,ba as bM,$S as bN,YS as bO,GS as bP,jS as bQ,XS as bR,VS as bS,dO as bT,Vp as bU,_t as bV,Xm as bW,SS as bX,rS as bY,oS as bZ,aS as b_,nO as ba,EV as bb,st as bc,xS as bd,yS as be,pS as bf,gS as bg,co as bh,kh as bi,mO as bj,lS as bk,cS as bl,Xi as bm,hS as bn,fa as bo,_i as bp,nS as bq,Fh as br,uS as bs,dS as bt,fS as bu,My as bv,Um as bw,Jr as bx,OS as by,Dm as bz,ua as c,RV as c0,hO as c1,uO as c2,cO as c3,We as d,$e as e,kV as f,it as g,bi as h,hh as i,Ki as j,$t as k,Ue as l,Ns as m,Ft as n,vp as o,si as p,bl as q,cr as r,Be as s,bb as t,Mp as u,ph as v,Nm as w,Kr as x,vy as y,$m as z}; diff --git a/dist/assets/index-BS4GpQRH.js b/dist/assets/index-CT90mgj8.js similarity index 99% rename from dist/assets/index-BS4GpQRH.js rename to dist/assets/index-CT90mgj8.js index b19e2ef..98aec41 100644 --- a/dist/assets/index-BS4GpQRH.js +++ b/dist/assets/index-CT90mgj8.js @@ -1,2 +1,2 @@ -var ft=Object.defineProperty;var gt=(W,t,e)=>t in W?ft(W,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):W[t]=e;var T=(W,t,e)=>gt(W,typeof t!="symbol"?t+"":t,e);import{f as ht,R as pt,N as dt,ac as ut,Z as mt,b4 as yt,O as rt,b5 as at,U as D,B as Tt}from"./index-BDM5NpkZ.js";import{$ as Rt,a0 as Yt,a1 as Ft,a2 as Et,y as _t,a3 as Ot,a4 as kt,a5 as Xt,a6 as Bt,a7 as Nt,a8 as Dt,a9 as $t,aa as zt,ab as Wt,ad as qt,H as Gt,ae as Jt,af as Ht,ag as Zt,ah as Kt,ai as Qt,aj as jt,ak as te,al as ee,am as se,an as ne,ao as ie,ap as oe,aq as re,ar as ae,as as le,at as ce,au as he,av as pe,aw as de,ax as ue,ay as fe,az as ge,aA as me,aB as ye,aC as Te,aD as be,aE as we,aF as xe,aG as Ae,aH as Pe,aI as Ie,aJ as Ce,aK as Ve,aL as Le,aM as Se,aN as Me,aO as ve,aP as Ue,aQ as Re,aR as Ye,aS as Fe,aT as Ee,x as _e,aU as Oe,aV as ke,aW as Xe,aX as Be,aY as Ne,aZ as De,a_ as $e,a$ as ze,b0 as We,b1 as qe,b2 as Ge,b3 as Je,b6 as He,b7 as Ze,b8 as Ke,b9 as Qe,ba as je,bb as ts,bc as es,bd as ss,be as ns,bf as is,bg as os,bh as rs,bi as as,bj as ls,bk as cs,bl as hs,bm as ps,bn as ds,bo as us,bp as fs,bq as gs,br as ms,bs as ys,bt as Ts,bu as bs,w as ws,X as xs,J as As,Y as Ps,z as Is,bv as Cs,bw as Vs,bx as Ls,by as Ss,bz as Ms,bA as vs,bB as Us,bC as Rs,bD as Ys,bE as Fs,bF as Es,bG as _s,T as Os,bH as ks,bI as Xs,b as Bs,bJ as Ns,c as Ds,bK as $s,bL as zs,bM as Ws,bN as qs,bO as Gs,bP as Js,bQ as Hs,bR as Zs,bS as Ks,bT as Qs,bU as js,bV as tn,bW as en,bX as sn,bY as nn,bZ as on,b_ as rn,V as an,b$ as ln,c0 as cn,c1 as hn,c2 as pn,c3 as dn}from"./index-BDM5NpkZ.js";class It{constructor(t){T(this,"skeletonData");T(this,"animationToMixTime",{});T(this,"defaultMix",0);if(!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,n){return typeof t=="string"?this.setMix1(t,e,n):this.setMix2(t,e,n)}setMix1(t,e,n){const s=this.skeletonData.findAnimation(t);if(!s)throw new Error(`Animation not found: ${t}`);const i=this.skeletonData.findAnimation(e);if(!i)throw new Error(`Animation not found: ${e}`);this.setMix2(s,i,n)}setMix2(t,e,n){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");const s=`${t.name}.${e.name}`;this.animationToMixTime[s]=n}getMix(t,e){const n=`${t.name}.${e.name}`,s=this.animationToMixTime[n];return s===void 0?this.defaultMix:s}}class Ct{constructor(t,e="",n=new bt,s=new lt){T(this,"textureLoader");T(this,"pathPrefix");T(this,"downloader");T(this,"cache");T(this,"errors",{});T(this,"toLoad",0);T(this,"loaded",0);T(this,"texturePmaInfo",{});this.textureLoader=t,this.pathPrefix=e,this.downloader=n,this.cache=s}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,n){this.toLoad--,this.loaded++,this.cache.assets[e]=n,this.cache.assetsRefCount[e]=(this.cache.assetsRefCount[e]||0)+1,t&&t(e,n)}error(t,e,n){this.toLoad--,this.loaded++,this.errors[e]=n,t&&t(e,n)}loadAll(){return new Promise((e,n)=>{const s=()=>{if(this.isLoadingComplete()){this.hasErrors()?n(this.errors):e(this);return}requestAnimationFrame(s)};requestAnimationFrame(s)})}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=()=>{},n=()=>{}){t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((s,i)=>{this.downloader.downloadBinary(t,o=>{this.success(e,t,o),s(o)},(o,r)=>{const l=`Couldn't load binary ${t}: status ${o}, ${r}`;this.error(n,t,l),i(l)})}))}loadText(t,e=()=>{},n=()=>{}){t=this.start(t),this.downloader.downloadText(t,s=>{this.success(e,t,s)},(s,i)=>{this.error(n,t,`Couldn't load text ${t}: status ${s}, ${i}`)})}loadJson(t,e=()=>{},n=()=>{}){t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((s,i)=>{this.downloader.downloadJson(t,o=>{this.success(e,t,o),s(o)},(o,r)=>{const l=`Couldn't load JSON ${t}: status ${o}, ${r}`;this.error(n,t,l),i(l)})}))}reuseAssets(t,e=()=>{},n=()=>{}){const s=this.cache.getAsset(t),i=s!==void 0;return i&&(this.cache.assetsLoaded[t]=s.then(o=>(o=o instanceof Image||o instanceof ImageBitmap?this.textureLoader(o):o,this.success(e,t,o),o)).catch(o=>{this.error(n,t,o)})),i}loadTexture(t,e=()=>{},n=()=>{}){if(t=this.start(t),this.reuseAssets(t,e,n))return;const s=this.texturePmaInfo[t];this.cache.assetsLoaded[t]=new Promise((i,o)=>{if(!!!(typeof window<"u"&&typeof navigator<"u"&&window.document))fetch(t,{mode:"cors"}).then(c=>{if(c.ok)return c.blob();const a=`Couldn't load image: ${t}`;this.error(n,t,`Couldn't load image: ${t}`),o(a)}).then(c=>c?createImageBitmap(c,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(c=>{if(c){const a=this.createTexture(t,s,c);this.success(e,t,a),i(a)}});else{const c=new Image;c.crossOrigin="anonymous",c.onload=()=>{const a=this.createTexture(t,s,c);this.success(e,t,a),i(a)},c.onerror=()=>{const a=`Couldn't load image: ${t}`;this.error(n,t,a),o(a)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),c.src=t}})}loadTextureAtlas(t,e=()=>{},n=()=>{},s){const i=t.lastIndexOf("/"),o=i>=0?t.substring(0,i+1):"";t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((r,l)=>{this.downloader.downloadText(t,c=>{try{const a=this.createTextureAtlas(c,o,t,s);let h=a.pages.length,m=!1;if(h===0){this.success(e,t,a),r(a);return}for(const y of a.pages)this.loadTexture(this.texturePath(o,y.name,s),(A,u)=>{m||(y.setTexture(u),--h===0&&(this.success(e,t,a),r(a)))},(A,u)=>{if(!m){const g=`Couldn't load texture ${t} page image: ${A}`;this.error(n,t,g),l(g)}m=!0})}catch(a){const h=`Couldn't parse texture atlas ${t}: ${a.message}`;this.error(n,t,h),l(h)}},(c,a)=>{const h=`Couldn't load texture atlas ${t}: status ${c}, ${a}`;this.error(n,t,h),l(h)})}))}loadTextureAtlasButNoTextures(t,e=()=>{},n=()=>{}){const s=t.lastIndexOf("/"),i=s>=0?t.substring(0,s+1):"";t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((o,r)=>{this.downloader.downloadText(t,l=>{try{const c=this.createTextureAtlas(l,i,t);this.success(e,t,c),o(c)}catch(c){const a=`Couldn't parse texture atlas ${t}: ${c.message}`;this.error(n,t,a),r(a)}},(l,c)=>{const a=`Couldn't load texture atlas ${t}: status ${l}, ${c}`;this.error(n,t,a),r(a)})}))}async loadBinaryAsync(t){return new Promise((e,n)=>{this.loadBinary(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadJsonAsync(t){return new Promise((e,n)=>{this.loadJson(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadTextureAsync(t){return new Promise((e,n)=>{this.loadTexture(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadTextureAtlasAsync(t){return new Promise((e,n)=>{this.loadTextureAtlas(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadTextureAtlasButNoTexturesAsync(t){return new Promise((e,n)=>{this.loadTextureAtlasButNoTextures(t,(s,i)=>e(i),(s,i)=>n(i))})}setCache(t){this.cache=t}get(t){return this.cache.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;const e=this.cache.assets[t];if(e)return e;const n=this.errors[t];throw Error(`Asset not found: ${t}${n?` +var ft=Object.defineProperty;var gt=(W,t,e)=>t in W?ft(W,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):W[t]=e;var T=(W,t,e)=>gt(W,typeof t!="symbol"?t+"":t,e);import{f as ht,R as pt,N as dt,ac as ut,Z as mt,b4 as yt,O as rt,b5 as at,U as D,B as Tt}from"./index-CPXvsWyv.js";import{$ as Rt,a0 as Yt,a1 as Ft,a2 as Et,y as _t,a3 as Ot,a4 as kt,a5 as Xt,a6 as Bt,a7 as Nt,a8 as Dt,a9 as $t,aa as zt,ab as Wt,ad as qt,H as Gt,ae as Jt,af as Ht,ag as Zt,ah as Kt,ai as Qt,aj as jt,ak as te,al as ee,am as se,an as ne,ao as ie,ap as oe,aq as re,ar as ae,as as le,at as ce,au as he,av as pe,aw as de,ax as ue,ay as fe,az as ge,aA as me,aB as ye,aC as Te,aD as be,aE as we,aF as xe,aG as Ae,aH as Pe,aI as Ie,aJ as Ce,aK as Ve,aL as Le,aM as Se,aN as Me,aO as ve,aP as Ue,aQ as Re,aR as Ye,aS as Fe,aT as Ee,x as _e,aU as Oe,aV as ke,aW as Xe,aX as Be,aY as Ne,aZ as De,a_ as $e,a$ as ze,b0 as We,b1 as qe,b2 as Ge,b3 as Je,b6 as He,b7 as Ze,b8 as Ke,b9 as Qe,ba as je,bb as ts,bc as es,bd as ss,be as ns,bf as is,bg as os,bh as rs,bi as as,bj as ls,bk as cs,bl as hs,bm as ps,bn as ds,bo as us,bp as fs,bq as gs,br as ms,bs as ys,bt as Ts,bu as bs,w as ws,X as xs,J as As,Y as Ps,z as Is,bv as Cs,bw as Vs,bx as Ls,by as Ss,bz as Ms,bA as vs,bB as Us,bC as Rs,bD as Ys,bE as Fs,bF as Es,bG as _s,T as Os,bH as ks,bI as Xs,b as Bs,bJ as Ns,c as Ds,bK as $s,bL as zs,bM as Ws,bN as qs,bO as Gs,bP as Js,bQ as Hs,bR as Zs,bS as Ks,bT as Qs,bU as js,bV as tn,bW as en,bX as sn,bY as nn,bZ as on,b_ as rn,V as an,b$ as ln,c0 as cn,c1 as hn,c2 as pn,c3 as dn}from"./index-CPXvsWyv.js";class It{constructor(t){T(this,"skeletonData");T(this,"animationToMixTime",{});T(this,"defaultMix",0);if(!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,n){return typeof t=="string"?this.setMix1(t,e,n):this.setMix2(t,e,n)}setMix1(t,e,n){const s=this.skeletonData.findAnimation(t);if(!s)throw new Error(`Animation not found: ${t}`);const i=this.skeletonData.findAnimation(e);if(!i)throw new Error(`Animation not found: ${e}`);this.setMix2(s,i,n)}setMix2(t,e,n){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");const s=`${t.name}.${e.name}`;this.animationToMixTime[s]=n}getMix(t,e){const n=`${t.name}.${e.name}`,s=this.animationToMixTime[n];return s===void 0?this.defaultMix:s}}class Ct{constructor(t,e="",n=new bt,s=new lt){T(this,"textureLoader");T(this,"pathPrefix");T(this,"downloader");T(this,"cache");T(this,"errors",{});T(this,"toLoad",0);T(this,"loaded",0);T(this,"texturePmaInfo",{});this.textureLoader=t,this.pathPrefix=e,this.downloader=n,this.cache=s}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,n){this.toLoad--,this.loaded++,this.cache.assets[e]=n,this.cache.assetsRefCount[e]=(this.cache.assetsRefCount[e]||0)+1,t&&t(e,n)}error(t,e,n){this.toLoad--,this.loaded++,this.errors[e]=n,t&&t(e,n)}loadAll(){return new Promise((e,n)=>{const s=()=>{if(this.isLoadingComplete()){this.hasErrors()?n(this.errors):e(this);return}requestAnimationFrame(s)};requestAnimationFrame(s)})}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=()=>{},n=()=>{}){t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((s,i)=>{this.downloader.downloadBinary(t,o=>{this.success(e,t,o),s(o)},(o,r)=>{const l=`Couldn't load binary ${t}: status ${o}, ${r}`;this.error(n,t,l),i(l)})}))}loadText(t,e=()=>{},n=()=>{}){t=this.start(t),this.downloader.downloadText(t,s=>{this.success(e,t,s)},(s,i)=>{this.error(n,t,`Couldn't load text ${t}: status ${s}, ${i}`)})}loadJson(t,e=()=>{},n=()=>{}){t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((s,i)=>{this.downloader.downloadJson(t,o=>{this.success(e,t,o),s(o)},(o,r)=>{const l=`Couldn't load JSON ${t}: status ${o}, ${r}`;this.error(n,t,l),i(l)})}))}reuseAssets(t,e=()=>{},n=()=>{}){const s=this.cache.getAsset(t),i=s!==void 0;return i&&(this.cache.assetsLoaded[t]=s.then(o=>(o=o instanceof Image||o instanceof ImageBitmap?this.textureLoader(o):o,this.success(e,t,o),o)).catch(o=>{this.error(n,t,o)})),i}loadTexture(t,e=()=>{},n=()=>{}){if(t=this.start(t),this.reuseAssets(t,e,n))return;const s=this.texturePmaInfo[t];this.cache.assetsLoaded[t]=new Promise((i,o)=>{if(!!!(typeof window<"u"&&typeof navigator<"u"&&window.document))fetch(t,{mode:"cors"}).then(c=>{if(c.ok)return c.blob();const a=`Couldn't load image: ${t}`;this.error(n,t,`Couldn't load image: ${t}`),o(a)}).then(c=>c?createImageBitmap(c,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(c=>{if(c){const a=this.createTexture(t,s,c);this.success(e,t,a),i(a)}});else{const c=new Image;c.crossOrigin="anonymous",c.onload=()=>{const a=this.createTexture(t,s,c);this.success(e,t,a),i(a)},c.onerror=()=>{const a=`Couldn't load image: ${t}`;this.error(n,t,a),o(a)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),c.src=t}})}loadTextureAtlas(t,e=()=>{},n=()=>{},s){const i=t.lastIndexOf("/"),o=i>=0?t.substring(0,i+1):"";t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((r,l)=>{this.downloader.downloadText(t,c=>{try{const a=this.createTextureAtlas(c,o,t,s);let h=a.pages.length,m=!1;if(h===0){this.success(e,t,a),r(a);return}for(const y of a.pages)this.loadTexture(this.texturePath(o,y.name,s),(A,u)=>{m||(y.setTexture(u),--h===0&&(this.success(e,t,a),r(a)))},(A,u)=>{if(!m){const g=`Couldn't load texture ${t} page image: ${A}`;this.error(n,t,g),l(g)}m=!0})}catch(a){const h=`Couldn't parse texture atlas ${t}: ${a.message}`;this.error(n,t,h),l(h)}},(c,a)=>{const h=`Couldn't load texture atlas ${t}: status ${c}, ${a}`;this.error(n,t,h),l(h)})}))}loadTextureAtlasButNoTextures(t,e=()=>{},n=()=>{}){const s=t.lastIndexOf("/"),i=s>=0?t.substring(0,s+1):"";t=this.start(t),!this.reuseAssets(t,e,n)&&(this.cache.assetsLoaded[t]=new Promise((o,r)=>{this.downloader.downloadText(t,l=>{try{const c=this.createTextureAtlas(l,i,t);this.success(e,t,c),o(c)}catch(c){const a=`Couldn't parse texture atlas ${t}: ${c.message}`;this.error(n,t,a),r(a)}},(l,c)=>{const a=`Couldn't load texture atlas ${t}: status ${l}, ${c}`;this.error(n,t,a),r(a)})}))}async loadBinaryAsync(t){return new Promise((e,n)=>{this.loadBinary(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadJsonAsync(t){return new Promise((e,n)=>{this.loadJson(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadTextureAsync(t){return new Promise((e,n)=>{this.loadTexture(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadTextureAtlasAsync(t){return new Promise((e,n)=>{this.loadTextureAtlas(t,(s,i)=>e(i),(s,i)=>n(i))})}async loadTextureAtlasButNoTexturesAsync(t){return new Promise((e,n)=>{this.loadTextureAtlasButNoTextures(t,(s,i)=>e(i),(s,i)=>n(i))})}setCache(t){this.cache=t}get(t){return this.cache.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;const e=this.cache.assets[t];if(e)return e;const n=this.errors[t];throw Error(`Asset not found: ${t}${n?` ${n}`:""}`)}remove(t){t=this.pathPrefix+t;const e=this.cache.assets[t];return e.dispose&&e.dispose(),delete this.cache.assets[t],delete this.cache.assetsRefCount[t],delete this.cache.assetsLoaded[t],e}removeAll(){for(const t in this.cache.assets){const e=this.cache.assets[t];e.dispose&&e.dispose()}this.cache.assets={},this.cache.assetsLoaded={},this.cache.assetsRefCount={}}isLoadingComplete(){return this.toLoad===0}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}disposeAsset(t){const e=this.cache.assets[t];if(e instanceof ht){e.dispose();return}this.disposeAssetInternal(t)}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}disposeAssetInternal(t){if(this.cache.assetsRefCount[t]>0&&--this.cache.assetsRefCount[t]===0)return this.remove(t)}createTextureAtlas(t,e,n,s){const i=new ht(t);i.dispose=()=>{var o;if(!(this.cache.assetsRefCount[n]<=0)){this.disposeAssetInternal(n);for(const r of i.pages)(o=r.texture)==null||o.dispose()}};for(const o of i.pages){const r=this.texturePath(e,o.name,s);this.texturePmaInfo[this.pathPrefix+r]=o.pma}return i}createTexture(t,e,n){const s=this.textureLoader(n,e),i=s.dispose.bind(s);return s.dispose=()=>{this.disposeAssetInternal(t)&&i()},s}texturePath(t,e,n){return n?n[e]:t+e}}const nt=class nt{constructor(){T(this,"assets",{});T(this,"assetsRefCount",{});T(this,"assetsLoaded",{})}static getCache(t){const e=nt.AVAILABLE_CACHES.get(t);if(e)return e;const n=new nt;return nt.AVAILABLE_CACHES.set(t,n),n}async addAsset(t,e){return this.assetsLoaded[t]=Promise.resolve(e),this.assets[t]=e,e}getAsset(t){return this.assetsLoaded[t]}};T(nt,"AVAILABLE_CACHES",new Map);let lt=nt;class bt{constructor(){T(this,"callbacks",{});T(this,"rawDataUris",{})}dataUriToString(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");return e!==-1?(e+=7,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}base64ToUint8Array(t){var e=window.atob(t),n=e.length,s=new Uint8Array(n);for(let i=0;i{this.finish(t,i.status,i.responseText)};i.onload=o,i.onerror=o,i.send()}downloadJson(t,e,n){this.downloadText(t,s=>{e(JSON.parse(s))},n)}downloadBinary(t,e,n){if(this.start(t,e,n))return;const s=this.rawDataUris[t];if(s&&!s.includes(".")){try{this.finish(t,200,this.dataUriToUint8Array(s))}catch(r){this.finish(t,400,JSON.stringify(r))}return}const i=new XMLHttpRequest;i.open("GET",s||t,!0),i.responseType="arraybuffer";const o=()=>{this.finish(t,i.status,i.response)};i.onload=()=>{i.status===200||i.status===0?this.finish(t,200,new Uint8Array(i.response)):o()},i.onerror=o,i.send()}start(t,e,n){let s=this.callbacks[t];try{if(s)return!0;this.callbacks[t]=s=[]}finally{s.push(e,n)}}finish(t,e,n){const s=this.callbacks[t];if(delete this.callbacks[t],e===200||e===0)for(let i=0,o=s.length;iD.newFloatArray(16)))}update(t,e){if(!t)throw new Error("skeleton cannot be null.");const n=this.boundingBoxes,s=this.polygons,i=this.polygonPool,o=t.slots,r=o.length;n.length=0,i.freeAll(s),s.length=0;for(let l=0;l=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,n,s){const i=this.minX,o=this.minY,r=this.maxX,l=this.maxY;if(t<=i&&n<=i||e<=o&&s<=o||t>=r&&n>=r||e>=l&&s>=l)return!1;const c=(s-e)/(n-t);let a=c*(i-t)+e;if(a>o&&ao&&ai&&hi&&ht.minX&&this.minYt.minY}containsPoint(t,e){const n=this.polygons;for(let s=0,i=n.length;s=n||a=n){const h=s[l];h+(n-c)/(a-c)*(s[o]-h)=h&&f<=A||f>=A&&f<=h)&&(f>=e&&f<=s||f>=s&&f<=e)){const x=(a*L-c*g)/C;if((x>=m&&x<=u||x>=u&&x<=m)&&(x>=n&&x<=i||x>=i&&x<=n))return!0}h=A,m=u}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");const e=this.boundingBoxes.indexOf(t);return e===-1?null:this.polygons[e]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}}class z{constructor(){T(this,"convexPolygons",[]);T(this,"convexPolygonsIndices",[]);T(this,"indicesArray",[]);T(this,"isConcaveArray",[]);T(this,"triangles",[]);T(this,"polygonPool",new at(()=>[]));T(this,"polygonIndicesPool",new at(()=>[]))}triangulate(t){const e=t;let n=t.length>>1;const s=this.indicesArray;s.length=0;for(let r=0;r3;){let r=n-1,l=0,c=1;for(;;){t:if(!i[l]){const m=s[r]<<1,y=s[l]<<1,A=s[c]<<1,u=e[m],g=e[m+1],b=e[y],L=e[y+1],C=e[A],f=e[A+1];for(let x=c+10);r=l>0?l-1:n-1,c=l+10?l-1:n-1,h=l0&&(s.push(r),i.push(o),r=this.polygonPool.obtain(),o=this.polygonIndicesPool.obtain()),r.length=0,r.push(u,g,b,L),r.push(C,f),o.length=0,o.push(m,y,A),c=z.winding(u,g,b,L,C,f),l=m}r.length>0&&(s.push(r),i.push(o));for(let a=0,h=s.length;a=0;a--)r=s[a],r.length===0?(s.splice(a,1),this.polygonPool.free(r),o=i[a],i.splice(a,1),this.polygonIndicesPool.free(o)):r.push(r[0],r[1]);return s}static isConcave(t,e,n,s){const i=s[t>0?t-1:e-1]<<1,o=s[t]<<1,r=s[t+1=0}static winding(t,e,n,s,i,o){return t*(o-s)+n*(e-o)+i*(s-e)>=0?1:-1}}class wt{constructor(){T(this,"triangulator",null);T(this,"clippingPolygon",[]);T(this,"clippingPolygons",[]);T(this,"clipOutput",[]);T(this,"clippedVertices",[]);T(this,"clippedUVs",[]);T(this,"clippedTriangles",[]);T(this,"inverseVertices",[]);T(this,"_clippedVerticesTyped",new Float32Array(1024));T(this,"_clippedUVsTyped",new Float32Array(1024));T(this,"_clippedTrianglesTyped",new Uint16Array(1024));T(this,"clippedVerticesTyped",new Float32Array(0));T(this,"clippedUVsTyped",new Float32Array(0));T(this,"clippedTrianglesTyped",new Uint16Array(0));T(this,"clippedVerticesLength",0);T(this,"clippedUVsLength",0);T(this,"clippedTrianglesLength",0);T(this,"scratch",[]);T(this,"inverse",!1);T(this,"clipAttachment",null)}clipStart(t,e,n){if(this.clipAttachment)return;const s=n.worldVerticesLength;this.clipAttachment=n,this.inverse=n.inverse;const i=D.setArraySize(this.clippingPolygon,s);n.computeWorldVertices(t,e,0,s,i,0,2);const o=this.clippingPolygon,r=this.makeClockwise(o);r||this.inverse||n.convex?(r||this.makeConvex(o),this.clippingPolygon.push(o[0],o[1]),this.clippingPolygons.push(o)):(this.triangulator===null&&(this.triangulator=new z),this.clippingPolygons.push(...this.triangulator.decompose(o,this.triangulator.triangulate(o))))}clipEnd(t){this.clipAttachment&&(t&&this.clipAttachment.endSlot!==t.data||(this.clipAttachment=null,this.clippingPolygons.length=0))}isClipping(){return this.clipAttachment!=null}clipTriangles(t,e,n,s,i,o,r,l){return s&&i&&o&&typeof r=="boolean"&&typeof l=="number"?this.clipTrianglesRender(t,e,n,s,i,o,r,l):this.clipTrianglesNoRender(t,e,n)}clipTrianglesNoRender(t,e,n){const s=this.clippedVertices;s.length=0;const i=this.clippedTriangles;i.length=0;let o=0;if(this.inverse){const h=this.clippingPolygons[0];for(let m=0;m>1,I=s.length;const R=D.setArraySize(s,I+P);D.arrayCopy(f,x,R,I,P),I=i.length;const v=D.setArraySize(i,I+3*(M-2));for(let V=1;V>1;const P=D.setArraySize(s,f+x);D.arrayCopy(a,0,P,f,x),f=i.length;const M=D.setArraySize(i,f+3*(S-2));S--;for(let I=1;I>1;let F=c.length;const N=D.setArraySize(c,F+G*l);for(let X=0;X>1;q===0&&(U=P-v,O=R-S,B=L-R,K=v-C,q=1/(U*B-O*K));const E=D.setArraySize(c,d+_*l);for(let Y=0;Y>1;let Y=this.clippedVerticesLength;const G=Y+k*o,F=this.clippedUVsLength+k*2;r.length>1;J===0&&(O=M-V,B=v-P,K=L-v,q=V-C,J=1/(O*K-B*q));const k=p+E*o;r.length=2?(a=this.clipOutput,h=this.scratch):(a=this.scratch,h=this.clipOutput);const m=r;a.length=8;const y=a;y[0]=t,y[1]=e,y[2]=n,y[3]=s,y[4]=i,y[5]=o,y[6]=t,y[7]=e,h.length=0;const A=r.length-4;for(let u=0;;u+=2){const g=m[u],b=m[u+1],L=g-m[u+2],C=b-m[u+3],f=h.length,x=a;t=x[0],e=x[1];let S=C*(g-t)-L*(b-e);for(let M=2,I=a.length-2;M<=I;M+=2){n=x[M],s=x[M+1];const R=C*(g-n)-L*(b-s);if(S>0)if(R>0)h.push(n,s);else{const v=n-t,V=s-e,w=S/(v*C-V*L);w>=0&&w<=1?(h.push(t+v*w,e+V*w),c=!0):h.push(n,s)}else if(R>0){const v=n-t,V=s-e,w=S/(v*C-V*L);w>=0&&w<=1?(h.push(t+v*w,e+V*w,n,s),c=!0):h.push(n,s)}else c=!0;t=n,e=s,S=R}if(f===h.length)return l.length=0,!0;if(h.push(h[0],h[1]),u===A)break;const P=h;h=a,h.length=0,a=P}if(l!==h){l.length=0;for(let u=0,g=h.length-2;u=2?(c=this.clipOutput,a=this.scratch):(c=this.scratch,a=this.clipOutput),c.length=8;let h=r,m=c;m[0]=t,m[1]=e,m[2]=n,m[3]=s,m[4]=i,m[5]=o,m[6]=t,m[7]=e,a.length=0;for(let y=0;;y+=2){const A=h[y],u=h[y+1],g=A-h[y+2],b=u-h[y+3],L=a.length,C=this.inverseVertices.length;this.inverseVertices.push(0),m=c,t=m[0],e=m[1];let f=b*(A-t)-g*(u-e);for(let P=2,M=c.length-2;P<=M;P+=2){n=m[P],s=m[P+1];const I=b*(A-n)-g*(u-s);if(f>0)if(I>0)a.push(n,s);else{const R=n-t,v=s-e,V=f/(R*b-v*g);if(V>=0&&V<=1){const w=t+R*V,U=e+v*V;a.push(w,U),this.inverseVertices.push(w,U,n,s)}else a.push(n,s)}else if(I>0){const R=n-t,v=s-e,V=f/(R*b-v*g);if(V>=0&&V<=1){const w=t+R*V,U=e+v*V;this.inverseVertices.push(w,U),a.push(w,U,n,s)}else a.push(n,s)}else this.inverseVertices.push(n,s);t=n,e=s,f=I}const x=this.inverseVertices.length-C-1;if(x>=6?this.inverseVertices[C]=x:this.inverseVertices.length=C,L===a.length||(a.push(a[0],a[1]),y===l))break;const S=a;a=c,a.length=0,c=S}}makeClockwise(t){const e=t,n=t.length;let s=!0,i=!0,o=0,r=e[n-2],l=e[n-1],c=e[0],a=e[1];for(let m=2;m=0,r=c,l=a,c=y,a=A}o+=c*e[1]-e[0]*a;const h=(c-r)*(e[1]-a)-(a-l)*(e[0]-c);if(i=i&&h<=0,s=s&&h>=0,o>=0){for(let m=0,y=n-2,A=n>>1;m=0&&(s[a]>l||s[a]===l&&s[a+1]>c);a-=2)s[a+2]=s[a],s[a+3]=s[a+1];s[a+2]=l,s[a+3]=c}n[0]=s[0],n[1]=s[1],n[2]=s[2],n[3]=s[3];let i=4;for(let r=4;r=0&&(i-=2,i!==2););n[i]=l,n[i+1]=c}n[i]=s[e-4],n[i+1]=s[e-3];const o=i;i+=2;for(let r=e-6;r>=0;r-=2,i+=2){const l=s[r],c=s[r+1];for(;(n[i-2]-n[i-4])*(c-n[i-3])-(n[i-1]-n[i-3])*(l-n[i-4])>=0&&(i-=2,i!==o););n[i]=l,n[i+1]=c}t.length=i-2}}class St{constructor(t,e,n={}){T(this,"skeleton");T(this,"adapter");T(this,"positionInheritanceFactorX",0);T(this,"positionInheritanceFactorY",0);T(this,"rotationInheritanceFactor",0);T(this,"hasLastTransform",!1);T(this,"lastX",0);T(this,"lastY",0);T(this,"lastZ",0);T(this,"lastRotation",0);T(this,"currentTransform",{x:0,y:0,z:0,rotation:0});T(this,"currentPosition",{x:0,y:0,z:0});T(this,"lastPosition",{x:0,y:0,z:0});this.skeleton=t,this.adapter=e,this.positionInheritanceFactorX=n.positionInheritanceX??0,this.positionInheritanceFactorY=n.positionInheritanceY??0,this.rotationInheritanceFactor=n.rotationInheritance??0}get positionInheritanceX(){return this.positionInheritanceFactorX}get positionInheritanceY(){return this.positionInheritanceFactorY}setPositionInheritance(t,e){const n=this.positionInheritanceFactorX===0&&this.positionInheritanceFactorY===0,s=t!==0||e!==0;this.positionInheritanceFactorX=t,this.positionInheritanceFactorY=e,n&&s&&this.resetPosition()}get rotationInheritance(){return this.rotationInheritanceFactor}set rotationInheritance(t){const e=this.rotationInheritanceFactor===0;this.rotationInheritanceFactor=t,e&&t!==0&&this.resetRotation()}resetPosition(){const t=this.currentTransform,e=!this.hasLastTransform&&this.rotationInheritanceFactor!==0;this.adapter.readTransform(t,e),this.lastX=t.x,this.lastY=t.y,this.lastZ=t.z,e&&(this.lastRotation=t.rotation),this.hasLastTransform=!0}resetRotation(){const t=this.currentTransform;this.adapter.readTransform(t,!0),this.lastRotation=t.rotation,this.hasLastTransform||(this.lastX=t.x,this.lastY=t.y,this.lastZ=t.z),this.hasLastTransform=!0}resetTransform(){const t=this.currentTransform;this.adapter.readTransform(t,!0),this.setLastTransform(t.x,t.y,t.z,t.rotation)}applyTransformMovement(){const t=this.positionInheritanceFactorX!==0||this.positionInheritanceFactorY!==0,e=this.rotationInheritanceFactor!==0;if(!t&&!e)return;const n=this.currentTransform;this.adapter.readTransform(n,e);const{x:s,y:i,z:o}=n,r=e?n.rotation:this.lastRotation,l=s!==this.lastX||i!==this.lastY||o!==this.lastZ;if(this.hasLastTransform){if(!l&&r===this.lastRotation)return;t&&l&&this.applyPositionMovement(s,i,o),e&&r!==this.lastRotation&&this.applyRotationMovement(r)}this.setLastTransform(s,i,o,r)}applyPositionMovement(t,e,n){const s=this.currentPosition;s.x=t,s.y=e,s.z=n,this.adapter.worldToSkeleton(s);const i=this.lastPosition;i.x=this.lastX,i.y=this.lastY,i.z=this.lastZ,this.adapter.worldToSkeleton(i),this.skeleton.physicsTranslate((s.x-i.x)*this.positionInheritanceFactorX,(s.y-i.y)*this.positionInheritanceFactorY)}applyRotationMovement(t){const e=this.rotationInheritanceFactor;e!==0&&this.skeleton.physicsRotate(0,0,this.getRotationDelta(t,this.lastRotation)*e)}setLastTransform(t,e,n,s){this.lastX=t,this.lastY=e,this.lastZ=n,this.lastRotation=s,this.hasLastTransform=!0}getRotationDelta(t,e){let n=t-e;return n=(n+180)%360-180,n<-180?n+360:n}}class Mt{constructor(){T(this,"commandPool",new xt);T(this,"worldVertices",new Float32Array(12*1024));T(this,"quadIndices",new Uint16Array([0,1,2,2,3,0]));T(this,"clipping",new wt);T(this,"renderCommands",[])}render(t,e=!1,n,s=2,i=0){var c,a;this.commandPool.reset(),this.renderCommands.length=0;const o=this.clipping;let r=0;const l=t.drawOrder.appliedPose;for(let h=0,m=l.length;h>1;const w=u.sequence,U=w.resolveIndex(A);f=w.getUVs(U),x=u.triangles,S=x.length,M=(a=w.regions[U])==null?void 0:a.texture}else if(u instanceof rt){o.clipEnd(y),o.clipStart(t,y,u);continue}else{o.clipEnd(y);continue}if(!M){o.clipEnd(y);continue}const I=t.color;let R,v;if(e){let w;if(n){w=Math.floor(n[3]*I.a*g.a*P.a*255);const U=Math.floor(w*n[0]*I.r*g.r*P.r),O=Math.floor(w*n[1]*I.g*g.g*P.g),B=Math.floor(w*n[2]*I.b*g.b*P.b);R=w<<24|U<<16|O<<8|B}else{w=Math.floor(I.a*g.a*P.a*255);const U=Math.floor(w*I.r*g.r*P.r),O=Math.floor(w*I.g*g.g*P.g),B=Math.floor(w*I.b*g.b*P.b);R=w<<24|U<<16|O<<8|B}if(v=4278190080,A.darkColor){const{r:U,g:O,b:B}=A.darkColor;v=4278190080|Math.floor(U*w)<<16|Math.floor(O*w)<<8|Math.floor(B*w)}}else{if(n){const w=Math.floor(n[3]*I.a*g.a*P.a*255),U=Math.floor(n[0]*I.r*g.r*P.r*255),O=Math.floor(n[1]*I.g*g.g*P.g*255),B=Math.floor(n[2]*I.b*g.b*P.b*255);R=w<<24|U<<16|O<<8|B}else{const w=Math.floor(I.a*g.a*P.a*255),U=Math.floor(I.r*g.r*P.r*255),O=Math.floor(I.g*g.g*P.g*255),B=Math.floor(I.b*g.b*P.b*255);R=w<<24|U<<16|O<<8|B}if(v=0,A.darkColor){const{r:w,g:U,b:O}=A.darkColor;v=Math.floor(w*255)<<16|Math.floor(U*255)<<8|Math.floor(O*255)}}o.isClipping()&&(o.clipTrianglesUnpacked(L,0,x,S,f,s),L=o.clippedVerticesTyped,C=o.clippedVerticesLength/s,f=o.clippedUVsTyped,x=o.clippedTrianglesTyped,S=o.clippedTrianglesLength);const V=this.commandPool.getCommand(C,S,s);if(V.blendMode=y.data.blendMode,V.texture=M,V.positions.set(L.subarray(0,C*s)),s>=3)for(let w=2,U=C*s;w=t*n&&i._indices.length>=e){s=i;break}if(s)this.pool.splice(this.pool.indexOf(s),1),s.next=void 0,s.numVertices=t,s.numIndices=e,s.positions=s._positions.subarray(0,t*n),s.uvs=s._uvs.subarray(0,t<<1),s.colors=s._colors.subarray(0,t),s.darkColors=s._darkColors.subarray(0,t),s.indices=s._indices.subarray(0,e);else{const i=new Float32Array(t*n),o=new Float32Array(t<<1),r=new Uint32Array(t),l=new Uint32Array(t),c=new Uint16Array(e);s={positions:i,uvs:o,colors:r,darkColors:l,indices:c,_positions:i,_uvs:o,_colors:r,_darkColors:l,_indices:c,numVertices:t,numIndices:e,blendMode:Tt.Normal,texture:null}}return this.inUse.push(s),s}reset(){this.pool.push(...this.inUse),this.inUse.length=0}}export{Rt as ATTACH_RETAIN,Yt as ATTACH_SETUP,Ft as AlphaTimeline,Et as Animation,_t as AnimationState,Ot as AnimationStateAdapter,It as AnimationStateData,lt as AssetCache,Ct as AssetManagerBase,Vt as AtlasAttachmentLoader,kt as Attachment,Xt as AttachmentTimeline,Bt as BinaryInput,Tt as BlendMode,Nt as Bone,Dt as BoneData,$t as BonePose,zt as BoneTimeline1,Wt as BoneTimeline2,ut as BoundingBoxAttachment,qt as CURRENT,rt as ClippingAttachment,Gt as Color,Jt as Constraint,Ht as ConstraintData,Zt as ConstraintTimeline1,Kt as CurveTimeline,Qt as CurveTimeline1,jt as DebugUtils,te as DeformTimeline,bt as Downloader,ee as DrawOrder,se as DrawOrderFolderTimeline,ne as DrawOrderTimeline,ie as Event,oe as EventData,re as EventQueue,ae as EventTimeline,le as EventType,ce as FIRST,he as FakeTexture,pe as FromProperty,de as FromRotate,ue as FromScaleX,fe as FromScaleY,ge as FromShearY,me as FromX,ye as FromY,Te as HOLD,be as IkConstraint,we as IkConstraintData,xe as IkConstraintPose,Ae as IkConstraintTimeline,Pe as Inherit,Ie as InheritTimeline,Ce as IntSet,Ve as Interpolation,Le as MODE,Se as MathUtils,dt as MeshAttachment,Me as MixFrom,mt as PathAttachment,ve as PathConstraint,Ue as PathConstraintData,Re as PathConstraintMixTimeline,Ye as PathConstraintPose,Fe as PathConstraintPositionTimeline,Ee as PathConstraintSpacingTimeline,_e as Physics,Oe as PhysicsConstraint,ke as PhysicsConstraintDampingTimeline,Xe as PhysicsConstraintData,Be as PhysicsConstraintGravityTimeline,Ne as PhysicsConstraintInertiaTimeline,De as PhysicsConstraintMassTimeline,$e as PhysicsConstraintMixTimeline,ze as PhysicsConstraintPose,We as PhysicsConstraintResetTimeline,qe as PhysicsConstraintStrengthTimeline,Ge as PhysicsConstraintTimeline,Je as PhysicsConstraintWindTimeline,yt as PointAttachment,at as Pool,He as Posed,Ze as PosedActive,Ke as PosedData,Qe as PositionMode,je as Pow,ts as PowOut,es as Property,ss as RGB2Timeline,ns as RGBA2Timeline,is as RGBATimeline,os as RGBTimeline,pt as RegionAttachment,rs as RotateMode,as as RotateTimeline,ls as SETUP,cs as ScaleTimeline,hs as ScaleXTimeline,ps as ScaleYMode,ds as ScaleYTimeline,us as Sequence,fs as SequenceMode,gs as SequenceModeValues,ms as SequenceTimeline,ys as ShearTimeline,Ts as ShearXTimeline,bs as ShearYTimeline,ws as Skeleton,xs as SkeletonBinary,Lt as SkeletonBounds,wt as SkeletonClipping,As as SkeletonData,Ps as SkeletonJson,St as SkeletonPhysicsMovement,Mt as SkeletonRendererCore,Is as Skin,Cs as SkinEntry,Vs as Slider,Ls as SliderData,Ss as SliderMixTimeline,Ms as SliderPose,vs as SliderTimeline,Us as Slot,Rs as SlotCurveTimeline,Ys as SlotData,Fs as SlotPose,Es as SpacingMode,_s as StringSet,Os as Texture,ht as TextureAtlas,ks as TextureAtlasPage,Xs as TextureAtlasRegion,Bs as TextureFilter,Ns as TextureRegion,Ds as TextureWrap,$s as TimeKeeper,zs as Timeline,Ws as ToProperty,qs as ToRotate,Gs as ToScaleX,Js as ToScaleY,Hs as ToShearY,Zs as ToX,Ks as ToY,Qs as TrackEntry,js as TransformConstraint,tn as TransformConstraintData,en as TransformConstraintPose,sn as TransformConstraintTimeline,nn as TranslateTimeline,on as TranslateXTimeline,rn as TranslateYTimeline,z as Triangulator,D as Utils,an as Vector2,ln as VertexAttachment,cn as WindowedMean,hn as isBoneTimeline,pn as isConstraintTimeline,dn as isSlotTimeline}; diff --git a/dist/assets/index-DvMPoOSF.css b/dist/assets/index-DvMPoOSF.css new file mode 100644 index 0000000..6b12607 --- /dev/null +++ b/dist/assets/index-DvMPoOSF.css @@ -0,0 +1 @@ +.help-overlay[data-v-78204b9d]{position:absolute;top:0;right:0;bottom:0;left:0;z-index:40;display:flex;align-items:center;justify-content:center;padding:72px 24px 28px;box-sizing:border-box;background:#05080fb8;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.help-dialog[data-v-78204b9d]{width:min(820px,100%);max-height:100%;display:flex;flex-direction:column;overflow:hidden;border:1px solid #3a4864;border-radius:14px;background:#141a27;color:#b8c3d8;box-shadow:0 22px 70px #0000009e}.help-head[data-v-78204b9d]{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:18px 20px 15px;border-bottom:1px solid #2b354a;background:linear-gradient(135deg,#202942,#181e2d)}.help-head h2[data-v-78204b9d]{margin:0;color:#eef2ff;font-size:19px}.help-head p[data-v-78204b9d]{margin:5px 0 0;color:#7786a3;font-size:11px}.help-close[data-v-78204b9d]{width:28px;height:28px;flex:0 0 28px;border:1px solid #43516b;border-radius:6px;background:#273249;color:#ccd7ed;cursor:pointer}.help-close[data-v-78204b9d]:hover{border-color:#7774ff;background:#3b4670;color:#fff}.help-body[data-v-78204b9d]{min-height:0;overflow:auto;padding:18px 20px 21px}.help-section[data-v-78204b9d]{padding:14px 15px;border:1px solid #2c3850;border-radius:10px;background:#181f2e}.help-section h3[data-v-78204b9d]{margin:0 0 11px;color:#9fb2ff;font-size:13px}.help-start ol[data-v-78204b9d]{margin:0;padding-left:21px;color:#aab6cc;font-size:12px;line-height:1.75}.help-start li[data-v-78204b9d]::marker{color:#7774ff;font-weight:700}.help-section b[data-v-78204b9d]{color:#dce4f7}.help-grid[data-v-78204b9d]{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(250px,.85fr);gap:12px;margin-top:12px}.help-list[data-v-78204b9d]{display:grid;gap:0;margin:0}.help-list>div[data-v-78204b9d]{display:grid;grid-template-columns:78px 1fr;gap:9px;padding:7px 0;border-bottom:1px solid #263146}.help-list>div[data-v-78204b9d]:last-child{border-bottom:0}.help-list dt[data-v-78204b9d]{color:#d3dcf0;font-size:11px;font-weight:700}.help-list dd[data-v-78204b9d]{margin:0;color:#8795ae;font-size:11px;line-height:1.5}.shortcut-list[data-v-78204b9d]{display:grid;gap:7px}.shortcut-list>div[data-v-78204b9d]{display:flex;align-items:center;min-height:25px;gap:5px}.shortcut-list kbd[data-v-78204b9d]{min-width:24px;box-sizing:border-box;padding:3px 6px;border:1px solid #465470;border-bottom-width:2px;border-radius:5px;background:#101623;color:#e0e7f6;font:10px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;text-align:center}.shortcut-list span[data-v-78204b9d]{color:#65728b;font-size:10px}.shortcut-list em[data-v-78204b9d]{margin-left:auto;color:#9ca9c1;font-size:11px;font-style:normal}.help-note[data-v-78204b9d]{margin:11px 0 0;padding-top:9px;border-top:1px solid #2a3549;color:#697791;font-size:10px;line-height:1.55}.help-export[data-v-78204b9d]{margin-top:12px}.help-export p[data-v-78204b9d]{margin:0;color:#8997b0;font-size:11px;line-height:1.65}.help-doc-title[data-v-78204b9d]{margin:16px 2px 2px;color:#9fb2ff;font-size:13px;font-weight:700;letter-spacing:.5px}.help-module[data-v-78204b9d]{margin-top:12px}.help-module-head[data-v-78204b9d]{display:flex;align-items:center;gap:8px;width:100%;padding:0;border:0;background:transparent;color:#9fb2ff;font:inherit;font-size:13px;font-weight:700;text-align:left;cursor:pointer}.help-module-head[data-v-78204b9d]:hover{color:#fff}.help-module-head .mtitle[data-v-78204b9d]{flex:1;min-width:0}.help-module-head .caret[data-v-78204b9d]{flex:0 0 auto;color:#7b86a2;font-size:12px}.help-module.open .help-module-head[data-v-78204b9d]{color:#fff}.help-module.open .help-module-head .caret[data-v-78204b9d]{color:#9fb2ff}.help-module .mnum[data-v-78204b9d]{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:6px;background:linear-gradient(135deg,#4a53b8,#6a5fd0);color:#fff;font-size:12px;font-weight:700}.help-module.help-connector[data-v-78204b9d]{border-color:#4a4f8a;background:linear-gradient(135deg,#1d2442,#181d2f)}.help-module.help-connector .help-module-head[data-v-78204b9d]{color:#b8c2ff}.help-module .connector-intro[data-v-78204b9d]{margin:0 0 10px;color:#9aa8c4;font-size:11px;line-height:1.6}.help-module .connector-intro b[data-v-78204b9d]{color:#dce4f7}.help-module .dl-link[data-v-78204b9d]{display:inline-flex;flex-direction:column;align-items:flex-start;gap:2px;margin:0 10px 6px 0;padding:6px 12px;border:1px solid #5652b5;border-radius:6px;background:#4540a0;color:#fff;font-size:12px;font-weight:700;text-decoration:none}.help-module .dl-link[data-v-78204b9d]:hover{border-color:#8982ff;background:#554dc2}.help-module .dl-link small[data-v-78204b9d]{color:#cfe0ff;font-weight:500;font-size:9px}.help-module-body[data-v-78204b9d]{padding-top:10px}@media(max-width:760px){.help-overlay[data-v-78204b9d]{padding:66px 12px 14px}.help-grid[data-v-78204b9d]{grid-template-columns:1fr}}.topbar[data-v-4749834a]{position:absolute;top:10px;left:10px;right:10px;display:flex;align-items:center;gap:10px;padding:8px 12px;background:#141420d9;border-radius:10px;border:1px solid rgba(255,255,255,.08);font-size:12px;color:#aab;z-index:5;flex-wrap:wrap}.topbar input[type=range][data-v-4749834a]{background:#1a1a28;border:1px solid #2e2e44;color:#dde;border-radius:5px}.tool-group[data-v-4749834a]{display:flex;gap:6px;margin-left:6px;padding-left:12px;border-left:1px solid #2a2a3c}.tool-btn[data-v-4749834a]{width:30px;height:26px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:14px;cursor:pointer;display:flex;align-items:center;justify-content:center}.tool-btn[data-v-4749834a]:hover{background:#2b3a5c;color:#fff}.tool-btn.on[data-v-4749834a]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.background-menu[data-v-4749834a]{position:relative;flex:0 0 auto}.background-btn[data-v-4749834a]{height:28px;padding:0 11px;border:1px solid #3a4963;border-radius:6px;background:#202a3b;color:#cbd7ed;font-size:12px;cursor:pointer}.background-btn[data-v-4749834a]:hover,.background-btn.on[data-v-4749834a]{border-color:#7774ff;background:#343b63;color:#fff}.background-panel[data-v-4749834a]{position:absolute;top:calc(100% + 9px);right:0;width:248px;box-sizing:border-box;padding:10px;border:1px solid #343b50;border-radius:9px;background:#141420fa;color:#aeb8cc;box-shadow:0 8px 24px #0000007a;z-index:12}.background-upload[data-v-4749834a]{width:100%;height:30px;border:1px solid #5652b5;border-radius:6px;background:#4540a0;color:#fff;cursor:pointer}.background-upload[data-v-4749834a]:hover{border-color:#8982ff;background:#554dc2}.background-clear[data-v-4749834a]{width:100%;height:28px;margin-top:6px;border:1px solid #70404a;border-radius:6px;background:#512a33;color:#efb5bd;cursor:pointer}.background-clear[data-v-4749834a]:hover:not(:disabled){border-color:#b65b6a;background:#6a303b;color:#fff}.background-clear[data-v-4749834a]:disabled{opacity:.42;cursor:not-allowed}.background-file-input[data-v-4749834a]{display:none}.background-file-name[data-v-4749834a]{margin:7px 2px 9px;overflow:hidden;color:#737f98;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.background-position-row[data-v-4749834a]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.background-position-row label[data-v-4749834a]{display:flex;align-items:center;gap:5px;color:#8995ad;font-size:11px}.background-position-row input[data-v-4749834a]{width:0;min-width:0;flex:1;box-sizing:border-box;height:28px;padding:0 6px;border:1px solid #343e55;border-radius:5px;background:#101522;color:#e1e6f2}.background-opacity-row[data-v-4749834a]{display:grid;grid-template-columns:46px 1fr 34px;align-items:center;gap:7px;margin-top:10px;font-size:11px}.background-opacity-row input[data-v-4749834a]{min-width:0;accent-color:#675de0}.background-opacity-row b[data-v-4749834a]{color:#aeb8cc;font-size:10px;text-align:right;font-variant-numeric:tabular-nums}.help-btn[data-v-4749834a]{height:28px;margin-left:auto;padding:0 11px;flex:0 0 auto;border:1px solid #3a4963;border-radius:6px;background:#202a3b;color:#cbd7ed;font-size:12px;font-weight:700;cursor:pointer}.help-btn[data-v-4749834a]:hover,.help-btn.on[data-v-4749834a]{border-color:#7774ff;background:#343b63;color:#fff}.zoom-pct[data-v-4749834a]{margin-left:0;font-variant-numeric:tabular-nums;color:#9aa;min-width:44px;text-align:center}.settings-btn[data-v-4749834a]{height:28px;padding:0 12px;flex:0 0 auto;border:1px solid #3a4963;border-radius:6px;background:#202a3b;color:#cdf;font-size:12px;font-weight:700;cursor:pointer}.settings-btn[data-v-4749834a]:hover{border-color:#7774ff;background:#2b3a5c;color:#fff}.undo-btn[data-v-4749834a]{width:30px;height:28px;flex:0 0 30px;border:1px solid #3a4963;border-radius:6px;background:#202a3b;color:#cdd8ed;font-size:18px;line-height:1;cursor:pointer}.undo-btn[data-v-4749834a]:hover:not(:disabled){border-color:#7774ff;background:#2b3a5c;color:#fff}.undo-btn[data-v-4749834a]:disabled{opacity:.38;cursor:not-allowed}.settings-panel[data-v-1bba85d9]{position:absolute;top:52px;left:10px;width:240px;z-index:10;background:#141420f7;border:1px solid #2a2a3c;border-radius:10px;padding:10px 12px;font-size:12px;color:#aab;box-shadow:0 6px 20px #0006}.sp-head[data-v-1bba85d9]{display:flex;justify-content:space-between;align-items:center;font-weight:700;color:#cdf;margin-bottom:10px}.sp-section-title[data-v-1bba85d9]{margin:2px 0 8px;color:#8a93bb;font-size:11px}.sp-switch-row[data-v-1bba85d9]{display:flex;align-items:center;justify-content:space-between;gap:10px;color:#aab}.sp-switch-control[data-v-1bba85d9]{display:inline-flex;align-items:center;gap:7px}.sp-switch-control input[data-v-1bba85d9]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.sp-switch-ui[data-v-1bba85d9]{position:relative;width:34px;height:18px;border-radius:999px;background:#39445a;cursor:pointer;transition:background .16s ease}.sp-switch-ui[data-v-1bba85d9]:after{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:#f4f6fb;transition:transform .16s ease}.sp-switch-control input:checked+.sp-switch-ui[data-v-1bba85d9]{background:#655df0}.sp-switch-control input:checked+.sp-switch-ui[data-v-1bba85d9]:after{transform:translate(16px)}.sp-switch-control input:focus-visible+.sp-switch-ui[data-v-1bba85d9]{outline:2px solid #8b86ff;outline-offset:2px}.sp-switch-control b[data-v-1bba85d9]{min-width:24px;color:#8a93bb;font-size:11px;font-weight:500}.sp-cache-note[data-v-1bba85d9]{margin-top:10px;padding-top:9px;border-top:1px solid #2a2a3c;color:#647089;font-size:10px;text-align:center}.sp-divider[data-v-1bba85d9]{height:1px;margin:10px 0;background:#2a2a3c}.sp-close[data-v-1bba85d9]{background:#2e3a55;border:none;color:#cdf;border-radius:4px;width:18px;height:18px;cursor:pointer;font-size:11px}.sp-row[data-v-1bba85d9]{display:flex;align-items:center;gap:8px;margin:8px 0}.sp-row>span[data-v-1bba85d9]:first-child{width:76px;flex-shrink:0;color:#8a93bb}.sp-row input[type=range][data-v-1bba85d9]{flex:1;background:#1a1a28;accent-color:#3a5a8c}.sp-num[data-v-1bba85d9]{width:52px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px;padding:2px 4px}.sp-undo-limit[data-v-1bba85d9]{margin-left:auto;width:64px;height:26px;box-sizing:border-box}.sp-colr[data-v-1bba85d9]{width:26px;height:22px;border:none;background:none;cursor:pointer}.sp-hex[data-v-1bba85d9]{font-size:11px;color:#889;font-variant-numeric:tabular-nums}.sp-chk[data-v-1bba85d9]{display:flex;align-items:center;gap:6px;margin:8px 0;color:#aab}.stage-wrap[data-v-c9db9503]{position:relative;width:100%;height:100%;overflow:hidden}.stage-holder[data-v-c9db9503]{width:100%;height:100%;cursor:grab;touch-action:none;background-color:#0e1219;outline:none}.stage-holder.grid[data-v-c9db9503]{background:conic-gradient(#141a26 90deg,transparent 90deg 180deg,#141a26 180deg 270deg,#141a26 180deg 270deg,transparent 270deg);background-size:28px 28px}.stage-holder[data-v-c9db9503]:active{cursor:grabbing}.hud[data-v-c9db9503]{position:absolute;bottom:12px;left:12px;padding:8px 12px;background:#141420bf;border-radius:8px;font-size:12px;color:#a0a8cc}.hud-number[data-v-c9db9503]{display:inline-block;box-sizing:border-box;text-align:right;font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1}.hud-system-count[data-v-c9db9503]{width:3ch}.hud-particle-count[data-v-c9db9503]{width:7ch;text-align:left}.hud-tip[data-v-c9db9503]{margin-left:12px;color:#5f6a8a;font-size:11px}b[data-v-c9db9503]{color:#fc3}.config-management-body[data-v-cb52d3e0]{padding-bottom:2px}.config-toolbar[data-v-cb52d3e0]{display:grid;grid-template-columns:auto auto minmax(0,1fr);gap:6px;margin-bottom:10px}.config-toolbar button[data-v-cb52d3e0],.config-toolbar select[data-v-cb52d3e0]{min-width:0;height:30px;box-sizing:border-box;border:1px solid #3b4864;border-radius:6px;background:#263149;color:#d6def0;font-size:11px}.config-toolbar button[data-v-cb52d3e0]{padding:0 9px;cursor:pointer}.config-toolbar button[data-v-cb52d3e0]:hover{border-color:#7169dc;background:#343d68;color:#fff}.config-toolbar select[data-v-cb52d3e0]{padding:0 7px;overflow:hidden;text-overflow:ellipsis}.config-toolbar select[data-v-cb52d3e0]:disabled{color:#68738a;background:#1b2130}.config-message[data-v-cb52d3e0]{margin:-4px 0 9px;color:#83b9a2;font-size:10px}.config-message.error[data-v-cb52d3e0]{color:#e8959e}.group[data-v-cb52d3e0]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-cb52d3e0]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-cb52d3e0]:hover{background:#20202e}.group-body[data-v-cb52d3e0]{padding:8px 10px 12px}.caret[data-v-cb52d3e0]{display:inline-block;width:12px;color:#667;font-size:11px}.ns[data-v-7c2fbed0]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.ns-label[data-v-7c2fbed0]{width:60px;flex-shrink:0;color:#8a93bb}.ns-range[data-v-7c2fbed0]{flex:1;accent-color:#3a7cd6}.ns-num[data-v-7c2fbed0]{width:56px;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px;text-align:right}.ns.disabled[data-v-7c2fbed0]{opacity:.55}.ns.disabled .ns-range[data-v-7c2fbed0],.ns.disabled .ns-num[data-v-7c2fbed0]{cursor:not-allowed}.ce[data-v-9bfb7b31]{display:flex;align-items:flex-start;gap:6px;width:100%}.ce-editor[data-v-9bfb7b31]{flex:1;min-width:0}.ce-reset[data-v-9bfb7b31]{flex:0 0 auto;padding:5px 7px;border:1px solid #3b4b65;border-radius:5px;background:#242f42;color:#c4cee2;font-size:10px;cursor:pointer}.ce-reset[data-v-9bfb7b31]:hover{border-color:#7774ff;background:#4f4dc2;color:#fff}.ce-svg[data-v-9bfb7b31]{width:100%;height:110px;display:block;border:1px solid #2a2a3c;border-radius:6px;background:#10101a;cursor:crosshair;touch-action:none}.ce-grid line[data-v-9bfb7b31]{stroke:#1e1e30;stroke-width:1}.ce-frame[data-v-9bfb7b31]{stroke:#2e2e44;stroke-width:1}.ce-line[data-v-9bfb7b31]{stroke:#6ea0e8;stroke-width:2;stroke-linejoin:round}.ce-handles line[data-v-9bfb7b31]{stroke:#8d96b5;stroke-width:1;stroke-dasharray:3 2}.ce-handles circle[data-v-9bfb7b31]{fill:#b7c2dd;stroke:#344d94;stroke-width:1.2;cursor:grab}.ce-handles circle[data-v-9bfb7b31]:active{cursor:grabbing}.ce-node[data-v-9bfb7b31]{fill:#fff;stroke:#3a55aa;stroke-width:1.6;pointer-events:none}.ce-hit[data-v-9bfb7b31]{fill:transparent;stroke:none;cursor:grab}.ce-hit[data-v-9bfb7b31]:active{cursor:grabbing}.ce-nav[data-v-9bfb7b31]{display:flex;justify-content:space-between;margin-top:3px}.ce-tip[data-v-9bfb7b31]{color:#566;font-size:10px}.spine-editor[data-v-3545b078]{display:grid;gap:10px;color:#c5cbe0}.editor-title[data-v-3545b078],.section-title[data-v-3545b078]{color:#dce2f5;font-weight:700}.editor-title[data-v-3545b078]{padding-bottom:9px;border-bottom:1px solid #30394d}.grid[data-v-3545b078]{display:grid;gap:8px}.grid.three[data-v-3545b078]{grid-template-columns:repeat(3,minmax(0,1fr))}.field[data-v-3545b078]{display:grid;gap:5px;min-width:0;color:#919bb7;font-size:12px}.field input[data-v-3545b078],.field select[data-v-3545b078],.asset-name[data-v-3545b078]{box-sizing:border-box;width:100%;min-width:0;height:35px;padding:0 10px;color:#e2e6f3;background:#101625;border:1px solid #32405b;border-radius:6px}.divider[data-v-3545b078]{height:1px;background:#30394d;margin:2px 0}.asset-row[data-v-3545b078]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.asset-name[data-v-3545b078]{display:flex;align-items:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#7f8aa7}button[data-v-3545b078]{height:35px;padding:0 13px;border:1px solid #3b4a67;border-radius:6px;background:#33415b;color:#e2e6f3;cursor:pointer}button[data-v-3545b078]:hover{filter:brightness(1.13)}button[data-v-3545b078]:disabled{opacity:.55;cursor:wait}.folder-select[data-v-3545b078]{width:100%;border-color:#6659c7;background:#4940a8;color:#fff}.folder-hint[data-v-3545b078]{margin-top:-5px;color:#69758e;font-size:10px;line-height:1.45}.asset-actions[data-v-3545b078]{display:grid;grid-template-columns:1fr 1fr;gap:5px}.asset-actions .load[data-v-3545b078]{background:#5543df;border-color:#6959ec}.asset-actions .clear[data-v-3545b078]{background:#702b34;border-color:#803842}.runtime-note[data-v-3545b078]{color:#69758e;font-size:11px;text-align:center}.error[data-v-3545b078]{padding:8px 10px;color:#ffabb2;background:#4b2028;border:1px solid #76323e;border-radius:6px;font-size:12px}.section-box[data-v-3545b078]{display:grid;gap:8px;padding:10px;background:#182132;border:1px solid #303c54;border-radius:7px}.empty[data-v-3545b078]{color:#667187;font-size:12px;padding:5px 0}.bone-tree[data-v-3545b078]{max-height:240px;overflow:auto;padding:4px 0;background:#111827;border-radius:5px}.tree-title-row[data-v-3545b078]{display:flex;align-items:center;justify-content:space-between;gap:8px}.tree-tabs[data-v-3545b078]{display:flex;gap:3px;margin:6px 0}.tree-tabs button[data-v-3545b078]{height:24px;padding:0 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#8d98ae;font-size:10px;cursor:pointer}.tree-tabs button[data-v-3545b078]:hover{background:#273246}.tree-tabs button.on[data-v-3545b078]{border-color:#7774ff;background:#35336b;color:#fff}.selected-bone[data-v-3545b078]{width:auto;min-width:0;max-width:100%;height:24px;flex:0 1 auto;overflow:hidden;padding:0 7px;color:#75819c;background:#182132;border:1px solid transparent;border-radius:5px;font-size:10px;text-align:right;white-space:nowrap;text-overflow:ellipsis}.selected-bone.active[data-v-3545b078]{color:#aeb9d4;background:#242f44;border-color:#35445e;cursor:pointer}.selected-bone.active[data-v-3545b078]:hover{border-color:#675ec4;background:#302b57}.selected-bone[data-v-3545b078]:disabled{opacity:1;cursor:default}.selected-bone strong[data-v-3545b078]{color:#c5cde3;font-weight:600}.tree-action[data-v-3545b078]{height:24px;padding:0 8px;color:#9aa7c2;background:#242f44;border-color:#35445e;font-size:10px}.bone-search[data-v-3545b078]{position:relative}.bone-search input[data-v-3545b078]{box-sizing:border-box;width:100%;height:30px;padding:0 32px 0 9px;color:#dce2f2;background:#101827;border:1px solid #33415b;border-radius:5px;font-size:11px;outline:none}.bone-search input[data-v-3545b078]:focus{border-color:#7065df;box-shadow:0 0 0 1px #7065df38}.bone-search button[data-v-3545b078]{position:absolute;top:3px;right:3px;width:24px;height:24px;padding:0;border:0;color:#8d98b0;background:transparent}.bone[data-v-3545b078]{display:flex;align-items:center;gap:4px;min-height:25px;color:#aeb8d2;font-size:12px;border-bottom:1px solid rgba(72,84,112,.22);cursor:pointer;outline:none}.bone[data-v-3545b078]:hover{background:#45567e38}.bone.selected[data-v-3545b078]{color:#f0edff;background:#6b53dd52;box-shadow:inset 2px 0 #8e72ff}.bone[data-v-3545b078]:focus-visible{box-shadow:inset 0 0 0 1px #7d72dd}.bone-toggle[data-v-3545b078]{width:22px;height:22px;padding:0;border:0;background:transparent;color:#9aa7c2}.bone-toggle[data-v-3545b078]:hover{background:#26324a}.bone-leaf[data-v-3545b078]{display:inline-flex;width:22px;justify-content:center;color:#58647d}.bone-name[data-v-3545b078]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.slot-row[data-v-3545b078]{padding-right:8px}.slot-order[data-v-3545b078]{width:24px;flex:0 0 24px;color:#66758e;font-size:10px;font-variant-numeric:tabular-nums;text-align:right}.slot-attachment[data-v-3545b078]{margin-left:auto;max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#6d7c96;font-size:10px}@media(max-width:430px){.grid.three[data-v-3545b078]{grid-template-columns:1fr}}.panel[data-v-55dcf3b2]{display:flex;width:100%;height:100%;flex-direction:column;overflow:hidden;background:#14141f;border-left:1px solid #2a2a3c;padding:12px;box-sizing:border-box}.empty[data-v-55dcf3b2],.panel-hint[data-v-55dcf3b2]{color:#667;font-size:12px;padding:8px 0}.group[data-v-55dcf3b2]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-55dcf3b2]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-55dcf3b2]:hover{background:#20202e}.scene-head[data-v-55dcf3b2]{padding-right:6px}.scene-actions[data-v-55dcf3b2]{margin-left:auto;display:flex;align-items:center;gap:4px}.scene-add[data-v-55dcf3b2]{height:24px;padding:0 6px;border:1px solid #3a4a6a;border-radius:5px;background:#2e3a55;color:#cdf;font-size:10px;white-space:nowrap;cursor:pointer}.scene-add[data-v-55dcf3b2]:hover{border-color:#7774ff;background:#45426f;color:#fff}.scene-add[data-v-55dcf3b2]:disabled{opacity:.42;cursor:not-allowed;border-color:#343a4b;background:#252a38;color:#778095}.group-body[data-v-55dcf3b2]{padding:8px 10px 12px}.caret[data-v-55dcf3b2]{display:inline-block;width:12px;color:#667;font-size:11px}.tree[data-v-55dcf3b2]{margin-bottom:8px}.tree-item[data-v-55dcf3b2]{display:flex;align-items:center;gap:6px;padding:5px 6px;font-size:12px;color:#bcd;border-radius:6px;margin-bottom:2px}.tree-item.on[data-v-55dcf3b2]{background:#26324a;color:#ffe}.tree-item .tdot[data-v-55dcf3b2]{color:#fc3;font-size:10px}.tree-item .tdot.dim[data-v-55dcf3b2]{color:#556}.tree-item .tdot.collision-dot[data-v-55dcf3b2]{color:#ff7070}.tree-item .tdot.path-dot[data-v-55dcf3b2]{color:#ff933e;font-size:14px}.tree-item .tdot.spine-dot[data-v-55dcf3b2]{color:#c08cff;font-size:11px}.tree-item .sub-branch[data-v-55dcf3b2]{color:#5f7090;font-size:12px}.tree-item .tlabel[data-v-55dcf3b2]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.scene-tree[data-v-55dcf3b2]{padding-bottom:8px;border-bottom:1px solid #2a2a3c}.scene-object-item[data-v-55dcf3b2]{min-height:28px;cursor:pointer}.scene-object-item[data-v-55dcf3b2]:hover{background:#202b40}.scene-object-child[data-v-55dcf3b2]{background:#1e2a3e59}.scene-object-kind[data-v-55dcf3b2]{color:#75829c;font-size:10px}.scene-object-kind.sub-emitter-kind[data-v-55dcf3b2]{color:#8f8cff}.scene-object-eye[data-v-55dcf3b2]{width:24px;height:22px;padding:3px;flex:0 0 24px;border:1px solid transparent;border-radius:5px;background:transparent;color:#9aa6bf;cursor:pointer}.scene-object-eye[data-v-55dcf3b2]:hover{border-color:#4b5972;background:#29354a;color:#e1e7f4}.scene-object-eye.off[data-v-55dcf3b2]{color:#59647a}.scene-object-eye svg[data-v-55dcf3b2]{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.scene-object-eye .eye-slash[data-v-55dcf3b2]{stroke:#d47b88;stroke-width:2}.scene-object-delete[data-v-55dcf3b2]{width:24px;height:22px;padding:0;border:1px solid #59414a;border-radius:5px;background:#3a272f;color:#efb4bd;font-size:11px;cursor:pointer}.scene-object-delete[data-v-55dcf3b2]:hover{border-color:#a45c69;background:#57303a;color:#fff}.object-editor-title[data-v-55dcf3b2]{margin:10px 0 8px;padding-top:8px;border-top:1px solid #2a2a3c;color:#cbd4e8;font-weight:700}.field-block[data-v-55dcf3b2]{display:flex;flex-direction:column;gap:5px;margin:10px 0;color:#8f9ab3;font-size:11px}.field-block>.inp[data-v-55dcf3b2]{width:100%;box-sizing:border-box;min-height:30px}.field-block small[data-v-55dcf3b2]{color:#5f6d86;line-height:1.5}.field-grid[data-v-55dcf3b2]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:end}.compact-field[data-v-55dcf3b2]{display:flex;min-width:0;flex-direction:column;gap:5px;margin:5px 0;color:#8f9ab3;font-size:11px}.compact-field .inp[data-v-55dcf3b2]{width:100%;min-height:30px;box-sizing:border-box}.check-field[data-v-55dcf3b2]{align-items:flex-start}.check-field input[data-v-55dcf3b2]{width:18px;height:18px;margin:4px 0;accent-color:#4f7ee8}.follow-path[data-v-55dcf3b2],.setting-line[data-v-55dcf3b2]{display:flex;align-items:center;gap:8px;margin:12px 0 4px;color:#aeb8cf;font-size:12px}.setting-line[data-v-55dcf3b2]{justify-content:space-between}.follow-path input[data-v-55dcf3b2],.setting-line input[type=checkbox][data-v-55dcf3b2]{width:17px;height:17px;accent-color:#4f7ee8}.collider-follow-section[data-v-55dcf3b2]{margin-top:12px;padding-top:4px;border-top:1px solid #30394d}.collider-curve-title[data-v-55dcf3b2]{display:flex;flex-direction:column;gap:3px;margin:12px 0 6px;color:#aeb8cf;font-size:12px}.collider-curve-title small[data-v-55dcf3b2]{color:#67738c;font-size:10px;line-height:1.45}.path-color[data-v-55dcf3b2]{width:48px;height:28px;padding:0;border:1px solid #3a4963;background:transparent;cursor:pointer}.path-help[data-v-55dcf3b2]{margin:12px 0;color:#7d89a2;font-size:11px;line-height:1.55}.path-help>span[data-v-55dcf3b2]{color:#aeb8cf}.path-help ul[data-v-55dcf3b2]{margin:6px 0 0;padding-left:20px}.path-help li[data-v-55dcf3b2]{margin:3px 0}.path-action[data-v-55dcf3b2]{width:100%;height:31px;margin-top:7px;border:0;border-radius:5px;background:#33425b;color:#c9d1e1;cursor:pointer}.path-action[data-v-55dcf3b2]:hover{filter:brightness(1.12)}.path-action.primary[data-v-55dcf3b2]{background:#f05408;color:#fff}.row[data-v-55dcf3b2]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-55dcf3b2]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-55dcf3b2]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.inp.tiny[data-v-55dcf3b2]{width:46px;flex:0 0 46px;text-align:center}.seed-row[data-v-55dcf3b2]{display:flex;align-items:center;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid #2d3950}.seed-row label[data-v-55dcf3b2]{width:64px;color:#8f9bb5;font-size:12px}.seed-input[data-v-55dcf3b2]{min-width:0;flex:1;padding:6px 8px;border:1px solid #344158;border-radius:6px;outline:none;background:#0f1625;color:#e2e7f2;font-size:12px}.seed-input[data-v-55dcf3b2]:focus{border-color:#625ff1}.seed-random[data-v-55dcf3b2]{width:34px;height:30px;border:1px solid #3a4860;border-radius:6px;background:#2c3950;color:#d7def0;cursor:pointer}.seed-random[data-v-55dcf3b2]:hover{background:#394964}.scene-seed[data-v-55dcf3b2]{margin-top:10px}.seed-hint[data-v-55dcf3b2]{margin:5px 0 1px 72px;color:#657188;font-size:9px;line-height:1.45}.group[data-v-f9eac627]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-f9eac627]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-f9eac627]:hover{background:#20202e}.group-reset[data-v-f9eac627]{margin-left:auto;height:22px;padding:0 7px;border:1px solid #3a465f;border-radius:5px;background:#252d3d;color:#9eabc3;font-size:10px;line-height:20px;cursor:pointer}.group-reset[data-v-f9eac627]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-f9eac627]{padding:8px 10px 12px}.caret[data-v-f9eac627]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-f9eac627]{height:1px;background:#2a2a3c;margin:8px 0}.row[data-v-f9eac627]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-f9eac627]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-f9eac627]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.segs[data-v-f9eac627]{display:flex;gap:6px;margin:6px 0}.stream-behavior-segs[data-v-f9eac627]{margin-top:10px}.stream-loop-options[data-v-f9eac627]{display:grid;gap:8px;margin:8px 0 4px;padding:9px 10px;border:1px solid #32405a;border-radius:6px;background:#171f2e}.loop-section-row[data-v-f9eac627]{display:flex;min-height:27px;align-items:center;justify-content:space-between;gap:8px}.loop-duration-control[data-v-f9eac627]{display:flex;flex:0 0 auto;align-items:center;gap:7px}.loop-duration-toggle[data-v-f9eac627]{gap:5px;font-size:10px;white-space:nowrap}.loop-duration-toggle .switch-ui[data-v-f9eac627]{width:26px;height:14px}.loop-duration-toggle .switch-ui[data-v-f9eac627]:after{width:10px;height:10px}.loop-duration-toggle input:checked+.switch-ui[data-v-f9eac627]:after{transform:translate(12px)}.loop-section-duration[data-v-f9eac627]{display:flex;flex:0 0 auto;align-items:center;gap:4px;color:#7f8ba4;font-size:11px}.loop-section-duration input[data-v-f9eac627]{position:static;width:54px;height:25px;padding:0 6px;border:1px solid #3a465f;border-radius:5px;outline:none;background:#101725;color:#e4e8f2;text-align:right;opacity:1;pointer-events:auto}.loop-section-duration input[data-v-f9eac627]:focus{border-color:#716eff}.loop-auto-duration[data-v-f9eac627]{min-width:54px;color:#77839a;text-align:right;white-space:nowrap}.seg[data-v-f9eac627]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg.on[data-v-f9eac627]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.seg[data-v-f9eac627]{display:flex;gap:6px;margin:6px 0}.inp.tiny[data-v-f9eac627]{width:46px;flex:0 0 46px;text-align:center}.switch-row[data-v-f9eac627]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-f9eac627]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-f9eac627]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-f9eac627]:after{content:"";position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .16s ease}.switch-row input:checked+.switch-ui[data-v-f9eac627]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-f9eac627]:after{transform:translate(14px)}.modifier-hint[data-v-f9eac627]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.stream-loop-hint[data-v-f9eac627]{margin:9px 2px 3px;padding:7px 8px;border:1px solid #4a436e;border-radius:5px;background:#211f35;color:#aaa4d7}.switch-row input:disabled+.switch-ui[data-v-f9eac627]{opacity:.45;cursor:not-allowed}.pac[data-v-238f838c]{padding:10px;margin:8px 0;border:1px solid #2c3850;border-radius:7px;background:#171d2a}.pac-head[data-v-238f838c]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px}.pac-label[data-v-238f838c]{color:#aeb8cf;font-size:12px;font-weight:600;white-space:nowrap}.pac-modes[data-v-238f838c]{display:flex;gap:4px;flex-wrap:wrap;justify-content:flex-end}.pac-mode[data-v-238f838c]{padding:4px 7px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.pac-mode.on[data-v-238f838c]{border-color:#7774ff;background:#605df0;color:#fff}.pac-curve[data-v-238f838c]{margin-top:8px}.pac-axis[data-v-238f838c]{display:flex;justify-content:space-between;margin-top:3px;color:#5f6b82;font-size:10px}.pac[data-v-238f838c] .ns-label{width:58px}.pac[data-v-238f838c] .ce-svg{height:96px;background:#0f1625;border-color:#30405a}.pac[data-v-238f838c] .ce-tip{color:#657188}.group[data-v-cf6b86a5]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-cf6b86a5]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-cf6b86a5]:hover{background:#20202e}.group-reset[data-v-cf6b86a5]{margin-left:auto;height:22px;padding:0 7px;border:1px solid #3a465f;border-radius:5px;background:#252d3d;color:#9eabc3;font-size:10px;line-height:20px;cursor:pointer}.group-reset[data-v-cf6b86a5]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-cf6b86a5]{padding:8px 10px 12px}.caret[data-v-cf6b86a5]{display:inline-block;width:12px;color:#667;font-size:11px}.row[data-v-cf6b86a5]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-cf6b86a5]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.attr-body[data-v-cf6b86a5]{padding:10px;background:#151b27}.attr-section-title[data-v-cf6b86a5]{margin:2px 0 8px;color:#9ca8c0;font-size:12px;font-weight:700}.attr-section-title.life-title[data-v-cf6b86a5]{margin-top:14px;padding-top:12px;border-top:1px solid #2d3950}.attr-axis-head[data-v-cf6b86a5]{display:flex;align-items:center;justify-content:space-between;margin:10px 1px -2px;color:#aeb8cf;font-size:12px;font-weight:600}.axis-modes[data-v-cf6b86a5]{display:flex;gap:4px}.axis-mode[data-v-cf6b86a5]{padding:4px 8px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.axis-mode.on[data-v-cf6b86a5]{border-color:#7774ff;background:#605df0;color:#fff}.life-item[data-v-cf6b86a5]{padding:9px 0;border-bottom:1px solid #2a3549}.switch-row[data-v-cf6b86a5]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-cf6b86a5]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-cf6b86a5]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-cf6b86a5]:after{content:"";position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .16s ease}.switch-row input:checked+.switch-ui[data-v-cf6b86a5]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-cf6b86a5]:after{transform:translate(14px)}.life-axis[data-v-cf6b86a5]{margin:9px 0 2px 42px}.switch-row input:disabled+.switch-ui[data-v-cf6b86a5]{opacity:.45;cursor:not-allowed}.gradient-editor[data-v-f6ab10bf]{margin:8px 0 11px 68px}.gradient-bar[data-v-f6ab10bf]{position:relative;height:18px;margin-bottom:14px;border:1px solid #465570;border-radius:6px;cursor:crosshair}.gradient-stop[data-v-f6ab10bf]{position:absolute;top:15px;width:14px;height:17px;padding:0;transform:translate(-50%);border:2px solid #d8deea;border-radius:2px 2px 5px 5px;background:var(--stop-color);cursor:grab;box-shadow:0 1px 3px #0009}.gradient-stop[data-v-f6ab10bf]:before{content:"";position:absolute;left:2px;top:-7px;border-left:3px solid transparent;border-right:3px solid transparent;border-bottom:5px solid #d8deea}.gradient-stop.selected[data-v-f6ab10bf]{outline:2px solid #7774ff;outline-offset:1px;z-index:2}.gradient-stop[data-v-f6ab10bf]:active{cursor:grabbing}.gradient-controls[data-v-f6ab10bf]{display:flex;align-items:center;gap:5px;margin-top:30px}.gradient-color[data-v-f6ab10bf]{width:28px;height:24px;padding:1px;border:1px solid #465570;border-radius:4px;background:#151b27;cursor:pointer}.gradient-hex-input[data-v-f6ab10bf]{width:66px;padding:4px 5px;border:1px solid #344158;border-radius:4px;outline:none;background:#101725;color:#aeb8cb;font-size:10px;font-family:monospace}.gradient-hex-input[data-v-f6ab10bf]:focus{border-color:#7774ff;color:#fff}.gradient-position[data-v-f6ab10bf]{display:flex;align-items:center;color:#71809a;font-size:10px}.gradient-position input[data-v-f6ab10bf]{width:43px;padding:3px 4px;border:1px solid #344158;border-radius:4px;outline:none;background:#101725;color:#dce3ef;text-align:right}.gradient-action[data-v-f6ab10bf]{width:25px;height:24px;padding:0;border:1px solid #3a4860;border-radius:4px;background:#273246;color:#cbd4e5;cursor:pointer}.gradient-action[data-v-f6ab10bf]:hover:not(:disabled){border-color:#7774ff;color:#fff}.gradient-action.danger[data-v-f6ab10bf]{color:#e3a5aa}.gradient-action[data-v-f6ab10bf]:disabled{opacity:.35;cursor:not-allowed}.gradient-hint[data-v-f6ab10bf]{margin-top:5px;color:#59667b;font-size:9px}.pivot-editor[data-v-1261b03a]{margin-top:8px;padding:8px;border:1px solid #2e3c55;border-radius:8px;background:#121a27}.pivot-toolbar[data-v-1261b03a]{display:flex;align-items:center;gap:7px;margin-bottom:7px}.pivot-hint[data-v-1261b03a]{flex:1;min-width:0;display:flex;align-items:center;gap:5px;color:#9aa8c4;font-size:10px;line-height:1.3}.pivot-hint-icon[data-v-1261b03a]{color:#8f8cff;font-size:13px}.pivot-zoom[data-v-1261b03a]{display:flex;align-items:center;gap:2px;padding:2px;border:1px solid #34435e;border-radius:6px;background:#182234}.pivot-zoom button[data-v-1261b03a]{width:20px;height:20px;padding:0;border:0;border-radius:4px;background:transparent;color:#a9b6d0;font-size:13px;cursor:pointer}.pivot-zoom button[data-v-1261b03a]:hover:not(:disabled){background:#2a3853;color:#fff}.pivot-zoom button[data-v-1261b03a]:disabled{opacity:.3;cursor:default}.pivot-zoom span[data-v-1261b03a]{min-width:36px;text-align:center;color:#c7d1e6;font-size:10px;font-variant-numeric:tabular-nums}.pivot-expand[data-v-1261b03a]{width:24px;height:24px;padding:0;border:1px solid #34435e;border-radius:6px;background:#182234;color:#a9b6d0;font-size:13px;cursor:pointer}.pivot-expand[data-v-1261b03a]:hover{border-color:#7774ff;color:#fff}.pivot-stage[data-v-1261b03a]{position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:156px;overflow:hidden;border:1px solid #2f3d57;border-radius:8px;background-color:#10161f;background-image:linear-gradient(45deg,#1a2230 25%,transparent 25%),linear-gradient(-45deg,#1a2230 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#1a2230 75%),linear-gradient(-45deg,transparent 75%,#1a2230 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0;touch-action:none;cursor:crosshair}.pivot-large .pivot-stage[data-v-1261b03a]{height:340px;background-size:22px 22px;background-position:0 0,0 11px,11px -11px,-11px 0}.pivot-stage.panning[data-v-1261b03a]{cursor:grabbing}.pivot-box[data-v-1261b03a]{position:relative;flex:0 0 auto}.pivot-box>img[data-v-1261b03a]{display:block;width:100%;height:100%;object-fit:fill;-webkit-user-select:none;user-select:none;pointer-events:none}.pivot-empty[data-v-1261b03a]{color:#4e5a70;font-size:12px}.pivot-cross[data-v-1261b03a]{position:absolute;pointer-events:none;background:#7e76ffbf;box-shadow:0 0 3px #7e76ff99}.pivot-cross.vertical[data-v-1261b03a]{top:0;bottom:0;width:1px;transform:translate(-.5px)}.pivot-cross.horizontal[data-v-1261b03a]{left:0;right:0;height:1px;transform:translateY(-.5px)}.pivot-marker[data-v-1261b03a]{position:absolute;width:13px;height:13px;transform:translate(-50%,-50%);border:2px solid #c9c6ff;border-radius:50%;background:#605ff0d9;box-shadow:0 0 0 3px #605ff047,0 0 10px #605ff0cc;pointer-events:none}.pivot-badge[data-v-1261b03a]{position:absolute;transform:translate(-50%,14px);padding:2px 6px;border:1px solid #6f6bc7;border-radius:4px;background:#191c3aeb;color:#b9b6ff;font-size:9px;white-space:nowrap;pointer-events:none}.pivot-bottom[data-v-1261b03a]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;margin-top:8px}.pivot-large .pivot-bottom[data-v-1261b03a]{gap:14px;margin-top:14px}.pivot-card[data-v-1261b03a]{min-width:0;padding:7px;border:1px solid #28344a;border-radius:8px;background:#151d2b}.pivot-card-head[data-v-1261b03a]{display:flex;align-items:center;justify-content:space-between;gap:5px;margin-bottom:6px;color:#b9c4da;font-size:10px}.pivot-card-icon[data-v-1261b03a]{color:#8f8cff}.pivot-presets[data-v-1261b03a]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}.pivot-preset[data-v-1261b03a]{height:30px;padding:0;border:1px solid #2f3d57;border-radius:5px;background:#1b2537;color:#aab6cf;font-size:16px;line-height:1;cursor:pointer}.pivot-preset[data-v-1261b03a]:hover{border-color:#5d5aa8;color:#d9d8ff}.pivot-preset.on[data-v-1261b03a]{border-color:#7774ff;background:#4a47b5;color:#fff}.pivot-reset[data-v-1261b03a]{display:block;width:100%;height:26px;margin-top:6px;padding:0 6px;border:1px solid #2f3d57;border-radius:5px;background:#1a2435;color:#96a4c0;font-size:10px;cursor:pointer;white-space:nowrap}.pivot-reset[data-v-1261b03a]:hover{border-color:#5d5aa8;background:#232f46;color:#d9d8ff}.pivot-coords[data-v-1261b03a]{display:flex;flex-direction:column;gap:5px}.pivot-large .pivot-coords[data-v-1261b03a]{flex-direction:row;gap:8px}.pivot-coords label[data-v-1261b03a]{flex:1;display:flex;align-items:center;gap:3px;color:#8d9ab5;font-size:10px}.pivot-coords input[data-v-1261b03a]{width:100%;min-width:0;height:24px;padding:0 4px;border:1px solid #34435e;border-radius:4px;background:#101827;color:#f0b465;font-size:11px;text-align:right}.pivot-rotate-head[data-v-1261b03a]{margin-top:10px}.pivot-rotate-state[data-v-1261b03a]{color:#6f7c96;font-size:9px}.pivot-rotate-body[data-v-1261b03a]{display:flex;align-items:center;gap:7px}.pivot-rotate-modes[data-v-1261b03a]{display:flex;flex-direction:column;gap:4px;flex:1}.pivot-rotate-modes button[data-v-1261b03a]{height:24px;padding:0 5px;border:1px solid #2f3d57;border-radius:5px;background:#1b2537;color:#93a0ba;font-size:9px;cursor:pointer}.pivot-rotate-modes button.on[data-v-1261b03a]{border-color:#7774ff;background:#4a47b5;color:#fff}.pivot-rotate-preview[data-v-1261b03a]{display:flex;align-items:center;justify-content:center;width:78px;height:78px;flex:0 0 78px;border:1px solid #2b374d;border-radius:6px;background:#10161f;overflow:hidden}.pivot-large .pivot-rotate-preview[data-v-1261b03a]{width:128px;height:128px;flex-basis:128px}.pivot-rotate-preview img[data-v-1261b03a]{display:block}.pivot-rotate-preview img.spin[data-v-1261b03a]{animation:pivot-spin-1261b03a 2s linear infinite}.pivot-rotate-preview img.swing[data-v-1261b03a]{animation:pivot-swing-1261b03a 1.1s ease-in-out infinite alternate}@keyframes pivot-spin-1261b03a{to{transform:rotate(360deg)}}@keyframes pivot-swing-1261b03a{0%{transform:rotate(-28deg)}to{transform:rotate(28deg)}}.pivot-large .pivot-hint[data-v-1261b03a],.pivot-large .pivot-card-head[data-v-1261b03a]{font-size:12px}.pivot-large .pivot-preset[data-v-1261b03a]{height:42px;font-size:20px}.pivot-large .pivot-reset[data-v-1261b03a]{height:34px;margin-top:8px;font-size:12px}.pivot-large .pivot-coords input[data-v-1261b03a]{height:34px;font-size:14px}.pivot-large .pivot-rotate-modes button[data-v-1261b03a]{height:34px;font-size:12px}.image-card[data-v-cb3a8e2c]{margin:8px 0;padding:9px;border:1px solid #2e3c55;border-radius:7px;background:#171d2a}.imgrow[data-v-cb3a8e2c]{display:flex;align-items:flex-start;gap:8px}.img-thumb[data-v-cb3a8e2c]{width:48px;height:48px;padding:0;border:1px solid #3a4963;border-radius:6px;background:#1a2232;display:flex;align-items:center;justify-content:center;flex-shrink:0;cursor:pointer;overflow:hidden}.img-thumb[data-v-cb3a8e2c]:hover{border-color:#7774ff}.img-thumb img[data-v-cb3a8e2c]{display:block;width:100%;height:100%;object-fit:contain}.img-fields[data-v-cb3a8e2c]{flex:1;min-width:0}.img-actions[data-v-cb3a8e2c]{display:flex;flex-direction:column;gap:4px}.row[data-v-cb3a8e2c]{display:flex;align-items:center;gap:8px;margin:6px 0;color:#aab;font-size:12px}.row>span[data-v-cb3a8e2c]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-cb3a8e2c]{min-width:0;flex:1;padding:3px 5px;border:1px solid #2e2e44;border-radius:5px;background:#1a1a28;color:#dde;font-size:12px}.mini-btn2[data-v-cb3a8e2c]{width:26px;height:24px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:5px;color:#aab;font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center}.mini-btn2[data-v-cb3a8e2c]:hover{background:#2b3a5c}.mini-btn2[data-v-cb3a8e2c]:disabled{opacity:.35;cursor:not-allowed}.thumb-note[data-v-cb3a8e2c]{margin:4px 0 2px;color:#667;font-size:11px}.sequence-pick[data-v-cb3a8e2c]{width:100%;margin:2px 0 4px;padding:6px 8px;border:1px solid #4a4a76;border-radius:5px;background:#27264b;color:#d8d7ff;font-size:12px;cursor:pointer}.sequence-pick[data-v-cb3a8e2c]:hover{border-color:#7774ff;background:#35336a}.sequence-note[data-v-cb3a8e2c]{margin:0 0 6px;color:#727b9b;font-size:11px;line-height:1.4}.resource-weight-row[data-v-cb3a8e2c]{display:grid;grid-template-columns:minmax(0,1fr) 28px;align-items:center;gap:7px}.resource-weight-control[data-v-cb3a8e2c]{width:100%;min-width:0}.resource-weight-control[data-v-cb3a8e2c] .ns-range{min-width:0}.resource-weight-control[data-v-cb3a8e2c] .ns-num{flex:0 0 56px;box-sizing:border-box}.weight-lock[data-v-cb3a8e2c]{width:28px;height:26px;flex:0 0 28px;padding:5px;border:1px solid #35435c;border-radius:5px;background:#202a3b;color:#78859e;cursor:pointer}.weight-lock svg[data-v-cb3a8e2c]{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.weight-lock[data-v-cb3a8e2c]:hover:not(:disabled){border-color:#7774ff;color:#b8b6ff}.weight-lock.on[data-v-cb3a8e2c]{border-color:#7774ff;background:#514fd0;color:#fff}.weight-lock[data-v-cb3a8e2c]:disabled{opacity:.35;cursor:not-allowed}.pivot-toggle-row[data-v-cb3a8e2c]{display:flex;align-items:center;gap:9px;margin-top:9px;padding:8px 9px;border:1px solid #2c3a54;border-radius:8px;background:#131b28}.pivot-toggle-icon[data-v-cb3a8e2c]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;flex:0 0 32px;border:1px solid #35435c;border-radius:7px;background:#1c2638;color:#8f8cff;font-size:17px}.pivot-toggle-text[data-v-cb3a8e2c]{flex:1;min-width:0}.pivot-toggle-title[data-v-cb3a8e2c]{color:#d6deee;font-size:12px;font-weight:600}.pivot-toggle-sub[data-v-cb3a8e2c]{margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#7584a0;font-size:9px}.pivot-switch[data-v-cb3a8e2c]{position:relative;flex:0 0 auto;cursor:pointer}.pivot-switch input[data-v-cb3a8e2c]{position:absolute;opacity:0;pointer-events:none}.pivot-switch-ui[data-v-cb3a8e2c]{position:relative;display:block;width:34px;height:19px;border-radius:10px;background:#354258;transition:background .16s ease}.pivot-switch-ui[data-v-cb3a8e2c]:after{content:"";position:absolute;left:2px;top:2px;width:15px;height:15px;border-radius:50%;background:#fff;transition:transform .16s ease}.pivot-switch input:checked+.pivot-switch-ui[data-v-cb3a8e2c]{background:#625ff1}.pivot-switch input:checked+.pivot-switch-ui[data-v-cb3a8e2c]:after{transform:translate(15px)}.pivot-modal-backdrop[data-v-cb3a8e2c]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;display:flex;align-items:center;justify-content:center;padding:24px;background:#06090fc7;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.pivot-modal[data-v-cb3a8e2c]{display:flex;flex-direction:column;width:min(980px,94vw);max-height:92vh;overflow:auto;padding:14px;border:1px solid #2f3f5c;border-radius:14px;background:#121927;box-shadow:0 24px 70px #0009}.pivot-modal-head[data-v-cb3a8e2c]{display:flex;align-items:flex-start;gap:10px;padding-bottom:10px;border-bottom:1px solid #253148}.pivot-modal-icon[data-v-cb3a8e2c]{display:flex;align-items:center;justify-content:center;width:34px;height:34px;flex:0 0 34px;border:1px solid #3b4a66;border-radius:8px;background:#1c2638;color:#8f8cff;font-size:18px}.pivot-modal-info[data-v-cb3a8e2c]{flex:1;min-width:0}.pivot-modal-title[data-v-cb3a8e2c]{display:flex;align-items:center;gap:7px;color:#e4e9f5;font-size:15px;font-weight:700}.pivot-modal-badge[data-v-cb3a8e2c]{padding:2px 7px;border:1px solid #4b4a8f;border-radius:999px;background:#2c2b58;color:#b9b6ff;font-size:10px;font-weight:500}.pivot-modal-desc[data-v-cb3a8e2c]{margin-top:3px;color:#7f8daa;font-size:11px}.pivot-modal-close[data-v-cb3a8e2c]{width:28px;height:28px;padding:0;border:0;border-radius:6px;background:transparent;color:#8b98b3;font-size:15px;cursor:pointer}.pivot-modal-close[data-v-cb3a8e2c]:hover{background:#253148;color:#fff}.pivot-modal-hint[data-v-cb3a8e2c]{margin:10px 0 0;color:#8b98b3;font-size:11px}.pivot-modal-actions[data-v-cb3a8e2c]{display:flex;justify-content:flex-end;gap:8px;margin-top:12px;padding-top:10px;border-top:1px solid #253148}.pivot-modal-cancel[data-v-cb3a8e2c]{height:34px;padding:0 16px;border:1px solid #34435e;border-radius:7px;background:#1a2334;color:#a9b6d0;font-size:12px;cursor:pointer}.pivot-modal-cancel[data-v-cb3a8e2c]:hover{border-color:#5d5aa8;color:#fff}.pivot-modal-confirm[data-v-cb3a8e2c]{height:34px;padding:0 22px;border:1px solid #7774ff;border-radius:7px;background:#5b57e8;color:#fff;font-size:12px;font-weight:700;cursor:pointer}.pivot-modal-confirm[data-v-cb3a8e2c]:hover{background:#6a66ff}.group[data-v-5709815f]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-5709815f]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-5709815f]:hover{background:#20202e}.group-reset[data-v-5709815f]{margin-left:auto;height:22px;padding:0 7px;border:1px solid #3a465f;border-radius:5px;background:#252d3d;color:#9eabc3;font-size:10px;line-height:20px;cursor:pointer}.group-reset[data-v-5709815f]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-5709815f]{padding:8px 10px 12px}.caret[data-v-5709815f]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-5709815f]{height:1px;background:#2a2a3c;margin:8px 0}.row[data-v-5709815f]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-5709815f]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-5709815f]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.colr[data-v-5709815f]{width:28px;height:22px;border:none;background:none;cursor:pointer}.seg[data-v-5709815f]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg.on[data-v-5709815f]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.look-title[data-v-5709815f]{font-size:12px;font-weight:600;color:#ccd;margin:10px 0 6px;padding-bottom:4px;border-bottom:1px solid #2a2a3c}.look-title[data-v-5709815f]:first-child{margin-top:2px}.seg[data-v-5709815f]{display:flex;gap:6px;margin:6px 0}.seg-btn[data-v-5709815f]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg-btn.active[data-v-5709815f]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.curve-wrap[data-v-5709815f]{margin:6px 0}.curve-labels[data-v-5709815f]{display:flex;justify-content:space-between;color:#566;font-size:10px;margin-top:2px}.image-title[data-v-5709815f]{display:flex;align-items:center;justify-content:space-between}.image-add[data-v-5709815f]{width:26px;height:24px;border:1px solid #4a4d9a;border-radius:5px;background:#252850;color:#8f8cff;font-size:18px;line-height:1;cursor:pointer}.image-add[data-v-5709815f]:hover{background:#4542a8;color:#fff}.resource-divider[data-v-5709815f]{height:1px;margin:9px 0 7px;background:#2a3549}.resource-color-row .blend-select[data-v-5709815f]{max-width:88px}.resource-color-picker .hex[data-v-5709815f]{margin-left:0}.random-color-hint[data-v-5709815f]{margin:-5px 0 9px 68px;color:#66758e;font-size:9px;line-height:1.45}.hex-input[data-v-5709815f]{width:72px;padding:4px 6px;border:1px solid #344158;border-radius:5px;outline:none;background:#101725;color:#aeb8cb;font-size:11px;font-family:monospace}.hex-input[data-v-5709815f]:focus{border-color:#7774ff;color:#fff}.resource-alpha-head[data-v-5709815f]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px;color:#8a93bb;font-size:12px}.alpha-modes[data-v-5709815f]{display:flex;gap:3px}.alpha-modes button[data-v-5709815f]{padding:4px 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#8d98ae;font-size:11px;cursor:pointer}.alpha-modes button[data-v-5709815f]:hover{background:#273246}.alpha-modes button.on[data-v-5709815f]{border-color:#7774ff;background:#605df0;color:#fff}.resource-alpha-curve[data-v-5709815f]{margin-top:7px}.file-input[data-v-5709815f]{display:none}.hex[data-v-5709815f]{font-size:11px;color:#889;margin-left:auto;font-variant-numeric:tabular-nums}.inp.tiny[data-v-5709815f]{width:46px;flex:0 0 46px;text-align:center}.render-layer-current[data-v-5709815f]{display:flex;align-items:center;gap:6px;margin:6px 0}.render-layer-text[data-v-5709815f]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#9aa6c2;font-size:11px}.mini-btn[data-v-5709815f]{flex:0 0 auto;height:24px;padding:0 7px;border:1px solid #3d4a66;border-radius:5px;background:#202a3e;color:#a9b5cf;font-size:10px;cursor:pointer}.mini-btn[data-v-5709815f]:hover{border-color:#7774ff;color:#fff}.mini-btn.ghost[data-v-5709815f]{background:transparent}.slot-picker[data-v-5709815f]{margin:6px 0;padding:6px;border:1px solid #2e3a52;border-radius:6px;background:#111a28}.slot-list[data-v-5709815f]{max-height:180px;overflow:auto;margin-top:6px}.slot-item[data-v-5709815f]{display:flex;align-items:center;gap:6px;width:100%;padding:4px 6px;border:1px solid transparent;border-radius:4px;background:transparent;color:#aab4cc;font-size:11px;text-align:left;cursor:pointer}.slot-item[data-v-5709815f]:hover{background:#1d2a3f}.slot-item.on[data-v-5709815f]{border-color:#7774ff;background:#2b2b55;color:#fff}.slot-order[data-v-5709815f]{width:26px;flex:0 0 26px;color:#66758e;font-variant-numeric:tabular-nums}.slot-name[data-v-5709815f]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slot-attachment[data-v-5709815f]{max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#6d7c96;font-size:10px}.switch-row[data-v-5709815f]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-5709815f]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-5709815f]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-5709815f]:after{content:"";position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .16s ease}.switch-row input:checked+.switch-ui[data-v-5709815f]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-5709815f]:after{transform:translate(14px)}.switch-row input:disabled+.switch-ui[data-v-5709815f]{opacity:.45;cursor:not-allowed}.render-layer-switch[data-v-5709815f]{margin:6px 0}.modifier-hint[data-v-5709815f]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.render-layer-warning[data-v-5709815f]{color:#d8a45e}.empty[data-v-affb8652]{color:#667;font-size:12px;padding:8px 0}.group[data-v-affb8652]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-affb8652]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-affb8652]:hover{background:#20202e}.group-reset[data-v-affb8652]{margin-left:auto;height:22px;padding:0 7px;border:1px solid #3a465f;border-radius:5px;background:#252d3d;color:#9eabc3;font-size:10px;line-height:20px;cursor:pointer}.group-reset[data-v-affb8652]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-affb8652]{padding:8px 10px 12px}.caret[data-v-affb8652]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-affb8652]{height:1px;background:#2a2a3c;margin:8px 0}.field-block[data-v-affb8652]{display:flex;flex-direction:column;gap:5px;margin:10px 0;color:#8f9ab3;font-size:11px}.field-block>.inp[data-v-affb8652]{width:100%;box-sizing:border-box;min-height:30px}.field-block small[data-v-affb8652]{color:#5f6d86;line-height:1.5}.field-grid[data-v-affb8652]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:end}.compact-field[data-v-affb8652]{display:flex;min-width:0;flex-direction:column;gap:5px;margin:5px 0;color:#8f9ab3;font-size:11px}.compact-field .inp[data-v-affb8652]{width:100%;min-height:30px;box-sizing:border-box}.tag[data-v-affb8652]{font-size:10px;color:#667;background:#1c1c2a;border-radius:4px;padding:1px 5px}.row[data-v-affb8652]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-affb8652]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-affb8652]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.colr[data-v-affb8652]{width:28px;height:22px;border:none;background:none;cursor:pointer}.placeholder[data-v-affb8652]{color:#667;font-size:11px;padding:6px 0}.image-add[data-v-affb8652]{width:26px;height:24px;border:1px solid #4a4d9a;border-radius:5px;background:#252850;color:#8f8cff;font-size:18px;line-height:1;cursor:pointer}.image-add[data-v-affb8652]:hover{background:#4542a8;color:#fff}.resource-divider[data-v-affb8652]{height:1px;margin:9px 0 7px;background:#2a3549}.hex-input[data-v-affb8652]{width:72px;padding:4px 6px;border:1px solid #344158;border-radius:5px;outline:none;background:#101725;color:#aeb8cb;font-size:11px;font-family:monospace}.hex-input[data-v-affb8652]:focus{border-color:#7774ff;color:#fff}.alpha-modes[data-v-affb8652]{display:flex;gap:3px}.alpha-modes button[data-v-affb8652]{padding:4px 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#8d98ae;font-size:11px;cursor:pointer}.alpha-modes button[data-v-affb8652]:hover{background:#273246}.alpha-modes button.on[data-v-affb8652]{border-color:#7774ff;background:#605df0;color:#fff}.file-input[data-v-affb8652]{display:none}.hex[data-v-affb8652]{font-size:11px;color:#889;margin-left:auto;font-variant-numeric:tabular-nums}.inp.tiny[data-v-affb8652]{width:46px;flex:0 0 46px;text-align:center}.axis-mode[data-v-affb8652]{padding:4px 8px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.axis-mode.on[data-v-affb8652]{border-color:#7774ff;background:#605df0;color:#fff}.switch-row[data-v-affb8652]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-affb8652]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-affb8652]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-affb8652]:after{content:"";position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .16s ease}.switch-row input:checked+.switch-ui[data-v-affb8652]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-affb8652]:after{transform:translate(14px)}.modifier-item[data-v-affb8652]{padding:8px 0 10px;border-bottom:1px solid #2a3549}.events-item[data-v-affb8652]{margin-top:4px;padding-bottom:2px;border-bottom:0}.event-rules[data-v-affb8652]{display:flex;flex-direction:column;gap:7px;margin-top:8px}.event-card[data-v-affb8652]{padding:7px;border:1px solid #2b3a54;border-radius:7px;background:#121a28}.event-selects[data-v-affb8652]{display:flex;align-items:center;gap:5px}.event-selects .inp[data-v-affb8652]{height:26px;min-height:26px;box-sizing:border-box;font-size:11px}.event-select[data-v-affb8652]{flex:0 0 34%}.event-target[data-v-affb8652]{flex:1;min-width:0}.event-remove[data-v-affb8652]{width:24px;height:26px;flex:0 0 24px;padding:0;border:1px solid #3a465f;border-radius:5px;background:#1c2638;color:#8794ad;font-size:11px;cursor:pointer}.event-remove[data-v-affb8652]:hover{border-color:#a05260;background:#3a2230;color:#ffb3c0}.event-probability[data-v-affb8652]{display:flex;align-items:center;gap:8px;margin-top:6px;color:#8d9ab5;font-size:10px}.event-probability>span[data-v-affb8652]{flex:0 0 56px}.event-probability .inp[data-v-affb8652]{flex:1;height:26px;box-sizing:border-box;font-size:11px}.event-inherit[data-v-affb8652],.event-color-mode[data-v-affb8652]{margin-top:4px}.event-color-mode>span[data-v-affb8652]{flex:0 0 84px}.event-color-mode .inp[data-v-affb8652]{height:26px;min-height:26px;box-sizing:border-box;font-size:11px}.event-collision-limit>span[data-v-affb8652]{flex-basis:72px}.inherit-trigger[data-v-affb8652]{flex:1;min-width:0;height:26px;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:6px;padding:0 7px;border:1px solid #34435e;border-radius:4px;background:#101827;color:#cdd6e8;font-size:11px;text-align:left;cursor:pointer}.inherit-trigger[data-v-affb8652]:hover{border-color:#5d5aa8}.inherit-summary[data-v-affb8652]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inherit-trigger i[data-v-affb8652]{color:#7f8db0;font-style:normal;font-size:10px}.inherit-menu[data-v-affb8652]{position:fixed;z-index:9999;padding:5px;border:1px solid #3b3f4a;border-radius:6px;background:#232427;box-shadow:0 12px 30px #0000008c}.inherit-option[data-v-affb8652]{display:flex;align-items:center;gap:6px;width:100%;height:26px;padding:0 7px;border:0;border-radius:4px;background:transparent;color:#c9ccd3;font-size:12px;text-align:left;cursor:pointer}.inherit-option[data-v-affb8652]:hover{background:#3a5a8c;color:#fff}.inherit-check[data-v-affb8652]{width:14px;flex:0 0 14px;color:#d8dbe2;font-size:12px}.inherit-divider[data-v-affb8652]{height:1px;margin:4px;background:#35373d}.event-add[data-v-affb8652]{height:28px;border:1px dashed #536079;border-radius:6px;background:transparent;color:#9aa7c2;font-size:11px;cursor:pointer}.event-add[data-v-affb8652]:hover{border-color:#7774ff;background:#232a45;color:#fff}.modifier-switch[data-v-affb8652]{font-weight:600}.modifier-params[data-v-affb8652]{margin:8px 0 0 10px;padding:2px 0 2px 10px;border-left:2px solid #344158}.modifier-hint[data-v-affb8652]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.collision-filter-params[data-v-affb8652]{position:relative;padding-top:5px;padding-bottom:5px}.collision-filter-title[data-v-affb8652]{margin-bottom:8px;color:#9ba7bd;font-size:11px;font-weight:600}.collision-filter-tags[data-v-affb8652]{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.collision-filter-tag[data-v-affb8652]{display:inline-flex;min-width:0;align-items:center;gap:6px;padding:5px 5px 5px 8px;border:1px solid #625ff1;border-radius:6px;background:#514dcf;color:#fff;font-size:11px}.collision-filter-tag>span[data-v-affb8652]{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.collision-filter-tag.disabled[data-v-affb8652]{border-color:#4b5364;background:#343b4b;color:#929bad}.collision-filter-tag button[data-v-affb8652]{width:18px;height:18px;padding:0;border:0;border-radius:4px;background:#0b0f1a38;color:inherit;line-height:16px;cursor:pointer}.collision-filter-tag button[data-v-affb8652]:hover{background:#0b0f1a80;color:#fff}.collision-filter-add[data-v-affb8652]{width:30px;height:30px;padding:0;border:1px dashed #536079;border-radius:6px;background:#182131;color:#98a5bd;font-size:18px;line-height:28px;cursor:pointer}.collision-filter-add[data-v-affb8652]:hover,.collision-filter-add.active[data-v-affb8652]{border-color:#7774ff;background:#262c52;color:#fff}.collision-filter-add[data-v-affb8652]:disabled{opacity:.42;cursor:not-allowed}.collision-filter-empty[data-v-affb8652]{margin-top:7px;color:#6f7b91;font-size:10px}.collision-filter-picker[data-v-affb8652]{display:grid;gap:4px;margin-top:7px;padding:5px;border:1px solid #344158;border-radius:6px;background:#101725}.collision-filter-picker button[data-v-affb8652]{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;border:0;border-radius:4px;background:transparent;color:#c7d0e3;font-size:11px;text-align:left;cursor:pointer}.collision-filter-picker button[data-v-affb8652]:hover{background:#29344a;color:#fff}.collision-filter-picker button span[data-v-affb8652]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.collision-filter-picker button small[data-v-affb8652]{flex:none;color:#68758d;font-size:9px}.switch-row input:disabled+.switch-ui[data-v-affb8652]{opacity:.45;cursor:not-allowed}.bone-follow-target[data-v-affb8652]{margin:7px 0 9px;padding:7px 8px;overflow:hidden;color:#7f8ba3;background:#121a29;border:1px solid #2f3c53;border-radius:5px;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.bone-follow-target strong[data-v-affb8652]{color:#c8d0e4;font-weight:600}.bone-follow-missing[data-v-affb8652]{margin:7px 0 9px;padding:7px 8px;color:#d49aa3;background:#2a1e26;border:1px solid #513540;border-radius:5px;font-size:10px;line-height:1.5}.bone-follow-rebind[data-v-affb8652]{width:100%;min-height:28px;margin:0 0 8px;padding:4px 8px;overflow:hidden;border:1px solid #4a436e;border-radius:5px;background:#2d2947;color:#c8c2ee;font-size:10px;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.bone-follow-rebind[data-v-affb8652]:hover{border-color:#7165bd;background:#3a335d;color:#fff}.bone-follow-transform-grid[data-v-affb8652]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.modifier-mode-row[data-v-affb8652]{display:flex;justify-content:flex-end;gap:4px;margin-bottom:6px}.gravity-curve-title[data-v-affb8652]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:10px 0 6px;color:#9ba7bd;font-size:11px}.gravity-curve-title span[data-v-affb8652]:last-child{color:#657188;font-size:9px}.gravity-curve-axis[data-v-affb8652]{display:flex;justify-content:space-between;margin:3px 34px 0 1px;color:#5f6b82;font-size:9px}.gravity-params[data-v-affb8652] .ce-svg{height:96px;background:#0f1625;border-color:#30405a}.trail-params[data-v-affb8652]{padding-right:2px}.trail-section-title[data-v-affb8652]{margin:3px 0 8px;color:#aeb8cf;font-size:12px;font-weight:700}.trail-fixed-color .hex-input[data-v-affb8652]{min-width:0;flex:1}.trail-mode-head[data-v-affb8652]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:10px 0 6px;color:#9ba7bd;font-size:11px}.trail-sub-switch[data-v-affb8652]{margin:11px 0 7px;padding-top:9px;border-top:1px solid #2a3549}.trail-grid-row[data-v-affb8652]{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.trail-grid-row[data-v-affb8652] .ns{min-width:0;flex-wrap:wrap;align-items:center}.trail-grid-row[data-v-affb8652] .ns-label{width:100%}.trail-grid-row[data-v-affb8652] .ns-range{min-width:0}.trail-grid-row[data-v-affb8652] .ns-num{width:42px}.trail-params[data-v-affb8652] .ce-svg{height:92px;background:#0f1625;border-color:#30405a}.group[data-v-04462c7a]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-04462c7a]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-04462c7a]:hover{background:#20202e}.group-reset[data-v-04462c7a]{margin-left:auto;height:22px;padding:0 7px;border:1px solid #3a465f;border-radius:5px;background:#252d3d;color:#9eabc3;font-size:10px;line-height:20px;cursor:pointer}.group-reset[data-v-04462c7a]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-04462c7a]{padding:8px 10px 12px}.caret[data-v-04462c7a]{display:inline-block;width:12px;color:#667;font-size:11px}.row[data-v-04462c7a]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-04462c7a]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-04462c7a]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.placeholder[data-v-04462c7a]{color:#667;font-size:11px;padding:6px 0}.export-settings[data-v-04462c7a]{padding-top:3px}.export-field[data-v-04462c7a]{display:flex;flex-direction:column;gap:6px;margin:10px 0 13px;color:#9ca8bf;font-size:11px;font-weight:600}.export-input[data-v-04462c7a]{width:100%;min-height:34px;box-sizing:border-box;padding:6px 9px;color:#e3e7f2;background:#141a29;border-color:#35445f}.export-fps-row[data-v-04462c7a]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:end}.export-fps-field[data-v-04462c7a]{margin-bottom:5px}.export-checkbox[data-v-04462c7a]{display:flex;align-items:center;gap:7px;min-height:34px;margin-bottom:5px;color:#aeb8cc;font-size:11px;white-space:nowrap}.export-checkbox input[data-v-04462c7a]{width:17px;height:17px;margin:0;accent-color:#625ff1}.export-help[data-v-04462c7a]{margin:-6px 0 14px;color:#66758e;font-size:10px;line-height:1.5}.export-switches[data-v-04462c7a]{display:grid;gap:13px;margin:4px 0 7px;padding-top:2px}.export-switch[data-v-04462c7a]{font-weight:600}.export-switch-last[data-v-04462c7a]{margin-top:13px}.inp.tiny[data-v-04462c7a]{width:46px;flex:0 0 46px;text-align:center}.switch-row[data-v-04462c7a]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-04462c7a]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-04462c7a]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-04462c7a]:after{content:"";position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .16s ease}.switch-row input:checked+.switch-ui[data-v-04462c7a]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-04462c7a]:after{transform:translate(14px)}.switch-row input:disabled+.switch-ui[data-v-04462c7a]{opacity:.45;cursor:not-allowed}.spine-export-actions[data-v-7ff40afe]{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:10px}.export-spine-json[data-v-7ff40afe]{width:100%;padding:9px 8px;flex:0 0 auto;border:1px solid #4f4b9a;border-radius:7px;background:#403b91;color:#f1f0ff;font-size:12px;font-weight:700;cursor:pointer}.export-spine-json[data-v-7ff40afe]:hover{border-color:#7774ff;background:#514bc0}.export-spine-json[data-v-7ff40afe]:disabled{cursor:wait;opacity:.68}.export-spine-project[data-v-7ff40afe]{grid-column:1 / -1;width:100%;padding:7px 8px;border:1px solid #287d69;border-radius:7px;background:#196854;color:#edfff9;font-size:12px;font-weight:700;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}.export-spine-project small[data-v-7ff40afe]{color:inherit;font-size:9px;font-weight:500;line-height:1.1}.export-spine-project[data-v-7ff40afe]:hover:not(:disabled){border-color:#47c89f;background:#238267}.export-spine-project[data-v-7ff40afe]:disabled{cursor:not-allowed;opacity:.48}.export-spine-images[data-v-7ff40afe]{width:100%;padding:8px;border:1px solid #3b5f8b;border-radius:7px;background:#243e64;color:#eaf3ff;font-size:12px;font-weight:700;cursor:pointer}.export-spine-images[data-v-7ff40afe]:hover:not(:disabled){border-color:#6099dc;background:#315581}.export-spine-images[data-v-7ff40afe]:disabled{cursor:wait;opacity:.55}.connector-status[data-v-7ff40afe]{display:flex;align-items:center;justify-content:center;gap:5px;padding-top:6px;color:#717b99;font-size:10px}.connector-status .connector-dot[data-v-7ff40afe]{width:6px;height:6px;border-radius:50%;background:#66718f}.connector-status.ready[data-v-7ff40afe]{color:#70d8ae}.connector-status.ready .connector-dot[data-v-7ff40afe]{background:#49c993;box-shadow:0 0 5px #49c99388}.connector-status.warning[data-v-7ff40afe]{color:#d4aa67}.connector-status.warning .connector-dot[data-v-7ff40afe]{background:#d4aa67}.connector-status button[data-v-7ff40afe]{padding:0 3px;border:0;background:transparent;color:#8290b6;font-size:10px;cursor:pointer}.connector-status button[data-v-7ff40afe]:hover{color:#c5caff}.connector-status a[data-v-7ff40afe]{padding:0 3px;color:#a8b0ff;font-size:10px;text-decoration:underline}.connector-status a[data-v-7ff40afe]:hover{color:#d8dcff}.export-message[data-v-7ff40afe]{padding:7px 5px 0;color:#70d8ae;font-size:10px;line-height:1.45;text-align:center}.export-message.error[data-v-7ff40afe]{color:#ff858f}.export-message a[data-v-7ff40afe]{display:inline-block;margin-left:5px;color:#9da7ff;text-decoration:underline}.panel[data-v-283ef8eb]{display:flex;width:100%;height:100%;flex-direction:column;overflow:hidden;background:#14141f;border-left:1px solid #2a2a3c;padding:12px;box-sizing:border-box}.panel-scroll[data-v-283ef8eb]{min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain;padding-right:2px;scrollbar-width:thin;scrollbar-color:#2e2e44 transparent}.panel-scroll[data-v-283ef8eb]::-webkit-scrollbar{width:6px}.panel-scroll[data-v-283ef8eb]::-webkit-scrollbar-track{background:transparent}.panel-scroll[data-v-283ef8eb]::-webkit-scrollbar-thumb{background:#2e2e44;border-radius:3px}.panel-scroll[data-v-283ef8eb]::-webkit-scrollbar-thumb:hover{background:#3a3a55}.panel-header[data-v-283ef8eb]{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;flex:0 0 auto;font-weight:700;color:#ccd}.timeline[data-v-6b4c353d]{height:100%;background:#12121c;border-top:1px solid #2a2a3c;display:flex;flex-direction:column;padding:6px 10px;gap:4px}.tl-controls[data-v-6b4c353d]{display:flex;align-items:center;gap:8px}.tl-btn[data-v-6b4c353d]{width:30px;height:26px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.tl-btn.on[data-v-6b4c353d]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.tl-ab-loop[data-v-6b4c353d]{position:relative}.tl-ab-toggle[data-v-6b4c353d]{display:flex;height:26px;align-items:center;gap:7px;padding:0 7px;border:1px solid #343a51;border-radius:6px;background:#1e1e2e;color:#8f98ad;font-size:10px;cursor:pointer}.tl-ab-toggle.on[data-v-6b4c353d]{border-color:#716eff;background:#2e2d50;color:#eef}.tl-switch[data-v-6b4c353d]{position:relative;width:22px;height:12px;border-radius:99px;background:#343a4b}.tl-switch b[data-v-6b4c353d]{position:absolute;top:2px;left:2px;width:8px;height:8px;border-radius:50%;background:#8992a5;transition:transform .15s ease,background .15s ease}.tl-ab-toggle.on .tl-switch[data-v-6b4c353d]{background:#716eff}.tl-ab-toggle.on .tl-switch b[data-v-6b4c353d]{transform:translate(10px);background:#fff}.tl-ab-popover[data-v-6b4c353d]{position:absolute;z-index:40;left:0;bottom:calc(100% + 8px);display:flex;align-items:center;gap:10px;padding:9px 10px;border:1px solid #4b4c73;border-radius:8px;background:#171724;box-shadow:0 10px 26px #00000080}.tl-ab-title[data-v-6b4c353d]{color:#b7bdd2;font-size:10px;white-space:nowrap}.tl-range[data-v-6b4c353d]{display:flex;height:25px;align-items:center;gap:3px;color:#778198;font-size:10px}.tl-range input[data-v-6b4c353d]{width:43px;height:25px;padding:0 5px;box-sizing:border-box;border:1px solid #3a3a51;border-radius:5px;outline:none;background:#181824;color:#e1e4ed;font-size:11px;text-align:center}.tl-range input[data-v-6b4c353d]:focus{border-color:#716eff}.tl-frame[data-v-6b4c353d]{display:inline-block;flex:0 0 92px;width:92px;box-sizing:border-box;font-size:12px;color:#aab;text-align:right;font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;white-space:nowrap}.tl-frame b[data-v-6b4c353d]{display:inline;color:inherit;font-weight:400}.tl-legend[data-v-6b4c353d]{display:flex;align-items:center;gap:4px;color:#778198;font-size:10px}.tl-legend i[data-v-6b4c353d]{display:inline-block;width:10px;height:7px;border-radius:2px}.legend-emission[data-v-6b4c353d]{margin-left:4px;background:#2f8b62}.legend-life[data-v-6b4c353d]{margin-left:5px;background:#a54551}.legend-spine[data-v-6b4c353d]{margin-left:5px;background:#7448b8}.tl-anim[data-v-6b4c353d]{display:flex;align-items:center;gap:6px;font-size:12px;color:#aab}.tl-owner-animation[data-v-6b4c353d]{position:relative}.tl-animation-trigger[data-v-6b4c353d]{display:flex;align-items:center;justify-content:space-between;gap:8px;width:116px;height:25px;padding:0 7px;overflow:hidden;border:1px solid #2e2e44;border-radius:5px;background:#1a1a28;color:#dde;cursor:pointer}.tl-animation-trigger>span[data-v-6b4c353d]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-animation-trigger>i[data-v-6b4c353d]{flex:0 0 auto;color:#8c96ad;font-style:normal}.tl-animation-trigger[data-v-6b4c353d]:disabled{opacity:.5;cursor:not-allowed}.tl-animation-menu[data-v-6b4c353d]{position:absolute;z-index:30;right:0;bottom:calc(100% + 6px);width:226px;padding:7px;border:1px solid #3c4760;border-radius:8px;background:#171b29;box-shadow:0 10px 24px #00000073}.tl-animation-menu-title[data-v-6b4c353d]{padding:2px 4px 6px;color:#77839c;font-size:10px}.tl-animation-option[data-v-6b4c353d]{display:flex;align-items:center;justify-content:space-between;width:100%;height:27px;padding:0 7px;border:0;border-radius:5px;background:transparent;color:#b8c1d5;text-align:left;cursor:pointer}.tl-animation-option>span[data-v-6b4c353d]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-animation-option[data-v-6b4c353d]:hover{background:#252e42}.tl-animation-option.on[data-v-6b4c353d]{background:#34335d;color:#fff}.tl-animation-option>i[data-v-6b4c353d]{color:#8d8aff;font-style:normal}.tl-animation-editor[data-v-6b4c353d]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px;margin-top:7px;padding-top:7px;border-top:1px solid #2b3346}.tl-animation-name[data-v-6b4c353d]{min-width:0;height:27px;padding:0 7px;box-sizing:border-box;border:1px solid #343e55;border-radius:5px;background:#101522;color:#e1e6f2;outline:none}.tl-animation-name[data-v-6b4c353d]:focus{border-color:#6865d8}.tl-animation-editor button[data-v-6b4c353d],.tl-animation-actions button[data-v-6b4c353d]{height:27px;padding:0 8px;border:1px solid #3c4861;border-radius:5px;background:#29344a;color:#cbd3e3;cursor:pointer}.tl-animation-actions[data-v-6b4c353d]{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin-top:6px}.tl-animation-actions button[data-v-6b4c353d]:last-child{border-color:#5b3942;background:#3b282f;color:#e2a8b2}.tl-animation-actions button[data-v-6b4c353d]:disabled{opacity:.4;cursor:not-allowed}.tl-animation-error[data-v-6b4c353d]{margin-top:5px;color:#ef8997;font-size:10px}.tl-animation-hint[data-v-6b4c353d]{margin-top:5px;color:#69758d;font-size:9px;text-align:center}.tl-sel[data-v-6b4c353d]{background:#1a1a28;border:1px solid #2e2e44;color:#dde;border-radius:5px;padding:2px 6px;font-size:12px}.tl-sel[data-v-6b4c353d]:disabled{opacity:.5;cursor:not-allowed}.tl-spine-preview .tl-sel[data-v-6b4c353d]{max-width:190px}.tl-zoom[data-v-6b4c353d]{margin-left:auto;font-size:11px;color:#667}.tl-viewport[data-v-6b4c353d]{position:relative;flex:1;overflow:hidden;background:#0d0d14;border:1px solid #2a2a3c;border-radius:6px;cursor:ew-resize}.tl-ticks[data-v-6b4c353d]{position:absolute;top:0;left:0;right:0;height:18px}.tl-tickline[data-v-6b4c353d]{position:absolute;top:0;bottom:0;width:1px;background:#263040}.tl-ticklabel[data-v-6b4c353d]{position:absolute;top:2px;transform:translate(-50%);font-size:9px;color:#667}.tl-playhead[data-v-6b4c353d]{position:absolute;top:0;bottom:0;width:2px;background:#fc3;z-index:5;pointer-events:none}.tl-lanes[data-v-6b4c353d]{position:absolute;top:22px;left:0;right:0;bottom:0}.tl-lane[data-v-6b4c353d]{position:relative;height:26px;margin-bottom:4px}.lane-ico[data-v-6b4c353d]{position:absolute;left:4px;top:6px;font-size:11px;color:#dde;z-index:2;pointer-events:none}.lane-ico.sub-lane-ico[data-v-6b4c353d]{color:#7f8999}.lane-bar[data-v-6b4c353d]{position:absolute;top:4px;height:18px;display:flex;align-items:stretch;cursor:grab;box-sizing:border-box}.lane-bar[data-v-6b4c353d]:active{cursor:grabbing}.lane-name[data-v-6b4c353d]{position:absolute;left:14px;right:5px;top:2px;z-index:2;pointer-events:none;font-size:11px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bar-life[data-v-6b4c353d]{position:absolute;inset:0 auto 0 0;z-index:0;min-width:1px;border:1px solid #c05a66;border-radius:5px;background:#a54551;box-sizing:border-box}.sub-emitter-bar .bar-life[data-v-6b4c353d]{border-color:#727d8f;background:#596274}.bar-life.loop-life[data-v-6b4c353d]{border-color:#667085;background:#242b39}.bar-emission[data-v-6b4c353d]{position:absolute;inset:0 auto 0 0;z-index:1;min-width:1px;border:1px solid #45a97d;border-radius:5px 0 0 5px;background:#2f8b62;box-sizing:border-box}.bar-emission.bar-loop[data-v-6b4c353d]{border-radius:0}.bar-loop-transition[data-v-6b4c353d]{position:absolute;top:0;bottom:0;z-index:1;border:1px solid #7d8799;background:#50596a;box-sizing:border-box}.bar-loop-start[data-v-6b4c353d]{left:0;border-radius:5px 0 0 5px}.bar-loop-end[data-v-6b4c353d]{border-radius:0 5px 5px 0}.bar-handle[data-v-6b4c353d]{position:absolute;z-index:4;right:-4px;top:-1px;bottom:-1px;width:8px;cursor:ew-resize;background:#ffffff2e}.bar-handle[data-v-6b4c353d]:hover{background:#ffffff59}.spine-ico[data-v-6b4c353d]{color:#c08cff}.spine-bar[data-v-6b4c353d]{position:absolute;top:4px;height:18px;min-width:1px;box-sizing:border-box;border:1px solid #a575ed;border-radius:5px;background:#7448b8;cursor:grab;box-shadow:inset 0 0 0 1px #ffffff0d}.spine-bar[data-v-6b4c353d]:active{cursor:grabbing}.tl-empty[data-v-6b4c353d]{color:#667;font-size:11px;padding:8px}.transfer-overlay[data-v-592b922e]{position:fixed;z-index:2000;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:auto;cursor:wait;overscroll-behavior:contain;background:#05080f42;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px)}.transfer-dialog[data-v-592b922e]{width:min(420px,calc(100vw - 40px));padding:18px 20px 16px;border:1px solid #414b66;border-radius:10px;box-shadow:0 18px 55px #00000075;background:#171d2b;color:#e7ebf5}.transfer-heading[data-v-592b922e]{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px;font-size:14px;font-weight:700}.transfer-heading strong[data-v-592b922e]{color:#a8a6ff;font-size:12px;font-variant-numeric:tabular-nums}.transfer-track[data-v-592b922e]{height:9px;overflow:hidden;border:1px solid #35415a;border-radius:999px;background:#0d1422}.transfer-bar[data-v-592b922e]{height:100%;border-radius:inherit;background:linear-gradient(90deg,#4d75e8,#7774ff);transition:width .16s ease}.transfer-track.indeterminate .transfer-bar[data-v-592b922e]{width:42%;animation:transfer-slide-592b922e 1s ease-in-out infinite}.transfer-detail[data-v-592b922e]{min-height:17px;margin-top:9px;color:#8895ae;font-size:11px;line-height:1.5}.transfer-dialog.failed[data-v-592b922e]{border-color:#754351}.transfer-dialog.failed .transfer-heading strong[data-v-592b922e],.transfer-dialog.failed .transfer-detail[data-v-592b922e]{color:#e99aa9}.transfer-dialog.failed .transfer-bar[data-v-592b922e]{background:#c85d70}.transfer-fade-enter-active[data-v-592b922e],.transfer-fade-leave-active[data-v-592b922e]{transition:opacity .16s ease}.transfer-fade-enter-from[data-v-592b922e],.transfer-fade-leave-to[data-v-592b922e]{opacity:0}@keyframes transfer-slide-592b922e{0%{transform:translate(-110%)}to{transform:translate(250%)}}.layout[data-v-42c4fa00]{display:flex;width:100%;height:100%;min-height:0;overflow:clip}.parameter-panel[data-v-42c4fa00]{flex-shrink:0;height:100%;min-height:0;overflow:clip}.resizer-col[data-v-42c4fa00]{width:5px;cursor:col-resize;background:#1c1c2a;border-left:1px solid #2a2a3c;border-right:1px solid #2a2a3c;flex-shrink:0}.resizer-col[data-v-42c4fa00]:hover{background:#3a5a8c}.right[data-v-42c4fa00]{flex:1;min-width:0;height:100%;min-height:0;overflow:clip;display:flex;flex-direction:column}.panel-right .right[data-v-42c4fa00]{order:1}.panel-right .resizer-col[data-v-42c4fa00]{order:2}.panel-right .parameter-panel[data-v-42c4fa00]{order:3}.stage-area[data-v-42c4fa00]{flex:1;min-height:0;overflow:clip}.resizer-row[data-v-42c4fa00]{height:4px;cursor:row-resize;background:#1c1c2a;border-top:1px solid #2a2a3c;border-bottom:1px solid #2a2a3c;flex-shrink:0}.resizer-row[data-v-42c4fa00]:hover{background:#3a5a8c}.timeline-area[data-v-42c4fa00]{position:relative;z-index:10;flex-shrink:0;overflow:visible}html,body{width:100%;height:100%;margin:0;padding:0;overflow:clip;overscroll-behavior:none;background:#0b0b12;color:#e8e8f0;font-family:system-ui,-apple-system,Segoe UI,sans-serif}body{position:fixed;top:0;right:0;bottom:0;left:0}*{box-sizing:border-box}#app{position:fixed;top:0;right:0;bottom:0;left:0;width:auto;height:auto;overflow:clip}html,body,#app{-webkit-user-select:none;user-select:none}input,textarea,select,[contenteditable=true]{-webkit-user-select:text;user-select:text}input[type=number]{-webkit-appearance:textfield;appearance:textfield;-moz-appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none} diff --git a/dist/assets/index-eyCkSEtn.css b/dist/assets/index-eyCkSEtn.css deleted file mode 100644 index 1de81ff..0000000 --- a/dist/assets/index-eyCkSEtn.css +++ /dev/null @@ -1 +0,0 @@ -.help-overlay[data-v-78204b9d]{position:absolute;top:0;right:0;bottom:0;left:0;z-index:40;display:flex;align-items:center;justify-content:center;padding:72px 24px 28px;box-sizing:border-box;background:#05080fb8;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.help-dialog[data-v-78204b9d]{width:min(820px,100%);max-height:100%;display:flex;flex-direction:column;overflow:hidden;border:1px solid #3a4864;border-radius:14px;background:#141a27;color:#b8c3d8;box-shadow:0 22px 70px #0000009e}.help-head[data-v-78204b9d]{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:18px 20px 15px;border-bottom:1px solid #2b354a;background:linear-gradient(135deg,#202942,#181e2d)}.help-head h2[data-v-78204b9d]{margin:0;color:#eef2ff;font-size:19px}.help-head p[data-v-78204b9d]{margin:5px 0 0;color:#7786a3;font-size:11px}.help-close[data-v-78204b9d]{width:28px;height:28px;flex:0 0 28px;border:1px solid #43516b;border-radius:6px;background:#273249;color:#ccd7ed;cursor:pointer}.help-close[data-v-78204b9d]:hover{border-color:#7774ff;background:#3b4670;color:#fff}.help-body[data-v-78204b9d]{min-height:0;overflow:auto;padding:18px 20px 21px}.help-section[data-v-78204b9d]{padding:14px 15px;border:1px solid #2c3850;border-radius:10px;background:#181f2e}.help-section h3[data-v-78204b9d]{margin:0 0 11px;color:#9fb2ff;font-size:13px}.help-start ol[data-v-78204b9d]{margin:0;padding-left:21px;color:#aab6cc;font-size:12px;line-height:1.75}.help-start li[data-v-78204b9d]::marker{color:#7774ff;font-weight:700}.help-section b[data-v-78204b9d]{color:#dce4f7}.help-grid[data-v-78204b9d]{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(250px,.85fr);gap:12px;margin-top:12px}.help-list[data-v-78204b9d]{display:grid;gap:0;margin:0}.help-list>div[data-v-78204b9d]{display:grid;grid-template-columns:78px 1fr;gap:9px;padding:7px 0;border-bottom:1px solid #263146}.help-list>div[data-v-78204b9d]:last-child{border-bottom:0}.help-list dt[data-v-78204b9d]{color:#d3dcf0;font-size:11px;font-weight:700}.help-list dd[data-v-78204b9d]{margin:0;color:#8795ae;font-size:11px;line-height:1.5}.shortcut-list[data-v-78204b9d]{display:grid;gap:7px}.shortcut-list>div[data-v-78204b9d]{display:flex;align-items:center;min-height:25px;gap:5px}.shortcut-list kbd[data-v-78204b9d]{min-width:24px;box-sizing:border-box;padding:3px 6px;border:1px solid #465470;border-bottom-width:2px;border-radius:5px;background:#101623;color:#e0e7f6;font:10px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;text-align:center}.shortcut-list span[data-v-78204b9d]{color:#65728b;font-size:10px}.shortcut-list em[data-v-78204b9d]{margin-left:auto;color:#9ca9c1;font-size:11px;font-style:normal}.help-note[data-v-78204b9d]{margin:11px 0 0;padding-top:9px;border-top:1px solid #2a3549;color:#697791;font-size:10px;line-height:1.55}.help-export[data-v-78204b9d]{margin-top:12px}.help-export p[data-v-78204b9d]{margin:0;color:#8997b0;font-size:11px;line-height:1.65}.help-doc-title[data-v-78204b9d]{margin:16px 2px 2px;color:#9fb2ff;font-size:13px;font-weight:700;letter-spacing:.5px}.help-module[data-v-78204b9d]{margin-top:12px}.help-module-head[data-v-78204b9d]{display:flex;align-items:center;gap:8px;width:100%;padding:0;border:0;background:transparent;color:#9fb2ff;font:inherit;font-size:13px;font-weight:700;text-align:left;cursor:pointer}.help-module-head[data-v-78204b9d]:hover{color:#fff}.help-module-head .mtitle[data-v-78204b9d]{flex:1;min-width:0}.help-module-head .caret[data-v-78204b9d]{flex:0 0 auto;color:#7b86a2;font-size:12px}.help-module.open .help-module-head[data-v-78204b9d]{color:#fff}.help-module.open .help-module-head .caret[data-v-78204b9d]{color:#9fb2ff}.help-module .mnum[data-v-78204b9d]{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:6px;background:linear-gradient(135deg,#4a53b8,#6a5fd0);color:#fff;font-size:12px;font-weight:700}.help-module.help-connector[data-v-78204b9d]{border-color:#4a4f8a;background:linear-gradient(135deg,#1d2442,#181d2f)}.help-module.help-connector .help-module-head[data-v-78204b9d]{color:#b8c2ff}.help-module .connector-intro[data-v-78204b9d]{margin:0 0 10px;color:#9aa8c4;font-size:11px;line-height:1.6}.help-module .connector-intro b[data-v-78204b9d]{color:#dce4f7}.help-module .dl-link[data-v-78204b9d]{display:inline-flex;flex-direction:column;align-items:flex-start;gap:2px;margin:0 10px 6px 0;padding:6px 12px;border:1px solid #5652b5;border-radius:6px;background:#4540a0;color:#fff;font-size:12px;font-weight:700;text-decoration:none}.help-module .dl-link[data-v-78204b9d]:hover{border-color:#8982ff;background:#554dc2}.help-module .dl-link small[data-v-78204b9d]{color:#cfe0ff;font-weight:500;font-size:9px}.help-module-body[data-v-78204b9d]{padding-top:10px}@media(max-width:760px){.help-overlay[data-v-78204b9d]{padding:66px 12px 14px}.help-grid[data-v-78204b9d]{grid-template-columns:1fr}}.topbar[data-v-4749834a]{position:absolute;top:10px;left:10px;right:10px;display:flex;align-items:center;gap:10px;padding:8px 12px;background:#141420d9;border-radius:10px;border:1px solid rgba(255,255,255,.08);font-size:12px;color:#aab;z-index:5;flex-wrap:wrap}.topbar input[type=range][data-v-4749834a]{background:#1a1a28;border:1px solid #2e2e44;color:#dde;border-radius:5px}.tool-group[data-v-4749834a]{display:flex;gap:6px;margin-left:6px;padding-left:12px;border-left:1px solid #2a2a3c}.tool-btn[data-v-4749834a]{width:30px;height:26px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:14px;cursor:pointer;display:flex;align-items:center;justify-content:center}.tool-btn[data-v-4749834a]:hover{background:#2b3a5c;color:#fff}.tool-btn.on[data-v-4749834a]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.background-menu[data-v-4749834a]{position:relative;flex:0 0 auto}.background-btn[data-v-4749834a]{height:28px;padding:0 11px;border:1px solid #3a4963;border-radius:6px;background:#202a3b;color:#cbd7ed;font-size:12px;cursor:pointer}.background-btn[data-v-4749834a]:hover,.background-btn.on[data-v-4749834a]{border-color:#7774ff;background:#343b63;color:#fff}.background-panel[data-v-4749834a]{position:absolute;top:calc(100% + 9px);right:0;width:248px;box-sizing:border-box;padding:10px;border:1px solid #343b50;border-radius:9px;background:#141420fa;color:#aeb8cc;box-shadow:0 8px 24px #0000007a;z-index:12}.background-upload[data-v-4749834a]{width:100%;height:30px;border:1px solid #5652b5;border-radius:6px;background:#4540a0;color:#fff;cursor:pointer}.background-upload[data-v-4749834a]:hover{border-color:#8982ff;background:#554dc2}.background-clear[data-v-4749834a]{width:100%;height:28px;margin-top:6px;border:1px solid #70404a;border-radius:6px;background:#512a33;color:#efb5bd;cursor:pointer}.background-clear[data-v-4749834a]:hover:not(:disabled){border-color:#b65b6a;background:#6a303b;color:#fff}.background-clear[data-v-4749834a]:disabled{opacity:.42;cursor:not-allowed}.background-file-input[data-v-4749834a]{display:none}.background-file-name[data-v-4749834a]{margin:7px 2px 9px;overflow:hidden;color:#737f98;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.background-position-row[data-v-4749834a]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.background-position-row label[data-v-4749834a]{display:flex;align-items:center;gap:5px;color:#8995ad;font-size:11px}.background-position-row input[data-v-4749834a]{width:0;min-width:0;flex:1;box-sizing:border-box;height:28px;padding:0 6px;border:1px solid #343e55;border-radius:5px;background:#101522;color:#e1e6f2}.background-opacity-row[data-v-4749834a]{display:grid;grid-template-columns:46px 1fr 34px;align-items:center;gap:7px;margin-top:10px;font-size:11px}.background-opacity-row input[data-v-4749834a]{min-width:0;accent-color:#675de0}.background-opacity-row b[data-v-4749834a]{color:#aeb8cc;font-size:10px;text-align:right;font-variant-numeric:tabular-nums}.help-btn[data-v-4749834a]{height:28px;margin-left:auto;padding:0 11px;flex:0 0 auto;border:1px solid #3a4963;border-radius:6px;background:#202a3b;color:#cbd7ed;font-size:12px;font-weight:700;cursor:pointer}.help-btn[data-v-4749834a]:hover,.help-btn.on[data-v-4749834a]{border-color:#7774ff;background:#343b63;color:#fff}.zoom-pct[data-v-4749834a]{margin-left:0;font-variant-numeric:tabular-nums;color:#9aa;min-width:44px;text-align:center}.settings-btn[data-v-4749834a]{height:28px;padding:0 12px;flex:0 0 auto;border:1px solid #3a4963;border-radius:6px;background:#202a3b;color:#cdf;font-size:12px;font-weight:700;cursor:pointer}.settings-btn[data-v-4749834a]:hover{border-color:#7774ff;background:#2b3a5c;color:#fff}.undo-btn[data-v-4749834a]{width:30px;height:28px;flex:0 0 30px;border:1px solid #3a4963;border-radius:6px;background:#202a3b;color:#cdd8ed;font-size:18px;line-height:1;cursor:pointer}.undo-btn[data-v-4749834a]:hover:not(:disabled){border-color:#7774ff;background:#2b3a5c;color:#fff}.undo-btn[data-v-4749834a]:disabled{opacity:.38;cursor:not-allowed}.settings-panel[data-v-1bba85d9]{position:absolute;top:52px;left:10px;width:240px;z-index:10;background:#141420f7;border:1px solid #2a2a3c;border-radius:10px;padding:10px 12px;font-size:12px;color:#aab;box-shadow:0 6px 20px #0006}.sp-head[data-v-1bba85d9]{display:flex;justify-content:space-between;align-items:center;font-weight:700;color:#cdf;margin-bottom:10px}.sp-section-title[data-v-1bba85d9]{margin:2px 0 8px;color:#8a93bb;font-size:11px}.sp-switch-row[data-v-1bba85d9]{display:flex;align-items:center;justify-content:space-between;gap:10px;color:#aab}.sp-switch-control[data-v-1bba85d9]{display:inline-flex;align-items:center;gap:7px}.sp-switch-control input[data-v-1bba85d9]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.sp-switch-ui[data-v-1bba85d9]{position:relative;width:34px;height:18px;border-radius:999px;background:#39445a;cursor:pointer;transition:background .16s ease}.sp-switch-ui[data-v-1bba85d9]:after{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:#f4f6fb;transition:transform .16s ease}.sp-switch-control input:checked+.sp-switch-ui[data-v-1bba85d9]{background:#655df0}.sp-switch-control input:checked+.sp-switch-ui[data-v-1bba85d9]:after{transform:translate(16px)}.sp-switch-control input:focus-visible+.sp-switch-ui[data-v-1bba85d9]{outline:2px solid #8b86ff;outline-offset:2px}.sp-switch-control b[data-v-1bba85d9]{min-width:24px;color:#8a93bb;font-size:11px;font-weight:500}.sp-cache-note[data-v-1bba85d9]{margin-top:10px;padding-top:9px;border-top:1px solid #2a2a3c;color:#647089;font-size:10px;text-align:center}.sp-divider[data-v-1bba85d9]{height:1px;margin:10px 0;background:#2a2a3c}.sp-close[data-v-1bba85d9]{background:#2e3a55;border:none;color:#cdf;border-radius:4px;width:18px;height:18px;cursor:pointer;font-size:11px}.sp-row[data-v-1bba85d9]{display:flex;align-items:center;gap:8px;margin:8px 0}.sp-row>span[data-v-1bba85d9]:first-child{width:76px;flex-shrink:0;color:#8a93bb}.sp-row input[type=range][data-v-1bba85d9]{flex:1;background:#1a1a28;accent-color:#3a5a8c}.sp-num[data-v-1bba85d9]{width:52px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px;padding:2px 4px}.sp-undo-limit[data-v-1bba85d9]{margin-left:auto;width:64px;height:26px;box-sizing:border-box}.sp-colr[data-v-1bba85d9]{width:26px;height:22px;border:none;background:none;cursor:pointer}.sp-hex[data-v-1bba85d9]{font-size:11px;color:#889;font-variant-numeric:tabular-nums}.sp-chk[data-v-1bba85d9]{display:flex;align-items:center;gap:6px;margin:8px 0;color:#aab}.stage-wrap[data-v-38dbe6fc]{position:relative;width:100%;height:100%;overflow:hidden}.stage-holder[data-v-38dbe6fc]{width:100%;height:100%;cursor:grab;touch-action:none;background-color:#0e1219;outline:none}.stage-holder.grid[data-v-38dbe6fc]{background:conic-gradient(#141a26 90deg,transparent 90deg 180deg,#141a26 180deg 270deg,#141a26 180deg 270deg,transparent 270deg);background-size:28px 28px}.stage-holder[data-v-38dbe6fc]:active{cursor:grabbing}.hud[data-v-38dbe6fc]{position:absolute;bottom:12px;left:12px;padding:8px 12px;background:#141420bf;border-radius:8px;font-size:12px;color:#a0a8cc}.hud-number[data-v-38dbe6fc]{display:inline-block;box-sizing:border-box;text-align:right;font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1}.hud-system-count[data-v-38dbe6fc]{width:3ch}.hud-particle-count[data-v-38dbe6fc]{width:7ch;text-align:left}.hud-tip[data-v-38dbe6fc]{margin-left:12px;color:#5f6a8a;font-size:11px}b[data-v-38dbe6fc]{color:#fc3}.config-management-body[data-v-cb52d3e0]{padding-bottom:2px}.config-toolbar[data-v-cb52d3e0]{display:grid;grid-template-columns:auto auto minmax(0,1fr);gap:6px;margin-bottom:10px}.config-toolbar button[data-v-cb52d3e0],.config-toolbar select[data-v-cb52d3e0]{min-width:0;height:30px;box-sizing:border-box;border:1px solid #3b4864;border-radius:6px;background:#263149;color:#d6def0;font-size:11px}.config-toolbar button[data-v-cb52d3e0]{padding:0 9px;cursor:pointer}.config-toolbar button[data-v-cb52d3e0]:hover{border-color:#7169dc;background:#343d68;color:#fff}.config-toolbar select[data-v-cb52d3e0]{padding:0 7px;overflow:hidden;text-overflow:ellipsis}.config-toolbar select[data-v-cb52d3e0]:disabled{color:#68738a;background:#1b2130}.config-message[data-v-cb52d3e0]{margin:-4px 0 9px;color:#83b9a2;font-size:10px}.config-message.error[data-v-cb52d3e0]{color:#e8959e}.group[data-v-cb52d3e0]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-cb52d3e0]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-cb52d3e0]:hover{background:#20202e}.group-body[data-v-cb52d3e0]{padding:8px 10px 12px}.caret[data-v-cb52d3e0]{display:inline-block;width:12px;color:#667;font-size:11px}.ns[data-v-7c2fbed0]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.ns-label[data-v-7c2fbed0]{width:60px;flex-shrink:0;color:#8a93bb}.ns-range[data-v-7c2fbed0]{flex:1;accent-color:#3a7cd6}.ns-num[data-v-7c2fbed0]{width:56px;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px;text-align:right}.ns.disabled[data-v-7c2fbed0]{opacity:.55}.ns.disabled .ns-range[data-v-7c2fbed0],.ns.disabled .ns-num[data-v-7c2fbed0]{cursor:not-allowed}.ce[data-v-9bfb7b31]{display:flex;align-items:flex-start;gap:6px;width:100%}.ce-editor[data-v-9bfb7b31]{flex:1;min-width:0}.ce-reset[data-v-9bfb7b31]{flex:0 0 auto;padding:5px 7px;border:1px solid #3b4b65;border-radius:5px;background:#242f42;color:#c4cee2;font-size:10px;cursor:pointer}.ce-reset[data-v-9bfb7b31]:hover{border-color:#7774ff;background:#4f4dc2;color:#fff}.ce-svg[data-v-9bfb7b31]{width:100%;height:110px;display:block;border:1px solid #2a2a3c;border-radius:6px;background:#10101a;cursor:crosshair;touch-action:none}.ce-grid line[data-v-9bfb7b31]{stroke:#1e1e30;stroke-width:1}.ce-frame[data-v-9bfb7b31]{stroke:#2e2e44;stroke-width:1}.ce-line[data-v-9bfb7b31]{stroke:#6ea0e8;stroke-width:2;stroke-linejoin:round}.ce-handles line[data-v-9bfb7b31]{stroke:#8d96b5;stroke-width:1;stroke-dasharray:3 2}.ce-handles circle[data-v-9bfb7b31]{fill:#b7c2dd;stroke:#344d94;stroke-width:1.2;cursor:grab}.ce-handles circle[data-v-9bfb7b31]:active{cursor:grabbing}.ce-node[data-v-9bfb7b31]{fill:#fff;stroke:#3a55aa;stroke-width:1.6;pointer-events:none}.ce-hit[data-v-9bfb7b31]{fill:transparent;stroke:none;cursor:grab}.ce-hit[data-v-9bfb7b31]:active{cursor:grabbing}.ce-nav[data-v-9bfb7b31]{display:flex;justify-content:space-between;margin-top:3px}.ce-tip[data-v-9bfb7b31]{color:#566;font-size:10px}.spine-editor[data-v-3545b078]{display:grid;gap:10px;color:#c5cbe0}.editor-title[data-v-3545b078],.section-title[data-v-3545b078]{color:#dce2f5;font-weight:700}.editor-title[data-v-3545b078]{padding-bottom:9px;border-bottom:1px solid #30394d}.grid[data-v-3545b078]{display:grid;gap:8px}.grid.three[data-v-3545b078]{grid-template-columns:repeat(3,minmax(0,1fr))}.field[data-v-3545b078]{display:grid;gap:5px;min-width:0;color:#919bb7;font-size:12px}.field input[data-v-3545b078],.field select[data-v-3545b078],.asset-name[data-v-3545b078]{box-sizing:border-box;width:100%;min-width:0;height:35px;padding:0 10px;color:#e2e6f3;background:#101625;border:1px solid #32405b;border-radius:6px}.divider[data-v-3545b078]{height:1px;background:#30394d;margin:2px 0}.asset-row[data-v-3545b078]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.asset-name[data-v-3545b078]{display:flex;align-items:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#7f8aa7}button[data-v-3545b078]{height:35px;padding:0 13px;border:1px solid #3b4a67;border-radius:6px;background:#33415b;color:#e2e6f3;cursor:pointer}button[data-v-3545b078]:hover{filter:brightness(1.13)}button[data-v-3545b078]:disabled{opacity:.55;cursor:wait}.folder-select[data-v-3545b078]{width:100%;border-color:#6659c7;background:#4940a8;color:#fff}.folder-hint[data-v-3545b078]{margin-top:-5px;color:#69758e;font-size:10px;line-height:1.45}.asset-actions[data-v-3545b078]{display:grid;grid-template-columns:1fr 1fr;gap:5px}.asset-actions .load[data-v-3545b078]{background:#5543df;border-color:#6959ec}.asset-actions .clear[data-v-3545b078]{background:#702b34;border-color:#803842}.runtime-note[data-v-3545b078]{color:#69758e;font-size:11px;text-align:center}.error[data-v-3545b078]{padding:8px 10px;color:#ffabb2;background:#4b2028;border:1px solid #76323e;border-radius:6px;font-size:12px}.section-box[data-v-3545b078]{display:grid;gap:8px;padding:10px;background:#182132;border:1px solid #303c54;border-radius:7px}.empty[data-v-3545b078]{color:#667187;font-size:12px;padding:5px 0}.bone-tree[data-v-3545b078]{max-height:240px;overflow:auto;padding:4px 0;background:#111827;border-radius:5px}.tree-title-row[data-v-3545b078]{display:flex;align-items:center;justify-content:space-between;gap:8px}.tree-tabs[data-v-3545b078]{display:flex;gap:3px;margin:6px 0}.tree-tabs button[data-v-3545b078]{height:24px;padding:0 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#8d98ae;font-size:10px;cursor:pointer}.tree-tabs button[data-v-3545b078]:hover{background:#273246}.tree-tabs button.on[data-v-3545b078]{border-color:#7774ff;background:#35336b;color:#fff}.selected-bone[data-v-3545b078]{width:auto;min-width:0;max-width:100%;height:24px;flex:0 1 auto;overflow:hidden;padding:0 7px;color:#75819c;background:#182132;border:1px solid transparent;border-radius:5px;font-size:10px;text-align:right;white-space:nowrap;text-overflow:ellipsis}.selected-bone.active[data-v-3545b078]{color:#aeb9d4;background:#242f44;border-color:#35445e;cursor:pointer}.selected-bone.active[data-v-3545b078]:hover{border-color:#675ec4;background:#302b57}.selected-bone[data-v-3545b078]:disabled{opacity:1;cursor:default}.selected-bone strong[data-v-3545b078]{color:#c5cde3;font-weight:600}.tree-action[data-v-3545b078]{height:24px;padding:0 8px;color:#9aa7c2;background:#242f44;border-color:#35445e;font-size:10px}.bone-search[data-v-3545b078]{position:relative}.bone-search input[data-v-3545b078]{box-sizing:border-box;width:100%;height:30px;padding:0 32px 0 9px;color:#dce2f2;background:#101827;border:1px solid #33415b;border-radius:5px;font-size:11px;outline:none}.bone-search input[data-v-3545b078]:focus{border-color:#7065df;box-shadow:0 0 0 1px #7065df38}.bone-search button[data-v-3545b078]{position:absolute;top:3px;right:3px;width:24px;height:24px;padding:0;border:0;color:#8d98b0;background:transparent}.bone[data-v-3545b078]{display:flex;align-items:center;gap:4px;min-height:25px;color:#aeb8d2;font-size:12px;border-bottom:1px solid rgba(72,84,112,.22);cursor:pointer;outline:none}.bone[data-v-3545b078]:hover{background:#45567e38}.bone.selected[data-v-3545b078]{color:#f0edff;background:#6b53dd52;box-shadow:inset 2px 0 #8e72ff}.bone[data-v-3545b078]:focus-visible{box-shadow:inset 0 0 0 1px #7d72dd}.bone-toggle[data-v-3545b078]{width:22px;height:22px;padding:0;border:0;background:transparent;color:#9aa7c2}.bone-toggle[data-v-3545b078]:hover{background:#26324a}.bone-leaf[data-v-3545b078]{display:inline-flex;width:22px;justify-content:center;color:#58647d}.bone-name[data-v-3545b078]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.slot-row[data-v-3545b078]{padding-right:8px}.slot-order[data-v-3545b078]{width:24px;flex:0 0 24px;color:#66758e;font-size:10px;font-variant-numeric:tabular-nums;text-align:right}.slot-attachment[data-v-3545b078]{margin-left:auto;max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#6d7c96;font-size:10px}@media(max-width:430px){.grid.three[data-v-3545b078]{grid-template-columns:1fr}}.panel[data-v-3873124f]{display:flex;width:100%;height:100%;flex-direction:column;overflow:hidden;background:#14141f;border-left:1px solid #2a2a3c;padding:12px;box-sizing:border-box}.empty[data-v-3873124f],.panel-hint[data-v-3873124f]{color:#667;font-size:12px;padding:8px 0}.group[data-v-3873124f]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-3873124f]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-3873124f]:hover{background:#20202e}.scene-head[data-v-3873124f]{padding-right:6px}.scene-actions[data-v-3873124f]{margin-left:auto;display:flex;align-items:center;gap:4px}.scene-add[data-v-3873124f]{height:24px;padding:0 6px;border:1px solid #3a4a6a;border-radius:5px;background:#2e3a55;color:#cdf;font-size:10px;white-space:nowrap;cursor:pointer}.scene-add[data-v-3873124f]:hover{border-color:#7774ff;background:#45426f;color:#fff}.scene-add[data-v-3873124f]:disabled{opacity:.42;cursor:not-allowed;border-color:#343a4b;background:#252a38;color:#778095}.group-body[data-v-3873124f]{padding:8px 10px 12px}.caret[data-v-3873124f]{display:inline-block;width:12px;color:#667;font-size:11px}.tree[data-v-3873124f]{margin-bottom:8px}.tree-item[data-v-3873124f]{display:flex;align-items:center;gap:6px;padding:5px 6px;font-size:12px;color:#bcd;border-radius:6px;margin-bottom:2px}.tree-item.on[data-v-3873124f]{background:#26324a;color:#ffe}.tree-item .tdot[data-v-3873124f]{color:#fc3;font-size:10px}.tree-item .tdot.dim[data-v-3873124f]{color:#556}.tree-item .tdot.collision-dot[data-v-3873124f]{color:#ff7070}.tree-item .tdot.path-dot[data-v-3873124f]{color:#ff933e;font-size:14px}.tree-item .tdot.spine-dot[data-v-3873124f]{color:#c08cff;font-size:11px}.tree-item .tlabel[data-v-3873124f]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.scene-tree[data-v-3873124f]{padding-bottom:8px;border-bottom:1px solid #2a2a3c}.scene-object-item[data-v-3873124f]{min-height:28px;cursor:pointer}.scene-object-item[data-v-3873124f]:hover{background:#202b40}.scene-object-kind[data-v-3873124f]{color:#75829c;font-size:10px}.scene-object-eye[data-v-3873124f]{width:24px;height:22px;padding:3px;flex:0 0 24px;border:1px solid transparent;border-radius:5px;background:transparent;color:#9aa6bf;cursor:pointer}.scene-object-eye[data-v-3873124f]:hover{border-color:#4b5972;background:#29354a;color:#e1e7f4}.scene-object-eye.off[data-v-3873124f]{color:#59647a}.scene-object-eye svg[data-v-3873124f]{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.scene-object-eye .eye-slash[data-v-3873124f]{stroke:#d47b88;stroke-width:2}.scene-object-delete[data-v-3873124f]{width:24px;height:22px;padding:0;border:1px solid #59414a;border-radius:5px;background:#3a272f;color:#efb4bd;font-size:11px;cursor:pointer}.scene-object-delete[data-v-3873124f]:hover{border-color:#a45c69;background:#57303a;color:#fff}.object-editor-title[data-v-3873124f]{margin:10px 0 8px;padding-top:8px;border-top:1px solid #2a2a3c;color:#cbd4e8;font-weight:700}.field-block[data-v-3873124f]{display:flex;flex-direction:column;gap:5px;margin:10px 0;color:#8f9ab3;font-size:11px}.field-block>.inp[data-v-3873124f]{width:100%;box-sizing:border-box;min-height:30px}.field-block small[data-v-3873124f]{color:#5f6d86;line-height:1.5}.field-grid[data-v-3873124f]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:end}.compact-field[data-v-3873124f]{display:flex;min-width:0;flex-direction:column;gap:5px;margin:5px 0;color:#8f9ab3;font-size:11px}.compact-field .inp[data-v-3873124f]{width:100%;min-height:30px;box-sizing:border-box}.check-field[data-v-3873124f]{align-items:flex-start}.check-field input[data-v-3873124f]{width:18px;height:18px;margin:4px 0;accent-color:#4f7ee8}.follow-path[data-v-3873124f],.setting-line[data-v-3873124f]{display:flex;align-items:center;gap:8px;margin:12px 0 4px;color:#aeb8cf;font-size:12px}.setting-line[data-v-3873124f]{justify-content:space-between}.follow-path input[data-v-3873124f],.setting-line input[type=checkbox][data-v-3873124f]{width:17px;height:17px;accent-color:#4f7ee8}.collider-follow-section[data-v-3873124f]{margin-top:12px;padding-top:4px;border-top:1px solid #30394d}.collider-curve-title[data-v-3873124f]{display:flex;flex-direction:column;gap:3px;margin:12px 0 6px;color:#aeb8cf;font-size:12px}.collider-curve-title small[data-v-3873124f]{color:#67738c;font-size:10px;line-height:1.45}.path-color[data-v-3873124f]{width:48px;height:28px;padding:0;border:1px solid #3a4963;background:transparent;cursor:pointer}.path-help[data-v-3873124f]{margin:12px 0;color:#7d89a2;font-size:11px;line-height:1.55}.path-help>span[data-v-3873124f]{color:#aeb8cf}.path-help ul[data-v-3873124f]{margin:6px 0 0;padding-left:20px}.path-help li[data-v-3873124f]{margin:3px 0}.path-action[data-v-3873124f]{width:100%;height:31px;margin-top:7px;border:0;border-radius:5px;background:#33425b;color:#c9d1e1;cursor:pointer}.path-action[data-v-3873124f]:hover{filter:brightness(1.12)}.path-action.primary[data-v-3873124f]{background:#f05408;color:#fff}.row[data-v-3873124f]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-3873124f]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-3873124f]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.inp.tiny[data-v-3873124f]{width:46px;flex:0 0 46px;text-align:center}.seed-row[data-v-3873124f]{display:flex;align-items:center;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid #2d3950}.seed-row label[data-v-3873124f]{width:64px;color:#8f9bb5;font-size:12px}.seed-input[data-v-3873124f]{min-width:0;flex:1;padding:6px 8px;border:1px solid #344158;border-radius:6px;outline:none;background:#0f1625;color:#e2e7f2;font-size:12px}.seed-input[data-v-3873124f]:focus{border-color:#625ff1}.seed-random[data-v-3873124f]{width:34px;height:30px;border:1px solid #3a4860;border-radius:6px;background:#2c3950;color:#d7def0;cursor:pointer}.seed-random[data-v-3873124f]:hover{background:#394964}.scene-seed[data-v-3873124f]{margin-top:10px}.seed-hint[data-v-3873124f]{margin:5px 0 1px 72px;color:#657188;font-size:9px;line-height:1.45}.group[data-v-f9eac627]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-f9eac627]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-f9eac627]:hover{background:#20202e}.group-reset[data-v-f9eac627]{margin-left:auto;height:22px;padding:0 7px;border:1px solid #3a465f;border-radius:5px;background:#252d3d;color:#9eabc3;font-size:10px;line-height:20px;cursor:pointer}.group-reset[data-v-f9eac627]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-f9eac627]{padding:8px 10px 12px}.caret[data-v-f9eac627]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-f9eac627]{height:1px;background:#2a2a3c;margin:8px 0}.row[data-v-f9eac627]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-f9eac627]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-f9eac627]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.segs[data-v-f9eac627]{display:flex;gap:6px;margin:6px 0}.stream-behavior-segs[data-v-f9eac627]{margin-top:10px}.stream-loop-options[data-v-f9eac627]{display:grid;gap:8px;margin:8px 0 4px;padding:9px 10px;border:1px solid #32405a;border-radius:6px;background:#171f2e}.loop-section-row[data-v-f9eac627]{display:flex;min-height:27px;align-items:center;justify-content:space-between;gap:8px}.loop-duration-control[data-v-f9eac627]{display:flex;flex:0 0 auto;align-items:center;gap:7px}.loop-duration-toggle[data-v-f9eac627]{gap:5px;font-size:10px;white-space:nowrap}.loop-duration-toggle .switch-ui[data-v-f9eac627]{width:26px;height:14px}.loop-duration-toggle .switch-ui[data-v-f9eac627]:after{width:10px;height:10px}.loop-duration-toggle input:checked+.switch-ui[data-v-f9eac627]:after{transform:translate(12px)}.loop-section-duration[data-v-f9eac627]{display:flex;flex:0 0 auto;align-items:center;gap:4px;color:#7f8ba4;font-size:11px}.loop-section-duration input[data-v-f9eac627]{position:static;width:54px;height:25px;padding:0 6px;border:1px solid #3a465f;border-radius:5px;outline:none;background:#101725;color:#e4e8f2;text-align:right;opacity:1;pointer-events:auto}.loop-section-duration input[data-v-f9eac627]:focus{border-color:#716eff}.loop-auto-duration[data-v-f9eac627]{min-width:54px;color:#77839a;text-align:right;white-space:nowrap}.seg[data-v-f9eac627]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg.on[data-v-f9eac627]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.seg[data-v-f9eac627]{display:flex;gap:6px;margin:6px 0}.inp.tiny[data-v-f9eac627]{width:46px;flex:0 0 46px;text-align:center}.switch-row[data-v-f9eac627]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-f9eac627]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-f9eac627]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-f9eac627]:after{content:"";position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .16s ease}.switch-row input:checked+.switch-ui[data-v-f9eac627]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-f9eac627]:after{transform:translate(14px)}.modifier-hint[data-v-f9eac627]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.stream-loop-hint[data-v-f9eac627]{margin:9px 2px 3px;padding:7px 8px;border:1px solid #4a436e;border-radius:5px;background:#211f35;color:#aaa4d7}.switch-row input:disabled+.switch-ui[data-v-f9eac627]{opacity:.45;cursor:not-allowed}.pac[data-v-238f838c]{padding:10px;margin:8px 0;border:1px solid #2c3850;border-radius:7px;background:#171d2a}.pac-head[data-v-238f838c]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px}.pac-label[data-v-238f838c]{color:#aeb8cf;font-size:12px;font-weight:600;white-space:nowrap}.pac-modes[data-v-238f838c]{display:flex;gap:4px;flex-wrap:wrap;justify-content:flex-end}.pac-mode[data-v-238f838c]{padding:4px 7px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.pac-mode.on[data-v-238f838c]{border-color:#7774ff;background:#605df0;color:#fff}.pac-curve[data-v-238f838c]{margin-top:8px}.pac-axis[data-v-238f838c]{display:flex;justify-content:space-between;margin-top:3px;color:#5f6b82;font-size:10px}.pac[data-v-238f838c] .ns-label{width:58px}.pac[data-v-238f838c] .ce-svg{height:96px;background:#0f1625;border-color:#30405a}.pac[data-v-238f838c] .ce-tip{color:#657188}.group[data-v-cf6b86a5]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-cf6b86a5]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-cf6b86a5]:hover{background:#20202e}.group-reset[data-v-cf6b86a5]{margin-left:auto;height:22px;padding:0 7px;border:1px solid #3a465f;border-radius:5px;background:#252d3d;color:#9eabc3;font-size:10px;line-height:20px;cursor:pointer}.group-reset[data-v-cf6b86a5]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-cf6b86a5]{padding:8px 10px 12px}.caret[data-v-cf6b86a5]{display:inline-block;width:12px;color:#667;font-size:11px}.row[data-v-cf6b86a5]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-cf6b86a5]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.attr-body[data-v-cf6b86a5]{padding:10px;background:#151b27}.attr-section-title[data-v-cf6b86a5]{margin:2px 0 8px;color:#9ca8c0;font-size:12px;font-weight:700}.attr-section-title.life-title[data-v-cf6b86a5]{margin-top:14px;padding-top:12px;border-top:1px solid #2d3950}.attr-axis-head[data-v-cf6b86a5]{display:flex;align-items:center;justify-content:space-between;margin:10px 1px -2px;color:#aeb8cf;font-size:12px;font-weight:600}.axis-modes[data-v-cf6b86a5]{display:flex;gap:4px}.axis-mode[data-v-cf6b86a5]{padding:4px 8px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.axis-mode.on[data-v-cf6b86a5]{border-color:#7774ff;background:#605df0;color:#fff}.life-item[data-v-cf6b86a5]{padding:9px 0;border-bottom:1px solid #2a3549}.switch-row[data-v-cf6b86a5]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-cf6b86a5]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-cf6b86a5]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-cf6b86a5]:after{content:"";position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .16s ease}.switch-row input:checked+.switch-ui[data-v-cf6b86a5]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-cf6b86a5]:after{transform:translate(14px)}.life-axis[data-v-cf6b86a5]{margin:9px 0 2px 42px}.switch-row input:disabled+.switch-ui[data-v-cf6b86a5]{opacity:.45;cursor:not-allowed}.gradient-editor[data-v-f6ab10bf]{margin:8px 0 11px 68px}.gradient-bar[data-v-f6ab10bf]{position:relative;height:18px;margin-bottom:14px;border:1px solid #465570;border-radius:6px;cursor:crosshair}.gradient-stop[data-v-f6ab10bf]{position:absolute;top:15px;width:14px;height:17px;padding:0;transform:translate(-50%);border:2px solid #d8deea;border-radius:2px 2px 5px 5px;background:var(--stop-color);cursor:grab;box-shadow:0 1px 3px #0009}.gradient-stop[data-v-f6ab10bf]:before{content:"";position:absolute;left:2px;top:-7px;border-left:3px solid transparent;border-right:3px solid transparent;border-bottom:5px solid #d8deea}.gradient-stop.selected[data-v-f6ab10bf]{outline:2px solid #7774ff;outline-offset:1px;z-index:2}.gradient-stop[data-v-f6ab10bf]:active{cursor:grabbing}.gradient-controls[data-v-f6ab10bf]{display:flex;align-items:center;gap:5px;margin-top:30px}.gradient-color[data-v-f6ab10bf]{width:28px;height:24px;padding:1px;border:1px solid #465570;border-radius:4px;background:#151b27;cursor:pointer}.gradient-hex-input[data-v-f6ab10bf]{width:66px;padding:4px 5px;border:1px solid #344158;border-radius:4px;outline:none;background:#101725;color:#aeb8cb;font-size:10px;font-family:monospace}.gradient-hex-input[data-v-f6ab10bf]:focus{border-color:#7774ff;color:#fff}.gradient-position[data-v-f6ab10bf]{display:flex;align-items:center;color:#71809a;font-size:10px}.gradient-position input[data-v-f6ab10bf]{width:43px;padding:3px 4px;border:1px solid #344158;border-radius:4px;outline:none;background:#101725;color:#dce3ef;text-align:right}.gradient-action[data-v-f6ab10bf]{width:25px;height:24px;padding:0;border:1px solid #3a4860;border-radius:4px;background:#273246;color:#cbd4e5;cursor:pointer}.gradient-action[data-v-f6ab10bf]:hover:not(:disabled){border-color:#7774ff;color:#fff}.gradient-action.danger[data-v-f6ab10bf]{color:#e3a5aa}.gradient-action[data-v-f6ab10bf]:disabled{opacity:.35;cursor:not-allowed}.gradient-hint[data-v-f6ab10bf]{margin-top:5px;color:#59667b;font-size:9px}.pivot-editor[data-v-1261b03a]{margin-top:8px;padding:8px;border:1px solid #2e3c55;border-radius:8px;background:#121a27}.pivot-toolbar[data-v-1261b03a]{display:flex;align-items:center;gap:7px;margin-bottom:7px}.pivot-hint[data-v-1261b03a]{flex:1;min-width:0;display:flex;align-items:center;gap:5px;color:#9aa8c4;font-size:10px;line-height:1.3}.pivot-hint-icon[data-v-1261b03a]{color:#8f8cff;font-size:13px}.pivot-zoom[data-v-1261b03a]{display:flex;align-items:center;gap:2px;padding:2px;border:1px solid #34435e;border-radius:6px;background:#182234}.pivot-zoom button[data-v-1261b03a]{width:20px;height:20px;padding:0;border:0;border-radius:4px;background:transparent;color:#a9b6d0;font-size:13px;cursor:pointer}.pivot-zoom button[data-v-1261b03a]:hover:not(:disabled){background:#2a3853;color:#fff}.pivot-zoom button[data-v-1261b03a]:disabled{opacity:.3;cursor:default}.pivot-zoom span[data-v-1261b03a]{min-width:36px;text-align:center;color:#c7d1e6;font-size:10px;font-variant-numeric:tabular-nums}.pivot-expand[data-v-1261b03a]{width:24px;height:24px;padding:0;border:1px solid #34435e;border-radius:6px;background:#182234;color:#a9b6d0;font-size:13px;cursor:pointer}.pivot-expand[data-v-1261b03a]:hover{border-color:#7774ff;color:#fff}.pivot-stage[data-v-1261b03a]{position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:156px;overflow:hidden;border:1px solid #2f3d57;border-radius:8px;background-color:#10161f;background-image:linear-gradient(45deg,#1a2230 25%,transparent 25%),linear-gradient(-45deg,#1a2230 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#1a2230 75%),linear-gradient(-45deg,transparent 75%,#1a2230 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0;touch-action:none;cursor:crosshair}.pivot-large .pivot-stage[data-v-1261b03a]{height:340px;background-size:22px 22px;background-position:0 0,0 11px,11px -11px,-11px 0}.pivot-stage.panning[data-v-1261b03a]{cursor:grabbing}.pivot-box[data-v-1261b03a]{position:relative;flex:0 0 auto}.pivot-box>img[data-v-1261b03a]{display:block;width:100%;height:100%;object-fit:fill;-webkit-user-select:none;user-select:none;pointer-events:none}.pivot-empty[data-v-1261b03a]{color:#4e5a70;font-size:12px}.pivot-cross[data-v-1261b03a]{position:absolute;pointer-events:none;background:#7e76ffbf;box-shadow:0 0 3px #7e76ff99}.pivot-cross.vertical[data-v-1261b03a]{top:0;bottom:0;width:1px;transform:translate(-.5px)}.pivot-cross.horizontal[data-v-1261b03a]{left:0;right:0;height:1px;transform:translateY(-.5px)}.pivot-marker[data-v-1261b03a]{position:absolute;width:13px;height:13px;transform:translate(-50%,-50%);border:2px solid #c9c6ff;border-radius:50%;background:#605ff0d9;box-shadow:0 0 0 3px #605ff047,0 0 10px #605ff0cc;pointer-events:none}.pivot-badge[data-v-1261b03a]{position:absolute;transform:translate(-50%,14px);padding:2px 6px;border:1px solid #6f6bc7;border-radius:4px;background:#191c3aeb;color:#b9b6ff;font-size:9px;white-space:nowrap;pointer-events:none}.pivot-bottom[data-v-1261b03a]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;margin-top:8px}.pivot-large .pivot-bottom[data-v-1261b03a]{gap:14px;margin-top:14px}.pivot-card[data-v-1261b03a]{min-width:0;padding:7px;border:1px solid #28344a;border-radius:8px;background:#151d2b}.pivot-card-head[data-v-1261b03a]{display:flex;align-items:center;justify-content:space-between;gap:5px;margin-bottom:6px;color:#b9c4da;font-size:10px}.pivot-card-icon[data-v-1261b03a]{color:#8f8cff}.pivot-presets[data-v-1261b03a]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}.pivot-preset[data-v-1261b03a]{height:30px;padding:0;border:1px solid #2f3d57;border-radius:5px;background:#1b2537;color:#aab6cf;font-size:16px;line-height:1;cursor:pointer}.pivot-preset[data-v-1261b03a]:hover{border-color:#5d5aa8;color:#d9d8ff}.pivot-preset.on[data-v-1261b03a]{border-color:#7774ff;background:#4a47b5;color:#fff}.pivot-reset[data-v-1261b03a]{display:block;width:100%;height:26px;margin-top:6px;padding:0 6px;border:1px solid #2f3d57;border-radius:5px;background:#1a2435;color:#96a4c0;font-size:10px;cursor:pointer;white-space:nowrap}.pivot-reset[data-v-1261b03a]:hover{border-color:#5d5aa8;background:#232f46;color:#d9d8ff}.pivot-coords[data-v-1261b03a]{display:flex;flex-direction:column;gap:5px}.pivot-large .pivot-coords[data-v-1261b03a]{flex-direction:row;gap:8px}.pivot-coords label[data-v-1261b03a]{flex:1;display:flex;align-items:center;gap:3px;color:#8d9ab5;font-size:10px}.pivot-coords input[data-v-1261b03a]{width:100%;min-width:0;height:24px;padding:0 4px;border:1px solid #34435e;border-radius:4px;background:#101827;color:#f0b465;font-size:11px;text-align:right}.pivot-rotate-head[data-v-1261b03a]{margin-top:10px}.pivot-rotate-state[data-v-1261b03a]{color:#6f7c96;font-size:9px}.pivot-rotate-body[data-v-1261b03a]{display:flex;align-items:center;gap:7px}.pivot-rotate-modes[data-v-1261b03a]{display:flex;flex-direction:column;gap:4px;flex:1}.pivot-rotate-modes button[data-v-1261b03a]{height:24px;padding:0 5px;border:1px solid #2f3d57;border-radius:5px;background:#1b2537;color:#93a0ba;font-size:9px;cursor:pointer}.pivot-rotate-modes button.on[data-v-1261b03a]{border-color:#7774ff;background:#4a47b5;color:#fff}.pivot-rotate-preview[data-v-1261b03a]{display:flex;align-items:center;justify-content:center;width:78px;height:78px;flex:0 0 78px;border:1px solid #2b374d;border-radius:6px;background:#10161f;overflow:hidden}.pivot-large .pivot-rotate-preview[data-v-1261b03a]{width:128px;height:128px;flex-basis:128px}.pivot-rotate-preview img[data-v-1261b03a]{display:block}.pivot-rotate-preview img.spin[data-v-1261b03a]{animation:pivot-spin-1261b03a 2s linear infinite}.pivot-rotate-preview img.swing[data-v-1261b03a]{animation:pivot-swing-1261b03a 1.1s ease-in-out infinite alternate}@keyframes pivot-spin-1261b03a{to{transform:rotate(360deg)}}@keyframes pivot-swing-1261b03a{0%{transform:rotate(-28deg)}to{transform:rotate(28deg)}}.pivot-large .pivot-hint[data-v-1261b03a],.pivot-large .pivot-card-head[data-v-1261b03a]{font-size:12px}.pivot-large .pivot-preset[data-v-1261b03a]{height:42px;font-size:20px}.pivot-large .pivot-reset[data-v-1261b03a]{height:34px;margin-top:8px;font-size:12px}.pivot-large .pivot-coords input[data-v-1261b03a]{height:34px;font-size:14px}.pivot-large .pivot-rotate-modes button[data-v-1261b03a]{height:34px;font-size:12px}.image-card[data-v-cb3a8e2c]{margin:8px 0;padding:9px;border:1px solid #2e3c55;border-radius:7px;background:#171d2a}.imgrow[data-v-cb3a8e2c]{display:flex;align-items:flex-start;gap:8px}.img-thumb[data-v-cb3a8e2c]{width:48px;height:48px;padding:0;border:1px solid #3a4963;border-radius:6px;background:#1a2232;display:flex;align-items:center;justify-content:center;flex-shrink:0;cursor:pointer;overflow:hidden}.img-thumb[data-v-cb3a8e2c]:hover{border-color:#7774ff}.img-thumb img[data-v-cb3a8e2c]{display:block;width:100%;height:100%;object-fit:contain}.img-fields[data-v-cb3a8e2c]{flex:1;min-width:0}.img-actions[data-v-cb3a8e2c]{display:flex;flex-direction:column;gap:4px}.row[data-v-cb3a8e2c]{display:flex;align-items:center;gap:8px;margin:6px 0;color:#aab;font-size:12px}.row>span[data-v-cb3a8e2c]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-cb3a8e2c]{min-width:0;flex:1;padding:3px 5px;border:1px solid #2e2e44;border-radius:5px;background:#1a1a28;color:#dde;font-size:12px}.mini-btn2[data-v-cb3a8e2c]{width:26px;height:24px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:5px;color:#aab;font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center}.mini-btn2[data-v-cb3a8e2c]:hover{background:#2b3a5c}.mini-btn2[data-v-cb3a8e2c]:disabled{opacity:.35;cursor:not-allowed}.thumb-note[data-v-cb3a8e2c]{margin:4px 0 2px;color:#667;font-size:11px}.sequence-pick[data-v-cb3a8e2c]{width:100%;margin:2px 0 4px;padding:6px 8px;border:1px solid #4a4a76;border-radius:5px;background:#27264b;color:#d8d7ff;font-size:12px;cursor:pointer}.sequence-pick[data-v-cb3a8e2c]:hover{border-color:#7774ff;background:#35336a}.sequence-note[data-v-cb3a8e2c]{margin:0 0 6px;color:#727b9b;font-size:11px;line-height:1.4}.resource-weight-row[data-v-cb3a8e2c]{display:grid;grid-template-columns:minmax(0,1fr) 28px;align-items:center;gap:7px}.resource-weight-control[data-v-cb3a8e2c]{width:100%;min-width:0}.resource-weight-control[data-v-cb3a8e2c] .ns-range{min-width:0}.resource-weight-control[data-v-cb3a8e2c] .ns-num{flex:0 0 56px;box-sizing:border-box}.weight-lock[data-v-cb3a8e2c]{width:28px;height:26px;flex:0 0 28px;padding:5px;border:1px solid #35435c;border-radius:5px;background:#202a3b;color:#78859e;cursor:pointer}.weight-lock svg[data-v-cb3a8e2c]{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.weight-lock[data-v-cb3a8e2c]:hover:not(:disabled){border-color:#7774ff;color:#b8b6ff}.weight-lock.on[data-v-cb3a8e2c]{border-color:#7774ff;background:#514fd0;color:#fff}.weight-lock[data-v-cb3a8e2c]:disabled{opacity:.35;cursor:not-allowed}.pivot-toggle-row[data-v-cb3a8e2c]{display:flex;align-items:center;gap:9px;margin-top:9px;padding:8px 9px;border:1px solid #2c3a54;border-radius:8px;background:#131b28}.pivot-toggle-icon[data-v-cb3a8e2c]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;flex:0 0 32px;border:1px solid #35435c;border-radius:7px;background:#1c2638;color:#8f8cff;font-size:17px}.pivot-toggle-text[data-v-cb3a8e2c]{flex:1;min-width:0}.pivot-toggle-title[data-v-cb3a8e2c]{color:#d6deee;font-size:12px;font-weight:600}.pivot-toggle-sub[data-v-cb3a8e2c]{margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#7584a0;font-size:9px}.pivot-switch[data-v-cb3a8e2c]{position:relative;flex:0 0 auto;cursor:pointer}.pivot-switch input[data-v-cb3a8e2c]{position:absolute;opacity:0;pointer-events:none}.pivot-switch-ui[data-v-cb3a8e2c]{position:relative;display:block;width:34px;height:19px;border-radius:10px;background:#354258;transition:background .16s ease}.pivot-switch-ui[data-v-cb3a8e2c]:after{content:"";position:absolute;left:2px;top:2px;width:15px;height:15px;border-radius:50%;background:#fff;transition:transform .16s ease}.pivot-switch input:checked+.pivot-switch-ui[data-v-cb3a8e2c]{background:#625ff1}.pivot-switch input:checked+.pivot-switch-ui[data-v-cb3a8e2c]:after{transform:translate(15px)}.pivot-modal-backdrop[data-v-cb3a8e2c]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;display:flex;align-items:center;justify-content:center;padding:24px;background:#06090fc7;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.pivot-modal[data-v-cb3a8e2c]{display:flex;flex-direction:column;width:min(980px,94vw);max-height:92vh;overflow:auto;padding:14px;border:1px solid #2f3f5c;border-radius:14px;background:#121927;box-shadow:0 24px 70px #0009}.pivot-modal-head[data-v-cb3a8e2c]{display:flex;align-items:flex-start;gap:10px;padding-bottom:10px;border-bottom:1px solid #253148}.pivot-modal-icon[data-v-cb3a8e2c]{display:flex;align-items:center;justify-content:center;width:34px;height:34px;flex:0 0 34px;border:1px solid #3b4a66;border-radius:8px;background:#1c2638;color:#8f8cff;font-size:18px}.pivot-modal-info[data-v-cb3a8e2c]{flex:1;min-width:0}.pivot-modal-title[data-v-cb3a8e2c]{display:flex;align-items:center;gap:7px;color:#e4e9f5;font-size:15px;font-weight:700}.pivot-modal-badge[data-v-cb3a8e2c]{padding:2px 7px;border:1px solid #4b4a8f;border-radius:999px;background:#2c2b58;color:#b9b6ff;font-size:10px;font-weight:500}.pivot-modal-desc[data-v-cb3a8e2c]{margin-top:3px;color:#7f8daa;font-size:11px}.pivot-modal-close[data-v-cb3a8e2c]{width:28px;height:28px;padding:0;border:0;border-radius:6px;background:transparent;color:#8b98b3;font-size:15px;cursor:pointer}.pivot-modal-close[data-v-cb3a8e2c]:hover{background:#253148;color:#fff}.pivot-modal-hint[data-v-cb3a8e2c]{margin:10px 0 0;color:#8b98b3;font-size:11px}.pivot-modal-actions[data-v-cb3a8e2c]{display:flex;justify-content:flex-end;gap:8px;margin-top:12px;padding-top:10px;border-top:1px solid #253148}.pivot-modal-cancel[data-v-cb3a8e2c]{height:34px;padding:0 16px;border:1px solid #34435e;border-radius:7px;background:#1a2334;color:#a9b6d0;font-size:12px;cursor:pointer}.pivot-modal-cancel[data-v-cb3a8e2c]:hover{border-color:#5d5aa8;color:#fff}.pivot-modal-confirm[data-v-cb3a8e2c]{height:34px;padding:0 22px;border:1px solid #7774ff;border-radius:7px;background:#5b57e8;color:#fff;font-size:12px;font-weight:700;cursor:pointer}.pivot-modal-confirm[data-v-cb3a8e2c]:hover{background:#6a66ff}.group[data-v-5709815f]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-5709815f]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-5709815f]:hover{background:#20202e}.group-reset[data-v-5709815f]{margin-left:auto;height:22px;padding:0 7px;border:1px solid #3a465f;border-radius:5px;background:#252d3d;color:#9eabc3;font-size:10px;line-height:20px;cursor:pointer}.group-reset[data-v-5709815f]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-5709815f]{padding:8px 10px 12px}.caret[data-v-5709815f]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-5709815f]{height:1px;background:#2a2a3c;margin:8px 0}.row[data-v-5709815f]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-5709815f]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-5709815f]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.colr[data-v-5709815f]{width:28px;height:22px;border:none;background:none;cursor:pointer}.seg[data-v-5709815f]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg.on[data-v-5709815f]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.look-title[data-v-5709815f]{font-size:12px;font-weight:600;color:#ccd;margin:10px 0 6px;padding-bottom:4px;border-bottom:1px solid #2a2a3c}.look-title[data-v-5709815f]:first-child{margin-top:2px}.seg[data-v-5709815f]{display:flex;gap:6px;margin:6px 0}.seg-btn[data-v-5709815f]{flex:1;padding:5px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.seg-btn.active[data-v-5709815f]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.curve-wrap[data-v-5709815f]{margin:6px 0}.curve-labels[data-v-5709815f]{display:flex;justify-content:space-between;color:#566;font-size:10px;margin-top:2px}.image-title[data-v-5709815f]{display:flex;align-items:center;justify-content:space-between}.image-add[data-v-5709815f]{width:26px;height:24px;border:1px solid #4a4d9a;border-radius:5px;background:#252850;color:#8f8cff;font-size:18px;line-height:1;cursor:pointer}.image-add[data-v-5709815f]:hover{background:#4542a8;color:#fff}.resource-divider[data-v-5709815f]{height:1px;margin:9px 0 7px;background:#2a3549}.resource-color-row .blend-select[data-v-5709815f]{max-width:88px}.resource-color-picker .hex[data-v-5709815f]{margin-left:0}.random-color-hint[data-v-5709815f]{margin:-5px 0 9px 68px;color:#66758e;font-size:9px;line-height:1.45}.hex-input[data-v-5709815f]{width:72px;padding:4px 6px;border:1px solid #344158;border-radius:5px;outline:none;background:#101725;color:#aeb8cb;font-size:11px;font-family:monospace}.hex-input[data-v-5709815f]:focus{border-color:#7774ff;color:#fff}.resource-alpha-head[data-v-5709815f]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px;color:#8a93bb;font-size:12px}.alpha-modes[data-v-5709815f]{display:flex;gap:3px}.alpha-modes button[data-v-5709815f]{padding:4px 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#8d98ae;font-size:11px;cursor:pointer}.alpha-modes button[data-v-5709815f]:hover{background:#273246}.alpha-modes button.on[data-v-5709815f]{border-color:#7774ff;background:#605df0;color:#fff}.resource-alpha-curve[data-v-5709815f]{margin-top:7px}.file-input[data-v-5709815f]{display:none}.hex[data-v-5709815f]{font-size:11px;color:#889;margin-left:auto;font-variant-numeric:tabular-nums}.inp.tiny[data-v-5709815f]{width:46px;flex:0 0 46px;text-align:center}.render-layer-current[data-v-5709815f]{display:flex;align-items:center;gap:6px;margin:6px 0}.render-layer-text[data-v-5709815f]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#9aa6c2;font-size:11px}.mini-btn[data-v-5709815f]{flex:0 0 auto;height:24px;padding:0 7px;border:1px solid #3d4a66;border-radius:5px;background:#202a3e;color:#a9b5cf;font-size:10px;cursor:pointer}.mini-btn[data-v-5709815f]:hover{border-color:#7774ff;color:#fff}.mini-btn.ghost[data-v-5709815f]{background:transparent}.slot-picker[data-v-5709815f]{margin:6px 0;padding:6px;border:1px solid #2e3a52;border-radius:6px;background:#111a28}.slot-list[data-v-5709815f]{max-height:180px;overflow:auto;margin-top:6px}.slot-item[data-v-5709815f]{display:flex;align-items:center;gap:6px;width:100%;padding:4px 6px;border:1px solid transparent;border-radius:4px;background:transparent;color:#aab4cc;font-size:11px;text-align:left;cursor:pointer}.slot-item[data-v-5709815f]:hover{background:#1d2a3f}.slot-item.on[data-v-5709815f]{border-color:#7774ff;background:#2b2b55;color:#fff}.slot-order[data-v-5709815f]{width:26px;flex:0 0 26px;color:#66758e;font-variant-numeric:tabular-nums}.slot-name[data-v-5709815f]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slot-attachment[data-v-5709815f]{max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#6d7c96;font-size:10px}.switch-row[data-v-5709815f]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-5709815f]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-5709815f]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-5709815f]:after{content:"";position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .16s ease}.switch-row input:checked+.switch-ui[data-v-5709815f]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-5709815f]:after{transform:translate(14px)}.switch-row input:disabled+.switch-ui[data-v-5709815f]{opacity:.45;cursor:not-allowed}.render-layer-switch[data-v-5709815f]{margin:6px 0}.modifier-hint[data-v-5709815f]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.render-layer-warning[data-v-5709815f]{color:#d8a45e}.empty[data-v-96ef634f]{color:#667;font-size:12px;padding:8px 0}.group[data-v-96ef634f]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-96ef634f]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-96ef634f]:hover{background:#20202e}.group-reset[data-v-96ef634f]{margin-left:auto;height:22px;padding:0 7px;border:1px solid #3a465f;border-radius:5px;background:#252d3d;color:#9eabc3;font-size:10px;line-height:20px;cursor:pointer}.group-reset[data-v-96ef634f]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-96ef634f]{padding:8px 10px 12px}.caret[data-v-96ef634f]{display:inline-block;width:12px;color:#667;font-size:11px}.divider[data-v-96ef634f]{height:1px;background:#2a2a3c;margin:8px 0}.field-block[data-v-96ef634f]{display:flex;flex-direction:column;gap:5px;margin:10px 0;color:#8f9ab3;font-size:11px}.field-block>.inp[data-v-96ef634f]{width:100%;box-sizing:border-box;min-height:30px}.field-block small[data-v-96ef634f]{color:#5f6d86;line-height:1.5}.field-grid[data-v-96ef634f]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:end}.compact-field[data-v-96ef634f]{display:flex;min-width:0;flex-direction:column;gap:5px;margin:5px 0;color:#8f9ab3;font-size:11px}.compact-field .inp[data-v-96ef634f]{width:100%;min-height:30px;box-sizing:border-box}.tag[data-v-96ef634f]{font-size:10px;color:#667;background:#1c1c2a;border-radius:4px;padding:1px 5px}.row[data-v-96ef634f]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-96ef634f]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-96ef634f]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.colr[data-v-96ef634f]{width:28px;height:22px;border:none;background:none;cursor:pointer}.placeholder[data-v-96ef634f]{color:#667;font-size:11px;padding:6px 0}.image-add[data-v-96ef634f]{width:26px;height:24px;border:1px solid #4a4d9a;border-radius:5px;background:#252850;color:#8f8cff;font-size:18px;line-height:1;cursor:pointer}.image-add[data-v-96ef634f]:hover{background:#4542a8;color:#fff}.resource-divider[data-v-96ef634f]{height:1px;margin:9px 0 7px;background:#2a3549}.hex-input[data-v-96ef634f]{width:72px;padding:4px 6px;border:1px solid #344158;border-radius:5px;outline:none;background:#101725;color:#aeb8cb;font-size:11px;font-family:monospace}.hex-input[data-v-96ef634f]:focus{border-color:#7774ff;color:#fff}.alpha-modes[data-v-96ef634f]{display:flex;gap:3px}.alpha-modes button[data-v-96ef634f]{padding:4px 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#8d98ae;font-size:11px;cursor:pointer}.alpha-modes button[data-v-96ef634f]:hover{background:#273246}.alpha-modes button.on[data-v-96ef634f]{border-color:#7774ff;background:#605df0;color:#fff}.file-input[data-v-96ef634f]{display:none}.hex[data-v-96ef634f]{font-size:11px;color:#889;margin-left:auto;font-variant-numeric:tabular-nums}.inp.tiny[data-v-96ef634f]{width:46px;flex:0 0 46px;text-align:center}.axis-mode[data-v-96ef634f]{padding:4px 8px;border:1px solid #344158;border-radius:5px;background:#273246;color:#aeb8cf;font-size:11px;cursor:pointer}.axis-mode.on[data-v-96ef634f]{border-color:#7774ff;background:#605df0;color:#fff}.switch-row[data-v-96ef634f]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-96ef634f]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-96ef634f]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-96ef634f]:after{content:"";position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .16s ease}.switch-row input:checked+.switch-ui[data-v-96ef634f]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-96ef634f]:after{transform:translate(14px)}.modifier-item[data-v-96ef634f]{padding:8px 0 10px;border-bottom:1px solid #2a3549}.modifier-switch[data-v-96ef634f]{font-weight:600}.modifier-params[data-v-96ef634f]{margin:8px 0 0 10px;padding:2px 0 2px 10px;border-left:2px solid #344158}.modifier-hint[data-v-96ef634f]{margin:7px 0 0 2px;color:#647086;font-size:9px;line-height:1.5}.collision-filter-params[data-v-96ef634f]{position:relative;padding-top:5px;padding-bottom:5px}.collision-filter-title[data-v-96ef634f]{margin-bottom:8px;color:#9ba7bd;font-size:11px;font-weight:600}.collision-filter-tags[data-v-96ef634f]{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.collision-filter-tag[data-v-96ef634f]{display:inline-flex;min-width:0;align-items:center;gap:6px;padding:5px 5px 5px 8px;border:1px solid #625ff1;border-radius:6px;background:#514dcf;color:#fff;font-size:11px}.collision-filter-tag>span[data-v-96ef634f]{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.collision-filter-tag.disabled[data-v-96ef634f]{border-color:#4b5364;background:#343b4b;color:#929bad}.collision-filter-tag button[data-v-96ef634f]{width:18px;height:18px;padding:0;border:0;border-radius:4px;background:#0b0f1a38;color:inherit;line-height:16px;cursor:pointer}.collision-filter-tag button[data-v-96ef634f]:hover{background:#0b0f1a80;color:#fff}.collision-filter-add[data-v-96ef634f]{width:30px;height:30px;padding:0;border:1px dashed #536079;border-radius:6px;background:#182131;color:#98a5bd;font-size:18px;line-height:28px;cursor:pointer}.collision-filter-add[data-v-96ef634f]:hover,.collision-filter-add.active[data-v-96ef634f]{border-color:#7774ff;background:#262c52;color:#fff}.collision-filter-add[data-v-96ef634f]:disabled{opacity:.42;cursor:not-allowed}.collision-filter-empty[data-v-96ef634f]{margin-top:7px;color:#6f7b91;font-size:10px}.collision-filter-picker[data-v-96ef634f]{display:grid;gap:4px;margin-top:7px;padding:5px;border:1px solid #344158;border-radius:6px;background:#101725}.collision-filter-picker button[data-v-96ef634f]{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;border:0;border-radius:4px;background:transparent;color:#c7d0e3;font-size:11px;text-align:left;cursor:pointer}.collision-filter-picker button[data-v-96ef634f]:hover{background:#29344a;color:#fff}.collision-filter-picker button span[data-v-96ef634f]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.collision-filter-picker button small[data-v-96ef634f]{flex:none;color:#68758d;font-size:9px}.switch-row input:disabled+.switch-ui[data-v-96ef634f]{opacity:.45;cursor:not-allowed}.bone-follow-target[data-v-96ef634f]{margin:7px 0 9px;padding:7px 8px;overflow:hidden;color:#7f8ba3;background:#121a29;border:1px solid #2f3c53;border-radius:5px;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.bone-follow-target strong[data-v-96ef634f]{color:#c8d0e4;font-weight:600}.bone-follow-missing[data-v-96ef634f]{margin:7px 0 9px;padding:7px 8px;color:#d49aa3;background:#2a1e26;border:1px solid #513540;border-radius:5px;font-size:10px;line-height:1.5}.bone-follow-rebind[data-v-96ef634f]{width:100%;min-height:28px;margin:0 0 8px;padding:4px 8px;overflow:hidden;border:1px solid #4a436e;border-radius:5px;background:#2d2947;color:#c8c2ee;font-size:10px;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.bone-follow-rebind[data-v-96ef634f]:hover{border-color:#7165bd;background:#3a335d;color:#fff}.bone-follow-transform-grid[data-v-96ef634f]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.modifier-mode-row[data-v-96ef634f]{display:flex;justify-content:flex-end;gap:4px;margin-bottom:6px}.gravity-curve-title[data-v-96ef634f]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:10px 0 6px;color:#9ba7bd;font-size:11px}.gravity-curve-title span[data-v-96ef634f]:last-child{color:#657188;font-size:9px}.gravity-curve-axis[data-v-96ef634f]{display:flex;justify-content:space-between;margin:3px 34px 0 1px;color:#5f6b82;font-size:9px}.gravity-params[data-v-96ef634f] .ce-svg{height:96px;background:#0f1625;border-color:#30405a}.trail-params[data-v-96ef634f]{padding-right:2px}.trail-section-title[data-v-96ef634f]{margin:3px 0 8px;color:#aeb8cf;font-size:12px;font-weight:700}.trail-fixed-color .hex-input[data-v-96ef634f]{min-width:0;flex:1}.trail-mode-head[data-v-96ef634f]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:10px 0 6px;color:#9ba7bd;font-size:11px}.trail-sub-switch[data-v-96ef634f]{margin:11px 0 7px;padding-top:9px;border-top:1px solid #2a3549}.trail-grid-row[data-v-96ef634f]{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.trail-grid-row[data-v-96ef634f] .ns{min-width:0;flex-wrap:wrap;align-items:center}.trail-grid-row[data-v-96ef634f] .ns-label{width:100%}.trail-grid-row[data-v-96ef634f] .ns-range{min-width:0}.trail-grid-row[data-v-96ef634f] .ns-num{width:42px}.trail-params[data-v-96ef634f] .ce-svg{height:92px;background:#0f1625;border-color:#30405a}.group[data-v-04462c7a]{border:1px solid #2a2a3c;border-radius:8px;margin-bottom:10px;overflow:hidden}.group-head[data-v-04462c7a]{display:flex;align-items:center;gap:6px;padding:7px 10px;cursor:pointer;font-size:12px;font-weight:600;color:#ccd;background:#191924;-webkit-user-select:none;user-select:none}.group-head[data-v-04462c7a]:hover{background:#20202e}.group-reset[data-v-04462c7a]{margin-left:auto;height:22px;padding:0 7px;border:1px solid #3a465f;border-radius:5px;background:#252d3d;color:#9eabc3;font-size:10px;line-height:20px;cursor:pointer}.group-reset[data-v-04462c7a]:hover{border-color:#7774ff;background:#45426f;color:#fff}.group-body[data-v-04462c7a]{padding:8px 10px 12px}.caret[data-v-04462c7a]{display:inline-block;width:12px;color:#667;font-size:11px}.row[data-v-04462c7a]{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:12px;color:#aab}.row>span[data-v-04462c7a]:first-child{width:60px;flex-shrink:0;color:#8a93bb}.inp[data-v-04462c7a]{flex:1;min-width:0;padding:3px 5px;background:#1a1a28;border:1px solid #2e2e44;border-radius:5px;color:#dde;font-size:12px}.placeholder[data-v-04462c7a]{color:#667;font-size:11px;padding:6px 0}.export-settings[data-v-04462c7a]{padding-top:3px}.export-field[data-v-04462c7a]{display:flex;flex-direction:column;gap:6px;margin:10px 0 13px;color:#9ca8bf;font-size:11px;font-weight:600}.export-input[data-v-04462c7a]{width:100%;min-height:34px;box-sizing:border-box;padding:6px 9px;color:#e3e7f2;background:#141a29;border-color:#35445f}.export-fps-row[data-v-04462c7a]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:end}.export-fps-field[data-v-04462c7a]{margin-bottom:5px}.export-checkbox[data-v-04462c7a]{display:flex;align-items:center;gap:7px;min-height:34px;margin-bottom:5px;color:#aeb8cc;font-size:11px;white-space:nowrap}.export-checkbox input[data-v-04462c7a]{width:17px;height:17px;margin:0;accent-color:#625ff1}.export-help[data-v-04462c7a]{margin:-6px 0 14px;color:#66758e;font-size:10px;line-height:1.5}.export-switches[data-v-04462c7a]{display:grid;gap:13px;margin:4px 0 7px;padding-top:2px}.export-switch[data-v-04462c7a]{font-weight:600}.export-switch-last[data-v-04462c7a]{margin-top:13px}.inp.tiny[data-v-04462c7a]{width:46px;flex:0 0 46px;text-align:center}.switch-row[data-v-04462c7a]{display:flex;align-items:center;gap:9px;color:#b8c1d5;font-size:12px;cursor:pointer}.switch-row input[data-v-04462c7a]{position:absolute;opacity:0;pointer-events:none}.switch-ui[data-v-04462c7a]{position:relative;width:32px;height:18px;border-radius:10px;background:#354258;transition:background .16s ease}.switch-ui[data-v-04462c7a]:after{content:"";position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .16s ease}.switch-row input:checked+.switch-ui[data-v-04462c7a]{background:#625ff1}.switch-row input:checked+.switch-ui[data-v-04462c7a]:after{transform:translate(14px)}.switch-row input:disabled+.switch-ui[data-v-04462c7a]{opacity:.45;cursor:not-allowed}.spine-export-actions[data-v-7ff40afe]{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:10px}.export-spine-json[data-v-7ff40afe]{width:100%;padding:9px 8px;flex:0 0 auto;border:1px solid #4f4b9a;border-radius:7px;background:#403b91;color:#f1f0ff;font-size:12px;font-weight:700;cursor:pointer}.export-spine-json[data-v-7ff40afe]:hover{border-color:#7774ff;background:#514bc0}.export-spine-json[data-v-7ff40afe]:disabled{cursor:wait;opacity:.68}.export-spine-project[data-v-7ff40afe]{grid-column:1 / -1;width:100%;padding:7px 8px;border:1px solid #287d69;border-radius:7px;background:#196854;color:#edfff9;font-size:12px;font-weight:700;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}.export-spine-project small[data-v-7ff40afe]{color:inherit;font-size:9px;font-weight:500;line-height:1.1}.export-spine-project[data-v-7ff40afe]:hover:not(:disabled){border-color:#47c89f;background:#238267}.export-spine-project[data-v-7ff40afe]:disabled{cursor:not-allowed;opacity:.48}.export-spine-images[data-v-7ff40afe]{width:100%;padding:8px;border:1px solid #3b5f8b;border-radius:7px;background:#243e64;color:#eaf3ff;font-size:12px;font-weight:700;cursor:pointer}.export-spine-images[data-v-7ff40afe]:hover:not(:disabled){border-color:#6099dc;background:#315581}.export-spine-images[data-v-7ff40afe]:disabled{cursor:wait;opacity:.55}.connector-status[data-v-7ff40afe]{display:flex;align-items:center;justify-content:center;gap:5px;padding-top:6px;color:#717b99;font-size:10px}.connector-status .connector-dot[data-v-7ff40afe]{width:6px;height:6px;border-radius:50%;background:#66718f}.connector-status.ready[data-v-7ff40afe]{color:#70d8ae}.connector-status.ready .connector-dot[data-v-7ff40afe]{background:#49c993;box-shadow:0 0 5px #49c99388}.connector-status.warning[data-v-7ff40afe]{color:#d4aa67}.connector-status.warning .connector-dot[data-v-7ff40afe]{background:#d4aa67}.connector-status button[data-v-7ff40afe]{padding:0 3px;border:0;background:transparent;color:#8290b6;font-size:10px;cursor:pointer}.connector-status button[data-v-7ff40afe]:hover{color:#c5caff}.connector-status a[data-v-7ff40afe]{padding:0 3px;color:#a8b0ff;font-size:10px;text-decoration:underline}.connector-status a[data-v-7ff40afe]:hover{color:#d8dcff}.export-message[data-v-7ff40afe]{padding:7px 5px 0;color:#70d8ae;font-size:10px;line-height:1.45;text-align:center}.export-message.error[data-v-7ff40afe]{color:#ff858f}.export-message a[data-v-7ff40afe]{display:inline-block;margin-left:5px;color:#9da7ff;text-decoration:underline}.panel[data-v-283ef8eb]{display:flex;width:100%;height:100%;flex-direction:column;overflow:hidden;background:#14141f;border-left:1px solid #2a2a3c;padding:12px;box-sizing:border-box}.panel-scroll[data-v-283ef8eb]{min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain;padding-right:2px;scrollbar-width:thin;scrollbar-color:#2e2e44 transparent}.panel-scroll[data-v-283ef8eb]::-webkit-scrollbar{width:6px}.panel-scroll[data-v-283ef8eb]::-webkit-scrollbar-track{background:transparent}.panel-scroll[data-v-283ef8eb]::-webkit-scrollbar-thumb{background:#2e2e44;border-radius:3px}.panel-scroll[data-v-283ef8eb]::-webkit-scrollbar-thumb:hover{background:#3a3a55}.panel-header[data-v-283ef8eb]{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;flex:0 0 auto;font-weight:700;color:#ccd}.timeline[data-v-1e581e89]{height:100%;background:#12121c;border-top:1px solid #2a2a3c;display:flex;flex-direction:column;padding:6px 10px;gap:4px}.tl-controls[data-v-1e581e89]{display:flex;align-items:center;gap:8px}.tl-btn[data-v-1e581e89]{width:30px;height:26px;background:#1e1e2e;border:1px solid #2e2e44;border-radius:6px;color:#aab;font-size:12px;cursor:pointer}.tl-btn.on[data-v-1e581e89]{background:#3a5a8c;color:#fff;border-color:#5a7ab8}.tl-range[data-v-1e581e89]{display:flex;height:25px;align-items:center;gap:3px;color:#778198;font-size:10px}.tl-range input[data-v-1e581e89]{width:43px;height:25px;padding:0 5px;box-sizing:border-box;border:1px solid #3a3a51;border-radius:5px;outline:none;background:#181824;color:#e1e4ed;font-size:11px;text-align:center}.tl-range input[data-v-1e581e89]:focus{border-color:#716eff}.tl-loop-range[data-v-1e581e89]{height:25px;padding:0 7px;border:1px solid #4e5680;border-radius:5px;background:#252943;color:#bfc8e8;font-size:10px;cursor:pointer;white-space:nowrap}.tl-loop-range[data-v-1e581e89]:hover{border-color:#716eff;color:#fff}.tl-frame[data-v-1e581e89]{display:inline-block;flex:0 0 92px;width:92px;box-sizing:border-box;font-size:12px;color:#aab;text-align:right;font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;white-space:nowrap}.tl-frame b[data-v-1e581e89]{display:inline;color:inherit;font-weight:400}.tl-legend[data-v-1e581e89]{display:flex;align-items:center;gap:4px;color:#778198;font-size:10px}.tl-legend i[data-v-1e581e89]{display:inline-block;width:10px;height:7px;border-radius:2px}.legend-emission[data-v-1e581e89]{margin-left:4px;background:#2f8b62}.legend-life[data-v-1e581e89]{margin-left:5px;background:#a54551}.legend-spine[data-v-1e581e89]{margin-left:5px;background:#7448b8}.tl-anim[data-v-1e581e89]{display:flex;align-items:center;gap:6px;font-size:12px;color:#aab}.tl-owner-animation[data-v-1e581e89]{position:relative}.tl-animation-trigger[data-v-1e581e89]{display:flex;align-items:center;justify-content:space-between;gap:8px;width:116px;height:25px;padding:0 7px;overflow:hidden;border:1px solid #2e2e44;border-radius:5px;background:#1a1a28;color:#dde;cursor:pointer}.tl-animation-trigger>span[data-v-1e581e89]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-animation-trigger>i[data-v-1e581e89]{flex:0 0 auto;color:#8c96ad;font-style:normal}.tl-animation-trigger[data-v-1e581e89]:disabled{opacity:.5;cursor:not-allowed}.tl-animation-menu[data-v-1e581e89]{position:absolute;z-index:30;right:0;bottom:calc(100% + 6px);width:226px;padding:7px;border:1px solid #3c4760;border-radius:8px;background:#171b29;box-shadow:0 10px 24px #00000073}.tl-animation-menu-title[data-v-1e581e89]{padding:2px 4px 6px;color:#77839c;font-size:10px}.tl-animation-option[data-v-1e581e89]{display:flex;align-items:center;justify-content:space-between;width:100%;height:27px;padding:0 7px;border:0;border-radius:5px;background:transparent;color:#b8c1d5;text-align:left;cursor:pointer}.tl-animation-option>span[data-v-1e581e89]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tl-animation-option[data-v-1e581e89]:hover{background:#252e42}.tl-animation-option.on[data-v-1e581e89]{background:#34335d;color:#fff}.tl-animation-option>i[data-v-1e581e89]{color:#8d8aff;font-style:normal}.tl-animation-editor[data-v-1e581e89]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px;margin-top:7px;padding-top:7px;border-top:1px solid #2b3346}.tl-animation-name[data-v-1e581e89]{min-width:0;height:27px;padding:0 7px;box-sizing:border-box;border:1px solid #343e55;border-radius:5px;background:#101522;color:#e1e6f2;outline:none}.tl-animation-name[data-v-1e581e89]:focus{border-color:#6865d8}.tl-animation-editor button[data-v-1e581e89],.tl-animation-actions button[data-v-1e581e89]{height:27px;padding:0 8px;border:1px solid #3c4861;border-radius:5px;background:#29344a;color:#cbd3e3;cursor:pointer}.tl-animation-actions[data-v-1e581e89]{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin-top:6px}.tl-animation-actions button[data-v-1e581e89]:last-child{border-color:#5b3942;background:#3b282f;color:#e2a8b2}.tl-animation-actions button[data-v-1e581e89]:disabled{opacity:.4;cursor:not-allowed}.tl-animation-error[data-v-1e581e89]{margin-top:5px;color:#ef8997;font-size:10px}.tl-animation-hint[data-v-1e581e89]{margin-top:5px;color:#69758d;font-size:9px;text-align:center}.tl-sel[data-v-1e581e89]{background:#1a1a28;border:1px solid #2e2e44;color:#dde;border-radius:5px;padding:2px 6px;font-size:12px}.tl-sel[data-v-1e581e89]:disabled{opacity:.5;cursor:not-allowed}.tl-spine-preview .tl-sel[data-v-1e581e89]{max-width:190px}.tl-zoom[data-v-1e581e89]{margin-left:auto;font-size:11px;color:#667}.tl-viewport[data-v-1e581e89]{position:relative;flex:1;overflow:hidden;background:#0d0d14;border:1px solid #2a2a3c;border-radius:6px;cursor:ew-resize}.tl-ticks[data-v-1e581e89]{position:absolute;top:0;left:0;right:0;height:18px}.tl-tickline[data-v-1e581e89]{position:absolute;top:0;bottom:0;width:1px;background:#263040}.tl-ticklabel[data-v-1e581e89]{position:absolute;top:2px;transform:translate(-50%);font-size:9px;color:#667}.tl-playhead[data-v-1e581e89]{position:absolute;top:0;bottom:0;width:2px;background:#fc3;z-index:5;pointer-events:none}.tl-lanes[data-v-1e581e89]{position:absolute;top:22px;left:0;right:0;bottom:0}.tl-lane[data-v-1e581e89]{position:relative;height:26px;margin-bottom:4px}.lane-ico[data-v-1e581e89]{position:absolute;left:4px;top:6px;font-size:11px;color:#dde;z-index:2;pointer-events:none}.lane-bar[data-v-1e581e89]{position:absolute;top:4px;height:18px;display:flex;align-items:stretch;cursor:grab;box-sizing:border-box}.lane-bar[data-v-1e581e89]:active{cursor:grabbing}.lane-name[data-v-1e581e89]{position:absolute;left:14px;right:5px;top:2px;z-index:2;pointer-events:none;font-size:11px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bar-life[data-v-1e581e89]{position:absolute;inset:0 auto 0 0;z-index:0;min-width:1px;border:1px solid #c05a66;border-radius:5px;background:#a54551;box-sizing:border-box}.bar-life.loop-life[data-v-1e581e89]{border-color:#667085;background:#242b39}.bar-emission[data-v-1e581e89]{position:absolute;inset:0 auto 0 0;z-index:1;min-width:1px;border:1px solid #45a97d;border-radius:5px 0 0 5px;background:#2f8b62;box-sizing:border-box}.bar-emission.bar-loop[data-v-1e581e89]{border-radius:0}.bar-loop-transition[data-v-1e581e89]{position:absolute;top:0;bottom:0;z-index:1;border:1px solid #7d8799;background:#50596a;box-sizing:border-box}.bar-loop-start[data-v-1e581e89]{left:0;border-radius:5px 0 0 5px}.bar-loop-end[data-v-1e581e89]{border-radius:0 5px 5px 0}.bar-handle[data-v-1e581e89]{position:absolute;z-index:4;right:-4px;top:-1px;bottom:-1px;width:8px;cursor:ew-resize;background:#ffffff2e}.bar-handle[data-v-1e581e89]:hover{background:#ffffff59}.spine-ico[data-v-1e581e89]{color:#c08cff}.spine-bar[data-v-1e581e89]{position:absolute;top:4px;height:18px;min-width:1px;box-sizing:border-box;border:1px solid #a575ed;border-radius:5px;background:#7448b8;cursor:grab;box-shadow:inset 0 0 0 1px #ffffff0d}.spine-bar[data-v-1e581e89]:active{cursor:grabbing}.tl-empty[data-v-1e581e89]{color:#667;font-size:11px;padding:8px}.transfer-overlay[data-v-592b922e]{position:fixed;z-index:2000;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;pointer-events:auto;cursor:wait;overscroll-behavior:contain;background:#05080f42;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px)}.transfer-dialog[data-v-592b922e]{width:min(420px,calc(100vw - 40px));padding:18px 20px 16px;border:1px solid #414b66;border-radius:10px;box-shadow:0 18px 55px #00000075;background:#171d2b;color:#e7ebf5}.transfer-heading[data-v-592b922e]{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px;font-size:14px;font-weight:700}.transfer-heading strong[data-v-592b922e]{color:#a8a6ff;font-size:12px;font-variant-numeric:tabular-nums}.transfer-track[data-v-592b922e]{height:9px;overflow:hidden;border:1px solid #35415a;border-radius:999px;background:#0d1422}.transfer-bar[data-v-592b922e]{height:100%;border-radius:inherit;background:linear-gradient(90deg,#4d75e8,#7774ff);transition:width .16s ease}.transfer-track.indeterminate .transfer-bar[data-v-592b922e]{width:42%;animation:transfer-slide-592b922e 1s ease-in-out infinite}.transfer-detail[data-v-592b922e]{min-height:17px;margin-top:9px;color:#8895ae;font-size:11px;line-height:1.5}.transfer-dialog.failed[data-v-592b922e]{border-color:#754351}.transfer-dialog.failed .transfer-heading strong[data-v-592b922e],.transfer-dialog.failed .transfer-detail[data-v-592b922e]{color:#e99aa9}.transfer-dialog.failed .transfer-bar[data-v-592b922e]{background:#c85d70}.transfer-fade-enter-active[data-v-592b922e],.transfer-fade-leave-active[data-v-592b922e]{transition:opacity .16s ease}.transfer-fade-enter-from[data-v-592b922e],.transfer-fade-leave-to[data-v-592b922e]{opacity:0}@keyframes transfer-slide-592b922e{0%{transform:translate(-110%)}to{transform:translate(250%)}}.layout[data-v-42c4fa00]{display:flex;width:100%;height:100%;min-height:0;overflow:clip}.parameter-panel[data-v-42c4fa00]{flex-shrink:0;height:100%;min-height:0;overflow:clip}.resizer-col[data-v-42c4fa00]{width:5px;cursor:col-resize;background:#1c1c2a;border-left:1px solid #2a2a3c;border-right:1px solid #2a2a3c;flex-shrink:0}.resizer-col[data-v-42c4fa00]:hover{background:#3a5a8c}.right[data-v-42c4fa00]{flex:1;min-width:0;height:100%;min-height:0;overflow:clip;display:flex;flex-direction:column}.panel-right .right[data-v-42c4fa00]{order:1}.panel-right .resizer-col[data-v-42c4fa00]{order:2}.panel-right .parameter-panel[data-v-42c4fa00]{order:3}.stage-area[data-v-42c4fa00]{flex:1;min-height:0;overflow:clip}.resizer-row[data-v-42c4fa00]{height:4px;cursor:row-resize;background:#1c1c2a;border-top:1px solid #2a2a3c;border-bottom:1px solid #2a2a3c;flex-shrink:0}.resizer-row[data-v-42c4fa00]:hover{background:#3a5a8c}.timeline-area[data-v-42c4fa00]{position:relative;z-index:10;flex-shrink:0;overflow:visible}html,body{width:100%;height:100%;margin:0;padding:0;overflow:clip;overscroll-behavior:none;background:#0b0b12;color:#e8e8f0;font-family:system-ui,-apple-system,Segoe UI,sans-serif}body{position:fixed;top:0;right:0;bottom:0;left:0}*{box-sizing:border-box}#app{position:fixed;top:0;right:0;bottom:0;left:0;width:auto;height:auto;overflow:clip}html,body,#app{-webkit-user-select:none;user-select:none}input,textarea,select,[contenteditable=true]{-webkit-user-select:text;user-select:text}input[type=number]{-webkit-appearance:textfield;appearance:textfield;-moz-appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none} diff --git a/dist/index.html b/dist/index.html index 3aa4a62..8db17e6 100644 --- a/dist/index.html +++ b/dist/index.html @@ -8,8 +8,8 @@ html, body { margin: 0; padding: 0; background: #111; color: #eee; font-family: system-ui, -apple-system, sans-serif; } #app { display: flex; flex-direction: column; height: 100vh; } - - + +
diff --git a/package.json b/package.json index 9c9d80f..d39672a 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,8 @@ "test:spine-json": "node scripts/verify-spine-json.mjs", "test:spine-naming": "node scripts/verify-spine-naming.mjs", "test:render-layer": "node scripts/verify-render-layer.mjs", + "test:particle-events": "node scripts/verify-particle-events.mjs", + "test:sub-emitter-timeline": "node scripts/verify-sub-emitter-timeline.mjs", "test:connector": "node scripts/verify-spine-connector.mjs", "test:connector:spine38-path": "node scripts/verify-spine38-connector-path.mjs", "test:connector:sea": "node scripts/verify-connector-sea.mjs", diff --git a/public/Preset/6.子发射器.json b/public/Preset/6.子发射器.json new file mode 100644 index 0000000..9660d71 --- /dev/null +++ b/public/Preset/6.子发射器.json @@ -0,0 +1,1542 @@ +{ + "format": "SpineParticle.EditorConfig", + "version": 1, + "savedAt": "2026-10-22T08:47:16.245Z", + "editor": { + "viewScale": 0.8928571428571436, + "viewX": 22.94058570991544, + "viewY": 11.760248162437591 + }, + "settings": { + "backgroundX": 0, + "backgroundY": 0, + "backgroundOpacity": 1, + "backgroundImageName": "", + "backgroundImageData": "", + "showGrid": true, + "exportSettings": { + "imagesPath": "./images/", + "spineVersion": "4.2", + "keyframeCurve": "bezier", + "fps": 30, + "omitFps": false, + "integerFrameAlignment": true, + "bonePool": true, + "excludeEmptyAnimations": false, + "fileName": "SpineParticle.json" + } + }, + "timeline": { + "fps": 30, + "loop": true, + "playbackStart": 0, + "playbackEnd": 114, + "playbackEndAuto": true, + "abLoop": false, + "animations": [ + "animation" + ] + }, + "selection": { + "type": "particle", + "id": 1 + }, + "scene": { + "systems": [ + { + "id": 1, + "visible": true, + "animation": "animation", + "config": { + "imageResources": [ + { + "id": 1, + "textureName": "star", + "textureFolder": "", + "previewUrl": "/images/star.png", + "imageMode": "fixed", + "sequencePlayback": "loop-forward", + "sequenceFps": 30, + "sequenceFrames": [], + "weight": 100, + "locked": false, + "scale": 1, + "anchorX": 0.5, + "anchorY": 0.5, + "colorMode": "fixed", + "colorStart": "#ffffff", + "colorEnd": "#ff4d4d", + "colorGradient": [ + { + "position": 0, + "color": "#ffffff" + }, + { + "position": 1, + "color": "#ff4d4d" + } + ], + "blend": "normal", + "independentAlpha": "off", + "alpha": 1, + "alphaCurveMode": "跟随导出", + "alphaCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 0.1, + "y": 1 + }, + { + "x": 0.9, + "y": 1 + }, + { + "x": 1, + "y": 0 + } + ] + } + ], + "imageWeightVersion": 1, + "name": "Fireworks", + "mode": "burst", + "rate": 10, + "streamBehavior": "normal", + "loopDurationFrames": 30, + "generateLoopStartAnimation": false, + "loopStartUseCustomDuration": false, + "loopStartDurationFrames": 30, + "generateLoopEndAnimation": false, + "loopEndUseCustomDuration": false, + "loopEndDurationFrames": 30, + "burstCount": 1, + "burstLoop": false, + "delay": 0, + "duration": 0.5, + "shape": "point", + "showShape": true, + "shapeRangeVersion": 1, + "innerRadius": 83, + "outerRadius": 148, + "innerRectW": 0, + "innerRectH": 0, + "outerRectW": 200, + "outerRectH": 100, + "spawnPathId": 0, + "spawnPathDistribution": "fixed", + "radius": 30, + "rectW": 60, + "rectH": 40, + "centerX": 0, + "centerY": 0, + "rootRotation": 0, + "rootScaleX": 1, + "rootScaleY": 1, + "renderLayerMode": "top", + "renderLayerSpineId": 0, + "renderLayerSlotName": "", + "renderLayerSlotPosition": "above", + "renderLayerFollowAttachment": false, + "emissionAngleMode": "random", + "direction": -90, + "spread": 0, + "coneDirection": 90, + "coneAngle": 90, + "lifeMin": 1, + "lifeMax": 1.8, + "lifeMode": "fixed", + "lifeCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "speedMin": 400, + "speedMax": 100, + "speedMode": "random", + "speedCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleMin": 0.3, + "scaleMax": 0.8, + "scaleMode": "random", + "scaleAxisMode": "uniform", + "scaleYMin": 0.3, + "scaleYMax": 0.8, + "scaleCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleYCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleEndRatio": 0.3, + "initialRotationMode": "random", + "initialRotationMin": 0, + "initialRotationMax": 360, + "initialRotationCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "alpha": 0.9, + "alphaEnd": 0, + "rotationSpeedMin": 360, + "rotationSpeedMax": 180, + "speedOverLifeEnabled": false, + "speedOverLifeMode": "fixed", + "speedOverLifeMin": 1, + "speedOverLifeMax": 1, + "speedOverLifeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleOverLifeEnabled": false, + "scaleOverLifeMode": "curve", + "scaleOverLifeAxisMode": "uniform", + "scaleOverLifeMin": 0, + "scaleOverLifeMax": 1, + "scaleYOverLifeMin": 0, + "scaleYOverLifeMax": 1, + "scaleOverLifeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleYOverLifeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "rotationOverLifeEnabled": true, + "rotationOverLifeMode": "fixed", + "rotationOverLifeCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "gravity": 980, + "gravityMode": "fixed", + "gravityMin": 980, + "gravityMax": 980, + "gravityDirection": -90, + "gravityCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "damping": 1, + "seed": 715994, + "colorStart": "#ffffff", + "colorEnd": "#ff4d4d", + "colorOverLife": false, + "blend": "add", + "alphaMode": "curve", + "curveMode": "线性", + "alphaCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 0.2, + "y": 1 + }, + { + "x": 0.8, + "y": 1 + }, + { + "x": 1, + "y": 0 + } + ], + "textureName": "star", + "textureFolder": "", + "alphaScale": 1, + "anchorX": 0.5, + "anchorY": 0.5, + "independentAlpha": "off", + "offsetX": 0, + "offsetY": 0, + "noise": false, + "noiseAmt": 30, + "noiseRange": 100, + "noiseSpeed": 1, + "useGravity": false, + "wind": false, + "windX": 0, + "windY": 0, + "windMode": "fixed", + "windMin": 100, + "windMax": 100, + "windDirection": 0, + "windCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "forceField": false, + "forceStrength": 10, + "forceRadius": 100, + "forceCenterX": 0, + "forceCenterY": 0, + "forceFalloff": "linear", + "showForceFieldShape": true, + "vortex": false, + "vortexStrength": 10, + "vortexRadius": 100, + "vortexCenterX": 0, + "vortexCenterY": 0, + "vortexFalloff": "linear", + "showVortexShape": true, + "attraction": false, + "attractionCenterX": 200, + "attractionCenterY": 0, + "attractionRadius": 20, + "attractionDuration": 0.5, + "attractionDelay": 0.1, + "attractionDelayMode": "particle", + "attractionPath": "curve", + "showAttractionShape": true, + "trail": true, + "trailConfigVersion": 3, + "trailResources": [ + { + "id": 1, + "textureName": "trail", + "previewUrl": "/images/trail.png", + "weight": 100, + "locked": false, + "rotation": 0, + "colorMode": "particle", + "color": "#ffffff", + "colorGradient": [ + { + "position": 0, + "color": "#ffffff" + }, + { + "position": 1, + "color": "#ffffff" + } + ], + "blend": "normal", + "alphaMode": "particle", + "alpha": 1, + "alphaCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "boneCount": 3, + "trailRatio": 100, + "lengthMode": "fixed", + "length": 50, + "lengthMin": 100, + "lengthMax": 100, + "widthSizeMode": "fixed", + "width": 20, + "widthMin": 100, + "widthMax": 100, + "widthMode": "particle", + "lifeLengthEnabled": false, + "lifeLengthCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "shapeEnabled": false, + "shapeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ] + } + ], + "trailResourceVersion": 6, + "trailTextureName": "trail", + "trailPreviewUrl": "/images/trail.png", + "trailColorMode": "particle", + "trailColor": "#ffffff", + "trailColorGradient": [ + { + "position": 0, + "color": "#ffffff" + }, + { + "position": 1, + "color": "#ffffff" + } + ], + "trailAlphaMode": "particle", + "trailAlpha": 1, + "trailAlphaCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "trailBoneCount": 3, + "trailLength": 100, + "trailWidth": 100, + "trailWidthMode": "particle", + "trailLifeLengthEnabled": false, + "trailLifeLengthCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "trailShapeEnabled": false, + "trailShapeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "trailGridRows": 4, + "trailGridCols": 4, + "collision": false, + "collisionColliderIds": [ + 2 + ], + "pathFollow": false, + "eventEnabled": true, + "events": [ + { + "id": 1, + "event": "death", + "targetSystemId": 2, + "probability": 1, + "inherit": [], + "colorInheritMode": "add", + "collisionLimit": 1 + } + ], + "emitterFollow": false, + "emitterFollowMode": "none", + "emitterFollowPathId": 0, + "emitterFollowSpineId": 0, + "emitterFollowBoneName": "", + "emitterFollowBoneOffsetX": 0, + "emitterFollowBoneOffsetY": 0, + "emitterFollowBoneRotation": 0, + "emitterFollowBoneScaleX": 1, + "emitterFollowBoneScaleY": 1, + "emitterAngleMode": "fixed", + "emitterFollowCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "emitterFollowDuration": 2, + "emitterFollowSpace": "world", + "emitterFollowDirection": "forward", + "emitterFollowOffset": 0 + } + }, + { + "id": 2, + "visible": true, + "animation": "animation", + "config": { + "imageResources": [ + { + "id": 1, + "textureName": "star", + "textureFolder": "", + "previewUrl": "/images/star.png", + "imageMode": "fixed", + "sequencePlayback": "loop-forward", + "sequenceFps": 30, + "sequenceFrames": [], + "weight": 100, + "locked": false, + "scale": 1, + "anchorX": 0.5, + "anchorY": 0.5, + "colorMode": "fixed", + "colorStart": "#00eeff", + "colorEnd": "#ff4d4d", + "colorGradient": [ + { + "position": 0, + "color": "#ffffff" + }, + { + "position": 1, + "color": "#ff4d4d" + } + ], + "blend": "add", + "independentAlpha": "off", + "alpha": 1, + "alphaCurveMode": "跟随导出", + "alphaCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 0.1, + "y": 1 + }, + { + "x": 0.9, + "y": 1 + }, + { + "x": 1, + "y": 0 + } + ] + } + ], + "imageWeightVersion": 1, + "name": "Burst", + "mode": "burst", + "rate": 20, + "streamBehavior": "normal", + "loopDurationFrames": 30, + "generateLoopStartAnimation": false, + "loopStartUseCustomDuration": false, + "loopStartDurationFrames": 30, + "generateLoopEndAnimation": false, + "loopEndUseCustomDuration": false, + "loopEndDurationFrames": 30, + "burstCount": 10, + "burstLoop": false, + "delay": 0, + "duration": 1, + "shape": "point", + "showShape": true, + "shapeRangeVersion": 1, + "innerRadius": 0, + "outerRadius": 30, + "innerRectW": 0, + "innerRectH": 0, + "outerRectW": 60, + "outerRectH": 40, + "spawnPathId": 0, + "spawnPathDistribution": "fixed", + "radius": 30, + "rectW": 60, + "rectH": 40, + "centerX": 0, + "centerY": 0, + "rootRotation": 0, + "rootScaleX": 1, + "rootScaleY": 1, + "renderLayerMode": "top", + "renderLayerSpineId": 0, + "renderLayerSlotName": "", + "renderLayerSlotPosition": "above", + "renderLayerFollowAttachment": false, + "emissionAngleMode": "random", + "direction": 0, + "spread": 360, + "coneDirection": 90, + "coneAngle": 60, + "lifeMin": 0.6, + "lifeMax": 1.8, + "lifeMode": "random", + "lifeCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "speedMin": 182, + "speedMax": 107, + "speedMode": "random", + "speedCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleMin": 0.3, + "scaleMax": 0.8, + "scaleMode": "random", + "scaleAxisMode": "uniform", + "scaleYMin": 0.3, + "scaleYMax": 0.8, + "scaleCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleYCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleEndRatio": 0.3, + "initialRotationMode": "random", + "initialRotationMin": 0, + "initialRotationMax": 360, + "initialRotationCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "alpha": 0.9, + "alphaEnd": 0, + "rotationSpeedMin": -360, + "rotationSpeedMax": 360, + "speedOverLifeEnabled": false, + "speedOverLifeMode": "fixed", + "speedOverLifeMin": 1, + "speedOverLifeMax": 1, + "speedOverLifeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleOverLifeEnabled": false, + "scaleOverLifeMode": "curve", + "scaleOverLifeAxisMode": "uniform", + "scaleOverLifeMin": 0, + "scaleOverLifeMax": 1, + "scaleYOverLifeMin": 0, + "scaleYOverLifeMax": 1, + "scaleOverLifeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleYOverLifeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "rotationOverLifeEnabled": true, + "rotationOverLifeMode": "random", + "rotationOverLifeCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "gravity": 980, + "gravityMode": "fixed", + "gravityMin": 980, + "gravityMax": 980, + "gravityDirection": -90, + "gravityCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "damping": 1, + "seed": 981504, + "colorStart": "#ffffff", + "colorEnd": "#ff4d4d", + "colorOverLife": false, + "blend": "add", + "alphaMode": "curve", + "curveMode": "线性", + "alphaCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 0.2, + "y": 1 + }, + { + "x": 0.8, + "y": 1 + }, + { + "x": 1, + "y": 0 + } + ], + "textureName": "star", + "textureFolder": "", + "alphaScale": 1, + "anchorX": 0.5, + "anchorY": 0.5, + "independentAlpha": "off", + "offsetX": 0, + "offsetY": 0, + "noise": false, + "noiseAmt": 30, + "noiseRange": 100, + "noiseSpeed": 1, + "useGravity": true, + "wind": false, + "windX": 0, + "windY": 0, + "windMode": "fixed", + "windMin": 100, + "windMax": 100, + "windDirection": 0, + "windCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "forceField": false, + "forceStrength": 10, + "forceRadius": 100, + "forceCenterX": 0, + "forceCenterY": 0, + "forceFalloff": "linear", + "showForceFieldShape": true, + "vortex": false, + "vortexStrength": 10, + "vortexRadius": 100, + "vortexCenterX": 0, + "vortexCenterY": 0, + "vortexFalloff": "linear", + "showVortexShape": true, + "attraction": false, + "attractionCenterX": 200, + "attractionCenterY": 0, + "attractionRadius": 20, + "attractionDuration": 0.5, + "attractionDelay": 0.1, + "attractionDelayMode": "particle", + "attractionPath": "curve", + "showAttractionShape": true, + "trail": true, + "trailConfigVersion": 3, + "trailResources": [ + { + "id": 1, + "textureName": "trail", + "previewUrl": "/images/trail.png", + "weight": 100, + "locked": false, + "rotation": 0, + "colorMode": "fixed", + "color": "#77fdfb", + "colorGradient": [ + { + "position": 0, + "color": "#ffffff" + }, + { + "position": 1, + "color": "#ffffff" + } + ], + "blend": "normal", + "alphaMode": "particle", + "alpha": 1, + "alphaCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "boneCount": 8, + "trailRatio": 40, + "lengthMode": "fixed", + "length": 50, + "lengthMin": 100, + "lengthMax": 100, + "widthSizeMode": "fixed", + "width": 20, + "widthMin": 100, + "widthMax": 100, + "widthMode": "particle", + "lifeLengthEnabled": false, + "lifeLengthCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "shapeEnabled": false, + "shapeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ] + } + ], + "trailResourceVersion": 6, + "trailTextureName": "trail", + "trailPreviewUrl": "/images/trail.png", + "trailColorMode": "particle", + "trailColor": "#ffffff", + "trailColorGradient": [ + { + "position": 0, + "color": "#ffffff" + }, + { + "position": 1, + "color": "#ffffff" + } + ], + "trailAlphaMode": "particle", + "trailAlpha": 1, + "trailAlphaCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "trailBoneCount": 3, + "trailLength": 100, + "trailWidth": 100, + "trailWidthMode": "particle", + "trailLifeLengthEnabled": false, + "trailLifeLengthCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "trailShapeEnabled": false, + "trailShapeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "trailGridRows": 9, + "trailGridCols": 9, + "collision": true, + "collisionColliderIds": [ + 2 + ], + "pathFollow": false, + "eventEnabled": true, + "events": [ + { + "id": 1, + "event": "collision", + "targetSystemId": 4, + "probability": 1, + "inherit": [ + "scale" + ], + "colorInheritMode": "add", + "collisionLimit": 1 + } + ], + "emitterFollow": false, + "emitterFollowMode": "none", + "emitterFollowPathId": 0, + "emitterFollowSpineId": 0, + "emitterFollowBoneName": "", + "emitterFollowBoneOffsetX": 0, + "emitterFollowBoneOffsetY": 0, + "emitterFollowBoneRotation": 0, + "emitterFollowBoneScaleX": 1, + "emitterFollowBoneScaleY": 1, + "emitterAngleMode": "fixed", + "emitterFollowCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "emitterFollowDuration": 2, + "emitterFollowSpace": "world", + "emitterFollowDirection": "forward", + "emitterFollowOffset": 0 + } + }, + { + "id": 4, + "visible": true, + "animation": "animation", + "config": { + "imageResources": [ + { + "id": 1, + "textureName": "star", + "textureFolder": "", + "previewUrl": "/images/star.png", + "imageMode": "fixed", + "sequencePlayback": "loop-forward", + "sequenceFps": 30, + "sequenceFrames": [], + "weight": 100, + "locked": false, + "scale": 1, + "anchorX": 0.5, + "anchorY": 0.5, + "colorMode": "fixed", + "colorStart": "#ff0000", + "colorEnd": "#ff4d4d", + "colorGradient": [ + { + "position": 0, + "color": "#ffffff" + }, + { + "position": 1, + "color": "#ff4d4d" + } + ], + "blend": "add", + "independentAlpha": "off", + "alpha": 1, + "alphaCurveMode": "跟随导出", + "alphaCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 0.1, + "y": 1 + }, + { + "x": 0.9, + "y": 1 + }, + { + "x": 1, + "y": 0 + } + ] + } + ], + "imageWeightVersion": 1, + "name": "Burst_Collid", + "mode": "burst", + "rate": 20, + "streamBehavior": "normal", + "loopDurationFrames": 30, + "generateLoopStartAnimation": false, + "loopStartUseCustomDuration": false, + "loopStartDurationFrames": 30, + "generateLoopEndAnimation": false, + "loopEndUseCustomDuration": false, + "loopEndDurationFrames": 30, + "burstCount": 10, + "burstLoop": false, + "delay": 0, + "duration": 1, + "shape": "point", + "showShape": true, + "shapeRangeVersion": 1, + "innerRadius": 0, + "outerRadius": 30, + "innerRectW": 0, + "innerRectH": 0, + "outerRectW": 60, + "outerRectH": 40, + "spawnPathId": 0, + "spawnPathDistribution": "fixed", + "radius": 30, + "rectW": 60, + "rectH": 40, + "centerX": 0, + "centerY": 0, + "rootRotation": 0, + "rootScaleX": 1, + "rootScaleY": 1, + "renderLayerMode": "top", + "renderLayerSpineId": 0, + "renderLayerSlotName": "", + "renderLayerSlotPosition": "above", + "renderLayerFollowAttachment": false, + "emissionAngleMode": "random", + "direction": 0, + "spread": 360, + "coneDirection": 90, + "coneAngle": 60, + "lifeMin": 0.6, + "lifeMax": 1, + "lifeMode": "random", + "lifeCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "speedMin": 30, + "speedMax": 50, + "speedMode": "random", + "speedCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleMin": 0.3, + "scaleMax": 0.8, + "scaleMode": "fixed", + "scaleAxisMode": "uniform", + "scaleYMin": 0.3, + "scaleYMax": 0.8, + "scaleCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleYCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleEndRatio": 0.3, + "initialRotationMode": "random", + "initialRotationMin": 0, + "initialRotationMax": 360, + "initialRotationCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "alpha": 0.9, + "alphaEnd": 0, + "rotationSpeedMin": -180, + "rotationSpeedMax": 180, + "speedOverLifeEnabled": false, + "speedOverLifeMode": "fixed", + "speedOverLifeMin": 1, + "speedOverLifeMax": 1, + "speedOverLifeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleOverLifeEnabled": false, + "scaleOverLifeMode": "curve", + "scaleOverLifeAxisMode": "uniform", + "scaleOverLifeMin": 0, + "scaleOverLifeMax": 1, + "scaleYOverLifeMin": 0, + "scaleYOverLifeMax": 1, + "scaleOverLifeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "scaleYOverLifeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "rotationOverLifeEnabled": true, + "rotationOverLifeMode": "random", + "rotationOverLifeCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "gravity": 980, + "gravityMode": "fixed", + "gravityMin": 980, + "gravityMax": 980, + "gravityDirection": -90, + "gravityCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "damping": 1, + "seed": 883913, + "colorStart": "#ffffff", + "colorEnd": "#ff4d4d", + "colorOverLife": false, + "blend": "add", + "alphaMode": "curve", + "curveMode": "线性", + "alphaCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 0.2, + "y": 1 + }, + { + "x": 0.8, + "y": 1 + }, + { + "x": 1, + "y": 0 + } + ], + "textureName": "star", + "textureFolder": "", + "alphaScale": 1, + "anchorX": 0.5, + "anchorY": 0.5, + "independentAlpha": "off", + "offsetX": 0, + "offsetY": 0, + "noise": false, + "noiseAmt": 30, + "noiseRange": 100, + "noiseSpeed": 1, + "useGravity": false, + "wind": false, + "windX": 0, + "windY": 0, + "windMode": "fixed", + "windMin": 100, + "windMax": 100, + "windDirection": 0, + "windCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "forceField": false, + "forceStrength": 10, + "forceRadius": 100, + "forceCenterX": 0, + "forceCenterY": 0, + "forceFalloff": "linear", + "showForceFieldShape": true, + "vortex": false, + "vortexStrength": 10, + "vortexRadius": 100, + "vortexCenterX": 0, + "vortexCenterY": 0, + "vortexFalloff": "linear", + "showVortexShape": true, + "attraction": false, + "attractionCenterX": 200, + "attractionCenterY": 0, + "attractionRadius": 20, + "attractionDuration": 0.5, + "attractionDelay": 0.1, + "attractionDelayMode": "particle", + "attractionPath": "curve", + "showAttractionShape": true, + "trail": false, + "trailConfigVersion": 3, + "trailResources": [ + { + "id": 1, + "textureName": "trail", + "previewUrl": "/images/trail.png", + "weight": 100, + "locked": false, + "rotation": 0, + "colorMode": "particle", + "color": "#ffffff", + "colorGradient": [ + { + "position": 0, + "color": "#ffffff" + }, + { + "position": 1, + "color": "#ffffff" + } + ], + "blend": "normal", + "alphaMode": "particle", + "alpha": 1, + "alphaCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "boneCount": 3, + "trailRatio": 100, + "lengthMode": "fixed", + "length": 100, + "lengthMin": 100, + "lengthMax": 100, + "widthSizeMode": "fixed", + "width": 100, + "widthMin": 100, + "widthMax": 100, + "widthMode": "particle", + "lifeLengthEnabled": false, + "lifeLengthCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "shapeEnabled": false, + "shapeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ] + } + ], + "trailResourceVersion": 6, + "trailTextureName": "trail", + "trailPreviewUrl": "/images/trail.png", + "trailColorMode": "particle", + "trailColor": "#ffffff", + "trailColorGradient": [ + { + "position": 0, + "color": "#ffffff" + }, + { + "position": 1, + "color": "#ffffff" + } + ], + "trailAlphaMode": "particle", + "trailAlpha": 1, + "trailAlphaCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "trailBoneCount": 3, + "trailLength": 100, + "trailWidth": 100, + "trailWidthMode": "particle", + "trailLifeLengthEnabled": false, + "trailLifeLengthCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "trailShapeEnabled": false, + "trailShapeCurve": [ + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + } + ], + "trailGridRows": 4, + "trailGridCols": 4, + "collision": false, + "collisionColliderIds": [], + "pathFollow": false, + "eventEnabled": false, + "events": [], + "emitterFollow": false, + "emitterFollowMode": "none", + "emitterFollowPathId": 0, + "emitterFollowSpineId": 0, + "emitterFollowBoneName": "", + "emitterFollowBoneOffsetX": 0, + "emitterFollowBoneOffsetY": 0, + "emitterFollowBoneRotation": 0, + "emitterFollowBoneScaleX": 1, + "emitterFollowBoneScaleY": 1, + "emitterAngleMode": "fixed", + "emitterFollowCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ], + "emitterFollowDuration": 2, + "emitterFollowSpace": "world", + "emitterFollowDirection": "forward", + "emitterFollowOffset": 0 + } + } + ], + "colliders": [ + { + "id": 2, + "name": "Collider", + "visible": true, + "shape": "rect", + "enabled": true, + "x": 0, + "y": -60, + "rotation": 0, + "scaleX": 4, + "scaleY": 0.5, + "radius": 50, + "radiusX": 70, + "radiusY": 45, + "width": 120, + "height": 80, + "sides": 6, + "response": "physics", + "elasticity": 0.5, + "friction": 0.3, + "followPath": false, + "followPathId": 0, + "followDuration": 2, + "followPathRotation": false, + "followCurveMode": "跟随导出", + "followCurve": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 1 + } + ] + } + ], + "paths": [], + "spines": [] + } +} \ No newline at end of file diff --git a/public/Preset/6.SpineBoy.json b/public/Preset/7.SpineBoy.json similarity index 100% rename from public/Preset/6.SpineBoy.json rename to public/Preset/7.SpineBoy.json diff --git a/public/Preset/index.json b/public/Preset/index.json index 12adbb9..67c0c17 100644 --- a/public/Preset/index.json +++ b/public/Preset/index.json @@ -20,7 +20,11 @@ "file": "5.贴图轴点.json" }, { - "name": "6.SpineBoy", - "file": "6.SpineBoy.json" + "name": "6.子发射器", + "file": "6.子发射器.json" + }, + { + "name": "7.SpineBoy", + "file": "7.SpineBoy.json" } ] diff --git a/scripts/pixi-stub.mjs b/scripts/pixi-stub.mjs new file mode 100644 index 0000000..22e01c9 --- /dev/null +++ b/scripts/pixi-stub.mjs @@ -0,0 +1,21 @@ +class Vec { constructor(){ this.x=0; this.y=0 } set(x,y){ this.x=x; this.y=(y===undefined?x:y); return this } } +export class Texture { constructor(){ this.width=1; this.height=1 } } +Texture.EMPTY = new Texture() +export class Container { + constructor(){ this.children=[]; this.parent=null; this.position=new Vec(); this.scale=new Vec(); this.scale.x=1; this.scale.y=1; this.anchor=new Vec(); this.rotation=0; this.visible=true; this.renderable=true; this.alpha=1 } + addChild(child){ this.children.push(child); child.parent=this; return child } + addChildAt(child,index){ this.children.splice(index,0,child); child.parent=this; return child } + removeChild(child){ const index=this.children.indexOf(child); if(index>=0) this.children.splice(index,1); return child } + removeFromParent(){ if(this.parent) this.parent.removeChild(this) } + getChildIndex(child){ return this.children.indexOf(child) } + destroy(){} +} +export class Sprite extends Container { + constructor(texture){ super(); this.texture=texture; this.blendMode=0; this.tint=0xffffff; this.x=0; this.y=0 } +} +export class Graphics extends Container { + clear(){} lineStyle(){} moveTo(){} lineTo(){} beginFill(){} endFill(){} drawCircle(){} drawPolygon(){} drawRect(){} bezierCurveTo(){} +} +export class SimpleMesh extends Container { + constructor(texture,vertices,uvs,indices){ super(); this.texture=texture; this.vertices=vertices; this.uvs=uvs; this.indices=indices; this.blendMode=0; this.tint=0xffffff } +} diff --git a/scripts/verify-particle-events.mjs b/scripts/verify-particle-events.mjs new file mode 100644 index 0000000..bd02ca4 --- /dev/null +++ b/scripts/verify-particle-events.mjs @@ -0,0 +1,174 @@ +import { build } from 'esbuild' + +const bundled = await build({ + bundle: true, + entryPoints: ['src/core/particleEmitter.ts'], + format: 'esm', + platform: 'node', + write: false, + alias: { 'pixi.js': './scripts/pixi-stub.mjs' }, +}) +const { ParticleEmitter, defaultConfig } = await import( + `data:text/javascript;base64,${Buffer.from(bundled.outputFiles[0].text).toString('base64')}` +) +const { Texture } = await import('./pixi-stub.mjs') + +const subBundled = await build({ + bundle: true, + entryPoints: ['src/core/subEmitterIds.ts'], + format: 'esm', + platform: 'node', + write: false, +}) +const { collectSubEmitterIds, collectEmitterAncestors } = await import( + `data:text/javascript;base64,${Buffer.from(subBundled.outputFiles[0].text).toString('base64')}` +) + +function makeConfig(overrides = {}) { + const config = defaultConfig() + config.texture = new Texture() + for (const resource of config.imageResources) resource.texture = new Texture() + for (const resource of config.trailResources) resource.texture = new Texture() + Object.assign(config, { + mode: 'burst', + burstCount: 1, + burstLoop: false, + delay: 0, + duration: 1, + lifeMode: 'fixed', + lifeMin: 0.1, + lifeMax: 0.1, + speedMin: 0, + speedMax: 0, + shape: 'point', + collision: false, + eventEnabled: false, + }, overrides) + return config +} + +const step = 1 / 30 +const emitter = new ParticleEmitter(makeConfig()) +const events = [] +emitter.onParticleEvent = (event) => events.push(event) +emitter.update(step, 'force') +if (!events.some((event) => event.kind === 'birth')) throw new Error('未收到出生事件') +for (let i = 0; i < 8; i++) emitter.update(step) +if (!events.some((event) => event.kind === 'death')) throw new Error('未收到死亡事件') + +const target = new ParticleEmitter(makeConfig({ lifeMin: 1, lifeMax: 1 })) +if (!target.spawnEventParticle(12, 34, 1)) throw new Error('事件粒子生成失败') +if (target.activeCount !== 1) throw new Error('事件粒子未进入目标粒子池') +if (target.spawnEventParticle(0, 0, 3)) throw new Error('事件链深度上限未生效') + +const inheritConfig = makeConfig({ + burstCount: 0, + lifeMin: 1, + lifeMax: 1, + scaleMode: 'fixed', + scaleMin: 2, + scaleMax: 2, + initialRotationMode: 'fixed', + initialRotationMin: 0, + initialRotationMax: 0, +}) +inheritConfig.imageResources[0].colorMode = 'fixed' +inheritConfig.imageResources[0].colorStart = '#102030' +const inheritTarget = new ParticleEmitter(inheritConfig) +inheritTarget.spawnEventParticle(0, 0, 1, { + attributes: ['color', 'scale', 'rotation', 'life'], + colorMode: 'add', + data: { colorHex: 0x010203, scaleX: 1.5, scaleY: 1.5, rotation: 90, life: 0.5 }, +}) +inheritTarget.update(0) +const inherited = inheritTarget.capture()[0] +if (!inherited) throw new Error('继承属性的子发射器粒子未生成') +if (inherited.colorHex !== 0x112233) throw new Error(`颜色继承应相加,实际 ${inherited.colorHex.toString(16)}`) +if (Math.abs(inherited.scaleX - 3) > 1e-6 || Math.abs(inherited.scaleY - 3) > 1e-6) throw new Error('大小继承应乘以目标整体缩放') +if (Math.abs(inherited.rotation - 90) > 1e-6) throw new Error('旋转继承应作为整体方向偏移') +for (let i = 0; i < 12; i++) inheritTarget.update(step) +if (inheritTarget.activeCount !== 1) throw new Error('生命周期继承过短') +for (let i = 0; i < 6; i++) inheritTarget.update(step) +if (inheritTarget.activeCount !== 0) throw new Error('生命周期继承未生效') + +const replaceColorTarget = new ParticleEmitter(makeConfig({ burstCount: 0, lifeMin: 1, lifeMax: 1 })) +replaceColorTarget.spawnEventParticle(0, 0, 1, { + attributes: ['color'], + colorMode: 'replace', + data: { colorHex: 0x445566, scaleX: 1, scaleY: 1, rotation: 0, life: 1 }, +}) +replaceColorTarget.update(0) +if (replaceColorTarget.capture()[0]?.colorHex !== 0x445566) throw new Error('颜色覆盖继承失败') + +// 子发射器爆发模式:一次事件应按“单次数量”生成多颗粒子。 +const burstTarget = new ParticleEmitter(makeConfig({ burstCount: 10 })) +if (!burstTarget.spawnEventParticle(0, 0, 1)) throw new Error('子发射器爆发事件生成失败') +if (burstTarget.activeCount !== 10) throw new Error(`子发射器应按单次数量生成 10 颗,实际 ${burstTarget.activeCount} 颗`) + +// 子发射器 delay:事件粒子应延迟发射,而不是立即生成。 +const delayedTarget = new ParticleEmitter(makeConfig({ delay: 0.2, burstCount: 2, lifeMin: 1, lifeMax: 1 })) +delayedTarget.setAutoEmission(false) +if (!delayedTarget.spawnEventParticle(0, 0, 1)) throw new Error('延迟子发射器事件未入队') +if (delayedTarget.activeCount !== 0) throw new Error('子发射器 delay 未生效,粒子立即生成了') +delayedTarget.update(0.1) +if (delayedTarget.activeCount !== 0) throw new Error('子发射器延迟未到时间就发射了') +delayedTarget.update(0.1) +if (delayedTarget.activeCount !== 2) throw new Error(`子发射器延迟后应生成 2 颗,实际 ${delayedTarget.activeCount} 颗`) + +// 子发射器:被引用后不自动发射,只接收事件粒子;移除引用后恢复普通系统。 +const subEmitter = new ParticleEmitter(makeConfig({ burstCount: 5 })) +subEmitter.setAutoEmission(false) +subEmitter.update(step, 'force') +if (subEmitter.activeCount !== 0) throw new Error('子发射器不应自动发射') +if (!subEmitter.spawnEventParticle(0, 0, 1)) throw new Error('子发射器无法接收事件粒子') +subEmitter.setAutoEmission(true) +subEmitter.update(step, 'force') +if (subEmitter.activeCount <= 1) throw new Error('移除引用后应恢复自动发射') + +const subIds = collectSubEmitterIds([ + { id: 1, config: { events: [{ targetSystemId: 2 }, { targetSystemId: 1 }] } }, + { id: 2, config: {} }, + { id: 3, config: {} }, +]) +if (!subIds.has(2) || subIds.has(1) || subIds.has(3)) throw new Error('子发射器引用集合计算错误') + +const chainSystems = [ + { id: 1, config: { events: [{ targetSystemId: 2 }] } }, + { id: 2, config: { events: [{ targetSystemId: 3 }] } }, + { id: 3, config: {} }, +] +const ancestors = collectEmitterAncestors(chainSystems, 3) +if (!ancestors.has(1) || !ancestors.has(2) || ancestors.has(3)) { + throw new Error('子发射器上游父系统计算错误,无法阻止循环依赖') +} + +const collider = { + id: 1, shape: 'circle', enabled: true, + x: 0, y: 0, rotation: 0, scaleX: 1, scaleY: 1, + radius: 50, radiusX: 50, radiusY: 50, width: 100, height: 100, sides: 6, + response: 'physics', elasticity: 1, friction: 0, +} +const collisionEmitter = new ParticleEmitter(makeConfig({ collision: true, lifeMin: 1, lifeMax: 1 })) +collisionEmitter.setColliders(Array.from({ length: 4 }, (_, index) => ({ + ...collider, + id: index + 1, + radius: 50 + index * 10, +}))) +collisionEmitter.setAutoEmission(false) +collisionEmitter.spawnEventParticle(0, 0, 1) +const collisionEvents = [] +collisionEmitter.onParticleEvent = (event) => collisionEvents.push(event) +collisionEmitter.update(step, 'force') +if (!collisionEvents.some((event) => event.kind === 'collision')) throw new Error('未收到碰撞事件') +const collisionCountsBySpawn = new Map() +for (const event of collisionEvents) { + if (event.kind !== 'collision') continue + const counts = collisionCountsBySpawn.get(event.spawnId) || [] + counts.push(event.collisionCount) + collisionCountsBySpawn.set(event.spawnId, counts) +} +if (![...collisionCountsBySpawn.values()].some((counts) => counts[0] === 1 && counts.at(-1) === 4)) { + throw new Error('同一粒子的碰撞次数未正确累计') +} + +console.log('粒子事件校验通过:出生 / 死亡 / 碰撞 / 子发射器生成与禁用自动发射 / 属性继承 / 深度上限') diff --git a/scripts/verify-sub-emitter-timeline.mjs b/scripts/verify-sub-emitter-timeline.mjs new file mode 100644 index 0000000..e4a71b0 --- /dev/null +++ b/scripts/verify-sub-emitter-timeline.mjs @@ -0,0 +1,87 @@ +import { build } from 'esbuild' + +const source = ` + import { createPinia, setActivePinia } from 'pinia' + import { useParticleStore } from './src/store/particleStore.ts' + import { subEmitterTriggerTimings } from './src/core/subEmitterTiming.ts' + import { collectSubEmitterIds } from './src/core/subEmitterIds.ts' + + setActivePinia(createPinia()) + const store = useParticleStore() + const parent = store.addSystem() + const child = store.addSystem() + const assert = (condition, message) => { if (!condition) throw new Error(message) } + const setLife = (system, life) => { + system.config.lifeMode = 'fixed' + system.config.lifeMin = life + system.config.lifeMax = life + } + + parent.config.mode = 'stream' + parent.config.streamBehavior = 'normal' + parent.config.delay = 0 + parent.config.duration = 1 + setLife(parent, 2) + parent.config.eventEnabled = true + parent.config.events = [{ + id: 1, event: 'death', targetSystemId: child.id, + probability: 1, collisionLimit: 1, inherit: [], colorInheritMode: 'add', + }] + + // 子发射器自身的 10s 发射时长不应算入时间轴。 + child.config.mode = 'stream' + child.config.streamBehavior = 'normal' + child.config.delay = 0 + child.config.duration = 10 + setLife(child, 1.5) + + // 死亡触发:父粒子最晚 3s 死亡,子发射器再存活 1.5s → 4.5s。 + let frames = store.recalcTotalFrames() + assert(frames === Math.ceil(4.5 * 30) + 1, '死亡子发射器时间轴错误:' + frames) + const deathTiming = subEmitterTriggerTimings(store.systems, 30).get(child.id) + assert(deathTiming && Math.abs(deathTiming.firstTrigger - 2) < 1e-6, '死亡子发射器起点应为第一次死亡 2s') + assert(deathTiming && Math.abs(deathTiming.lastTrigger - 3) < 1e-6, '死亡子发射器最后触发应为 3s') + assert(deathTiming && Math.abs(deathTiming.end - 4.5) < 1e-6, '死亡子发射器终点应为 4.5s') + + // 子发射器自身 delay 在父事件之后继续延后发射。 + child.config.delay = 0.2 + frames = store.recalcTotalFrames() + assert(frames === Math.ceil(4.7 * 30) + 1, '子发射器延迟未计入时间轴:' + frames) + child.config.delay = 0 + + // 出生触发:子发射器与父粒子同时开始,取较长者 2s → 3s。 + parent.config.events[0].event = 'birth' + frames = store.recalcTotalFrames() + assert(frames === Math.ceil(3 * 30) + 1, '出生子发射器时间轴错误:' + frames) + const birthTiming = subEmitterTriggerTimings(store.systems, 30).get(child.id) + assert(birthTiming && Math.abs(birthTiming.firstTrigger - 0) < 1e-6, '出生子发射器应从父粒子首次出生开始') + assert(birthTiming && Math.abs(birthTiming.lastTrigger - 1) < 1e-6, '出生子发射器最后触发应为发射结束 1s') + assert(birthTiming && Math.abs(birthTiming.end - 2.5) < 1e-6, '出生子发射器终点应为 2.5s') + + // 关闭“开启子发射器”后,保留的规则不应继续把目标标记为子发射器。 + parent.config.eventEnabled = false + assert(!collectSubEmitterIds(store.systems).has(child.id), '关闭子发射器后目标仍被当作子发射器') + assert(!subEmitterTriggerTimings(store.systems, 30).has(child.id), '关闭子发射器后仍有时间轴触发区间') + frames = store.recalcTotalFrames() + assert(frames === Math.ceil(11.5 * 30) + 1, '关闭子发射器后目标未恢复独立时长') + + // 移除引用后子发射器恢复正常,自身的 10s 发射时长重新计入。 + parent.config.eventEnabled = true + parent.config.events = [] + frames = store.recalcTotalFrames() + assert(frames === Math.ceil(11.5 * 30) + 1, '移除引用后时间轴错误:' + frames) + + console.log('子发射器时间轴校验通过:死亡/出生触发与移除引用后的总长度') +` + +const result = await build({ + stdin: { contents: source, resolveDir: process.cwd(), sourcefile: 'verify-sub-emitter-timeline.ts', loader: 'ts' }, + bundle: true, + platform: 'node', + format: 'esm', + write: false, + logLevel: 'silent', +}) + +const code = Buffer.from(result.outputFiles[0].contents).toString('base64') +await import(`data:text/javascript;base64,${code}`) diff --git a/scripts/verify-timeline.mjs b/scripts/verify-timeline.mjs index 998783c..632a098 100644 --- a/scripts/verify-timeline.mjs +++ b/scripts/verify-timeline.mjs @@ -6,7 +6,7 @@ const bundled = await build({ contents: [ "export { bakeLoopFrames, closeLoopFrameSeam } from './src/core/loopFrameBaker.ts'", "export { loopPlaybackRange, loopSegmentTiming } from './src/core/loopSegmentTiming.ts'", - "export { normalizePlaybackRange, resizePlaybackRange } from './src/timeline/playbackRange.ts'", + "export { normalizePlaybackRange, resizePlaybackRange, resolvePlaybackRange } from './src/timeline/playbackRange.ts'", ].join('\n'), resolveDir: process.cwd(), sourcefile: 'timeline-test-entry.ts', @@ -52,6 +52,10 @@ const normalized = api.normalizePlaybackRange(10, 10, 100) if (normalized.start !== 10 || normalized.end !== 11) throw new Error('播放范围必须至少包含两个帧位置') const resized = api.resizePlaybackRange({ start: 5, end: 59 }, 60, 90) if (resized.start !== 5 || resized.end !== 89) throw new Error('全范围播放没有随总时长扩展') +const abOff = api.resolvePlaybackRange(false, 5, 54, 139) +if (abOff.start !== 0 || abOff.end !== 138) throw new Error('AB 关闭时应播放完整时间轴') +const abOn = api.resolvePlaybackRange(true, 5, 54, 139) +if (abOn.start !== 5 || abOn.end !== 54) throw new Error('AB 开启时应播放用户输入区间') function state(x) { return [{ diff --git a/src/core/particleConfig.ts b/src/core/particleConfig.ts index 36477c9..567db82 100644 --- a/src/core/particleConfig.ts +++ b/src/core/particleConfig.ts @@ -232,6 +232,8 @@ export function defaultConfig(): EmitterConfig { collision: false, collisionColliderIds: [], pathFollow: false, + eventEnabled: false, + events: [], emitterFollow: false, emitterFollowMode: 'none', emitterFollowPathId: 0, @@ -306,6 +308,38 @@ export function ensureEmitterConfig(config: EmitterConfig): EmitterConfig { if (typeof config.renderLayerSlotName !== 'string') config.renderLayerSlotName = '' if (config.renderLayerSlotPosition !== 'above' && config.renderLayerSlotPosition !== 'below') config.renderLayerSlotPosition = 'above' if (typeof config.renderLayerFollowAttachment !== 'boolean') config.renderLayerFollowAttachment = false + if (typeof config.eventEnabled !== 'boolean') config.eventEnabled = false + if (!Array.isArray(config.events)) config.events = [] + for (const rule of config.events) { + rule.id = Math.max(1, Math.round(Number(rule.id) || 1)) + if (rule.event !== 'birth' && rule.event !== 'death' && rule.event !== 'collision') rule.event = 'birth' + rule.targetSystemId = Math.max(0, Math.round(Number(rule.targetSystemId) || 0)) + const probability = Number(rule.probability) + rule.probability = Math.min(1, Math.max(0, Number.isFinite(probability) ? probability : 1)) + const collisionLimit = Math.round(Number(rule.collisionLimit)) + rule.collisionLimit = Math.min(4, Math.max(1, Number.isFinite(collisionLimit) ? collisionLimit : 1)) + // 旧版本 inherit 是单字符串;统一迁移为可多选的属性数组。 + const legacyInherit = rule.inherit as unknown + const allowedInherit = ['color', 'scale', 'rotation', 'life'] + const inheritList = Array.isArray(legacyInherit) + ? legacyInherit + : legacyInherit === 'all' + ? [...allowedInherit] + : allowedInherit.includes(String(legacyInherit)) + ? [String(legacyInherit)] + : [] + const normalizedInherit = [...new Set(inheritList.filter((name) => allowedInherit.includes(String(name))))] as typeof rule.inherit + // 只有值确实变化时才写回;ensureEmitterConfig 每帧都会调用,重复赋新数组会触发无限响应式更新。 + const currentInherit = Array.isArray(legacyInherit) ? legacyInherit : null + if ( + !currentInherit + || currentInherit.length !== normalizedInherit.length + || normalizedInherit.some((name, index) => name !== currentInherit[index]) + ) { + rule.inherit = normalizedInherit + } + if (rule.colorInheritMode !== 'add' && rule.colorInheritMode !== 'replace') rule.colorInheritMode = 'add' + } config.innerRadius = Math.max(0, Number(config.innerRadius) || 0) config.outerRadius = Math.max(config.innerRadius, Number(config.outerRadius) || 0) config.innerRectW = Math.max(0, Number(config.innerRectW) || 0) diff --git a/src/core/particleEmitter.ts b/src/core/particleEmitter.ts index 0954389..73a8abd 100644 --- a/src/core/particleEmitter.ts +++ b/src/core/particleEmitter.ts @@ -3,10 +3,10 @@ import { pathDistributionProgress, sampleEmitterShape, sampleEmissionVelocityAng import { TrailController, createTrailState, resetTrailState, type ParticleTrailState } from './particleTrail' import { pickImageResource, pickTrailResource, imageFrameState, imageFrameTexture } from './particleResources' -import type { SceneCollider, EmitterConfig, ParticleState } from './particleTypes' +import type { SceneCollider, EmitterConfig, ParticleState, ParticleInheritAttribute } from './particleTypes' import { defaultConfig, ensureEmitterConfig } from './particleConfig' import { BLEND_MAP, MAX_PARTICLES } from './particleConstants' -import { lerp, finite, localToWorldMath, worldMathToLocal, localVelocityToWorldMath, worldVelocityToLocalMath, resolveColliderPoint, tFromLife, seededUnit, initialValue, overLifeValue, curveAt, mulberry32, hexToNumber, gradientColorAt, fieldFalloff, vortexAcceleration } from './particleMath' +import { lerp, finite, localToWorldMath, worldMathToLocal, localVelocityToWorldMath, worldVelocityToLocalMath, resolveColliderPoint, tFromLife, seededUnit, initialValue, overLifeValue, curveAt, mulberry32, hexToNumber, gradientColorAt, fieldFalloff, vortexAcceleration, addRgbColors } from './particleMath' // 保留原有入口,现有调用方无需随内部拆分修改。 export type * from './particleTypes' @@ -40,8 +40,54 @@ interface Particle { resourceId: number /** 随机颜色模式下,粒子出生时从卡片色带采样并在生命周期内保持的颜色。 */ colorSample: number + /** 父粒子颜色,逐通道相加到粒子自身颜色。 */ + colorAdd: number + /** 父粒子颜色覆盖;null 表示不覆盖。 */ + colorOverride: number | null + /** 当前渲染缩放,用于事件继承。 */ + currentScaleX: number + currentScaleY: number imageFrameIndex: number collisionPaused: boolean + /** 当前粒子累计发生的碰撞次数。 */ + collisionCount: number + /** 由事件链生成的层级;0 = 正常发射。 */ + eventDepth: number +} + +export type ParticleEventKind = 'birth' | 'death' | 'collision' + +export interface ParticleEventInfo { + kind: ParticleEventKind + /** 事件位置的数学世界坐标。 */ + worldX: number + worldY: number + rotation: number + spawnId: number + /** 0 = 正常发射;数值越大表示事件链越深。 */ + depth: number + colorHex: number + scaleX: number + scaleY: number + maxLife: number + collisionCount: number + normalX?: number + normalY?: number +} + +/** 子发射器从父粒子继承的数据。 */ +export interface ParticleInheritData { + colorHex: number + scaleX: number + scaleY: number + rotation: number + life: number +} + +export interface ParticleInheritOptions { + attributes: ParticleInheritAttribute[] + colorMode: 'add' | 'replace' + data: ParticleInheritData } export class ParticleEmitter extends Container { @@ -55,8 +101,21 @@ export class ParticleEmitter extends Container { /** 用于“统一时间”延迟:记录吸附从关闭切换为开启时的发射器时间。 */ private _attractionEnabledAt = 0 private _attractionWasEnabled = false + /** 子发射器关闭自动发射,只接收父粒子事件生成的粒子。 */ + private autoEmission = true + /** 事件粒子延迟队列:子发射器 delay 表示在父事件之后再延迟多久发射。 */ + private pendingEventSpawns: Array<{ + worldX: number + worldY: number + depth: number + inherit?: ParticleInheritOptions + count: number + remaining: number + }> = [] /** 活动粒子状态快照(供骨架 / 导出) */ states: ParticleState[] = [] + /** 粒子出生/死亡/碰撞事件回调(由 EmitterSync 接入跨系统事件)。 */ + onParticleEvent: ((event: ParticleEventInfo) => void) | null = null /** 确定性随机(种子>0 时可复现) */ private rng: () => number = Math.random private _lastSeed = -1 @@ -118,8 +177,14 @@ export class ParticleEmitter extends Container { trail: createTrailState(), resourceId: 1, colorSample: 0xffffff, + colorAdd: 0, + colorOverride: null, + currentScaleX: 1, + currentScaleY: 1, imageFrameIndex: 0, collisionPaused: false, + collisionCount: 0, + eventDepth: 0, }) } } @@ -129,6 +194,7 @@ export class ParticleEmitter extends Container { this.spawnPathClosed = closed } setColliders(colliders: SceneCollider[]) { this.colliders = colliders } + setAutoEmission(enabled: boolean) { this.autoEmission = enabled } setEmitterFollowSpawn(x: number, y: number, angleDegrees: number) { this.followSpawnX = x this.followSpawnY = y @@ -147,6 +213,8 @@ export class ParticleEmitter extends Container { if (!collider.enabled) continue const hit = resolveColliderPoint(collider, world.x, world.y) if (!hit) continue + p.collisionCount++ + this.emitWorldEvent('collision', p, hit.x, hit.y, { normalX: hit.nx, normalY: hit.ny }) if (collider.response === 'destroy') { this.kill(particleIndex) return true @@ -203,7 +271,7 @@ export class ParticleEmitter extends Container { // 发射时长只属于持续模式;爆发模式在延迟结束时执行一次,不显示也不消耗持续段。 const withinDuration = emissionControl === 'force' || (emissionControl === 'normal' && (cfg.mode === 'burst' || this._elapsed < cfg.delay + Math.max(1 / 30, cfg.duration))) // 发射(仅在窗口内且未超时长) - if (inWindow && withinDuration) { + if (this.autoEmission && inWindow && withinDuration) { if (cfg.mode === 'stream') { this.accumulator += dt * cfg.rate while (this.accumulator >= 1) { this.accumulator -= 1; this.spawnOne() } @@ -219,6 +287,24 @@ export class ParticleEmitter extends Container { } } + // 处理子发射器的延迟发射队列;新粒子在本帧就会参与后续更新与录制。 + if (this.pendingEventSpawns.length && dt > 0) { + const ready: typeof this.pendingEventSpawns = [] + const waiting: typeof this.pendingEventSpawns = [] + for (const pending of this.pendingEventSpawns) { + pending.remaining -= dt + if (pending.remaining <= 0) ready.push(pending) + else waiting.push(pending) + } + this.pendingEventSpawns = waiting + for (const pending of ready) { + const local = worldMathToLocal(this.cfg, pending.worldX, pending.worldY, this.simulationTransform) + for (let index = 0; index < pending.count; index++) { + if (!this.spawnOne({ x: local.x, y: local.y }, pending.depth, pending.inherit)) break + } + } + } + const states: ParticleState[] = [] for (let i = 0; i < this.pool.length; i++) { const p = this.pool[i] @@ -385,6 +471,8 @@ export class ParticleEmitter extends Container { : scaleMulX } s.scale.set(finite(p.scaleStartX * scaleMulX, 1), finite(p.scaleStartY * scaleMulY, 1)) + p.currentScaleX = s.scale.x + p.currentScaleY = s.scale.y const baseAlpha = cfg.alphaMode === 'curve' ? curveAt(cfg.alphaCurve, t, this.resolveCurveMode(cfg.curveMode)) * cfg.alphaScale : cfg.alpha * cfg.alphaScale @@ -395,11 +483,13 @@ export class ParticleEmitter extends Container { ? curveAt(resource.alphaCurve, t, this.resolveCurveMode(resource.alphaCurveMode)) : baseAlpha, 1) const colorStart = resource?.colorStart || '#ffffff' - const rgb = resource?.colorMode === 'lifetime' - ? gradientColorAt(resource.colorGradient, t) - : resource?.colorMode === 'random' - ? p.colorSample - : hexToNumber(colorStart) + const baseRgb = resource?.colorMode === 'lifetime' + ? gradientColorAt(resource.colorGradient, t) + : resource?.colorMode === 'random' + ? p.colorSample + : hexToNumber(colorStart) + // 继承颜色:按配置逐通道相加,或直接覆盖目标系统颜色。 + const rgb = p.colorOverride ?? addRgbColors(baseRgb, p.colorAdd) s.tint = rgb s.blendMode = BLEND_MAP[resource?.blend || 'normal'] as any const trailState = this.trail.update(p.trail, cfg, p.boneName, renderX, renderY, t, s) @@ -467,15 +557,70 @@ export class ParticleEmitter extends Container { } } - private spawnOne() { + /** 由跨系统事件触发:在给定的数学世界坐标处生成一颗目标系统的粒子。 */ + spawnEventParticle(worldX: number, worldY: number, depth = 1, inherit?: ParticleInheritOptions, count?: number): boolean { + if (depth > 2) return false + // 子发射器按自己的发射模式决定每次事件生成多少颗:爆发=单次数量,持续=1。 + const requested = count ?? (this.cfg.mode === 'burst' ? this.cfg.burstCount : 1) + const total = Math.max(1, Math.min(MAX_PARTICLES, Math.round(Number(requested) || 1))) + // 子发射器 delay 表示在父事件之后再延迟多久发射。 + const delay = Math.max(0, Number(this.cfg.delay) || 0) + if (delay > 0) { + this.pendingEventSpawns.push({ worldX, worldY, depth, inherit, count: total, remaining: delay }) + return true + } + const local = worldMathToLocal(this.cfg, worldX, worldY, this.simulationTransform) + let spawned = false + for (let index = 0; index < total; index++) { + if (!this.spawnOne({ x: local.x, y: local.y }, depth, inherit)) break + spawned = true + } + return spawned + } + + private emitWorldEvent( + kind: ParticleEventKind, + particle: Particle, + worldX: number, + worldY: number, + extra?: { normalX?: number; normalY?: number }, + ) { + if (!this.onParticleEvent) return + this.onParticleEvent({ + kind, + worldX, + worldY, + rotation: particle.rotation, + spawnId: particle.spawnId, + depth: particle.eventDepth, + colorHex: particle.sprite.tint as number, + scaleX: particle.currentScaleX, + scaleY: particle.currentScaleY, + maxLife: particle.maxLife, + collisionCount: particle.collisionCount, + ...extra, + }) + } + + private emitLocalEvent(kind: ParticleEventKind, particle: Particle, x: number, y: number) { + if (!this.onParticleEvent) return + const world = localToWorldMath(this.cfg, x, y, this.simulationTransform) + this.emitWorldEvent(kind, particle, world.x, world.y) + } + + private spawnOne(originOverride?: { x: number; y: number }, eventDepth = 0, inherit?: ParticleInheritOptions): boolean { const cfg = this.cfg let idx = this.pool.findIndex((p) => !p.active) - if (idx === -1) return // 池满 - const origin = this.spawnOrigin() + if (idx === -1) return false // 池满 + const origin = originOverride + ? { x: originOverride.x, y: originOverride.y, radialAngle: 0 } + : this.spawnOrigin() const { x: ox, y: oy } = origin const life = initialValue(cfg.lifeMode, cfg.lifeMin, cfg.lifeMax, cfg.lifeCurve, this.rng()) const speed = initialValue(cfg.speedMode, cfg.speedMin, cfg.speedMax, cfg.speedCurve, this.rng()) - const dirAng = sampleEmissionVelocityAngle(cfg, origin, this.followSpawnAngle, this.rng) + // 继承旋转作为整个子发射系统的方向偏移:旋转发射方向与粒子初始朝向。 + const rotationOffset = inherit?.attributes.includes('rotation') ? inherit.data.rotation : 0 + const dirAng = sampleEmissionVelocityAngle(cfg, origin, this.followSpawnAngle, this.rng) + rotationOffset * Math.PI / 180 const p = this.pool[idx] const resource = pickImageResource(cfg, this.rng) const spawnSerial = this._spawnSerial++ @@ -494,6 +639,8 @@ export class ParticleEmitter extends Container { p.attractionActive = false p.attractionElapsed = 0 p.collisionPaused = false + p.collisionCount = 0 + p.eventDepth = eventDepth p.attractionCurveSide = seededUnit(cfg.seed, spawnSerial, 0xa341316c) < 0.5 ? -1 : 1 p.trail.history.length = 0 p.trail.bones.length = 0 @@ -531,7 +678,7 @@ export class ParticleEmitter extends Container { p.alphaStart = cfg.alpha; p.alphaEnd = cfg.alphaEnd p.rotation = cfg.initialRotationMode === 'direction' ? -Math.atan2(p.vy, p.vx) * 180 / Math.PI + cfg.initialRotationMin - : initialValue(cfg.initialRotationMode, cfg.initialRotationMin, cfg.initialRotationMax, cfg.initialRotationCurve, this.rng()) + : initialValue(cfg.initialRotationMode, cfg.initialRotationMin, cfg.initialRotationMax, cfg.initialRotationCurve, this.rng()) + rotationOffset p.rotationSpeed = cfg.rotationOverLifeEnabled ? initialValue(cfg.rotationOverLifeMode, cfg.rotationSpeedMin, cfg.rotationSpeedMax, cfg.rotationOverLifeCurve, this.rng()) : 0 @@ -549,23 +696,49 @@ export class ParticleEmitter extends Container { p.colorSample = resource.colorMode === 'random' ? gradientColorAt(resource.colorGradient, seededUnit(cfg.seed, spawnSerial, 0x9e3779b9)) : hexToNumber(resource.colorStart) + p.colorAdd = 0 + p.colorOverride = null + // 子发射器继承父粒子属性:颜色 / 大小 / 旋转 / 生命周期。 + if (inherit) { + const attributes = inherit.attributes + if (attributes.includes('color')) { + if (inherit.colorMode === 'replace') p.colorOverride = inherit.data.colorHex + else p.colorAdd = inherit.data.colorHex + } + if (attributes.includes('scale')) { + // 大小作为整个子发射系统的缩放:目标粒子自身缩放 × 父粒子当前缩放。 + p.scaleStartX *= inherit.data.scaleX + p.scaleStartY *= inherit.data.scaleY + } + // 旋转已在上面作为整体方向偏移应用,不再覆盖粒子自身旋转。 + if (attributes.includes('life')) { + p.life = Math.max(0.0001, inherit.data.life) + p.maxLife = p.life + } + } + p.currentScaleX = p.scaleStartX + p.currentScaleY = p.scaleStartY const initialFrame = imageFrameState(resource, 0) p.imageFrameIndex = initialFrame.index p.sprite.texture = imageFrameTexture(resource, cfg.texture, initialFrame.index) p.sprite.anchor.set(resource.anchorX, resource.anchorY) p.sprite.blendMode = BLEND_MAP[resource.blend] as any - p.sprite.tint = p.colorSample + p.sprite.tint = p.colorOverride ?? addRgbColors(p.colorSample, p.colorAdd) p.sprite.visible = true + this.emitLocalEvent('birth', p, p.x, p.y) + return true } private kill(i: number) { const p = this.pool[i] + if (p.active) this.emitLocalEvent('death', p, p.x, p.y) p.active = false p.sprite.visible = false resetTrailState(p.trail) } clear() { + this.pendingEventSpawns.length = 0 for (const p of this.pool) { p.active = false p.sprite.visible = false @@ -657,6 +830,7 @@ export class ParticleEmitter extends Container { /** 清空所有粒子并重置发射计时 */ reset() { + this.pendingEventSpawns.length = 0 for (const p of this.pool) { p.active = false p.sprite.visible = false @@ -678,6 +852,7 @@ export class ParticleEmitter extends Container { * 发射计时与随机序列回到周期起点,使每一周期产生完全相同的发射事件。 */ restartEmissionCycle() { + this.pendingEventSpawns.length = 0 this.accumulator = 0 this.burstTimer = 0 this._spawnSerial = 0 diff --git a/src/core/particleMath.ts b/src/core/particleMath.ts index 26f9494..942f329 100644 --- a/src/core/particleMath.ts +++ b/src/core/particleMath.ts @@ -247,3 +247,11 @@ export function hexToRgb(hex: string): [number, number, number] { const n = parseInt(h, 16) return [(n >> 16) & 255, (n >> 8) & 255, n & 255] } + +/** 颜色相加:逐通道相加并钳制到 0~255。 */ +export function addRgbColors(base: number, add: number): number { + const r = Math.min(255, ((base >> 16) & 255) + ((add >> 16) & 255)) + const g = Math.min(255, ((base >> 8) & 255) + ((add >> 8) & 255)) + const b = Math.min(255, (base & 255) + (add & 255)) + return (r << 16) | (g << 8) | b +} diff --git a/src/core/particleTypes.ts b/src/core/particleTypes.ts index a469234..9c4218e 100644 --- a/src/core/particleTypes.ts +++ b/src/core/particleTypes.ts @@ -16,6 +16,28 @@ export type FieldFalloff = 'constant' | 'linear' | 'inverse' /** 粒子系统在 Spine 绘制顺序中的位置(仅影响编辑器预览)。 */ export type RenderLayerMode = 'top' | 'slot' export type RenderLayerPosition = 'above' | 'below' +/** 粒子事件类型。 */ +export type ParticleEventType = 'birth' | 'death' | 'collision' +/** 子发射器可继承的单个属性(可多选)。 */ +export type ParticleInheritAttribute = 'color' | 'scale' | 'rotation' | 'life' +/** 颜色继承方式:逐通道相加或直接覆盖。 */ +export type ParticleColorInheritMode = 'add' | 'replace' + +/** 一条事件规则:某个粒子事件以一定概率触发另一个粒子系统。 */ +export interface ParticleEventRule { + id: number + event: ParticleEventType + /** 目标粒子系统 id;0 表示未选择。 */ + targetSystemId: number + /** 每个粒子事件触发概率 0~1。 */ + probability: number + /** 碰撞事件对同一父粒子的最大触发次数。 */ + collisionLimit: number + /** 子发射器继承父粒子的属性;空数组 = 无。 */ + inherit: ParticleInheritAttribute[] + /** 继承颜色时采用相加还是覆盖。 */ + colorInheritMode: ParticleColorInheritMode +} export interface CurvePoint { x: number; y: number; inX?: number; inY?: number; outX?: number; outY?: number } export interface ColorGradientStop { position: number; color: string } @@ -352,6 +374,9 @@ export interface EmitterConfig { collisionColliderIds: number[] /** 开启路径跟随(预留) */ pathFollow: boolean + /** 开启事件(具体事件类型与行为后续接入)。 */ + eventEnabled: boolean + events: ParticleEventRule[] emitterFollow: boolean emitterFollowMode: 'none' | 'path' | 'bone' emitterFollowPathId: number diff --git a/src/core/subEmitterIds.ts b/src/core/subEmitterIds.ts new file mode 100644 index 0000000..74c3279 --- /dev/null +++ b/src/core/subEmitterIds.ts @@ -0,0 +1,50 @@ +interface SubEmitterSource { + id: number + config: { eventEnabled?: boolean; events?: Array<{ targetSystemId: number }> } +} + +/** + * 被任一子发射器规则引用的粒子系统属于父系统的一部分: + * 不在场景对象列表中单独显示,也不自动发射,只由父粒子事件驱动。 + */ +export function collectSubEmitterIds(systems: readonly SubEmitterSource[]): Set { + const ids = new Set() + for (const system of systems) { + if (system.config?.eventEnabled === false) continue + const rules = system.config?.events + if (!Array.isArray(rules)) continue + for (const rule of rules) { + if (rule.targetSystemId > 0 && rule.targetSystemId !== system.id) ids.add(rule.targetSystemId) + } + } + return ids +} + +/** + * 收集某个粒子系统的全部上游父系统(沿子发射器引用向上遍历)。 + * 添加子发射器目标时必须排除这些系统,否则会形成循环依赖。 + */ +export function collectEmitterAncestors(systems: readonly SubEmitterSource[], systemId: number): Set { + const parentsOf = new Map() + for (const system of systems) { + if (system.config?.eventEnabled === false) continue + const rules = system.config?.events + if (!Array.isArray(rules)) continue + for (const rule of rules) { + if (rule.targetSystemId <= 0 || rule.targetSystemId === system.id) continue + const parents = parentsOf.get(rule.targetSystemId) + if (parents) parents.push(system.id) + else parentsOf.set(rule.targetSystemId, [system.id]) + } + } + const ancestors = new Set() + const queue = [...(parentsOf.get(systemId) || [])] + while (queue.length) { + const current = queue.pop()! + if (ancestors.has(current)) continue + ancestors.add(current) + queue.push(...(parentsOf.get(current) || [])) + } + ancestors.delete(systemId) + return ancestors +} diff --git a/src/core/subEmitterTiming.ts b/src/core/subEmitterTiming.ts new file mode 100644 index 0000000..3c8ad6e --- /dev/null +++ b/src/core/subEmitterTiming.ts @@ -0,0 +1,142 @@ +import { loopSegmentTiming } from './loopSegmentTiming' + +export interface SubEmitterRuleSource { + event: 'birth' | 'death' | 'collision' + targetSystemId: number +} + +export interface SubEmitterTimingSource { + id: number + config: { + mode: 'stream' | 'burst' + streamBehavior: 'normal' | 'loop' + delay: number + duration: number + loopDurationFrames: number + lifeMin: number + lifeMax: number + lifeMode: string + eventEnabled: boolean + events?: SubEmitterRuleSource[] + } +} + +export interface SubEmitterTriggerTiming { + /** 第一次被父粒子事件触发的时刻(秒)。 */ + firstTrigger: number + /** 最后一次可能被触发的时刻(秒)。 */ + lastTrigger: number + /** 最后一颗粒子消失的时刻(秒)。 */ + end: number +} + +const numberOrZero = (value: unknown) => Math.max(0, Number(value) || 0) + +/** + * 计算子发射器在时间轴上的实际活动区间: + * 起点取第一次可能被触发的时刻,终点取最后一次触发 + 子粒子最大生命。 + * 触发时机:出生=父粒子出生时;死亡=最早/最晚死亡时;碰撞=出生到死亡之间。 + */ +export function subEmitterTriggerTimings( + systems: readonly SubEmitterTimingSource[], + fps: number, +): Map { + const safeFps = Math.max(1, fps) + const byId = new Map(systems.map((system) => [system.id, system])) + const subIds = new Set() + for (const system of systems) { + if (!system.config.eventEnabled) continue + for (const rule of system.config.events || []) { + if (rule.targetSystemId > 0 && rule.targetSystemId !== system.id && byId.has(rule.targetSystemId)) { + subIds.add(rule.targetSystemId) + } + } + } + + const parentsOf = new Map>() + for (const system of systems) { + if (!system.config.eventEnabled) continue + for (const rule of system.config.events || []) { + if (rule.targetSystemId <= 0 || rule.targetSystemId === system.id || !byId.has(rule.targetSystemId)) continue + const parents = parentsOf.get(rule.targetSystemId) + if (parents) parents.push({ parent: system, rule }) + else parentsOf.set(rule.targetSystemId, [{ parent: system, rule }]) + } + } + + const emissionStart = (config: SubEmitterTimingSource['config']) => numberOrZero(config.delay) + const delayOf = (config: SubEmitterTimingSource['config']) => numberOrZero(config.delay) + const emissionEnd = (config: SubEmitterTimingSource['config']) => { + const delay = emissionStart(config) + if (config.mode !== 'stream') return delay + if (config.streamBehavior === 'loop') { + return delay + loopSegmentTiming(config as any, safeFps).total / safeFps + } + return delay + Math.max(1 / safeFps, Number(config.duration) || 0) + } + const lifeMinOf = (config: SubEmitterTimingSource['config']) => { + const min = numberOrZero(config.lifeMin) + const max = numberOrZero(config.lifeMax) + return config.lifeMode === 'fixed' ? min : Math.min(min, max) + } + const lifeMaxOf = (config: SubEmitterTimingSource['config']) => { + const min = numberOrZero(config.lifeMin) + const max = numberOrZero(config.lifeMax) + return config.lifeMode === 'fixed' ? min : Math.max(min, max) + } + + const firstCache = new Map() + const lastCache = new Map() + const firstVisiting = new Set() + const lastVisiting = new Set() + const firstTrigger = (system: SubEmitterTimingSource): number => { + const cached = firstCache.get(system.id) + if (cached != null) return cached + if (firstVisiting.has(system.id)) return emissionStart(system.config) + firstVisiting.add(system.id) + let first = Infinity + for (const { parent, rule } of parentsOf.get(system.id) || []) { + const parentFirst = subIds.has(parent.id) + ? firstTrigger(parent) + delayOf(parent.config) + : emissionStart(parent.config) + const offset = rule.event === 'death' ? lifeMinOf(parent.config) : 0 + first = Math.min(first, parentFirst + offset) + } + if (!Number.isFinite(first)) first = emissionStart(system.config) + firstVisiting.delete(system.id) + firstCache.set(system.id, first) + return first + } + const lastTrigger = (system: SubEmitterTimingSource): number => { + const cached = lastCache.get(system.id) + if (cached != null) return cached + if (lastVisiting.has(system.id)) return emissionEnd(system.config) + lastVisiting.add(system.id) + let last = -Infinity + for (const { parent, rule } of parentsOf.get(system.id) || []) { + const parentLast = subIds.has(parent.id) + ? lastTrigger(parent) + delayOf(parent.config) + : emissionEnd(parent.config) + const offset = rule.event === 'birth' ? 0 : lifeMaxOf(parent.config) + last = Math.max(last, parentLast + offset) + } + if (!Number.isFinite(last)) last = emissionEnd(system.config) + lastVisiting.delete(system.id) + lastCache.set(system.id, last) + return last + } + + const result = new Map() + for (const id of subIds) { + const system = byId.get(id) + if (!system) continue + const first = firstTrigger(system) + const last = lastTrigger(system) + result.set(id, { + firstTrigger: first, + lastTrigger: last, + end: Math.max(first, last) + lifeMaxOf(system.config), + }) + } + return result +} diff --git a/src/editor/editorConfig.ts b/src/editor/editorConfig.ts index 4185a22..ac0b27c 100644 --- a/src/editor/editorConfig.ts +++ b/src/editor/editorConfig.ts @@ -16,6 +16,8 @@ import { restoreSpineSource } from '../spine/spineSourceBundle' import { registerSpineAsset, releaseSpineAsset } from '../spine/spineAssetRegistry' import { cloneEditorValue } from './editorClone' import { ensureSpineExportSettings } from '../export/spineExportSettings' +import { loopSegmentTiming } from '../core/loopSegmentTiming' +import { lastFrameOfDuration } from '../timeline/playbackRange' type EditorStore = ReturnType @@ -43,6 +45,10 @@ export interface EditorConfigFile { loop: boolean playbackStart?: number playbackEnd?: number + /** B 是否跟随时间轴总长,而不是用户自定义的循环末帧。 */ + playbackEndAuto?: boolean + /** 是否启用独立的 A/B 区间播放。 */ + abLoop?: boolean animations: string[] } selection: { @@ -85,6 +91,7 @@ function withoutLegacyColliderTags(collider: CollisionBody): CollisionBody { export function createEditorConfig(store: EditorStore): EditorConfigFile { const settings = captureProjectSettings(store.settings) + const playbackEndAuto = store.timeline.playbackEnd >= Math.max(1, store.timeline.totalFrames - 1) return jsonClone({ format: EDITOR_CONFIG_FORMAT, version: EDITOR_CONFIG_VERSION, @@ -96,6 +103,8 @@ export function createEditorConfig(store: EditorStore): EditorConfigFile { loop: store.timeline.loop, playbackStart: store.timeline.playbackStart, playbackEnd: store.timeline.playbackEnd, + playbackEndAuto, + abLoop: store.timeline.abLoop, animations: [...store.timeline.animations], }, selection: { @@ -111,6 +120,41 @@ export function createEditorConfig(store: EditorStore): EditorConfigFile { }) } +/** v1 配置没有 playbackEndAuto,用旧版“各系统独立计时”的末帧判断 B 是否为自动全范围。 */ +function legacyPlaybackLastFrame( + systems: ParticleSystem[], + colliders: CollisionBody[], + spines: SpineSceneObject[], + fps: number, +) { + const safeFps = Math.max(1, fps) + let maxSec = 0 + for (const system of systems) { + const c = system.config + const lifeMin = Math.max(0, Number(c.lifeMin) || 0) + const lifeMax = Math.max(0, Number(c.lifeMax) || 0) + const life = c.lifeMode === 'fixed' ? lifeMin : Math.max(lifeMin, lifeMax) + const emissionDuration = c.mode === 'stream' + ? c.streamBehavior === 'loop' + ? loopSegmentTiming(c, safeFps).total / safeFps + : Math.max(1 / safeFps, Number(c.duration) || 0) + : 0 + let end = Math.max(0, Number(c.delay) || 0) + emissionDuration + life + if (c.mode === 'stream' && c.streamBehavior === 'loop') { + end = Math.max(0, Number(c.delay) || 0) + loopSegmentTiming(c, safeFps).total / safeFps + } + maxSec = Math.max(maxSec, end) + } + for (const spine of spines) { + const animation = spine.animations.find((item) => item.name === spine.selectedAnimation) + if (animation) maxSec = Math.max(maxSec, Math.max(0, Number(spine.timeOffset) || 0) + Math.max(0, animation.duration || 0)) + } + for (const collider of colliders) { + if (collider.followPath && collider.followPathId) maxSec = Math.max(maxSec, Math.max(0, collider.followDuration) || 0) + } + return lastFrameOfDuration(maxSec, safeFps) +} + function downloadName() { const stamp = new Date().toISOString().replace(/[-:]/g, '').replace(/\.\d{3}Z$/, '').replace('T', '-') return `SpineParticle-${stamp}.json` @@ -247,6 +291,10 @@ export async function applyEditorConfig(store: EditorStore, input: EditorConfigF store.settings.exportSettings = ensureSpineExportSettings(config.settings?.exportSettings) store.settings.undoLimit = Math.min(200, Math.max(1, Math.round(Number(store.settings.undoLimit) || 20))) store.timeline.fps = Math.max(1, Math.round(Number(config.timeline?.fps) || 30)) + const savedPlaybackEnd = Math.max(1, Math.floor(Number(config.timeline?.playbackEnd) || Number.MAX_SAFE_INTEGER)) + const playbackEndAuto = config.timeline?.playbackEndAuto + ?? savedPlaybackEnd >= legacyPlaybackLastFrame(systems, colliders, spines, store.timeline.fps) + store.timeline.abLoop = config.timeline?.abLoop === true store.timeline.loop = config.timeline?.loop !== false store.timeline.animations = Array.isArray(config.timeline?.animations) && config.timeline.animations.length ? [...new Set(config.timeline.animations.filter((name) => typeof name === 'string' && name.trim()).map((name) => name.trim()))] @@ -279,7 +327,7 @@ export async function applyEditorConfig(store: EditorStore, input: EditorConfigF store.syncSceneSequences() repairSelection(store, config.selection) store.timeline.playbackStart = Math.max(0, Math.floor(Number(config.timeline?.playbackStart) || 0)) - store.timeline.playbackEnd = Math.max(1, Math.floor(Number(config.timeline?.playbackEnd) || Number.MAX_SAFE_INTEGER)) + store.timeline.playbackEnd = savedPlaybackEnd store.timeline.frame = 0 store.timeline.recorded = false store.timeline.playing = true @@ -287,6 +335,7 @@ export async function applyEditorConfig(store: EditorStore, input: EditorConfigF if (!store.timeline.animations.includes(system.animation)) system.animation = store.timeline.animations[0] } store.recalcTotalFrames() + if (playbackEndAuto) store.timeline.playbackEnd = store.timeline.totalFrames - 1 store.timeline.frame = store.timeline.playbackStart return config } diff --git a/src/store/particleStore.ts b/src/store/particleStore.ts index 19d9c96..44e5c54 100644 --- a/src/store/particleStore.ts +++ b/src/store/particleStore.ts @@ -1,11 +1,12 @@ -import { defineStore } from 'pinia' +import { acceptHMRUpdate, defineStore } from 'pinia' import { EmitterConfig, defaultConfig, ensureEmitterConfig, ParticleState, type SceneCollider } from '../core/particleEmitter' import type { SpineSceneObject } from '../spine/spineTypes' import { releaseSpineAsset, retainSpineAsset } from '../spine/spineAssetRegistry' import { cloneEditorValue } from '../editor/editorClone' import { defaultSpineExportSettings, type SpineExportSettings } from '../export/spineExportSettings' import { loopSegmentTiming } from '../core/loopSegmentTiming' -import { lastFrameOfDuration, normalizePlaybackRange, resizePlaybackRange } from '../timeline/playbackRange' +import { collectSubEmitterIds } from '../core/subEmitterIds' +import { lastFrameOfDuration, resizePlaybackRange, resolvePlaybackRange } from '../timeline/playbackRange' export interface ParticleSystem { id: number @@ -98,6 +99,8 @@ export interface TimelineState { /** 自定义播放范围,首尾帧均包含。 */ playbackStart: number playbackEnd: number + /** 是否启用独立的 A/B 区间播放;关闭时播放完整时间轴。 */ + abLoop: boolean /** 帧率 */ fps: number /** 是否已录制 */ @@ -133,7 +136,7 @@ export const useParticleStore = defineStore('particle', { activeObjectType: 'particle' as SceneObjectType, activeObjectId: 0, // 与 Spine 编辑器默认时间基准对齐:1 秒 = 30 帧。 - timeline: { playing: true, loop: true, frame: 0, totalFrames: 60, playbackStart: 0, playbackEnd: 59, fps: 30, recorded: false, animation: 'animation', animations: ['animation'] } as TimelineState, + timeline: { playing: true, loop: true, abLoop: false, frame: 0, totalFrames: 60, playbackStart: 0, playbackEnd: 59, fps: 30, recorded: false, animation: 'animation', animations: ['animation'] } as TimelineState, settings: { parameterPanelOnRight: true, tickEnabled: false, @@ -158,6 +161,12 @@ export const useParticleStore = defineStore('particle', { }), getters: { activeSystemCount: (s) => s.systems.length, + playbackRange: (s) => resolvePlaybackRange( + s.timeline.abLoop, + s.timeline.playbackStart, + s.timeline.playbackEnd, + s.timeline.totalFrames, + ), }, actions: { syncSceneSequences() { @@ -447,7 +456,7 @@ export const useParticleStore = defineStore('particle', { this.recalcTotalFrames() }, play() { - const range = normalizePlaybackRange(this.timeline.playbackStart, this.timeline.playbackEnd, this.timeline.totalFrames) + const range = this.playbackRange if (this.timeline.frame < range.start || this.timeline.frame >= range.end) this.timeline.frame = range.start this.timeline.playing = true }, @@ -456,57 +465,114 @@ export const useParticleStore = defineStore('particle', { if (this.timeline.playing) this.pause() else this.play() }, - toStart() { this.timeline.frame = this.timeline.playbackStart }, + toStart() { this.timeline.frame = this.playbackRange.start }, previousFrame() { this.timeline.playing = false - this.timeline.frame = Math.max(this.timeline.playbackStart, this.timeline.frame - 1) + this.timeline.frame = Math.max(this.playbackRange.start, this.timeline.frame - 1) }, nextFrame() { this.timeline.playing = false - this.timeline.frame = Math.min(this.timeline.playbackEnd, this.timeline.frame + 1) + this.timeline.frame = Math.min(this.playbackRange.end, this.timeline.frame + 1) }, toEnd() { this.timeline.playing = false - this.timeline.frame = this.timeline.playbackEnd + this.timeline.frame = this.playbackRange.end }, toggleLoop() { this.timeline.loop = !this.timeline.loop }, + toggleABLoop() { + this.timeline.abLoop = !this.timeline.abLoop + const range = this.playbackRange + if (this.timeline.frame < range.start || this.timeline.frame > range.end) this.timeline.frame = range.start + }, setFrame(f: number) { this.timeline.frame = Math.max(0, Math.min(f, this.timeline.totalFrames - 1)) }, setPlaybackStart(value: number) { - const range = normalizePlaybackRange(value, this.timeline.playbackEnd, this.timeline.totalFrames) + const range = resolvePlaybackRange(true, value, this.timeline.playbackEnd, this.timeline.totalFrames) this.timeline.playbackStart = range.start this.timeline.playbackEnd = range.end - if (this.timeline.frame < range.start) this.timeline.frame = range.start + if (this.timeline.abLoop && this.timeline.frame < range.start) this.timeline.frame = range.start }, setPlaybackEnd(value: number) { - const range = normalizePlaybackRange(this.timeline.playbackStart, value, this.timeline.totalFrames) + const range = resolvePlaybackRange(true, this.timeline.playbackStart, value, this.timeline.totalFrames) this.timeline.playbackStart = range.start this.timeline.playbackEnd = range.end - if (this.timeline.frame > range.end) this.timeline.frame = range.end + if (this.timeline.abLoop && this.timeline.frame > range.end) this.timeline.frame = range.end }, /** 依据所有粒子系统的"最晚消失时间"重算总帧数。 * 固定生命周期使用 lifeMin;随机生命周期使用上下限中的较大值。 * 单系统总时长 = delay + 持续模式 duration(爆发为 0)+ 最大粒子生命, + * 并递归计入子发射器链(出生立即触发、死亡/碰撞在最晚生命结束时触发)。 * 多系统取最大;转帧 = ceil(sec * fps)。 */ recalcTotalFrames() { - const fps = this.timeline.fps || 30 - let maxSec = 0 - for (const sys of this.systems) { - const c = sys.config + const fps = Math.max(1, this.timeline.fps || 30) + const particleLifeOf = (c: any) => { const lifeMin = Math.max(0, Number(c.lifeMin) || 0) const lifeMax = Math.max(0, Number(c.lifeMax) || 0) - const particleLife = c.lifeMode === 'fixed' - ? lifeMin - : Math.max(lifeMin, lifeMax) - const emissionDuration = c.mode === 'stream' - ? c.streamBehavior === 'loop' - ? Math.max(1 / fps, Math.ceil(Math.max(1, Number(c.loopDurationFrames) || 1)) / fps) + return c.lifeMode === 'fixed' ? lifeMin : Math.max(lifeMin, lifeMax) + } + const byId = new Map(this.systems.map((system) => [system.id, system])) + const tailCache = new Map() + const visiting = new Set() + /** 从一颗粒子出生算起,它及其子发射器链最晚持续多久。 */ + const effectTail = (system: any): number => { + const cached = tailCache.get(system.id) + if (cached != null) return cached + if (visiting.has(system.id)) return 0 + visiting.add(system.id) + const config = system.config + const life = particleLifeOf(config) + let tail = life + if (config.eventEnabled) { + for (const rule of config.events || []) { + const target = byId.get(rule.targetSystemId) + if (!target || target.id === system.id) continue + const childTail = effectTail(target) + // 出生时立即触发;死亡/碰撞最晚发生在父粒子生命结束时。 + const offset = rule.event === 'birth' ? 0 : life + // 子发射器自身的 delay 表示父事件之后再延迟多久发射。 + const targetDelay = Math.max(0, Number(target.config.delay) || 0) + tail = Math.max(tail, offset + targetDelay + childTail) + } + } + visiting.delete(system.id) + tailCache.set(system.id, tail) + return tail + } + + const subEmitterIds = collectSubEmitterIds(this.systems) + let maxSec = 0 + for (const system of this.systems) { + // 子发射器不独立发射,时长通过父系统的 effectTail 计算。 + if (subEmitterIds.has(system.id)) continue + const c = system.config + const delay = Math.max(0, Number(c.delay) || 0) + const isLoop = c.mode === 'stream' && c.streamBehavior === 'loop' + let end: number + if (c.mode === 'stream') { + const emissionDuration = isLoop + ? loopSegmentTiming(c, fps).total / fps : Math.max(1 / fps, Number(c.duration) || 0) - : 0 - let end = Math.max(0, Number(c.delay) || 0) + emissionDuration + particleLife - if (c.mode === 'stream' && c.streamBehavior === 'loop') { - end = Math.max(0, Number(c.delay) || 0) + loopSegmentTiming(c, fps).total / fps + end = delay + emissionDuration + if (isLoop) { + // 循环结束段已包含父系统自身消亡,只追加子发射器链的尾部时长。 + let childTail = 0 + if (c.eventEnabled) { + const life = particleLifeOf(c) + for (const rule of c.events || []) { + const target = byId.get(rule.targetSystemId) + if (!target || target.id === system.id) continue + const targetDelay = Math.max(0, Number(target.config.delay) || 0) + childTail = Math.max(childTail, (rule.event === 'birth' ? 0 : life) + targetDelay + effectTail(target)) + } + } + end += childTail + } else { + end += effectTail(system) + } + } else { + // 爆发:delay 时刻触发一次,之后只计算生命与子发射器链。 + end = delay + effectTail(system) } if (end > maxSec) maxSec = end } @@ -541,3 +607,8 @@ export const useParticleStore = defineStore('particle', { }, }, }) + +// 开发环境接受 Pinia store 热更新,避免动作改动后仍执行旧引用(保留当前场景状态)。 +if (import.meta.hot) { + import.meta.hot.accept(acceptHMRUpdate(useParticleStore, import.meta.hot)) +} diff --git a/src/timeline/playbackRange.ts b/src/timeline/playbackRange.ts index 1367608..d6e0a83 100644 --- a/src/timeline/playbackRange.ts +++ b/src/timeline/playbackRange.ts @@ -29,6 +29,12 @@ export function normalizePlaybackRange(start: unknown, end: unknown, totalFrames return { start: safeStart, end: safeEnd } } +/** AB 关闭时始终使用完整时间轴,A/B 只是保留给下次开启。 */ +export function resolvePlaybackRange(abLoop: boolean, start: unknown, end: unknown, totalFrames: number) { + const last = Math.max(1, Math.floor(totalFrames) - 1) + return normalizePlaybackRange(abLoop ? start : 0, abLoop ? end : last, totalFrames) +} + export function resizePlaybackRange(range: PlaybackRange, previousTotal: number, nextTotal: number) { const previousLast = Math.max(1, previousTotal - 1) const nextLast = Math.max(1, nextTotal - 1) diff --git a/src/views/Stage.vue b/src/views/Stage.vue index 43f0315..1056076 100644 --- a/src/views/Stage.vue +++ b/src/views/Stage.vue @@ -37,6 +37,7 @@ import { Application, Container, Graphics, type Text, type Texture } from 'pixi. import { ParticleEmitter, ensureEmitterConfig, type ParticleState } from '../core/particleEmitter' import { bakeLoopFrames } from '../core/loopFrameBaker' import { loopPlaybackRange } from '../core/loopSegmentTiming' +import { collectSubEmitterIds } from '../core/subEmitterIds' import { useParticleStore, type CollisionBody, type ParticleSystem } from '../store/particleStore' import { SpineRuntimeLayer } from '../spine/SpineRuntimeLayer' import { installEditorHistory, undoLastOperation } from '../editor/editorHistory' @@ -220,12 +221,21 @@ function bakeSystemFrames(system: ParticleSystem, emitter: ParticleEmitter, fps: */ function ensureFramesBaked(fps: number) { const totalFrames = Math.max(2, Math.floor(store.timeline.totalFrames) || 2) + const subEmitterIds = collectSubEmitterIds(store.systems) let complete = true - for (const system of store.systems) { - if ((system.frames?.length || 0) >= totalFrames) continue - const emitter = emitterSync.emitters.get(system.id) - if (!emitter) { complete = false; continue } - bakeSystemFrames(system as unknown as ParticleSystem, emitter, fps, totalFrames) + // 烘焙预热会大量出生/死亡粒子,期间暂停跨系统事件,避免注入预热粒子。 + emitterSync.suspendEvents(true) + try { + for (const system of store.systems) { + // 子发射器由父粒子事件驱动,不能脱离父系统单独烘焙。 + if (subEmitterIds.has(system.id)) continue + if ((system.frames?.length || 0) >= totalFrames) continue + const emitter = emitterSync.emitters.get(system.id) + if (!emitter) { complete = false; continue } + bakeSystemFrames(system as unknown as ParticleSystem, emitter, fps, totalFrames) + } + } finally { + emitterSync.suspendEvents(false) } if (complete) store.timeline.recorded = true } @@ -351,6 +361,7 @@ function loop() { appendStateBones(collected, state, emitter.position.x, emitter.position.y) } const tl = store.timeline + const playbackRange = store.playbackRange const fps = tl.fps const frameDuration = 1 / Math.max(1, fps) let displayFrame = timelineDisplayFrame @@ -376,18 +387,26 @@ function loop() { total = 0 if (!tl.recorded) { // 录制阶段:固定步长模拟并记录当前帧。 - for (const sys of store.systems) { - const emitter = emitterSync.emitters.get(sys.id) - if (!emitter) continue - const isLoopStream = sys.config.mode === 'stream' && sys.config.streamBehavior === 'loop' - // 循环持续是一次性烘焙:只要缓存还没有就补上。录制不一定从第 0 帧开始 - // (播放头可能被播放范围钳到 A 帧),只按 tl.frame === 0 判断会漏烘焙, - // 导致整段回放都没有可用帧。 - if (isLoopStream) { - if (!sys.frames?.length) bakeLoopFrames(sys as unknown as ParticleSystem, emitter, fps, tl.totalFrames) - } else if (tl.frame === 0) { - emitter.reset() + emitterSync.suspendEvents(true) + try { + const subEmitterIds = collectSubEmitterIds(store.systems) + for (const sys of store.systems) { + const emitter = emitterSync.emitters.get(sys.id) + if (!emitter) continue + const isLoopStream = !subEmitterIds.has(sys.id) + && sys.config.mode === 'stream' + && sys.config.streamBehavior === 'loop' + // 循环持续是一次性烘焙:只要缓存还没有就补上。录制不一定从第 0 帧开始 + // (播放头可能被播放范围钳到 A 帧),只按 tl.frame === 0 判断会漏烘焙, + // 导致整段回放都没有可用帧。 + if (isLoopStream) { + if (!sys.frames?.length) bakeLoopFrames(sys as unknown as ParticleSystem, emitter, fps, tl.totalFrames) + } else if (tl.frame === 0) { + emitter.reset() + } } + } finally { + emitterSync.suspendEvents(false) } for (const [systemId, em] of emitterSync.emitters) { const system = store.systems.find((item) => item.id === systemId) @@ -412,7 +431,7 @@ function loop() { } tl.frame++ if (tl.frame >= tl.totalFrames) { - tl.frame = tl.playbackStart + tl.frame = playbackRange.start tl.recorded = true } } else { @@ -435,13 +454,13 @@ function loop() { : null // 烘焙数据保留“末帧 = 首帧”以便导出闭环。预览精确循环段时,末帧只作为 // 数学边界,不再与下一轮首帧连续显示两次,避免衔接处停顿一帧。 - const closesActiveLoop = tl.loop - && activeLoopRange?.start === tl.playbackStart - && activeLoopRange.end === tl.playbackEnd - const playbackLastFrame = closesActiveLoop ? tl.playbackEnd - 1 : tl.playbackEnd + const closesActiveLoop = tl.loop && tl.abLoop + && activeLoopRange?.start === playbackRange.start + && activeLoopRange.end === playbackRange.end + const playbackLastFrame = closesActiveLoop ? playbackRange.end - 1 : playbackRange.end if (tl.frame > playbackLastFrame) { - if (tl.loop) tl.frame = tl.playbackStart - else { tl.frame = tl.playbackEnd; tl.playing = false; break } + if (tl.loop) tl.frame = playbackRange.start + else { tl.frame = playbackRange.end; tl.playing = false; break } } } } diff --git a/src/views/Timeline.vue b/src/views/Timeline.vue index 1174cc9..8caeb61 100644 --- a/src/views/Timeline.vue +++ b/src/views/Timeline.vue @@ -9,10 +9,17 @@ - - - - + +
+ +
+
AB 循环区间
+ + +
+
帧 {{ store.timeline.frame }} / {{ Math.max(0, store.timeline.totalFrames - 1) }} 持续发射 粒子存在 Spine 动画
@@ -84,23 +91,24 @@
- ● + ●
{{ (sys.config as any).name || '系统 ' + (i + 1) }} - -