spine-runtimes/spine-ts/spine-phaser-v3/dist/esm/spine-phaser-v3.mjs.map

8 lines
1.0 MiB

{
"version": 3,
"sources": ["../../src/require-shim.ts", "../../src/SpinePlugin.ts", "../../src/keys.ts", "../../../spine-core/src/Utils.ts", "../../../spine-core/src/attachments/Attachment.ts", "../../../spine-core/src/attachments/Sequence.ts", "../../../spine-core/src/Animation.ts", "../../../spine-core/src/AnimationState.ts", "../../../spine-core/src/AnimationStateData.ts", "../../../spine-core/src/attachments/BoundingBoxAttachment.ts", "../../../spine-core/src/attachments/ClippingAttachment.ts", "../../../spine-core/src/Texture.ts", "../../../spine-core/src/TextureAtlas.ts", "../../../spine-core/src/attachments/MeshAttachment.ts", "../../../spine-core/src/attachments/PathAttachment.ts", "../../../spine-core/src/attachments/PointAttachment.ts", "../../../spine-core/src/attachments/RegionAttachment.ts", "../../../spine-core/src/AtlasAttachmentLoader.ts", "../../../spine-core/src/BoneData.ts", "../../../spine-core/src/Bone.ts", "../../../spine-core/src/ConstraintData.ts", "../../../spine-core/src/AssetManagerBase.ts", "../../../spine-core/src/Event.ts", "../../../spine-core/src/EventData.ts", "../../../spine-core/src/IkConstraint.ts", "../../../spine-core/src/IkConstraintData.ts", "../../../spine-core/src/PathConstraintData.ts", "../../../spine-core/src/PathConstraint.ts", "../../../spine-core/src/PhysicsConstraint.ts", "../../../spine-core/src/Slot.ts", "../../../spine-core/src/TransformConstraint.ts", "../../../spine-core/src/Skeleton.ts", "../../../spine-core/src/PhysicsConstraintData.ts", "../../../spine-core/src/SkeletonData.ts", "../../../spine-core/src/Skin.ts", "../../../spine-core/src/SlotData.ts", "../../../spine-core/src/TransformConstraintData.ts", "../../../spine-core/src/SkeletonBinary.ts", "../../../spine-core/src/SkeletonBounds.ts", "../../../spine-core/src/Triangulator.ts", "../../../spine-core/src/SkeletonClipping.ts", "../../../spine-core/src/SkeletonJson.ts", "../../../spine-core/src/polyfills.ts", "../../../spine-webgl/src/WebGL.ts", "../../../spine-webgl/src/GLTexture.ts", "../../../spine-webgl/src/AssetManager.ts", "../../../spine-webgl/src/Vector3.ts", "../../../spine-webgl/src/Matrix4.ts", "../../../spine-webgl/src/Camera.ts", "../../../spine-webgl/src/Input.ts", "../../../spine-webgl/src/CameraController.ts", "../../../spine-webgl/src/Shader.ts", "../../../spine-webgl/src/Mesh.ts", "../../../spine-webgl/src/PolygonBatcher.ts", "../../../spine-webgl/src/ShapeRenderer.ts", "../../../spine-webgl/src/SkeletonDebugRenderer.ts", "../../../spine-webgl/src/SkeletonRenderer.ts", "../../../spine-webgl/src/SceneRenderer.ts", "../../../spine-webgl/src/LoadingScreen.ts", "../../../spine-webgl/src/SpineCanvas.ts", "../../src/mixins.ts", "../../src/SpineGameObject.ts", "../../../spine-canvas/src/CanvasTexture.ts", "../../../spine-canvas/src/SkeletonRenderer.ts", "../../src/index.ts"],
"sourcesContent": ["/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\ndeclare global {\n\tvar require: any;\n}\nif (typeof window !== 'undefined' && window.Phaser) {\n\tlet prevRequire = window.require;\n\twindow.require = (x: string) => {\n\t\tif (prevRequire) return prevRequire(x);\n\t\telse if (x === \"Phaser\") return window.Phaser;\n\t}\n}\nexport { }\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport * as Phaser from \"phaser\";\nimport { SPINE_ATLAS_CACHE_KEY, SPINE_GAME_OBJECT_TYPE, SPINE_SKELETON_DATA_FILE_TYPE, SPINE_ATLAS_FILE_TYPE, SPINE_SKELETON_FILE_CACHE_KEY as SPINE_SKELETON_DATA_CACHE_KEY } from \"./keys.js\";\nimport { AtlasAttachmentLoader, GLTexture, SceneRenderer, Skeleton, SkeletonBinary, SkeletonData, SkeletonJson, TextureAtlas } from \"@esotericsoftware/spine-webgl\"\nimport { SpineGameObject, SpineGameObjectBoundsProvider } from \"./SpineGameObject.js\";\nimport { CanvasTexture, SkeletonRenderer } from \"@esotericsoftware/spine-canvas\";\n\n/**\n * Configuration object used when creating {@link SpineGameObject} instances via a scene's\n * {@link GameObjectCreator} (`Scene.make`).\n */\nexport interface SpineGameObjectConfig extends Phaser.Types.GameObjects.GameObjectConfig {\n\t/** The x-position of the object, optional, default: 0 */\n\tx?: number,\n\t/** The y-position of the object, optional, default: 0 */\n\ty?: number,\n\t/** The skeleton data key */\n\tdataKey: string,\n\t/** The atlas key */\n\tatlasKey: string\n\t/** The bounds provider, optional, default: `SetupPoseBoundsProvider` */\n\tboundsProvider?: SpineGameObjectBoundsProvider\n}\n\n/**\n * {@link ScenePlugin} implementation adding Spine Runtime capabilities to a scene.\n *\n * The scene's {@link LoaderPlugin} (`Scene.load`) gets these additional functions:\n * * `spineBinary(key: string, url: string, xhrSettings?: XHRSettingsObject)`: loads a skeleton binary `.skel` file from the `url`.\n * * `spineJson(key: string, url: string, xhrSettings?: XHRSettingsObject)`: loads a skeleton binary `.skel` file from the `url`.\n * * `spineAtlas(key: string, url: string, premultipliedAlpha: boolean = true, xhrSettings?: XHRSettingsObject)`: loads a texture atlas `.atlas` file from the `url` as well as its correponding texture atlas page images.\n *\n * The scene's {@link GameObjectFactory} (`Scene.add`) gets these additional functions:\n * * `spine(x: number, y: number, dataKey: string, atlasKey: string, boundsProvider: SpineGameObjectBoundsProvider = SetupPoseBoundsProvider())`:\n * creates a new {@link SpineGameObject} from the data and atlas at position `(x, y)`, using the {@link BoundsProvider} to calculate its bounding box. The object is automatically added to the scene.\n *\n * The scene's {@link GameObjectCreator} (`Scene.make`) gets these additional functions:\n * * `spine(config: SpineGameObjectConfig)`: creates a new {@link SpineGameObject} from the given configuration object.\n *\n * The plugin has additional public methods to work with Spine Runtime core API objects:\n * * `getAtlas(atlasKey: string)`: returns the {@link TextureAtlas} instance for the given atlas key.\n * * `getSkeletonData(skeletonDataKey: string)`: returns the {@link SkeletonData} instance for the given skeleton data key.\n * * `createSkeleton(skeletonDataKey: string, atlasKey: string, premultipliedAlpha: boolean = true)`: creates a new {@link Skeleton} instance from the given skeleton data and atlas key.\n * * `isPremultipliedAlpha(atlasKey: string)`: returns `true` if the atlas with the given key has premultiplied alpha.\n */\nexport class SpinePlugin extends Phaser.Plugins.ScenePlugin {\n\tgame: Phaser.Game;\n\tprivate isWebGL: boolean;\n\tgl: WebGLRenderingContext | null;\n\tstatic gameWebGLRenderer: SceneRenderer | null = null;\n\tget webGLRenderer (): SceneRenderer | null {\n\t\treturn SpinePlugin.gameWebGLRenderer;\n\t}\n\tcanvasRenderer: SkeletonRenderer | null;\n\tphaserRenderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer;\n\tprivate skeletonDataCache: Phaser.Cache.BaseCache;\n\tprivate atlasCache: Phaser.Cache.BaseCache;\n\n\tconstructor (scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n\t\tsuper(scene, pluginManager, pluginKey);\n\t\tthis.game = pluginManager.game;\n\t\tthis.isWebGL = this.game.config.renderType === 2;\n\t\tthis.gl = this.isWebGL ? (this.game.renderer as Phaser.Renderer.WebGL.WebGLRenderer).gl : null;\n\t\tthis.phaserRenderer = this.game.renderer;\n\t\tthis.canvasRenderer = null;\n\t\tthis.skeletonDataCache = this.game.cache.addCustom(SPINE_SKELETON_DATA_CACHE_KEY);\n\t\tthis.atlasCache = this.game.cache.addCustom(SPINE_ATLAS_CACHE_KEY);\n\n\t\tlet skeletonJsonFileCallback = function (this: any, key: string,\n\t\t\turl: string,\n\t\t\txhrSettings: Phaser.Types.Loader.XHRSettingsObject) {\n\t\t\tlet file = new SpineSkeletonDataFile(this as any, key, url, SpineSkeletonDataFileType.json, xhrSettings);\n\t\t\tthis.addFile(file.files);\n\t\t\treturn this;\n\t\t};\n\t\tpluginManager.registerFileType(\"spineJson\", skeletonJsonFileCallback, scene);\n\n\t\tlet skeletonBinaryFileCallback = function (this: any, key: string,\n\t\t\turl: string,\n\t\t\txhrSettings: Phaser.Types.Loader.XHRSettingsObject) {\n\t\t\tlet file = new SpineSkeletonDataFile(this as any, key, url, SpineSkeletonDataFileType.binary, xhrSettings);\n\t\t\tthis.addFile(file.files);\n\t\t\treturn this;\n\t\t};\n\t\tpluginManager.registerFileType(\"spineBinary\", skeletonBinaryFileCallback, scene);\n\n\t\tlet atlasFileCallback = function (this: any, key: string,\n\t\t\turl: string,\n\t\t\tpremultipliedAlpha: boolean,\n\t\t\txhrSettings: Phaser.Types.Loader.XHRSettingsObject) {\n\t\t\tlet file = new SpineAtlasFile(this as any, key, url, premultipliedAlpha, xhrSettings);\n\t\t\tthis.addFile(file.files);\n\t\t\treturn this;\n\t\t};\n\t\tpluginManager.registerFileType(\"spineAtlas\", atlasFileCallback, scene);\n\n\t\tlet addSpineGameObject = function (this: Phaser.GameObjects.GameObjectFactory, x: number, y: number, dataKey: string, atlasKey: string, boundsProvider: SpineGameObjectBoundsProvider) {\n\t\t\tif (this.scene.sys.renderer instanceof Phaser.Renderer.WebGL.WebGLRenderer) {\n\t\t\t\tthis.scene.sys.renderer.pipelines.clear();\n\t\t\t}\n\n\t\t\tconst spinePlugin = (this.scene.sys as any)[pluginKey] as SpinePlugin;\n\t\t\tlet gameObject = new SpineGameObject(this.scene, spinePlugin, x, y, dataKey, atlasKey, boundsProvider);\n\t\t\tthis.displayList.add(gameObject);\n\t\t\tthis.updateList.add(gameObject);\n\n\t\t\tif (this.scene.sys.renderer instanceof Phaser.Renderer.WebGL.WebGLRenderer) {\n\t\t\t\tthis.scene.sys.renderer.pipelines.rebind();\n\t\t\t}\n\n\t\t\treturn gameObject;\n\t\t};\n\n\t\tlet makeSpineGameObject = function (this: Phaser.GameObjects.GameObjectFactory, config: SpineGameObjectConfig, addToScene: boolean = false) {\n\t\t\tif (this.scene.sys.renderer instanceof Phaser.Renderer.WebGL.WebGLRenderer) {\n\t\t\t\tthis.scene.sys.renderer.pipelines.clear();\n\t\t\t}\n\n\t\t\tlet x = config.x ? config.x : 0;\n\t\t\tlet y = config.y ? config.y : 0;\n\t\t\tlet boundsProvider = config.boundsProvider ? config.boundsProvider : undefined;\n\n\t\t\tconst spinePlugin = (this.scene.sys as any)[pluginKey] as SpinePlugin;\n\t\t\tlet gameObject = new SpineGameObject(this.scene, spinePlugin, x, y, config.dataKey, config.atlasKey, boundsProvider);\n\t\t\tif (addToScene !== undefined) {\n\t\t\t\tconfig.add = addToScene;\n\t\t\t}\n\n\t\t\tif (this.scene.sys.renderer instanceof Phaser.Renderer.WebGL.WebGLRenderer) {\n\t\t\t\tthis.scene.sys.renderer.pipelines.rebind();\n\t\t\t}\n\n\t\t\treturn Phaser.GameObjects.BuildGameObject(this.scene, gameObject, config);\n\t\t}\n\t\tpluginManager.registerGameObject((window as any).SPINE_GAME_OBJECT_TYPE ? (window as any).SPINE_GAME_OBJECT_TYPE : SPINE_GAME_OBJECT_TYPE, addSpineGameObject, makeSpineGameObject);\n\t}\n\n\tstatic rendererId = 0;\n\tboot () {\n\t\tSkeleton.yDown = true;\n\t\tif (this.isWebGL) {\n\t\t\tif (!SpinePlugin.gameWebGLRenderer) {\n\t\t\t\tSpinePlugin.gameWebGLRenderer = new SceneRenderer((this.game.renderer! as Phaser.Renderer.WebGL.WebGLRenderer).canvas, this.gl!, true);\n\t\t\t}\n\t\t\tthis.onResize();\n\t\t\tthis.game.scale.on(Phaser.Scale.Events.RESIZE, this.onResize, this);\n\t\t} else {\n\t\t\tif (!this.canvasRenderer) {\n\t\t\t\tthis.canvasRenderer = new SkeletonRenderer(this.scene!.sys.context);\n\t\t\t}\n\t\t}\n\n\t\tvar eventEmitter = this.systems!.events;\n\t\teventEmitter.once('shutdown', this.shutdown, this);\n\t\teventEmitter.once('destroy', this.destroy, this);\n\t\tthis.game.events.once('destroy', this.gameDestroy, this);\n\t}\n\n\tonResize () {\n\t\tvar phaserRenderer = this.game.renderer;\n\t\tvar sceneRenderer = this.webGLRenderer;\n\n\t\tif (phaserRenderer && sceneRenderer) {\n\t\t\tvar viewportWidth = phaserRenderer.width;\n\t\t\tvar viewportHeight = phaserRenderer.height;\n\t\t\tsceneRenderer.camera.position.x = viewportWidth / 2;\n\t\t\tsceneRenderer.camera.position.y = viewportHeight / 2;\n\t\t\tsceneRenderer.camera.up.y = -1;\n\t\t\tsceneRenderer.camera.direction.z = 1;\n\t\t\tsceneRenderer.camera.setViewport(viewportWidth, viewportHeight);\n\t\t}\n\t}\n\n\tshutdown () {\n\t\tthis.systems!.events.off(\"shutdown\", this.shutdown, this);\n\t\tif (this.isWebGL) {\n\t\t\tthis.game.scale.off(Phaser.Scale.Events.RESIZE, this.onResize, this);\n\t\t}\n\t}\n\n\tdestroy () {\n\t\tthis.shutdown()\n\t}\n\n\tgameDestroy () {\n\t\tthis.pluginManager.removeGameObject((window as any).SPINE_GAME_OBJECT_TYPE ? (window as any).SPINE_GAME_OBJECT_TYPE : SPINE_GAME_OBJECT_TYPE, true, true);\n\t\tif (this.webGLRenderer) this.webGLRenderer.dispose();\n\t\tSpinePlugin.gameWebGLRenderer = null;\n\t}\n\n\t/** Returns the TextureAtlas instance for the given key */\n\tgetAtlas (atlasKey: string) {\n\t\tlet atlas: TextureAtlas;\n\t\tif (this.atlasCache.exists(atlasKey)) {\n\t\t\tatlas = this.atlasCache.get(atlasKey);\n\t\t} else {\n\t\t\tlet atlasFile = this.game.cache.text.get(atlasKey) as { data: string, premultipliedAlpha: boolean };\n\t\t\tatlas = new TextureAtlas(atlasFile.data);\n\t\t\tif (this.isWebGL) {\n\t\t\t\tlet gl = this.gl!;\n\t\t\t\tconst phaserUnpackPmaValue = gl.getParameter(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL);\n\t\t\t\tif (phaserUnpackPmaValue) gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n\t\t\t\tfor (let atlasPage of atlas.pages) {\n\t\t\t\t\tatlasPage.setTexture(new GLTexture(gl, this.game.textures.get(atlasKey + \"!\" + atlasPage.name).getSourceImage() as HTMLImageElement | ImageBitmap, false));\n\t\t\t\t}\n\t\t\t\tif (phaserUnpackPmaValue) gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\t\t\t} else {\n\t\t\t\tfor (let atlasPage of atlas.pages) {\n\t\t\t\t\tatlasPage.setTexture(new CanvasTexture(this.game.textures.get(atlasKey + \"!\" + atlasPage.name).getSourceImage() as HTMLImageElement | ImageBitmap));\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.atlasCache.add(atlasKey, atlas);\n\t\t}\n\t\treturn atlas;\n\t}\n\n\t/** Returns whether the TextureAtlas uses premultiplied alpha */\n\tisAtlasPremultiplied (atlasKey: string) {\n\t\tlet atlasFile = this.game.cache.text.get(atlasKey);\n\t\tif (!atlasFile) return false;\n\t\treturn atlasFile.premultipliedAlpha;\n\t}\n\n\t/** Returns the SkeletonData instance for the given data and atlas key */\n\tgetSkeletonData (dataKey: string, atlasKey: string) {\n\t\tconst atlas = this.getAtlas(atlasKey)\n\t\tconst combinedKey = dataKey + atlasKey;\n\t\tlet skeletonData: SkeletonData;\n\t\tif (this.skeletonDataCache.exists(combinedKey)) {\n\t\t\tskeletonData = this.skeletonDataCache.get(combinedKey);\n\t\t} else {\n\t\t\tif (this.game.cache.json.exists(dataKey)) {\n\t\t\t\tlet jsonFile = this.game.cache.json.get(dataKey) as any;\n\t\t\t\tlet json = new SkeletonJson(new AtlasAttachmentLoader(atlas));\n\t\t\t\tskeletonData = json.readSkeletonData(jsonFile);\n\t\t\t} else {\n\t\t\t\tlet binaryFile = this.game.cache.binary.get(dataKey) as ArrayBuffer;\n\t\t\t\tlet binary = new SkeletonBinary(new AtlasAttachmentLoader(atlas));\n\t\t\t\tskeletonData = binary.readSkeletonData(new Uint8Array(binaryFile));\n\t\t\t}\n\t\t\tthis.skeletonDataCache.add(combinedKey, skeletonData);\n\t\t}\n\t\treturn skeletonData;\n\t}\n\n\t/** Creates a new Skeleton instance from the data and atlas. */\n\tcreateSkeleton (dataKey: string, atlasKey: string) {\n\t\treturn new Skeleton(this.getSkeletonData(dataKey, atlasKey));\n\t}\n}\n\nenum SpineSkeletonDataFileType {\n\tjson,\n\tbinary\n}\n\ninterface SpineSkeletonDataFileConfig {\n\tkey: string;\n\turl: string;\n\ttype: \"spineJson\" | \"spineBinary\";\n\txhrSettings?: Phaser.Types.Loader.XHRSettingsObject\n}\n\nclass SpineSkeletonDataFile extends Phaser.Loader.MultiFile {\n\tconstructor (loader: Phaser.Loader.LoaderPlugin, key: string | SpineSkeletonDataFileConfig, url?: string, public fileType?: SpineSkeletonDataFileType, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject) {\n\t\tif (typeof key !== \"string\") {\n\t\t\tconst config = key;\n\t\t\tkey = config.key;\n\t\t\turl = config.url;\n\t\t\tfileType = config.type === \"spineJson\" ? SpineSkeletonDataFileType.json : SpineSkeletonDataFileType.binary;\n\t\t\txhrSettings = config.xhrSettings;\n\t\t}\n\t\tlet file = null;\n\t\tlet isJson = fileType == SpineSkeletonDataFileType.json;\n\t\tif (isJson) {\n\t\t\tfile = new Phaser.Loader.FileTypes.JSONFile(loader, {\n\t\t\t\tkey: key,\n\t\t\t\turl: url,\n\t\t\t\textension: \"json\",\n\t\t\t\txhrSettings: xhrSettings,\n\t\t\t} as Phaser.Types.Loader.FileTypes.JSONFileConfig);\n\t\t} else {\n\t\t\tfile = new Phaser.Loader.FileTypes.BinaryFile(loader, {\n\t\t\t\tkey: key,\n\t\t\t\turl: url,\n\t\t\t\textension: \"skel\",\n\t\t\t\txhrSettings: xhrSettings,\n\t\t\t} as Phaser.Types.Loader.FileTypes.BinaryFileConfig);\n\t\t}\n\t\tsuper(loader, SPINE_SKELETON_DATA_FILE_TYPE, key, [file]);\n\t}\n\n\tonFileComplete (file: Phaser.Loader.File) {\n\t\tthis.pending--;\n\t}\n\n\taddToCache () {\n\t\tif (this.isReadyToProcess()) this.files[0].addToCache();\n\t}\n}\n\ninterface SpineAtlasFileConfig {\n\tkey: string;\n\turl: string;\n\tpremultipliedAlpha?: boolean;\n\txhrSettings?: Phaser.Types.Loader.XHRSettingsObject;\n}\n\nclass SpineAtlasFile extends Phaser.Loader.MultiFile {\n\tconstructor (loader: Phaser.Loader.LoaderPlugin, key: string | SpineAtlasFileConfig, url?: string, public premultipliedAlpha?: boolean, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject) {\n\t\tif (typeof key !== \"string\") {\n\t\t\tconst config = key;\n\t\t\tkey = config.key;\n\t\t\turl = config.url;\n\t\t\tpremultipliedAlpha = config.premultipliedAlpha;\n\t\t\txhrSettings = config.xhrSettings;\n\t\t}\n\n\t\tsuper(loader, SPINE_ATLAS_FILE_TYPE, key, [\n\t\t\tnew Phaser.Loader.FileTypes.TextFile(loader, {\n\t\t\t\tkey: key,\n\t\t\t\turl: url,\n\t\t\t\txhrSettings: xhrSettings,\n\t\t\t\textension: \"atlas\"\n\t\t\t})\n\t\t]);\n\t}\n\n\tonFileComplete (file: Phaser.Loader.File) {\n\t\tif (this.files.indexOf(file) != -1) {\n\t\t\tthis.pending--;\n\n\t\t\tif (file.type == \"text\") {\n\t\t\t\tvar lines = file.data.split(/\\r\\n|\\r|\\n/);\n\t\t\t\tlet textures = [];\n\t\t\t\ttextures.push(lines[0]);\n\t\t\t\tfor (var t = 1; t < lines.length; t++) {\n\t\t\t\t\tvar line = lines[t];\n\t\t\t\t\tif (line.trim() === '' && t < lines.length - 1) {\n\t\t\t\t\t\tline = lines[t + 1];\n\t\t\t\t\t\ttextures.push(line);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet basePath = file.src.match(/^.*\\//) ?? \"\";\n\t\t\t\tfor (var i = 0; i < textures.length; i++) {\n\t\t\t\t\tvar url = basePath + textures[i];\n\t\t\t\t\tvar key = file.key + \"!\" + textures[i];\n\t\t\t\t\tvar image = new Phaser.Loader.FileTypes.ImageFile(this.loader, key, url);\n\n\t\t\t\t\tif (!this.loader.keyExists(image)) {\n\t\t\t\t\t\tthis.addToMultiFile(image);\n\t\t\t\t\t\tthis.loader.addFile(image);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\taddToCache () {\n\t\tif (this.isReadyToProcess()) {\n\t\t\tlet textureManager = this.loader.textureManager;\n\t\t\tfor (let file of this.files) {\n\t\t\t\tif (file.type == \"image\") {\n\t\t\t\t\tif (!textureManager.exists(file.key)) {\n\t\t\t\t\t\ttextureManager.addImage(file.key, file.data);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.premultipliedAlpha = this.premultipliedAlpha ?? (file.data.indexOf(\"pma: true\") >= 0 || file.data.indexOf(\"pma:true\") >= 0);\n\t\t\t\t\tfile.data = {\n\t\t\t\t\t\tdata: file.data,\n\t\t\t\t\t\tpremultipliedAlpha: this.premultipliedAlpha,\n\t\t\t\t\t};\n\t\t\t\t\tfile.addToCache();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport const SPINE_SKELETON_FILE_CACHE_KEY = \"esotericsoftware.spine.skeletonFile.cache\";\nexport const SPINE_ATLAS_CACHE_KEY = \"esotericsoftware.spine.atlas.cache\";\nexport const SPINE_LOADER_TYPE = \"spine\";\nexport const SPINE_SKELETON_DATA_FILE_TYPE = \"spineSkeletonData\";\nexport const SPINE_ATLAS_FILE_TYPE = \"spineAtlasData\";\nexport const SPINE_GAME_OBJECT_TYPE = \"spine\";\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Skeleton } from \"./Skeleton.js\";\nimport { MixBlend } from \"./Animation.js\";\n\nexport interface StringMap<T> {\n\t[key: string]: T;\n}\n\nexport class IntSet {\n\tarray = new Array<number | undefined>();\n\n\tadd (value: number): boolean {\n\t\tlet contains = this.contains(value);\n\t\tthis.array[value | 0] = value | 0;\n\t\treturn !contains;\n\t}\n\n\tcontains (value: number) {\n\t\treturn this.array[value | 0] != undefined;\n\t}\n\n\tremove (value: number) {\n\t\tthis.array[value | 0] = undefined;\n\t}\n\n\tclear () {\n\t\tthis.array.length = 0;\n\t}\n}\n\nexport class StringSet {\n\tentries: StringMap<boolean> = {};\n\tsize = 0;\n\n\tadd (value: string): boolean {\n\t\tlet contains = this.entries[value];\n\t\tthis.entries[value] = true;\n\t\tif (!contains) {\n\t\t\tthis.size++;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\taddAll (values: string[]): boolean {\n\t\tlet oldSize = this.size;\n\t\tfor (var i = 0, n = values.length; i < n; i++)\n\t\t\tthis.add(values[i]);\n\t\treturn oldSize != this.size;\n\t}\n\n\tcontains (value: string) {\n\t\treturn this.entries[value];\n\t}\n\n\tclear () {\n\t\tthis.entries = {};\n\t\tthis.size = 0;\n\t}\n}\n\nexport type NumberArrayLike = Array<number> | Float32Array;\nexport type IntArrayLike = Array<number> | Int16Array;\n\nexport interface Disposable {\n\tdispose (): void;\n}\n\nexport interface Restorable {\n\trestore (): void;\n}\n\nexport class Color {\n\tpublic static WHITE = new Color(1, 1, 1, 1);\n\tpublic static RED = new Color(1, 0, 0, 1);\n\tpublic static GREEN = new Color(0, 1, 0, 1);\n\tpublic static BLUE = new Color(0, 0, 1, 1);\n\tpublic static MAGENTA = new Color(1, 0, 1, 1);\n\n\tconstructor (public r: number = 0, public g: number = 0, public b: number = 0, public a: number = 0) {\n\t}\n\n\tset (r: number, g: number, b: number, a: number) {\n\t\tthis.r = r;\n\t\tthis.g = g;\n\t\tthis.b = b;\n\t\tthis.a = a;\n\t\treturn this.clamp();\n\t}\n\n\tsetFromColor (c: Color) {\n\t\tthis.r = c.r;\n\t\tthis.g = c.g;\n\t\tthis.b = c.b;\n\t\tthis.a = c.a;\n\t\treturn this;\n\t}\n\n\tsetFromString (hex: string) {\n\t\thex = hex.charAt(0) == '#' ? hex.substr(1) : hex;\n\t\tthis.r = parseInt(hex.substr(0, 2), 16) / 255;\n\t\tthis.g = parseInt(hex.substr(2, 2), 16) / 255;\n\t\tthis.b = parseInt(hex.substr(4, 2), 16) / 255;\n\t\tthis.a = hex.length != 8 ? 1 : parseInt(hex.substr(6, 2), 16) / 255;\n\t\treturn this;\n\t}\n\n\tadd (r: number, g: number, b: number, a: number) {\n\t\tthis.r += r;\n\t\tthis.g += g;\n\t\tthis.b += b;\n\t\tthis.a += a;\n\t\treturn this.clamp();\n\t}\n\n\tclamp () {\n\t\tif (this.r < 0) this.r = 0;\n\t\telse if (this.r > 1) this.r = 1;\n\n\t\tif (this.g < 0) this.g = 0;\n\t\telse if (this.g > 1) this.g = 1;\n\n\t\tif (this.b < 0) this.b = 0;\n\t\telse if (this.b > 1) this.b = 1;\n\n\t\tif (this.a < 0) this.a = 0;\n\t\telse if (this.a > 1) this.a = 1;\n\t\treturn this;\n\t}\n\n\tstatic rgba8888ToColor (color: Color, value: number) {\n\t\tcolor.r = ((value & 0xff000000) >>> 24) / 255;\n\t\tcolor.g = ((value & 0x00ff0000) >>> 16) / 255;\n\t\tcolor.b = ((value & 0x0000ff00) >>> 8) / 255;\n\t\tcolor.a = ((value & 0x000000ff)) / 255;\n\t}\n\n\tstatic rgb888ToColor (color: Color, value: number) {\n\t\tcolor.r = ((value & 0x00ff0000) >>> 16) / 255;\n\t\tcolor.g = ((value & 0x0000ff00) >>> 8) / 255;\n\t\tcolor.b = ((value & 0x000000ff)) / 255;\n\t}\n\n\ttoRgb888 () {\n\t\tconst hex = (x: number) => (\"0\" + (x * 255).toString(16)).slice(-2);\n\t\treturn Number(\"0x\" + hex(this.r) + hex(this.g) + hex(this.b));\n\t}\n\n\tstatic fromString (hex: string): Color {\n\t\treturn new Color().setFromString(hex);\n\t}\n}\n\nexport class MathUtils {\n\tstatic PI = 3.1415927;\n\tstatic PI2 = MathUtils.PI * 2;\n\tstatic invPI2 = 1 / MathUtils.PI2;\n\tstatic radiansToDegrees = 180 / MathUtils.PI;\n\tstatic radDeg = MathUtils.radiansToDegrees;\n\tstatic degreesToRadians = MathUtils.PI / 180;\n\tstatic degRad = MathUtils.degreesToRadians;\n\n\tstatic clamp (value: number, min: number, max: number) {\n\t\tif (value < min) return min;\n\t\tif (value > max) return max;\n\t\treturn value;\n\t}\n\n\tstatic cosDeg (degrees: number) {\n\t\treturn Math.cos(degrees * MathUtils.degRad);\n\t}\n\n\tstatic sinDeg (degrees: number) {\n\t\treturn Math.sin(degrees * MathUtils.degRad);\n\t}\n\n\tstatic atan2Deg (y: number, x: number) {\n\t\treturn Math.atan2(y, x) * MathUtils.degRad;\n\t}\n\n\tstatic signum (value: number): number {\n\t\treturn value > 0 ? 1 : value < 0 ? -1 : 0;\n\t}\n\n\tstatic toInt (x: number) {\n\t\treturn x > 0 ? Math.floor(x) : Math.ceil(x);\n\t}\n\n\tstatic cbrt (x: number) {\n\t\tlet y = Math.pow(Math.abs(x), 1 / 3);\n\t\treturn x < 0 ? -y : y;\n\t}\n\n\tstatic randomTriangular (min: number, max: number): number {\n\t\treturn MathUtils.randomTriangularWith(min, max, (min + max) * 0.5);\n\t}\n\n\tstatic randomTriangularWith (min: number, max: number, mode: number): number {\n\t\tlet u = Math.random();\n\t\tlet d = max - min;\n\t\tif (u <= (mode - min) / d) return min + Math.sqrt(u * d * (mode - min));\n\t\treturn max - Math.sqrt((1 - u) * d * (max - mode));\n\t}\n\n\tstatic isPowerOfTwo (value: number) {\n\t\treturn value && (value & (value - 1)) === 0;\n\t}\n}\n\nexport abstract class Interpolation {\n\tprotected abstract applyInternal (a: number): number;\n\tapply (start: number, end: number, a: number): number {\n\t\treturn start + (end - start) * this.applyInternal(a);\n\t}\n}\n\nexport class Pow extends Interpolation {\n\tprotected power = 2;\n\n\tconstructor (power: number) {\n\t\tsuper();\n\t\tthis.power = power;\n\t}\n\n\tapplyInternal (a: number): number {\n\t\tif (a <= 0.5) return Math.pow(a * 2, this.power) / 2;\n\t\treturn Math.pow((a - 1) * 2, this.power) / (this.power % 2 == 0 ? -2 : 2) + 1;\n\t}\n}\n\nexport class PowOut extends Pow {\n\tconstructor (power: number) {\n\t\tsuper(power);\n\t}\n\n\tapplyInternal (a: number): number {\n\t\treturn Math.pow(a - 1, this.power) * (this.power % 2 == 0 ? -1 : 1) + 1;\n\t}\n}\n\nexport class Utils {\n\tstatic SUPPORTS_TYPED_ARRAYS = typeof (Float32Array) !== \"undefined\";\n\n\tstatic arrayCopy<T> (source: ArrayLike<T>, sourceStart: number, dest: ArrayLike<T>, destStart: number, numElements: number) {\n\t\tfor (let i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) {\n\t\t\tdest[j] = source[i];\n\t\t}\n\t}\n\n\tstatic arrayFill<T> (array: ArrayLike<T>, fromIndex: number, toIndex: number, value: T) {\n\t\tfor (let i = fromIndex; i < toIndex; i++)\n\t\t\tarray[i] = value;\n\t}\n\n\tstatic setArraySize<T> (array: Array<T>, size: number, value: any = 0): Array<T> {\n\t\tlet oldSize = array.length;\n\t\tif (oldSize == size) return array;\n\t\tarray.length = size;\n\t\tif (oldSize < size) {\n\t\t\tfor (let i = oldSize; i < size; i++) array[i] = value;\n\t\t}\n\t\treturn array;\n\t}\n\n\tstatic ensureArrayCapacity<T> (array: Array<T>, size: number, value: any = 0): Array<T> {\n\t\tif (array.length >= size) return array;\n\t\treturn Utils.setArraySize(array, size, value);\n\t}\n\n\tstatic newArray<T> (size: number, defaultValue: T): Array<T> {\n\t\tlet array = new Array<T>(size);\n\t\tfor (let i = 0; i < size; i++) array[i] = defaultValue;\n\t\treturn array;\n\t}\n\n\tstatic newFloatArray (size: number): NumberArrayLike {\n\t\tif (Utils.SUPPORTS_TYPED_ARRAYS)\n\t\t\treturn new Float32Array(size)\n\t\telse {\n\t\t\tlet array = new Array<number>(size);\n\t\t\tfor (let i = 0; i < array.length; i++) array[i] = 0;\n\t\t\treturn array;\n\t\t}\n\t}\n\n\tstatic newShortArray (size: number): IntArrayLike {\n\t\tif (Utils.SUPPORTS_TYPED_ARRAYS)\n\t\t\treturn new Int16Array(size)\n\t\telse {\n\t\t\tlet array = new Array<number>(size);\n\t\t\tfor (let i = 0; i < array.length; i++) array[i] = 0;\n\t\t\treturn array;\n\t\t}\n\t}\n\n\tstatic toFloatArray (array: Array<number>) {\n\t\treturn Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array;\n\t}\n\n\tstatic toSinglePrecision (value: number) {\n\t\treturn Utils.SUPPORTS_TYPED_ARRAYS ? Math.fround(value) : value;\n\t}\n\n\t// This function is used to fix WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109\n\tstatic webkit602BugfixHelper (alpha: number, blend: MixBlend) {\n\t}\n\n\tstatic contains<T> (array: Array<T>, element: T, identity = true) {\n\t\tfor (var i = 0; i < array.length; i++)\n\t\t\tif (array[i] == element) return true;\n\t\treturn false;\n\t}\n\n\tstatic enumValue (type: any, name: string) {\n\t\treturn type[name[0].toUpperCase() + name.slice(1)];\n\t}\n}\n\nexport class DebugUtils {\n\tstatic logBones (skeleton: Skeleton) {\n\t\tfor (let i = 0; i < skeleton.bones.length; i++) {\n\t\t\tlet bone = skeleton.bones[i];\n\t\t\tconsole.log(bone.data.name + \", \" + bone.a + \", \" + bone.b + \", \" + bone.c + \", \" + bone.d + \", \" + bone.worldX + \", \" + bone.worldY);\n\t\t}\n\t}\n}\n\nexport class Pool<T> {\n\tprivate items = new Array<T>();\n\tprivate instantiator: () => T;\n\n\tconstructor (instantiator: () => T) {\n\t\tthis.instantiator = instantiator;\n\t}\n\n\tobtain () {\n\t\treturn this.items.length > 0 ? this.items.pop()! : this.instantiator();\n\t}\n\n\tfree (item: T) {\n\t\tif ((item as any).reset) (item as any).reset();\n\t\tthis.items.push(item);\n\t}\n\n\tfreeAll (items: ArrayLike<T>) {\n\t\tfor (let i = 0; i < items.length; i++)\n\t\t\tthis.free(items[i]);\n\t}\n\n\tclear () {\n\t\tthis.items.length = 0;\n\t}\n}\n\nexport class Vector2 {\n\tconstructor (public x = 0, public y = 0) {\n\t}\n\n\tset (x: number, y: number): Vector2 {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tlength () {\n\t\tlet x = this.x;\n\t\tlet y = this.y;\n\t\treturn Math.sqrt(x * x + y * y);\n\t}\n\n\tnormalize () {\n\t\tlet len = this.length();\n\t\tif (len != 0) {\n\t\t\tthis.x /= len;\n\t\t\tthis.y /= len;\n\t\t}\n\t\treturn this;\n\t}\n}\n\nexport class TimeKeeper {\n\tmaxDelta = 0.064;\n\tframesPerSecond = 0;\n\tdelta = 0;\n\ttotalTime = 0;\n\n\tprivate lastTime = Date.now() / 1000;\n\tprivate frameCount = 0;\n\tprivate frameTime = 0;\n\n\tupdate () {\n\t\tlet now = Date.now() / 1000;\n\t\tthis.delta = now - this.lastTime;\n\t\tthis.frameTime += this.delta;\n\t\tthis.totalTime += this.delta;\n\t\tif (this.delta > this.maxDelta) this.delta = this.maxDelta;\n\t\tthis.lastTime = now;\n\n\t\tthis.frameCount++;\n\t\tif (this.frameTime > 1) {\n\t\t\tthis.framesPerSecond = this.frameCount / this.frameTime;\n\t\t\tthis.frameTime = 0;\n\t\t\tthis.frameCount = 0;\n\t\t}\n\t}\n}\n\nexport interface ArrayLike<T> {\n\tlength: number;\n\t[n: number]: T;\n}\n\nexport class WindowedMean {\n\tvalues: Array<number>;\n\taddedValues = 0;\n\tlastValue = 0;\n\tmean = 0;\n\tdirty = true;\n\n\tconstructor (windowSize: number = 32) {\n\t\tthis.values = new Array<number>(windowSize);\n\t}\n\n\thasEnoughData () {\n\t\treturn this.addedValues >= this.values.length;\n\t}\n\n\taddValue (value: number) {\n\t\tif (this.addedValues < this.values.length) this.addedValues++;\n\t\tthis.values[this.lastValue++] = value;\n\t\tif (this.lastValue > this.values.length - 1) this.lastValue = 0;\n\t\tthis.dirty = true;\n\t}\n\n\tgetMean () {\n\t\tif (this.hasEnoughData()) {\n\t\t\tif (this.dirty) {\n\t\t\t\tlet mean = 0;\n\t\t\t\tfor (let i = 0; i < this.values.length; i++)\n\t\t\t\t\tmean += this.values[i];\n\t\t\t\tthis.mean = mean / this.values.length;\n\t\t\t\tthis.dirty = false;\n\t\t\t}\n\t\t\treturn this.mean;\n\t\t}\n\t\treturn 0;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Slot } from \"../Slot.js\";\nimport { NumberArrayLike, Utils } from \"../Utils.js\";\n\n/** The base class for all attachments. */\nexport abstract class Attachment {\n\tname: string;\n\n\tconstructor (name: string) {\n\t\tif (!name) throw new Error(\"name cannot be null.\");\n\t\tthis.name = name;\n\t}\n\n\tabstract copy (): Attachment;\n}\n\n/** Base class for an attachment with vertices that are transformed by one or more bones and can be deformed by a slot's\n * {@link Slot#deform}. */\nexport abstract class VertexAttachment extends Attachment {\n\tprivate static nextID = 0;\n\n\t/** The unique ID for this attachment. */\n\tid = VertexAttachment.nextID++;\n\n\t/** The bones which affect the {@link #getVertices()}. The array entries are, for each vertex, the number of bones affecting\n\t * the vertex followed by that many bone indices, which is the index of the bone in {@link Skeleton#bones}. Will be null\n\t * if this attachment has no weights. */\n\tbones: Array<number> | null = null;\n\n\t/** The vertex positions in the bone's coordinate system. For a non-weighted attachment, the values are `x,y`\n\t * entries for each vertex. For a weighted attachment, the values are `x,y,weight` entries for each bone affecting\n\t * each vertex. */\n\tvertices: NumberArrayLike = [];\n\n\t/** The maximum number of world vertex values that can be output by\n\t * {@link #computeWorldVertices()} using the `count` parameter. */\n\tworldVerticesLength = 0;\n\n\t/** Timelines for the timeline attachment are also applied to this attachment.\n\t * May be null if no attachment-specific timelines should be applied. */\n\ttimelineAttachment: Attachment = this;\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\t/** Transforms the attachment's local {@link #vertices} to world coordinates. If the slot's {@link Slot#deform} is\n\t * not empty, it is used to deform the vertices.\n\t *\n\t * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine\n\t * Runtimes Guide.\n\t * @param start The index of the first {@link #vertices} value to transform. Each vertex has 2 values, x and y.\n\t * @param count The number of world vertex values to output. Must be <= {@link #worldVerticesLength} - `start`.\n\t * @param worldVertices The output world vertices. Must have a length >= `offset` + `count` *\n\t * `stride` / 2.\n\t * @param offset The `worldVertices` index to begin writing values.\n\t * @param stride The number of `worldVertices` entries between the value pairs written. */\n\tcomputeWorldVertices (slot: Slot, start: number, count: number, worldVertices: NumberArrayLike, offset: number, stride: number) {\n\t\tcount = offset + (count >> 1) * stride;\n\t\tlet skeleton = slot.bone.skeleton;\n\t\tlet deformArray = slot.deform;\n\t\tlet vertices = this.vertices;\n\t\tlet bones = this.bones;\n\t\tif (!bones) {\n\t\t\tif (deformArray.length > 0) vertices = deformArray;\n\t\t\tlet bone = slot.bone;\n\t\t\tlet x = bone.worldX;\n\t\t\tlet y = bone.worldY;\n\t\t\tlet a = bone.a, b = bone.b, c = bone.c, d = bone.d;\n\t\t\tfor (let v = start, w = offset; w < count; v += 2, w += stride) {\n\t\t\t\tlet vx = vertices[v], vy = vertices[v + 1];\n\t\t\t\tworldVertices[w] = vx * a + vy * b + x;\n\t\t\t\tworldVertices[w + 1] = vx * c + vy * d + y;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tlet v = 0, skip = 0;\n\t\tfor (let i = 0; i < start; i += 2) {\n\t\t\tlet n = bones[v];\n\t\t\tv += n + 1;\n\t\t\tskip += n;\n\t\t}\n\t\tlet skeletonBones = skeleton.bones;\n\t\tif (deformArray.length == 0) {\n\t\t\tfor (let w = offset, b = skip * 3; w < count; w += stride) {\n\t\t\t\tlet wx = 0, wy = 0;\n\t\t\t\tlet n = bones[v++];\n\t\t\t\tn += v;\n\t\t\t\tfor (; v < n; v++, b += 3) {\n\t\t\t\t\tlet bone = skeletonBones[bones[v]];\n\t\t\t\t\tlet vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2];\n\t\t\t\t\twx += (vx * bone.a + vy * bone.b + bone.worldX) * weight;\n\t\t\t\t\twy += (vx * bone.c + vy * bone.d + bone.worldY) * weight;\n\t\t\t\t}\n\t\t\t\tworldVertices[w] = wx;\n\t\t\t\tworldVertices[w + 1] = wy;\n\t\t\t}\n\t\t} else {\n\t\t\tlet deform = deformArray;\n\t\t\tfor (let w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) {\n\t\t\t\tlet wx = 0, wy = 0;\n\t\t\t\tlet n = bones[v++];\n\t\t\t\tn += v;\n\t\t\t\tfor (; v < n; v++, b += 3, f += 2) {\n\t\t\t\t\tlet bone = skeletonBones[bones[v]];\n\t\t\t\t\tlet vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2];\n\t\t\t\t\twx += (vx * bone.a + vy * bone.b + bone.worldX) * weight;\n\t\t\t\t\twy += (vx * bone.c + vy * bone.d + bone.worldY) * weight;\n\t\t\t\t}\n\t\t\t\tworldVertices[w] = wx;\n\t\t\t\tworldVertices[w + 1] = wy;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Does not copy id (generated) or name (set on construction). **/\n\tcopyTo (attachment: VertexAttachment) {\n\t\tif (this.bones) {\n\t\t\tattachment.bones = new Array<number>(this.bones.length);\n\t\t\tUtils.arrayCopy(this.bones, 0, attachment.bones, 0, this.bones.length);\n\t\t} else\n\t\t\tattachment.bones = null;\n\n\t\tif (this.vertices) {\n\t\t\tattachment.vertices = Utils.newFloatArray(this.vertices.length);\n\t\t\tUtils.arrayCopy(this.vertices, 0, attachment.vertices, 0, this.vertices.length);\n\t\t}\n\n\t\tattachment.worldVerticesLength = this.worldVerticesLength;\n\t\tattachment.timelineAttachment = this.timelineAttachment;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { TextureRegion } from \"../Texture.js\";\nimport { Slot } from \"../Slot.js\";\nimport { HasTextureRegion } from \"./HasTextureRegion.js\";\nimport { Utils } from \"../Utils.js\";\n\n\nexport class Sequence {\n\tprivate static _nextID = 0;\n\n\tid = Sequence.nextID();\n\tregions: TextureRegion[];\n\tstart = 0;\n\tdigits = 0;\n\t/** The index of the region to show for the setup pose. */\n\tsetupIndex = 0;\n\n\tconstructor (count: number) {\n\t\tthis.regions = new Array<TextureRegion>(count);\n\t}\n\n\tcopy (): Sequence {\n\t\tlet copy = new Sequence(this.regions.length);\n\t\tUtils.arrayCopy(this.regions, 0, copy.regions, 0, this.regions.length);\n\t\tcopy.start = this.start;\n\t\tcopy.digits = this.digits;\n\t\tcopy.setupIndex = this.setupIndex;\n\t\treturn copy;\n\t}\n\n\tapply (slot: Slot, attachment: HasTextureRegion) {\n\t\tlet index = slot.sequenceIndex;\n\t\tif (index == -1) index = this.setupIndex;\n\t\tif (index >= this.regions.length) index = this.regions.length - 1;\n\t\tlet region = this.regions[index];\n\t\tif (attachment.region != region) {\n\t\t\tattachment.region = region;\n\t\t\tattachment.updateRegion();\n\t\t}\n\t}\n\n\tgetPath (basePath: string, index: number): string {\n\t\tlet result = basePath;\n\t\tlet frame = (this.start + index).toString();\n\t\tfor (let i = this.digits - frame.length; i > 0; i--)\n\t\t\tresult += \"0\";\n\t\tresult += frame;\n\t\treturn result;\n\t}\n\n\tprivate static nextID (): number {\n\t\treturn Sequence._nextID++;\n\t}\n}\n\nexport enum SequenceMode {\n\thold = 0,\n\tonce = 1,\n\tloop = 2,\n\tpingpong = 3,\n\tonceReverse = 4,\n\tloopReverse = 5,\n\tpingpongReverse = 6\n}\n\nexport const SequenceModeValues = [\n\tSequenceMode.hold,\n\tSequenceMode.once,\n\tSequenceMode.loop,\n\tSequenceMode.pingpong,\n\tSequenceMode.onceReverse,\n\tSequenceMode.loopReverse,\n\tSequenceMode.pingpongReverse\n];\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { VertexAttachment, Attachment } from \"./attachments/Attachment.js\";\nimport { IkConstraint } from \"./IkConstraint.js\";\nimport { PathConstraint } from \"./PathConstraint.js\";\nimport { Skeleton } from \"./Skeleton.js\";\nimport { Slot } from \"./Slot.js\";\nimport { TransformConstraint } from \"./TransformConstraint.js\";\nimport { StringSet, Utils, MathUtils, NumberArrayLike } from \"./Utils.js\";\nimport { Event } from \"./Event.js\";\nimport { HasTextureRegion } from \"./attachments/HasTextureRegion.js\";\nimport { SequenceMode, SequenceModeValues } from \"./attachments/Sequence.js\";\nimport { PhysicsConstraint } from \"./PhysicsConstraint.js\";\nimport { PhysicsConstraintData } from \"./PhysicsConstraintData.js\";\nimport { Inherit } from \"./BoneData.js\";\n\n/** A simple container for a list of timelines and a name. */\nexport class Animation {\n\t/** The animation's name, which is unique across all animations in the skeleton. */\n\tname: string;\n\ttimelines: Array<Timeline> = [];\n\ttimelineIds: StringSet = new StringSet();\n\n\t/** The duration of the animation in seconds, which is the highest time of all keys in the timeline. */\n\tduration: number;\n\n\tconstructor (name: string, timelines: Array<Timeline>, duration: number) {\n\t\tif (!name) throw new Error(\"name cannot be null.\");\n\t\tthis.name = name;\n\t\tthis.setTimelines(timelines);\n\t\tthis.duration = duration;\n\t}\n\n\tsetTimelines (timelines: Array<Timeline>) {\n\t\tif (!timelines) throw new Error(\"timelines cannot be null.\");\n\t\tthis.timelines = timelines;\n\t\tthis.timelineIds.clear();\n\t\tfor (var i = 0; i < timelines.length; i++)\n\t\t\tthis.timelineIds.addAll(timelines[i].getPropertyIds());\n\t}\n\n\thasTimeline (ids: string[]): boolean {\n\t\tfor (let i = 0; i < ids.length; i++)\n\t\t\tif (this.timelineIds.contains(ids[i])) return true;\n\t\treturn false;\n\t}\n\n\t/** Applies all the animation's timelines to the specified skeleton.\n\t *\n\t * See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}.\n\t * @param loop If true, the animation repeats after {@link #getDuration()}.\n\t * @param events May be null to ignore fired events. */\n\tapply (skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\n\t\tif (loop && this.duration != 0) {\n\t\t\ttime %= this.duration;\n\t\t\tif (lastTime > 0) lastTime %= this.duration;\n\t\t}\n\n\t\tlet timelines = this.timelines;\n\t\tfor (let i = 0, n = timelines.length; i < n; i++)\n\t\t\ttimelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction);\n\t}\n}\n\n/** Controls how a timeline value is mixed with the setup pose value or current pose value when a timeline's `alpha`\n * < 1.\n *\n * See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}. */\nexport enum MixBlend {\n\t/** Transitions from the setup value to the timeline value (the current value is not used). Before the first key, the setup\n\t * value is set. */\n\tsetup,\n\t/** Transitions from the current value to the timeline value. Before the first key, transitions from the current value to\n\t * the setup value. Timelines which perform instant transitions, such as {@link DrawOrderTimeline} or\n\t * {@link AttachmentTimeline}, use the setup value before the first key.\n\t *\n\t * `first` is intended for the first animations applied, not for animations layered on top of those. */\n\tfirst,\n\t/** Transitions from the current value to the timeline value. No change is made before the first key (the current value is\n\t * kept until the first key).\n\t *\n\t * `replace` is intended for animations layered on top of others, not for the first animations applied. */\n\treplace,\n\t/** Transitions from the current value to the current value plus the timeline value. No change is made before the first key\n\t * (the current value is kept until the first key).\n\t *\n\t * `add` is intended for animations layered on top of others, not for the first animations applied. Properties\n\t * keyed by additive animations must be set manually or by another animation before applying the additive animations, else\n\t * the property values will increase continually. */\n\tadd\n}\n\n/** Indicates whether a timeline's `alpha` is mixing out over time toward 0 (the setup or current pose value) or\n * mixing in toward 1 (the timeline's value).\n *\n * See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}. */\nexport enum MixDirection {\n\tmixIn, mixOut\n}\n\nconst Property = {\n\trotate: 0,\n\tx: 1,\n\ty: 2,\n\tscaleX: 3,\n\tscaleY: 4,\n\tshearX: 5,\n\tshearY: 6,\n\tinherit: 7,\n\n\trgb: 8,\n\talpha: 9,\n\trgb2: 10,\n\n\tattachment: 11,\n\tdeform: 12,\n\n\tevent: 13,\n\tdrawOrder: 14,\n\n\tikConstraint: 15,\n\ttransformConstraint: 16,\n\n\tpathConstraintPosition: 17,\n\tpathConstraintSpacing: 18,\n\tpathConstraintMix: 19,\n\n\tphysicsConstraintInertia: 20,\n\tphysicsConstraintStrength: 21,\n\tphysicsConstraintDamping: 22,\n\tphysicsConstraintMass: 23,\n\tphysicsConstraintWind: 24,\n\tphysicsConstraintGravity: 25,\n\tphysicsConstraintMix: 26,\n\tphysicsConstraintReset: 27,\n\n\tsequence: 28,\n}\n\n/** The interface for all timelines. */\nexport abstract class Timeline {\n\tpropertyIds: string[];\n\tframes: NumberArrayLike;\n\n\tconstructor (frameCount: number, propertyIds: string[]) {\n\t\tthis.propertyIds = propertyIds;\n\t\tthis.frames = Utils.newFloatArray(frameCount * this.getFrameEntries());\n\t}\n\n\tgetPropertyIds () {\n\t\treturn this.propertyIds;\n\t}\n\n\tgetFrameEntries (): number {\n\t\treturn 1;\n\t}\n\n\tgetFrameCount () {\n\t\treturn this.frames.length / this.getFrameEntries();\n\t}\n\n\tgetDuration (): number {\n\t\treturn this.frames[this.frames.length - this.getFrameEntries()];\n\t}\n\n\tabstract apply (skeleton: Skeleton, lastTime: number, time: number, events: Array<Event> | null, alpha: number, blend: MixBlend, direction: MixDirection): void;\n\n\tstatic search1 (frames: NumberArrayLike, time: number) {\n\t\tlet n = frames.length;\n\t\tfor (let i = 1; i < n; i++)\n\t\t\tif (frames[i] > time) return i - 1;\n\t\treturn n - 1;\n\t}\n\n\tstatic search (frames: NumberArrayLike, time: number, step: number) {\n\t\tlet n = frames.length;\n\t\tfor (let i = step; i < n; i += step)\n\t\t\tif (frames[i] > time) return i - step;\n\t\treturn n - step;\n\t}\n}\n\nexport interface BoneTimeline {\n\t/** The index of the bone in {@link Skeleton#bones} that will be changed. */\n\tboneIndex: number;\n}\n\nexport interface SlotTimeline {\n\t/** The index of the slot in {@link Skeleton#slots} that will be changed. */\n\tslotIndex: number;\n}\n\n/** The base class for timelines that use interpolation between key frame values. */\nexport abstract class CurveTimeline extends Timeline {\n\tprotected curves: NumberArrayLike; // type, x, y, ...\n\n\tconstructor (frameCount: number, bezierCount: number, propertyIds: string[]) {\n\t\tsuper(frameCount, propertyIds);\n\t\tthis.curves = Utils.newFloatArray(frameCount + bezierCount * 18/*BEZIER_SIZE*/);\n\t\tthis.curves[frameCount - 1] = 1/*STEPPED*/;\n\t}\n\n\t/** Sets the specified key frame to linear interpolation. */\n\tsetLinear (frame: number) {\n\t\tthis.curves[frame] = 0/*LINEAR*/;\n\t}\n\n\t/** Sets the specified key frame to stepped interpolation. */\n\tsetStepped (frame: number) {\n\t\tthis.curves[frame] = 1/*STEPPED*/;\n\t}\n\n\t/** Shrinks the storage for Bezier curves, for use when <code>bezierCount</code> (specified in the constructor) was larger\n\t * than the actual number of Bezier curves. */\n\tshrink (bezierCount: number) {\n\t\tlet size = this.getFrameCount() + bezierCount * 18/*BEZIER_SIZE*/;\n\t\tif (this.curves.length > size) {\n\t\t\tlet newCurves = Utils.newFloatArray(size);\n\t\t\tUtils.arrayCopy(this.curves, 0, newCurves, 0, size);\n\t\t\tthis.curves = newCurves;\n\t\t}\n\t}\n\n\t/** Stores the segments for the specified Bezier curve. For timelines that modify multiple values, there may be more than\n\t * one curve per frame.\n\t * @param bezier The ordinal of this Bezier curve for this timeline, between 0 and <code>bezierCount - 1</code> (specified\n\t * in the constructor), inclusive.\n\t * @param frame Between 0 and <code>frameCount - 1</code>, inclusive.\n\t * @param value The index of the value for this frame that this curve is used for.\n\t * @param time1 The time for the first key.\n\t * @param value1 The value for the first key.\n\t * @param cx1 The time for the first Bezier handle.\n\t * @param cy1 The value for the first Bezier handle.\n\t * @param cx2 The time of the second Bezier handle.\n\t * @param cy2 The value for the second Bezier handle.\n\t * @param time2 The time for the second key.\n\t * @param value2 The value for the second key. */\n\tsetBezier (bezier: number, frame: number, value: number, time1: number, value1: number, cx1: number, cy1: number, cx2: number,\n\t\tcy2: number, time2: number, value2: number) {\n\t\tlet curves = this.curves;\n\t\tlet i = this.getFrameCount() + bezier * 18/*BEZIER_SIZE*/;\n\t\tif (value == 0) curves[frame] = 2/*BEZIER*/ + i;\n\t\tlet tmpx = (time1 - cx1 * 2 + cx2) * 0.03, tmpy = (value1 - cy1 * 2 + cy2) * 0.03;\n\t\tlet dddx = ((cx1 - cx2) * 3 - time1 + time2) * 0.006, dddy = ((cy1 - cy2) * 3 - value1 + value2) * 0.006;\n\t\tlet ddx = tmpx * 2 + dddx, ddy = tmpy * 2 + dddy;\n\t\tlet dx = (cx1 - time1) * 0.3 + tmpx + dddx * 0.16666667, dy = (cy1 - value1) * 0.3 + tmpy + dddy * 0.16666667;\n\t\tlet x = time1 + dx, y = value1 + dy;\n\t\tfor (let n = i + 18/*BEZIER_SIZE*/; i < n; i += 2) {\n\t\t\tcurves[i] = x;\n\t\t\tcurves[i + 1] = y;\n\t\t\tdx += ddx;\n\t\t\tdy += ddy;\n\t\t\tddx += dddx;\n\t\t\tddy += dddy;\n\t\t\tx += dx;\n\t\t\ty += dy;\n\t\t}\n\t}\n\n\t/** Returns the Bezier interpolated value for the specified time.\n\t * @param frameIndex The index into {@link #getFrames()} for the values of the frame before <code>time</code>.\n\t * @param valueOffset The offset from <code>frameIndex</code> to the value this curve is used for.\n\t * @param i The index of the Bezier segments. See {@link #getCurveType(int)}. */\n\tgetBezierValue (time: number, frameIndex: number, valueOffset: number, i: number) {\n\t\tlet curves = this.curves;\n\t\tif (curves[i] > time) {\n\t\t\tlet x = this.frames[frameIndex], y = this.frames[frameIndex + valueOffset];\n\t\t\treturn y + (time - x) / (curves[i] - x) * (curves[i + 1] - y);\n\t\t}\n\t\tlet n = i + 18/*BEZIER_SIZE*/;\n\t\tfor (i += 2; i < n; i += 2) {\n\t\t\tif (curves[i] >= time) {\n\t\t\t\tlet x = curves[i - 2], y = curves[i - 1];\n\t\t\t\treturn y + (time - x) / (curves[i] - x) * (curves[i + 1] - y);\n\t\t\t}\n\t\t}\n\t\tframeIndex += this.getFrameEntries();\n\t\tlet x = curves[n - 2], y = curves[n - 1];\n\t\treturn y + (time - x) / (this.frames[frameIndex] - x) * (this.frames[frameIndex + valueOffset] - y);\n\t}\n}\n\nexport abstract class CurveTimeline1 extends CurveTimeline {\n\tconstructor (frameCount: number, bezierCount: number, propertyId: string) {\n\t\tsuper(frameCount, bezierCount, [propertyId]);\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 2/*ENTRIES*/;\n\t}\n\n\t/** Sets the time and value for the specified frame.\n\t * @param frame Between 0 and <code>frameCount</code>, inclusive.\n\t * @param time The frame time in seconds. */\n\tsetFrame (frame: number, time: number, value: number) {\n\t\tframe <<= 1;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*VALUE*/] = value;\n\t}\n\n\t/** Returns the interpolated value for the specified time. */\n\tgetCurveValue (time: number) {\n\t\tlet frames = this.frames;\n\t\tlet i = frames.length - 2;\n\t\tfor (let ii = 2; ii <= i; ii += 2) {\n\t\t\tif (frames[ii] > time) {\n\t\t\t\ti = ii - 2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tlet curveType = this.curves[i >> 1];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i], value = frames[i + 1/*VALUE*/];\n\t\t\t\treturn value + (time - before) / (frames[i + 2/*ENTRIES*/] - before) * (frames[i + 2/*ENTRIES*/ + 1/*VALUE*/] - value);\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\treturn frames[i + 1/*VALUE*/];\n\t\t}\n\t\treturn this.getBezierValue(time, i, 1/*VALUE*/, curveType - 2/*BEZIER*/);\n\t}\n\n\tgetRelativeValue (time: number, alpha: number, blend: MixBlend, current: number, setup: number) {\n\t\tif (time < this.frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\treturn setup;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\treturn current + (setup - current) * alpha;\n\t\t\t}\n\t\t\treturn current;\n\t\t}\n\t\tlet value = this.getCurveValue(time);\n\t\tswitch (blend) {\n\t\t\tcase MixBlend.setup:\n\t\t\t\treturn setup + value * alpha;\n\t\t\tcase MixBlend.first:\n\t\t\tcase MixBlend.replace:\n\t\t\t\tvalue += setup - current;\n\t\t}\n\t\treturn current + value * alpha;\n\t}\n\n\tgetAbsoluteValue (time: number, alpha: number, blend: MixBlend, current: number, setup: number) {\n\t\tif (time < this.frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\treturn setup;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\treturn current + (setup - current) * alpha;\n\t\t\t}\n\t\t\treturn current;\n\t\t}\n\t\tlet value = this.getCurveValue(time);\n\t\tif (blend == MixBlend.setup) return setup + (value - setup) * alpha;\n\t\treturn current + (value - current) * alpha;\n\t}\n\n\tgetAbsoluteValue2 (time: number, alpha: number, blend: MixBlend, current: number, setup: number, value: number) {\n\t\tif (time < this.frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\treturn setup;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\treturn current + (setup - current) * alpha;\n\t\t\t}\n\t\t\treturn current;\n\t\t}\n\t\tif (blend == MixBlend.setup) return setup + (value - setup) * alpha;\n\t\treturn current + (value - current) * alpha;\n\t}\n\n\tgetScaleValue (time: number, alpha: number, blend: MixBlend, direction: MixDirection, current: number, setup: number) {\n\t\tconst frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\treturn setup;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\treturn current + (setup - current) * alpha;\n\t\t\t}\n\t\t\treturn current;\n\t\t}\n\t\tlet value = this.getCurveValue(time) * setup;\n\t\tif (alpha == 1) {\n\t\t\tif (blend == MixBlend.add) return current + value - setup;\n\t\t\treturn value;\n\t\t}\n\t\t// Mixing out uses sign of setup or current pose, else use sign of key.\n\t\tif (direction == MixDirection.mixOut) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\treturn setup + (Math.abs(value) * MathUtils.signum(setup) - setup) * alpha;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\tcase MixBlend.replace:\n\t\t\t\t\treturn current + (Math.abs(value) * MathUtils.signum(current) - current) * alpha;\n\t\t\t}\n\t\t} else {\n\t\t\tlet s = 0;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\ts = Math.abs(setup) * MathUtils.signum(value);\n\t\t\t\t\treturn s + (value - s) * alpha;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\tcase MixBlend.replace:\n\t\t\t\t\ts = Math.abs(current) * MathUtils.signum(value);\n\t\t\t\t\treturn s + (value - s) * alpha;\n\t\t\t}\n\t\t}\n\t\treturn current + (value - setup) * alpha;\n\t}\n}\n\n/** The base class for a {@link CurveTimeline} which sets two properties. */\nexport abstract class CurveTimeline2 extends CurveTimeline {\n\t/** @param bezierCount The maximum number of Bezier curves. See {@link #shrink(int)}.\n\t * @param propertyIds Unique identifiers for the properties the timeline modifies. */\n\tconstructor (frameCount: number, bezierCount: number, propertyId1: string, propertyId2: string) {\n\t\tsuper(frameCount, bezierCount, [propertyId1, propertyId2]);\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 3/*ENTRIES*/;\n\t}\n\n\t/** Sets the time and values for the specified frame.\n\t * @param frame Between 0 and <code>frameCount</code>, inclusive.\n\t * @param time The frame time in seconds. */\n\tsetFrame (frame: number, time: number, value1: number, value2: number) {\n\t\tframe *= 3/*ENTRIES*/;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*VALUE1*/] = value1;\n\t\tthis.frames[frame + 2/*VALUE2*/] = value2;\n\t}\n}\n\n/** Changes a bone's local {@link Bone#rotation}. */\nexport class RotateTimeline extends CurveTimeline1 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.rotate + \"|\" + boneIndex);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array<Event> | null, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (bone.active) bone.rotation = this.getRelativeValue(time, alpha, blend, bone.rotation, bone.data.rotation);\n\t}\n}\n\n/** Changes a bone's local {@link Bone#x} and {@link Bone#y}. */\nexport class TranslateTimeline extends CurveTimeline2 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount,\n\t\t\tProperty.x + \"|\" + boneIndex,\n\t\t\tProperty.y + \"|\" + boneIndex,\n\t\t);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (!bone.active) return;\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tbone.x = bone.data.x;\n\t\t\t\t\tbone.y = bone.data.y;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tbone.x += (bone.data.x - bone.x) * alpha;\n\t\t\t\t\tbone.y += (bone.data.y - bone.y) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet x = 0, y = 0;\n\t\tlet i = Timeline.search(frames, time, 3/*ENTRIES*/);\n\t\tlet curveType = this.curves[i / 3/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\tx = frames[i + 1/*VALUE1*/];\n\t\t\t\ty = frames[i + 2/*VALUE2*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 3/*ENTRIES*/] - before);\n\t\t\t\tx += (frames[i + 3/*ENTRIES*/ + 1/*VALUE1*/] - x) * t;\n\t\t\t\ty += (frames[i + 3/*ENTRIES*/ + 2/*VALUE2*/] - y) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tx = frames[i + 1/*VALUE1*/];\n\t\t\t\ty = frames[i + 2/*VALUE2*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tx = this.getBezierValue(time, i, 1/*VALUE1*/, curveType - 2/*BEZIER*/);\n\t\t\t\ty = this.getBezierValue(time, i, 2/*VALUE2*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t}\n\n\t\tswitch (blend) {\n\t\t\tcase MixBlend.setup:\n\t\t\t\tbone.x = bone.data.x + x * alpha;\n\t\t\t\tbone.y = bone.data.y + y * alpha;\n\t\t\t\tbreak;\n\t\t\tcase MixBlend.first:\n\t\t\tcase MixBlend.replace:\n\t\t\t\tbone.x += (bone.data.x + x - bone.x) * alpha;\n\t\t\t\tbone.y += (bone.data.y + y - bone.y) * alpha;\n\t\t\t\tbreak;\n\t\t\tcase MixBlend.add:\n\t\t\t\tbone.x += x * alpha;\n\t\t\t\tbone.y += y * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a bone's local {@link Bone#x}. */\nexport class TranslateXTimeline extends CurveTimeline1 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.x + \"|\" + boneIndex);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (bone.active) bone.x = this.getRelativeValue(time, alpha, blend, bone.x, bone.data.x);\n\t}\n}\n\n/** Changes a bone's local {@link Bone#x}. */\nexport class TranslateYTimeline extends CurveTimeline1 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.y + \"|\" + boneIndex);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (bone.active) bone.y = this.getRelativeValue(time, alpha, blend, bone.y, bone.data.y);\n\t}\n}\n\n/** Changes a bone's local {@link Bone#scaleX)} and {@link Bone#scaleY}. */\nexport class ScaleTimeline extends CurveTimeline2 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount,\n\t\t\tProperty.scaleX + \"|\" + boneIndex,\n\t\t\tProperty.scaleY + \"|\" + boneIndex\n\t\t);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (!bone.active) return;\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tbone.scaleX = bone.data.scaleX;\n\t\t\t\t\tbone.scaleY = bone.data.scaleY;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tbone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha;\n\t\t\t\t\tbone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet x, y;\n\t\tlet i = Timeline.search(frames, time, 3/*ENTRIES*/);\n\t\tlet curveType = this.curves[i / 3/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\tx = frames[i + 1/*VALUE1*/];\n\t\t\t\ty = frames[i + 2/*VALUE2*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 3/*ENTRIES*/] - before);\n\t\t\t\tx += (frames[i + 3/*ENTRIES*/ + 1/*VALUE1*/] - x) * t;\n\t\t\t\ty += (frames[i + 3/*ENTRIES*/ + 2/*VALUE2*/] - y) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tx = frames[i + 1/*VALUE1*/];\n\t\t\t\ty = frames[i + 2/*VALUE2*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tx = this.getBezierValue(time, i, 1/*VALUE1*/, curveType - 2/*BEZIER*/);\n\t\t\t\ty = this.getBezierValue(time, i, 2/*VALUE2*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t}\n\t\tx *= bone.data.scaleX;\n\t\ty *= bone.data.scaleY;\n\n\t\tif (alpha == 1) {\n\t\t\tif (blend == MixBlend.add) {\n\t\t\t\tbone.scaleX += x - bone.data.scaleX;\n\t\t\t\tbone.scaleY += y - bone.data.scaleY;\n\t\t\t} else {\n\t\t\t\tbone.scaleX = x;\n\t\t\t\tbone.scaleY = y;\n\t\t\t}\n\t\t} else {\n\t\t\tlet bx = 0, by = 0;\n\t\t\tif (direction == MixDirection.mixOut) {\n\t\t\t\tswitch (blend) {\n\t\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\t\tbx = bone.data.scaleX;\n\t\t\t\t\t\tby = bone.data.scaleY;\n\t\t\t\t\t\tbone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;\n\t\t\t\t\t\tbone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tcase MixBlend.replace:\n\t\t\t\t\t\tbx = bone.scaleX;\n\t\t\t\t\t\tby = bone.scaleY;\n\t\t\t\t\t\tbone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;\n\t\t\t\t\t\tbone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MixBlend.add:\n\t\t\t\t\t\tbone.scaleX += (x - bone.data.scaleX) * alpha;\n\t\t\t\t\t\tbone.scaleY += (y - bone.data.scaleY) * alpha;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tswitch (blend) {\n\t\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\t\tbx = Math.abs(bone.data.scaleX) * MathUtils.signum(x);\n\t\t\t\t\t\tby = Math.abs(bone.data.scaleY) * MathUtils.signum(y);\n\t\t\t\t\t\tbone.scaleX = bx + (x - bx) * alpha;\n\t\t\t\t\t\tbone.scaleY = by + (y - by) * alpha;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tcase MixBlend.replace:\n\t\t\t\t\t\tbx = Math.abs(bone.scaleX) * MathUtils.signum(x);\n\t\t\t\t\t\tby = Math.abs(bone.scaleY) * MathUtils.signum(y);\n\t\t\t\t\t\tbone.scaleX = bx + (x - bx) * alpha;\n\t\t\t\t\t\tbone.scaleY = by + (y - by) * alpha;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MixBlend.add:\n\t\t\t\t\t\tbone.scaleX += (x - bone.data.scaleX) * alpha;\n\t\t\t\t\t\tbone.scaleY += (y - bone.data.scaleY) * alpha;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Changes a bone's local {@link Bone#scaleX)} and {@link Bone#scaleY}. */\nexport class ScaleXTimeline extends CurveTimeline1 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.scaleX + \"|\" + boneIndex);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (bone.active) bone.scaleX = this.getScaleValue(time, alpha, blend, direction, bone.scaleX, bone.data.scaleX);\n\t}\n}\n\n/** Changes a bone's local {@link Bone#scaleX)} and {@link Bone#scaleY}. */\nexport class ScaleYTimeline extends CurveTimeline1 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.scaleY + \"|\" + boneIndex);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (bone.active) bone.scaleY = this.getScaleValue(time, alpha, blend, direction, bone.scaleY, bone.data.scaleY);\n\t}\n}\n\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */\nexport class ShearTimeline extends CurveTimeline2 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount,\n\t\t\tProperty.shearX + \"|\" + boneIndex,\n\t\t\tProperty.shearY + \"|\" + boneIndex\n\t\t);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (!bone.active) return;\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tbone.shearX = bone.data.shearX;\n\t\t\t\t\tbone.shearY = bone.data.shearY;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tbone.shearX += (bone.data.shearX - bone.shearX) * alpha;\n\t\t\t\t\tbone.shearY += (bone.data.shearY - bone.shearY) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet x = 0, y = 0;\n\t\tlet i = Timeline.search(frames, time, 3/*ENTRIES*/);\n\t\tlet curveType = this.curves[i / 3/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\tx = frames[i + 1/*VALUE1*/];\n\t\t\t\ty = frames[i + 2/*VALUE2*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 3/*ENTRIES*/] - before);\n\t\t\t\tx += (frames[i + 3/*ENTRIES*/ + 1/*VALUE1*/] - x) * t;\n\t\t\t\ty += (frames[i + 3/*ENTRIES*/ + 2/*VALUE2*/] - y) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tx = frames[i + 1/*VALUE1*/];\n\t\t\t\ty = frames[i + 2/*VALUE2*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tx = this.getBezierValue(time, i, 1/*VALUE1*/, curveType - 2/*BEZIER*/);\n\t\t\t\ty = this.getBezierValue(time, i, 2/*VALUE2*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t}\n\n\t\tswitch (blend) {\n\t\t\tcase MixBlend.setup:\n\t\t\t\tbone.shearX = bone.data.shearX + x * alpha;\n\t\t\t\tbone.shearY = bone.data.shearY + y * alpha;\n\t\t\t\tbreak;\n\t\t\tcase MixBlend.first:\n\t\t\tcase MixBlend.replace:\n\t\t\t\tbone.shearX += (bone.data.shearX + x - bone.shearX) * alpha;\n\t\t\t\tbone.shearY += (bone.data.shearY + y - bone.shearY) * alpha;\n\t\t\t\tbreak;\n\t\t\tcase MixBlend.add:\n\t\t\t\tbone.shearX += x * alpha;\n\t\t\t\tbone.shearY += y * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */\nexport class ShearXTimeline extends CurveTimeline1 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.shearX + \"|\" + boneIndex);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (bone.active) bone.shearX = this.getRelativeValue(time, alpha, blend, bone.shearX, bone.data.shearX);\n\t}\n}\n\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */\nexport class ShearYTimeline extends CurveTimeline1 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.shearY + \"|\" + boneIndex);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (bone.active) bone.shearY = this.getRelativeValue(time, alpha, blend, bone.shearY, bone.data.shearY);\n\t}\n}\n\nexport class InheritTimeline extends Timeline implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, boneIndex: number) {\n\t\tsuper(frameCount, [Property.inherit + \"|\" + boneIndex]);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tpublic getFrameEntries () {\n\t\treturn 2/*ENTRIES*/;\n\t}\n\n\t/** Sets the transform mode for the specified frame.\n\t * @param frame Between 0 and <code>frameCount</code>, inclusive.\n\t * @param time The frame time in seconds. */\n\tpublic setFrame (frame: number, time: number, inherit: Inherit) {\n\t\tframe *= 2/*ENTRIES*/;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*INHERIT*/] = inherit;\n\t}\n\n\tpublic apply (skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (!bone.active) return;\n\n\t\tif (direction == MixDirection.mixOut) {\n\t\t\tif (blend == MixBlend.setup) bone.inherit = bone.data.inherit;\n\t\t\treturn;\n\t\t}\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tif (blend == MixBlend.setup || blend == MixBlend.first) bone.inherit = bone.data.inherit;\n\t\t\treturn;\n\t\t}\n\t\tbone.inherit = this.frames[Timeline.search(frames, time, 2/*ENTRIES*/) + 1/*INHERIT*/];\n\t}\n}\n\n/** Changes a slot's {@link Slot#color}. */\nexport class RGBATimeline extends CurveTimeline implements SlotTimeline {\n\tslotIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number) {\n\t\tsuper(frameCount, bezierCount, [\n\t\t\tProperty.rgb + \"|\" + slotIndex,\n\t\t\tProperty.alpha + \"|\" + slotIndex\n\t\t]);\n\t\tthis.slotIndex = slotIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 5/*ENTRIES*/;\n\t}\n\n\t/** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */\n\tsetFrame (frame: number, time: number, r: number, g: number, b: number, a: number) {\n\t\tframe *= 5/*ENTRIES*/;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*R*/] = r;\n\t\tthis.frames[frame + 2/*G*/] = g;\n\t\tthis.frames[frame + 3/*B*/] = b;\n\t\tthis.frames[frame + 4/*A*/] = a;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\n\t\tlet frames = this.frames;\n\t\tlet color = slot.color;\n\t\tif (time < frames[0]) {\n\t\t\tlet setup = slot.data.color;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tcolor.setFromColor(setup);\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tcolor.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha,\n\t\t\t\t\t\t(setup.a - color.a) * alpha);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet r = 0, g = 0, b = 0, a = 0;\n\t\tlet i = Timeline.search(frames, time, 5/*ENTRIES*/);\n\t\tlet curveType = this.curves[i / 5/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\ta = frames[i + 4/*A*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 5/*ENTRIES*/] - before);\n\t\t\t\tr += (frames[i + 5/*ENTRIES*/ + 1/*R*/] - r) * t;\n\t\t\t\tg += (frames[i + 5/*ENTRIES*/ + 2/*G*/] - g) * t;\n\t\t\t\tb += (frames[i + 5/*ENTRIES*/ + 3/*B*/] - b) * t;\n\t\t\t\ta += (frames[i + 5/*ENTRIES*/ + 4/*A*/] - a) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\ta = frames[i + 4/*A*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tr = this.getBezierValue(time, i, 1/*R*/, curveType - 2/*BEZIER*/);\n\t\t\t\tg = this.getBezierValue(time, i, 2/*G*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t\t\tb = this.getBezierValue(time, i, 3/*B*/, curveType + 18/*BEZIER_SIZE*/ * 2 - 2/*BEZIER*/);\n\t\t\t\ta = this.getBezierValue(time, i, 4/*A*/, curveType + 18/*BEZIER_SIZE*/ * 3 - 2/*BEZIER*/);\n\t\t}\n\t\tif (alpha == 1)\n\t\t\tcolor.set(r, g, b, a);\n\t\telse {\n\t\t\tif (blend == MixBlend.setup) color.setFromColor(slot.data.color);\n\t\t\tcolor.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);\n\t\t}\n\t}\n}\n\n/** Changes a slot's {@link Slot#color}. */\nexport class RGBTimeline extends CurveTimeline implements SlotTimeline {\n\tslotIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number) {\n\t\tsuper(frameCount, bezierCount, [\n\t\t\tProperty.rgb + \"|\" + slotIndex\n\t\t]);\n\t\tthis.slotIndex = slotIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 4/*ENTRIES*/;\n\t}\n\n\t/** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */\n\tsetFrame (frame: number, time: number, r: number, g: number, b: number) {\n\t\tframe <<= 2;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*R*/] = r;\n\t\tthis.frames[frame + 2/*G*/] = g;\n\t\tthis.frames[frame + 3/*B*/] = b;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\n\t\tlet frames = this.frames;\n\t\tlet color = slot.color;\n\t\tif (time < frames[0]) {\n\t\t\tlet setup = slot.data.color;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tcolor.r = setup.r;\n\t\t\t\t\tcolor.g = setup.g;\n\t\t\t\t\tcolor.b = setup.b;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tcolor.r += (setup.r - color.r) * alpha;\n\t\t\t\t\tcolor.g += (setup.g - color.g) * alpha;\n\t\t\t\t\tcolor.b += (setup.b - color.b) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet r = 0, g = 0, b = 0;\n\t\tlet i = Timeline.search(frames, time, 4/*ENTRIES*/);\n\t\tlet curveType = this.curves[i >> 2];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 4/*ENTRIES*/] - before);\n\t\t\t\tr += (frames[i + 4/*ENTRIES*/ + 1/*R*/] - r) * t;\n\t\t\t\tg += (frames[i + 4/*ENTRIES*/ + 2/*G*/] - g) * t;\n\t\t\t\tb += (frames[i + 4/*ENTRIES*/ + 3/*B*/] - b) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tr = this.getBezierValue(time, i, 1/*R*/, curveType - 2/*BEZIER*/);\n\t\t\t\tg = this.getBezierValue(time, i, 2/*G*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t\t\tb = this.getBezierValue(time, i, 3/*B*/, curveType + 18/*BEZIER_SIZE*/ * 2 - 2/*BEZIER*/);\n\t\t}\n\t\tif (alpha == 1) {\n\t\t\tcolor.r = r;\n\t\t\tcolor.g = g;\n\t\t\tcolor.b = b;\n\t\t} else {\n\t\t\tif (blend == MixBlend.setup) {\n\t\t\t\tlet setup = slot.data.color;\n\t\t\t\tcolor.r = setup.r;\n\t\t\t\tcolor.g = setup.g;\n\t\t\t\tcolor.b = setup.b;\n\t\t\t}\n\t\t\tcolor.r += (r - color.r) * alpha;\n\t\t\tcolor.g += (g - color.g) * alpha;\n\t\t\tcolor.b += (b - color.b) * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */\nexport class AlphaTimeline extends CurveTimeline1 implements SlotTimeline {\n\tslotIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.alpha + \"|\" + slotIndex);\n\t\tthis.slotIndex = slotIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\n\t\tlet color = slot.color;\n\t\tif (time < this.frames[0]) {\n\t\t\tlet setup = slot.data.color;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tcolor.a = setup.a;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tcolor.a += (setup.a - color.a) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet a = this.getCurveValue(time);\n\t\tif (alpha == 1)\n\t\t\tcolor.a = a;\n\t\telse {\n\t\t\tif (blend == MixBlend.setup) color.a = slot.data.color.a;\n\t\t\tcolor.a += (a - color.a) * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a slot's {@link Slot#color} and {@link Slot#darkColor} for two color tinting. */\nexport class RGBA2Timeline extends CurveTimeline implements SlotTimeline {\n\tslotIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number) {\n\t\tsuper(frameCount, bezierCount, [\n\t\t\tProperty.rgb + \"|\" + slotIndex,\n\t\t\tProperty.alpha + \"|\" + slotIndex,\n\t\t\tProperty.rgb2 + \"|\" + slotIndex\n\t\t]);\n\t\tthis.slotIndex = slotIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 8/*ENTRIES*/;\n\t}\n\n\t/** Sets the time in seconds, light, and dark colors for the specified key frame. */\n\tsetFrame (frame: number, time: number, r: number, g: number, b: number, a: number, r2: number, g2: number, b2: number) {\n\t\tframe <<= 3;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*R*/] = r;\n\t\tthis.frames[frame + 2/*G*/] = g;\n\t\tthis.frames[frame + 3/*B*/] = b;\n\t\tthis.frames[frame + 4/*A*/] = a;\n\t\tthis.frames[frame + 5/*R2*/] = r2;\n\t\tthis.frames[frame + 6/*G2*/] = g2;\n\t\tthis.frames[frame + 7/*B2*/] = b2;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\n\t\tlet frames = this.frames;\n\t\tlet light = slot.color, dark = slot.darkColor!;\n\t\tif (time < frames[0]) {\n\t\t\tlet setupLight = slot.data.color, setupDark = slot.data.darkColor!;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tlight.setFromColor(setupLight);\n\t\t\t\t\tdark.r = setupDark.r;\n\t\t\t\t\tdark.g = setupDark.g;\n\t\t\t\t\tdark.b = setupDark.b;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tlight.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha,\n\t\t\t\t\t\t(setupLight.a - light.a) * alpha);\n\t\t\t\t\tdark.r += (setupDark.r - dark.r) * alpha;\n\t\t\t\t\tdark.g += (setupDark.g - dark.g) * alpha;\n\t\t\t\t\tdark.b += (setupDark.b - dark.b) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0;\n\t\tlet i = Timeline.search(frames, time, 8/*ENTRIES*/);\n\t\tlet curveType = this.curves[i >> 3];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\ta = frames[i + 4/*A*/];\n\t\t\t\tr2 = frames[i + 5/*R2*/];\n\t\t\t\tg2 = frames[i + 6/*G2*/];\n\t\t\t\tb2 = frames[i + 7/*B2*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 8/*ENTRIES*/] - before);\n\t\t\t\tr += (frames[i + 8/*ENTRIES*/ + 1/*R*/] - r) * t;\n\t\t\t\tg += (frames[i + 8/*ENTRIES*/ + 2/*G*/] - g) * t;\n\t\t\t\tb += (frames[i + 8/*ENTRIES*/ + 3/*B*/] - b) * t;\n\t\t\t\ta += (frames[i + 8/*ENTRIES*/ + 4/*A*/] - a) * t;\n\t\t\t\tr2 += (frames[i + 8/*ENTRIES*/ + 5/*R2*/] - r2) * t;\n\t\t\t\tg2 += (frames[i + 8/*ENTRIES*/ + 6/*G2*/] - g2) * t;\n\t\t\t\tb2 += (frames[i + 8/*ENTRIES*/ + 7/*B2*/] - b2) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\ta = frames[i + 4/*A*/];\n\t\t\t\tr2 = frames[i + 5/*R2*/];\n\t\t\t\tg2 = frames[i + 6/*G2*/];\n\t\t\t\tb2 = frames[i + 7/*B2*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tr = this.getBezierValue(time, i, 1/*R*/, curveType - 2/*BEZIER*/);\n\t\t\t\tg = this.getBezierValue(time, i, 2/*G*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t\t\tb = this.getBezierValue(time, i, 3/*B*/, curveType + 18/*BEZIER_SIZE*/ * 2 - 2/*BEZIER*/);\n\t\t\t\ta = this.getBezierValue(time, i, 4/*A*/, curveType + 18/*BEZIER_SIZE*/ * 3 - 2/*BEZIER*/);\n\t\t\t\tr2 = this.getBezierValue(time, i, 5/*R2*/, curveType + 18/*BEZIER_SIZE*/ * 4 - 2/*BEZIER*/);\n\t\t\t\tg2 = this.getBezierValue(time, i, 6/*G2*/, curveType + 18/*BEZIER_SIZE*/ * 5 - 2/*BEZIER*/);\n\t\t\t\tb2 = this.getBezierValue(time, i, 7/*B2*/, curveType + 18/*BEZIER_SIZE*/ * 6 - 2/*BEZIER*/);\n\t\t}\n\n\t\tif (alpha == 1) {\n\t\t\tlight.set(r, g, b, a);\n\t\t\tdark.r = r2;\n\t\t\tdark.g = g2;\n\t\t\tdark.b = b2;\n\t\t} else {\n\t\t\tif (blend == MixBlend.setup) {\n\t\t\t\tlight.setFromColor(slot.data.color);\n\t\t\t\tlet setupDark = slot.data.darkColor!;\n\t\t\t\tdark.r = setupDark.r;\n\t\t\t\tdark.g = setupDark.g;\n\t\t\t\tdark.b = setupDark.b;\n\t\t\t}\n\t\t\tlight.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha);\n\t\t\tdark.r += (r2 - dark.r) * alpha;\n\t\t\tdark.g += (g2 - dark.g) * alpha;\n\t\t\tdark.b += (b2 - dark.b) * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a slot's {@link Slot#color} and {@link Slot#darkColor} for two color tinting. */\nexport class RGB2Timeline extends CurveTimeline implements SlotTimeline {\n\tslotIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number) {\n\t\tsuper(frameCount, bezierCount, [\n\t\t\tProperty.rgb + \"|\" + slotIndex,\n\t\t\tProperty.rgb2 + \"|\" + slotIndex\n\t\t]);\n\t\tthis.slotIndex = slotIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 7/*ENTRIES*/;\n\t}\n\n\t/** Sets the time in seconds, light, and dark colors for the specified key frame. */\n\tsetFrame (frame: number, time: number, r: number, g: number, b: number, r2: number, g2: number, b2: number) {\n\t\tframe *= 7/*ENTRIES*/;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*R*/] = r;\n\t\tthis.frames[frame + 2/*G*/] = g;\n\t\tthis.frames[frame + 3/*B*/] = b;\n\t\tthis.frames[frame + 4/*R2*/] = r2;\n\t\tthis.frames[frame + 5/*G2*/] = g2;\n\t\tthis.frames[frame + 6/*B2*/] = b2;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\n\t\tlet frames = this.frames;\n\t\tlet light = slot.color, dark = slot.darkColor!;\n\t\tif (time < frames[0]) {\n\t\t\tlet setupLight = slot.data.color, setupDark = slot.data.darkColor!;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tlight.r = setupLight.r;\n\t\t\t\t\tlight.g = setupLight.g;\n\t\t\t\t\tlight.b = setupLight.b;\n\t\t\t\t\tdark.r = setupDark.r;\n\t\t\t\t\tdark.g = setupDark.g;\n\t\t\t\t\tdark.b = setupDark.b;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tlight.r += (setupLight.r - light.r) * alpha;\n\t\t\t\t\tlight.g += (setupLight.g - light.g) * alpha;\n\t\t\t\t\tlight.b += (setupLight.b - light.b) * alpha;\n\t\t\t\t\tdark.r += (setupDark.r - dark.r) * alpha;\n\t\t\t\t\tdark.g += (setupDark.g - dark.g) * alpha;\n\t\t\t\t\tdark.b += (setupDark.b - dark.b) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0;\n\t\tlet i = Timeline.search(frames, time, 7/*ENTRIES*/);\n\t\tlet curveType = this.curves[i / 7/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\tr2 = frames[i + 4/*R2*/];\n\t\t\t\tg2 = frames[i + 5/*G2*/];\n\t\t\t\tb2 = frames[i + 6/*B2*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 7/*ENTRIES*/] - before);\n\t\t\t\tr += (frames[i + 7/*ENTRIES*/ + 1/*R*/] - r) * t;\n\t\t\t\tg += (frames[i + 7/*ENTRIES*/ + 2/*G*/] - g) * t;\n\t\t\t\tb += (frames[i + 7/*ENTRIES*/ + 3/*B*/] - b) * t;\n\t\t\t\tr2 += (frames[i + 7/*ENTRIES*/ + 4/*R2*/] - r2) * t;\n\t\t\t\tg2 += (frames[i + 7/*ENTRIES*/ + 5/*G2*/] - g2) * t;\n\t\t\t\tb2 += (frames[i + 7/*ENTRIES*/ + 6/*B2*/] - b2) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\tr2 = frames[i + 4/*R2*/];\n\t\t\t\tg2 = frames[i + 5/*G2*/];\n\t\t\t\tb2 = frames[i + 6/*B2*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tr = this.getBezierValue(time, i, 1/*R*/, curveType - 2/*BEZIER*/);\n\t\t\t\tg = this.getBezierValue(time, i, 2/*G*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t\t\tb = this.getBezierValue(time, i, 3/*B*/, curveType + 18/*BEZIER_SIZE*/ * 2 - 2/*BEZIER*/);\n\t\t\t\tr2 = this.getBezierValue(time, i, 4/*R2*/, curveType + 18/*BEZIER_SIZE*/ * 3 - 2/*BEZIER*/);\n\t\t\t\tg2 = this.getBezierValue(time, i, 5/*G2*/, curveType + 18/*BEZIER_SIZE*/ * 4 - 2/*BEZIER*/);\n\t\t\t\tb2 = this.getBezierValue(time, i, 6/*B2*/, curveType + 18/*BEZIER_SIZE*/ * 5 - 2/*BEZIER*/);\n\t\t}\n\n\t\tif (alpha == 1) {\n\t\t\tlight.r = r;\n\t\t\tlight.g = g;\n\t\t\tlight.b = b;\n\t\t\tdark.r = r2;\n\t\t\tdark.g = g2;\n\t\t\tdark.b = b2;\n\t\t} else {\n\t\t\tif (blend == MixBlend.setup) {\n\t\t\t\tlet setupLight = slot.data.color, setupDark = slot.data.darkColor!;\n\t\t\t\tlight.r = setupLight.r;\n\t\t\t\tlight.g = setupLight.g;\n\t\t\t\tlight.b = setupLight.b;\n\t\t\t\tdark.r = setupDark.r;\n\t\t\t\tdark.g = setupDark.g;\n\t\t\t\tdark.b = setupDark.b;\n\t\t\t}\n\t\t\tlight.r += (r - light.r) * alpha;\n\t\t\tlight.g += (g - light.g) * alpha;\n\t\t\tlight.b += (b - light.b) * alpha;\n\t\t\tdark.r += (r2 - dark.r) * alpha;\n\t\t\tdark.g += (g2 - dark.g) * alpha;\n\t\t\tdark.b += (b2 - dark.b) * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a slot's {@link Slot#attachment}. */\nexport class AttachmentTimeline extends Timeline implements SlotTimeline {\n\tslotIndex = 0;\n\n\t/** The attachment name for each key frame. May contain null values to clear the attachment. */\n\tattachmentNames: Array<string | null>;\n\n\tconstructor (frameCount: number, slotIndex: number) {\n\t\tsuper(frameCount, [\n\t\t\tProperty.attachment + \"|\" + slotIndex\n\t\t]);\n\t\tthis.slotIndex = slotIndex;\n\t\tthis.attachmentNames = new Array<string>(frameCount);\n\t}\n\n\tgetFrameCount () {\n\t\treturn this.frames.length;\n\t}\n\n\t/** Sets the time in seconds and the attachment name for the specified key frame. */\n\tsetFrame (frame: number, time: number, attachmentName: string | null) {\n\t\tthis.frames[frame] = time;\n\t\tthis.attachmentNames[frame] = attachmentName;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\n\t\tif (direction == MixDirection.mixOut) {\n\t\t\tif (blend == MixBlend.setup) this.setAttachment(skeleton, slot, slot.data.attachmentName);\n\t\t\treturn;\n\t\t}\n\n\t\tif (time < this.frames[0]) {\n\t\t\tif (blend == MixBlend.setup || blend == MixBlend.first) this.setAttachment(skeleton, slot, slot.data.attachmentName);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setAttachment(skeleton, slot, this.attachmentNames[Timeline.search1(this.frames, time)]);\n\t}\n\n\tsetAttachment (skeleton: Skeleton, slot: Slot, attachmentName: string | null) {\n\t\tslot.setAttachment(!attachmentName ? null : skeleton.getAttachment(this.slotIndex, attachmentName));\n\t}\n}\n\n/** Changes a slot's {@link Slot#deform} to deform a {@link VertexAttachment}. */\nexport class DeformTimeline extends CurveTimeline implements SlotTimeline {\n\tslotIndex = 0;\n\n\t/** The attachment that will be deformed. */\n\tattachment: VertexAttachment;\n\n\t/** The vertices for each key frame. */\n\tvertices: Array<NumberArrayLike>;\n\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number, attachment: VertexAttachment) {\n\t\tsuper(frameCount, bezierCount, [\n\t\t\tProperty.deform + \"|\" + slotIndex + \"|\" + attachment.id\n\t\t]);\n\t\tthis.slotIndex = slotIndex;\n\t\tthis.attachment = attachment;\n\t\tthis.vertices = new Array<NumberArrayLike>(frameCount);\n\t}\n\n\tgetFrameCount () {\n\t\treturn this.frames.length;\n\t}\n\n\t/** Sets the time in seconds and the vertices for the specified key frame.\n\t * @param vertices Vertex positions for an unweighted VertexAttachment, or deform offsets if it has weights. */\n\tsetFrame (frame: number, time: number, vertices: NumberArrayLike) {\n\t\tthis.frames[frame] = time;\n\t\tthis.vertices[frame] = vertices;\n\t}\n\n\t/** @param value1 Ignored (0 is used for a deform timeline).\n\t * @param value2 Ignored (1 is used for a deform timeline). */\n\tsetBezier (bezier: number, frame: number, value: number, time1: number, value1: number, cx1: number, cy1: number, cx2: number,\n\t\tcy2: number, time2: number, value2: number) {\n\t\tlet curves = this.curves;\n\t\tlet i = this.getFrameCount() + bezier * 18/*BEZIER_SIZE*/;\n\t\tif (value == 0) curves[frame] = 2/*BEZIER*/ + i;\n\t\tlet tmpx = (time1 - cx1 * 2 + cx2) * 0.03, tmpy = cy2 * 0.03 - cy1 * 0.06;\n\t\tlet dddx = ((cx1 - cx2) * 3 - time1 + time2) * 0.006, dddy = (cy1 - cy2 + 0.33333333) * 0.018;\n\t\tlet ddx = tmpx * 2 + dddx, ddy = tmpy * 2 + dddy;\n\t\tlet dx = (cx1 - time1) * 0.3 + tmpx + dddx * 0.16666667, dy = cy1 * 0.3 + tmpy + dddy * 0.16666667;\n\t\tlet x = time1 + dx, y = dy;\n\t\tfor (let n = i + 18/*BEZIER_SIZE*/; i < n; i += 2) {\n\t\t\tcurves[i] = x;\n\t\t\tcurves[i + 1] = y;\n\t\t\tdx += ddx;\n\t\t\tdy += ddy;\n\t\t\tddx += dddx;\n\t\t\tddy += dddy;\n\t\t\tx += dx;\n\t\t\ty += dy;\n\t\t}\n\t}\n\n\tgetCurvePercent (time: number, frame: number) {\n\t\tlet curves = this.curves;\n\t\tlet i = curves[frame];\n\t\tswitch (i) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet x = this.frames[frame];\n\t\t\t\treturn (time - x) / (this.frames[frame + this.getFrameEntries()] - x);\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\treturn 0;\n\t\t}\n\t\ti -= 2/*BEZIER*/;\n\t\tif (curves[i] > time) {\n\t\t\tlet x = this.frames[frame];\n\t\t\treturn curves[i + 1] * (time - x) / (curves[i] - x);\n\t\t}\n\t\tlet n = i + 18/*BEZIER_SIZE*/;\n\t\tfor (i += 2; i < n; i += 2) {\n\t\t\tif (curves[i] >= time) {\n\t\t\t\tlet x = curves[i - 2], y = curves[i - 1];\n\t\t\t\treturn y + (time - x) / (curves[i] - x) * (curves[i + 1] - y);\n\t\t\t}\n\t\t}\n\t\tlet x = curves[n - 2], y = curves[n - 1];\n\t\treturn y + (1 - y) * (time - x) / (this.frames[frame + this.getFrameEntries()] - x);\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet slot: Slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\t\tlet slotAttachment: Attachment | null = slot.getAttachment();\n\t\tif (!slotAttachment) return;\n\t\tif (!(slotAttachment instanceof VertexAttachment) || (<VertexAttachment>slotAttachment).timelineAttachment != this.attachment) return;\n\n\t\tlet deform: Array<number> = slot.deform;\n\t\tif (deform.length == 0) blend = MixBlend.setup;\n\n\t\tlet vertices = this.vertices;\n\t\tlet vertexCount = vertices[0].length;\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tdeform.length = 0;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tif (alpha == 1) {\n\t\t\t\t\t\tdeform.length = 0;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tdeform.length = vertexCount;\n\t\t\t\t\tlet vertexAttachment = <VertexAttachment>slotAttachment;\n\t\t\t\t\tif (!vertexAttachment.bones) {\n\t\t\t\t\t\t// Unweighted vertex positions.\n\t\t\t\t\t\tlet setupVertices = vertexAttachment.vertices;\n\t\t\t\t\t\tfor (var i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\tdeform[i] += (setupVertices[i] - deform[i]) * alpha;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Weighted deform offsets.\n\t\t\t\t\t\talpha = 1 - alpha;\n\t\t\t\t\t\tfor (var i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\tdeform[i] *= alpha;\n\t\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tdeform.length = vertexCount;\n\t\tif (time >= frames[frames.length - 1]) {\n\t\t\tlet lastVertices = vertices[frames.length - 1];\n\t\t\tif (alpha == 1) {\n\t\t\t\tif (blend == MixBlend.add) {\n\t\t\t\t\tlet vertexAttachment = slotAttachment as VertexAttachment;\n\t\t\t\t\tif (!vertexAttachment.bones) {\n\t\t\t\t\t\t// Unweighted vertex positions, with alpha.\n\t\t\t\t\t\tlet setupVertices = vertexAttachment.vertices;\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\tdeform[i] += lastVertices[i] - setupVertices[i];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Weighted deform offsets, with alpha.\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\tdeform[i] += lastVertices[i];\n\t\t\t\t\t}\n\t\t\t\t} else\n\t\t\t\t\tUtils.arrayCopy(lastVertices, 0, deform, 0, vertexCount);\n\t\t\t} else {\n\t\t\t\tswitch (blend) {\n\t\t\t\t\tcase MixBlend.setup: {\n\t\t\t\t\t\tlet vertexAttachment = slotAttachment as VertexAttachment;\n\t\t\t\t\t\tif (!vertexAttachment.bones) {\n\t\t\t\t\t\t\t// Unweighted vertex positions, with alpha.\n\t\t\t\t\t\t\tlet setupVertices = vertexAttachment.vertices;\n\t\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\t\t\tlet setup = setupVertices[i];\n\t\t\t\t\t\t\t\tdeform[i] = setup + (lastVertices[i] - setup) * alpha;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Weighted deform offsets, with alpha.\n\t\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\t\tdeform[i] = lastVertices[i] * alpha;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tcase MixBlend.replace:\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\tdeform[i] += (lastVertices[i] - deform[i]) * alpha;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MixBlend.add:\n\t\t\t\t\t\tlet vertexAttachment = slotAttachment as VertexAttachment;\n\t\t\t\t\t\tif (!vertexAttachment.bones) {\n\t\t\t\t\t\t\t// Unweighted vertex positions, with alpha.\n\t\t\t\t\t\t\tlet setupVertices = vertexAttachment.vertices;\n\t\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\t\tdeform[i] += (lastVertices[i] - setupVertices[i]) * alpha;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Weighted deform offsets, with alpha.\n\t\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\t\tdeform[i] += lastVertices[i] * alpha;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Interpolate between the previous frame and the current frame.\n\t\tlet frame = Timeline.search1(frames, time);\n\t\tlet percent = this.getCurvePercent(time, frame);\n\t\tlet prevVertices = vertices[frame];\n\t\tlet nextVertices = vertices[frame + 1];\n\n\t\tif (alpha == 1) {\n\t\t\tif (blend == MixBlend.add) {\n\t\t\t\tlet vertexAttachment = slotAttachment as VertexAttachment;\n\t\t\t\tif (!vertexAttachment.bones) {\n\t\t\t\t\t// Unweighted vertex positions, with alpha.\n\t\t\t\t\tlet setupVertices = vertexAttachment.vertices;\n\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\tlet prev = prevVertices[i];\n\t\t\t\t\t\tdeform[i] += prev + (nextVertices[i] - prev) * percent - setupVertices[i];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Weighted deform offsets, with alpha.\n\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\tlet prev = prevVertices[i];\n\t\t\t\t\t\tdeform[i] += prev + (nextVertices[i] - prev) * percent;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\tlet prev = prevVertices[i];\n\t\t\t\t\tdeform[i] = prev + (nextVertices[i] - prev) * percent;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup: {\n\t\t\t\t\tlet vertexAttachment = slotAttachment as VertexAttachment;\n\t\t\t\t\tif (!vertexAttachment.bones) {\n\t\t\t\t\t\t// Unweighted vertex positions, with alpha.\n\t\t\t\t\t\tlet setupVertices = vertexAttachment.vertices;\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\t\tlet prev = prevVertices[i], setup = setupVertices[i];\n\t\t\t\t\t\t\tdeform[i] = setup + (prev + (nextVertices[i] - prev) * percent - setup) * alpha;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Weighted deform offsets, with alpha.\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\t\tlet prev = prevVertices[i];\n\t\t\t\t\t\t\tdeform[i] = (prev + (nextVertices[i] - prev) * percent) * alpha;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase MixBlend.first:\n\t\t\t\tcase MixBlend.replace:\n\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\tlet prev = prevVertices[i];\n\t\t\t\t\t\tdeform[i] += (prev + (nextVertices[i] - prev) * percent - deform[i]) * alpha;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase MixBlend.add:\n\t\t\t\t\tlet vertexAttachment = slotAttachment as VertexAttachment;\n\t\t\t\t\tif (!vertexAttachment.bones) {\n\t\t\t\t\t\t// Unweighted vertex positions, with alpha.\n\t\t\t\t\t\tlet setupVertices = vertexAttachment.vertices;\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\t\tlet prev = prevVertices[i];\n\t\t\t\t\t\t\tdeform[i] += (prev + (nextVertices[i] - prev) * percent - setupVertices[i]) * alpha;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Weighted deform offsets, with alpha.\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\t\tlet prev = prevVertices[i];\n\t\t\t\t\t\t\tdeform[i] += (prev + (nextVertices[i] - prev) * percent) * alpha;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Fires an {@link Event} when specific animation times are reached. */\nexport class EventTimeline extends Timeline {\n\tstatic propertyIds = [\"\" + Property.event];\n\n\t/** The event for each key frame. */\n\tevents: Array<Event>;\n\n\tconstructor (frameCount: number) {\n\t\tsuper(frameCount, EventTimeline.propertyIds);\n\n\t\tthis.events = new Array<Event>(frameCount);\n\t}\n\n\tgetFrameCount () {\n\t\treturn this.frames.length;\n\t}\n\n\t/** Sets the time in seconds and the event for the specified key frame. */\n\tsetFrame (frame: number, event: Event) {\n\t\tthis.frames[frame] = event.time;\n\t\tthis.events[frame] = event;\n\t}\n\n\t/** Fires events for frames > `lastTime` and <= `time`. */\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tif (!firedEvents) return;\n\n\t\tlet frames = this.frames;\n\t\tlet frameCount = this.frames.length;\n\n\t\tif (lastTime > time) { // Apply after lastTime for looped animations.\n\t\t\tthis.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction);\n\t\t\tlastTime = -1;\n\t\t} else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame.\n\t\t\treturn;\n\t\tif (time < frames[0]) return;\n\n\t\tlet i = 0;\n\t\tif (lastTime < frames[0])\n\t\t\ti = 0;\n\t\telse {\n\t\t\ti = Timeline.search1(frames, lastTime) + 1;\n\t\t\tlet frameTime = frames[i];\n\t\t\twhile (i > 0) { // Fire multiple events with the same frame.\n\t\t\t\tif (frames[i - 1] != frameTime) break;\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\t\tfor (; i < frameCount && time >= frames[i]; i++)\n\t\t\tfiredEvents.push(this.events[i]);\n\t}\n}\n\n/** Changes a skeleton's {@link Skeleton#drawOrder}. */\nexport class DrawOrderTimeline extends Timeline {\n\tstatic propertyIds = [\"\" + Property.drawOrder];\n\n\t/** The draw order for each key frame. See {@link #setFrame(int, float, int[])}. */\n\tdrawOrders: Array<Array<number> | null>;\n\n\tconstructor (frameCount: number) {\n\t\tsuper(frameCount, DrawOrderTimeline.propertyIds);\n\t\tthis.drawOrders = new Array<Array<number> | null>(frameCount);\n\t}\n\n\tgetFrameCount () {\n\t\treturn this.frames.length;\n\t}\n\n\t/** Sets the time in seconds and the draw order for the specified key frame.\n\t * @param drawOrder For each slot in {@link Skeleton#slots}, the index of the new draw order. May be null to use setup pose\n\t * draw order. */\n\tsetFrame (frame: number, time: number, drawOrder: Array<number> | null) {\n\t\tthis.frames[frame] = time;\n\t\tthis.drawOrders[frame] = drawOrder;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tif (direction == MixDirection.mixOut) {\n\t\t\tif (blend == MixBlend.setup) Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\n\t\t\treturn;\n\t\t}\n\n\t\tif (time < this.frames[0]) {\n\t\t\tif (blend == MixBlend.setup || blend == MixBlend.first) Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\n\t\t\treturn;\n\t\t}\n\n\t\tlet idx = Timeline.search1(this.frames, time);\n\t\tlet drawOrderToSetupIndex = this.drawOrders[idx];\n\t\tif (!drawOrderToSetupIndex)\n\t\t\tUtils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\n\t\telse {\n\t\t\tlet drawOrder: Array<Slot> = skeleton.drawOrder;\n\t\t\tlet slots: Array<Slot> = skeleton.slots;\n\t\t\tfor (let i = 0, n = drawOrderToSetupIndex.length; i < n; i++)\n\t\t\t\tdrawOrder[i] = slots[drawOrderToSetupIndex[i]];\n\t\t}\n\t}\n}\n\n/** Changes an IK constraint's {@link IkConstraint#mix}, {@link IkConstraint#softness},\n * {@link IkConstraint#bendDirection}, {@link IkConstraint#stretch}, and {@link IkConstraint#compress}. */\nexport class IkConstraintTimeline extends CurveTimeline {\n\t/** The index of the IK constraint in {@link Skeleton#getIkConstraints()} that will be changed when this timeline is applied */\n\tconstraintIndex: number = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, ikConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, [\n\t\t\tProperty.ikConstraint + \"|\" + ikConstraintIndex\n\t\t]);\n\t\tthis.constraintIndex = ikConstraintIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 6/*ENTRIES*/;\n\t}\n\n\t/** Sets the time in seconds, mix, softness, bend direction, compress, and stretch for the specified key frame. */\n\tsetFrame (frame: number, time: number, mix: number, softness: number, bendDirection: number, compress: boolean, stretch: boolean) {\n\t\tframe *= 6/*ENTRIES*/;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*MIX*/] = mix;\n\t\tthis.frames[frame + 2/*SOFTNESS*/] = softness;\n\t\tthis.frames[frame + 3/*BEND_DIRECTION*/] = bendDirection;\n\t\tthis.frames[frame + 4/*COMPRESS*/] = compress ? 1 : 0;\n\t\tthis.frames[frame + 5/*STRETCH*/] = stretch ? 1 : 0;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet constraint: IkConstraint = skeleton.ikConstraints[this.constraintIndex];\n\t\tif (!constraint.active) return;\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tconstraint.mix = constraint.data.mix;\n\t\t\t\t\tconstraint.softness = constraint.data.softness;\n\t\t\t\t\tconstraint.bendDirection = constraint.data.bendDirection;\n\t\t\t\t\tconstraint.compress = constraint.data.compress;\n\t\t\t\t\tconstraint.stretch = constraint.data.stretch;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tconstraint.mix += (constraint.data.mix - constraint.mix) * alpha;\n\t\t\t\t\tconstraint.softness += (constraint.data.softness - constraint.softness) * alpha;\n\t\t\t\t\tconstraint.bendDirection = constraint.data.bendDirection;\n\t\t\t\t\tconstraint.compress = constraint.data.compress;\n\t\t\t\t\tconstraint.stretch = constraint.data.stretch;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet mix = 0, softness = 0;\n\t\tlet i = Timeline.search(frames, time, 6/*ENTRIES*/)\n\t\tlet curveType = this.curves[i / 6/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\tmix = frames[i + 1/*MIX*/];\n\t\t\t\tsoftness = frames[i + 2/*SOFTNESS*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 6/*ENTRIES*/] - before);\n\t\t\t\tmix += (frames[i + 6/*ENTRIES*/ + 1/*MIX*/] - mix) * t;\n\t\t\t\tsoftness += (frames[i + 6/*ENTRIES*/ + 2/*SOFTNESS*/] - softness) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tmix = frames[i + 1/*MIX*/];\n\t\t\t\tsoftness = frames[i + 2/*SOFTNESS*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmix = this.getBezierValue(time, i, 1/*MIX*/, curveType - 2/*BEZIER*/);\n\t\t\t\tsoftness = this.getBezierValue(time, i, 2/*SOFTNESS*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t}\n\n\t\tif (blend == MixBlend.setup) {\n\t\t\tconstraint.mix = constraint.data.mix + (mix - constraint.data.mix) * alpha;\n\t\t\tconstraint.softness = constraint.data.softness + (softness - constraint.data.softness) * alpha;\n\n\t\t\tif (direction == MixDirection.mixOut) {\n\t\t\t\tconstraint.bendDirection = constraint.data.bendDirection;\n\t\t\t\tconstraint.compress = constraint.data.compress;\n\t\t\t\tconstraint.stretch = constraint.data.stretch;\n\t\t\t} else {\n\t\t\t\tconstraint.bendDirection = frames[i + 3/*BEND_DIRECTION*/];\n\t\t\t\tconstraint.compress = frames[i + 4/*COMPRESS*/] != 0;\n\t\t\t\tconstraint.stretch = frames[i + 5/*STRETCH*/] != 0;\n\t\t\t}\n\t\t} else {\n\t\t\tconstraint.mix += (mix - constraint.mix) * alpha;\n\t\t\tconstraint.softness += (softness - constraint.softness) * alpha;\n\t\t\tif (direction == MixDirection.mixIn) {\n\t\t\t\tconstraint.bendDirection = frames[i + 3/*BEND_DIRECTION*/];\n\t\t\t\tconstraint.compress = frames[i + 4/*COMPRESS*/] != 0;\n\t\t\t\tconstraint.stretch = frames[i + 5/*STRETCH*/] != 0;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Changes a transform constraint's {@link TransformConstraint#rotateMix}, {@link TransformConstraint#translateMix},\n * {@link TransformConstraint#scaleMix}, and {@link TransformConstraint#shearMix}. */\nexport class TransformConstraintTimeline extends CurveTimeline {\n\t/** The index of the transform constraint slot in {@link Skeleton#transformConstraints} that will be changed. */\n\tconstraintIndex: number = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, transformConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, [\n\t\t\tProperty.transformConstraint + \"|\" + transformConstraintIndex\n\t\t]);\n\t\tthis.constraintIndex = transformConstraintIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 7/*ENTRIES*/;\n\t}\n\n\t/** The time in seconds, rotate mix, translate mix, scale mix, and shear mix for the specified key frame. */\n\tsetFrame (frame: number, time: number, mixRotate: number, mixX: number, mixY: number, mixScaleX: number, mixScaleY: number,\n\t\tmixShearY: number) {\n\t\tlet frames = this.frames;\n\t\tframe *= 7/*ENTRIES*/;\n\t\tframes[frame] = time;\n\t\tframes[frame + 1/*ROTATE*/] = mixRotate;\n\t\tframes[frame + 2/*X*/] = mixX;\n\t\tframes[frame + 3/*Y*/] = mixY;\n\t\tframes[frame + 4/*SCALEX*/] = mixScaleX;\n\t\tframes[frame + 5/*SCALEY*/] = mixScaleY;\n\t\tframes[frame + 6/*SHEARY*/] = mixShearY;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet constraint: TransformConstraint = skeleton.transformConstraints[this.constraintIndex];\n\t\tif (!constraint.active) return;\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tlet data = constraint.data;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tconstraint.mixRotate = data.mixRotate;\n\t\t\t\t\tconstraint.mixX = data.mixX;\n\t\t\t\t\tconstraint.mixY = data.mixY;\n\t\t\t\t\tconstraint.mixScaleX = data.mixScaleX;\n\t\t\t\t\tconstraint.mixScaleY = data.mixScaleY;\n\t\t\t\t\tconstraint.mixShearY = data.mixShearY;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tconstraint.mixRotate += (data.mixRotate - constraint.mixRotate) * alpha;\n\t\t\t\t\tconstraint.mixX += (data.mixX - constraint.mixX) * alpha;\n\t\t\t\t\tconstraint.mixY += (data.mixY - constraint.mixY) * alpha;\n\t\t\t\t\tconstraint.mixScaleX += (data.mixScaleX - constraint.mixScaleX) * alpha;\n\t\t\t\t\tconstraint.mixScaleY += (data.mixScaleY - constraint.mixScaleY) * alpha;\n\t\t\t\t\tconstraint.mixShearY += (data.mixShearY - constraint.mixShearY) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet rotate, x, y, scaleX, scaleY, shearY;\n\t\tlet i = Timeline.search(frames, time, 7/*ENTRIES*/);\n\t\tlet curveType = this.curves[i / 7/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\trotate = frames[i + 1/*ROTATE*/];\n\t\t\t\tx = frames[i + 2/*X*/];\n\t\t\t\ty = frames[i + 3/*Y*/];\n\t\t\t\tscaleX = frames[i + 4/*SCALEX*/];\n\t\t\t\tscaleY = frames[i + 5/*SCALEY*/];\n\t\t\t\tshearY = frames[i + 6/*SHEARY*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 7/*ENTRIES*/] - before);\n\t\t\t\trotate += (frames[i + 7/*ENTRIES*/ + 1/*ROTATE*/] - rotate) * t;\n\t\t\t\tx += (frames[i + 7/*ENTRIES*/ + 2/*X*/] - x) * t;\n\t\t\t\ty += (frames[i + 7/*ENTRIES*/ + 3/*Y*/] - y) * t;\n\t\t\t\tscaleX += (frames[i + 7/*ENTRIES*/ + 4/*SCALEX*/] - scaleX) * t;\n\t\t\t\tscaleY += (frames[i + 7/*ENTRIES*/ + 5/*SCALEY*/] - scaleY) * t;\n\t\t\t\tshearY += (frames[i + 7/*ENTRIES*/ + 6/*SHEARY*/] - shearY) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\trotate = frames[i + 1/*ROTATE*/];\n\t\t\t\tx = frames[i + 2/*X*/];\n\t\t\t\ty = frames[i + 3/*Y*/];\n\t\t\t\tscaleX = frames[i + 4/*SCALEX*/];\n\t\t\t\tscaleY = frames[i + 5/*SCALEY*/];\n\t\t\t\tshearY = frames[i + 6/*SHEARY*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\trotate = this.getBezierValue(time, i, 1/*ROTATE*/, curveType - 2/*BEZIER*/);\n\t\t\t\tx = this.getBezierValue(time, i, 2/*X*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t\t\ty = this.getBezierValue(time, i, 3/*Y*/, curveType + 18/*BEZIER_SIZE*/ * 2 - 2/*BEZIER*/);\n\t\t\t\tscaleX = this.getBezierValue(time, i, 4/*SCALEX*/, curveType + 18/*BEZIER_SIZE*/ * 3 - 2/*BEZIER*/);\n\t\t\t\tscaleY = this.getBezierValue(time, i, 5/*SCALEY*/, curveType + 18/*BEZIER_SIZE*/ * 4 - 2/*BEZIER*/);\n\t\t\t\tshearY = this.getBezierValue(time, i, 6/*SHEARY*/, curveType + 18/*BEZIER_SIZE*/ * 5 - 2/*BEZIER*/);\n\t\t}\n\n\t\tif (blend == MixBlend.setup) {\n\t\t\tlet data = constraint.data;\n\t\t\tconstraint.mixRotate = data.mixRotate + (rotate - data.mixRotate) * alpha;\n\t\t\tconstraint.mixX = data.mixX + (x - data.mixX) * alpha;\n\t\t\tconstraint.mixY = data.mixY + (y - data.mixY) * alpha;\n\t\t\tconstraint.mixScaleX = data.mixScaleX + (scaleX - data.mixScaleX) * alpha;\n\t\t\tconstraint.mixScaleY = data.mixScaleY + (scaleY - data.mixScaleY) * alpha;\n\t\t\tconstraint.mixShearY = data.mixShearY + (shearY - data.mixShearY) * alpha;\n\t\t} else {\n\t\t\tconstraint.mixRotate += (rotate - constraint.mixRotate) * alpha;\n\t\t\tconstraint.mixX += (x - constraint.mixX) * alpha;\n\t\t\tconstraint.mixY += (y - constraint.mixY) * alpha;\n\t\t\tconstraint.mixScaleX += (scaleX - constraint.mixScaleX) * alpha;\n\t\t\tconstraint.mixScaleY += (scaleY - constraint.mixScaleY) * alpha;\n\t\t\tconstraint.mixShearY += (shearY - constraint.mixShearY) * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a path constraint's {@link PathConstraint#position}. */\nexport class PathConstraintPositionTimeline extends CurveTimeline1 {\n\t/** The index of the path constraint in {@link Skeleton#getPathConstraints()} that will be changed when this timeline is\n\t * applied. */\n\tconstraintIndex: number = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, pathConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.pathConstraintPosition + \"|\" + pathConstraintIndex);\n\t\tthis.constraintIndex = pathConstraintIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet constraint: PathConstraint = skeleton.pathConstraints[this.constraintIndex];\n\t\tif (constraint.active)\n\t\t\tconstraint.position = this.getAbsoluteValue(time, alpha, blend, constraint.position, constraint.data.position);\n\t}\n}\n\n/** Changes a path constraint's {@link PathConstraint#spacing}. */\nexport class PathConstraintSpacingTimeline extends CurveTimeline1 {\n\t/** The index of the path constraint in {@link Skeleton#getPathConstraints()} that will be changed when this timeline is\n\t * applied. */\n\tconstraintIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, pathConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.pathConstraintSpacing + \"|\" + pathConstraintIndex);\n\t\tthis.constraintIndex = pathConstraintIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet constraint: PathConstraint = skeleton.pathConstraints[this.constraintIndex];\n\t\tif (constraint.active)\n\t\t\tconstraint.spacing = this.getAbsoluteValue(time, alpha, blend, constraint.spacing, constraint.data.spacing);\n\t}\n}\n\n/** Changes a transform constraint's {@link PathConstraint#getMixRotate()}, {@link PathConstraint#getMixX()}, and\n * {@link PathConstraint#getMixY()}. */\nexport class PathConstraintMixTimeline extends CurveTimeline {\n\t/** The index of the path constraint in {@link Skeleton#getPathConstraints()} that will be changed when this timeline is\n\t * applied. */\n\tconstraintIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, pathConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, [\n\t\t\tProperty.pathConstraintMix + \"|\" + pathConstraintIndex\n\t\t]);\n\t\tthis.constraintIndex = pathConstraintIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 4/*ENTRIES*/;\n\t}\n\n\tsetFrame (frame: number, time: number, mixRotate: number, mixX: number, mixY: number) {\n\t\tlet frames = this.frames;\n\t\tframe <<= 2;\n\t\tframes[frame] = time;\n\t\tframes[frame + 1/*ROTATE*/] = mixRotate;\n\t\tframes[frame + 2/*X*/] = mixX;\n\t\tframes[frame + 3/*Y*/] = mixY;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet constraint: PathConstraint = skeleton.pathConstraints[this.constraintIndex];\n\t\tif (!constraint.active) return;\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tconstraint.mixRotate = constraint.data.mixRotate;\n\t\t\t\t\tconstraint.mixX = constraint.data.mixX;\n\t\t\t\t\tconstraint.mixY = constraint.data.mixY;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tconstraint.mixRotate += (constraint.data.mixRotate - constraint.mixRotate) * alpha;\n\t\t\t\t\tconstraint.mixX += (constraint.data.mixX - constraint.mixX) * alpha;\n\t\t\t\t\tconstraint.mixY += (constraint.data.mixY - constraint.mixY) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet rotate, x, y;\n\t\tlet i = Timeline.search(frames, time, 4/*ENTRIES*/);\n\t\tlet curveType = this.curves[i >> 2];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\trotate = frames[i + 1/*ROTATE*/];\n\t\t\t\tx = frames[i + 2/*X*/];\n\t\t\t\ty = frames[i + 3/*Y*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 4/*ENTRIES*/] - before);\n\t\t\t\trotate += (frames[i + 4/*ENTRIES*/ + 1/*ROTATE*/] - rotate) * t;\n\t\t\t\tx += (frames[i + 4/*ENTRIES*/ + 2/*X*/] - x) * t;\n\t\t\t\ty += (frames[i + 4/*ENTRIES*/ + 3/*Y*/] - y) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\trotate = frames[i + 1/*ROTATE*/];\n\t\t\t\tx = frames[i + 2/*X*/];\n\t\t\t\ty = frames[i + 3/*Y*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\trotate = this.getBezierValue(time, i, 1/*ROTATE*/, curveType - 2/*BEZIER*/);\n\t\t\t\tx = this.getBezierValue(time, i, 2/*X*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t\t\ty = this.getBezierValue(time, i, 3/*Y*/, curveType + 18/*BEZIER_SIZE*/ * 2 - 2/*BEZIER*/);\n\t\t}\n\n\t\tif (blend == MixBlend.setup) {\n\t\t\tlet data = constraint.data;\n\t\t\tconstraint.mixRotate = data.mixRotate + (rotate - data.mixRotate) * alpha;\n\t\t\tconstraint.mixX = data.mixX + (x - data.mixX) * alpha;\n\t\t\tconstraint.mixY = data.mixY + (y - data.mixY) * alpha;\n\t\t} else {\n\t\t\tconstraint.mixRotate += (rotate - constraint.mixRotate) * alpha;\n\t\t\tconstraint.mixX += (x - constraint.mixX) * alpha;\n\t\t\tconstraint.mixY += (y - constraint.mixY) * alpha;\n\t\t}\n\t}\n}\n\n/** The base class for most {@link PhysicsConstraint} timelines. */\nexport abstract class PhysicsConstraintTimeline extends CurveTimeline1 {\n\t/** The index of the physics constraint in {@link Skeleton#getPhysicsConstraints()} that will be changed when this timeline\n\t * is applied, or -1 if all physics constraints in the skeleton will be changed. */\n\tconstraintIndex = 0;\n\n\t/** @param physicsConstraintIndex -1 for all physics constraints in the skeleton. */\n\tconstructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number) {\n\t\tsuper(frameCount, bezierCount, property + \"|\" + physicsConstraintIndex);\n\t\tthis.constraintIndex = physicsConstraintIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet constraint: PhysicsConstraint;\n\t\tif (this.constraintIndex == -1) {\n\t\t\tconst value = time >= this.frames[0] ? this.getCurveValue(time) : 0;\n\n\t\t\tfor (const constraint of skeleton.physicsConstraints) {\n\t\t\t\tif (constraint.active && this.global(constraint.data))\n\t\t\t\t\tthis.set(constraint, this.getAbsoluteValue2(time, alpha, blend, this.get(constraint), this.setup(constraint), value));\n\t\t\t}\n\t\t} else {\n\t\t\tconstraint = skeleton.physicsConstraints[this.constraintIndex];\n\t\t\tif (constraint.active) this.set(constraint, this.getAbsoluteValue(time, alpha, blend, this.get(constraint), this.setup(constraint)));\n\t\t}\n\t}\n\n\tabstract setup (constraint: PhysicsConstraint): number;\n\n\tabstract get (constraint: PhysicsConstraint): number;\n\n\tabstract set (constraint: PhysicsConstraint, value: number): void;\n\n\tabstract global (constraint: PhysicsConstraintData): boolean;\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraint#getInertia()}. */\nexport class PhysicsConstraintInertiaTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintInertia);\n\t}\n\n\tsetup (constraint: PhysicsConstraint): number {\n\t\treturn constraint.data.inertia;\n\t}\n\n\tget (constraint: PhysicsConstraint): number {\n\t\treturn constraint.inertia;\n\t}\n\n\tset (constraint: PhysicsConstraint, value: number): void {\n\t\tconstraint.inertia = value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.inertiaGlobal;\n\t}\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraint#getStrength()}. */\nexport class PhysicsConstraintStrengthTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintStrength);\n\t}\n\n\tsetup (constraint: PhysicsConstraint): number {\n\t\treturn constraint.data.strength;\n\t}\n\n\tget (constraint: PhysicsConstraint): number {\n\t\treturn constraint.strength;\n\t}\n\n\tset (constraint: PhysicsConstraint, value: number): void {\n\t\tconstraint.strength = value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.strengthGlobal;\n\t}\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraint#getDamping()}. */\nexport class PhysicsConstraintDampingTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintDamping);\n\t}\n\n\tsetup (constraint: PhysicsConstraint): number {\n\t\treturn constraint.data.damping;\n\t}\n\n\tget (constraint: PhysicsConstraint): number {\n\t\treturn constraint.damping;\n\t}\n\n\tset (constraint: PhysicsConstraint, value: number): void {\n\t\tconstraint.damping = value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.dampingGlobal;\n\t}\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraint#getMassInverse()}. The timeline values are not inverted. */\nexport class PhysicsConstraintMassTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintMass);\n\t}\n\n\tsetup (constraint: PhysicsConstraint): number {\n\t\treturn 1 / constraint.data.massInverse;\n\t}\n\n\tget (constraint: PhysicsConstraint): number {\n\t\treturn 1 / constraint.massInverse;\n\t}\n\n\tset (constraint: PhysicsConstraint, value: number): void {\n\t\tconstraint.massInverse = 1 / value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.massGlobal;\n\t}\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraint#getWind()}. */\nexport class PhysicsConstraintWindTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintWind);\n\t}\n\n\tsetup (constraint: PhysicsConstraint): number {\n\t\treturn constraint.data.wind;\n\t}\n\n\tget (constraint: PhysicsConstraint): number {\n\t\treturn constraint.wind;\n\t}\n\n\tset (constraint: PhysicsConstraint, value: number): void {\n\t\tconstraint.wind = value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.windGlobal;\n\t}\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraint#getGravity()}. */\nexport class PhysicsConstraintGravityTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintGravity);\n\t}\n\n\tsetup (constraint: PhysicsConstraint): number {\n\t\treturn constraint.data.gravity;\n\t}\n\n\tget (constraint: PhysicsConstraint): number {\n\t\treturn constraint.gravity;\n\t}\n\n\tset (constraint: PhysicsConstraint, value: number): void {\n\t\tconstraint.gravity = value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.gravityGlobal;\n\t}\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraint#getMix()}. */\nexport class PhysicsConstraintMixTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintMix);\n\t}\n\n\tsetup (constraint: PhysicsConstraint): number {\n\t\treturn constraint.data.mix;\n\t}\n\n\tget (constraint: PhysicsConstraint): number {\n\t\treturn constraint.mix;\n\t}\n\n\tset (constraint: PhysicsConstraint, value: number): void {\n\t\tconstraint.mix = value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.mixGlobal;\n\t}\n}\n\n/** Resets a physics constraint when specific animation times are reached. */\nexport class PhysicsConstraintResetTimeline extends Timeline {\n\tprivate static propertyIds: string[] = [Property.physicsConstraintReset.toString()];\n\n\t/** The index of the physics constraint in {@link Skeleton#getPhysicsConstraints()} that will be reset when this timeline is\n\t* applied, or -1 if all physics constraints in the skeleton will be reset. */\n\tconstraintIndex: number;\n\n\t/** @param physicsConstraintIndex -1 for all physics constraints in the skeleton. */\n\tconstructor (frameCount: number, physicsConstraintIndex: number) {\n\t\tsuper(frameCount, PhysicsConstraintResetTimeline.propertyIds);\n\t\tthis.constraintIndex = physicsConstraintIndex;\n\t}\n\n\tgetFrameCount () {\n\t\treturn this.frames.length;\n\t}\n\n\t/** Sets the time for the specified frame.\n\t * @param frame Between 0 and <code>frameCount</code>, inclusive. */\n\tsetFrame (frame: number, time: number) {\n\t\tthis.frames[frame] = time;\n\t}\n\n\t/** Resets the physics constraint when frames > <code>lastTime</code> and <= <code>time</code>. */\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\n\t\tlet constraint: PhysicsConstraint | undefined;\n\t\tif (this.constraintIndex != -1) {\n\t\t\tconstraint = skeleton.physicsConstraints[this.constraintIndex];\n\t\t\tif (!constraint.active) return;\n\t\t}\n\n\t\tconst frames = this.frames;\n\n\t\tif (lastTime > time) { // Apply after lastTime for looped animations.\n\t\t\tthis.apply(skeleton, lastTime, Number.MAX_VALUE, [], alpha, blend, direction);\n\t\t\tlastTime = -1;\n\t\t} else if (lastTime >= frames[frames.length - 1]) // Last time is after last frame.\n\t\t\treturn;\n\t\tif (time < frames[0]) return;\n\n\t\tif (lastTime < frames[0] || time >= frames[Timeline.search1(frames, lastTime) + 1]) {\n\t\t\tif (constraint != null)\n\t\t\t\tconstraint.reset();\n\t\t\telse {\n\t\t\t\tfor (const constraint of skeleton.physicsConstraints) {\n\t\t\t\t\tif (constraint.active) constraint.reset();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Changes a slot's {@link Slot#getSequenceIndex()} for an attachment's {@link Sequence}. */\nexport class SequenceTimeline extends Timeline implements SlotTimeline {\n\tstatic ENTRIES = 3;\n\tstatic MODE = 1;\n\tstatic DELAY = 2;\n\n\tslotIndex: number;\n\tattachment: HasTextureRegion;\n\n\tconstructor (frameCount: number, slotIndex: number, attachment: HasTextureRegion) {\n\t\tsuper(frameCount, [\n\t\t\tProperty.sequence + \"|\" + slotIndex + \"|\" + attachment.sequence!.id\n\t\t]);\n\t\tthis.slotIndex = slotIndex;\n\t\tthis.attachment = attachment;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn SequenceTimeline.ENTRIES;\n\t}\n\n\tgetSlotIndex () {\n\t\treturn this.slotIndex;\n\t}\n\n\tgetAttachment () {\n\t\treturn this.attachment as unknown as Attachment;\n\t}\n\n\t/** Sets the time, mode, index, and frame time for the specified frame.\n\t * @param frame Between 0 and <code>frameCount</code>, inclusive.\n\t * @param time Seconds between frames. */\n\tsetFrame (frame: number, time: number, mode: SequenceMode, index: number, delay: number) {\n\t\tlet frames = this.frames;\n\t\tframe *= SequenceTimeline.ENTRIES;\n\t\tframes[frame] = time;\n\t\tframes[frame + SequenceTimeline.MODE] = mode | (index << 4);\n\t\tframes[frame + SequenceTimeline.DELAY] = delay;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array<Event>, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\t\tlet slotAttachment = slot.attachment;\n\t\tlet attachment = this.attachment as unknown as Attachment;\n\t\tif (slotAttachment != attachment) {\n\t\t\tif (!(slotAttachment instanceof VertexAttachment)\n\t\t\t\t|| (slotAttachment as VertexAttachment).timelineAttachment != attachment) return;\n\t\t}\n\n\t\tif (direction == MixDirection.mixOut) {\n\t\t\tif (blend == MixBlend.setup) slot.sequenceIndex = -1;\n\t\t\treturn;\n\t\t}\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tif (blend == MixBlend.setup || blend == MixBlend.first) slot.sequenceIndex = -1;\n\t\t\treturn;\n\t\t}\n\n\t\tlet i = Timeline.search(frames, time, SequenceTimeline.ENTRIES);\n\t\tlet before = frames[i];\n\t\tlet modeAndIndex = frames[i + SequenceTimeline.MODE];\n\t\tlet delay = frames[i + SequenceTimeline.DELAY];\n\n\t\tif (!this.attachment.sequence) return;\n\t\tlet index = modeAndIndex >> 4, count = this.attachment.sequence!.regions.length;\n\t\tlet mode = SequenceModeValues[modeAndIndex & 0xf];\n\t\tif (mode != SequenceMode.hold) {\n\t\t\tindex += (((time - before) / delay + 0.00001) | 0);\n\t\t\tswitch (mode) {\n\t\t\t\tcase SequenceMode.once:\n\t\t\t\t\tindex = Math.min(count - 1, index);\n\t\t\t\t\tbreak;\n\t\t\t\tcase SequenceMode.loop:\n\t\t\t\t\tindex %= count;\n\t\t\t\t\tbreak;\n\t\t\t\tcase SequenceMode.pingpong: {\n\t\t\t\t\tlet n = (count << 1) - 2;\n\t\t\t\t\tindex = n == 0 ? 0 : index % n;\n\t\t\t\t\tif (index >= count) index = n - index;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase SequenceMode.onceReverse:\n\t\t\t\t\tindex = Math.max(count - 1 - index, 0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase SequenceMode.loopReverse:\n\t\t\t\t\tindex = count - 1 - (index % count);\n\t\t\t\t\tbreak;\n\t\t\t\tcase SequenceMode.pingpongReverse: {\n\t\t\t\t\tlet n = (count << 1) - 2;\n\t\t\t\t\tindex = n == 0 ? 0 : (index + count - 1) % n;\n\t\t\t\t\tif (index >= count) index = n - index;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tslot.sequenceIndex = index;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Animation, MixBlend, AttachmentTimeline, MixDirection, RotateTimeline, DrawOrderTimeline, Timeline, EventTimeline } from \"./Animation.js\";\nimport { AnimationStateData } from \"./AnimationStateData.js\";\nimport { Skeleton } from \"./Skeleton.js\";\nimport { Slot } from \"./Slot.js\";\nimport { StringSet, Pool, Utils, MathUtils } from \"./Utils.js\";\nimport { Event } from \"./Event.js\";\n\n\n/** Applies animations over time, queues animations for later playback, mixes (crossfading) between animations, and applies\n * multiple animations on top of each other (layering).\n *\n * See [Applying Animations](http://esotericsoftware.com/spine-applying-animations/) in the Spine Runtimes Guide. */\nexport class AnimationState {\n\tstatic _emptyAnimation = new Animation(\"<empty>\", [], 0);\n\tprivate static emptyAnimation (): Animation {\n\t\treturn AnimationState._emptyAnimation;\n\t}\n\n\t/** The AnimationStateData to look up mix durations. */\n\tdata: AnimationStateData;\n\n\t/** The list of tracks that currently have animations, which may contain null entries. */\n\ttracks = new Array<TrackEntry | null>();\n\n\t/** Multiplier for the delta time when the animation state is updated, causing time for all animations and mixes to play slower\n\t * or faster. Defaults to 1.\n\t *\n\t * See TrackEntry {@link TrackEntry#timeScale} for affecting a single animation. */\n\ttimeScale = 1;\n\tunkeyedState = 0;\n\n\tevents = new Array<Event>();\n\tlisteners = new Array<AnimationStateListener>();\n\tqueue = new EventQueue(this);\n\tpropertyIDs = new StringSet();\n\tanimationsChanged = false;\n\n\ttrackEntryPool = new Pool<TrackEntry>(() => new TrackEntry());\n\n\tconstructor (data: AnimationStateData) {\n\t\tthis.data = data;\n\t}\n\n\t/** Increments each track entry {@link TrackEntry#trackTime()}, setting queued animations as current if needed. */\n\tupdate (delta: number) {\n\t\tdelta *= this.timeScale;\n\t\tlet tracks = this.tracks;\n\t\tfor (let i = 0, n = tracks.length; i < n; i++) {\n\t\t\tlet current = tracks[i];\n\t\t\tif (!current) continue;\n\n\t\t\tcurrent.animationLast = current.nextAnimationLast;\n\t\t\tcurrent.trackLast = current.nextTrackLast;\n\n\t\t\tlet currentDelta = delta * current.timeScale;\n\n\t\t\tif (current.delay > 0) {\n\t\t\t\tcurrent.delay -= currentDelta;\n\t\t\t\tif (current.delay > 0) continue;\n\t\t\t\tcurrentDelta = -current.delay;\n\t\t\t\tcurrent.delay = 0;\n\t\t\t}\n\n\t\t\tlet next = current.next;\n\t\t\tif (next) {\n\t\t\t\t// When the next entry's delay is passed, change to the next entry, preserving leftover time.\n\t\t\t\tlet nextTime = current.trackLast - next.delay;\n\t\t\t\tif (nextTime >= 0) {\n\t\t\t\t\tnext.delay = 0;\n\t\t\t\t\tnext.trackTime += current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale;\n\t\t\t\t\tcurrent.trackTime += currentDelta;\n\t\t\t\t\tthis.setCurrent(i, next, true);\n\t\t\t\t\twhile (next.mixingFrom) {\n\t\t\t\t\t\tnext.mixTime += delta;\n\t\t\t\t\t\tnext = next.mixingFrom;\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (current.trackLast >= current.trackEnd && !current.mixingFrom) {\n\t\t\t\ttracks[i] = null;\n\t\t\t\tthis.queue.end(current);\n\t\t\t\tthis.clearNext(current);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (current.mixingFrom && this.updateMixingFrom(current, delta)) {\n\t\t\t\t// End mixing from entries once all have completed.\n\t\t\t\tlet from: TrackEntry | null = current.mixingFrom;\n\t\t\t\tcurrent.mixingFrom = null;\n\t\t\t\tif (from) from.mixingTo = null;\n\t\t\t\twhile (from) {\n\t\t\t\t\tthis.queue.end(from);\n\t\t\t\t\tfrom = from.mixingFrom;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcurrent.trackTime += currentDelta;\n\t\t}\n\n\t\tthis.queue.drain();\n\t}\n\n\t/** Returns true when all mixing from entries are complete. */\n\tupdateMixingFrom (to: TrackEntry, delta: number): boolean {\n\t\tlet from = to.mixingFrom;\n\t\tif (!from) return true;\n\n\t\tlet finished = this.updateMixingFrom(from, delta);\n\n\t\tfrom.animationLast = from.nextAnimationLast;\n\t\tfrom.trackLast = from.nextTrackLast;\n\n\t\t// The from entry was applied at least once and the mix is complete.\n\t\tif (to.nextTrackLast != -1 && to.mixTime >= to.mixDuration) {\n\t\t\t// Mixing is complete for all entries before the from entry or the mix is instantaneous.\n\t\t\tif (from.totalAlpha == 0 || to.mixDuration == 0) {\n\t\t\t\tto.mixingFrom = from.mixingFrom;\n\t\t\t\tif (from.mixingFrom != null) from.mixingFrom.mixingTo = to;\n\t\t\t\tto.interruptAlpha = from.interruptAlpha;\n\t\t\t\tthis.queue.end(from);\n\t\t\t}\n\t\t\treturn finished;\n\t\t}\n\n\t\tfrom.trackTime += delta * from.timeScale;\n\t\tto.mixTime += delta;\n\t\treturn false;\n\t}\n\n\t/** Poses the skeleton using the track entry animations. There are no side effects other than invoking listeners, so the\n\t * animation state can be applied to multiple skeletons to pose them identically.\n\t * @returns True if any animations were applied. */\n\tapply (skeleton: Skeleton): boolean {\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\t\tif (this.animationsChanged) this._animationsChanged();\n\n\t\tlet events = this.events;\n\t\tlet tracks = this.tracks;\n\t\tlet applied = false;\n\n\t\tfor (let i = 0, n = tracks.length; i < n; i++) {\n\t\t\tlet current = tracks[i];\n\t\t\tif (!current || current.delay > 0) continue;\n\t\t\tapplied = true;\n\t\t\tlet blend: MixBlend = i == 0 ? MixBlend.first : current.mixBlend;\n\n\t\t\t// Apply mixing from entries first.\n\t\t\tlet alpha = current.alpha;\n\t\t\tif (current.mixingFrom)\n\t\t\t\talpha *= this.applyMixingFrom(current, skeleton, blend);\n\t\t\telse if (current.trackTime >= current.trackEnd && !current.next)\n\t\t\t\talpha = 0;\n\t\t\tlet attachments = alpha >= current.alphaAttachmentThreshold;\n\n\n\t\t\t// Apply current entry.\n\t\t\tlet animationLast = current.animationLast, animationTime = current.getAnimationTime(), applyTime = animationTime;\n\t\t\tlet applyEvents: Event[] | null = events;\n\t\t\tif (current.reverse) {\n\t\t\t\tapplyTime = current.animation!.duration - applyTime;\n\t\t\t\tapplyEvents = null;\n\t\t\t}\n\t\t\tlet timelines = current.animation!.timelines;\n\t\t\tlet timelineCount = timelines.length;\n\t\t\tif ((i == 0 && alpha == 1) || blend == MixBlend.add) {\n\t\t\t\tif (i == 0) attachments = true;\n\t\t\t\tfor (let ii = 0; ii < timelineCount; ii++) {\n\t\t\t\t\t// Fixes issue #302 on IOS9 where mix, blend sometimes became undefined and caused assets\n\t\t\t\t\t// to sometimes stop rendering when using color correction, as their RGBA values become NaN.\n\t\t\t\t\t// (https://github.com/pixijs/pixi-spine/issues/302)\n\t\t\t\t\tUtils.webkit602BugfixHelper(alpha, blend);\n\t\t\t\t\tvar timeline = timelines[ii];\n\t\t\t\t\tif (timeline instanceof AttachmentTimeline)\n\t\t\t\t\t\tthis.applyAttachmentTimeline(timeline, skeleton, applyTime, blend, attachments);\n\t\t\t\t\telse\n\t\t\t\t\t\ttimeline.apply(skeleton, animationLast, applyTime, applyEvents, alpha, blend, MixDirection.mixIn);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlet timelineMode = current.timelineMode;\n\n\t\t\t\tlet shortestRotation = current.shortestRotation;\n\t\t\t\tlet firstFrame = !shortestRotation && current.timelinesRotation.length != timelineCount << 1;\n\t\t\t\tif (firstFrame) current.timelinesRotation.length = timelineCount << 1;\n\n\t\t\t\tfor (let ii = 0; ii < timelineCount; ii++) {\n\t\t\t\t\tlet timeline = timelines[ii];\n\t\t\t\t\tlet timelineBlend = timelineMode[ii] == SUBSEQUENT ? blend : MixBlend.setup;\n\t\t\t\t\tif (!shortestRotation && timeline instanceof RotateTimeline) {\n\t\t\t\t\t\tthis.applyRotateTimeline(timeline, skeleton, applyTime, alpha, timelineBlend, current.timelinesRotation, ii << 1, firstFrame);\n\t\t\t\t\t} else if (timeline instanceof AttachmentTimeline) {\n\t\t\t\t\t\tthis.applyAttachmentTimeline(timeline, skeleton, applyTime, blend, attachments);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// This fixes the WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109\n\t\t\t\t\t\tUtils.webkit602BugfixHelper(alpha, blend);\n\t\t\t\t\t\ttimeline.apply(skeleton, animationLast, applyTime, applyEvents, alpha, timelineBlend, MixDirection.mixIn);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.queueEvents(current, animationTime);\n\t\t\tevents.length = 0;\n\t\t\tcurrent.nextAnimationLast = animationTime;\n\t\t\tcurrent.nextTrackLast = current.trackTime;\n\t\t}\n\n\t\t// Set slots attachments to the setup pose, if needed. This occurs if an animation that is mixing out sets attachments so\n\t\t// subsequent timelines see any deform, but the subsequent timelines don't set an attachment (eg they are also mixing out or\n\t\t// the time is before the first key).\n\t\tvar setupState = this.unkeyedState + SETUP;\n\t\tvar slots = skeleton.slots;\n\t\tfor (var i = 0, n = skeleton.slots.length; i < n; i++) {\n\t\t\tvar slot = slots[i];\n\t\t\tif (slot.attachmentState == setupState) {\n\t\t\t\tvar attachmentName = slot.data.attachmentName;\n\t\t\t\tslot.setAttachment(!attachmentName ? null : skeleton.getAttachment(slot.data.index, attachmentName));\n\t\t\t}\n\t\t}\n\t\tthis.unkeyedState += 2; // Increasing after each use avoids the need to reset attachmentState for every slot.\n\n\t\tthis.queue.drain();\n\t\treturn applied;\n\t}\n\n\tapplyMixingFrom (to: TrackEntry, skeleton: Skeleton, blend: MixBlend) {\n\t\tlet from = to.mixingFrom!;\n\t\tif (from.mixingFrom) this.applyMixingFrom(from, skeleton, blend);\n\n\t\tlet mix = 0;\n\t\tif (to.mixDuration == 0) { // Single frame mix to undo mixingFrom changes.\n\t\t\tmix = 1;\n\t\t\tif (blend == MixBlend.first) blend = MixBlend.setup;\n\t\t} else {\n\t\t\tmix = to.mixTime / to.mixDuration;\n\t\t\tif (mix > 1) mix = 1;\n\t\t\tif (blend != MixBlend.first) blend = from.mixBlend;\n\t\t}\n\n\t\tlet attachments = mix < from.mixAttachmentThreshold, drawOrder = mix < from.mixDrawOrderThreshold;\n\t\tlet timelines = from.animation!.timelines;\n\t\tlet timelineCount = timelines.length;\n\t\tlet alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix);\n\t\tlet animationLast = from.animationLast, animationTime = from.getAnimationTime(), applyTime = animationTime;\n\t\tlet events = null;\n\t\tif (from.reverse)\n\t\t\tapplyTime = from.animation!.duration - applyTime;\n\t\telse if (mix < from.eventThreshold)\n\t\t\tevents = this.events;\n\n\t\tif (blend == MixBlend.add) {\n\t\t\tfor (let i = 0; i < timelineCount; i++)\n\t\t\t\ttimelines[i].apply(skeleton, animationLast, applyTime, events, alphaMix, blend, MixDirection.mixOut);\n\t\t} else {\n\t\t\tlet timelineMode = from.timelineMode;\n\t\t\tlet timelineHoldMix = from.timelineHoldMix;\n\n\t\t\tlet shortestRotation = from.shortestRotation;\n\t\t\tlet firstFrame = !shortestRotation && from.timelinesRotation.length != timelineCount << 1;\n\t\t\tif (firstFrame) from.timelinesRotation.length = timelineCount << 1;\n\n\t\t\tfrom.totalAlpha = 0;\n\t\t\tfor (let i = 0; i < timelineCount; i++) {\n\t\t\t\tlet timeline = timelines[i];\n\t\t\t\tlet direction = MixDirection.mixOut;\n\t\t\t\tlet timelineBlend: MixBlend;\n\t\t\t\tlet alpha = 0;\n\t\t\t\tswitch (timelineMode[i]) {\n\t\t\t\t\tcase SUBSEQUENT:\n\t\t\t\t\t\tif (!drawOrder && timeline instanceof DrawOrderTimeline) continue;\n\t\t\t\t\t\ttimelineBlend = blend;\n\t\t\t\t\t\talpha = alphaMix;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase FIRST:\n\t\t\t\t\t\ttimelineBlend = MixBlend.setup;\n\t\t\t\t\t\talpha = alphaMix;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase HOLD_SUBSEQUENT:\n\t\t\t\t\t\ttimelineBlend = blend;\n\t\t\t\t\t\talpha = alphaHold;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase HOLD_FIRST:\n\t\t\t\t\t\ttimelineBlend = MixBlend.setup;\n\t\t\t\t\t\talpha = alphaHold;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\ttimelineBlend = MixBlend.setup;\n\t\t\t\t\t\tlet holdMix = timelineHoldMix[i];\n\t\t\t\t\t\talpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tfrom.totalAlpha += alpha;\n\n\t\t\t\tif (!shortestRotation && timeline instanceof RotateTimeline)\n\t\t\t\t\tthis.applyRotateTimeline(timeline, skeleton, applyTime, alpha, timelineBlend, from.timelinesRotation, i << 1, firstFrame);\n\t\t\t\telse if (timeline instanceof AttachmentTimeline)\n\t\t\t\t\tthis.applyAttachmentTimeline(timeline, skeleton, applyTime, timelineBlend, attachments && alpha >= from.alphaAttachmentThreshold);\n\t\t\t\telse {\n\t\t\t\t\t// This fixes the WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109\n\t\t\t\t\tUtils.webkit602BugfixHelper(alpha, blend);\n\t\t\t\t\tif (drawOrder && timeline instanceof DrawOrderTimeline && timelineBlend == MixBlend.setup)\n\t\t\t\t\t\tdirection = MixDirection.mixIn;\n\t\t\t\t\ttimeline.apply(skeleton, animationLast, applyTime, events, alpha, timelineBlend, direction);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (to.mixDuration > 0) this.queueEvents(from, animationTime);\n\t\tthis.events.length = 0;\n\t\tfrom.nextAnimationLast = animationTime;\n\t\tfrom.nextTrackLast = from.trackTime;\n\n\t\treturn mix;\n\t}\n\n\tapplyAttachmentTimeline (timeline: AttachmentTimeline, skeleton: Skeleton, time: number, blend: MixBlend, attachments: boolean) {\n\t\tvar slot = skeleton.slots[timeline.slotIndex];\n\t\tif (!slot.bone.active) return;\n\n\t\tif (time < timeline.frames[0]) { // Time is before first frame.\n\t\t\tif (blend == MixBlend.setup || blend == MixBlend.first)\n\t\t\t\tthis.setAttachment(skeleton, slot, slot.data.attachmentName, attachments);\n\t\t} else\n\t\t\tthis.setAttachment(skeleton, slot, timeline.attachmentNames[Timeline.search1(timeline.frames, time)], attachments);\n\n\t\t// If an attachment wasn't set (ie before the first frame or attachments is false), set the setup attachment later.\n\t\tif (slot.attachmentState <= this.unkeyedState) slot.attachmentState = this.unkeyedState + SETUP;\n\t}\n\n\tsetAttachment (skeleton: Skeleton, slot: Slot, attachmentName: string | null, attachments: boolean) {\n\t\tslot.setAttachment(!attachmentName ? null : skeleton.getAttachment(slot.data.index, attachmentName));\n\t\tif (attachments) slot.attachmentState = this.unkeyedState + CURRENT;\n\t}\n\n\tapplyRotateTimeline (timeline: RotateTimeline, skeleton: Skeleton, time: number, alpha: number, blend: MixBlend,\n\t\ttimelinesRotation: Array<number>, i: number, firstFrame: boolean) {\n\n\t\tif (firstFrame) timelinesRotation[i] = 0;\n\n\t\tif (alpha == 1) {\n\t\t\ttimeline.apply(skeleton, 0, time, null, 1, blend, MixDirection.mixIn);\n\t\t\treturn;\n\t\t}\n\n\t\tlet bone = skeleton.bones[timeline.boneIndex];\n\t\tif (!bone.active) return;\n\t\tlet frames = timeline.frames;\n\t\tlet r1 = 0, r2 = 0;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tbone.rotation = bone.data.rotation;\n\t\t\t\tdefault:\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tr1 = bone.rotation;\n\t\t\t\t\tr2 = bone.data.rotation;\n\t\t\t}\n\t\t} else {\n\t\t\tr1 = blend == MixBlend.setup ? bone.data.rotation : bone.rotation;\n\t\t\tr2 = bone.data.rotation + timeline.getCurveValue(time);\n\t\t}\n\n\t\t// Mix between rotations using the direction of the shortest route on the first frame while detecting crosses.\n\t\tlet total = 0, diff = r2 - r1;\n\t\tdiff -= Math.ceil(diff / 360 - 0.5) * 360;\n\t\tif (diff == 0) {\n\t\t\ttotal = timelinesRotation[i];\n\t\t} else {\n\t\t\tlet lastTotal = 0, lastDiff = 0;\n\t\t\tif (firstFrame) {\n\t\t\t\tlastTotal = 0;\n\t\t\t\tlastDiff = diff;\n\t\t\t} else {\n\t\t\t\tlastTotal = timelinesRotation[i];\n\t\t\t\tlastDiff = timelinesRotation[i + 1];\n\t\t\t}\n\t\t\tlet loops = lastTotal - lastTotal % 360;\n\t\t\ttotal = diff + loops;\n\t\t\tlet current = diff >= 0, dir = lastTotal >= 0;\n\t\t\tif (Math.abs(lastDiff) <= 90 && MathUtils.signum(lastDiff) != MathUtils.signum(diff)) {\n\t\t\t\tif (Math.abs(lastTotal - loops) > 180) {\n\t\t\t\t\ttotal += 360 * MathUtils.signum(lastTotal);\n\t\t\t\t\tdir = current;\n\t\t\t\t} else if (loops != 0)\n\t\t\t\t\ttotal -= 360 * MathUtils.signum(lastTotal);\n\t\t\t\telse\n\t\t\t\t\tdir = current;\n\t\t\t}\n\t\t\tif (dir != current) total += 360 * MathUtils.signum(lastTotal);\n\t\t\ttimelinesRotation[i] = total;\n\t\t}\n\t\ttimelinesRotation[i + 1] = diff;\n\t\tbone.rotation = r1 + total * alpha;\n\t}\n\n\tqueueEvents (entry: TrackEntry, animationTime: number) {\n\t\tlet animationStart = entry.animationStart, animationEnd = entry.animationEnd;\n\t\tlet duration = animationEnd - animationStart;\n\t\tlet trackLastWrapped = entry.trackLast % duration;\n\n\t\t// Queue events before complete.\n\t\tlet events = this.events;\n\t\tlet i = 0, n = events.length;\n\t\tfor (; i < n; i++) {\n\t\t\tlet event = events[i];\n\t\t\tif (event.time < trackLastWrapped) break;\n\t\t\tif (event.time > animationEnd) continue; // Discard events outside animation start/end.\n\t\t\tthis.queue.event(entry, event);\n\t\t}\n\n\t\t// Queue complete if completed a loop iteration or the animation.\n\t\tlet complete = false;\n\t\tif (entry.loop) {\n\t\t\tif (duration == 0)\n\t\t\t\tcomplete = true;\n\t\t\telse {\n\t\t\t\tconst cycles = Math.floor(entry.trackTime / duration);\n\t\t\t\tcomplete = cycles > 0 && cycles > Math.floor(entry.trackLast / duration);\n\t\t\t}\n\t\t} else\n\t\t\tcomplete = animationTime >= animationEnd && entry.animationLast < animationEnd;\n\t\tif (complete) this.queue.complete(entry);\n\n\t\t// Queue events after complete.\n\t\tfor (; i < n; i++) {\n\t\t\tlet event = events[i];\n\t\t\tif (event.time < animationStart) continue; // Discard events outside animation start/end.\n\t\t\tthis.queue.event(entry, event);\n\t\t}\n\t}\n\n\t/** Removes all animations from all tracks, leaving skeletons in their current pose.\n\t *\n\t * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose,\n\t * rather than leaving them in their current pose. */\n\tclearTracks () {\n\t\tlet oldDrainDisabled = this.queue.drainDisabled;\n\t\tthis.queue.drainDisabled = true;\n\t\tfor (let i = 0, n = this.tracks.length; i < n; i++)\n\t\t\tthis.clearTrack(i);\n\t\tthis.tracks.length = 0;\n\t\tthis.queue.drainDisabled = oldDrainDisabled;\n\t\tthis.queue.drain();\n\t}\n\n\t/** Removes all animations from the track, leaving skeletons in their current pose.\n\t *\n\t * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose,\n\t * rather than leaving them in their current pose. */\n\tclearTrack (trackIndex: number) {\n\t\tif (trackIndex >= this.tracks.length) return;\n\t\tlet current = this.tracks[trackIndex];\n\t\tif (!current) return;\n\n\t\tthis.queue.end(current);\n\n\t\tthis.clearNext(current);\n\n\t\tlet entry = current;\n\t\twhile (true) {\n\t\t\tlet from = entry.mixingFrom;\n\t\t\tif (!from) break;\n\t\t\tthis.queue.end(from);\n\t\t\tentry.mixingFrom = null;\n\t\t\tentry.mixingTo = null;\n\t\t\tentry = from;\n\t\t}\n\n\t\tthis.tracks[current.trackIndex] = null;\n\n\t\tthis.queue.drain();\n\t}\n\n\tsetCurrent (index: number, current: TrackEntry, interrupt: boolean) {\n\t\tlet from = this.expandToIndex(index);\n\t\tthis.tracks[index] = current;\n\t\tcurrent.previous = null;\n\n\t\tif (from) {\n\t\t\tif (interrupt) this.queue.interrupt(from);\n\t\t\tcurrent.mixingFrom = from;\n\t\t\tfrom.mixingTo = current;\n\t\t\tcurrent.mixTime = 0;\n\n\t\t\t// Store the interrupted mix percentage.\n\t\t\tif (from.mixingFrom && from.mixDuration > 0)\n\t\t\t\tcurrent.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration);\n\n\t\t\tfrom.timelinesRotation.length = 0; // Reset rotation for mixing out, in case entry was mixed in.\n\t\t}\n\n\t\tthis.queue.start(current);\n\t}\n\n\t/** Sets an animation by name.\n\t *\n\t * See {@link #setAnimationWith()}. */\n\tsetAnimation (trackIndex: number, animationName: string, loop: boolean = false) {\n\t\tlet animation = this.data.skeletonData.findAnimation(animationName);\n\t\tif (!animation) throw new Error(\"Animation not found: \" + animationName);\n\t\treturn this.setAnimationWith(trackIndex, animation, loop);\n\t}\n\n\t/** Sets the current animation for a track, discarding any queued animations. If the formerly current track entry was never\n\t * applied to a skeleton, it is replaced (not mixed from).\n\t * @param loop If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its\n\t * duration. In either case {@link TrackEntry#trackEnd} determines when the track is cleared.\n\t * @returns A track entry to allow further customization of animation playback. References to the track entry must not be kept\n\t * after the {@link AnimationStateListener#dispose()} event occurs. */\n\tsetAnimationWith (trackIndex: number, animation: Animation, loop: boolean = false) {\n\t\tif (!animation) throw new Error(\"animation cannot be null.\");\n\t\tlet interrupt = true;\n\t\tlet current = this.expandToIndex(trackIndex);\n\t\tif (current) {\n\t\t\tif (current.nextTrackLast == -1) {\n\t\t\t\t// Don't mix from an entry that was never applied.\n\t\t\t\tthis.tracks[trackIndex] = current.mixingFrom;\n\t\t\t\tthis.queue.interrupt(current);\n\t\t\t\tthis.queue.end(current);\n\t\t\t\tthis.clearNext(current);\n\t\t\t\tcurrent = current.mixingFrom;\n\t\t\t\tinterrupt = false;\n\t\t\t} else\n\t\t\t\tthis.clearNext(current);\n\t\t}\n\t\tlet entry = this.trackEntry(trackIndex, animation, loop, current);\n\t\tthis.setCurrent(trackIndex, entry, interrupt);\n\t\tthis.queue.drain();\n\t\treturn entry;\n\t}\n\n\t/** Queues an animation by name.\n\t *\n\t * See {@link #addAnimationWith()}. */\n\taddAnimation (trackIndex: number, animationName: string, loop: boolean = false, delay: number = 0) {\n\t\tlet animation = this.data.skeletonData.findAnimation(animationName);\n\t\tif (!animation) throw new Error(\"Animation not found: \" + animationName);\n\t\treturn this.addAnimationWith(trackIndex, animation, loop, delay);\n\t}\n\n\t/** Adds an animation to be played after the current or last queued animation for a track. If the track is empty, it is\n\t * equivalent to calling {@link #setAnimationWith()}.\n\t * @param delay If > 0, sets {@link TrackEntry#delay}. If <= 0, the delay set is the duration of the previous track entry\n\t * minus any mix duration (from the {@link AnimationStateData}) plus the specified `delay` (ie the mix\n\t * ends at (`delay` = 0) or before (`delay` < 0) the previous track entry duration). If the\n\t * previous entry is looping, its next loop completion is used instead of its duration.\n\t * @returns A track entry to allow further customization of animation playback. References to the track entry must not be kept\n\t * after the {@link AnimationStateListener#dispose()} event occurs. */\n\taddAnimationWith (trackIndex: number, animation: Animation, loop: boolean = false, delay: number = 0) {\n\t\tif (!animation) throw new Error(\"animation cannot be null.\");\n\n\t\tlet last = this.expandToIndex(trackIndex);\n\t\tif (last) {\n\t\t\twhile (last.next)\n\t\t\t\tlast = last.next;\n\t\t}\n\n\t\tlet entry = this.trackEntry(trackIndex, animation, loop, last);\n\n\t\tif (!last) {\n\t\t\tthis.setCurrent(trackIndex, entry, true);\n\t\t\tthis.queue.drain();\n\t\t} else {\n\t\t\tlast.next = entry;\n\t\t\tentry.previous = last;\n\t\t\tif (delay <= 0) delay += last.getTrackComplete() - entry.mixDuration;\n\t\t}\n\n\t\tentry.delay = delay;\n\t\treturn entry;\n\t}\n\n\t/** Sets an empty animation for a track, discarding any queued animations, and sets the track entry's\n\t * {@link TrackEntry#mixduration}. An empty animation has no timelines and serves as a placeholder for mixing in or out.\n\t *\n\t * Mixing out is done by setting an empty animation with a mix duration using either {@link #setEmptyAnimation()},\n\t * {@link #setEmptyAnimations()}, or {@link #addEmptyAnimation()}. Mixing to an empty animation causes\n\t * the previous animation to be applied less and less over the mix duration. Properties keyed in the previous animation\n\t * transition to the value from lower tracks or to the setup pose value if no lower tracks key the property. A mix duration of\n\t * 0 still mixes out over one frame.\n\t *\n\t * Mixing in is done by first setting an empty animation, then adding an animation using\n\t * {@link #addAnimation()} and on the returned track entry, set the\n\t * {@link TrackEntry#setMixDuration()}. Mixing from an empty animation causes the new animation to be applied more and\n\t * more over the mix duration. Properties keyed in the new animation transition from the value from lower tracks or from the\n\t * setup pose value if no lower tracks key the property to the value keyed in the new animation. */\n\tsetEmptyAnimation (trackIndex: number, mixDuration: number = 0) {\n\t\tlet entry = this.setAnimationWith(trackIndex, AnimationState.emptyAnimation(), false);\n\t\tentry.mixDuration = mixDuration;\n\t\tentry.trackEnd = mixDuration;\n\t\treturn entry;\n\t}\n\n\t/** Adds an empty animation to be played after the current or last queued animation for a track, and sets the track entry's\n\t * {@link TrackEntry#mixDuration}. If the track is empty, it is equivalent to calling\n\t * {@link #setEmptyAnimation()}.\n\t *\n\t * See {@link #setEmptyAnimation()}.\n\t * @param delay If > 0, sets {@link TrackEntry#delay}. If <= 0, the delay set is the duration of the previous track entry\n\t * minus any mix duration plus the specified `delay` (ie the mix ends at (`delay` = 0) or\n\t * before (`delay` < 0) the previous track entry duration). If the previous entry is looping, its next\n\t * loop completion is used instead of its duration.\n\t * @return A track entry to allow further customization of animation playback. References to the track entry must not be kept\n\t * after the {@link AnimationStateListener#dispose()} event occurs. */\n\taddEmptyAnimation (trackIndex: number, mixDuration: number = 0, delay: number = 0) {\n\t\tlet entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation(), false, delay);\n\t\tif (delay <= 0) entry.delay += entry.mixDuration - mixDuration;\n\t\tentry.mixDuration = mixDuration;\n\t\tentry.trackEnd = mixDuration;\n\t\treturn entry;\n\t}\n\n\t/** Sets an empty animation for every track, discarding any queued animations, and mixes to it over the specified mix\n\t * duration. */\n\tsetEmptyAnimations (mixDuration: number = 0) {\n\t\tlet oldDrainDisabled = this.queue.drainDisabled;\n\t\tthis.queue.drainDisabled = true;\n\t\tfor (let i = 0, n = this.tracks.length; i < n; i++) {\n\t\t\tlet current = this.tracks[i];\n\t\t\tif (current) this.setEmptyAnimation(current.trackIndex, mixDuration);\n\t\t}\n\t\tthis.queue.drainDisabled = oldDrainDisabled;\n\t\tthis.queue.drain();\n\t}\n\n\texpandToIndex (index: number) {\n\t\tif (index < this.tracks.length) return this.tracks[index];\n\t\tUtils.ensureArrayCapacity(this.tracks, index + 1, null);\n\t\tthis.tracks.length = index + 1;\n\t\treturn null;\n\t}\n\n\t/** @param last May be null. */\n\ttrackEntry (trackIndex: number, animation: Animation, loop: boolean, last: TrackEntry | null) {\n\t\tlet entry = this.trackEntryPool.obtain();\n\t\tentry.reset();\n\t\tentry.trackIndex = trackIndex;\n\t\tentry.animation = animation;\n\t\tentry.loop = loop;\n\t\tentry.holdPrevious = false;\n\n\t\tentry.reverse = false;\n\t\tentry.shortestRotation = false;\n\n\t\tentry.eventThreshold = 0;\n\t\tentry.alphaAttachmentThreshold = 0;\n\t\tentry.mixAttachmentThreshold = 0;\n\t\tentry.mixDrawOrderThreshold = 0;\n\n\t\tentry.animationStart = 0;\n\t\tentry.animationEnd = animation.duration;\n\t\tentry.animationLast = -1;\n\t\tentry.nextAnimationLast = -1;\n\n\t\tentry.delay = 0;\n\t\tentry.trackTime = 0;\n\t\tentry.trackLast = -1;\n\t\tentry.nextTrackLast = -1;\n\t\tentry.trackEnd = Number.MAX_VALUE;\n\t\tentry.timeScale = 1;\n\n\t\tentry.alpha = 1;\n\t\tentry.mixTime = 0;\n\t\tentry.mixDuration = !last ? 0 : this.data.getMix(last.animation!, animation);\n\t\tentry.interruptAlpha = 1;\n\t\tentry.totalAlpha = 0;\n\t\tentry.mixBlend = MixBlend.replace;\n\t\treturn entry;\n\t}\n\n\t/** Removes the {@link TrackEntry#getNext() next entry} and all entries after it for the specified entry. */\n\tclearNext (entry: TrackEntry) {\n\t\tlet next = entry.next;\n\t\twhile (next) {\n\t\t\tthis.queue.dispose(next);\n\t\t\tnext = next.next;\n\t\t}\n\t\tentry.next = null;\n\t}\n\n\t_animationsChanged () {\n\t\tthis.animationsChanged = false;\n\n\t\tthis.propertyIDs.clear();\n\t\tlet tracks = this.tracks;\n\t\tfor (let i = 0, n = tracks.length; i < n; i++) {\n\t\t\tlet entry = tracks[i];\n\t\t\tif (!entry) continue;\n\t\t\twhile (entry.mixingFrom)\n\t\t\t\tentry = entry.mixingFrom;\n\t\t\tdo {\n\t\t\t\tif (!entry.mixingTo || entry.mixBlend != MixBlend.add) this.computeHold(entry);\n\t\t\t\tentry = entry.mixingTo;\n\t\t\t} while (entry);\n\t\t}\n\t}\n\n\tcomputeHold (entry: TrackEntry) {\n\t\tlet to = entry.mixingTo;\n\t\tlet timelines = entry.animation!.timelines;\n\t\tlet timelinesCount = entry.animation!.timelines.length;\n\t\tlet timelineMode = entry.timelineMode;\n\t\ttimelineMode.length = timelinesCount;\n\t\tlet timelineHoldMix = entry.timelineHoldMix;\n\t\ttimelineHoldMix.length = 0;\n\t\tlet propertyIDs = this.propertyIDs;\n\n\t\tif (to && to.holdPrevious) {\n\t\t\tfor (let i = 0; i < timelinesCount; i++)\n\t\t\t\ttimelineMode[i] = propertyIDs.addAll(timelines[i].getPropertyIds()) ? HOLD_FIRST : HOLD_SUBSEQUENT;\n\t\t\treturn;\n\t\t}\n\n\t\touter:\n\t\tfor (let i = 0; i < timelinesCount; i++) {\n\t\t\tlet timeline = timelines[i];\n\t\t\tlet ids = timeline.getPropertyIds();\n\t\t\tif (!propertyIDs.addAll(ids))\n\t\t\t\ttimelineMode[i] = SUBSEQUENT;\n\t\t\telse if (!to || timeline instanceof AttachmentTimeline || timeline instanceof DrawOrderTimeline\n\t\t\t\t|| timeline instanceof EventTimeline || !to.animation!.hasTimeline(ids)) {\n\t\t\t\ttimelineMode[i] = FIRST;\n\t\t\t} else {\n\t\t\t\tfor (let next = to.mixingTo; next; next = next!.mixingTo) {\n\t\t\t\t\tif (next.animation!.hasTimeline(ids)) continue;\n\t\t\t\t\tif (entry.mixDuration > 0) {\n\t\t\t\t\t\ttimelineMode[i] = HOLD_MIX;\n\t\t\t\t\t\ttimelineHoldMix[i] = next;\n\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ttimelineMode[i] = HOLD_FIRST;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Returns the track entry for the animation currently playing on the track, or null if no animation is currently playing. */\n\tgetCurrent (trackIndex: number) {\n\t\tif (trackIndex >= this.tracks.length) return null;\n\t\treturn this.tracks[trackIndex];\n\t}\n\n\t/** Adds a listener to receive events for all track entries. */\n\taddListener (listener: AnimationStateListener) {\n\t\tif (!listener) throw new Error(\"listener cannot be null.\");\n\t\tthis.listeners.push(listener);\n\t}\n\n\t/** Removes the listener added with {@link #addListener()}. */\n\tremoveListener (listener: AnimationStateListener) {\n\t\tlet index = this.listeners.indexOf(listener);\n\t\tif (index >= 0) this.listeners.splice(index, 1);\n\t}\n\n\t/** Removes all listeners added with {@link #addListener()}. */\n\tclearListeners () {\n\t\tthis.listeners.length = 0;\n\t}\n\n\t/** Discards all listener notifications that have not yet been delivered. This can be useful to call from an\n\t * {@link AnimationStateListener} when it is known that further notifications that may have been already queued for delivery\n\t * are not wanted because new animations are being set. */\n\tclearListenerNotifications () {\n\t\tthis.queue.clear();\n\t}\n}\n\n/** Stores settings and other state for the playback of an animation on an {@link AnimationState} track.\n *\n * References to a track entry must not be kept after the {@link AnimationStateListener#dispose()} event occurs. */\nexport class TrackEntry {\n\t/** The animation to apply for this track entry. */\n\tanimation: Animation | null = null;\n\n\tprevious: TrackEntry | null = null;\n\n\t/** The animation queued to start after this animation, or null. `next` makes up a linked list. */\n\tnext: TrackEntry | null = null;\n\n\t/** The track entry for the previous animation when mixing from the previous animation to this animation, or null if no\n\t * mixing is currently occuring. When mixing from multiple animations, `mixingFrom` makes up a linked list. */\n\tmixingFrom: TrackEntry | null = null;\n\n\t/** The track entry for the next animation when mixing from this animation to the next animation, or null if no mixing is\n\t * currently occuring. When mixing to multiple animations, `mixingTo` makes up a linked list. */\n\tmixingTo: TrackEntry | null = null;\n\n\t/** The listener for events generated by this track entry, or null.\n\t *\n\t * A track entry returned from {@link AnimationState#setAnimation()} is already the current animation\n\t * for the track, so the track entry listener {@link AnimationStateListener#start()} will not be called. */\n\tlistener: AnimationStateListener | null = null;\n\n\t/** The index of the track where this track entry is either current or queued.\n\t *\n\t * See {@link AnimationState#getCurrent()}. */\n\ttrackIndex: number = 0;\n\n\t/** If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its\n\t * duration. */\n\tloop: boolean = false;\n\n\t/** If true, when mixing from the previous animation to this animation, the previous animation is applied as normal instead\n\t * of being mixed out.\n\t *\n\t * When mixing between animations that key the same property, if a lower track also keys that property then the value will\n\t * briefly dip toward the lower track value during the mix. This happens because the first animation mixes from 100% to 0%\n\t * while the second animation mixes from 0% to 100%. Setting `holdPrevious` to true applies the first animation\n\t * at 100% during the mix so the lower track value is overwritten. Such dipping does not occur on the lowest track which\n\t * keys the property, only when a higher track also keys the property.\n\t *\n\t * Snapping will occur if `holdPrevious` is true and this animation does not key all the same properties as the\n\t * previous animation. */\n\tholdPrevious: boolean = false;\n\n\treverse: boolean = false;\n\n\tshortestRotation: boolean = false;\n\n\t/** When the mix percentage ({@link #mixTime} / {@link #mixDuration}) is less than the\n\t * `eventThreshold`, event timelines are applied while this animation is being mixed out. Defaults to 0, so event\n\t * timelines are not applied while this animation is being mixed out. */\n\teventThreshold: number = 0;\n\n\t/** When the mix percentage ({@link #mixtime} / {@link #mixDuration}) is less than the\n\t * `attachmentThreshold`, attachment timelines are applied while this animation is being mixed out. Defaults to\n\t * 0, so attachment timelines are not applied while this animation is being mixed out. */\n\tmixAttachmentThreshold: number = 0;\n\n\t/** When {@link #getAlpha()} is greater than <code>alphaAttachmentThreshold</code>, attachment timelines are applied.\n\t * Defaults to 0, so attachment timelines are always applied. */\n\talphaAttachmentThreshold: number = 0;\n\n\t/** When the mix percentage ({@link #getMixTime()} / {@link #getMixDuration()}) is less than the\n\t * <code>mixDrawOrderThreshold</code>, draw order timelines are applied while this animation is being mixed out. Defaults to\n\t * 0, so draw order timelines are not applied while this animation is being mixed out. */\n\tmixDrawOrderThreshold: number = 0;\n\n\t/** Seconds when this animation starts, both initially and after looping. Defaults to 0.\n\t *\n\t * When changing the `animationStart` time, it often makes sense to set {@link #animationLast} to the same\n\t * value to prevent timeline keys before the start time from triggering. */\n\tanimationStart: number = 0;\n\n\t/** Seconds for the last frame of this animation. Non-looping animations won't play past this time. Looping animations will\n\t * loop back to {@link #animationStart} at this time. Defaults to the animation {@link Animation#duration}. */\n\tanimationEnd: number = 0;\n\n\n\t/** The time in seconds this animation was last applied. Some timelines use this for one-time triggers. Eg, when this\n\t * animation is applied, event timelines will fire all events between the `animationLast` time (exclusive) and\n\t * `animationTime` (inclusive). Defaults to -1 to ensure triggers on frame 0 happen the first time this animation\n\t * is applied. */\n\tanimationLast: number = 0;\n\n\tnextAnimationLast: number = 0;\n\n\t/** Seconds to postpone playing the animation. When this track entry is the current track entry, `delay`\n\t * postpones incrementing the {@link #trackTime}. When this track entry is queued, `delay` is the time from\n\t * the start of the previous animation to when this track entry will become the current track entry (ie when the previous\n\t * track entry {@link TrackEntry#trackTime} >= this track entry's `delay`).\n\t *\n\t * {@link #timeScale} affects the delay. */\n\tdelay: number = 0;\n\n\t/** Current time in seconds this track entry has been the current track entry. The track time determines\n\t * {@link #animationTime}. The track time can be set to start the animation at a time other than 0, without affecting\n\t * looping. */\n\ttrackTime: number = 0;\n\n\ttrackLast: number = 0; nextTrackLast: number = 0;\n\n\t/** The track time in seconds when this animation will be removed from the track. Defaults to the highest possible float\n\t * value, meaning the animation will be applied until a new animation is set or the track is cleared. If the track end time\n\t * is reached, no other animations are queued for playback, and mixing from any previous animations is complete, then the\n\t * properties keyed by the animation are set to the setup pose and the track is cleared.\n\t *\n\t * It may be desired to use {@link AnimationState#addEmptyAnimation()} rather than have the animation\n\t * abruptly cease being applied. */\n\ttrackEnd: number = 0;\n\n\t/** Multiplier for the delta time when this track entry is updated, causing time for this animation to pass slower or\n\t * faster. Defaults to 1.\n\t *\n\t * {@link #mixTime} is not affected by track entry time scale, so {@link #mixDuration} may need to be adjusted to\n\t * match the animation speed.\n\t *\n\t * When using {@link AnimationState#addAnimation()} with a `delay` <= 0, note the\n\t * {@link #delay} is set using the mix duration from the {@link AnimationStateData}, assuming time scale to be 1. If\n\t * the time scale is not 1, the delay may need to be adjusted.\n\t *\n\t * See AnimationState {@link AnimationState#timeScale} for affecting all animations. */\n\ttimeScale: number = 0;\n\n\t/** Values < 1 mix this animation with the skeleton's current pose (usually the pose resulting from lower tracks). Defaults\n\t * to 1, which overwrites the skeleton's current pose with this animation.\n\t *\n\t * Typically track 0 is used to completely pose the skeleton, then alpha is used on higher tracks. It doesn't make sense to\n\t * use alpha on track 0 if the skeleton pose is from the last frame render. */\n\talpha: number = 0;\n\n\t/** Seconds from 0 to the {@link #getMixDuration()} when mixing from the previous animation to this animation. May be\n\t * slightly more than `mixDuration` when the mix is complete. */\n\tmixTime: number = 0;\n\n\t/** Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData\n\t * {@link AnimationStateData#getMix()} based on the animation before this animation (if any).\n\t *\n\t * A mix duration of 0 still mixes out over one frame to provide the track entry being mixed out a chance to revert the\n\t * properties it was animating.\n\t *\n\t * The `mixDuration` can be set manually rather than use the value from\n\t * {@link AnimationStateData#getMix()}. In that case, the `mixDuration` can be set for a new\n\t * track entry only before {@link AnimationState#update(float)} is first called.\n\t *\n\t * When using {@link AnimationState#addAnimation()} with a `delay` <= 0, note the\n\t * {@link #delay} is set using the mix duration from the {@link AnimationStateData}, not a mix duration set\n\t * afterward. */\n\t_mixDuration: number = 0; interruptAlpha: number = 0; totalAlpha: number = 0;\n\n\tget mixDuration () {\n\t\treturn this._mixDuration;\n\t}\n\n\tset mixDuration (mixDuration: number) {\n\t\tthis._mixDuration = mixDuration;\n\t}\n\n\tsetMixDurationWithDelay (mixDuration: number, delay: number) {\n\t\tthis._mixDuration = mixDuration;\n\t\tif (this.previous != null && delay <= 0) delay += this.previous.getTrackComplete() - mixDuration;\n\t\tthis.delay = delay;\n\t}\n\n\t/** Controls how properties keyed in the animation are mixed with lower tracks. Defaults to {@link MixBlend#replace}, which\n\t * replaces the values from the lower tracks with the animation values. {@link MixBlend#add} adds the animation values to\n\t * the values from the lower tracks.\n\t *\n\t * The `mixBlend` can be set for a new track entry only before {@link AnimationState#apply()} is first\n\t * called. */\n\tmixBlend = MixBlend.replace;\n\ttimelineMode = new Array<number>();\n\ttimelineHoldMix = new Array<TrackEntry>();\n\ttimelinesRotation = new Array<number>();\n\n\treset () {\n\t\tthis.next = null;\n\t\tthis.previous = null;\n\t\tthis.mixingFrom = null;\n\t\tthis.mixingTo = null;\n\t\tthis.animation = null;\n\t\tthis.listener = null;\n\t\tthis.timelineMode.length = 0;\n\t\tthis.timelineHoldMix.length = 0;\n\t\tthis.timelinesRotation.length = 0;\n\t}\n\n\t/** Uses {@link #trackTime} to compute the `animationTime`, which is between {@link #animationStart}\n\t * and {@link #animationEnd}. When the `trackTime` is 0, the `animationTime` is equal to the\n\t * `animationStart` time. */\n\tgetAnimationTime () {\n\t\tif (this.loop) {\n\t\t\tlet duration = this.animationEnd - this.animationStart;\n\t\t\tif (duration == 0) return this.animationStart;\n\t\t\treturn (this.trackTime % duration) + this.animationStart;\n\t\t}\n\t\treturn Math.min(this.trackTime + this.animationStart, this.animationEnd);\n\t}\n\n\tsetAnimationLast (animationLast: number) {\n\t\tthis.animationLast = animationLast;\n\t\tthis.nextAnimationLast = animationLast;\n\t}\n\n\t/** Returns true if at least one loop has been completed.\n\t *\n\t * See {@link AnimationStateListener#complete()}. */\n\tisComplete () {\n\t\treturn this.trackTime >= this.animationEnd - this.animationStart;\n\t}\n\n\t/** Resets the rotation directions for mixing this entry's rotate timelines. This can be useful to avoid bones rotating the\n\t * long way around when using {@link #alpha} and starting animations on other tracks.\n\t *\n\t * Mixing with {@link MixBlend#replace} involves finding a rotation between two others, which has two possible solutions:\n\t * the short way or the long way around. The two rotations likely change over time, so which direction is the short or long\n\t * way also changes. If the short way was always chosen, bones would flip to the other side when that direction became the\n\t * long way. TrackEntry chooses the short way the first time it is applied and remembers that direction. */\n\tresetRotationDirections () {\n\t\tthis.timelinesRotation.length = 0;\n\t}\n\n\tgetTrackComplete () {\n\t\tlet duration = this.animationEnd - this.animationStart;\n\t\tif (duration != 0) {\n\t\t\tif (this.loop) return duration * (1 + ((this.trackTime / duration) | 0)); // Completion of next loop.\n\t\t\tif (this.trackTime < duration) return duration; // Before duration.\n\t\t}\n\t\treturn this.trackTime; // Next update.\n\t}\n\n\t/** Returns true if this track entry has been applied at least once.\n\t * <p>\n\t * See {@link AnimationState#apply(Skeleton)}. */\n\twasApplied () {\n\t\treturn this.nextTrackLast != -1;\n\t}\n\n\t/** Returns true if there is a {@link #getNext()} track entry and it will become the current track entry during the next\n\t * {@link AnimationState#update(float)}. */\n\tisNextReady () {\n\t\treturn this.next != null && this.nextTrackLast - this.next.delay >= 0;\n\t}\n}\n\nexport class EventQueue {\n\tobjects: Array<any> = [];\n\tdrainDisabled = false;\n\tanimState: AnimationState;\n\n\tconstructor (animState: AnimationState) {\n\t\tthis.animState = animState;\n\t}\n\n\tstart (entry: TrackEntry) {\n\t\tthis.objects.push(EventType.start);\n\t\tthis.objects.push(entry);\n\t\tthis.animState.animationsChanged = true;\n\t}\n\n\tinterrupt (entry: TrackEntry) {\n\t\tthis.objects.push(EventType.interrupt);\n\t\tthis.objects.push(entry);\n\t}\n\n\tend (entry: TrackEntry) {\n\t\tthis.objects.push(EventType.end);\n\t\tthis.objects.push(entry);\n\t\tthis.animState.animationsChanged = true;\n\t}\n\n\tdispose (entry: TrackEntry) {\n\t\tthis.objects.push(EventType.dispose);\n\t\tthis.objects.push(entry);\n\t}\n\n\tcomplete (entry: TrackEntry) {\n\t\tthis.objects.push(EventType.complete);\n\t\tthis.objects.push(entry);\n\t}\n\n\tevent (entry: TrackEntry, event: Event) {\n\t\tthis.objects.push(EventType.event);\n\t\tthis.objects.push(entry);\n\t\tthis.objects.push(event);\n\t}\n\n\tdrain () {\n\t\tif (this.drainDisabled) return;\n\t\tthis.drainDisabled = true;\n\n\t\tlet objects = this.objects;\n\t\tlet listeners = this.animState.listeners;\n\n\t\tfor (let i = 0; i < objects.length; i += 2) {\n\t\t\tlet type = objects[i] as EventType;\n\t\t\tlet entry = objects[i + 1] as TrackEntry;\n\t\t\tswitch (type) {\n\t\t\t\tcase EventType.start:\n\t\t\t\t\tif (entry.listener && entry.listener.start) entry.listener.start(entry);\n\t\t\t\t\tfor (let ii = 0; ii < listeners.length; ii++) {\n\t\t\t\t\t\tlet listener = listeners[ii];\n\t\t\t\t\t\tif (listener.start) listener.start(entry);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase EventType.interrupt:\n\t\t\t\t\tif (entry.listener && entry.listener.interrupt) entry.listener.interrupt(entry);\n\t\t\t\t\tfor (let ii = 0; ii < listeners.length; ii++) {\n\t\t\t\t\t\tlet listener = listeners[ii];\n\t\t\t\t\t\tif (listener.interrupt) listener.interrupt(entry);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase EventType.end:\n\t\t\t\t\tif (entry.listener && entry.listener.end) entry.listener.end(entry);\n\t\t\t\t\tfor (let ii = 0; ii < listeners.length; ii++) {\n\t\t\t\t\t\tlet listener = listeners[ii];\n\t\t\t\t\t\tif (listener.end) listener.end(entry);\n\t\t\t\t\t}\n\t\t\t\t// Fall through.\n\t\t\t\tcase EventType.dispose:\n\t\t\t\t\tif (entry.listener && entry.listener.dispose) entry.listener.dispose(entry);\n\t\t\t\t\tfor (let ii = 0; ii < listeners.length; ii++) {\n\t\t\t\t\t\tlet listener = listeners[ii];\n\t\t\t\t\t\tif (listener.dispose) listener.dispose(entry);\n\t\t\t\t\t}\n\t\t\t\t\tthis.animState.trackEntryPool.free(entry);\n\t\t\t\t\tbreak;\n\t\t\t\tcase EventType.complete:\n\t\t\t\t\tif (entry.listener && entry.listener.complete) entry.listener.complete(entry);\n\t\t\t\t\tfor (let ii = 0; ii < listeners.length; ii++) {\n\t\t\t\t\t\tlet listener = listeners[ii];\n\t\t\t\t\t\tif (listener.complete) listener.complete(entry);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase EventType.event:\n\t\t\t\t\tlet event = objects[i++ + 2] as Event;\n\t\t\t\t\tif (entry.listener && entry.listener.event) entry.listener.event(entry, event);\n\t\t\t\t\tfor (let ii = 0; ii < listeners.length; ii++) {\n\t\t\t\t\t\tlet listener = listeners[ii];\n\t\t\t\t\t\tif (listener.event) listener.event(entry, event);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tthis.clear();\n\n\t\tthis.drainDisabled = false;\n\t}\n\n\tclear () {\n\t\tthis.objects.length = 0;\n\t}\n}\n\nexport enum EventType {\n\tstart, interrupt, end, dispose, complete, event\n}\n\n/** The interface to implement for receiving TrackEntry events. It is always safe to call AnimationState methods when receiving\n * events.\n *\n * See TrackEntry {@link TrackEntry#listener} and AnimationState\n * {@link AnimationState#addListener()}. */\nexport interface AnimationStateListener {\n\t/** Invoked when this entry has been set as the current entry. */\n\tstart?: (entry: TrackEntry) => void;\n\n\t/** Invoked when another entry has replaced this entry as the current entry. This entry may continue being applied for\n\t * mixing. */\n\tinterrupt?: (entry: TrackEntry) => void;\n\n\t/** Invoked when this entry is no longer the current entry and will never be applied again. */\n\tend?: (entry: TrackEntry) => void;\n\n\t/** Invoked when this entry will be disposed. This may occur without the entry ever being set as the current entry.\n\t * References to the entry should not be kept after dispose is called, as it may be destroyed or reused. */\n\tdispose?: (entry: TrackEntry) => void;\n\n\t/** Invoked every time this entry's animation completes a loop. */\n\tcomplete?: (entry: TrackEntry) => void;\n\n\t/** Invoked when this entry's animation triggers an event. */\n\tevent?: (entry: TrackEntry, event: Event) => void;\n}\n\nexport abstract class AnimationStateAdapter implements AnimationStateListener {\n\tstart (entry: TrackEntry) {\n\t}\n\n\tinterrupt (entry: TrackEntry) {\n\t}\n\n\tend (entry: TrackEntry) {\n\t}\n\n\tdispose (entry: TrackEntry) {\n\t}\n\n\tcomplete (entry: TrackEntry) {\n\t}\n\n\tevent (entry: TrackEntry, event: Event) {\n\t}\n}\n\n/** 1. A previously applied timeline has set this property.\n *\n * Result: Mix from the current pose to the timeline pose. */\nexport const SUBSEQUENT = 0;\n/** 1. This is the first timeline to set this property.\n * 2. The next track entry applied after this one does not have a timeline to set this property.\n *\n * Result: Mix from the setup pose to the timeline pose. */\nexport const FIRST = 1;\n/** 1) A previously applied timeline has set this property.<br>\n * 2) The next track entry to be applied does have a timeline to set this property.<br>\n * 3) The next track entry after that one does not have a timeline to set this property.<br>\n * Result: Mix from the current pose to the timeline pose, but do not mix out. This avoids \"dipping\" when crossfading\n * animations that key the same property. A subsequent timeline will set this property using a mix. */\nexport const HOLD_SUBSEQUENT = 2;\n/** 1) This is the first timeline to set this property.<br>\n * 2) The next track entry to be applied does have a timeline to set this property.<br>\n * 3) The next track entry after that one does not have a timeline to set this property.<br>\n * Result: Mix from the setup pose to the timeline pose, but do not mix out. This avoids \"dipping\" when crossfading animations\n * that key the same property. A subsequent timeline will set this property using a mix. */\nexport const HOLD_FIRST = 3;\n/** 1. This is the first timeline to set this property.\n * 2. The next track entry to be applied does have a timeline to set this property.\n * 3. The next track entry after that one does have a timeline to set this property.\n * 4. timelineHoldMix stores the first subsequent track entry that does not have a timeline to set this property.\n *\n * Result: The same as HOLD except the mix percentage from the timelineHoldMix track entry is used. This handles when more than\n * 2 track entries in a row have a timeline that sets the same property.\n *\n * Eg, A -> B -> C -> D where A, B, and C have a timeline setting same property, but D does not. When A is applied, to avoid\n * \"dipping\" A is not mixed out, however D (the first entry that doesn't set the property) mixing in is used to mix out A\n * (which affects B and C). Without using D to mix out, A would be applied fully until mixing completes, then snap into\n * place. */\nexport const HOLD_MIX = 4;\n\nexport const SETUP = 1;\nexport const CURRENT = 2;\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Animation } from \"./Animation.js\";\nimport { SkeletonData } from \"./SkeletonData.js\";\nimport { StringMap } from \"./Utils.js\";\n\n\n/** Stores mix (crossfade) durations to be applied when {@link AnimationState} animations are changed. */\nexport class AnimationStateData {\n\t/** The SkeletonData to look up animations when they are specified by name. */\n\tskeletonData: SkeletonData;\n\n\tanimationToMixTime: StringMap<number> = {};\n\n\t/** The mix duration to use when no mix duration has been defined between two animations. */\n\tdefaultMix = 0;\n\n\tconstructor (skeletonData: SkeletonData) {\n\t\tif (!skeletonData) throw new Error(\"skeletonData cannot be null.\");\n\t\tthis.skeletonData = skeletonData;\n\t}\n\n\t/** Sets a mix duration by animation name.\n\t *\n\t * See {@link #setMixWith()}. */\n\tsetMix (fromName: string, toName: string, duration: number) {\n\t\tlet from = this.skeletonData.findAnimation(fromName);\n\t\tif (!from) throw new Error(\"Animation not found: \" + fromName);\n\t\tlet to = this.skeletonData.findAnimation(toName);\n\t\tif (!to) throw new Error(\"Animation not found: \" + toName);\n\t\tthis.setMixWith(from, to, duration);\n\t}\n\n\t/** Sets the mix duration when changing from the specified animation to the other.\n\t *\n\t * See {@link TrackEntry#mixDuration}. */\n\tsetMixWith (from: Animation, to: Animation, duration: number) {\n\t\tif (!from) throw new Error(\"from cannot be null.\");\n\t\tif (!to) throw new Error(\"to cannot be null.\");\n\t\tlet key = from.name + \".\" + to.name;\n\t\tthis.animationToMixTime[key] = duration;\n\t}\n\n\t/** Returns the mix duration to use when changing from the specified animation to the other, or the {@link #defaultMix} if\n\t * no mix duration has been set. */\n\tgetMix (from: Animation, to: Animation) {\n\t\tlet key = from.name + \".\" + to.name;\n\t\tlet value = this.animationToMixTime[key];\n\t\treturn value === undefined ? this.defaultMix : value;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Color } from \"../Utils.js\";\nimport { VertexAttachment, Attachment } from \"./Attachment.js\";\n\n/** An attachment with vertices that make up a polygon. Can be used for hit detection, creating physics bodies, spawning particle\n * effects, and more.\n *\n * See {@link SkeletonBounds} and [Bounding Boxes](http://esotericsoftware.com/spine-bounding-boxes) in the Spine User\n * Guide. */\nexport class BoundingBoxAttachment extends VertexAttachment {\n\tcolor = new Color(1, 1, 1, 1);\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\tcopy (): Attachment {\n\t\tlet copy = new BoundingBoxAttachment(this.name);\n\t\tthis.copyTo(copy);\n\t\tcopy.color.setFromColor(this.color);\n\t\treturn copy;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { SlotData } from \"../SlotData.js\";\nimport { Color } from \"../Utils.js\";\nimport { VertexAttachment, Attachment } from \"./Attachment.js\";\n\n/** An attachment with vertices that make up a polygon used for clipping the rendering of other attachments. */\nexport class ClippingAttachment extends VertexAttachment {\n\t/** Clipping is performed between the clipping polygon's slot and the end slot. Returns null if clipping is done until the end of\n\t * the skeleton's rendering. */\n\tendSlot: SlotData | null = null;\n\n\t// Nonessential.\n\t/** The color of the clipping polygon as it was in Spine. Available only when nonessential data was exported. Clipping polygons\n\t * are not usually rendered at runtime. */\n\tcolor = new Color(0.2275, 0.2275, 0.8078, 1); // ce3a3aff\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\tcopy (): Attachment {\n\t\tlet copy = new ClippingAttachment(this.name);\n\t\tthis.copyTo(copy);\n\t\tcopy.endSlot = this.endSlot;\n\t\tcopy.color.setFromColor(this.color);\n\t\treturn copy;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport abstract class Texture {\n\tprotected _image: HTMLImageElement | ImageBitmap | any;\n\n\tconstructor (image: HTMLImageElement | ImageBitmap | any) {\n\t\tthis._image = image;\n\t}\n\n\tgetImage (): HTMLImageElement | ImageBitmap | any {\n\t\treturn this._image;\n\t}\n\n\tabstract setFilters (minFilter: TextureFilter, magFilter: TextureFilter): void;\n\tabstract setWraps (uWrap: TextureWrap, vWrap: TextureWrap): void;\n\tabstract dispose (): void;\n}\n\nexport enum TextureFilter {\n\tNearest = 9728, // WebGLRenderingContext.NEAREST\n\tLinear = 9729, // WebGLRenderingContext.LINEAR\n\tMipMap = 9987, // WebGLRenderingContext.LINEAR_MIPMAP_LINEAR\n\tMipMapNearestNearest = 9984, // WebGLRenderingContext.NEAREST_MIPMAP_NEAREST\n\tMipMapLinearNearest = 9985, // WebGLRenderingContext.LINEAR_MIPMAP_NEAREST\n\tMipMapNearestLinear = 9986, // WebGLRenderingContext.NEAREST_MIPMAP_LINEAR\n\tMipMapLinearLinear = 9987 // WebGLRenderingContext.LINEAR_MIPMAP_LINEAR\n}\n\nexport enum TextureWrap {\n\tMirroredRepeat = 33648, // WebGLRenderingContext.MIRRORED_REPEAT\n\tClampToEdge = 33071, // WebGLRenderingContext.CLAMP_TO_EDGE\n\tRepeat = 10497 // WebGLRenderingContext.REPEAT\n}\n\nexport class TextureRegion {\n\ttexture: any;\n\tu = 0; v = 0;\n\tu2 = 0; v2 = 0;\n\twidth = 0; height = 0;\n\tdegrees = 0;\n\toffsetX = 0; offsetY = 0;\n\toriginalWidth = 0; originalHeight = 0;\n}\n\nexport class FakeTexture extends Texture {\n\tsetFilters (minFilter: TextureFilter, magFilter: TextureFilter) { }\n\tsetWraps (uWrap: TextureWrap, vWrap: TextureWrap) { }\n\tdispose () { }\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { AssetManagerBase } from \"./AssetManagerBase.js\";\nimport { TextureFilter, TextureWrap, Texture, TextureRegion } from \"./Texture.js\";\nimport { Disposable, Utils, StringMap } from \"./Utils.js\";\n\nexport class TextureAtlas implements Disposable {\n\tpages = new Array<TextureAtlasPage>();\n\tregions = new Array<TextureAtlasRegion>();\n\n\tconstructor (atlasText: string) {\n\t\tlet reader = new TextureAtlasReader(atlasText);\n\t\tlet entry = new Array<string>(4);\n\n\t\tlet pageFields: StringMap<(page: TextureAtlasPage) => void> = {};\n\t\tpageFields[\"size\"] = (page: TextureAtlasPage) => {\n\t\t\tpage!.width = parseInt(entry[1]);\n\t\t\tpage!.height = parseInt(entry[2]);\n\t\t};\n\t\tpageFields[\"format\"] = () => {\n\t\t\t// page.format = Format[tuple[0]]; we don't need format in WebGL\n\t\t};\n\t\tpageFields[\"filter\"] = (page: TextureAtlasPage) => {\n\t\t\tpage!.minFilter = Utils.enumValue(TextureFilter, entry[1]);\n\t\t\tpage!.magFilter = Utils.enumValue(TextureFilter, entry[2]);\n\t\t};\n\t\tpageFields[\"repeat\"] = (page: TextureAtlasPage) => {\n\t\t\tif (entry[1].indexOf('x') != -1) page!.uWrap = TextureWrap.Repeat;\n\t\t\tif (entry[1].indexOf('y') != -1) page!.vWrap = TextureWrap.Repeat;\n\t\t};\n\t\tpageFields[\"pma\"] = (page: TextureAtlasPage) => {\n\t\t\tpage!.pma = entry[1] == \"true\";\n\t\t};\n\n\t\tvar regionFields: StringMap<(region: TextureAtlasRegion) => void> = {};\n\t\tregionFields[\"xy\"] = (region: TextureAtlasRegion) => { // Deprecated, use bounds.\n\t\t\tregion.x = parseInt(entry[1]);\n\t\t\tregion.y = parseInt(entry[2]);\n\t\t};\n\t\tregionFields[\"size\"] = (region: TextureAtlasRegion) => { // Deprecated, use bounds.\n\t\t\tregion.width = parseInt(entry[1]);\n\t\t\tregion.height = parseInt(entry[2]);\n\t\t};\n\t\tregionFields[\"bounds\"] = (region: TextureAtlasRegion) => {\n\t\t\tregion.x = parseInt(entry[1]);\n\t\t\tregion.y = parseInt(entry[2]);\n\t\t\tregion.width = parseInt(entry[3]);\n\t\t\tregion.height = parseInt(entry[4]);\n\t\t};\n\t\tregionFields[\"offset\"] = (region: TextureAtlasRegion) => { // Deprecated, use offsets.\n\t\t\tregion.offsetX = parseInt(entry[1]);\n\t\t\tregion.offsetY = parseInt(entry[2]);\n\t\t};\n\t\tregionFields[\"orig\"] = (region: TextureAtlasRegion) => { // Deprecated, use offsets.\n\t\t\tregion.originalWidth = parseInt(entry[1]);\n\t\t\tregion.originalHeight = parseInt(entry[2]);\n\t\t};\n\t\tregionFields[\"offsets\"] = (region: TextureAtlasRegion) => {\n\t\t\tregion.offsetX = parseInt(entry[1]);\n\t\t\tregion.offsetY = parseInt(entry[2]);\n\t\t\tregion.originalWidth = parseInt(entry[3]);\n\t\t\tregion.originalHeight = parseInt(entry[4]);\n\t\t};\n\t\tregionFields[\"rotate\"] = (region: TextureAtlasRegion) => {\n\t\t\tlet value = entry[1];\n\t\t\tif (value == \"true\")\n\t\t\t\tregion.degrees = 90;\n\t\t\telse if (value != \"false\")\n\t\t\t\tregion.degrees = parseInt(value);\n\t\t};\n\t\tregionFields[\"index\"] = (region: TextureAtlasRegion) => {\n\t\t\tregion.index = parseInt(entry[1]);\n\t\t};\n\n\t\tlet line = reader.readLine();\n\t\t// Ignore empty lines before first entry.\n\t\twhile (line && line.trim().length == 0)\n\t\t\tline = reader.readLine();\n\t\t// Header entries.\n\t\twhile (true) {\n\t\t\tif (!line || line.trim().length == 0) break;\n\t\t\tif (reader.readEntry(entry, line) == 0) break; // Silently ignore all header fields.\n\t\t\tline = reader.readLine();\n\t\t}\n\n\t\t// Page and region entries.\n\t\tlet page: TextureAtlasPage | null = null;\n\t\tlet names: string[] | null = null;\n\t\tlet values: number[][] | null = null;\n\t\twhile (true) {\n\t\t\tif (line === null) break;\n\t\t\tif (line.trim().length == 0) {\n\t\t\t\tpage = null;\n\t\t\t\tline = reader.readLine();\n\t\t\t} else if (!page) {\n\t\t\t\tpage = new TextureAtlasPage(line.trim());\n\t\t\t\twhile (true) {\n\t\t\t\t\tif (reader.readEntry(entry, line = reader.readLine()) == 0) break;\n\t\t\t\t\tlet field = pageFields[entry[0]];\n\t\t\t\t\tif (field) field(page);\n\t\t\t\t}\n\t\t\t\tthis.pages.push(page);\n\t\t\t} else {\n\t\t\t\tlet region = new TextureAtlasRegion(page, line);\n\n\t\t\t\twhile (true) {\n\t\t\t\t\tlet count = reader.readEntry(entry, line = reader.readLine());\n\t\t\t\t\tif (count == 0) break;\n\t\t\t\t\tlet field = regionFields[entry[0]];\n\t\t\t\t\tif (field)\n\t\t\t\t\t\tfield(region);\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (!names) names = [];\n\t\t\t\t\t\tif (!values) values = [];\n\t\t\t\t\t\tnames.push(entry[0]);\n\t\t\t\t\t\tlet entryValues: number[] = [];\n\t\t\t\t\t\tfor (let i = 0; i < count; i++)\n\t\t\t\t\t\t\tentryValues.push(parseInt(entry[i + 1]));\n\t\t\t\t\t\tvalues.push(entryValues);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (region.originalWidth == 0 && region.originalHeight == 0) {\n\t\t\t\t\tregion.originalWidth = region.width;\n\t\t\t\t\tregion.originalHeight = region.height;\n\t\t\t\t}\n\t\t\t\tif (names && names.length > 0 && values && values.length > 0) {\n\t\t\t\t\tregion.names = names;\n\t\t\t\t\tregion.values = values;\n\t\t\t\t\tnames = null;\n\t\t\t\t\tvalues = null;\n\t\t\t\t}\n\t\t\t\tregion.u = region.x / page.width;\n\t\t\t\tregion.v = region.y / page.height;\n\t\t\t\tif (region.degrees == 90) {\n\t\t\t\t\tregion.u2 = (region.x + region.height) / page.width;\n\t\t\t\t\tregion.v2 = (region.y + region.width) / page.height;\n\t\t\t\t} else {\n\t\t\t\t\tregion.u2 = (region.x + region.width) / page.width;\n\t\t\t\t\tregion.v2 = (region.y + region.height) / page.height;\n\t\t\t\t}\n\t\t\t\tthis.regions.push(region);\n\t\t\t}\n\t\t}\n\t}\n\n\tfindRegion (name: string): TextureAtlasRegion | null {\n\t\tfor (let i = 0; i < this.regions.length; i++) {\n\t\t\tif (this.regions[i].name == name) {\n\t\t\t\treturn this.regions[i];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tsetTextures (assetManager: AssetManagerBase, pathPrefix: string = \"\") {\n\t\tfor (let page of this.pages)\n\t\t\tpage.setTexture(assetManager.get(pathPrefix + page.name));\n\t}\n\n\tdispose () {\n\t\tfor (let i = 0; i < this.pages.length; i++) {\n\t\t\tthis.pages[i].texture?.dispose();\n\t\t}\n\t}\n}\n\nclass TextureAtlasReader {\n\tlines: Array<string>;\n\tindex: number = 0;\n\n\tconstructor (text: string) {\n\t\tthis.lines = text.split(/\\r\\n|\\r|\\n/);\n\t}\n\n\treadLine (): string | null {\n\t\tif (this.index >= this.lines.length)\n\t\t\treturn null;\n\t\treturn this.lines[this.index++];\n\t}\n\n\treadEntry (entry: string[], line: string | null): number {\n\t\tif (!line) return 0;\n\t\tline = line.trim();\n\t\tif (line.length == 0) return 0;\n\n\t\tlet colon = line.indexOf(':');\n\t\tif (colon == -1) return 0;\n\t\tentry[0] = line.substr(0, colon).trim();\n\t\tfor (let i = 1, lastMatch = colon + 1; ; i++) {\n\t\t\tlet comma = line.indexOf(',', lastMatch);\n\t\t\tif (comma == -1) {\n\t\t\t\tentry[i] = line.substr(lastMatch).trim();\n\t\t\t\treturn i;\n\t\t\t}\n\t\t\tentry[i] = line.substr(lastMatch, comma - lastMatch).trim();\n\t\t\tlastMatch = comma + 1;\n\t\t\tif (i == 4) return 4;\n\t\t}\n\t}\n}\n\nexport class TextureAtlasPage {\n\tname: string;\n\tminFilter: TextureFilter = TextureFilter.Nearest;\n\tmagFilter: TextureFilter = TextureFilter.Nearest;\n\tuWrap: TextureWrap = TextureWrap.ClampToEdge;\n\tvWrap: TextureWrap = TextureWrap.ClampToEdge;\n\ttexture: Texture | null = null;\n\twidth: number = 0;\n\theight: number = 0;\n\tpma: boolean = false;\n\tregions = new Array<TextureAtlasRegion>();\n\n\tconstructor (name: string) {\n\t\tthis.name = name;\n\t}\n\n\tsetTexture (texture: Texture) {\n\t\tthis.texture = texture;\n\t\ttexture.setFilters(this.minFilter, this.magFilter);\n\t\ttexture.setWraps(this.uWrap, this.vWrap);\n\t\tfor (let region of this.regions)\n\t\t\tregion.texture = texture;\n\t}\n}\n\nexport class TextureAtlasRegion extends TextureRegion {\n\tpage: TextureAtlasPage;\n\tname: string;\n\tx: number = 0;\n\ty: number = 0;\n\toffsetX: number = 0;\n\toffsetY: number = 0;\n\toriginalWidth: number = 0;\n\toriginalHeight: number = 0;\n\tindex: number = 0;\n\tdegrees: number = 0;\n\tnames: string[] | null = null;\n\tvalues: number[][] | null = null;\n\n\tconstructor (page: TextureAtlasPage, name: string) {\n\t\tsuper();\n\t\tthis.page = page;\n\t\tthis.name = name;\n\t\tpage.regions.push(this);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { TextureRegion } from \"../Texture.js\";\nimport { TextureAtlasRegion } from \"../TextureAtlas.js\";\nimport { Color, NumberArrayLike, Utils } from \"../Utils.js\";\nimport { VertexAttachment, Attachment } from \"./Attachment.js\";\nimport { HasTextureRegion } from \"./HasTextureRegion.js\";\nimport { Sequence } from \"./Sequence.js\";\nimport { Slot } from \"../Slot.js\";\n\n/** An attachment that displays a textured mesh. A mesh has hull vertices and internal vertices within the hull. Holes are not\n * supported. Each vertex has UVs (texture coordinates) and triangles are used to map an image on to the mesh.\n *\n * See [Mesh attachments](http://esotericsoftware.com/spine-meshes) in the Spine User Guide. */\nexport class MeshAttachment extends VertexAttachment implements HasTextureRegion {\n\tregion: TextureRegion | null = null;\n\n\t/** The name of the texture region for this attachment. */\n\tpath: string;\n\n\t/** The UV pair for each vertex, normalized within the texture region. */\n\tregionUVs: NumberArrayLike = [];\n\n\t/** The UV pair for each vertex, normalized within the entire texture.\n\t *\n\t * See {@link #updateUVs}. */\n\tuvs: NumberArrayLike = [];\n\n\t/** Triplets of vertex indices which describe the mesh's triangulation. */\n\ttriangles: Array<number> = [];\n\n\t/** The color to tint the mesh. */\n\tcolor = new Color(1, 1, 1, 1);\n\n\t/** The width of the mesh's image. Available only when nonessential data was exported. */\n\twidth: number = 0;\n\n\t/** The height of the mesh's image. Available only when nonessential data was exported. */\n\theight: number = 0;\n\n\t/** The number of entries at the beginning of {@link #vertices} that make up the mesh hull. */\n\thullLength: number = 0;\n\n\t/** Vertex index pairs describing edges for controling triangulation. Mesh triangles will never cross edges. Only available if\n\t * nonessential data was exported. Triangulation is not performed at runtime. */\n\tedges: Array<number> = [];\n\n\tprivate parentMesh: MeshAttachment | null = null;\n\n\tsequence: Sequence | null = null;\n\n\ttempColor = new Color(0, 0, 0, 0);\n\n\tconstructor (name: string, path: string) {\n\t\tsuper(name);\n\t\tthis.path = path;\n\t}\n\n\t/** Calculates {@link #uvs} using the {@link #regionUVs} and region. Must be called if the region, the region's properties, or\n\t * the {@link #regionUVs} are changed. */\n\tupdateRegion () {\n\t\tif (!this.region) throw new Error(\"Region not set.\");\n\t\tlet regionUVs = this.regionUVs;\n\t\tif (!this.uvs || this.uvs.length != regionUVs.length) this.uvs = Utils.newFloatArray(regionUVs.length);\n\t\tlet uvs = this.uvs;\n\t\tlet n = this.uvs.length;\n\t\tlet u = this.region.u, v = this.region.v, width = 0, height = 0;\n\t\tif (this.region instanceof TextureAtlasRegion) {\n\t\t\tlet region = this.region, page = region.page;\n\t\t\tlet textureWidth = page.width, textureHeight = page.height;\n\t\t\tswitch (region.degrees) {\n\t\t\t\tcase 90:\n\t\t\t\t\tu -= (region.originalHeight - region.offsetY - region.height) / textureWidth;\n\t\t\t\t\tv -= (region.originalWidth - region.offsetX - region.width) / textureHeight;\n\t\t\t\t\twidth = region.originalHeight / textureWidth;\n\t\t\t\t\theight = region.originalWidth / textureHeight;\n\t\t\t\t\tfor (let i = 0; i < n; i += 2) {\n\t\t\t\t\t\tuvs[i] = u + regionUVs[i + 1] * width;\n\t\t\t\t\t\tuvs[i + 1] = v + (1 - regionUVs[i]) * height;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\tcase 180:\n\t\t\t\t\tu -= (region.originalWidth - region.offsetX - region.width) / textureWidth;\n\t\t\t\t\tv -= region.offsetY / textureHeight;\n\t\t\t\t\twidth = region.originalWidth / textureWidth;\n\t\t\t\t\theight = region.originalHeight / textureHeight;\n\t\t\t\t\tfor (let i = 0; i < n; i += 2) {\n\t\t\t\t\t\tuvs[i] = u + (1 - regionUVs[i]) * width;\n\t\t\t\t\t\tuvs[i + 1] = v + (1 - regionUVs[i + 1]) * height;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\tcase 270:\n\t\t\t\t\tu -= region.offsetY / textureWidth;\n\t\t\t\t\tv -= region.offsetX / textureHeight;\n\t\t\t\t\twidth = region.originalHeight / textureWidth;\n\t\t\t\t\theight = region.originalWidth / textureHeight;\n\t\t\t\t\tfor (let i = 0; i < n; i += 2) {\n\t\t\t\t\t\tuvs[i] = u + (1 - regionUVs[i + 1]) * width;\n\t\t\t\t\t\tuvs[i + 1] = v + regionUVs[i] * height;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t}\n\t\t\tu -= region.offsetX / textureWidth;\n\t\t\tv -= (region.originalHeight - region.offsetY - region.height) / textureHeight;\n\t\t\twidth = region.originalWidth / textureWidth;\n\t\t\theight = region.originalHeight / textureHeight;\n\t\t} else if (!this.region) {\n\t\t\tu = v = 0;\n\t\t\twidth = height = 1;\n\t\t} else {\n\t\t\twidth = this.region.u2 - u;\n\t\t\theight = this.region.v2 - v;\n\t\t}\n\n\t\tfor (let i = 0; i < n; i += 2) {\n\t\t\tuvs[i] = u + regionUVs[i] * width;\n\t\t\tuvs[i + 1] = v + regionUVs[i + 1] * height;\n\t\t}\n\t}\n\n\t/** The parent mesh if this is a linked mesh, else null. A linked mesh shares the {@link #bones}, {@link #vertices},\n\t * {@link #regionUVs}, {@link #triangles}, {@link #hullLength}, {@link #edges}, {@link #width}, and {@link #height} with the\n\t * parent mesh, but may have a different {@link #name} or {@link #path} (and therefore a different texture). */\n\tgetParentMesh () {\n\t\treturn this.parentMesh;\n\t}\n\n\t/** @param parentMesh May be null. */\n\tsetParentMesh (parentMesh: MeshAttachment) {\n\t\tthis.parentMesh = parentMesh;\n\t\tif (parentMesh) {\n\t\t\tthis.bones = parentMesh.bones;\n\t\t\tthis.vertices = parentMesh.vertices;\n\t\t\tthis.worldVerticesLength = parentMesh.worldVerticesLength;\n\t\t\tthis.regionUVs = parentMesh.regionUVs;\n\t\t\tthis.triangles = parentMesh.triangles;\n\t\t\tthis.hullLength = parentMesh.hullLength;\n\t\t\tthis.worldVerticesLength = parentMesh.worldVerticesLength\n\t\t}\n\t}\n\n\tcopy (): Attachment {\n\t\tif (this.parentMesh) return this.newLinkedMesh();\n\n\t\tlet copy = new MeshAttachment(this.name, this.path);\n\t\tcopy.region = this.region;\n\t\tcopy.color.setFromColor(this.color);\n\n\t\tthis.copyTo(copy);\n\t\tcopy.regionUVs = new Array<number>(this.regionUVs.length);\n\t\tUtils.arrayCopy(this.regionUVs, 0, copy.regionUVs, 0, this.regionUVs.length);\n\t\tcopy.uvs = new Array<number>(this.uvs.length);\n\t\tUtils.arrayCopy(this.uvs, 0, copy.uvs, 0, this.uvs.length);\n\t\tcopy.triangles = new Array<number>(this.triangles.length);\n\t\tUtils.arrayCopy(this.triangles, 0, copy.triangles, 0, this.triangles.length);\n\t\tcopy.hullLength = this.hullLength;\n\n\t\tcopy.sequence = this.sequence != null ? this.sequence.copy() : null;\n\n\t\t// Nonessential.\n\t\tif (this.edges) {\n\t\t\tcopy.edges = new Array<number>(this.edges.length);\n\t\t\tUtils.arrayCopy(this.edges, 0, copy.edges, 0, this.edges.length);\n\t\t}\n\t\tcopy.width = this.width;\n\t\tcopy.height = this.height;\n\n\t\treturn copy;\n\t}\n\n\tcomputeWorldVertices (slot: Slot, start: number, count: number, worldVertices: NumberArrayLike, offset: number, stride: number) {\n\t\tif (this.sequence != null) this.sequence.apply(slot, this);\n\t\tsuper.computeWorldVertices(slot, start, count, worldVertices, offset, stride);\n\t}\n\n\t/** Returns a new mesh with the {@link #parentMesh} set to this mesh's parent mesh, if any, else to this mesh. **/\n\tnewLinkedMesh (): MeshAttachment {\n\t\tlet copy = new MeshAttachment(this.name, this.path);\n\t\tcopy.region = this.region;\n\t\tcopy.color.setFromColor(this.color);\n\t\tcopy.timelineAttachment = this.timelineAttachment;\n\t\tcopy.setParentMesh(this.parentMesh ? this.parentMesh : this);\n\t\tif (copy.region != null) copy.updateRegion();\n\t\treturn copy;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Color, Utils } from \"../Utils.js\";\nimport { VertexAttachment, Attachment } from \"./Attachment.js\";\n\n/** An attachment whose vertices make up a composite Bezier curve.\n *\n * See {@link PathConstraint} and [Paths](http://esotericsoftware.com/spine-paths) in the Spine User Guide. */\nexport class PathAttachment extends VertexAttachment {\n\n\t/** The lengths along the path in the setup pose from the start of the path to the end of each Bezier curve. */\n\tlengths: Array<number> = [];\n\n\t/** If true, the start and end knots are connected. */\n\tclosed = false;\n\n\t/** If true, additional calculations are performed to make calculating positions along the path more accurate. If false, fewer\n\t * calculations are performed but calculating positions along the path is less accurate. */\n\tconstantSpeed = false;\n\n\t/** The color of the path as it was in Spine. Available only when nonessential data was exported. Paths are not usually\n\t * rendered at runtime. */\n\tcolor = new Color(1, 1, 1, 1);\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\tcopy (): Attachment {\n\t\tlet copy = new PathAttachment(this.name);\n\t\tthis.copyTo(copy);\n\t\tcopy.lengths = new Array<number>(this.lengths.length);\n\t\tUtils.arrayCopy(this.lengths, 0, copy.lengths, 0, this.lengths.length);\n\t\tcopy.closed = closed;\n\t\tcopy.constantSpeed = this.constantSpeed;\n\t\tcopy.color.setFromColor(this.color);\n\t\treturn copy;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Bone } from \"../Bone.js\";\nimport { Color, Vector2, MathUtils } from \"../Utils.js\";\nimport { VertexAttachment, Attachment } from \"./Attachment.js\";\n\n/** An attachment which is a single point and a rotation. This can be used to spawn projectiles, particles, etc. A bone can be\n * used in similar ways, but a PointAttachment is slightly less expensive to compute and can be hidden, shown, and placed in a\n * skin.\n *\n * See [Point Attachments](http://esotericsoftware.com/spine-point-attachments) in the Spine User Guide. */\nexport class PointAttachment extends VertexAttachment {\n\tx: number = 0;\n\ty: number = 0;\n\trotation: number = 0;\n\n\t/** The color of the point attachment as it was in Spine. Available only when nonessential data was exported. Point attachments\n\t * are not usually rendered at runtime. */\n\tcolor = new Color(0.38, 0.94, 0, 1);\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\tcomputeWorldPosition (bone: Bone, point: Vector2) {\n\t\tpoint.x = this.x * bone.a + this.y * bone.b + bone.worldX;\n\t\tpoint.y = this.x * bone.c + this.y * bone.d + bone.worldY;\n\t\treturn point;\n\t}\n\n\tcomputeWorldRotation (bone: Bone) {\n\t\tconst r = this.rotation * MathUtils.degRad, cos = Math.cos(r), sin = Math.sin(r);\n\t\tconst x = cos * bone.a + sin * bone.b;\n\t\tconst y = cos * bone.c + sin * bone.d;\n\t\treturn MathUtils.atan2Deg(y, x);\t\t\n\t}\n\n\tcopy (): Attachment {\n\t\tlet copy = new PointAttachment(this.name);\n\t\tcopy.x = this.x;\n\t\tcopy.y = this.y;\n\t\tcopy.rotation = this.rotation;\n\t\tcopy.color.setFromColor(this.color);\n\t\treturn copy;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Bone } from \"../Bone.js\";\nimport { TextureRegion } from \"../Texture.js\";\nimport { Color, MathUtils, NumberArrayLike, Utils } from \"../Utils.js\";\nimport { Attachment } from \"./Attachment.js\";\nimport { HasTextureRegion } from \"./HasTextureRegion.js\";\nimport { Sequence } from \"./Sequence.js\";\nimport { Slot } from \"../Slot.js\";\n\n/** An attachment that displays a textured quadrilateral.\n *\n * See [Region attachments](http://esotericsoftware.com/spine-regions) in the Spine User Guide. */\nexport class RegionAttachment extends Attachment implements HasTextureRegion {\n\t/** The local x translation. */\n\tx = 0;\n\n\t/** The local y translation. */\n\ty = 0;\n\n\t/** The local scaleX. */\n\tscaleX = 1;\n\n\t/** The local scaleY. */\n\tscaleY = 1;\n\n\t/** The local rotation. */\n\trotation = 0;\n\n\t/** The width of the region attachment in Spine. */\n\twidth = 0;\n\n\t/** The height of the region attachment in Spine. */\n\theight = 0;\n\n\t/** The color to tint the region attachment. */\n\tcolor = new Color(1, 1, 1, 1);\n\n\t/** The name of the texture region for this attachment. */\n\tpath: string;\n\n\tregion: TextureRegion | null = null;\n\tsequence: Sequence | null = null;\n\n\t/** For each of the 4 vertices, a pair of <code>x,y</code> values that is the local position of the vertex.\n\t *\n\t * See {@link #updateOffset()}. */\n\toffset = Utils.newFloatArray(8);\n\n\tuvs = Utils.newFloatArray(8);\n\n\ttempColor = new Color(1, 1, 1, 1);\n\n\tconstructor (name: string, path: string) {\n\t\tsuper(name);\n\t\tthis.path = path;\n\t}\n\n\t/** Calculates the {@link #offset} using the region settings. Must be called after changing region settings. */\n\tupdateRegion (): void {\n\t\tif (!this.region) throw new Error(\"Region not set.\");\n\t\tlet region = this.region;\n\t\tlet uvs = this.uvs;\n\n\t\tif (region == null) {\n\t\t\tuvs[0] = 0;\n\t\t\tuvs[1] = 0;\n\t\t\tuvs[2] = 0;\n\t\t\tuvs[3] = 1;\n\t\t\tuvs[4] = 1;\n\t\t\tuvs[5] = 1;\n\t\t\tuvs[6] = 1;\n\t\t\tuvs[7] = 0;\n\t\t\treturn;\n\t\t}\n\n\t\tlet regionScaleX = this.width / this.region.originalWidth * this.scaleX;\n\t\tlet regionScaleY = this.height / this.region.originalHeight * this.scaleY;\n\t\tlet localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX;\n\t\tlet localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY;\n\t\tlet localX2 = localX + this.region.width * regionScaleX;\n\t\tlet localY2 = localY + this.region.height * regionScaleY;\n\t\tlet radians = this.rotation * MathUtils.degRad;\n\t\tlet cos = Math.cos(radians);\n\t\tlet sin = Math.sin(radians);\n\t\tlet x = this.x, y = this.y;\n\t\tlet localXCos = localX * cos + x;\n\t\tlet localXSin = localX * sin;\n\t\tlet localYCos = localY * cos + y;\n\t\tlet localYSin = localY * sin;\n\t\tlet localX2Cos = localX2 * cos + x;\n\t\tlet localX2Sin = localX2 * sin;\n\t\tlet localY2Cos = localY2 * cos + y;\n\t\tlet localY2Sin = localY2 * sin;\n\t\tlet offset = this.offset;\n\t\toffset[0] = localXCos - localYSin;\n\t\toffset[1] = localYCos + localXSin;\n\t\toffset[2] = localXCos - localY2Sin;\n\t\toffset[3] = localY2Cos + localXSin;\n\t\toffset[4] = localX2Cos - localY2Sin;\n\t\toffset[5] = localY2Cos + localX2Sin;\n\t\toffset[6] = localX2Cos - localYSin;\n\t\toffset[7] = localYCos + localX2Sin;\n\n\t\tif (region.degrees == 90) {\n\t\t\tuvs[0] = region.u2;\n\t\t\tuvs[1] = region.v2;\n\t\t\tuvs[2] = region.u;\n\t\t\tuvs[3] = region.v2;\n\t\t\tuvs[4] = region.u;\n\t\t\tuvs[5] = region.v;\n\t\t\tuvs[6] = region.u2;\n\t\t\tuvs[7] = region.v;\n\t\t} else {\n\t\t\tuvs[0] = region.u;\n\t\t\tuvs[1] = region.v2;\n\t\t\tuvs[2] = region.u;\n\t\t\tuvs[3] = region.v;\n\t\t\tuvs[4] = region.u2;\n\t\t\tuvs[5] = region.v;\n\t\t\tuvs[6] = region.u2;\n\t\t\tuvs[7] = region.v2;\n\t\t}\n\t}\n\n\t/** Transforms the attachment's four vertices to world coordinates. If the attachment has a {@link #sequence}, the region may\n\t * be changed.\n\t * <p>\n\t * See <a href=\"http://esotericsoftware.com/spine-runtime-skeletons#World-transforms\">World transforms</a> in the Spine\n\t * Runtimes Guide.\n\t * @param worldVertices The output world vertices. Must have a length >= <code>offset</code> + 8.\n\t * @param offset The <code>worldVertices</code> index to begin writing values.\n\t * @param stride The number of <code>worldVertices</code> entries between the value pairs written. */\n\tcomputeWorldVertices (slot: Slot, worldVertices: NumberArrayLike, offset: number, stride: number) {\n\t\tif (this.sequence != null)\n\t\t\tthis.sequence.apply(slot, this);\n\n\t\tlet bone = slot.bone;\n\t\tlet vertexOffset = this.offset;\n\t\tlet x = bone.worldX, y = bone.worldY;\n\t\tlet a = bone.a, b = bone.b, c = bone.c, d = bone.d;\n\t\tlet offsetX = 0, offsetY = 0;\n\n\t\toffsetX = vertexOffset[0];\n\t\toffsetY = vertexOffset[1];\n\t\tworldVertices[offset] = offsetX * a + offsetY * b + x; // br\n\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\n\t\toffset += stride;\n\n\t\toffsetX = vertexOffset[2];\n\t\toffsetY = vertexOffset[3];\n\t\tworldVertices[offset] = offsetX * a + offsetY * b + x; // bl\n\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\n\t\toffset += stride;\n\n\t\toffsetX = vertexOffset[4];\n\t\toffsetY = vertexOffset[5];\n\t\tworldVertices[offset] = offsetX * a + offsetY * b + x; // ul\n\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\n\t\toffset += stride;\n\n\t\toffsetX = vertexOffset[6];\n\t\toffsetY = vertexOffset[7];\n\t\tworldVertices[offset] = offsetX * a + offsetY * b + x; // ur\n\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\n\t}\n\n\tcopy (): Attachment {\n\t\tlet copy = new RegionAttachment(this.name, this.path);\n\t\tcopy.region = this.region;\n\t\tcopy.x = this.x;\n\t\tcopy.y = this.y;\n\t\tcopy.scaleX = this.scaleX;\n\t\tcopy.scaleY = this.scaleY;\n\t\tcopy.rotation = this.rotation;\n\t\tcopy.width = this.width;\n\t\tcopy.height = this.height;\n\t\tUtils.arrayCopy(this.uvs, 0, copy.uvs, 0, 8);\n\t\tUtils.arrayCopy(this.offset, 0, copy.offset, 0, 8);\n\t\tcopy.color.setFromColor(this.color);\n\t\tcopy.sequence = this.sequence != null ? this.sequence.copy() : null;\n\t\treturn copy;\n\t}\n\n\tstatic X1 = 0;\n\tstatic Y1 = 1;\n\tstatic C1R = 2;\n\tstatic C1G = 3;\n\tstatic C1B = 4;\n\tstatic C1A = 5;\n\tstatic U1 = 6;\n\tstatic V1 = 7;\n\n\tstatic X2 = 8;\n\tstatic Y2 = 9;\n\tstatic C2R = 10;\n\tstatic C2G = 11;\n\tstatic C2B = 12;\n\tstatic C2A = 13;\n\tstatic U2 = 14;\n\tstatic V2 = 15;\n\n\tstatic X3 = 16;\n\tstatic Y3 = 17;\n\tstatic C3R = 18;\n\tstatic C3G = 19;\n\tstatic C3B = 20;\n\tstatic C3A = 21;\n\tstatic U3 = 22;\n\tstatic V3 = 23;\n\n\tstatic X4 = 24;\n\tstatic Y4 = 25;\n\tstatic C4R = 26;\n\tstatic C4G = 27;\n\tstatic C4B = 28;\n\tstatic C4A = 29;\n\tstatic U4 = 30;\n\tstatic V4 = 31;\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { AttachmentLoader } from \"./attachments/AttachmentLoader.js\";\nimport { BoundingBoxAttachment } from \"./attachments/BoundingBoxAttachment.js\";\nimport { ClippingAttachment } from \"./attachments/ClippingAttachment.js\";\nimport { MeshAttachment } from \"./attachments/MeshAttachment.js\";\nimport { PathAttachment } from \"./attachments/PathAttachment.js\";\nimport { PointAttachment } from \"./attachments/PointAttachment.js\";\nimport { RegionAttachment } from \"./attachments/RegionAttachment.js\";\nimport { Skin } from \"./Skin.js\";\nimport { TextureAtlas } from \"./TextureAtlas.js\";\nimport { Sequence } from \"./attachments/Sequence.js\"\n\n/** An {@link AttachmentLoader} that configures attachments using texture regions from an {@link TextureAtlas}.\n *\n * See [Loading skeleton data](http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data) in the\n * Spine Runtimes Guide. */\nexport class AtlasAttachmentLoader implements AttachmentLoader {\n\tatlas: TextureAtlas;\n\n\tconstructor (atlas: TextureAtlas) {\n\t\tthis.atlas = atlas;\n\t}\n\n\tloadSequence (name: string, basePath: string, sequence: Sequence) {\n\t\tlet regions = sequence.regions;\n\t\tfor (let i = 0, n = regions.length; i < n; i++) {\n\t\t\tlet path = sequence.getPath(basePath, i);\n\t\t\tlet region = this.atlas.findRegion(path);\n\t\t\tif (region == null) throw new Error(\"Region not found in atlas: \" + path + \" (sequence: \" + name + \")\");\n\t\t\tregions[i] = region;\n\t\t}\n\t}\n\n\tnewRegionAttachment (skin: Skin, name: string, path: string, sequence: Sequence): RegionAttachment {\n\t\tlet attachment = new RegionAttachment(name, path);\n\t\tif (sequence != null) {\n\t\t\tthis.loadSequence(name, path, sequence);\n\t\t} else {\n\t\t\tlet region = this.atlas.findRegion(path);\n\t\t\tif (!region) throw new Error(\"Region not found in atlas: \" + path + \" (region attachment: \" + name + \")\");\n\t\t\tattachment.region = region;\n\t\t}\n\t\treturn attachment;\n\t}\n\n\tnewMeshAttachment (skin: Skin, name: string, path: string, sequence: Sequence): MeshAttachment {\n\t\tlet attachment = new MeshAttachment(name, path);\n\t\tif (sequence != null) {\n\t\t\tthis.loadSequence(name, path, sequence);\n\t\t} else {\n\t\t\tlet region = this.atlas.findRegion(path);\n\t\t\tif (!region) throw new Error(\"Region not found in atlas: \" + path + \" (mesh attachment: \" + name + \")\");\n\t\t\tattachment.region = region;\n\t\t}\n\t\treturn attachment;\n\t}\n\n\tnewBoundingBoxAttachment (skin: Skin, name: string): BoundingBoxAttachment {\n\t\treturn new BoundingBoxAttachment(name);\n\t}\n\n\tnewPathAttachment (skin: Skin, name: string): PathAttachment {\n\t\treturn new PathAttachment(name);\n\t}\n\n\tnewPointAttachment (skin: Skin, name: string): PointAttachment {\n\t\treturn new PointAttachment(name);\n\t}\n\n\tnewClippingAttachment (skin: Skin, name: string): ClippingAttachment {\n\t\treturn new ClippingAttachment(name);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Color } from \"./Utils.js\";\n\n/** Stores the setup pose for a {@link Bone}. */\nexport class BoneData {\n\t/** The index of the bone in {@link Skeleton#getBones()}. */\n\tindex: number = 0;\n\n\t/** The name of the bone, which is unique across all bones in the skeleton. */\n\tname: string;\n\n\t/** @returns May be null. */\n\tparent: BoneData | null = null;\n\n\t/** The bone's length. */\n\tlength: number = 0;\n\n\t/** The local x translation. */\n\tx = 0;\n\n\t/** The local y translation. */\n\ty = 0;\n\n\t/** The local rotation in degrees, counter clockwise. */\n\trotation = 0;\n\n\t/** The local scaleX. */\n\tscaleX = 1;\n\n\t/** The local scaleY. */\n\tscaleY = 1;\n\n\t/** The local shearX. */\n\tshearX = 0;\n\n\t/** The local shearX. */\n\tshearY = 0;\n\n\t/** The transform mode for how parent world transforms affect this bone. */\n\tinherit = Inherit.Normal;\n\n\t/** When true, {@link Skeleton#updateWorldTransform()} only updates this bone if the {@link Skeleton#skin} contains this\n\t * bone.\n\t * @see Skin#bones */\n\tskinRequired = false;\n\n\t/** The color of the bone as it was in Spine. Available only when nonessential data was exported. Bones are not usually\n\t * rendered at runtime. */\n\tcolor = new Color();\n\n\t/** The bone icon as it was in Spine, or null if nonessential data was not exported. */\n\ticon?: string;\n\n\t/** False if the bone was hidden in Spine and nonessential data was exported. Does not affect runtime rendering. */\n\tvisible = false;\n\n\tconstructor (index: number, name: string, parent: BoneData | null) {\n\t\tif (index < 0) throw new Error(\"index must be >= 0.\");\n\t\tif (!name) throw new Error(\"name cannot be null.\");\n\t\tthis.index = index;\n\t\tthis.name = name;\n\t\tthis.parent = parent;\n\t}\n}\n\n/** Determines how a bone inherits world transforms from parent bones. */\nexport enum Inherit { Normal, OnlyTranslation, NoRotationOrReflection, NoScale, NoScaleOrReflection }\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BoneData, Inherit } from \"./BoneData.js\";\nimport { Physics, Skeleton } from \"./Skeleton.js\";\nimport { Updatable } from \"./Updatable.js\";\nimport { MathUtils, Vector2 } from \"./Utils.js\";\n\n/** Stores a bone's current pose.\n *\n * A bone has a local transform which is used to compute its world transform. A bone also has an applied transform, which is a\n * local transform that can be applied to compute the world transform. The local transform and applied transform may differ if a\n * constraint or application code modifies the world transform after it was computed from the local transform. */\nexport class Bone implements Updatable {\n\t/** The bone's setup pose data. */\n\tdata: BoneData;\n\n\t/** The skeleton this bone belongs to. */\n\tskeleton: Skeleton;\n\n\t/** The parent bone, or null if this is the root bone. */\n\tparent: Bone | null = null;\n\n\t/** The immediate children of this bone. */\n\tchildren = new Array<Bone>();\n\n\t/** The local x translation. */\n\tx = 0;\n\n\t/** The local y translation. */\n\ty = 0;\n\n\t/** The local rotation in degrees, counter clockwise. */\n\trotation = 0;\n\n\t/** The local scaleX. */\n\tscaleX = 0;\n\n\t/** The local scaleY. */\n\tscaleY = 0;\n\n\t/** The local shearX. */\n\tshearX = 0;\n\n\t/** The local shearY. */\n\tshearY = 0;\n\n\t/** The applied local x translation. */\n\tax = 0;\n\n\t/** The applied local y translation. */\n\tay = 0;\n\n\t/** The applied local rotation in degrees, counter clockwise. */\n\tarotation = 0;\n\n\t/** The applied local scaleX. */\n\tascaleX = 0;\n\n\t/** The applied local scaleY. */\n\tascaleY = 0;\n\n\t/** The applied local shearX. */\n\tashearX = 0;\n\n\t/** The applied local shearY. */\n\tashearY = 0;\n\n\t/** Part of the world transform matrix for the X axis. If changed, {@link #updateAppliedTransform()} should be called. */\n\ta = 0;\n\n\t/** Part of the world transform matrix for the Y axis. If changed, {@link #updateAppliedTransform()} should be called. */\n\tb = 0;\n\n\t/** Part of the world transform matrix for the X axis. If changed, {@link #updateAppliedTransform()} should be called. */\n\tc = 0;\n\n\t/** Part of the world transform matrix for the Y axis. If changed, {@link #updateAppliedTransform()} should be called. */\n\td = 0;\n\n\t/** The world X position. If changed, {@link #updateAppliedTransform()} should be called. */\n\tworldY = 0;\n\n\t/** The world Y position. If changed, {@link #updateAppliedTransform()} should be called. */\n\tworldX = 0;\n\n\tinherit: Inherit = Inherit.Normal;\n\n\tsorted = false;\n\tactive = false;\n\n\t/** @param parent May be null. */\n\tconstructor (data: BoneData, skeleton: Skeleton, parent: Bone | null) {\n\t\tif (!data) throw new Error(\"data cannot be null.\");\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\t\tthis.data = data;\n\t\tthis.skeleton = skeleton;\n\t\tthis.parent = parent;\n\t\tthis.setToSetupPose();\n\t}\n\n\t/** Returns false when the bone has not been computed because {@link BoneData#skinRequired} is true and the\n\t * {@link Skeleton#skin active skin} does not {@link Skin#bones contain} this bone. */\n\tisActive () {\n\t\treturn this.active;\n\t}\n\n\t/** Computes the world transform using the parent bone and this bone's local applied transform. */\n\tupdate (physics: Physics) {\n\t\tthis.updateWorldTransformWith(this.ax, this.ay, this.arotation, this.ascaleX, this.ascaleY, this.ashearX, this.ashearY);\n\t}\n\n\t/** Computes the world transform using the parent bone and this bone's local transform.\n\t *\n\t * See {@link #updateWorldTransformWith()}. */\n\tupdateWorldTransform () {\n\t\tthis.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\n\t}\n\n\t/** Computes the world transform using the parent bone and the specified local transform. The applied transform is set to the\n\t * specified local transform. Child bones are not updated.\n\t *\n\t * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine\n\t * Runtimes Guide. */\n\tupdateWorldTransformWith (x: number, y: number, rotation: number, scaleX: number, scaleY: number, shearX: number, shearY: number) {\n\t\tthis.ax = x;\n\t\tthis.ay = y;\n\t\tthis.arotation = rotation;\n\t\tthis.ascaleX = scaleX;\n\t\tthis.ascaleY = scaleY;\n\t\tthis.ashearX = shearX;\n\t\tthis.ashearY = shearY;\n\n\t\tlet parent = this.parent;\n\t\tif (!parent) { // Root bone.\n\t\t\tlet skeleton = this.skeleton;\n\t\t\tconst sx = skeleton.scaleX, sy = skeleton.scaleY;\n\t\t\tconst rx = (rotation + shearX) * MathUtils.degRad;\n\t\t\tconst ry = (rotation + 90 + shearY) * MathUtils.degRad;\n\t\t\tthis.a = Math.cos(rx) * scaleX * sx;\n\t\t\tthis.b = Math.cos(ry) * scaleY * sx;\n\t\t\tthis.c = Math.sin(rx) * scaleX * sy;\n\t\t\tthis.d = Math.sin(ry) * scaleY * sy;\n\t\t\tthis.worldX = x * sx + skeleton.x;\n\t\t\tthis.worldY = y * sy + skeleton.y;\n\t\t\treturn;\n\t\t}\n\n\t\tlet pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;\n\t\tthis.worldX = pa * x + pb * y + parent.worldX;\n\t\tthis.worldY = pc * x + pd * y + parent.worldY;\n\n\t\tswitch (this.inherit) {\n\t\t\tcase Inherit.Normal: {\n\t\t\t\tconst rx = (rotation + shearX) * MathUtils.degRad;\n\t\t\t\tconst ry = (rotation + 90 + shearY) * MathUtils.degRad;\n\t\t\t\tconst la = Math.cos(rx) * scaleX;\n\t\t\t\tconst lb = Math.cos(ry) * scaleY;\n\t\t\t\tconst lc = Math.sin(rx) * scaleX;\n\t\t\t\tconst ld = Math.sin(ry) * scaleY;\n\t\t\t\tthis.a = pa * la + pb * lc;\n\t\t\t\tthis.b = pa * lb + pb * ld;\n\t\t\t\tthis.c = pc * la + pd * lc;\n\t\t\t\tthis.d = pc * lb + pd * ld;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase Inherit.OnlyTranslation: {\n\t\t\t\tconst rx = (rotation + shearX) * MathUtils.degRad;\n\t\t\t\tconst ry = (rotation + 90 + shearY) * MathUtils.degRad;\n\t\t\t\tthis.a = Math.cos(rx) * scaleX;\n\t\t\t\tthis.b = Math.cos(ry) * scaleY;\n\t\t\t\tthis.c = Math.sin(rx) * scaleX;\n\t\t\t\tthis.d = Math.sin(ry) * scaleY;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase Inherit.NoRotationOrReflection: {\n\t\t\t\tlet sx = 1 / this.skeleton.scaleX, sy = 1 / this.skeleton.scaleY;\n\t\t\t\tpa *= sx;\n\t\t\t\tpc *= sy;\n\t\t\t\tlet s = pa * pa + pc * pc;\n\t\t\t\tlet prx = 0;\n\t\t\t\tif (s > 0.0001) {\n\t\t\t\t\ts = Math.abs(pa * pd * sy - pb * sx * pc) / s;\n\t\t\t\t\tpb = pc * s;\n\t\t\t\t\tpd = pa * s;\n\t\t\t\t\tprx = Math.atan2(pc, pa) * MathUtils.radDeg;\n\t\t\t\t} else {\n\t\t\t\t\tpa = 0;\n\t\t\t\t\tpc = 0;\n\t\t\t\t\tprx = 90 - Math.atan2(pd, pb) * MathUtils.radDeg;\n\t\t\t\t}\n\t\t\t\tconst rx = (rotation + shearX - prx) * MathUtils.degRad;\n\t\t\t\tconst ry = (rotation + shearY - prx + 90) * MathUtils.degRad;\n\t\t\t\tconst la = Math.cos(rx) * scaleX;\n\t\t\t\tconst lb = Math.cos(ry) * scaleY;\n\t\t\t\tconst lc = Math.sin(rx) * scaleX;\n\t\t\t\tconst ld = Math.sin(ry) * scaleY;\n\t\t\t\tthis.a = pa * la - pb * lc;\n\t\t\t\tthis.b = pa * lb - pb * ld;\n\t\t\t\tthis.c = pc * la + pd * lc;\n\t\t\t\tthis.d = pc * lb + pd * ld;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase Inherit.NoScale:\n\t\t\tcase Inherit.NoScaleOrReflection: {\n\t\t\t\trotation *= MathUtils.degRad;\n\t\t\t\tconst cos = Math.cos(rotation), sin = Math.sin(rotation);\n\t\t\t\tlet za = (pa * cos + pb * sin) / this.skeleton.scaleX;\n\t\t\t\tlet zc = (pc * cos + pd * sin) / this.skeleton.scaleY;\n\t\t\t\tlet s = Math.sqrt(za * za + zc * zc);\n\t\t\t\tif (s > 0.00001) s = 1 / s;\n\t\t\t\tza *= s;\n\t\t\t\tzc *= s;\n\t\t\t\ts = Math.sqrt(za * za + zc * zc);\n\t\t\t\tif (this.inherit == Inherit.NoScale\n\t\t\t\t\t&& (pa * pd - pb * pc < 0) != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0)) s = -s;\n\t\t\t\trotation = Math.PI / 2 + Math.atan2(zc, za);\n\t\t\t\tconst zb = Math.cos(rotation) * s;\n\t\t\t\tconst zd = Math.sin(rotation) * s;\n\t\t\t\tshearX *= MathUtils.degRad;\n\t\t\t\tshearY = (90 + shearY) * MathUtils.degRad;\n\t\t\t\tconst la = Math.cos(shearX) * scaleX;\n\t\t\t\tconst lb = Math.cos(shearY) * scaleY;\n\t\t\t\tconst lc = Math.sin(shearX) * scaleX;\n\t\t\t\tconst ld = Math.sin(shearY) * scaleY;\n\t\t\t\tthis.a = za * la + zb * lc;\n\t\t\t\tthis.b = za * lb + zb * ld;\n\t\t\t\tthis.c = zc * la + zd * lc;\n\t\t\t\tthis.d = zc * lb + zd * ld;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tthis.a *= this.skeleton.scaleX;\n\t\tthis.b *= this.skeleton.scaleX;\n\t\tthis.c *= this.skeleton.scaleY;\n\t\tthis.d *= this.skeleton.scaleY;\n\t}\n\n\t/** Sets this bone's local transform to the setup pose. */\n\tsetToSetupPose () {\n\t\tlet data = this.data;\n\t\tthis.x = data.x;\n\t\tthis.y = data.y;\n\t\tthis.rotation = data.rotation;\n\t\tthis.scaleX = data.scaleX;\n\t\tthis.scaleY = data.scaleY;\n\t\tthis.shearX = data.shearX;\n\t\tthis.shearY = data.shearY;\n\t\tthis.inherit = data.inherit;\n\t}\n\n\t/** Computes the applied transform values from the world transform.\n\t *\n\t * If the world transform is modified (by a constraint, {@link #rotateWorld(float)}, etc) then this method should be called so\n\t * the applied transform matches the world transform. The applied transform may be needed by other code (eg to apply other\n\t * constraints).\n\t *\n\t * Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. The applied transform after\n\t * calling this method is equivalent to the local transform used to compute the world transform, but may not be identical. */\n\tupdateAppliedTransform () {\n\t\tlet parent = this.parent;\n\t\tif (!parent) {\n\t\t\tthis.ax = this.worldX - this.skeleton.x;\n\t\t\tthis.ay = this.worldY - this.skeleton.y;\n\t\t\tthis.arotation = Math.atan2(this.c, this.a) * MathUtils.radDeg;\n\t\t\tthis.ascaleX = Math.sqrt(this.a * this.a + this.c * this.c);\n\t\t\tthis.ascaleY = Math.sqrt(this.b * this.b + this.d * this.d);\n\t\t\tthis.ashearX = 0;\n\t\t\tthis.ashearY = Math.atan2(this.a * this.b + this.c * this.d, this.a * this.d - this.b * this.c) * MathUtils.radDeg;\n\t\t\treturn;\n\t\t}\n\t\tlet pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;\n\t\tlet pid = 1 / (pa * pd - pb * pc);\n\t\tlet ia = pd * pid, ib = pb * pid, ic = pc * pid, id = pa * pid;\n\t\tlet dx = this.worldX - parent.worldX, dy = this.worldY - parent.worldY;\n\t\tthis.ax = (dx * ia - dy * ib);\n\t\tthis.ay = (dy * id - dx * ic);\n\n\t\tlet ra, rb, rc, rd;\n\t\tif (this.inherit == Inherit.OnlyTranslation) {\n\t\t\tra = this.a;\n\t\t\trb = this.b;\n\t\t\trc = this.c;\n\t\t\trd = this.d;\n\t\t} else {\n\t\t\tswitch (this.inherit) {\n\t\t\t\tcase Inherit.NoRotationOrReflection: {\n\t\t\t\t\tlet s = Math.abs(pa * pd - pb * pc) / (pa * pa + pc * pc);\n\t\t\t\t\tpb = -pc * this.skeleton.scaleX * s / this.skeleton.scaleY;\n\t\t\t\t\tpd = pa * this.skeleton.scaleY * s / this.skeleton.scaleX;\n\t\t\t\t\tpid = 1 / (pa * pd - pb * pc);\n\t\t\t\t\tia = pd * pid;\n\t\t\t\t\tib = pb * pid;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase Inherit.NoScale:\n\t\t\t\tcase Inherit.NoScaleOrReflection:\n\t\t\t\t\tlet cos = MathUtils.cosDeg(this.rotation), sin = MathUtils.sinDeg(this.rotation);\n\t\t\t\t\tpa = (pa * cos + pb * sin) / this.skeleton.scaleX;\n\t\t\t\t\tpc = (pc * cos + pd * sin) / this.skeleton.scaleY;\n\t\t\t\t\tlet s = Math.sqrt(pa * pa + pc * pc);\n\t\t\t\t\tif (s > 0.00001) s = 1 / s;\n\t\t\t\t\tpa *= s;\n\t\t\t\t\tpc *= s;\n\t\t\t\t\ts = Math.sqrt(pa * pa + pc * pc);\n\t\t\t\t\tif (this.inherit == Inherit.NoScale && pid < 0 != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0)) s = -s;\n\t\t\t\t\tlet r = MathUtils.PI / 2 + Math.atan2(pc, pa);\n\t\t\t\t\tpb = Math.cos(r) * s;\n\t\t\t\t\tpd = Math.sin(r) * s;\n\t\t\t\t\tpid = 1 / (pa * pd - pb * pc);\n\t\t\t\t\tia = pd * pid;\n\t\t\t\t\tib = pb * pid;\n\t\t\t\t\tic = pc * pid;\n\t\t\t\t\tid = pa * pid;\n\t\t\t}\n\t\t\tra = ia * this.a - ib * this.c;\n\t\t\trb = ia * this.b - ib * this.d;\n\t\t\trc = id * this.c - ic * this.a;\n\t\t\trd = id * this.d - ic * this.b;\n\t\t}\n\n\t\tthis.ashearX = 0;\n\t\tthis.ascaleX = Math.sqrt(ra * ra + rc * rc);\n\t\tif (this.ascaleX > 0.0001) {\n\t\t\tlet det = ra * rd - rb * rc;\n\t\t\tthis.ascaleY = det / this.ascaleX;\n\t\t\tthis.ashearY = -Math.atan2(ra * rb + rc * rd, det) * MathUtils.radDeg;\n\t\t\tthis.arotation = Math.atan2(rc, ra) * MathUtils.radDeg;\n\t\t} else {\n\t\t\tthis.ascaleX = 0;\n\t\t\tthis.ascaleY = Math.sqrt(rb * rb + rd * rd);\n\t\t\tthis.ashearY = 0;\n\t\t\tthis.arotation = 90 - Math.atan2(rd, rb) * MathUtils.radDeg;\n\t\t}\n\t}\n\n\n\t/** The world rotation for the X axis, calculated using {@link #a} and {@link #c}. */\n\tgetWorldRotationX () {\n\t\treturn Math.atan2(this.c, this.a) * MathUtils.radDeg;\n\t}\n\n\t/** The world rotation for the Y axis, calculated using {@link #b} and {@link #d}. */\n\tgetWorldRotationY () {\n\t\treturn Math.atan2(this.d, this.b) * MathUtils.radDeg;\n\t}\n\n\t/** The magnitude (always positive) of the world scale X, calculated using {@link #a} and {@link #c}. */\n\tgetWorldScaleX () {\n\t\treturn Math.sqrt(this.a * this.a + this.c * this.c);\n\t}\n\n\t/** The magnitude (always positive) of the world scale Y, calculated using {@link #b} and {@link #d}. */\n\tgetWorldScaleY () {\n\t\treturn Math.sqrt(this.b * this.b + this.d * this.d);\n\t}\n\n\t/** Transforms a point from world coordinates to the bone's local coordinates. */\n\tworldToLocal (world: Vector2) {\n\t\tlet invDet = 1 / (this.a * this.d - this.b * this.c);\n\t\tlet x = world.x - this.worldX, y = world.y - this.worldY;\n\t\tworld.x = x * this.d * invDet - y * this.b * invDet;\n\t\tworld.y = y * this.a * invDet - x * this.c * invDet;\n\t\treturn world;\n\t}\n\n\t/** Transforms a point from the bone's local coordinates to world coordinates. */\n\tlocalToWorld (local: Vector2) {\n\t\tlet x = local.x, y = local.y;\n\t\tlocal.x = x * this.a + y * this.b + this.worldX;\n\t\tlocal.y = x * this.c + y * this.d + this.worldY;\n\t\treturn local;\n\t}\n\n\t/** Transforms a point from world coordinates to the parent bone's local coordinates. */\n\tworldToParent (world: Vector2) {\n\t\tif (world == null) throw new Error(\"world cannot be null.\");\n\t\treturn this.parent == null ? world : this.parent.worldToLocal(world);\n\t}\n\n\t/** Transforms a point from the parent bone's coordinates to world coordinates. */\n\tparentToWorld (world: Vector2) {\n\t\tif (world == null) throw new Error(\"world cannot be null.\");\n\t\treturn this.parent == null ? world : this.parent.localToWorld(world);\n\t}\n\n\t/** Transforms a world rotation to a local rotation. */\n\tworldToLocalRotation (worldRotation: number) {\n\t\tlet sin = MathUtils.sinDeg(worldRotation), cos = MathUtils.cosDeg(worldRotation);\n\t\treturn Math.atan2(this.a * sin - this.c * cos, this.d * cos - this.b * sin) * MathUtils.radDeg + this.rotation - this.shearX;\n\t}\n\n\t/** Transforms a local rotation to a world rotation. */\n\tlocalToWorldRotation (localRotation: number) {\n\t\tlocalRotation -= this.rotation - this.shearX;\n\t\tlet sin = MathUtils.sinDeg(localRotation), cos = MathUtils.cosDeg(localRotation);\n\t\treturn Math.atan2(cos * this.c + sin * this.d, cos * this.a + sin * this.b) * MathUtils.radDeg;\n\t}\n\n\t/** Rotates the world transform the specified amount.\n\t * <p>\n\t * After changes are made to the world transform, {@link #updateAppliedTransform()} should be called and\n\t * {@link #update(Physics)} will need to be called on any child bones, recursively. */\n\trotateWorld (degrees: number) {\n\t\tdegrees *= MathUtils.degRad;\n\t\tconst sin = Math.sin(degrees), cos = Math.cos(degrees);\n\t\tconst ra = this.a, rb = this.b;\n\t\tthis.a = cos * ra - sin * this.c;\n\t\tthis.b = cos * rb - sin * this.d;\n\t\tthis.c = sin * ra + cos * this.c;\n\t\tthis.d = sin * rb + cos * this.d;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n/** The base class for all constraint datas. */\nexport abstract class ConstraintData {\n\tconstructor (public name: string, public order: number, public skinRequired: boolean) { }\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Texture } from \"./Texture.js\";\nimport { TextureAtlas } from \"./TextureAtlas.js\";\nimport { Disposable, StringMap } from \"./Utils.js\";\n\nexport class AssetManagerBase implements Disposable {\n\tprivate pathPrefix: string = \"\";\n\tprivate textureLoader: (image: HTMLImageElement | ImageBitmap) => Texture;\n\tprivate downloader: Downloader;\n\tprivate assets: StringMap<any> = {};\n\tprivate errors: StringMap<string> = {};\n\tprivate toLoad = 0;\n\tprivate loaded = 0;\n\n\tconstructor (textureLoader: (image: HTMLImageElement | ImageBitmap) => Texture, pathPrefix: string = \"\", downloader: Downloader = new Downloader()) {\n\t\tthis.textureLoader = textureLoader;\n\t\tthis.pathPrefix = pathPrefix;\n\t\tthis.downloader = downloader;\n\t}\n\n\tprivate start (path: string): string {\n\t\tthis.toLoad++;\n\t\treturn this.pathPrefix + path;\n\t}\n\n\tprivate success (callback: (path: string, data: any) => void, path: string, asset: any) {\n\t\tthis.toLoad--;\n\t\tthis.loaded++;\n\t\tthis.assets[path] = asset;\n\t\tif (callback) callback(path, asset);\n\t}\n\n\tprivate error (callback: (path: string, message: string) => void, path: string, message: string) {\n\t\tthis.toLoad--;\n\t\tthis.loaded++;\n\t\tthis.errors[path] = message;\n\t\tif (callback) callback(path, message);\n\t}\n\n\tloadAll () {\n\t\tlet promise = new Promise((resolve: (assetManager: AssetManagerBase) => void, reject: (errors: StringMap<string>) => void) => {\n\t\t\tlet check = () => {\n\t\t\t\tif (this.isLoadingComplete()) {\n\t\t\t\t\tif (this.hasErrors()) reject(this.errors);\n\t\t\t\t\telse resolve(this);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\trequestAnimationFrame(check);\n\t\t\t}\n\t\t\trequestAnimationFrame(check);\n\t\t});\n\t\treturn promise;\n\t}\n\n\tsetRawDataURI (path: string, data: string) {\n\t\tthis.downloader.rawDataUris[this.pathPrefix + path] = data;\n\t}\n\n\tloadBinary (path: string,\n\t\tsuccess: (path: string, binary: Uint8Array) => void = () => { },\n\t\terror: (path: string, message: string) => void = () => { }) {\n\t\tpath = this.start(path);\n\n\t\tthis.downloader.downloadBinary(path, (data: Uint8Array): void => {\n\t\t\tthis.success(success, path, data);\n\t\t}, (status: number, responseText: string): void => {\n\t\t\tthis.error(error, path, `Couldn't load binary ${path}: status ${status}, ${responseText}`);\n\t\t});\n\t}\n\n\tloadText (path: string,\n\t\tsuccess: (path: string, text: string) => void = () => { },\n\t\terror: (path: string, message: string) => void = () => { }) {\n\t\tpath = this.start(path);\n\n\t\tthis.downloader.downloadText(path, (data: string): void => {\n\t\t\tthis.success(success, path, data);\n\t\t}, (status: number, responseText: string): void => {\n\t\t\tthis.error(error, path, `Couldn't load text ${path}: status ${status}, ${responseText}`);\n\t\t});\n\t}\n\n\tloadJson (path: string,\n\t\tsuccess: (path: string, object: object) => void = () => { },\n\t\terror: (path: string, message: string) => void = () => { }) {\n\t\tpath = this.start(path);\n\n\t\tthis.downloader.downloadJson(path, (data: object): void => {\n\t\t\tthis.success(success, path, data);\n\t\t}, (status: number, responseText: string): void => {\n\t\t\tthis.error(error, path, `Couldn't load JSON ${path}: status ${status}, ${responseText}`);\n\t\t});\n\t}\n\n\tloadTexture (path: string,\n\t\tsuccess: (path: string, texture: Texture) => void = () => { },\n\t\terror: (path: string, message: string) => void = () => { }) {\n\t\tpath = this.start(path);\n\n\t\tlet isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document);\n\t\tlet isWebWorker = !isBrowser; // && typeof importScripts !== 'undefined';\n\t\tif (isWebWorker) {\n\t\t\tfetch(path, { mode: <RequestMode>\"cors\" }).then((response) => {\n\t\t\t\tif (response.ok) return response.blob();\n\t\t\t\tthis.error(error, path, `Couldn't load image: ${path}`);\n\t\t\t\treturn null;\n\t\t\t}).then((blob) => {\n\t\t\t\treturn blob ? createImageBitmap(blob, { premultiplyAlpha: \"none\", colorSpaceConversion: \"none\" }) : null;\n\t\t\t}).then((bitmap) => {\n\t\t\t\tif (bitmap) this.success(success, path, this.textureLoader(bitmap));\n\t\t\t});\n\t\t} else {\n\t\t\tlet image = new Image();\n\t\t\timage.crossOrigin = \"anonymous\";\n\t\t\timage.onload = () => {\n\t\t\t\tthis.success(success, path, this.textureLoader(image));\n\t\t\t};\n\t\t\timage.onerror = () => {\n\t\t\t\tthis.error(error, path, `Couldn't load image: ${path}`);\n\t\t\t};\n\t\t\tif (this.downloader.rawDataUris[path]) path = this.downloader.rawDataUris[path];\n\t\t\timage.src = path;\n\t\t}\n\t}\n\n\tloadTextureAtlas (path: string,\n\t\tsuccess: (path: string, atlas: TextureAtlas) => void = () => { },\n\t\terror: (path: string, message: string) => void = () => { },\n\t\tfileAlias?: { [keyword: string]: string }\n\t) {\n\t\tlet index = path.lastIndexOf(\"/\");\n\t\tlet parent = index >= 0 ? path.substring(0, index + 1) : \"\";\n\t\tpath = this.start(path);\n\n\t\tthis.downloader.downloadText(path, (atlasText: string): void => {\n\t\t\ttry {\n\t\t\t\tlet atlas = new TextureAtlas(atlasText);\n\t\t\t\tlet toLoad = atlas.pages.length, abort = false;\n\t\t\t\tfor (let page of atlas.pages) {\n\t\t\t\t\tthis.loadTexture(!fileAlias ? parent + page.name : fileAlias[page.name!],\n\t\t\t\t\t\t(imagePath: string, texture: Texture) => {\n\t\t\t\t\t\t\tif (!abort) {\n\t\t\t\t\t\t\t\tpage.setTexture(texture);\n\t\t\t\t\t\t\t\tif (--toLoad == 0) this.success(success, path, atlas);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t(imagePath: string, message: string) => {\n\t\t\t\t\t\t\tif (!abort) this.error(error, path, `Couldn't load texture atlas ${path} page image: ${imagePath}`);\n\t\t\t\t\t\t\tabort = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tthis.error(error, path, `Couldn't parse texture atlas ${path}: ${(e as any).message}`);\n\t\t\t}\n\t\t}, (status: number, responseText: string): void => {\n\t\t\tthis.error(error, path, `Couldn't load texture atlas ${path}: status ${status}, ${responseText}`);\n\t\t});\n\t}\n\n\tget (path: string) {\n\t\treturn this.assets[this.pathPrefix + path];\n\t}\n\n\trequire (path: string) {\n\t\tpath = this.pathPrefix + path;\n\t\tlet asset = this.assets[path];\n\t\tif (asset) return asset;\n\t\tlet error = this.errors[path];\n\t\tthrow Error(\"Asset not found: \" + path + (error ? \"\\n\" + error : \"\"));\n\t}\n\n\tremove (path: string) {\n\t\tpath = this.pathPrefix + path;\n\t\tlet asset = this.assets[path];\n\t\tif ((<any>asset).dispose) (<any>asset).dispose();\n\t\tdelete this.assets[path];\n\t\treturn asset;\n\t}\n\n\tremoveAll () {\n\t\tfor (let key in this.assets) {\n\t\t\tlet asset = this.assets[key];\n\t\t\tif ((<any>asset).dispose) (<any>asset).dispose();\n\t\t}\n\t\tthis.assets = {};\n\t}\n\n\tisLoadingComplete (): boolean {\n\t\treturn this.toLoad == 0;\n\t}\n\n\tgetToLoad (): number {\n\t\treturn this.toLoad;\n\t}\n\n\tgetLoaded (): number {\n\t\treturn this.loaded;\n\t}\n\n\tdispose () {\n\t\tthis.removeAll();\n\t}\n\n\thasErrors () {\n\t\treturn Object.keys(this.errors).length > 0;\n\t}\n\n\tgetErrors () {\n\t\treturn this.errors;\n\t}\n}\n\nexport class Downloader {\n\tprivate callbacks: StringMap<Array<Function>> = {};\n\trawDataUris: StringMap<string> = {};\n\n\tdataUriToString (dataUri: string) {\n\t\tif (!dataUri.startsWith(\"data:\")) {\n\t\t\tthrow new Error(\"Not a data URI.\");\n\t\t}\n\n\t\tlet base64Idx = dataUri.indexOf(\"base64,\");\n\t\tif (base64Idx != -1) {\n\t\t\tbase64Idx += \"base64,\".length;\n\t\t\treturn atob(dataUri.substr(base64Idx));\n\t\t} else {\n\t\t\treturn dataUri.substr(dataUri.indexOf(\",\") + 1);\n\t\t}\n\t}\n\n\tbase64ToUint8Array (base64: string) {\n\t\tvar binary_string = window.atob(base64);\n\t\tvar len = binary_string.length;\n\t\tvar bytes = new Uint8Array(len);\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tbytes[i] = binary_string.charCodeAt(i);\n\t\t}\n\t\treturn bytes;\n\t}\n\n\tdataUriToUint8Array (dataUri: string) {\n\t\tif (!dataUri.startsWith(\"data:\")) {\n\t\t\tthrow new Error(\"Not a data URI.\");\n\t\t}\n\n\t\tlet base64Idx = dataUri.indexOf(\"base64,\");\n\t\tif (base64Idx == -1) throw new Error(\"Not a binary data URI.\");\n\t\tbase64Idx += \"base64,\".length;\n\t\treturn this.base64ToUint8Array(dataUri.substr(base64Idx));\n\t}\n\n\tdownloadText (url: string, success: (data: string) => void, error: (status: number, responseText: string) => void) {\n\t\tif (this.start(url, success, error)) return;\n\t\tif (this.rawDataUris[url]) {\n\t\t\ttry {\n\t\t\t\tlet dataUri = this.rawDataUris[url];\n\t\t\t\tthis.finish(url, 200, this.dataUriToString(dataUri));\n\t\t\t} catch (e) {\n\t\t\t\tthis.finish(url, 400, JSON.stringify(e));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tlet request = new XMLHttpRequest();\n\t\trequest.overrideMimeType(\"text/html\");\n\t\trequest.open(\"GET\", url, true);\n\t\tlet done = () => {\n\t\t\tthis.finish(url, request.status, request.responseText);\n\t\t};\n\t\trequest.onload = done;\n\t\trequest.onerror = done;\n\t\trequest.send();\n\t}\n\n\tdownloadJson (url: string, success: (data: object) => void, error: (status: number, responseText: string) => void) {\n\t\tthis.downloadText(url, (data: string): void => {\n\t\t\tsuccess(JSON.parse(data));\n\t\t}, error);\n\t}\n\n\tdownloadBinary (url: string, success: (data: Uint8Array) => void, error: (status: number, responseText: string) => void) {\n\t\tif (this.start(url, success, error)) return;\n\t\tif (this.rawDataUris[url]) {\n\t\t\ttry {\n\t\t\t\tlet dataUri = this.rawDataUris[url];\n\t\t\t\tthis.finish(url, 200, this.dataUriToUint8Array(dataUri));\n\t\t\t} catch (e) {\n\t\t\t\tthis.finish(url, 400, JSON.stringify(e));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tlet request = new XMLHttpRequest();\n\t\trequest.open(\"GET\", url, true);\n\t\trequest.responseType = \"arraybuffer\";\n\t\tlet onerror = () => {\n\t\t\tthis.finish(url, request.status, request.response);\n\t\t};\n\t\trequest.onload = () => {\n\t\t\tif (request.status == 200 || request.status == 0)\n\t\t\t\tthis.finish(url, 200, new Uint8Array(request.response as ArrayBuffer));\n\t\t\telse\n\t\t\t\tonerror();\n\t\t};\n\t\trequest.onerror = onerror;\n\t\trequest.send();\n\t}\n\n\tprivate start (url: string, success: any, error: any) {\n\t\tlet callbacks = this.callbacks[url];\n\t\ttry {\n\t\t\tif (callbacks) return true;\n\t\t\tthis.callbacks[url] = callbacks = [];\n\t\t} finally {\n\t\t\tcallbacks.push(success, error);\n\t\t}\n\t}\n\n\tprivate finish (url: string, status: number, data: any) {\n\t\tlet callbacks = this.callbacks[url];\n\t\tdelete this.callbacks[url];\n\t\tlet args = status == 200 || status == 0 ? [data] : [status, data];\n\t\tfor (let i = args.length - 1, n = callbacks.length; i < n; i += 2)\n\t\t\tcallbacks[i].apply(null, args);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { EventData } from \"./EventData.js\";\n\n/** Stores the current pose values for an {@link Event}.\n *\n * See Timeline {@link Timeline#apply()},\n * AnimationStateListener {@link AnimationStateListener#event()}, and\n * [Events](http://esotericsoftware.com/spine-events) in the Spine User Guide. */\nexport class Event {\n\tdata: EventData;\n\tintValue: number = 0;\n\tfloatValue: number = 0;\n\tstringValue: string | null = null;\n\ttime: number = 0;\n\tvolume: number = 0;\n\tbalance: number = 0;\n\n\tconstructor (time: number, data: EventData) {\n\t\tif (!data) throw new Error(\"data cannot be null.\");\n\t\tthis.time = time;\n\t\tthis.data = data;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n/** Stores the setup pose values for an {@link Event}.\n *\n * See [Events](http://esotericsoftware.com/spine-events) in the Spine User Guide. */\nexport class EventData {\n\tname: string;\n\tintValue: number = 0;\n\tfloatValue: number = 0;\n\tstringValue: string | null = null;\n\taudioPath: string | null = null;\n\tvolume: number = 0;\n\tbalance: number = 0;\n\n\tconstructor (name: string) {\n\t\tthis.name = name;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Bone } from \"./Bone.js\";\nimport { Inherit } from \"./BoneData.js\";\nimport { IkConstraintData } from \"./IkConstraintData.js\";\nimport { Physics, Skeleton } from \"./Skeleton.js\";\nimport { Updatable } from \"./Updatable.js\";\nimport { MathUtils } from \"./Utils.js\";\n\n/** Stores the current pose for an IK constraint. An IK constraint adjusts the rotation of 1 or 2 constrained bones so the tip of\n * the last bone is as close to the target bone as possible.\n *\n * See [IK constraints](http://esotericsoftware.com/spine-ik-constraints) in the Spine User Guide. */\nexport class IkConstraint implements Updatable {\n\t/** The IK constraint's setup pose data. */\n\tdata: IkConstraintData;\n\n\t/** The bones that will be modified by this IK constraint. */\n\tbones: Array<Bone>;\n\n\t/** The bone that is the IK target. */\n\ttarget: Bone;\n\n\t/** Controls the bend direction of the IK bones, either 1 or -1. */\n\tbendDirection = 0;\n\n\t/** When true and only a single bone is being constrained, if the target is too close, the bone is scaled to reach it. */\n\tcompress = false;\n\n\t/** When true, if the target is out of range, the parent bone is scaled to reach it. If more than one bone is being constrained\n\t * and the parent bone has local nonuniform scale, stretch is not applied. */\n\tstretch = false;\n\n\t/** A percentage (0-1) that controls the mix between the constrained and unconstrained rotations. */\n\tmix = 1;\n\n\t/** For two bone IK, the distance from the maximum reach of the bones that rotation will slow. */\n\tsoftness = 0;\n\tactive = false;\n\n\tconstructor (data: IkConstraintData, skeleton: Skeleton) {\n\t\tif (!data) throw new Error(\"data cannot be null.\");\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\t\tthis.data = data;\n\n\t\tthis.bones = new Array<Bone>();\n\t\tfor (let i = 0; i < data.bones.length; i++) {\n\t\t\tlet bone = skeleton.findBone(data.bones[i].name);\n\t\t\tif (!bone) throw new Error(`Couldn't find bone ${data.bones[i].name}`);\n\t\t\tthis.bones.push(bone);\n\t\t}\n\t\tlet target = skeleton.findBone(data.target.name);\n\t\tif (!target) throw new Error(`Couldn't find bone ${data.target.name}`);\n\n\t\tthis.target = target;\n\t\tthis.mix = data.mix;\n\t\tthis.softness = data.softness;\n\t\tthis.bendDirection = data.bendDirection;\n\t\tthis.compress = data.compress;\n\t\tthis.stretch = data.stretch;\n\t}\n\n\tisActive () {\n\t\treturn this.active;\n\t}\n\n\tsetToSetupPose () {\n\t\tconst data = this.data;\n\t\tthis.mix = data.mix;\n\t\tthis.softness = data.softness;\n\t\tthis.bendDirection = data.bendDirection;\n\t\tthis.compress = data.compress;\n\t\tthis.stretch = data.stretch;\n\t}\n\n\tupdate (physics: Physics) {\n\t\tif (this.mix == 0) return;\n\t\tlet target = this.target;\n\t\tlet bones = this.bones;\n\t\tswitch (bones.length) {\n\t\t\tcase 1:\n\t\t\t\tthis.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tthis.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.data.uniform, this.softness, this.mix);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/** Applies 1 bone IK. The target is specified in the world coordinate system. */\n\tapply1 (bone: Bone, targetX: number, targetY: number, compress: boolean, stretch: boolean, uniform: boolean, alpha: number) {\n\t\tlet p = bone.parent;\n\t\tif (!p) throw new Error(\"IK bone must have parent.\");\n\t\tlet pa = p.a, pb = p.b, pc = p.c, pd = p.d;\n\t\tlet rotationIK = -bone.ashearX - bone.arotation, tx = 0, ty = 0;\n\n\t\tswitch (bone.inherit) {\n\t\t\tcase Inherit.OnlyTranslation:\n\t\t\t\ttx = (targetX - bone.worldX) * MathUtils.signum(bone.skeleton.scaleX);\n\t\t\t\tty = (targetY - bone.worldY) * MathUtils.signum(bone.skeleton.scaleY);\n\t\t\t\tbreak;\n\t\t\tcase Inherit.NoRotationOrReflection:\n\t\t\t\tlet s = Math.abs(pa * pd - pb * pc) / Math.max(0.0001, pa * pa + pc * pc);\n\t\t\t\tlet sa = pa / bone.skeleton.scaleX;\n\t\t\t\tlet sc = pc / bone.skeleton.scaleY;\n\t\t\t\tpb = -sc * s * bone.skeleton.scaleX;\n\t\t\t\tpd = sa * s * bone.skeleton.scaleY;\n\t\t\t\trotationIK += Math.atan2(sc, sa) * MathUtils.radDeg;\n\t\t\t// Fall through\n\t\t\tdefault:\n\t\t\t\tlet x = targetX - p.worldX, y = targetY - p.worldY;\n\t\t\t\tlet d = pa * pd - pb * pc;\n\t\t\t\tif (Math.abs(d) <= 0.0001) {\n\t\t\t\t\ttx = 0;\n\t\t\t\t\tty = 0;\n\t\t\t\t} else {\n\t\t\t\t\ttx = (x * pd - y * pb) / d - bone.ax;\n\t\t\t\t\tty = (y * pa - x * pc) / d - bone.ay;\n\t\t\t\t}\n\t\t}\n\t\trotationIK += Math.atan2(ty, tx) * MathUtils.radDeg;\n\t\tif (bone.ascaleX < 0) rotationIK += 180;\n\t\tif (rotationIK > 180)\n\t\t\trotationIK -= 360;\n\t\telse if (rotationIK < -180)\n\t\t\trotationIK += 360;\n\t\tlet sx = bone.ascaleX, sy = bone.ascaleY;\n\t\tif (compress || stretch) {\n\t\t\tswitch (bone.inherit) {\n\t\t\t\tcase Inherit.NoScale:\n\t\t\t\tcase Inherit.NoScaleOrReflection:\n\t\t\t\t\ttx = targetX - bone.worldX;\n\t\t\t\t\tty = targetY - bone.worldY;\n\t\t\t}\n\t\t\tconst b = bone.data.length * sx;\n\t\t\tif (b > 0.0001) {\n\t\t\t\tconst dd = tx * tx + ty * ty;\n\t\t\t\tif ((compress && dd < b * b) || (stretch && dd > b * b)) {\n\t\t\t\t\tconst s = (Math.sqrt(dd) / b - 1) * alpha + 1;\n\t\t\t\t\tsx *= s;\n\t\t\t\t\tif (uniform) sy *= s;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tbone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, sx, sy, bone.ashearX,\n\t\t\tbone.ashearY);\n\t}\n\n\t/** Applies 2 bone IK. The target is specified in the world coordinate system.\n\t * @param child A direct descendant of the parent bone. */\n\tapply2 (parent: Bone, child: Bone, targetX: number, targetY: number, bendDir: number, stretch: boolean, uniform: boolean, softness: number, alpha: number) {\n\t\tif (parent.inherit != Inherit.Normal || child.inherit != Inherit.Normal) return;\n\t\tlet px = parent.ax, py = parent.ay, psx = parent.ascaleX, psy = parent.ascaleY, sx = psx, sy = psy, csx = child.ascaleX;\n\t\tlet os1 = 0, os2 = 0, s2 = 0;\n\t\tif (psx < 0) {\n\t\t\tpsx = -psx;\n\t\t\tos1 = 180;\n\t\t\ts2 = -1;\n\t\t} else {\n\t\t\tos1 = 0;\n\t\t\ts2 = 1;\n\t\t}\n\t\tif (psy < 0) {\n\t\t\tpsy = -psy;\n\t\t\ts2 = -s2;\n\t\t}\n\t\tif (csx < 0) {\n\t\t\tcsx = -csx;\n\t\t\tos2 = 180;\n\t\t} else\n\t\t\tos2 = 0;\n\t\tlet cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = parent.a, b = parent.b, c = parent.c, d = parent.d;\n\t\tlet u = Math.abs(psx - psy) <= 0.0001;\n\t\tif (!u || stretch) {\n\t\t\tcy = 0;\n\t\t\tcwx = a * cx + parent.worldX;\n\t\t\tcwy = c * cx + parent.worldY;\n\t\t} else {\n\t\t\tcy = child.ay;\n\t\t\tcwx = a * cx + b * cy + parent.worldX;\n\t\t\tcwy = c * cx + d * cy + parent.worldY;\n\t\t}\n\t\tlet pp = parent.parent;\n\t\tif (!pp) throw new Error(\"IK parent must itself have a parent.\");\n\t\ta = pp.a;\n\t\tb = pp.b;\n\t\tc = pp.c;\n\t\td = pp.d;\n\t\tlet id = a * d - b * c, x = cwx - pp.worldX, y = cwy - pp.worldY;\n\t\tid = Math.abs(id) <= 0.0001 ? 0 : 1 / id;\n\t\tlet dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;\n\t\tlet l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1, a2;\n\t\tif (l1 < 0.0001) {\n\t\t\tthis.apply1(parent, targetX, targetY, false, stretch, false, alpha);\n\t\t\tchild.updateWorldTransformWith(cx, cy, 0, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\n\t\t\treturn;\n\t\t}\n\t\tx = targetX - pp.worldX;\n\t\ty = targetY - pp.worldY;\n\t\tlet tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py;\n\t\tlet dd = tx * tx + ty * ty;\n\t\tif (softness != 0) {\n\t\t\tsoftness *= psx * (csx + 1) * 0.5;\n\t\t\tlet td = Math.sqrt(dd), sd = td - l1 - l2 * psx + softness;\n\t\t\tif (sd > 0) {\n\t\t\t\tlet p = Math.min(1, sd / (softness * 2)) - 1;\n\t\t\t\tp = (sd - softness * (1 - p * p)) / td;\n\t\t\t\ttx -= p * tx;\n\t\t\t\tty -= p * ty;\n\t\t\t\tdd = tx * tx + ty * ty;\n\t\t\t}\n\t\t}\n\t\touter:\n\t\tif (u) {\n\t\t\tl2 *= psx;\n\t\t\tlet cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2);\n\t\t\tif (cos < -1) {\n\t\t\t\tcos = -1;\n\t\t\t\ta2 = Math.PI * bendDir;\n\t\t\t} else if (cos > 1) {\n\t\t\t\tcos = 1;\n\t\t\t\ta2 = 0;\n\t\t\t\tif (stretch) {\n\t\t\t\t\ta = (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1;\n\t\t\t\t\tsx *= a;\n\t\t\t\t\tif (uniform) sy *= a;\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\ta2 = Math.acos(cos) * bendDir;\n\t\t\ta = l1 + l2 * cos;\n\t\t\tb = l2 * Math.sin(a2);\n\t\t\ta1 = Math.atan2(ty * a - tx * b, tx * a + ty * b);\n\t\t} else {\n\t\t\ta = psx * l2;\n\t\t\tb = psy * l2;\n\t\t\tlet aa = a * a, bb = b * b, ta = Math.atan2(ty, tx);\n\t\t\tc = bb * l1 * l1 + aa * dd - aa * bb;\n\t\t\tlet c1 = -2 * bb * l1, c2 = bb - aa;\n\t\t\td = c1 * c1 - 4 * c2 * c;\n\t\t\tif (d >= 0) {\n\t\t\t\tlet q = Math.sqrt(d);\n\t\t\t\tif (c1 < 0) q = -q;\n\t\t\t\tq = -(c1 + q) * 0.5;\n\t\t\t\tlet r0 = q / c2, r1 = c / q;\n\t\t\t\tlet r = Math.abs(r0) < Math.abs(r1) ? r0 : r1;\n\t\t\t\tr0 = dd - r * r;\n\t\t\t\tif (r0 >= 0) {\n\t\t\t\t\ty = Math.sqrt(r0) * bendDir;\n\t\t\t\t\ta1 = ta - Math.atan2(y, r);\n\t\t\t\t\ta2 = Math.atan2(y / psy, (r - l1) / psx);\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet minAngle = MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0;\n\t\t\tlet maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0;\n\t\t\tc = -a * l1 / (aa - bb);\n\t\t\tif (c >= -1 && c <= 1) {\n\t\t\t\tc = Math.acos(c);\n\t\t\t\tx = a * Math.cos(c) + l1;\n\t\t\t\ty = b * Math.sin(c);\n\t\t\t\td = x * x + y * y;\n\t\t\t\tif (d < minDist) {\n\t\t\t\t\tminAngle = c;\n\t\t\t\t\tminDist = d;\n\t\t\t\t\tminX = x;\n\t\t\t\t\tminY = y;\n\t\t\t\t}\n\t\t\t\tif (d > maxDist) {\n\t\t\t\t\tmaxAngle = c;\n\t\t\t\t\tmaxDist = d;\n\t\t\t\t\tmaxX = x;\n\t\t\t\t\tmaxY = y;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (dd <= (minDist + maxDist) * 0.5) {\n\t\t\t\ta1 = ta - Math.atan2(minY * bendDir, minX);\n\t\t\t\ta2 = minAngle * bendDir;\n\t\t\t} else {\n\t\t\t\ta1 = ta - Math.atan2(maxY * bendDir, maxX);\n\t\t\t\ta2 = maxAngle * bendDir;\n\t\t\t}\n\t\t}\n\t\tlet os = Math.atan2(cy, cx) * s2;\n\t\tlet rotation = parent.arotation;\n\t\ta1 = (a1 - os) * MathUtils.radDeg + os1 - rotation;\n\t\tif (a1 > 180)\n\t\t\ta1 -= 360;\n\t\telse if (a1 < -180) //\n\t\t\ta1 += 360;\n\t\tparent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, sy, 0, 0);\n\t\trotation = child.arotation;\n\t\ta2 = ((a2 + os) * MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation;\n\t\tif (a2 > 180)\n\t\t\ta2 -= 360;\n\t\telse if (a2 < -180) //\n\t\t\ta2 += 360;\n\t\tchild.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BoneData } from \"./BoneData.js\";\nimport { ConstraintData } from \"./ConstraintData.js\";\n\n\n/** Stores the setup pose for an {@link IkConstraint}.\n * <p>\n * See [IK constraints](http://esotericsoftware.com/spine-ik-constraints) in the Spine User Guide. */\nexport class IkConstraintData extends ConstraintData {\n\t/** The bones that are constrained by this IK constraint. */\n\tbones = new Array<BoneData>();\n\n\t/** The bone that is the IK target. */\n\tprivate _target: BoneData | null = null;\n\tpublic set target (boneData: BoneData) { this._target = boneData; }\n\tpublic get target () {\n\t\tif (!this._target) throw new Error(\"BoneData not set.\")\n\t\telse return this._target;\n\t}\n\n\t/** Controls the bend direction of the IK bones, either 1 or -1. */\n\tbendDirection = 0;\n\n\t/** When true and only a single bone is being constrained, if the target is too close, the bone is scaled to reach it. */\n\tcompress = false;\n\n\t/** When true, if the target is out of range, the parent bone is scaled to reach it. If more than one bone is being constrained\n\t * and the parent bone has local nonuniform scale, stretch is not applied. */\n\tstretch = false;\n\n\t/** When true, only a single bone is being constrained, and {@link #getCompress()} or {@link #getStretch()} is used, the bone\n\t * is scaled on both the X and Y axes. */\n\tuniform = false;\n\n\t/** A percentage (0-1) that controls the mix between the constrained and unconstrained rotations. */\n\tmix = 0;\n\n\t/** For two bone IK, the distance from the maximum reach of the bones that rotation will slow. */\n\tsoftness = 0;\n\n\tconstructor (name: string) {\n\t\tsuper(name, 0, false);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BoneData } from \"./BoneData.js\";\nimport { ConstraintData } from \"./ConstraintData.js\";\nimport { SlotData } from \"./SlotData.js\";\n\n\n/** Stores the setup pose for a {@link PathConstraint}.\n *\n * See [path constraints](http://esotericsoftware.com/spine-path-constraints) in the Spine User Guide. */\nexport class PathConstraintData extends ConstraintData {\n\n\t/** The bones that will be modified by this path constraint. */\n\tbones = new Array<BoneData>();\n\n\t/** The slot whose path attachment will be used to constrained the bones. */\n\tprivate _target: SlotData | null = null;\n\tpublic set target (slotData: SlotData) { this._target = slotData; }\n\tpublic get target () {\n\t\tif (!this._target) throw new Error(\"SlotData not set.\")\n\t\telse return this._target;\n\t}\n\n\t/** The mode for positioning the first bone on the path. */\n\tpositionMode: PositionMode = PositionMode.Fixed;\n\n\t/** The mode for positioning the bones after the first bone on the path. */\n\tspacingMode: SpacingMode = SpacingMode.Fixed;\n\n\t/** The mode for adjusting the rotation of the bones. */\n\trotateMode: RotateMode = RotateMode.Chain;\n\n\t/** An offset added to the constrained bone rotation. */\n\toffsetRotation: number = 0;\n\n\t/** The position along the path. */\n\tposition: number = 0;\n\n\t/** The spacing between bones. */\n\tspacing: number = 0;\n\n\tmixRotate = 0;\n\tmixX = 0;\n\tmixY = 0;\n\n\tconstructor (name: string) {\n\t\tsuper(name, 0, false);\n\t}\n}\n\n/** Controls how the first bone is positioned along the path.\n *\n * See [position](http://esotericsoftware.com/spine-path-constraints#Position) in the Spine User Guide. */\nexport enum PositionMode { Fixed, Percent }\n\n/** Controls how bones after the first bone are positioned along the path.\n *\n * See [spacing](http://esotericsoftware.com/spine-path-constraints#Spacing) in the Spine User Guide. */\nexport enum SpacingMode { Length, Fixed, Percent, Proportional }\n\n/** Controls how bones are rotated, translated, and scaled to match the path.\n *\n * See [rotate mix](http://esotericsoftware.com/spine-path-constraints#Rotate-mix) in the Spine User Guide. */\nexport enum RotateMode { Tangent, Chain, ChainScale }\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { PathAttachment } from \"./attachments/PathAttachment.js\";\nimport { Bone } from \"./Bone.js\";\nimport { PathConstraintData, RotateMode, SpacingMode, PositionMode } from \"./PathConstraintData.js\";\nimport { Physics, Skeleton } from \"./Skeleton.js\";\nimport { Slot } from \"./Slot.js\";\nimport { Updatable } from \"./Updatable.js\";\nimport { Utils, MathUtils } from \"./Utils.js\";\n\n\n/** Stores the current pose for a path constraint. A path constraint adjusts the rotation, translation, and scale of the\n * constrained bones so they follow a {@link PathAttachment}.\n *\n * See [Path constraints](http://esotericsoftware.com/spine-path-constraints) in the Spine User Guide. */\nexport class PathConstraint implements Updatable {\n\tstatic NONE = -1; static BEFORE = -2; static AFTER = -3;\n\tstatic epsilon = 0.00001;\n\n\t/** The path constraint's setup pose data. */\n\tdata: PathConstraintData;\n\n\t/** The bones that will be modified by this path constraint. */\n\tbones: Array<Bone>;\n\n\t/** The slot whose path attachment will be used to constrained the bones. */\n\ttarget: Slot;\n\n\t/** The position along the path. */\n\tposition = 0;\n\n\t/** The spacing between bones. */\n\tspacing = 0;\n\n\tmixRotate = 0;\n\n\tmixX = 0;\n\n\tmixY = 0;\n\n\tspaces = new Array<number>(); positions = new Array<number>();\n\tworld = new Array<number>(); curves = new Array<number>(); lengths = new Array<number>();\n\tsegments = new Array<number>();\n\n\tactive = false;\n\n\tconstructor (data: PathConstraintData, skeleton: Skeleton) {\n\t\tif (!data) throw new Error(\"data cannot be null.\");\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\t\tthis.data = data;\n\n\t\tthis.bones = new Array<Bone>();\n\t\tfor (let i = 0, n = data.bones.length; i < n; i++) {\n\t\t\tlet bone = skeleton.findBone(data.bones[i].name);\n\t\t\tif (!bone) throw new Error(`Couldn't find bone ${data.bones[i].name}.`);\n\t\t\tthis.bones.push(bone);\n\t\t}\n\t\tlet target = skeleton.findSlot(data.target.name);\n\t\tif (!target) throw new Error(`Couldn't find target bone ${data.target.name}`);\n\t\tthis.target = target;\n\n\t\tthis.position = data.position;\n\t\tthis.spacing = data.spacing;\n\t\tthis.mixRotate = data.mixRotate;\n\t\tthis.mixX = data.mixX;\n\t\tthis.mixY = data.mixY;\n\t}\n\n\tisActive () {\n\t\treturn this.active;\n\t}\n\n\tsetToSetupPose () {\n\t\tconst data = this.data;\n\t\tthis.position = data.position;\n\t\tthis.spacing = data.spacing;\n\t\tthis.mixRotate = data.mixRotate;\n\t\tthis.mixX = data.mixX;\n\t\tthis.mixY = data.mixY;\n\t}\n\n\tupdate (physics: Physics) {\n\t\tlet attachment = this.target.getAttachment();\n\t\tif (!(attachment instanceof PathAttachment)) return;\n\n\t\tlet mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY;\n\t\tif (mixRotate == 0 && mixX == 0 && mixY == 0) return;\n\n\t\tlet data = this.data;\n\t\tlet tangents = data.rotateMode == RotateMode.Tangent, scale = data.rotateMode == RotateMode.ChainScale;\n\n\t\tlet bones = this.bones;\n\t\tlet boneCount = bones.length, spacesCount = tangents ? boneCount : boneCount + 1;\n\t\tlet spaces = Utils.setArraySize(this.spaces, spacesCount), lengths: Array<number> = scale ? this.lengths = Utils.setArraySize(this.lengths, boneCount) : [];\n\t\tlet spacing = this.spacing;\n\n\t\tswitch (data.spacingMode) {\n\t\t\tcase SpacingMode.Percent:\n\t\t\t\tif (scale) {\n\t\t\t\t\tfor (let i = 0, n = spacesCount - 1; i < n; i++) {\n\t\t\t\t\t\tlet bone = bones[i];\n\t\t\t\t\t\tlet setupLength = bone.data.length;\n\t\t\t\t\t\tlet x = setupLength * bone.a, y = setupLength * bone.c;\n\t\t\t\t\t\tlengths[i] = Math.sqrt(x * x + y * y);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tUtils.arrayFill(spaces, 1, spacesCount, spacing);\n\t\t\t\tbreak;\n\t\t\tcase SpacingMode.Proportional:\n\t\t\t\tlet sum = 0;\n\t\t\t\tfor (let i = 0, n = spacesCount - 1; i < n;) {\n\t\t\t\t\tlet bone = bones[i];\n\t\t\t\t\tlet setupLength = bone.data.length;\n\t\t\t\t\tif (setupLength < PathConstraint.epsilon) {\n\t\t\t\t\t\tif (scale) lengths[i] = 0;\n\t\t\t\t\t\tspaces[++i] = spacing;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet x = setupLength * bone.a, y = setupLength * bone.c;\n\t\t\t\t\t\tlet length = Math.sqrt(x * x + y * y);\n\t\t\t\t\t\tif (scale) lengths[i] = length;\n\t\t\t\t\t\tspaces[++i] = length;\n\t\t\t\t\t\tsum += length;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (sum > 0) {\n\t\t\t\t\tsum = spacesCount / sum * spacing;\n\t\t\t\t\tfor (let i = 1; i < spacesCount; i++)\n\t\t\t\t\t\tspaces[i] *= sum;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tlet lengthSpacing = data.spacingMode == SpacingMode.Length;\n\t\t\t\tfor (let i = 0, n = spacesCount - 1; i < n;) {\n\t\t\t\t\tlet bone = bones[i];\n\t\t\t\t\tlet setupLength = bone.data.length;\n\t\t\t\t\tif (setupLength < PathConstraint.epsilon) {\n\t\t\t\t\t\tif (scale) lengths[i] = 0;\n\t\t\t\t\t\tspaces[++i] = spacing;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet x = setupLength * bone.a, y = setupLength * bone.c;\n\t\t\t\t\t\tlet length = Math.sqrt(x * x + y * y);\n\t\t\t\t\t\tif (scale) lengths[i] = length;\n\t\t\t\t\t\tspaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length / setupLength;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\n\t\tlet positions = this.computeWorldPositions(<PathAttachment>attachment, spacesCount, tangents);\n\t\tlet boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation;\n\t\tlet tip = false;\n\t\tif (offsetRotation == 0)\n\t\t\ttip = data.rotateMode == RotateMode.Chain;\n\t\telse {\n\t\t\ttip = false;\n\t\t\tlet p = this.target.bone;\n\t\t\toffsetRotation *= p.a * p.d - p.b * p.c > 0 ? MathUtils.degRad : -MathUtils.degRad;\n\t\t}\n\t\tfor (let i = 0, p = 3; i < boneCount; i++, p += 3) {\n\t\t\tlet bone = bones[i];\n\t\t\tbone.worldX += (boneX - bone.worldX) * mixX;\n\t\t\tbone.worldY += (boneY - bone.worldY) * mixY;\n\t\t\tlet x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY;\n\t\t\tif (scale) {\n\t\t\t\tlet length = lengths[i];\n\t\t\t\tif (length != 0) {\n\t\t\t\t\tlet s = (Math.sqrt(dx * dx + dy * dy) / length - 1) * mixRotate + 1;\n\t\t\t\t\tbone.a *= s;\n\t\t\t\t\tbone.c *= s;\n\t\t\t\t}\n\t\t\t}\n\t\t\tboneX = x;\n\t\t\tboneY = y;\n\t\t\tif (mixRotate > 0) {\n\t\t\t\tlet a = bone.a, b = bone.b, c = bone.c, d = bone.d, r = 0, cos = 0, sin = 0;\n\t\t\t\tif (tangents)\n\t\t\t\t\tr = positions[p - 1];\n\t\t\t\telse if (spaces[i + 1] == 0)\n\t\t\t\t\tr = positions[p + 2];\n\t\t\t\telse\n\t\t\t\t\tr = Math.atan2(dy, dx);\n\t\t\t\tr -= Math.atan2(c, a);\n\t\t\t\tif (tip) {\n\t\t\t\t\tcos = Math.cos(r);\n\t\t\t\t\tsin = Math.sin(r);\n\t\t\t\t\tlet length = bone.data.length;\n\t\t\t\t\tboneX += (length * (cos * a - sin * c) - dx) * mixRotate;\n\t\t\t\t\tboneY += (length * (sin * a + cos * c) - dy) * mixRotate;\n\t\t\t\t} else {\n\t\t\t\t\tr += offsetRotation;\n\t\t\t\t}\n\t\t\t\tif (r > MathUtils.PI)\n\t\t\t\t\tr -= MathUtils.PI2;\n\t\t\t\telse if (r < -MathUtils.PI) //\n\t\t\t\t\tr += MathUtils.PI2;\n\t\t\t\tr *= mixRotate;\n\t\t\t\tcos = Math.cos(r);\n\t\t\t\tsin = Math.sin(r);\n\t\t\t\tbone.a = cos * a - sin * c;\n\t\t\t\tbone.b = cos * b - sin * d;\n\t\t\t\tbone.c = sin * a + cos * c;\n\t\t\t\tbone.d = sin * b + cos * d;\n\t\t\t}\n\t\t\tbone.updateAppliedTransform();\n\t\t}\n\t}\n\n\tcomputeWorldPositions (path: PathAttachment, spacesCount: number, tangents: boolean) {\n\t\tlet target = this.target;\n\t\tlet position = this.position;\n\t\tlet spaces = this.spaces, out = Utils.setArraySize(this.positions, spacesCount * 3 + 2), world: Array<number> = this.world;\n\t\tlet closed = path.closed;\n\t\tlet verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE;\n\n\t\tif (!path.constantSpeed) {\n\t\t\tlet lengths = path.lengths;\n\t\t\tcurveCount -= closed ? 1 : 2;\n\t\t\tlet pathLength = lengths[curveCount];\n\t\t\tif (this.data.positionMode == PositionMode.Percent) position *= pathLength;\n\n\t\t\tlet multiplier;\n\t\t\tswitch (this.data.spacingMode) {\n\t\t\t\tcase SpacingMode.Percent:\n\t\t\t\t\tmultiplier = pathLength;\n\t\t\t\t\tbreak;\n\t\t\t\tcase SpacingMode.Proportional:\n\t\t\t\t\tmultiplier = pathLength / spacesCount;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tmultiplier = 1;\n\t\t\t}\n\t\t\tworld = Utils.setArraySize(this.world, 8);\n\t\t\tfor (let i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) {\n\t\t\t\tlet space = spaces[i] * multiplier;\n\t\t\t\tposition += space;\n\t\t\t\tlet p = position;\n\n\t\t\t\tif (closed) {\n\t\t\t\t\tp %= pathLength;\n\t\t\t\t\tif (p < 0) p += pathLength;\n\t\t\t\t\tcurve = 0;\n\t\t\t\t} else if (p < 0) {\n\t\t\t\t\tif (prevCurve != PathConstraint.BEFORE) {\n\t\t\t\t\t\tprevCurve = PathConstraint.BEFORE;\n\t\t\t\t\t\tpath.computeWorldVertices(target, 2, 4, world, 0, 2);\n\t\t\t\t\t}\n\t\t\t\t\tthis.addBeforePosition(p, world, 0, out, o);\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (p > pathLength) {\n\t\t\t\t\tif (prevCurve != PathConstraint.AFTER) {\n\t\t\t\t\t\tprevCurve = PathConstraint.AFTER;\n\t\t\t\t\t\tpath.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2);\n\t\t\t\t\t}\n\t\t\t\t\tthis.addAfterPosition(p - pathLength, world, 0, out, o);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Determine curve containing position.\n\t\t\t\tfor (; ; curve++) {\n\t\t\t\t\tlet length = lengths[curve];\n\t\t\t\t\tif (p > length) continue;\n\t\t\t\t\tif (curve == 0)\n\t\t\t\t\t\tp /= length;\n\t\t\t\t\telse {\n\t\t\t\t\t\tlet prev = lengths[curve - 1];\n\t\t\t\t\t\tp = (p - prev) / (length - prev);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (curve != prevCurve) {\n\t\t\t\t\tprevCurve = curve;\n\t\t\t\t\tif (closed && curve == curveCount) {\n\t\t\t\t\t\tpath.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2);\n\t\t\t\t\t\tpath.computeWorldVertices(target, 0, 4, world, 4, 2);\n\t\t\t\t\t} else\n\t\t\t\t\t\tpath.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2);\n\t\t\t\t}\n\t\t\t\tthis.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o,\n\t\t\t\t\ttangents || (i > 0 && space == 0));\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\n\t\t// World vertices.\n\t\tif (closed) {\n\t\t\tverticesLength += 2;\n\t\t\tworld = Utils.setArraySize(this.world, verticesLength);\n\t\t\tpath.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2);\n\t\t\tpath.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2);\n\t\t\tworld[verticesLength - 2] = world[0];\n\t\t\tworld[verticesLength - 1] = world[1];\n\t\t} else {\n\t\t\tcurveCount--;\n\t\t\tverticesLength -= 4;\n\t\t\tworld = Utils.setArraySize(this.world, verticesLength);\n\t\t\tpath.computeWorldVertices(target, 2, verticesLength, world, 0, 2);\n\t\t}\n\n\t\t// Curve lengths.\n\t\tlet curves = Utils.setArraySize(this.curves, curveCount);\n\t\tlet pathLength = 0;\n\t\tlet x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;\n\t\tlet tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0;\n\t\tfor (let i = 0, w = 2; i < curveCount; i++, w += 6) {\n\t\t\tcx1 = world[w];\n\t\t\tcy1 = world[w + 1];\n\t\t\tcx2 = world[w + 2];\n\t\t\tcy2 = world[w + 3];\n\t\t\tx2 = world[w + 4];\n\t\t\ty2 = world[w + 5];\n\t\t\ttmpx = (x1 - cx1 * 2 + cx2) * 0.1875;\n\t\t\ttmpy = (y1 - cy1 * 2 + cy2) * 0.1875;\n\t\t\tdddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375;\n\t\t\tdddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375;\n\t\t\tddfx = tmpx * 2 + dddfx;\n\t\t\tddfy = tmpy * 2 + dddfy;\n\t\t\tdfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667;\n\t\t\tdfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667;\n\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\tdfx += ddfx;\n\t\t\tdfy += ddfy;\n\t\t\tddfx += dddfx;\n\t\t\tddfy += dddfy;\n\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\tdfx += ddfx;\n\t\t\tdfy += ddfy;\n\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\tdfx += ddfx + dddfx;\n\t\t\tdfy += ddfy + dddfy;\n\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\tcurves[i] = pathLength;\n\t\t\tx1 = x2;\n\t\t\ty1 = y2;\n\t\t}\n\n\t\tif (this.data.positionMode == PositionMode.Percent) position *= pathLength;\n\n\t\tlet multiplier;\n\t\tswitch (this.data.spacingMode) {\n\t\t\tcase SpacingMode.Percent:\n\t\t\t\tmultiplier = pathLength;\n\t\t\t\tbreak;\n\t\t\tcase SpacingMode.Proportional:\n\t\t\t\tmultiplier = pathLength / spacesCount;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmultiplier = 1;\n\t\t}\n\n\t\tlet segments = this.segments;\n\t\tlet curveLength = 0;\n\t\tfor (let i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) {\n\t\t\tlet space = spaces[i] * multiplier;\n\t\t\tposition += space;\n\t\t\tlet p = position;\n\n\t\t\tif (closed) {\n\t\t\t\tp %= pathLength;\n\t\t\t\tif (p < 0) p += pathLength;\n\t\t\t\tcurve = 0;\n\t\t\t} else if (p < 0) {\n\t\t\t\tthis.addBeforePosition(p, world, 0, out, o);\n\t\t\t\tcontinue;\n\t\t\t} else if (p > pathLength) {\n\t\t\t\tthis.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Determine curve containing position.\n\t\t\tfor (; ; curve++) {\n\t\t\t\tlet length = curves[curve];\n\t\t\t\tif (p > length) continue;\n\t\t\t\tif (curve == 0)\n\t\t\t\t\tp /= length;\n\t\t\t\telse {\n\t\t\t\t\tlet prev = curves[curve - 1];\n\t\t\t\t\tp = (p - prev) / (length - prev);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Curve segment lengths.\n\t\t\tif (curve != prevCurve) {\n\t\t\t\tprevCurve = curve;\n\t\t\t\tlet ii = curve * 6;\n\t\t\t\tx1 = world[ii];\n\t\t\t\ty1 = world[ii + 1];\n\t\t\t\tcx1 = world[ii + 2];\n\t\t\t\tcy1 = world[ii + 3];\n\t\t\t\tcx2 = world[ii + 4];\n\t\t\t\tcy2 = world[ii + 5];\n\t\t\t\tx2 = world[ii + 6];\n\t\t\t\ty2 = world[ii + 7];\n\t\t\t\ttmpx = (x1 - cx1 * 2 + cx2) * 0.03;\n\t\t\t\ttmpy = (y1 - cy1 * 2 + cy2) * 0.03;\n\t\t\t\tdddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006;\n\t\t\t\tdddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006;\n\t\t\t\tddfx = tmpx * 2 + dddfx;\n\t\t\t\tddfy = tmpy * 2 + dddfy;\n\t\t\t\tdfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667;\n\t\t\t\tdfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667;\n\t\t\t\tcurveLength = Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\t\tsegments[0] = curveLength;\n\t\t\t\tfor (ii = 1; ii < 8; ii++) {\n\t\t\t\t\tdfx += ddfx;\n\t\t\t\t\tdfy += ddfy;\n\t\t\t\t\tddfx += dddfx;\n\t\t\t\t\tddfy += dddfy;\n\t\t\t\t\tcurveLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\t\t\tsegments[ii] = curveLength;\n\t\t\t\t}\n\t\t\t\tdfx += ddfx;\n\t\t\t\tdfy += ddfy;\n\t\t\t\tcurveLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\t\tsegments[8] = curveLength;\n\t\t\t\tdfx += ddfx + dddfx;\n\t\t\t\tdfy += ddfy + dddfy;\n\t\t\t\tcurveLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\t\tsegments[9] = curveLength;\n\t\t\t\tsegment = 0;\n\t\t\t}\n\n\t\t\t// Weight by segment length.\n\t\t\tp *= curveLength;\n\t\t\tfor (; ; segment++) {\n\t\t\t\tlet length = segments[segment];\n\t\t\t\tif (p > length) continue;\n\t\t\t\tif (segment == 0)\n\t\t\t\t\tp /= length;\n\t\t\t\telse {\n\t\t\t\t\tlet prev = segments[segment - 1];\n\t\t\t\t\tp = segment + (p - prev) / (length - prev);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0));\n\t\t}\n\t\treturn out;\n\t}\n\n\taddBeforePosition (p: number, temp: Array<number>, i: number, out: Array<number>, o: number) {\n\t\tlet x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx);\n\t\tout[o] = x1 + p * Math.cos(r);\n\t\tout[o + 1] = y1 + p * Math.sin(r);\n\t\tout[o + 2] = r;\n\t}\n\n\taddAfterPosition (p: number, temp: Array<number>, i: number, out: Array<number>, o: number) {\n\t\tlet x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx);\n\t\tout[o] = x1 + p * Math.cos(r);\n\t\tout[o + 1] = y1 + p * Math.sin(r);\n\t\tout[o + 2] = r;\n\t}\n\n\taddCurvePosition (p: number, x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number,\n\t\tout: Array<number>, o: number, tangents: boolean) {\n\t\tif (p == 0 || isNaN(p)) {\n\t\t\tout[o] = x1;\n\t\t\tout[o + 1] = y1;\n\t\t\tout[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);\n\t\t\treturn;\n\t\t}\n\t\tlet tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;\n\t\tlet ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;\n\t\tlet x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;\n\t\tout[o] = x;\n\t\tout[o + 1] = y;\n\t\tif (tangents) {\n\t\t\tif (p < 0.001)\n\t\t\t\tout[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);\n\t\t\telse\n\t\t\t\tout[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Bone } from \"./Bone.js\";\nimport { PhysicsConstraintData } from \"./PhysicsConstraintData.js\";\nimport { Physics, Skeleton } from \"./Skeleton.js\";\nimport { Updatable } from \"./Updatable.js\";\nimport { MathUtils } from \"./Utils.js\";\n\n\n/** Stores the current pose for a physics constraint. A physics constraint applies physics to bones.\n * <p>\n * See <a href=\"http://esotericsoftware.com/spine-physics-constraints\">Physics constraints</a> in the Spine User Guide. */\nexport class PhysicsConstraint implements Updatable {\n\treadonly data: PhysicsConstraintData;\n\tprivate _bone: Bone | null = null;\n\t/** The bone constrained by this physics constraint. */\n\tpublic set bone (bone: Bone) { this._bone = bone; }\n\tpublic get bone () {\n\t\tif (!this._bone) throw new Error(\"Bone not set.\")\n\t\telse return this._bone;\n\t}\n\tinertia = 0;\n\tstrength = 0;\n\tdamping = 0;\n\tmassInverse = 0;\n\twind = 0;\n\tgravity = 0;\n\tmix = 0;\n\n\t_reset = true;\n\tux = 0;\n\tuy = 0;\n\tcx = 0;\n\tcy = 0;\n\ttx = 0;\n\tty = 0;\n\txOffset = 0;\n\txVelocity = 0;\n\tyOffset = 0;\n\tyVelocity = 0;\n\trotateOffset = 0;\n\trotateVelocity = 0;\n\tscaleOffset = 0\n\tscaleVelocity = 0;\n\n\tactive = false;\n\n\treadonly skeleton: Skeleton;\n\tremaining = 0;\n\tlastTime = 0;\n\n\tconstructor (data: PhysicsConstraintData, skeleton: Skeleton) {\n\t\tthis.data = data;\n\t\tthis.skeleton = skeleton;\n\n\t\tthis.bone = skeleton.bones[data.bone.index];\n\n\t\tthis.inertia = data.inertia;\n\t\tthis.strength = data.strength;\n\t\tthis.damping = data.damping;\n\t\tthis.massInverse = data.massInverse;\n\t\tthis.wind = data.wind;\n\t\tthis.gravity = data.gravity;\n\t\tthis.mix = data.mix;\n\t}\n\n\treset () {\n\t\tthis.remaining = 0;\n\t\tthis.lastTime = this.skeleton.time;\n\t\tthis._reset = true;\n\t\tthis.xOffset = 0;\n\t\tthis.xVelocity = 0;\n\t\tthis.yOffset = 0;\n\t\tthis.yVelocity = 0;\n\t\tthis.rotateOffset = 0;\n\t\tthis.rotateVelocity = 0;\n\t\tthis.scaleOffset = 0;\n\t\tthis.scaleVelocity = 0;\n\t}\n\n\tsetToSetupPose () {\n\t\tconst data = this.data;\n\t\tthis.inertia = data.inertia;\n\t\tthis.strength = data.strength;\n\t\tthis.damping = data.damping;\n\t\tthis.massInverse = data.massInverse;\n\t\tthis.wind = data.wind;\n\t\tthis.gravity = data.gravity;\n\t\tthis.mix = data.mix;\n\t}\n\n\tisActive () {\n\t\treturn this.active;\n\t}\n\n\t/** Applies the constraint to the constrained bones. */\n\tupdate (physics: Physics) {\n\t\tconst mix = this.mix;\n\t\tif (mix == 0) return;\n\n\t\tconst x = this.data.x > 0, y = this.data.y > 0, rotateOrShearX = this.data.rotate > 0 || this.data.shearX > 0, scaleX = this.data.scaleX > 0;\n\t\tconst bone = this.bone;\n\t\tconst l = bone.data.length;\n\n\t\tswitch (physics) {\n\t\t\tcase Physics.none:\n\t\t\t\treturn;\n\t\t\tcase Physics.reset:\n\t\t\t\tthis.reset();\n\t\t\t// Fall through.\n\t\t\tcase Physics.update:\n\t\t\t\tconst skeleton = this.skeleton;\n\t\t\t\tconst delta = Math.max(this.skeleton.time - this.lastTime, 0);\n\t\t\t\tthis.remaining += delta;\n\t\t\t\tthis.lastTime = skeleton.time;\n\n\t\t\t\tconst bx = bone.worldX, by = bone.worldY;\n\t\t\t\tif (this._reset) {\n\t\t\t\t\tthis._reset = false;\n\t\t\t\t\tthis.ux = bx;\n\t\t\t\t\tthis.uy = by;\n\t\t\t\t} else {\n\t\t\t\t\tlet a = this.remaining, i = this.inertia, t = this.data.step, f = this.skeleton.data.referenceScale, d = -1;\n\t\t\t\t\tlet qx = this.data.limit * delta, qy = qx * Math.abs(skeleton.scaleY);\n\t\t\t\t\tqx *= Math.abs(skeleton.scaleX);\n\t\t\t\t\tif (x || y) {\n\t\t\t\t\t\tif (x) {\n\t\t\t\t\t\t\tconst u = (this.ux - bx) * i;\n\t\t\t\t\t\t\tthis.xOffset += u > qx ? qx : u < -qx ? -qx : u;\n\t\t\t\t\t\t\tthis.ux = bx;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (y) {\n\t\t\t\t\t\t\tconst u = (this.uy - by) * i;\n\t\t\t\t\t\t\tthis.yOffset += u > qy ? qy : u < -qy ? -qy : u;\n\t\t\t\t\t\t\tthis.uy = by;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (a >= t) {\n\t\t\t\t\t\t\td = Math.pow(this.damping, 60 * t);\n\t\t\t\t\t\t\tconst m = this.massInverse * t, e = this.strength, w = this.wind * f * skeleton.scaleX, g = this.gravity * f * skeleton.scaleY;\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\tif (x) {\n\t\t\t\t\t\t\t\t\tthis.xVelocity += (w - this.xOffset * e) * m;\n\t\t\t\t\t\t\t\t\tthis.xOffset += this.xVelocity * t;\n\t\t\t\t\t\t\t\t\tthis.xVelocity *= d;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (y) {\n\t\t\t\t\t\t\t\t\tthis.yVelocity -= (g + this.yOffset * e) * m;\n\t\t\t\t\t\t\t\t\tthis.yOffset += this.yVelocity * t;\n\t\t\t\t\t\t\t\t\tthis.yVelocity *= d;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ta -= t;\n\t\t\t\t\t\t\t} while (a >= t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (x) bone.worldX += this.xOffset * mix * this.data.x;\n\t\t\t\t\t\tif (y) bone.worldY += this.yOffset * mix * this.data.y;\n\t\t\t\t\t}\n\t\t\t\t\tif (rotateOrShearX || scaleX) {\n\t\t\t\t\t\tlet ca = Math.atan2(bone.c, bone.a), c = 0, s = 0, mr = 0;\n\t\t\t\t\t\tlet dx = this.cx - bone.worldX, dy = this.cy - bone.worldY;\n\t\t\t\t\t\tif (dx > qx)\n\t\t\t\t\t\t\tdx = qx;\n\t\t\t\t\t\telse if (dx < -qx) //\n\t\t\t\t\t\t\tdx = -qx;\n\t\t\t\t\t\tif (dy > qy)\n\t\t\t\t\t\t\tdy = qy;\n\t\t\t\t\t\telse if (dy < -qy) //\n\t\t\t\t\t\t\tdy = -qy;\n\t\t\t\t\t\tif (rotateOrShearX) {\n\t\t\t\t\t\t\tmr = (this.data.rotate + this.data.shearX) * mix;\n\t\t\t\t\t\t\tlet r = Math.atan2(dy + this.ty, dx + this.tx) - ca - this.rotateOffset * mr;\n\t\t\t\t\t\t\tthis.rotateOffset += (r - Math.ceil(r * MathUtils.invPI2 - 0.5) * MathUtils.PI2) * i;\n\t\t\t\t\t\t\tr = this.rotateOffset * mr + ca;\n\t\t\t\t\t\t\tc = Math.cos(r);\n\t\t\t\t\t\t\ts = Math.sin(r);\n\t\t\t\t\t\t\tif (scaleX) {\n\t\t\t\t\t\t\t\tr = l * bone.getWorldScaleX();\n\t\t\t\t\t\t\t\tif (r > 0) this.scaleOffset += (dx * c + dy * s) * i / r;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tc = Math.cos(ca);\n\t\t\t\t\t\t\ts = Math.sin(ca);\n\t\t\t\t\t\t\tconst r = l * bone.getWorldScaleX();\n\t\t\t\t\t\t\tif (r > 0) this.scaleOffset += (dx * c + dy * s) * i / r;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ta = this.remaining;\n\t\t\t\t\t\tif (a >= t) {\n\t\t\t\t\t\t\tif (d == -1) d = Math.pow(this.damping, 60 * t);\n\t\t\t\t\t\t\tconst m = this.massInverse * t, e = this.strength, w = this.wind, g = (Skeleton.yDown ? -this.gravity : this.gravity), h = l / f;\n\t\t\t\t\t\t\twhile (true) {\n\t\t\t\t\t\t\t\ta -= t;\n\t\t\t\t\t\t\t\tif (scaleX) {\n\t\t\t\t\t\t\t\t\tthis.scaleVelocity += (w * c - g * s - this.scaleOffset * e) * m;\n\t\t\t\t\t\t\t\t\tthis.scaleOffset += this.scaleVelocity * t;\n\t\t\t\t\t\t\t\t\tthis.scaleVelocity *= d;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (rotateOrShearX) {\n\t\t\t\t\t\t\t\t\tthis.rotateVelocity -= ((w * s + g * c) * h + this.rotateOffset * e) * m;\n\t\t\t\t\t\t\t\t\tthis.rotateOffset += this.rotateVelocity * t;\n\t\t\t\t\t\t\t\t\tthis.rotateVelocity *= d;\n\t\t\t\t\t\t\t\t\tif (a < t) break;\n\t\t\t\t\t\t\t\t\tconst r = this.rotateOffset * mr + ca;\n\t\t\t\t\t\t\t\t\tc = Math.cos(r);\n\t\t\t\t\t\t\t\t\ts = Math.sin(r);\n\t\t\t\t\t\t\t\t} else if (a < t) //\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.remaining = a;\n\t\t\t\t}\n\t\t\t\tthis.cx = bone.worldX;\n\t\t\t\tthis.cy = bone.worldY;\n\t\t\t\tbreak;\n\t\t\tcase Physics.pose:\n\t\t\t\tif (x) bone.worldX += this.xOffset * mix * this.data.x;\n\t\t\t\tif (y) bone.worldY += this.yOffset * mix * this.data.y;\n\t\t}\n\n\t\tif (rotateOrShearX) {\n\t\t\tlet o = this.rotateOffset * mix, s = 0, c = 0, a = 0;\n\t\t\tif (this.data.shearX > 0) {\n\t\t\t\tlet r = 0;\n\t\t\t\tif (this.data.rotate > 0) {\n\t\t\t\t\tr = o * this.data.rotate;\n\t\t\t\t\ts = Math.sin(r);\n\t\t\t\t\tc = Math.cos(r);\n\t\t\t\t\ta = bone.b;\n\t\t\t\t\tbone.b = c * a - s * bone.d;\n\t\t\t\t\tbone.d = s * a + c * bone.d;\n\t\t\t\t}\n\t\t\t\tr += o * this.data.shearX;\n\t\t\t\ts = Math.sin(r);\n\t\t\t\tc = Math.cos(r);\n\t\t\t\ta = bone.a;\n\t\t\t\tbone.a = c * a - s * bone.c;\n\t\t\t\tbone.c = s * a + c * bone.c;\n\t\t\t} else {\n\t\t\t\to *= this.data.rotate;\n\t\t\t\ts = Math.sin(o);\n\t\t\t\tc = Math.cos(o);\n\t\t\t\ta = bone.a;\n\t\t\t\tbone.a = c * a - s * bone.c;\n\t\t\t\tbone.c = s * a + c * bone.c;\n\t\t\t\ta = bone.b;\n\t\t\t\tbone.b = c * a - s * bone.d;\n\t\t\t\tbone.d = s * a + c * bone.d;\n\t\t\t}\n\t\t}\n\t\tif (scaleX) {\n\t\t\tconst s = 1 + this.scaleOffset * mix * this.data.scaleX;\n\t\t\tbone.a *= s;\n\t\t\tbone.c *= s;\n\t\t}\n\t\tif (physics != Physics.pose) {\n\t\t\tthis.tx = l * bone.a;\n\t\t\tthis.ty = l * bone.c;\n\t\t}\n\t\tbone.updateAppliedTransform();\n\t}\n\n\t/** Translates the physics constraint so next {@link #update(Physics)} forces are applied as if the bone moved an additional\n\t * amount in world space. */\n\ttranslate (x: number, y: number) {\n\t\tthis.ux -= x;\n\t\tthis.uy -= y;\n\t\tthis.cx -= x;\n\t\tthis.cy -= y;\n\t}\n\n\t/** Rotates the physics constraint so next {@link #update(Physics)} forces are applied as if the bone rotated around the\n\t * specified point in world space. */\n\trotate (x: number, y: number, degrees: number) {\n\t\tconst r = degrees * MathUtils.degRad, cos = Math.cos(r), sin = Math.sin(r);\n\t\tconst dx = this.cx - x, dy = this.cy - y;\n\t\tthis.translate(dx * cos - dy * sin - dx, dx * sin + dy * cos - dy);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Attachment, VertexAttachment } from \"./attachments/Attachment.js\";\nimport { Bone } from \"./Bone.js\";\nimport { Skeleton } from \"./Skeleton.js\";\nimport { SlotData } from \"./SlotData.js\";\nimport { Color } from \"./Utils.js\";\n\n/** Stores a slot's current pose. Slots organize attachments for {@link Skeleton#drawOrder} purposes and provide a place to store\n * state for an attachment. State cannot be stored in an attachment itself because attachments are stateless and may be shared\n * across multiple skeletons. */\nexport class Slot {\n\t/** The slot's setup pose data. */\n\tdata: SlotData;\n\n\t/** The bone this slot belongs to. */\n\tbone: Bone;\n\n\t/** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two\n\t * color tinting. */\n\tcolor: Color;\n\n\t/** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark\n\t * color's alpha is not used. */\n\tdarkColor: Color | null = null;\n\n\tattachment: Attachment | null = null;\n\n\tattachmentState: number = 0;\n\n\t/** The index of the texture region to display when the slot's attachment has a {@link Sequence}. -1 represents the\n\t * {@link Sequence#getSetupIndex()}. */\n\tsequenceIndex: number = -1;\n\n\t/** Values to deform the slot's attachment. For an unweighted mesh, the entries are local positions for each vertex. For a\n\t * weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions.\n\t *\n\t * See {@link VertexAttachment#computeWorldVertices()} and {@link DeformTimeline}. */\n\tdeform = new Array<number>();\n\n\tconstructor (data: SlotData, bone: Bone) {\n\t\tif (!data) throw new Error(\"data cannot be null.\");\n\t\tif (!bone) throw new Error(\"bone cannot be null.\");\n\t\tthis.data = data;\n\t\tthis.bone = bone;\n\t\tthis.color = new Color();\n\t\tthis.darkColor = !data.darkColor ? null : new Color();\n\t\tthis.setToSetupPose();\n\t}\n\n\t/** The skeleton this slot belongs to. */\n\tgetSkeleton (): Skeleton {\n\t\treturn this.bone.skeleton;\n\t}\n\n\t/** The current attachment for the slot, or null if the slot has no attachment. */\n\tgetAttachment (): Attachment | null {\n\t\treturn this.attachment;\n\t}\n\n\t/** Sets the slot's attachment and, if the attachment changed, resets {@link #sequenceIndex} and clears the {@link #deform}.\n\t * The deform is not cleared if the old attachment has the same {@link VertexAttachment#getTimelineAttachment()} as the\n\t * specified attachment. */\n\tsetAttachment (attachment: Attachment | null) {\n\t\tif (this.attachment == attachment) return;\n\t\tif (!(attachment instanceof VertexAttachment) || !(this.attachment instanceof VertexAttachment)\n\t\t\t|| (<VertexAttachment>attachment).timelineAttachment != (<VertexAttachment>this.attachment).timelineAttachment) {\n\t\t\tthis.deform.length = 0;\n\t\t}\n\t\tthis.attachment = attachment;\n\t\tthis.sequenceIndex = -1;\n\t}\n\n\t/** Sets this slot to the setup pose. */\n\tsetToSetupPose () {\n\t\tthis.color.setFromColor(this.data.color);\n\t\tif (this.darkColor) this.darkColor.setFromColor(this.data.darkColor!);\n\t\tif (!this.data.attachmentName)\n\t\t\tthis.attachment = null;\n\t\telse {\n\t\t\tthis.attachment = null;\n\t\t\tthis.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Bone } from \"./Bone.js\";\nimport { Physics, Skeleton } from \"./Skeleton.js\";\nimport { TransformConstraintData } from \"./TransformConstraintData.js\";\nimport { Updatable } from \"./Updatable.js\";\nimport { Vector2, MathUtils } from \"./Utils.js\";\n\n\n/** Stores the current pose for a transform constraint. A transform constraint adjusts the world transform of the constrained\n * bones to match that of the target bone.\n *\n * See [Transform constraints](http://esotericsoftware.com/spine-transform-constraints) in the Spine User Guide. */\nexport class TransformConstraint implements Updatable {\n\n\t/** The transform constraint's setup pose data. */\n\tdata: TransformConstraintData;\n\n\t/** The bones that will be modified by this transform constraint. */\n\tbones: Array<Bone>;\n\n\t/** The target bone whose world transform will be copied to the constrained bones. */\n\ttarget: Bone;\n\n\tmixRotate = 0; mixX = 0; mixY = 0; mixScaleX = 0; mixScaleY = 0; mixShearY = 0;\n\n\ttemp = new Vector2();\n\tactive = false;\n\n\tconstructor (data: TransformConstraintData, skeleton: Skeleton) {\n\t\tif (!data) throw new Error(\"data cannot be null.\");\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\t\tthis.data = data;\n\n\t\tthis.bones = new Array<Bone>();\n\t\tfor (let i = 0; i < data.bones.length; i++) {\n\t\t\tlet bone = skeleton.findBone(data.bones[i].name);\n\t\t\tif (!bone) throw new Error(`Couldn't find bone ${data.bones[i].name}.`);\n\t\t\tthis.bones.push(bone);\n\t\t}\n\t\tlet target = skeleton.findBone(data.target.name);\n\t\tif (!target) throw new Error(`Couldn't find target bone ${data.target.name}.`);\n\t\tthis.target = target;\n\n\t\tthis.mixRotate = data.mixRotate;\n\t\tthis.mixX = data.mixX;\n\t\tthis.mixY = data.mixY;\n\t\tthis.mixScaleX = data.mixScaleX;\n\t\tthis.mixScaleY = data.mixScaleY;\n\t\tthis.mixShearY = data.mixShearY;\n\t}\n\n\tisActive () {\n\t\treturn this.active;\n\t}\n\n\tsetToSetupPose () {\n\t\tconst data = this.data;\n\t\tthis.mixRotate = data.mixRotate;\n\t\tthis.mixX = data.mixX;\n\t\tthis.mixY = data.mixY;\n\t\tthis.mixScaleX = data.mixScaleX;\n\t\tthis.mixScaleY = data.mixScaleY;\n\t\tthis.mixShearY = data.mixShearY;\n\t}\n\n\tupdate (physics: Physics) {\n\t\tif (this.mixRotate == 0 && this.mixX == 0 && this.mixY == 0 && this.mixScaleX == 0 && this.mixScaleY == 0 && this.mixShearY == 0) return;\n\n\t\tif (this.data.local) {\n\t\t\tif (this.data.relative)\n\t\t\t\tthis.applyRelativeLocal();\n\t\t\telse\n\t\t\t\tthis.applyAbsoluteLocal();\n\t\t} else {\n\t\t\tif (this.data.relative)\n\t\t\t\tthis.applyRelativeWorld();\n\t\t\telse\n\t\t\t\tthis.applyAbsoluteWorld();\n\t\t}\n\t}\n\n\tapplyAbsoluteWorld () {\n\t\tlet mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX,\n\t\t\tmixScaleY = this.mixScaleY, mixShearY = this.mixShearY;\n\t\tlet translate = mixX != 0 || mixY != 0;\n\n\t\tlet target = this.target;\n\t\tlet ta = target.a, tb = target.b, tc = target.c, td = target.d;\n\t\tlet degRadReflect = ta * td - tb * tc > 0 ? MathUtils.degRad : -MathUtils.degRad;\n\t\tlet offsetRotation = this.data.offsetRotation * degRadReflect;\n\t\tlet offsetShearY = this.data.offsetShearY * degRadReflect;\n\n\t\tlet bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\n\t\t\tif (mixRotate != 0) {\n\t\t\t\tlet a = bone.a, b = bone.b, c = bone.c, d = bone.d;\n\t\t\t\tlet r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation;\n\t\t\t\tif (r > MathUtils.PI)\n\t\t\t\t\tr -= MathUtils.PI2;\n\t\t\t\telse if (r < -MathUtils.PI) //\n\t\t\t\t\tr += MathUtils.PI2;\n\t\t\t\tr *= mixRotate;\n\t\t\t\tlet cos = Math.cos(r), sin = Math.sin(r);\n\t\t\t\tbone.a = cos * a - sin * c;\n\t\t\t\tbone.b = cos * b - sin * d;\n\t\t\t\tbone.c = sin * a + cos * c;\n\t\t\t\tbone.d = sin * b + cos * d;\n\t\t\t}\n\n\t\t\tif (translate) {\n\t\t\t\tlet temp = this.temp;\n\t\t\t\ttarget.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\n\t\t\t\tbone.worldX += (temp.x - bone.worldX) * mixX;\n\t\t\t\tbone.worldY += (temp.y - bone.worldY) * mixY;\n\t\t\t}\n\n\t\t\tif (mixScaleX != 0) {\n\t\t\t\tlet s = Math.sqrt(bone.a * bone.a + bone.c * bone.c);\n\t\t\t\tif (s != 0) s = (s + (Math.sqrt(ta * ta + tc * tc) - s + this.data.offsetScaleX) * mixScaleX) / s;\n\t\t\t\tbone.a *= s;\n\t\t\t\tbone.c *= s;\n\t\t\t}\n\t\t\tif (mixScaleY != 0) {\n\t\t\t\tlet s = Math.sqrt(bone.b * bone.b + bone.d * bone.d);\n\t\t\t\tif (s != 0) s = (s + (Math.sqrt(tb * tb + td * td) - s + this.data.offsetScaleY) * mixScaleY) / s;\n\t\t\t\tbone.b *= s;\n\t\t\t\tbone.d *= s;\n\t\t\t}\n\n\t\t\tif (mixShearY > 0) {\n\t\t\t\tlet b = bone.b, d = bone.d;\n\t\t\t\tlet by = Math.atan2(d, b);\n\t\t\t\tlet r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(bone.c, bone.a));\n\t\t\t\tif (r > MathUtils.PI)\n\t\t\t\t\tr -= MathUtils.PI2;\n\t\t\t\telse if (r < -MathUtils.PI) //\n\t\t\t\t\tr += MathUtils.PI2;\n\t\t\t\tr = by + (r + offsetShearY) * mixShearY;\n\t\t\t\tlet s = Math.sqrt(b * b + d * d);\n\t\t\t\tbone.b = Math.cos(r) * s;\n\t\t\t\tbone.d = Math.sin(r) * s;\n\t\t\t}\n\n\t\t\tbone.updateAppliedTransform();\n\t\t}\n\t}\n\n\tapplyRelativeWorld () {\n\t\tlet mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX,\n\t\t\tmixScaleY = this.mixScaleY, mixShearY = this.mixShearY;\n\t\tlet translate = mixX != 0 || mixY != 0;\n\n\t\tlet target = this.target;\n\t\tlet ta = target.a, tb = target.b, tc = target.c, td = target.d;\n\t\tlet degRadReflect = ta * td - tb * tc > 0 ? MathUtils.degRad : -MathUtils.degRad;\n\t\tlet offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect;\n\n\t\tlet bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\n\t\t\tif (mixRotate != 0) {\n\t\t\t\tlet a = bone.a, b = bone.b, c = bone.c, d = bone.d;\n\t\t\t\tlet r = Math.atan2(tc, ta) + offsetRotation;\n\t\t\t\tif (r > MathUtils.PI)\n\t\t\t\t\tr -= MathUtils.PI2;\n\t\t\t\telse if (r < -MathUtils.PI) //\n\t\t\t\t\tr += MathUtils.PI2;\n\t\t\t\tr *= mixRotate;\n\t\t\t\tlet cos = Math.cos(r), sin = Math.sin(r);\n\t\t\t\tbone.a = cos * a - sin * c;\n\t\t\t\tbone.b = cos * b - sin * d;\n\t\t\t\tbone.c = sin * a + cos * c;\n\t\t\t\tbone.d = sin * b + cos * d;\n\t\t\t}\n\n\t\t\tif (translate) {\n\t\t\t\tlet temp = this.temp;\n\t\t\t\ttarget.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\n\t\t\t\tbone.worldX += temp.x * mixX;\n\t\t\t\tbone.worldY += temp.y * mixY;\n\t\t\t}\n\n\t\t\tif (mixScaleX != 0) {\n\t\t\t\tlet s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * mixScaleX + 1;\n\t\t\t\tbone.a *= s;\n\t\t\t\tbone.c *= s;\n\t\t\t}\n\t\t\tif (mixScaleY != 0) {\n\t\t\t\tlet s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * mixScaleY + 1;\n\t\t\t\tbone.b *= s;\n\t\t\t\tbone.d *= s;\n\t\t\t}\n\n\t\t\tif (mixShearY > 0) {\n\t\t\t\tlet r = Math.atan2(td, tb) - Math.atan2(tc, ta);\n\t\t\t\tif (r > MathUtils.PI)\n\t\t\t\t\tr -= MathUtils.PI2;\n\t\t\t\telse if (r < -MathUtils.PI) //\n\t\t\t\t\tr += MathUtils.PI2;\n\t\t\t\tlet b = bone.b, d = bone.d;\n\t\t\t\tr = Math.atan2(d, b) + (r - MathUtils.PI / 2 + offsetShearY) * mixShearY;\n\t\t\t\tlet s = Math.sqrt(b * b + d * d);\n\t\t\t\tbone.b = Math.cos(r) * s;\n\t\t\t\tbone.d = Math.sin(r) * s;\n\t\t\t}\n\n\t\t\tbone.updateAppliedTransform();\n\t\t}\n\t}\n\n\tapplyAbsoluteLocal () {\n\t\tlet mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX,\n\t\t\tmixScaleY = this.mixScaleY, mixShearY = this.mixShearY;\n\n\t\tlet target = this.target;\n\n\t\tlet bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\n\t\t\tlet rotation = bone.arotation;\n\t\t\tif (mixRotate != 0) rotation += (target.arotation - rotation + this.data.offsetRotation) * mixRotate;\n\n\t\t\tlet x = bone.ax, y = bone.ay;\n\t\t\tx += (target.ax - x + this.data.offsetX) * mixX;\n\t\t\ty += (target.ay - y + this.data.offsetY) * mixY;\n\n\t\t\tlet scaleX = bone.ascaleX, scaleY = bone.ascaleY;\n\t\t\tif (mixScaleX != 0 && scaleX != 0)\n\t\t\t\tscaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * mixScaleX) / scaleX;\n\t\t\tif (mixScaleY != 0 && scaleY != 0)\n\t\t\t\tscaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * mixScaleY) / scaleY;\n\n\t\t\tlet shearY = bone.ashearY;\n\t\t\tif (mixShearY != 0) shearY += (target.ashearY - shearY + this.data.offsetShearY) * mixShearY;\n\n\t\t\tbone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\n\t\t}\n\t}\n\n\tapplyRelativeLocal () {\n\t\tlet mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX,\n\t\t\tmixScaleY = this.mixScaleY, mixShearY = this.mixShearY;\n\n\t\tlet target = this.target;\n\n\t\tlet bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\n\t\t\tlet rotation = bone.arotation + (target.arotation + this.data.offsetRotation) * mixRotate;\n\t\t\tlet x = bone.ax + (target.ax + this.data.offsetX) * mixX;\n\t\t\tlet y = bone.ay + (target.ay + this.data.offsetY) * mixY;\n\t\t\tlet scaleX = bone.ascaleX * (((target.ascaleX - 1 + this.data.offsetScaleX) * mixScaleX) + 1);\n\t\t\tlet scaleY = bone.ascaleY * (((target.ascaleY - 1 + this.data.offsetScaleY) * mixScaleY) + 1);\n\t\t\tlet shearY = bone.ashearY + (target.ashearY + this.data.offsetShearY) * mixShearY;\n\n\t\t\tbone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Attachment } from \"./attachments/Attachment.js\";\nimport { ClippingAttachment } from \"./attachments/ClippingAttachment.js\";\nimport { MeshAttachment } from \"./attachments/MeshAttachment.js\";\nimport { PathAttachment } from \"./attachments/PathAttachment.js\";\nimport { RegionAttachment } from \"./attachments/RegionAttachment.js\";\nimport { Bone } from \"./Bone.js\";\nimport { IkConstraint } from \"./IkConstraint.js\";\nimport { PathConstraint } from \"./PathConstraint.js\";\nimport { PhysicsConstraint } from \"./PhysicsConstraint.js\";\nimport { SkeletonClipping } from \"./SkeletonClipping.js\";\nimport { SkeletonData } from \"./SkeletonData.js\";\nimport { Skin } from \"./Skin.js\";\nimport { Slot } from \"./Slot.js\";\nimport { TransformConstraint } from \"./TransformConstraint.js\";\nimport { Updatable } from \"./Updatable.js\";\nimport { Color, Utils, MathUtils, Vector2, NumberArrayLike } from \"./Utils.js\";\n\n/** Stores the current pose for a skeleton.\n *\n * See [Instance objects](http://esotericsoftware.com/spine-runtime-architecture#Instance-objects) in the Spine Runtimes Guide. */\nexport class Skeleton {\n\tprivate static quadTriangles = [0, 1, 2, 2, 3, 0];\n\tstatic yDown = false;\n\n\t/** The skeleton's setup pose data. */\n\tdata: SkeletonData;\n\n\t/** The skeleton's bones, sorted parent first. The root bone is always the first bone. */\n\tbones: Array<Bone>;\n\n\t/** The skeleton's slots in the setup pose draw order. */\n\tslots: Array<Slot>;\n\n\t/** The skeleton's slots in the order they should be drawn. The returned array may be modified to change the draw order. */\n\tdrawOrder: Array<Slot>;\n\n\t/** The skeleton's IK constraints. */\n\tikConstraints: Array<IkConstraint>;\n\n\t/** The skeleton's transform constraints. */\n\ttransformConstraints: Array<TransformConstraint>;\n\n\t/** The skeleton's path constraints. */\n\tpathConstraints: Array<PathConstraint>;\n\n\n\t/** The skeleton's physics constraints. */\n\tphysicsConstraints: Array<PhysicsConstraint>;\n\n\t/** The list of bones and constraints, sorted in the order they should be updated, as computed by {@link #updateCache()}. */\n\t_updateCache = new Array<Updatable>();\n\n\t/** The skeleton's current skin. May be null. */\n\tskin: Skin | null = null;\n\n\t/** The color to tint all the skeleton's attachments. */\n\tcolor: Color;\n\n\t/** Scales the entire skeleton on the X axis. This affects all bones, even if the bone's transform mode disallows scale\n\t * inheritance. */\n\tscaleX = 1;\n\n\t/** Scales the entire skeleton on the Y axis. This affects all bones, even if the bone's transform mode disallows scale\n\t * inheritance. */\n\tprivate _scaleY = 1;\n\n\tpublic get scaleY () {\n\t\treturn Skeleton.yDown ? -this._scaleY : this._scaleY;\n\t}\n\n\tpublic set scaleY (scaleY: number) {\n\t\tthis._scaleY = scaleY;\n\t}\n\n\t/** Sets the skeleton X position, which is added to the root bone worldX position. */\n\tx = 0;\n\n\t/** Sets the skeleton Y position, which is added to the root bone worldY position. */\n\ty = 0;\n\n\t/** Returns the skeleton's time. This is used for time-based manipulations, such as {@link PhysicsConstraint}.\n\t * <p>\n\t * See {@link #update(float)}. */\n\ttime = 0;\n\n\tconstructor (data: SkeletonData) {\n\t\tif (!data) throw new Error(\"data cannot be null.\");\n\t\tthis.data = data;\n\n\t\tthis.bones = new Array<Bone>();\n\t\tfor (let i = 0; i < data.bones.length; i++) {\n\t\t\tlet boneData = data.bones[i];\n\t\t\tlet bone: Bone;\n\t\t\tif (!boneData.parent)\n\t\t\t\tbone = new Bone(boneData, this, null);\n\t\t\telse {\n\t\t\t\tlet parent = this.bones[boneData.parent.index];\n\t\t\t\tbone = new Bone(boneData, this, parent);\n\t\t\t\tparent.children.push(bone);\n\t\t\t}\n\t\t\tthis.bones.push(bone);\n\t\t}\n\n\t\tthis.slots = new Array<Slot>();\n\t\tthis.drawOrder = new Array<Slot>();\n\t\tfor (let i = 0; i < data.slots.length; i++) {\n\t\t\tlet slotData = data.slots[i];\n\t\t\tlet bone = this.bones[slotData.boneData.index];\n\t\t\tlet slot = new Slot(slotData, bone);\n\t\t\tthis.slots.push(slot);\n\t\t\tthis.drawOrder.push(slot);\n\t\t}\n\n\t\tthis.ikConstraints = new Array<IkConstraint>();\n\t\tfor (let i = 0; i < data.ikConstraints.length; i++) {\n\t\t\tlet ikConstraintData = data.ikConstraints[i];\n\t\t\tthis.ikConstraints.push(new IkConstraint(ikConstraintData, this));\n\t\t}\n\n\t\tthis.transformConstraints = new Array<TransformConstraint>();\n\t\tfor (let i = 0; i < data.transformConstraints.length; i++) {\n\t\t\tlet transformConstraintData = data.transformConstraints[i];\n\t\t\tthis.transformConstraints.push(new TransformConstraint(transformConstraintData, this));\n\t\t}\n\n\t\tthis.pathConstraints = new Array<PathConstraint>();\n\t\tfor (let i = 0; i < data.pathConstraints.length; i++) {\n\t\t\tlet pathConstraintData = data.pathConstraints[i];\n\t\t\tthis.pathConstraints.push(new PathConstraint(pathConstraintData, this));\n\t\t}\n\n\t\tthis.physicsConstraints = new Array<PhysicsConstraint>();\n\t\tfor (let i = 0; i < data.physicsConstraints.length; i++) {\n\t\t\tlet physicsConstraintData = data.physicsConstraints[i];\n\t\t\tthis.physicsConstraints.push(new PhysicsConstraint(physicsConstraintData, this));\n\t\t}\n\n\t\tthis.color = new Color(1, 1, 1, 1);\n\t\tthis.updateCache();\n\t}\n\n\t/** Caches information about bones and constraints. Must be called if the {@link #getSkin()} is modified or if bones,\n\t * constraints, or weighted path attachments are added or removed. */\n\tupdateCache () {\n\t\tlet updateCache = this._updateCache;\n\t\tupdateCache.length = 0;\n\n\t\tlet bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\t\t\tbone.sorted = bone.data.skinRequired;\n\t\t\tbone.active = !bone.sorted;\n\t\t}\n\n\t\tif (this.skin) {\n\t\t\tlet skinBones = this.skin.bones;\n\t\t\tfor (let i = 0, n = this.skin.bones.length; i < n; i++) {\n\t\t\t\tlet bone: Bone | null = this.bones[skinBones[i].index];\n\t\t\t\tdo {\n\t\t\t\t\tbone.sorted = false;\n\t\t\t\t\tbone.active = true;\n\t\t\t\t\tbone = bone.parent;\n\t\t\t\t} while (bone);\n\t\t\t}\n\t\t}\n\n\t\t// IK first, lowest hierarchy depth first.\n\t\tlet ikConstraints = this.ikConstraints;\n\t\tlet transformConstraints = this.transformConstraints;\n\t\tlet pathConstraints = this.pathConstraints;\n\t\tlet physicsConstraints = this.physicsConstraints;\n\t\tlet ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length, physicsCount = this.physicsConstraints.length;\n\t\tlet constraintCount = ikCount + transformCount + pathCount + physicsCount;\n\n\t\touter:\n\t\tfor (let i = 0; i < constraintCount; i++) {\n\t\t\tfor (let ii = 0; ii < ikCount; ii++) {\n\t\t\t\tlet constraint = ikConstraints[ii];\n\t\t\t\tif (constraint.data.order == i) {\n\t\t\t\t\tthis.sortIkConstraint(constraint);\n\t\t\t\t\tcontinue outer;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (let ii = 0; ii < transformCount; ii++) {\n\t\t\t\tlet constraint = transformConstraints[ii];\n\t\t\t\tif (constraint.data.order == i) {\n\t\t\t\t\tthis.sortTransformConstraint(constraint);\n\t\t\t\t\tcontinue outer;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (let ii = 0; ii < pathCount; ii++) {\n\t\t\t\tlet constraint = pathConstraints[ii];\n\t\t\t\tif (constraint.data.order == i) {\n\t\t\t\t\tthis.sortPathConstraint(constraint);\n\t\t\t\t\tcontinue outer;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (let ii = 0; ii < physicsCount; ii++) {\n\t\t\t\tconst constraint = physicsConstraints[ii];\n\t\t\t\tif (constraint.data.order == i) {\n\t\t\t\t\tthis.sortPhysicsConstraint(constraint);\n\t\t\t\t\tcontinue outer;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0, n = bones.length; i < n; i++)\n\t\t\tthis.sortBone(bones[i]);\n\t}\n\n\tsortIkConstraint (constraint: IkConstraint) {\n\t\tconstraint.active = constraint.target.isActive() && (!constraint.data.skinRequired || (this.skin && Utils.contains(this.skin.constraints, constraint.data, true)))!;\n\t\tif (!constraint.active) return;\n\n\t\tlet target = constraint.target;\n\t\tthis.sortBone(target);\n\n\t\tlet constrained = constraint.bones;\n\t\tlet parent = constrained[0];\n\t\tthis.sortBone(parent);\n\n\t\tif (constrained.length == 1) {\n\t\t\tthis._updateCache.push(constraint);\n\t\t\tthis.sortReset(parent.children);\n\t\t} else {\n\t\t\tlet child = constrained[constrained.length - 1];\n\t\t\tthis.sortBone(child);\n\n\t\t\tthis._updateCache.push(constraint);\n\n\t\t\tthis.sortReset(parent.children);\n\t\t\tchild.sorted = true;\n\t\t}\n\t}\n\n\tsortPathConstraint (constraint: PathConstraint) {\n\t\tconstraint.active = constraint.target.bone.isActive() && (!constraint.data.skinRequired || (this.skin && Utils.contains(this.skin.constraints, constraint.data, true)))!;\n\t\tif (!constraint.active) return;\n\n\t\tlet slot = constraint.target;\n\t\tlet slotIndex = slot.data.index;\n\t\tlet slotBone = slot.bone;\n\t\tif (this.skin) this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone);\n\t\tif (this.data.defaultSkin && this.data.defaultSkin != this.skin)\n\t\t\tthis.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone);\n\t\tfor (let i = 0, n = this.data.skins.length; i < n; i++)\n\t\t\tthis.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone);\n\n\t\tlet attachment = slot.getAttachment();\n\t\tif (attachment instanceof PathAttachment) this.sortPathConstraintAttachmentWith(attachment, slotBone);\n\n\t\tlet constrained = constraint.bones;\n\t\tlet boneCount = constrained.length;\n\t\tfor (let i = 0; i < boneCount; i++)\n\t\t\tthis.sortBone(constrained[i]);\n\n\t\tthis._updateCache.push(constraint);\n\n\t\tfor (let i = 0; i < boneCount; i++)\n\t\t\tthis.sortReset(constrained[i].children);\n\t\tfor (let i = 0; i < boneCount; i++)\n\t\t\tconstrained[i].sorted = true;\n\t}\n\n\tsortTransformConstraint (constraint: TransformConstraint) {\n\t\tconstraint.active = constraint.target.isActive() && (!constraint.data.skinRequired || (this.skin && Utils.contains(this.skin.constraints, constraint.data, true)))!;\n\t\tif (!constraint.active) return;\n\n\t\tthis.sortBone(constraint.target);\n\n\t\tlet constrained = constraint.bones;\n\t\tlet boneCount = constrained.length;\n\t\tif (constraint.data.local) {\n\t\t\tfor (let i = 0; i < boneCount; i++) {\n\t\t\t\tlet child = constrained[i];\n\t\t\t\tthis.sortBone(child.parent!);\n\t\t\t\tthis.sortBone(child);\n\t\t\t}\n\t\t} else {\n\t\t\tfor (let i = 0; i < boneCount; i++) {\n\t\t\t\tthis.sortBone(constrained[i]);\n\t\t\t}\n\t\t}\n\n\t\tthis._updateCache.push(constraint);\n\n\t\tfor (let i = 0; i < boneCount; i++)\n\t\t\tthis.sortReset(constrained[i].children);\n\t\tfor (let i = 0; i < boneCount; i++)\n\t\t\tconstrained[i].sorted = true;\n\t}\n\n\tsortPathConstraintAttachment (skin: Skin, slotIndex: number, slotBone: Bone) {\n\t\tlet attachments = skin.attachments[slotIndex];\n\t\tif (!attachments) return;\n\t\tfor (let key in attachments) {\n\t\t\tthis.sortPathConstraintAttachmentWith(attachments[key], slotBone);\n\t\t}\n\t}\n\n\tsortPathConstraintAttachmentWith (attachment: Attachment, slotBone: Bone) {\n\t\tif (!(attachment instanceof PathAttachment)) return;\n\t\tlet pathBones = (<PathAttachment>attachment).bones;\n\t\tif (!pathBones)\n\t\t\tthis.sortBone(slotBone);\n\t\telse {\n\t\t\tlet bones = this.bones;\n\t\t\tfor (let i = 0, n = pathBones.length; i < n;) {\n\t\t\t\tlet nn = pathBones[i++];\n\t\t\t\tnn += i;\n\t\t\t\twhile (i < nn)\n\t\t\t\t\tthis.sortBone(bones[pathBones[i++]]);\n\t\t\t}\n\t\t}\n\t}\n\n\tsortPhysicsConstraint (constraint: PhysicsConstraint) {\n\t\tconst bone = constraint.bone;\n\t\tconstraint.active = bone.active && (!constraint.data.skinRequired || (this.skin != null && Utils.contains(this.skin.constraints, constraint.data, true)));\n\t\tif (!constraint.active) return;\n\n\t\tthis.sortBone(bone);\n\n\t\tthis._updateCache.push(constraint);\n\n\t\tthis.sortReset(bone.children);\n\t\tbone.sorted = true;\n\t}\n\n\tsortBone (bone: Bone) {\n\t\tif (!bone) return;\n\t\tif (bone.sorted) return;\n\t\tlet parent = bone.parent;\n\t\tif (parent) this.sortBone(parent);\n\t\tbone.sorted = true;\n\t\tthis._updateCache.push(bone);\n\t}\n\n\tsortReset (bones: Array<Bone>) {\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\t\t\tif (!bone.active) continue;\n\t\t\tif (bone.sorted) this.sortReset(bone.children);\n\t\t\tbone.sorted = false;\n\t\t}\n\t}\n\n\t/** Updates the world transform for each bone and applies all constraints.\n\t *\n\t * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine\n\t * Runtimes Guide. */\n\tupdateWorldTransform (physics: Physics) {\n\t\tif (physics === undefined || physics === null) throw new Error(\"physics is undefined\");\n\t\tlet bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\t\t\tbone.ax = bone.x;\n\t\t\tbone.ay = bone.y;\n\t\t\tbone.arotation = bone.rotation;\n\t\t\tbone.ascaleX = bone.scaleX;\n\t\t\tbone.ascaleY = bone.scaleY;\n\t\t\tbone.ashearX = bone.shearX;\n\t\t\tbone.ashearY = bone.shearY;\n\t\t}\n\n\t\tlet updateCache = this._updateCache;\n\t\tfor (let i = 0, n = updateCache.length; i < n; i++)\n\t\t\tupdateCache[i].update(physics);\n\t}\n\n\tupdateWorldTransformWith (physics: Physics, parent: Bone) {\n\t\tif (!parent) throw new Error(\"parent cannot be null.\");\n\n\t\tlet bones = this.bones;\n\t\tfor (let i = 1, n = bones.length; i < n; i++) { // Skip root bone.\n\t\t\tlet bone = bones[i];\n\t\t\tbone.ax = bone.x;\n\t\t\tbone.ay = bone.y;\n\t\t\tbone.arotation = bone.rotation;\n\t\t\tbone.ascaleX = bone.scaleX;\n\t\t\tbone.ascaleY = bone.scaleY;\n\t\t\tbone.ashearX = bone.shearX;\n\t\t\tbone.ashearY = bone.shearY;\n\t\t}\n\n\t\t// Apply the parent bone transform to the root bone. The root bone always inherits scale, rotation and reflection.\n\t\tlet rootBone = this.getRootBone();\n\t\tif (!rootBone) throw new Error(\"Root bone must not be null.\");\n\t\tlet pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;\n\t\trootBone.worldX = pa * this.x + pb * this.y + parent.worldX;\n\t\trootBone.worldY = pc * this.x + pd * this.y + parent.worldY;\n\n\t\tconst rx = (rootBone.rotation + rootBone.shearX) * MathUtils.degRad;\n\t\tconst ry = (rootBone.rotation + 90 + rootBone.shearY) * MathUtils.degRad;\n\t\tconst la = Math.cos(rx) * rootBone.scaleX;\n\t\tconst lb = Math.cos(ry) * rootBone.scaleY;\n\t\tconst lc = Math.sin(rx) * rootBone.scaleX;\n\t\tconst ld = Math.sin(ry) * rootBone.scaleY;\n\t\trootBone.a = (pa * la + pb * lc) * this.scaleX;\n\t\trootBone.b = (pa * lb + pb * ld) * this.scaleX;\n\t\trootBone.c = (pc * la + pd * lc) * this.scaleY;\n\t\trootBone.d = (pc * lb + pd * ld) * this.scaleY;\n\n\t\t// Update everything except root bone.\n\t\tlet updateCache = this._updateCache;\n\t\tfor (let i = 0, n = updateCache.length; i < n; i++) {\n\t\t\tlet updatable = updateCache[i];\n\t\t\tif (updatable != rootBone) updatable.update(physics);\n\t\t}\n\t}\n\n\t/** Sets the bones, constraints, and slots to their setup pose values. */\n\tsetToSetupPose () {\n\t\tthis.setBonesToSetupPose();\n\t\tthis.setSlotsToSetupPose();\n\t}\n\n\t/** Sets the bones and constraints to their setup pose values. */\n\tsetBonesToSetupPose () {\n\t\tfor (const bone of this.bones) bone.setToSetupPose();\n\t\tfor (const constraint of this.ikConstraints) constraint.setToSetupPose();\n\t\tfor (const constraint of this.transformConstraints) constraint.setToSetupPose();\n\t\tfor (const constraint of this.pathConstraints) constraint.setToSetupPose();\n\t\tfor (const constraint of this.physicsConstraints) constraint.setToSetupPose();\n\t}\n\n\t/** Sets the slots and draw order to their setup pose values. */\n\tsetSlotsToSetupPose () {\n\t\tlet slots = this.slots;\n\t\tUtils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length);\n\t\tfor (let i = 0, n = slots.length; i < n; i++)\n\t\t\tslots[i].setToSetupPose();\n\t}\n\n\t/** @returns May return null. */\n\tgetRootBone () {\n\t\tif (this.bones.length == 0) return null;\n\t\treturn this.bones[0];\n\t}\n\n\t/** @returns May be null. */\n\tfindBone (boneName: string) {\n\t\tif (!boneName) throw new Error(\"boneName cannot be null.\");\n\t\tlet bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\t\t\tif (bone.data.name == boneName) return bone;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it\n\t * repeatedly.\n\t * @returns May be null. */\n\tfindSlot (slotName: string) {\n\t\tif (!slotName) throw new Error(\"slotName cannot be null.\");\n\t\tlet slots = this.slots;\n\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\tlet slot = slots[i];\n\t\t\tif (slot.data.name == slotName) return slot;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Sets a skin by name.\n\t *\n\t * See {@link #setSkin()}. */\n\tsetSkinByName (skinName: string) {\n\t\tlet skin = this.data.findSkin(skinName);\n\t\tif (!skin) throw new Error(\"Skin not found: \" + skinName);\n\t\tthis.setSkin(skin);\n\t}\n\n\t/** Sets the skin used to look up attachments before looking in the {@link SkeletonData#defaultSkin default skin}. If the\n\t * skin is changed, {@link #updateCache()} is called.\n\t *\n\t * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was no\n\t * old skin, each slot's setup mode attachment is attached from the new skin.\n\t *\n\t * After changing the skin, the visible attachments can be reset to those attached in the setup pose by calling\n\t * {@link #setSlotsToSetupPose()}. Also, often {@link AnimationState#apply()} is called before the next time the\n\t * skeleton is rendered to allow any attachment keys in the current animation(s) to hide or show attachments from the new skin.\n\t * @param newSkin May be null. */\n\tsetSkin (newSkin: Skin) {\n\t\tif (newSkin == this.skin) return;\n\t\tif (newSkin) {\n\t\t\tif (this.skin)\n\t\t\t\tnewSkin.attachAll(this, this.skin);\n\t\t\telse {\n\t\t\t\tlet slots = this.slots;\n\t\t\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\t\t\tlet slot = slots[i];\n\t\t\t\t\tlet name = slot.data.attachmentName;\n\t\t\t\t\tif (name) {\n\t\t\t\t\t\tlet attachment = newSkin.getAttachment(i, name);\n\t\t\t\t\t\tif (attachment) slot.setAttachment(attachment);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.skin = newSkin;\n\t\tthis.updateCache();\n\t}\n\n\n\t/** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot name and attachment\n\t * name.\n\t *\n\t * See {@link #getAttachment()}.\n\t * @returns May be null. */\n\tgetAttachmentByName (slotName: string, attachmentName: string): Attachment | null {\n\t\tlet slot = this.data.findSlot(slotName);\n\t\tif (!slot) throw new Error(`Can't find slot with name ${slotName}`);\n\t\treturn this.getAttachment(slot.index, attachmentName);\n\t}\n\n\t/** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot index and\n\t * attachment name. First the skin is checked and if the attachment was not found, the default skin is checked.\n\t *\n\t * See [Runtime skins](http://esotericsoftware.com/spine-runtime-skins) in the Spine Runtimes Guide.\n\t * @returns May be null. */\n\tgetAttachment (slotIndex: number, attachmentName: string): Attachment | null {\n\t\tif (!attachmentName) throw new Error(\"attachmentName cannot be null.\");\n\t\tif (this.skin) {\n\t\t\tlet attachment = this.skin.getAttachment(slotIndex, attachmentName);\n\t\t\tif (attachment) return attachment;\n\t\t}\n\t\tif (this.data.defaultSkin) return this.data.defaultSkin.getAttachment(slotIndex, attachmentName);\n\t\treturn null;\n\t}\n\n\t/** A convenience method to set an attachment by finding the slot with {@link #findSlot()}, finding the attachment with\n\t * {@link #getAttachment()}, then setting the slot's {@link Slot#attachment}.\n\t * @param attachmentName May be null to clear the slot's attachment. */\n\tsetAttachment (slotName: string, attachmentName: string) {\n\t\tif (!slotName) throw new Error(\"slotName cannot be null.\");\n\t\tlet slots = this.slots;\n\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\tlet slot = slots[i];\n\t\t\tif (slot.data.name == slotName) {\n\t\t\t\tlet attachment: Attachment | null = null;\n\t\t\t\tif (attachmentName) {\n\t\t\t\t\tattachment = this.getAttachment(i, attachmentName);\n\t\t\t\t\tif (!attachment) throw new Error(\"Attachment not found: \" + attachmentName + \", for slot: \" + slotName);\n\t\t\t\t}\n\t\t\t\tslot.setAttachment(attachment);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tthrow new Error(\"Slot not found: \" + slotName);\n\t}\n\n\n\t/** Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results of this method\n\t * than to call it repeatedly.\n\t * @return May be null. */\n\tfindIkConstraint (constraintName: string) {\n\t\tif (!constraintName) throw new Error(\"constraintName cannot be null.\");\n\t\treturn this.ikConstraints.find((constraint) => constraint.data.name == constraintName) ?? null;\n\t}\n\n\t/** Finds a transform constraint by comparing each transform constraint's name. It is more efficient to cache the results of\n\t * this method than to call it repeatedly.\n\t * @return May be null. */\n\tfindTransformConstraint (constraintName: string) {\n\t\tif (!constraintName) throw new Error(\"constraintName cannot be null.\");\n\t\treturn this.transformConstraints.find((constraint) => constraint.data.name == constraintName) ?? null;\n\t}\n\n\t/** Finds a path constraint by comparing each path constraint's name. It is more efficient to cache the results of this method\n\t * than to call it repeatedly.\n\t * @return May be null. */\n\tfindPathConstraint (constraintName: string) {\n\t\tif (!constraintName) throw new Error(\"constraintName cannot be null.\");\n\t\treturn this.pathConstraints.find((constraint) => constraint.data.name == constraintName) ?? null;\n\t}\n\n\t/** Finds a physics constraint by comparing each physics constraint's name. It is more efficient to cache the results of this\n\t * method than to call it repeatedly. */\n\tfindPhysicsConstraint (constraintName: string) {\n\t\tif (constraintName == null) throw new Error(\"constraintName cannot be null.\");\n\t\treturn this.physicsConstraints.find((constraint) => constraint.data.name == constraintName) ?? null;\n\t}\n\n\t/** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose as `{ x: number, y: number, width: number, height: number }`.\n\t * Note that this method will create temporary objects which can add to garbage collection pressure. Use `getBounds()` if garbage collection is a concern. */\n\tgetBoundsRect (clipper?: SkeletonClipping) {\n\t\tlet offset = new Vector2();\n\t\tlet size = new Vector2();\n\t\tthis.getBounds(offset, size, undefined, clipper);\n\t\treturn { x: offset.x, y: offset.y, width: size.x, height: size.y };\n\t}\n\n\t/** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.\n\t * @param offset An output value, the distance from the skeleton origin to the bottom left corner of the AABB.\n\t * @param size An output value, the width and height of the AABB.\n\t * @param temp Working memory to temporarily store attachments' computed world vertices.\n\t * @param clipper {@link SkeletonClipping} to use. If <code>null</code>, no clipping is applied. */\n\tgetBounds (offset: Vector2, size: Vector2, temp: Array<number> = new Array<number>(2), clipper: SkeletonClipping | null = null) {\n\t\tif (!offset) throw new Error(\"offset cannot be null.\");\n\t\tif (!size) throw new Error(\"size cannot be null.\");\n\t\tlet drawOrder = this.drawOrder;\n\t\tlet minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\n\t\tfor (let i = 0, n = drawOrder.length; i < n; i++) {\n\t\t\tlet slot = drawOrder[i];\n\t\t\tif (!slot.bone.active) continue;\n\t\t\tlet verticesLength = 0;\n\t\t\tlet vertices: NumberArrayLike | null = null;\n\t\t\tlet triangles: NumberArrayLike | null = null;\n\t\t\tlet attachment = slot.getAttachment();\n\t\t\tif (attachment instanceof RegionAttachment) {\n\t\t\t\tverticesLength = 8;\n\t\t\t\tvertices = Utils.setArraySize(temp, verticesLength, 0);\n\t\t\t\tattachment.computeWorldVertices(slot, vertices, 0, 2);\n\t\t\t\ttriangles = Skeleton.quadTriangles;\n\t\t\t} else if (attachment instanceof MeshAttachment) {\n\t\t\t\tlet mesh = (<MeshAttachment>attachment);\n\t\t\t\tverticesLength = mesh.worldVerticesLength;\n\t\t\t\tvertices = Utils.setArraySize(temp, verticesLength, 0);\n\t\t\t\tmesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);\n\t\t\t\ttriangles = mesh.triangles;\n\t\t\t} else if (attachment instanceof ClippingAttachment && clipper != null) {\n\t\t\t\tclipper.clipStart(slot, attachment);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (vertices && triangles) {\n\t\t\t\tif (clipper != null && clipper.isClipping()) {\n\t\t\t\t\tclipper.clipTriangles(vertices, triangles, triangles.length);\n\t\t\t\t\tvertices = clipper.clippedVertices;\n\t\t\t\t\tverticesLength = clipper.clippedVertices.length;\n\t\t\t\t}\n\t\t\t\tfor (let ii = 0, nn = vertices.length; ii < nn; ii += 2) {\n\t\t\t\t\tlet x = vertices[ii], y = vertices[ii + 1];\n\t\t\t\t\tminX = Math.min(minX, x);\n\t\t\t\t\tminY = Math.min(minY, y);\n\t\t\t\t\tmaxX = Math.max(maxX, x);\n\t\t\t\t\tmaxY = Math.max(maxY, y);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (clipper != null) clipper.clipEndWithSlot(slot);\n\t\t}\n\t\tif (clipper != null) clipper.clipEnd();\n\t\toffset.set(minX, minY);\n\t\tsize.set(maxX - minX, maxY - minY);\n\t}\n\n\t/** Increments the skeleton's {@link #time}. */\n\tupdate (delta: number) {\n\t\tthis.time += delta;\n\t}\n\n\tphysicsTranslate (x: number, y: number) {\n\t\tconst physicsConstraints = this.physicsConstraints;\n\t\tfor (let i = 0, n = physicsConstraints.length; i < n; i++)\n\t\t\tphysicsConstraints[i].translate(x, y);\n\t}\n\n\t/** Calls {@link PhysicsConstraint#rotate(float, float, float)} for each physics constraint. */\n\tphysicsRotate (x: number, y: number, degrees: number) {\n\t\tconst physicsConstraints = this.physicsConstraints;\n\t\tfor (let i = 0, n = physicsConstraints.length; i < n; i++)\n\t\t\tphysicsConstraints[i].rotate(x, y, degrees);\n\t}\n}\n\n/** Determines how physics and other non-deterministic updates are applied. */\nexport enum Physics {\n\t/** Physics are not updated or applied. */\n\tnone,\n\n\t/** Physics are reset to the current pose. */\n\treset,\n\n\t/** Physics are updated and the pose from physics is applied. */\n\tupdate,\n\n\t/** Physics are not updated but the pose from physics is applied. */\n\tpose\n}", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BoneData } from \"./BoneData.js\";\nimport { ConstraintData } from \"./ConstraintData.js\";\n\n\n/** Stores the setup pose for a {@link PhysicsConstraint}.\n * <p>\n * See <a href=\"http://esotericsoftware.com/spine-physics-constraints\">Physics constraints</a> in the Spine User Guide. */\nexport class PhysicsConstraintData extends ConstraintData {\n\tprivate _bone: BoneData | null = null;\n\t/** The bone constrained by this physics constraint. */\n\tpublic set bone (boneData: BoneData) { this._bone = boneData; }\n\tpublic get bone () {\n\t\tif (!this._bone) throw new Error(\"BoneData not set.\")\n\t\telse return this._bone;\n\t}\n\n\tx = 0;\n\ty = 0;\n\trotate = 0;\n\tscaleX = 0;\n\tshearX = 0;\n\tlimit = 0;\n\tstep = 0;\n\tinertia = 0;\n\tstrength = 0;\n\tdamping = 0;\n\tmassInverse = 0;\n\twind = 0;\n\tgravity = 0;\n\t/** A percentage (0-1) that controls the mix between the constrained and unconstrained poses. */\n\tmix = 0;\n\tinertiaGlobal = false;\n\tstrengthGlobal = false;\n\tdampingGlobal = false;\n\tmassGlobal = false;\n\twindGlobal = false;\n\tgravityGlobal = false;\n\tmixGlobal = false;\n\n\tconstructor (name: string) {\n\t\tsuper(name, 0, false);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Animation } from \"./Animation\"\nimport { BoneData } from \"./BoneData.js\";\nimport { EventData } from \"./EventData.js\";\nimport { IkConstraintData } from \"./IkConstraintData.js\";\nimport { PathConstraintData } from \"./PathConstraintData.js\";\nimport { PhysicsConstraintData } from \"./PhysicsConstraintData.js\";\nimport { Skin } from \"./Skin.js\";\nimport { SlotData } from \"./SlotData.js\";\nimport { TransformConstraintData } from \"./TransformConstraintData.js\";\n\n/** Stores the setup pose and all of the stateless data for a skeleton.\n *\n * See [Data objects](http://esotericsoftware.com/spine-runtime-architecture#Data-objects) in the Spine Runtimes\n * Guide. */\nexport class SkeletonData {\n\n\t/** The skeleton's name, which by default is the name of the skeleton data file, if possible. May be null. */\n\tname: string | null = null;\n\n\t/** The skeleton's bones, sorted parent first. The root bone is always the first bone. */\n\tbones = new Array<BoneData>(); // Ordered parents first.\n\n\t/** The skeleton's slots in the setup pose draw order. */\n\tslots = new Array<SlotData>(); // Setup pose draw order.\n\n\tskins = new Array<Skin>();\n\n\t/** The skeleton's default skin. By default this skin contains all attachments that were not in a skin in Spine.\n\t *\n\t * See {@link Skeleton#getAttachmentByName()}.\n\t * May be null. */\n\tdefaultSkin: Skin | null = null;\n\n\t/** The skeleton's events. */\n\tevents = new Array<EventData>();\n\n\t/** The skeleton's animations. */\n\tanimations = new Array<Animation>();\n\n\t/** The skeleton's IK constraints. */\n\tikConstraints = new Array<IkConstraintData>();\n\n\t/** The skeleton's transform constraints. */\n\ttransformConstraints = new Array<TransformConstraintData>();\n\n\t/** The skeleton's path constraints. */\n\tpathConstraints = new Array<PathConstraintData>();\n\n\t/** The skeleton's physics constraints. */\n\tphysicsConstraints = new Array<PhysicsConstraintData>();\n\n\t/** The X coordinate of the skeleton's axis aligned bounding box in the setup pose. */\n\tx: number = 0;\n\n\t/** The Y coordinate of the skeleton's axis aligned bounding box in the setup pose. */\n\ty: number = 0;\n\n\t/** The width of the skeleton's axis aligned bounding box in the setup pose. */\n\twidth: number = 0;\n\n\t/** The height of the skeleton's axis aligned bounding box in the setup pose. */\n\theight: number = 0;\n\n\t/** Baseline scale factor for applying distance-dependent effects on non-scalable properties, such as angle or scale. Default\n\t * is 100. */\n\treferenceScale = 100;\n\n\t/** The Spine version used to export the skeleton data, or null. */\n\tversion: string | null = null;\n\n\t/** The skeleton data hash. This value will change if any of the skeleton data has changed. May be null. */\n\thash: string | null = null;\n\n\t// Nonessential\n\t/** The dopesheet FPS in Spine. Available only when nonessential data was exported. */\n\tfps = 0;\n\n\t/** The path to the images directory as defined in Spine. Available only when nonessential data was exported. May be null. */\n\timagesPath: string | null = null;\n\n\t/** The path to the audio directory as defined in Spine. Available only when nonessential data was exported. May be null. */\n\taudioPath: string | null = null;\n\n\t/** Finds a bone by comparing each bone's name. It is more efficient to cache the results of this method than to call it\n\t * multiple times.\n\t * @returns May be null. */\n\tfindBone (boneName: string) {\n\t\tif (!boneName) throw new Error(\"boneName cannot be null.\");\n\t\tlet bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\t\t\tif (bone.name == boneName) return bone;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it\n\t * multiple times.\n\t * @returns May be null. */\n\tfindSlot (slotName: string) {\n\t\tif (!slotName) throw new Error(\"slotName cannot be null.\");\n\t\tlet slots = this.slots;\n\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\tlet slot = slots[i];\n\t\t\tif (slot.name == slotName) return slot;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds a skin by comparing each skin's name. It is more efficient to cache the results of this method than to call it\n\t * multiple times.\n\t * @returns May be null. */\n\tfindSkin (skinName: string) {\n\t\tif (!skinName) throw new Error(\"skinName cannot be null.\");\n\t\tlet skins = this.skins;\n\t\tfor (let i = 0, n = skins.length; i < n; i++) {\n\t\t\tlet skin = skins[i];\n\t\t\tif (skin.name == skinName) return skin;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds an event by comparing each events's name. It is more efficient to cache the results of this method than to call it\n\t * multiple times.\n\t * @returns May be null. */\n\tfindEvent (eventDataName: string) {\n\t\tif (!eventDataName) throw new Error(\"eventDataName cannot be null.\");\n\t\tlet events = this.events;\n\t\tfor (let i = 0, n = events.length; i < n; i++) {\n\t\t\tlet event = events[i];\n\t\t\tif (event.name == eventDataName) return event;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds an animation by comparing each animation's name. It is more efficient to cache the results of this method than to\n\t * call it multiple times.\n\t * @returns May be null. */\n\tfindAnimation (animationName: string) {\n\t\tif (!animationName) throw new Error(\"animationName cannot be null.\");\n\t\tlet animations = this.animations;\n\t\tfor (let i = 0, n = animations.length; i < n; i++) {\n\t\t\tlet animation = animations[i];\n\t\t\tif (animation.name == animationName) return animation;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results of this method\n\t * than to call it multiple times.\n\t * @return May be null. */\n\tfindIkConstraint (constraintName: string) {\n\t\tif (!constraintName) throw new Error(\"constraintName cannot be null.\");\n\t\tconst ikConstraints = this.ikConstraints;\n\t\tfor (let i = 0, n = ikConstraints.length; i < n; i++) {\n\t\t\tconst constraint = ikConstraints[i];\n\t\t\tif (constraint.name == constraintName) return constraint;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds a transform constraint by comparing each transform constraint's name. It is more efficient to cache the results of\n\t * this method than to call it multiple times.\n\t * @return May be null. */\n\tfindTransformConstraint (constraintName: string) {\n\t\tif (!constraintName) throw new Error(\"constraintName cannot be null.\");\n\t\tconst transformConstraints = this.transformConstraints;\n\t\tfor (let i = 0, n = transformConstraints.length; i < n; i++) {\n\t\t\tconst constraint = transformConstraints[i];\n\t\t\tif (constraint.name == constraintName) return constraint;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds a path constraint by comparing each path constraint's name. It is more efficient to cache the results of this method\n\t * than to call it multiple times.\n\t * @return May be null. */\n\tfindPathConstraint (constraintName: string) {\n\t\tif (!constraintName) throw new Error(\"constraintName cannot be null.\");\n\t\tconst pathConstraints = this.pathConstraints;\n\t\tfor (let i = 0, n = pathConstraints.length; i < n; i++) {\n\t\t\tconst constraint = pathConstraints[i];\n\t\t\tif (constraint.name == constraintName) return constraint;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds a physics constraint by comparing each physics constraint's name. It is more efficient to cache the results of this method\n\t * than to call it multiple times.\n\t * @return May be null. */\n\tfindPhysicsConstraint (constraintName: string) {\n\t\tif (!constraintName) throw new Error(\"constraintName cannot be null.\");\n\t\tconst physicsConstraints = this.physicsConstraints;\n\t\tfor (let i = 0, n = physicsConstraints.length; i < n; i++) {\n\t\t\tconst constraint = physicsConstraints[i];\n\t\t\tif (constraint.name == constraintName) return constraint;\n\t\t}\n\t\treturn null;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Attachment } from \"./attachments/Attachment.js\";\nimport { MeshAttachment } from \"./attachments/MeshAttachment.js\";\nimport { BoneData } from \"./BoneData.js\";\nimport { ConstraintData } from \"./ConstraintData.js\";\nimport { Skeleton } from \"./Skeleton.js\";\nimport { Color, StringMap } from \"./Utils.js\";\n\n/** Stores an entry in the skin consisting of the slot index, name, and attachment **/\nexport class SkinEntry {\n\tconstructor (public slotIndex: number = 0, public name: string, public attachment: Attachment) { }\n}\n\n/** Stores attachments by slot index and attachment name.\n *\n * See SkeletonData {@link SkeletonData#defaultSkin}, Skeleton {@link Skeleton#skin}, and\n * [Runtime skins](http://esotericsoftware.com/spine-runtime-skins) in the Spine Runtimes Guide. */\nexport class Skin {\n\t/** The skin's name, which is unique across all skins in the skeleton. */\n\tname: string;\n\n\tattachments = new Array<StringMap<Attachment>>();\n\tbones = Array<BoneData>();\n\tconstraints = new Array<ConstraintData>();\n\n\t/** The color of the skin as it was in Spine, or a default color if nonessential data was not exported. */\n\tcolor = new Color(0.99607843, 0.61960787, 0.30980393, 1); // fe9e4fff\n\n\tconstructor (name: string) {\n\t\tif (!name) throw new Error(\"name cannot be null.\");\n\t\tthis.name = name;\n\t}\n\n\t/** Adds an attachment to the skin for the specified slot index and name. */\n\tsetAttachment (slotIndex: number, name: string, attachment: Attachment) {\n\t\tif (!attachment) throw new Error(\"attachment cannot be null.\");\n\t\tlet attachments = this.attachments;\n\t\tif (slotIndex >= attachments.length) attachments.length = slotIndex + 1;\n\t\tif (!attachments[slotIndex]) attachments[slotIndex] = {};\n\t\tattachments[slotIndex][name] = attachment;\n\t}\n\n\t/** Adds all attachments, bones, and constraints from the specified skin to this skin. */\n\taddSkin (skin: Skin) {\n\t\tfor (let i = 0; i < skin.bones.length; i++) {\n\t\t\tlet bone = skin.bones[i];\n\t\t\tlet contained = false;\n\t\t\tfor (let ii = 0; ii < this.bones.length; ii++) {\n\t\t\t\tif (this.bones[ii] == bone) {\n\t\t\t\t\tcontained = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!contained) this.bones.push(bone);\n\t\t}\n\n\t\tfor (let i = 0; i < skin.constraints.length; i++) {\n\t\t\tlet constraint = skin.constraints[i];\n\t\t\tlet contained = false;\n\t\t\tfor (let ii = 0; ii < this.constraints.length; ii++) {\n\t\t\t\tif (this.constraints[ii] == constraint) {\n\t\t\t\t\tcontained = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!contained) this.constraints.push(constraint);\n\t\t}\n\n\t\tlet attachments = skin.getAttachments();\n\t\tfor (let i = 0; i < attachments.length; i++) {\n\t\t\tvar attachment = attachments[i];\n\t\t\tthis.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\n\t\t}\n\t}\n\n\t/** Adds all bones and constraints and copies of all attachments from the specified skin to this skin. Mesh attachments are not\n\t * copied, instead a new linked mesh is created. The attachment copies can be modified without affecting the originals. */\n\tcopySkin (skin: Skin) {\n\t\tfor (let i = 0; i < skin.bones.length; i++) {\n\t\t\tlet bone = skin.bones[i];\n\t\t\tlet contained = false;\n\t\t\tfor (let ii = 0; ii < this.bones.length; ii++) {\n\t\t\t\tif (this.bones[ii] == bone) {\n\t\t\t\t\tcontained = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!contained) this.bones.push(bone);\n\t\t}\n\n\t\tfor (let i = 0; i < skin.constraints.length; i++) {\n\t\t\tlet constraint = skin.constraints[i];\n\t\t\tlet contained = false;\n\t\t\tfor (let ii = 0; ii < this.constraints.length; ii++) {\n\t\t\t\tif (this.constraints[ii] == constraint) {\n\t\t\t\t\tcontained = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!contained) this.constraints.push(constraint);\n\t\t}\n\n\t\tlet attachments = skin.getAttachments();\n\t\tfor (let i = 0; i < attachments.length; i++) {\n\t\t\tvar attachment = attachments[i];\n\t\t\tif (!attachment.attachment) continue;\n\t\t\tif (attachment.attachment instanceof MeshAttachment) {\n\t\t\t\tattachment.attachment = attachment.attachment.newLinkedMesh();\n\t\t\t\tthis.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\n\t\t\t} else {\n\t\t\t\tattachment.attachment = attachment.attachment.copy();\n\t\t\t\tthis.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Returns the attachment for the specified slot index and name, or null. */\n\tgetAttachment (slotIndex: number, name: string): Attachment | null {\n\t\tlet dictionary = this.attachments[slotIndex];\n\t\treturn dictionary ? dictionary[name] : null;\n\t}\n\n\t/** Removes the attachment in the skin for the specified slot index and name, if any. */\n\tremoveAttachment (slotIndex: number, name: string) {\n\t\tlet dictionary = this.attachments[slotIndex];\n\t\tif (dictionary) delete dictionary[name];\n\t}\n\n\t/** Returns all attachments in this skin. */\n\tgetAttachments (): Array<SkinEntry> {\n\t\tlet entries = new Array<SkinEntry>();\n\t\tfor (var i = 0; i < this.attachments.length; i++) {\n\t\t\tlet slotAttachments = this.attachments[i];\n\t\t\tif (slotAttachments) {\n\t\t\t\tfor (let name in slotAttachments) {\n\t\t\t\t\tlet attachment = slotAttachments[name];\n\t\t\t\t\tif (attachment) entries.push(new SkinEntry(i, name, attachment));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn entries;\n\t}\n\n\t/** Returns all attachments in this skin for the specified slot index. */\n\tgetAttachmentsForSlot (slotIndex: number, attachments: Array<SkinEntry>) {\n\t\tlet slotAttachments = this.attachments[slotIndex];\n\t\tif (slotAttachments) {\n\t\t\tfor (let name in slotAttachments) {\n\t\t\t\tlet attachment = slotAttachments[name];\n\t\t\t\tif (attachment) attachments.push(new SkinEntry(slotIndex, name, attachment));\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Clears all attachments, bones, and constraints. */\n\tclear () {\n\t\tthis.attachments.length = 0;\n\t\tthis.bones.length = 0;\n\t\tthis.constraints.length = 0;\n\t}\n\n\t/** Attach each attachment in this skin if the corresponding attachment in the old skin is currently attached. */\n\tattachAll (skeleton: Skeleton, oldSkin: Skin) {\n\t\tlet slotIndex = 0;\n\t\tfor (let i = 0; i < skeleton.slots.length; i++) {\n\t\t\tlet slot = skeleton.slots[i];\n\t\t\tlet slotAttachment = slot.getAttachment();\n\t\t\tif (slotAttachment && slotIndex < oldSkin.attachments.length) {\n\t\t\t\tlet dictionary = oldSkin.attachments[slotIndex];\n\t\t\t\tfor (let key in dictionary) {\n\t\t\t\t\tlet skinAttachment: Attachment = dictionary[key];\n\t\t\t\t\tif (slotAttachment == skinAttachment) {\n\t\t\t\t\t\tlet attachment = this.getAttachment(slotIndex, key);\n\t\t\t\t\t\tif (attachment) slot.setAttachment(attachment);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tslotIndex++;\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BoneData } from \"./BoneData.js\";\nimport { Color } from \"./Utils.js\";\n\n/** Stores the setup pose for a {@link Slot}. */\nexport class SlotData {\n\t/** The index of the slot in {@link Skeleton#getSlots()}. */\n\tindex: number = 0;\n\n\t/** The name of the slot, which is unique across all slots in the skeleton. */\n\tname: string;\n\n\t/** The bone this slot belongs to. */\n\tboneData: BoneData;\n\n\t/** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two\n\t * color tinting. */\n\tcolor = new Color(1, 1, 1, 1);\n\n\t/** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark\n\t * color's alpha is not used. */\n\tdarkColor: Color | null = null;\n\n\t/** The name of the attachment that is visible for this slot in the setup pose, or null if no attachment is visible. */\n\tattachmentName: string | null = null;\n\n\t/** The blend mode for drawing the slot's attachment. */\n\tblendMode: BlendMode = BlendMode.Normal;\n\n\t/** False if the slot was hidden in Spine and nonessential data was exported. Does not affect runtime rendering. */\n\tvisible = true;\n\n\tconstructor (index: number, name: string, boneData: BoneData) {\n\t\tif (index < 0) throw new Error(\"index must be >= 0.\");\n\t\tif (!name) throw new Error(\"name cannot be null.\");\n\t\tif (!boneData) throw new Error(\"boneData cannot be null.\");\n\t\tthis.index = index;\n\t\tthis.name = name;\n\t\tthis.boneData = boneData;\n\t}\n}\n\n/** Determines how images are blended with existing pixels when drawn. */\nexport enum BlendMode { Normal, Additive, Multiply, Screen }\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { ConstraintData } from \"./ConstraintData.js\";\nimport { BoneData } from \"./BoneData.js\";\n\n/** Stores the setup pose for a {@link TransformConstraint}.\n *\n * See [Transform constraints](http://esotericsoftware.com/spine-transform-constraints) in the Spine User Guide. */\nexport class TransformConstraintData extends ConstraintData {\n\n\t/** The bones that will be modified by this transform constraint. */\n\tbones = new Array<BoneData>();\n\n\t/** The target bone whose world transform will be copied to the constrained bones. */\n\tprivate _target: BoneData | null = null;\n\tpublic set target (boneData: BoneData) { this._target = boneData; }\n\tpublic get target () {\n\t\tif (!this._target) throw new Error(\"BoneData not set.\")\n\t\telse return this._target;\n\t}\n\n\tmixRotate = 0;\n\tmixX = 0;\n\tmixY = 0;\n\tmixScaleX = 0;\n\tmixScaleY = 0;\n\tmixShearY = 0;\n\n\t/** An offset added to the constrained bone rotation. */\n\toffsetRotation = 0;\n\n\t/** An offset added to the constrained bone X translation. */\n\toffsetX = 0;\n\n\t/** An offset added to the constrained bone Y translation. */\n\toffsetY = 0;\n\n\t/** An offset added to the constrained bone scaleX. */\n\toffsetScaleX = 0;\n\n\t/** An offset added to the constrained bone scaleY. */\n\toffsetScaleY = 0;\n\n\t/** An offset added to the constrained bone shearY. */\n\toffsetShearY = 0;\n\n\trelative = false;\n\tlocal = false;\n\n\tconstructor (name: string) {\n\t\tsuper(name, 0, false);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Animation, Timeline, InheritTimeline, AttachmentTimeline, RGBATimeline, RGBTimeline, RGBA2Timeline, RGB2Timeline, AlphaTimeline, RotateTimeline, TranslateTimeline, TranslateXTimeline, TranslateYTimeline, ScaleTimeline, ScaleXTimeline, ScaleYTimeline, ShearTimeline, ShearXTimeline, ShearYTimeline, IkConstraintTimeline, TransformConstraintTimeline, PathConstraintPositionTimeline, PathConstraintSpacingTimeline, PathConstraintMixTimeline, DeformTimeline, DrawOrderTimeline, EventTimeline, CurveTimeline1, CurveTimeline2, CurveTimeline, SequenceTimeline, PhysicsConstraintResetTimeline, PhysicsConstraintInertiaTimeline, PhysicsConstraintStrengthTimeline, PhysicsConstraintDampingTimeline, PhysicsConstraintMassTimeline, PhysicsConstraintWindTimeline, PhysicsConstraintGravityTimeline, PhysicsConstraintMixTimeline } from \"./Animation.js\";\nimport { VertexAttachment, Attachment } from \"./attachments/Attachment.js\";\nimport { AttachmentLoader } from \"./attachments/AttachmentLoader.js\";\nimport { HasTextureRegion } from \"./attachments/HasTextureRegion.js\";\nimport { MeshAttachment } from \"./attachments/MeshAttachment.js\";\nimport { Sequence, SequenceModeValues } from \"./attachments/Sequence.js\";\nimport { BoneData } from \"./BoneData.js\";\nimport { Event } from \"./Event.js\";\nimport { EventData } from \"./EventData.js\";\nimport { IkConstraintData } from \"./IkConstraintData.js\";\nimport { PathConstraintData, PositionMode, SpacingMode } from \"./PathConstraintData.js\";\nimport { PhysicsConstraintData } from \"./PhysicsConstraintData.js\";\nimport { SkeletonData } from \"./SkeletonData.js\";\nimport { Skin } from \"./Skin.js\";\nimport { SlotData } from \"./SlotData.js\";\nimport { TransformConstraintData } from \"./TransformConstraintData.js\";\nimport { Color, Utils } from \"./Utils.js\";\n\n/** Loads skeleton data in the Spine binary format.\n *\n * See [Spine binary format](http://esotericsoftware.com/spine-binary-format) and\n * [JSON and binary data](http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data) in the Spine\n * Runtimes Guide. */\nexport class SkeletonBinary {\n\t/** Scales bone positions, image sizes, and translations as they are loaded. This allows different size images to be used at\n\t * runtime than were used in Spine.\n\t *\n\t * See [Scaling](http://esotericsoftware.com/spine-loading-skeleton-data#Scaling) in the Spine Runtimes Guide. */\n\tscale = 1;\n\n\tattachmentLoader: AttachmentLoader;\n\tprivate linkedMeshes = new Array<LinkedMesh>();\n\n\tconstructor (attachmentLoader: AttachmentLoader) {\n\t\tthis.attachmentLoader = attachmentLoader;\n\t}\n\n\treadSkeletonData (binary: Uint8Array | ArrayBuffer): SkeletonData {\n\t\tlet scale = this.scale;\n\n\t\tlet skeletonData = new SkeletonData();\n\t\tskeletonData.name = \"\"; // BOZO\n\n\t\tlet input = new BinaryInput(binary);\n\n\t\tlet lowHash = input.readInt32();\n\t\tlet highHash = input.readInt32();\n\t\tskeletonData.hash = highHash == 0 && lowHash == 0 ? null : highHash.toString(16) + lowHash.toString(16);\n\t\tskeletonData.version = input.readString();\n\t\tskeletonData.x = input.readFloat();\n\t\tskeletonData.y = input.readFloat();\n\t\tskeletonData.width = input.readFloat();\n\t\tskeletonData.height = input.readFloat();\n\t\tskeletonData.referenceScale = input.readFloat() * scale;\n\n\t\tlet nonessential = input.readBoolean();\n\t\tif (nonessential) {\n\t\t\tskeletonData.fps = input.readFloat();\n\t\t\tskeletonData.imagesPath = input.readString();\n\t\t\tskeletonData.audioPath = input.readString();\n\t\t}\n\n\t\tlet n = 0;\n\t\t// Strings.\n\t\tn = input.readInt(true)\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tlet str = input.readString();\n\t\t\tif (!str) throw new Error(\"String in string table must not be null.\");\n\t\t\tinput.strings.push(str);\n\t\t}\n\n\t\t// Bones.\n\t\tn = input.readInt(true)\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tlet name = input.readString();\n\t\t\tif (!name) throw new Error(\"Bone name must not be null.\");\n\t\t\tlet parent = i == 0 ? null : skeletonData.bones[input.readInt(true)];\n\t\t\tlet data = new BoneData(i, name, parent);\n\t\t\tdata.rotation = input.readFloat();\n\t\t\tdata.x = input.readFloat() * scale;\n\t\t\tdata.y = input.readFloat() * scale;\n\t\t\tdata.scaleX = input.readFloat();\n\t\t\tdata.scaleY = input.readFloat();\n\t\t\tdata.shearX = input.readFloat();\n\t\t\tdata.shearY = input.readFloat();\n\t\t\tdata.length = input.readFloat() * scale;\n\t\t\tdata.inherit = input.readByte();\n\t\t\tdata.skinRequired = input.readBoolean();\n\t\t\tif (nonessential) {\n\t\t\t\tColor.rgba8888ToColor(data.color, input.readInt32());\n\t\t\t\tdata.icon = input.readString() ?? undefined;\n\t\t\t\tdata.visible = input.readBoolean();\n\t\t\t}\n\t\t\tskeletonData.bones.push(data);\n\t\t}\n\n\t\t// Slots.\n\t\tn = input.readInt(true);\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tlet slotName = input.readString();\n\t\t\tif (!slotName) throw new Error(\"Slot name must not be null.\");\n\t\t\tlet boneData = skeletonData.bones[input.readInt(true)];\n\t\t\tlet data = new SlotData(i, slotName, boneData);\n\t\t\tColor.rgba8888ToColor(data.color, input.readInt32());\n\n\t\t\tlet darkColor = input.readInt32();\n\t\t\tif (darkColor != -1) Color.rgb888ToColor(data.darkColor = new Color(), darkColor);\n\n\t\t\tdata.attachmentName = input.readStringRef();\n\t\t\tdata.blendMode = input.readInt(true);\n\t\t\tif (nonessential) data.visible = input.readBoolean();\n\t\t\tskeletonData.slots.push(data);\n\t\t}\n\n\t\t// IK constraints.\n\t\tn = input.readInt(true);\n\t\tfor (let i = 0, nn; i < n; i++) {\n\t\t\tlet name = input.readString();\n\t\t\tif (!name) throw new Error(\"IK constraint data name must not be null.\");\n\t\t\tlet data = new IkConstraintData(name);\n\t\t\tdata.order = input.readInt(true);\n\t\t\tnn = input.readInt(true);\n\t\t\tfor (let ii = 0; ii < nn; ii++)\n\t\t\t\tdata.bones.push(skeletonData.bones[input.readInt(true)]);\n\t\t\tdata.target = skeletonData.bones[input.readInt(true)];\n\t\t\tlet flags = input.readByte();\n\t\t\tdata.skinRequired = (flags & 1) != 0;\n\t\t\tdata.bendDirection = (flags & 2) != 0 ? 1 : -1;\n\t\t\tdata.compress = (flags & 4) != 0;\n\t\t\tdata.stretch = (flags & 8) != 0;\n\t\t\tdata.uniform = (flags & 16) != 0;\n\t\t\tif ((flags & 32) != 0) data.mix = (flags & 64) != 0 ? input.readFloat() : 1;\n\t\t\tif ((flags & 128) != 0) data.softness = input.readFloat() * scale;\n\t\t\tskeletonData.ikConstraints.push(data);\n\t\t}\n\n\t\t// Transform constraints.\n\t\tn = input.readInt(true);\n\t\tfor (let i = 0, nn; i < n; i++) {\n\t\t\tlet name = input.readString();\n\t\t\tif (!name) throw new Error(\"Transform constraint data name must not be null.\");\n\t\t\tlet data = new TransformConstraintData(name);\n\t\t\tdata.order = input.readInt(true);\n\t\t\tnn = input.readInt(true);\n\t\t\tfor (let ii = 0; ii < nn; ii++)\n\t\t\t\tdata.bones.push(skeletonData.bones[input.readInt(true)]);\n\t\t\tdata.target = skeletonData.bones[input.readInt(true)];\n\t\t\tlet flags = input.readByte();\n\t\t\tdata.skinRequired = (flags & 1) != 0;\n\t\t\tdata.local = (flags & 2) != 0;\n\t\t\tdata.relative = (flags & 4) != 0;\n\t\t\tif ((flags & 8) != 0) data.offsetRotation = input.readFloat();\n\t\t\tif ((flags & 16) != 0) data.offsetX = input.readFloat() * scale;\n\t\t\tif ((flags & 32) != 0) data.offsetY = input.readFloat() * scale;\n\t\t\tif ((flags & 64) != 0) data.offsetScaleX = input.readFloat();\n\t\t\tif ((flags & 128) != 0) data.offsetScaleY = input.readFloat();\n\t\t\tflags = input.readByte();\n\t\t\tif ((flags & 1) != 0) data.offsetShearY = input.readFloat();\n\t\t\tif ((flags & 2) != 0) data.mixRotate = input.readFloat();\n\t\t\tif ((flags & 4) != 0) data.mixX = input.readFloat();\n\t\t\tif ((flags & 8) != 0) data.mixY = input.readFloat();\n\t\t\tif ((flags & 16) != 0) data.mixScaleX = input.readFloat();\n\t\t\tif ((flags & 32) != 0) data.mixScaleY = input.readFloat();\n\t\t\tif ((flags & 64) != 0) data.mixShearY = input.readFloat();\n\t\t\tskeletonData.transformConstraints.push(data);\n\t\t}\n\n\t\t// Path constraints.\n\t\tn = input.readInt(true);\n\t\tfor (let i = 0, nn; i < n; i++) {\n\t\t\tlet name = input.readString();\n\t\t\tif (!name) throw new Error(\"Path constraint data name must not be null.\");\n\t\t\tlet data = new PathConstraintData(name);\n\t\t\tdata.order = input.readInt(true);\n\t\t\tdata.skinRequired = input.readBoolean();\n\t\t\tnn = input.readInt(true);\n\t\t\tfor (let ii = 0; ii < nn; ii++)\n\t\t\t\tdata.bones.push(skeletonData.bones[input.readInt(true)]);\n\t\t\tdata.target = skeletonData.slots[input.readInt(true)];\n\t\t\tconst flags = input.readByte();\n\t\t\tdata.positionMode = flags & 1;\n\t\t\tdata.spacingMode = (flags >> 1) & 3;\n\t\t\tdata.rotateMode = (flags >> 3) & 3;\n\t\t\tif ((flags & 128) != 0) data.offsetRotation = input.readFloat();\n\t\t\tdata.position = input.readFloat();\n\t\t\tif (data.positionMode == PositionMode.Fixed) data.position *= scale;\n\t\t\tdata.spacing = input.readFloat();\n\t\t\tif (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed) data.spacing *= scale;\n\t\t\tdata.mixRotate = input.readFloat();\n\t\t\tdata.mixX = input.readFloat();\n\t\t\tdata.mixY = input.readFloat();\n\t\t\tskeletonData.pathConstraints.push(data);\n\t\t}\n\n\t\t// Physics constraints.\n\t\tn = input.readInt(true);\n\t\tfor (let i = 0, nn; i < n; i++) {\n\t\t\tconst name = input.readString();\n\t\t\tif (!name) throw new Error(\"Physics constraint data name must not be null.\");\n\t\t\tconst data = new PhysicsConstraintData(name);\n\t\t\tdata.order = input.readInt(true);\n\t\t\tdata.bone = skeletonData.bones[input.readInt(true)];\n\t\t\tlet flags = input.readByte();\n\t\t\tdata.skinRequired = (flags & 1) != 0;\n\t\t\tif ((flags & 2) != 0) data.x = input.readFloat();\n\t\t\tif ((flags & 4) != 0) data.y = input.readFloat();\n\t\t\tif ((flags & 8) != 0) data.rotate = input.readFloat();\n\t\t\tif ((flags & 16) != 0) data.scaleX = input.readFloat();\n\t\t\tif ((flags & 32) != 0) data.shearX = input.readFloat();\n\t\t\tdata.limit = ((flags & 64) != 0 ? input.readFloat() : 5000) * scale;\n\t\t\tdata.step = 1 / input.readUnsignedByte();\n\t\t\tdata.inertia = input.readFloat();\n\t\t\tdata.strength = input.readFloat();\n\t\t\tdata.damping = input.readFloat();\n\t\t\tdata.massInverse = (flags & 128) != 0 ? input.readFloat() : 1;\n\t\t\tdata.wind = input.readFloat();\n\t\t\tdata.gravity = input.readFloat();\n\t\t\tflags = input.readByte();\n\t\t\tif ((flags & 1) != 0) data.inertiaGlobal = true;\n\t\t\tif ((flags & 2) != 0) data.strengthGlobal = true;\n\t\t\tif ((flags & 4) != 0) data.dampingGlobal = true;\n\t\t\tif ((flags & 8) != 0) data.massGlobal = true;\n\t\t\tif ((flags & 16) != 0) data.windGlobal = true;\n\t\t\tif ((flags & 32) != 0) data.gravityGlobal = true;\n\t\t\tif ((flags & 64) != 0) data.mixGlobal = true;\n\t\t\tdata.mix = (flags & 128) != 0 ? input.readFloat() : 1;\n\t\t\tskeletonData.physicsConstraints.push(data);\n\t\t}\n\n\t\t// Default skin.\n\t\tlet defaultSkin = this.readSkin(input, skeletonData, true, nonessential);\n\t\tif (defaultSkin) {\n\t\t\tskeletonData.defaultSkin = defaultSkin;\n\t\t\tskeletonData.skins.push(defaultSkin);\n\t\t}\n\n\t\t// Skins.\n\t\t{\n\t\t\tlet i = skeletonData.skins.length;\n\t\t\tUtils.setArraySize(skeletonData.skins, n = i + input.readInt(true));\n\t\t\tfor (; i < n; i++) {\n\t\t\t\tlet skin = this.readSkin(input, skeletonData, false, nonessential);\n\t\t\t\tif (!skin) throw new Error(\"readSkin() should not have returned null.\");\n\t\t\t\tskeletonData.skins[i] = skin;\n\t\t\t}\n\t\t}\n\n\t\t// Linked meshes.\n\t\tn = this.linkedMeshes.length;\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tlet linkedMesh = this.linkedMeshes[i];\n\t\t\tconst skin = skeletonData.skins[linkedMesh.skinIndex];\n\t\t\tif (!linkedMesh.parent) throw new Error(\"Linked mesh parent must not be null\");\n\t\t\tlet parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\n\t\t\tif (!parent) throw new Error(`Parent mesh not found: ${linkedMesh.parent}`);\n\t\t\tlinkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent as VertexAttachment : linkedMesh.mesh;\n\t\t\tlinkedMesh.mesh.setParentMesh(parent as MeshAttachment);\n\t\t\tif (linkedMesh.mesh.region != null) linkedMesh.mesh.updateRegion();\n\t\t}\n\t\tthis.linkedMeshes.length = 0;\n\n\t\t// Events.\n\t\tn = input.readInt(true);\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tlet eventName = input.readString();\n\t\t\tif (!eventName) throw new Error(\"Event data name must not be null\");\n\t\t\tlet data = new EventData(eventName);\n\t\t\tdata.intValue = input.readInt(false);\n\t\t\tdata.floatValue = input.readFloat();\n\t\t\tdata.stringValue = input.readString();\n\t\t\tdata.audioPath = input.readString();\n\t\t\tif (data.audioPath) {\n\t\t\t\tdata.volume = input.readFloat();\n\t\t\t\tdata.balance = input.readFloat();\n\t\t\t}\n\t\t\tskeletonData.events.push(data);\n\t\t}\n\n\t\t// Animations.\n\t\tn = input.readInt(true);\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tlet animationName = input.readString();\n\t\t\tif (!animationName) throw new Error(\"Animatio name must not be null.\");\n\t\t\tskeletonData.animations.push(this.readAnimation(input, animationName, skeletonData));\n\t\t}\n\t\treturn skeletonData;\n\t}\n\n\tprivate readSkin (input: BinaryInput, skeletonData: SkeletonData, defaultSkin: boolean, nonessential: boolean): Skin | null {\n\t\tlet skin = null;\n\t\tlet slotCount = 0;\n\n\t\tif (defaultSkin) {\n\t\t\tslotCount = input.readInt(true)\n\t\t\tif (slotCount == 0) return null;\n\t\t\tskin = new Skin(\"default\");\n\t\t} else {\n\t\t\tlet skinName = input.readString();\n\t\t\tif (!skinName) throw new Error(\"Skin name must not be null.\");\n\t\t\tskin = new Skin(skinName);\n\t\t\tif (nonessential) Color.rgba8888ToColor(skin.color, input.readInt32());\n\t\t\tskin.bones.length = input.readInt(true);\n\t\t\tfor (let i = 0, n = skin.bones.length; i < n; i++)\n\t\t\t\tskin.bones[i] = skeletonData.bones[input.readInt(true)];\n\n\t\t\tfor (let i = 0, n = input.readInt(true); i < n; i++)\n\t\t\t\tskin.constraints.push(skeletonData.ikConstraints[input.readInt(true)]);\n\t\t\tfor (let i = 0, n = input.readInt(true); i < n; i++)\n\t\t\t\tskin.constraints.push(skeletonData.transformConstraints[input.readInt(true)]);\n\t\t\tfor (let i = 0, n = input.readInt(true); i < n; i++)\n\t\t\t\tskin.constraints.push(skeletonData.pathConstraints[input.readInt(true)]);\n\t\t\tfor (let i = 0, n = input.readInt(true); i < n; i++)\n\t\t\t\tskin.constraints.push(skeletonData.physicsConstraints[input.readInt(true)]);\n\n\t\t\tslotCount = input.readInt(true);\n\t\t}\n\n\t\tfor (let i = 0; i < slotCount; i++) {\n\t\t\tlet slotIndex = input.readInt(true);\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tlet name = input.readStringRef();\n\t\t\t\tif (!name)\n\t\t\t\t\tthrow new Error(\"Attachment name must not be null\");\n\t\t\t\tlet attachment = this.readAttachment(input, skeletonData, skin, slotIndex, name, nonessential);\n\t\t\t\tif (attachment) skin.setAttachment(slotIndex, name, attachment);\n\t\t\t}\n\t\t}\n\t\treturn skin;\n\t}\n\n\tprivate readAttachment (input: BinaryInput, skeletonData: SkeletonData, skin: Skin, slotIndex: number, attachmentName: string | null | undefined, nonessential: boolean): Attachment | null {\n\t\tlet scale = this.scale;\n\n\t\tlet flags = input.readByte();\n\t\tconst name = (flags & 8) != 0 ? input.readStringRef() : attachmentName;\n\t\tif (!name) throw new Error(\"Attachment name must not be null\");\n\t\tswitch ((flags & 0b111) as AttachmentType) { // BUG?\n\t\t\tcase AttachmentType.Region: {\n\t\t\t\tlet path = (flags & 16) != 0 ? input.readStringRef() : null;\n\t\t\t\tconst color = (flags & 32) != 0 ? input.readInt32() : 0xffffffff;\n\t\t\t\tconst sequence = (flags & 64) != 0 ? this.readSequence(input) : null;\n\t\t\t\tlet rotation = (flags & 128) != 0 ? input.readFloat() : 0;\n\t\t\t\tlet x = input.readFloat();\n\t\t\t\tlet y = input.readFloat();\n\t\t\t\tlet scaleX = input.readFloat();\n\t\t\t\tlet scaleY = input.readFloat();\n\t\t\t\tlet width = input.readFloat();\n\t\t\t\tlet height = input.readFloat();\n\n\t\t\t\tif (!path) path = name;\n\t\t\t\tlet region = this.attachmentLoader.newRegionAttachment(skin, name, path, sequence);\n\t\t\t\tif (!region) return null;\n\t\t\t\tregion.path = path;\n\t\t\t\tregion.x = x * scale;\n\t\t\t\tregion.y = y * scale;\n\t\t\t\tregion.scaleX = scaleX;\n\t\t\t\tregion.scaleY = scaleY;\n\t\t\t\tregion.rotation = rotation;\n\t\t\t\tregion.width = width * scale;\n\t\t\t\tregion.height = height * scale;\n\t\t\t\tColor.rgba8888ToColor(region.color, color);\n\t\t\t\tregion.sequence = sequence;\n\t\t\t\tif (sequence == null) region.updateRegion();\n\t\t\t\treturn region;\n\t\t\t}\n\t\t\tcase AttachmentType.BoundingBox: {\n\t\t\t\tlet vertices = this.readVertices(input, (flags & 16) != 0);\n\t\t\t\tlet color = nonessential ? input.readInt32() : 0;\n\n\t\t\t\tlet box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\n\t\t\t\tif (!box) return null;\n\t\t\t\tbox.worldVerticesLength = vertices.length;\n\t\t\t\tbox.vertices = vertices.vertices!;\n\t\t\t\tbox.bones = vertices.bones;\n\t\t\t\tif (nonessential) Color.rgba8888ToColor(box.color, color);\n\t\t\t\treturn box;\n\t\t\t}\n\t\t\tcase AttachmentType.Mesh: {\n\t\t\t\tlet path = (flags & 16) != 0 ? input.readStringRef() : name;\n\t\t\t\tconst color = (flags & 32) != 0 ? input.readInt32() : 0xffffffff;\n\t\t\t\tconst sequence = (flags & 64) != 0 ? this.readSequence(input) : null;\n\t\t\t\tconst hullLength = input.readInt(true);\n\t\t\t\tconst vertices = this.readVertices(input, (flags & 128) != 0);\n\t\t\t\tconst uvs = this.readFloatArray(input, vertices.length, 1);\n\t\t\t\tconst triangles = this.readShortArray(input, (vertices.length - hullLength - 2) * 3);\n\t\t\t\tlet edges: number[] = [];\n\t\t\t\tlet width = 0, height = 0;\n\t\t\t\tif (nonessential) {\n\t\t\t\t\tedges = this.readShortArray(input, input.readInt(true));\n\t\t\t\t\twidth = input.readFloat();\n\t\t\t\t\theight = input.readFloat();\n\t\t\t\t}\n\n\t\t\t\tif (!path) path = name;\n\t\t\t\tlet mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence);\n\t\t\t\tif (!mesh) return null;\n\t\t\t\tmesh.path = path;\n\t\t\t\tColor.rgba8888ToColor(mesh.color, color);\n\t\t\t\tmesh.bones = vertices.bones;\n\t\t\t\tmesh.vertices = vertices.vertices!;\n\t\t\t\tmesh.worldVerticesLength = vertices.length;\n\t\t\t\tmesh.triangles = triangles;\n\t\t\t\tmesh.regionUVs = uvs;\n\t\t\t\tif (sequence == null) mesh.updateRegion();\n\t\t\t\tmesh.hullLength = hullLength << 1;\n\t\t\t\tmesh.sequence = sequence;\n\t\t\t\tif (nonessential) {\n\t\t\t\t\tmesh.edges = edges;\n\t\t\t\t\tmesh.width = width * scale;\n\t\t\t\t\tmesh.height = height * scale;\n\t\t\t\t}\n\t\t\t\treturn mesh;\n\t\t\t}\n\t\t\tcase AttachmentType.LinkedMesh: {\n\t\t\t\tconst path = (flags & 16) != 0 ? input.readStringRef() : name;\n\t\t\t\tif (path == null) throw new Error(\"Path of linked mesh must not be null\");\n\t\t\t\tconst color = (flags & 32) != 0 ? input.readInt32() : 0xffffffff;\n\t\t\t\tconst sequence = (flags & 64) != 0 ? this.readSequence(input) : null;\n\t\t\t\tconst inheritTimelines = (flags & 128) != 0;\n\t\t\t\tconst skinIndex = input.readInt(true);\n\t\t\t\tconst parent = input.readStringRef();\n\t\t\t\tlet width = 0, height = 0;\n\t\t\t\tif (nonessential) {\n\t\t\t\t\twidth = input.readFloat();\n\t\t\t\t\theight = input.readFloat();\n\t\t\t\t}\n\n\t\t\t\tlet mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence);\n\t\t\t\tif (!mesh) return null;\n\t\t\t\tmesh.path = path;\n\t\t\t\tColor.rgba8888ToColor(mesh.color, color);\n\t\t\t\tmesh.sequence = sequence;\n\t\t\t\tif (nonessential) {\n\t\t\t\t\tmesh.width = width * scale;\n\t\t\t\t\tmesh.height = height * scale;\n\t\t\t\t}\n\t\t\t\tthis.linkedMeshes.push(new LinkedMesh(mesh, skinIndex, slotIndex, parent, inheritTimelines));\n\t\t\t\treturn mesh;\n\t\t\t}\n\t\t\tcase AttachmentType.Path: {\n\t\t\t\tconst closed = (flags & 16) != 0;\n\t\t\t\tconst constantSpeed = (flags & 32) != 0;\n\t\t\t\tconst vertices = this.readVertices(input, (flags & 64) != 0);\n\n\t\t\t\tconst lengths = Utils.newArray(vertices.length / 6, 0);\n\t\t\t\tfor (let i = 0, n = lengths.length; i < n; i++)\n\t\t\t\t\tlengths[i] = input.readFloat() * scale;\n\t\t\t\tconst color = nonessential ? input.readInt32() : 0;\n\n\t\t\t\tconst path = this.attachmentLoader.newPathAttachment(skin, name);\n\t\t\t\tif (!path) return null;\n\t\t\t\tpath.closed = closed;\n\t\t\t\tpath.constantSpeed = constantSpeed;\n\t\t\t\tpath.worldVerticesLength = vertices.length;\n\t\t\t\tpath.vertices = vertices.vertices!;\n\t\t\t\tpath.bones = vertices.bones;\n\t\t\t\tpath.lengths = lengths;\n\t\t\t\tif (nonessential) Color.rgba8888ToColor(path.color, color);\n\t\t\t\treturn path;\n\t\t\t}\n\t\t\tcase AttachmentType.Point: {\n\t\t\t\tconst rotation = input.readFloat();\n\t\t\t\tconst x = input.readFloat();\n\t\t\t\tconst y = input.readFloat();\n\t\t\t\tconst color = nonessential ? input.readInt32() : 0;\n\n\t\t\t\tconst point = this.attachmentLoader.newPointAttachment(skin, name);\n\t\t\t\tif (!point) return null;\n\t\t\t\tpoint.x = x * scale;\n\t\t\t\tpoint.y = y * scale;\n\t\t\t\tpoint.rotation = rotation;\n\t\t\t\tif (nonessential) Color.rgba8888ToColor(point.color, color);\n\t\t\t\treturn point;\n\t\t\t}\n\t\t\tcase AttachmentType.Clipping: {\n\t\t\t\tconst endSlotIndex = input.readInt(true);\n\t\t\t\tconst vertices = this.readVertices(input, (flags & 16) != 0);\n\t\t\t\tlet color = nonessential ? input.readInt32() : 0;\n\n\t\t\t\tlet clip = this.attachmentLoader.newClippingAttachment(skin, name);\n\t\t\t\tif (!clip) return null;\n\t\t\t\tclip.endSlot = skeletonData.slots[endSlotIndex];\n\t\t\t\tclip.worldVerticesLength = vertices.length;\n\t\t\t\tclip.vertices = vertices.vertices!;\n\t\t\t\tclip.bones = vertices.bones;\n\t\t\t\tif (nonessential) Color.rgba8888ToColor(clip.color, color);\n\t\t\t\treturn clip;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate readSequence (input: BinaryInput) {\n\t\tlet sequence = new Sequence(input.readInt(true));\n\t\tsequence.start = input.readInt(true);\n\t\tsequence.digits = input.readInt(true);\n\t\tsequence.setupIndex = input.readInt(true);\n\t\treturn sequence;\n\t}\n\n\tprivate readVertices (input: BinaryInput, weighted: boolean): Vertices {\n\t\tconst scale = this.scale;\n\t\tconst vertexCount = input.readInt(true);\n\t\tconst vertices = new Vertices();\n\t\tvertices.length = vertexCount << 1;\n\t\tif (!weighted) {\n\t\t\tvertices.vertices = this.readFloatArray(input, vertices.length, scale);\n\t\t\treturn vertices;\n\t\t}\n\t\tlet weights = new Array<number>();\n\t\tlet bonesArray = new Array<number>();\n\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\tlet boneCount = input.readInt(true);\n\t\t\tbonesArray.push(boneCount);\n\t\t\tfor (let ii = 0; ii < boneCount; ii++) {\n\t\t\t\tbonesArray.push(input.readInt(true));\n\t\t\t\tweights.push(input.readFloat() * scale);\n\t\t\t\tweights.push(input.readFloat() * scale);\n\t\t\t\tweights.push(input.readFloat());\n\t\t\t}\n\t\t}\n\t\tvertices.vertices = Utils.toFloatArray(weights);\n\t\tvertices.bones = bonesArray;\n\t\treturn vertices;\n\t}\n\n\tprivate readFloatArray (input: BinaryInput, n: number, scale: number): number[] {\n\t\tlet array = new Array<number>(n);\n\t\tif (scale == 1) {\n\t\t\tfor (let i = 0; i < n; i++)\n\t\t\t\tarray[i] = input.readFloat();\n\t\t} else {\n\t\t\tfor (let i = 0; i < n; i++)\n\t\t\t\tarray[i] = input.readFloat() * scale;\n\t\t}\n\t\treturn array;\n\t}\n\n\tprivate readShortArray (input: BinaryInput, n: number): number[] {\n\t\tlet array = new Array<number>(n);\n\t\tfor (let i = 0; i < n; i++)\n\t\t\tarray[i] = input.readInt(true);\n\t\treturn array;\n\t}\n\n\tprivate readAnimation (input: BinaryInput, name: string, skeletonData: SkeletonData): Animation {\n\t\tinput.readInt(true); // Number of timelines.\n\t\tlet timelines = new Array<Timeline>();\n\t\tlet scale = this.scale;\n\n\t\t// Slot timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tlet slotIndex = input.readInt(true);\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tlet timelineType = input.readByte();\n\t\t\t\tlet frameCount = input.readInt(true);\n\t\t\t\tlet frameLast = frameCount - 1;\n\t\t\t\tswitch (timelineType) {\n\t\t\t\t\tcase SLOT_ATTACHMENT: {\n\t\t\t\t\t\tlet timeline = new AttachmentTimeline(frameCount, slotIndex);\n\t\t\t\t\t\tfor (let frame = 0; frame < frameCount; frame++)\n\t\t\t\t\t\t\ttimeline.setFrame(frame, input.readFloat(), input.readStringRef());\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase SLOT_RGBA: {\n\t\t\t\t\t\tlet bezierCount = input.readInt(true);\n\t\t\t\t\t\tlet timeline = new RGBATimeline(frameCount, bezierCount, slotIndex);\n\n\t\t\t\t\t\tlet time = input.readFloat();\n\t\t\t\t\t\tlet r = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet g = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet b = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet a = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, r, g, b, a);\n\t\t\t\t\t\t\tif (frame == frameLast) break;\n\n\t\t\t\t\t\t\tlet time2 = input.readFloat();\n\t\t\t\t\t\t\tlet r2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet g2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet b2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet a2 = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, r, r2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, g, g2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 2, time, time2, b, b2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 3, time, time2, a, a2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tr = r2;\n\t\t\t\t\t\t\tg = g2;\n\t\t\t\t\t\t\tb = b2;\n\t\t\t\t\t\t\ta = a2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase SLOT_RGB: {\n\t\t\t\t\t\tlet bezierCount = input.readInt(true);\n\t\t\t\t\t\tlet timeline = new RGBTimeline(frameCount, bezierCount, slotIndex);\n\n\t\t\t\t\t\tlet time = input.readFloat();\n\t\t\t\t\t\tlet r = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet g = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet b = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, r, g, b);\n\t\t\t\t\t\t\tif (frame == frameLast) break;\n\n\t\t\t\t\t\t\tlet time2 = input.readFloat();\n\t\t\t\t\t\t\tlet r2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet g2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet b2 = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, r, r2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, g, g2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 2, time, time2, b, b2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tr = r2;\n\t\t\t\t\t\t\tg = g2;\n\t\t\t\t\t\t\tb = b2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase SLOT_RGBA2: {\n\t\t\t\t\t\tlet bezierCount = input.readInt(true);\n\t\t\t\t\t\tlet timeline = new RGBA2Timeline(frameCount, bezierCount, slotIndex);\n\n\t\t\t\t\t\tlet time = input.readFloat();\n\t\t\t\t\t\tlet r = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet g = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet b = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet a = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet r2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet g2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet b2 = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, r, g, b, a, r2, g2, b2);\n\t\t\t\t\t\t\tif (frame == frameLast) break;\n\t\t\t\t\t\t\tlet time2 = input.readFloat();\n\t\t\t\t\t\t\tlet nr = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet ng = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet nb = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet na = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet nr2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet ng2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet nb2 = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, r, nr, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, g, ng, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 2, time, time2, b, nb, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 3, time, time2, a, na, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 4, time, time2, r2, nr2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 5, time, time2, g2, ng2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 6, time, time2, b2, nb2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tr = nr;\n\t\t\t\t\t\t\tg = ng;\n\t\t\t\t\t\t\tb = nb;\n\t\t\t\t\t\t\ta = na;\n\t\t\t\t\t\t\tr2 = nr2;\n\t\t\t\t\t\t\tg2 = ng2;\n\t\t\t\t\t\t\tb2 = nb2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase SLOT_RGB2: {\n\t\t\t\t\t\tlet bezierCount = input.readInt(true);\n\t\t\t\t\t\tlet timeline = new RGB2Timeline(frameCount, bezierCount, slotIndex);\n\n\t\t\t\t\t\tlet time = input.readFloat();\n\t\t\t\t\t\tlet r = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet g = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet b = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet r2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet g2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet b2 = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, r, g, b, r2, g2, b2);\n\t\t\t\t\t\t\tif (frame == frameLast) break;\n\t\t\t\t\t\t\tlet time2 = input.readFloat();\n\t\t\t\t\t\t\tlet nr = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet ng = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet nb = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet nr2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet ng2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet nb2 = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, r, nr, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, g, ng, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 2, time, time2, b, nb, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 3, time, time2, r2, nr2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 4, time, time2, g2, ng2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 5, time, time2, b2, nb2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tr = nr;\n\t\t\t\t\t\t\tg = ng;\n\t\t\t\t\t\t\tb = nb;\n\t\t\t\t\t\t\tr2 = nr2;\n\t\t\t\t\t\t\tg2 = ng2;\n\t\t\t\t\t\t\tb2 = nb2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase SLOT_ALPHA: {\n\t\t\t\t\t\tlet timeline = new AlphaTimeline(frameCount, input.readInt(true), slotIndex);\n\t\t\t\t\t\tlet time = input.readFloat(), a = input.readUnsignedByte() / 255;\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, a);\n\t\t\t\t\t\t\tif (frame == frameLast) break;\n\t\t\t\t\t\t\tlet time2 = input.readFloat();\n\t\t\t\t\t\t\tlet a2 = input.readUnsignedByte() / 255;\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, a, a2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\ta = a2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Bone timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tlet boneIndex = input.readInt(true);\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tlet type = input.readByte(), frameCount = input.readInt(true);\n\t\t\t\tif (type == BONE_INHERIT) {\n\t\t\t\t\tlet timeline = new InheritTimeline(frameCount, boneIndex);\n\t\t\t\t\tfor (let frame = 0; frame < frameCount; frame++) {\n\t\t\t\t\t\ttimeline.setFrame(frame, input.readFloat(), input.readByte());\n\t\t\t\t\t}\n\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tlet bezierCount = input.readInt(true);\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase BONE_ROTATE:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new RotateTimeline(frameCount, bezierCount, boneIndex), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_TRANSLATE:\n\t\t\t\t\t\ttimelines.push(readTimeline2(input, new TranslateTimeline(frameCount, bezierCount, boneIndex), scale));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_TRANSLATEX:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new TranslateXTimeline(frameCount, bezierCount, boneIndex), scale));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_TRANSLATEY:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new TranslateYTimeline(frameCount, bezierCount, boneIndex), scale));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_SCALE:\n\t\t\t\t\t\ttimelines.push(readTimeline2(input, new ScaleTimeline(frameCount, bezierCount, boneIndex), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_SCALEX:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new ScaleXTimeline(frameCount, bezierCount, boneIndex), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_SCALEY:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new ScaleYTimeline(frameCount, bezierCount, boneIndex), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_SHEAR:\n\t\t\t\t\t\ttimelines.push(readTimeline2(input, new ShearTimeline(frameCount, bezierCount, boneIndex), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_SHEARX:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new ShearXTimeline(frameCount, bezierCount, boneIndex), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_SHEARY:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new ShearYTimeline(frameCount, bezierCount, boneIndex), 1));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// IK constraint timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tlet index = input.readInt(true), frameCount = input.readInt(true), frameLast = frameCount - 1;\n\t\t\tlet timeline = new IkConstraintTimeline(frameCount, input.readInt(true), index);\n\t\t\tlet flags = input.readByte();\n\t\t\tlet time = input.readFloat(), mix = (flags & 1) != 0 ? ((flags & 2) != 0 ? input.readFloat() : 1) : 0;\n\t\t\tlet softness = (flags & 4) != 0 ? input.readFloat() * scale : 0;\n\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\ttimeline.setFrame(frame, time, mix, softness, (flags & 8) != 0 ? 1 : -1, (flags & 16) != 0, (flags & 32) != 0);\n\t\t\t\tif (frame == frameLast) break;\n\t\t\t\tflags = input.readByte();\n\t\t\t\tconst time2 = input.readFloat(), mix2 = (flags & 1) != 0 ? ((flags & 2) != 0 ? input.readFloat() : 1) : 0;\n\t\t\t\tconst softness2 = (flags & 4) != 0 ? input.readFloat() * scale : 0;\n\t\t\t\tif ((flags & 64) != 0) {\n\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t} else if ((flags & 128) != 0) {\n\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, mix, mix2, 1);\n\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, softness, softness2, scale);\n\t\t\t\t}\n\t\t\t\ttime = time2;\n\t\t\t\tmix = mix2;\n\t\t\t\tsoftness = softness2;\n\t\t\t}\n\t\t\ttimelines.push(timeline);\n\t\t}\n\n\t\t// Transform constraint timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tlet index = input.readInt(true), frameCount = input.readInt(true), frameLast = frameCount - 1;\n\t\t\tlet timeline = new TransformConstraintTimeline(frameCount, input.readInt(true), index);\n\t\t\tlet time = input.readFloat(), mixRotate = input.readFloat(), mixX = input.readFloat(), mixY = input.readFloat(),\n\t\t\t\tmixScaleX = input.readFloat(), mixScaleY = input.readFloat(), mixShearY = input.readFloat();\n\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\ttimeline.setFrame(frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY);\n\t\t\t\tif (frame == frameLast) break;\n\t\t\t\tlet time2 = input.readFloat(), mixRotate2 = input.readFloat(), mixX2 = input.readFloat(), mixY2 = input.readFloat(),\n\t\t\t\t\tmixScaleX2 = input.readFloat(), mixScaleY2 = input.readFloat(), mixShearY2 = input.readFloat();\n\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1);\n\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1);\n\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 2, time, time2, mixY, mixY2, 1);\n\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 3, time, time2, mixScaleX, mixScaleX2, 1);\n\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 4, time, time2, mixScaleY, mixScaleY2, 1);\n\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 5, time, time2, mixShearY, mixShearY2, 1);\n\t\t\t\t}\n\t\t\t\ttime = time2;\n\t\t\t\tmixRotate = mixRotate2;\n\t\t\t\tmixX = mixX2;\n\t\t\t\tmixY = mixY2;\n\t\t\t\tmixScaleX = mixScaleX2;\n\t\t\t\tmixScaleY = mixScaleY2;\n\t\t\t\tmixShearY = mixShearY2;\n\t\t\t}\n\t\t\ttimelines.push(timeline);\n\t\t}\n\n\t\t// Path constraint timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tlet index = input.readInt(true);\n\t\t\tlet data = skeletonData.pathConstraints[index];\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tconst type = input.readByte(), frameCount = input.readInt(true), bezierCount = input.readInt(true);\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase PATH_POSITION:\n\t\t\t\t\t\ttimelines\n\t\t\t\t\t\t\t.push(readTimeline1(input, new PathConstraintPositionTimeline(frameCount, bezierCount, index),\n\t\t\t\t\t\t\t\tdata.positionMode == PositionMode.Fixed ? scale : 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PATH_SPACING:\n\t\t\t\t\t\ttimelines\n\t\t\t\t\t\t\t.push(readTimeline1(input, new PathConstraintSpacingTimeline(frameCount, bezierCount, index),\n\t\t\t\t\t\t\t\tdata.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed ? scale : 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PATH_MIX:\n\t\t\t\t\t\tlet timeline = new PathConstraintMixTimeline(frameCount, bezierCount, index);\n\t\t\t\t\t\tlet time = input.readFloat(), mixRotate = input.readFloat(), mixX = input.readFloat(), mixY = input.readFloat();\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, mixRotate, mixX, mixY);\n\t\t\t\t\t\t\tif (frame == frameLast) break;\n\t\t\t\t\t\t\tlet time2 = input.readFloat(), mixRotate2 = input.readFloat(), mixX2 = input.readFloat(),\n\t\t\t\t\t\t\t\tmixY2 = input.readFloat();\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 2, time, time2, mixY, mixY2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tmixRotate = mixRotate2;\n\t\t\t\t\t\t\tmixX = mixX2;\n\t\t\t\t\t\t\tmixY = mixY2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Physics timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tconst index = input.readInt(true) - 1;\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tconst type = input.readByte(), frameCount = input.readInt(true);\n\t\t\t\tif (type == PHYSICS_RESET) {\n\t\t\t\t\tconst timeline = new PhysicsConstraintResetTimeline(frameCount, index);\n\t\t\t\t\tfor (let frame = 0; frame < frameCount; frame++)\n\t\t\t\t\t\ttimeline.setFrame(frame, input.readFloat());\n\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst bezierCount = input.readInt(true);\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase PHYSICS_INERTIA:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new PhysicsConstraintInertiaTimeline(frameCount, bezierCount, index), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PHYSICS_STRENGTH:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new PhysicsConstraintStrengthTimeline(frameCount, bezierCount, index), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PHYSICS_DAMPING:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new PhysicsConstraintDampingTimeline(frameCount, bezierCount, index), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PHYSICS_MASS:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new PhysicsConstraintMassTimeline(frameCount, bezierCount, index), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PHYSICS_WIND:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new PhysicsConstraintWindTimeline(frameCount, bezierCount, index), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PHYSICS_GRAVITY:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new PhysicsConstraintGravityTimeline(frameCount, bezierCount, index), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PHYSICS_MIX:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new PhysicsConstraintMixTimeline(frameCount, bezierCount, index), 1));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Deform timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tlet skin = skeletonData.skins[input.readInt(true)];\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tlet slotIndex = input.readInt(true);\n\t\t\t\tfor (let iii = 0, nnn = input.readInt(true); iii < nnn; iii++) {\n\t\t\t\t\tlet attachmentName = input.readStringRef();\n\t\t\t\t\tif (!attachmentName) throw new Error(\"attachmentName must not be null.\");\n\t\t\t\t\tlet attachment = skin.getAttachment(slotIndex, attachmentName);\n\t\t\t\t\tlet timelineType = input.readByte();\n\t\t\t\t\tlet frameCount = input.readInt(true);\n\t\t\t\t\tlet frameLast = frameCount - 1;\n\n\t\t\t\t\tswitch (timelineType) {\n\t\t\t\t\t\tcase ATTACHMENT_DEFORM: {\n\t\t\t\t\t\t\tlet vertexAttachment = attachment as VertexAttachment;\n\t\t\t\t\t\t\tlet weighted = vertexAttachment.bones;\n\t\t\t\t\t\t\tlet vertices = vertexAttachment.vertices;\n\t\t\t\t\t\t\tlet deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\n\n\n\t\t\t\t\t\t\tlet bezierCount = input.readInt(true);\n\t\t\t\t\t\t\tlet timeline = new DeformTimeline(frameCount, bezierCount, slotIndex, vertexAttachment);\n\n\t\t\t\t\t\t\tlet time = input.readFloat();\n\t\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\t\tlet deform;\n\t\t\t\t\t\t\t\tlet end = input.readInt(true);\n\t\t\t\t\t\t\t\tif (end == 0)\n\t\t\t\t\t\t\t\t\tdeform = weighted ? Utils.newFloatArray(deformLength) : vertices;\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tdeform = Utils.newFloatArray(deformLength);\n\t\t\t\t\t\t\t\t\tlet start = input.readInt(true);\n\t\t\t\t\t\t\t\t\tend += start;\n\t\t\t\t\t\t\t\t\tif (scale == 1) {\n\t\t\t\t\t\t\t\t\t\tfor (let v = start; v < end; v++)\n\t\t\t\t\t\t\t\t\t\t\tdeform[v] = input.readFloat();\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tfor (let v = start; v < end; v++)\n\t\t\t\t\t\t\t\t\t\t\tdeform[v] = input.readFloat() * scale;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (!weighted) {\n\t\t\t\t\t\t\t\t\t\tfor (let v = 0, vn = deform.length; v < vn; v++)\n\t\t\t\t\t\t\t\t\t\t\tdeform[v] += vertices[v];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\ttimeline.setFrame(frame, time, deform);\n\t\t\t\t\t\t\t\tif (frame == frameLast) break;\n\t\t\t\t\t\t\t\tlet time2 = input.readFloat();\n\t\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, 0, 1, 1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase ATTACHMENT_SEQUENCE: {\n\t\t\t\t\t\t\tlet timeline = new SequenceTimeline(frameCount, slotIndex, attachment as unknown as HasTextureRegion);\n\t\t\t\t\t\t\tfor (let frame = 0; frame < frameCount; frame++) {\n\t\t\t\t\t\t\t\tlet time = input.readFloat();\n\t\t\t\t\t\t\t\tlet modeAndIndex = input.readInt32();\n\t\t\t\t\t\t\t\ttimeline.setFrame(frame, time, SequenceModeValues[modeAndIndex & 0xf], modeAndIndex >> 4,\n\t\t\t\t\t\t\t\t\tinput.readFloat());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Draw order timeline.\n\t\tlet drawOrderCount = input.readInt(true);\n\t\tif (drawOrderCount > 0) {\n\t\t\tlet timeline = new DrawOrderTimeline(drawOrderCount);\n\t\t\tlet slotCount = skeletonData.slots.length;\n\t\t\tfor (let i = 0; i < drawOrderCount; i++) {\n\t\t\t\tlet time = input.readFloat();\n\t\t\t\tlet offsetCount = input.readInt(true);\n\t\t\t\tlet drawOrder = Utils.newArray(slotCount, 0);\n\t\t\t\tfor (let ii = slotCount - 1; ii >= 0; ii--)\n\t\t\t\t\tdrawOrder[ii] = -1;\n\t\t\t\tlet unchanged = Utils.newArray(slotCount - offsetCount, 0);\n\t\t\t\tlet originalIndex = 0, unchangedIndex = 0;\n\t\t\t\tfor (let ii = 0; ii < offsetCount; ii++) {\n\t\t\t\t\tlet slotIndex = input.readInt(true);\n\t\t\t\t\t// Collect unchanged items.\n\t\t\t\t\twhile (originalIndex != slotIndex)\n\t\t\t\t\t\tunchanged[unchangedIndex++] = originalIndex++;\n\t\t\t\t\t// Set changed items.\n\t\t\t\t\tdrawOrder[originalIndex + input.readInt(true)] = originalIndex++;\n\t\t\t\t}\n\t\t\t\t// Collect remaining unchanged items.\n\t\t\t\twhile (originalIndex < slotCount)\n\t\t\t\t\tunchanged[unchangedIndex++] = originalIndex++;\n\t\t\t\t// Fill in unchanged items.\n\t\t\t\tfor (let ii = slotCount - 1; ii >= 0; ii--)\n\t\t\t\t\tif (drawOrder[ii] == -1) drawOrder[ii] = unchanged[--unchangedIndex];\n\t\t\t\ttimeline.setFrame(i, time, drawOrder);\n\t\t\t}\n\t\t\ttimelines.push(timeline);\n\t\t}\n\n\t\t// Event timeline.\n\t\tlet eventCount = input.readInt(true);\n\t\tif (eventCount > 0) {\n\t\t\tlet timeline = new EventTimeline(eventCount);\n\t\t\tfor (let i = 0; i < eventCount; i++) {\n\t\t\t\tlet time = input.readFloat();\n\t\t\t\tlet eventData = skeletonData.events[input.readInt(true)];\n\t\t\t\tlet event = new Event(time, eventData);\n\t\t\t\tevent.intValue = input.readInt(false);\n\t\t\t\tevent.floatValue = input.readFloat();\n\t\t\t\tevent.stringValue = input.readString();\n\t\t\t\tif (event.stringValue == null) event.stringValue = eventData.stringValue;\n\t\t\t\tif (event.data.audioPath) {\n\t\t\t\t\tevent.volume = input.readFloat();\n\t\t\t\t\tevent.balance = input.readFloat();\n\t\t\t\t}\n\t\t\t\ttimeline.setFrame(i, event);\n\t\t\t}\n\t\t\ttimelines.push(timeline);\n\t\t}\n\n\t\tlet duration = 0;\n\t\tfor (let i = 0, n = timelines.length; i < n; i++)\n\t\t\tduration = Math.max(duration, timelines[i].getDuration());\n\t\treturn new Animation(name, timelines, duration);\n\t}\n}\n\nexport class BinaryInput {\n\tconstructor (data: Uint8Array | ArrayBuffer, public strings = new Array<string>(), private index: number = 0, private buffer = new DataView(data instanceof ArrayBuffer ? data : data.buffer)) {\n\t}\n\n\treadByte (): number {\n\t\treturn this.buffer.getInt8(this.index++);\n\t}\n\n\treadUnsignedByte (): number {\n\t\treturn this.buffer.getUint8(this.index++);\n\t}\n\n\treadShort (): number {\n\t\tlet value = this.buffer.getInt16(this.index);\n\t\tthis.index += 2;\n\t\treturn value;\n\t}\n\n\treadInt32 (): number {\n\t\tlet value = this.buffer.getInt32(this.index)\n\t\tthis.index += 4;\n\t\treturn value;\n\t}\n\n\treadInt (optimizePositive: boolean) {\n\t\tlet b = this.readByte();\n\t\tlet result = b & 0x7F;\n\t\tif ((b & 0x80) != 0) {\n\t\t\tb = this.readByte();\n\t\t\tresult |= (b & 0x7F) << 7;\n\t\t\tif ((b & 0x80) != 0) {\n\t\t\t\tb = this.readByte();\n\t\t\t\tresult |= (b & 0x7F) << 14;\n\t\t\t\tif ((b & 0x80) != 0) {\n\t\t\t\t\tb = this.readByte();\n\t\t\t\t\tresult |= (b & 0x7F) << 21;\n\t\t\t\t\tif ((b & 0x80) != 0) {\n\t\t\t\t\t\tb = this.readByte();\n\t\t\t\t\t\tresult |= (b & 0x7F) << 28;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn optimizePositive ? result : ((result >>> 1) ^ -(result & 1));\n\t}\n\n\treadStringRef (): string | null {\n\t\tlet index = this.readInt(true);\n\t\treturn index == 0 ? null : this.strings[index - 1];\n\t}\n\n\treadString (): string | null {\n\t\tlet byteCount = this.readInt(true);\n\t\tswitch (byteCount) {\n\t\t\tcase 0:\n\t\t\t\treturn null;\n\t\t\tcase 1:\n\t\t\t\treturn \"\";\n\t\t}\n\t\tbyteCount--;\n\t\tlet chars = \"\";\n\t\tlet charCount = 0;\n\t\tfor (let i = 0; i < byteCount;) {\n\t\t\tlet b = this.readUnsignedByte();\n\t\t\tswitch (b >> 4) {\n\t\t\t\tcase 12:\n\t\t\t\tcase 13:\n\t\t\t\t\tchars += String.fromCharCode(((b & 0x1F) << 6 | this.readByte() & 0x3F));\n\t\t\t\t\ti += 2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 14:\n\t\t\t\t\tchars += String.fromCharCode(((b & 0x0F) << 12 | (this.readByte() & 0x3F) << 6 | this.readByte() & 0x3F));\n\t\t\t\t\ti += 3;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tchars += String.fromCharCode(b);\n\t\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\treturn chars;\n\t}\n\n\treadFloat (): number {\n\t\tlet value = this.buffer.getFloat32(this.index);\n\t\tthis.index += 4;\n\t\treturn value;\n\t}\n\n\treadBoolean (): boolean {\n\t\treturn this.readByte() != 0;\n\t}\n}\n\nclass LinkedMesh {\n\tparent: string | null; skinIndex: number;\n\tslotIndex: number;\n\tmesh: MeshAttachment;\n\tinheritTimeline: boolean;\n\n\tconstructor (mesh: MeshAttachment, skinIndex: number, slotIndex: number, parent: string | null, inheritDeform: boolean) {\n\t\tthis.mesh = mesh;\n\t\tthis.skinIndex = skinIndex;\n\t\tthis.slotIndex = slotIndex;\n\t\tthis.parent = parent;\n\t\tthis.inheritTimeline = inheritDeform;\n\t}\n}\n\nclass Vertices {\n\tconstructor (public bones: Array<number> | null = null, public vertices: Array<number> | Float32Array | null = null, public length: number = 0) { }\n}\n\nenum AttachmentType { Region, BoundingBox, Mesh, LinkedMesh, Path, Point, Clipping }\n\nfunction readTimeline1 (input: BinaryInput, timeline: CurveTimeline1, scale: number): CurveTimeline1 {\n\tlet time = input.readFloat(), value = input.readFloat() * scale;\n\tfor (let frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1; ; frame++) {\n\t\ttimeline.setFrame(frame, time, value);\n\t\tif (frame == frameLast) break;\n\t\tlet time2 = input.readFloat(), value2 = input.readFloat() * scale;\n\t\tswitch (input.readByte()) {\n\t\t\tcase CURVE_STEPPED:\n\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\tbreak;\n\t\t\tcase CURVE_BEZIER:\n\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, value, value2, scale);\n\t\t}\n\t\ttime = time2;\n\t\tvalue = value2;\n\t}\n\treturn timeline;\n}\n\nfunction readTimeline2 (input: BinaryInput, timeline: CurveTimeline2, scale: number): CurveTimeline2 {\n\tlet time = input.readFloat(), value1 = input.readFloat() * scale, value2 = input.readFloat() * scale;\n\tfor (let frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1; ; frame++) {\n\t\ttimeline.setFrame(frame, time, value1, value2);\n\t\tif (frame == frameLast) break;\n\t\tlet time2 = input.readFloat(), nvalue1 = input.readFloat() * scale, nvalue2 = input.readFloat() * scale;\n\t\tswitch (input.readByte()) {\n\t\t\tcase CURVE_STEPPED:\n\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\tbreak;\n\t\t\tcase CURVE_BEZIER:\n\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, value1, nvalue1, scale);\n\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, value2, nvalue2, scale);\n\t\t}\n\t\ttime = time2;\n\t\tvalue1 = nvalue1;\n\t\tvalue2 = nvalue2;\n\t}\n\treturn timeline;\n}\n\nfunction setBezier (input: BinaryInput, timeline: CurveTimeline, bezier: number, frame: number, value: number,\n\ttime1: number, time2: number, value1: number, value2: number, scale: number) {\n\ttimeline.setBezier(bezier, frame, value, time1, value1, input.readFloat(), input.readFloat() * scale, input.readFloat(), input.readFloat() * scale, time2, value2);\n}\n\nconst BONE_ROTATE = 0;\nconst BONE_TRANSLATE = 1;\nconst BONE_TRANSLATEX = 2;\nconst BONE_TRANSLATEY = 3;\nconst BONE_SCALE = 4;\nconst BONE_SCALEX = 5;\nconst BONE_SCALEY = 6;\nconst BONE_SHEAR = 7;\nconst BONE_SHEARX = 8;\nconst BONE_SHEARY = 9;\nconst BONE_INHERIT = 10;\n\nconst SLOT_ATTACHMENT = 0;\nconst SLOT_RGBA = 1;\nconst SLOT_RGB = 2;\nconst SLOT_RGBA2 = 3;\nconst SLOT_RGB2 = 4;\nconst SLOT_ALPHA = 5;\n\nconst ATTACHMENT_DEFORM = 0;\nconst ATTACHMENT_SEQUENCE = 1;\n\nconst PATH_POSITION = 0;\nconst PATH_SPACING = 1;\nconst PATH_MIX = 2;\n\nconst PHYSICS_INERTIA = 0;\nconst PHYSICS_STRENGTH = 1;\nconst PHYSICS_DAMPING = 2;\nconst PHYSICS_MASS = 4;\nconst PHYSICS_WIND = 5;\nconst PHYSICS_GRAVITY = 6;\nconst PHYSICS_MIX = 7;\nconst PHYSICS_RESET = 8;\n\nconst CURVE_LINEAR = 0;\nconst CURVE_STEPPED = 1;\nconst CURVE_BEZIER = 2;\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BoundingBoxAttachment } from \"./attachments/BoundingBoxAttachment.js\";\nimport { Skeleton } from \"./Skeleton.js\";\nimport { NumberArrayLike, Pool, Utils } from \"./Utils.js\";\n\n/** Collects each visible {@link BoundingBoxAttachment} and computes the world vertices for its polygon. The polygon vertices are\n * provided along with convenience methods for doing hit detection. */\nexport class SkeletonBounds {\n\n\t/** The left edge of the axis aligned bounding box. */\n\tminX = 0;\n\n\t/** The bottom edge of the axis aligned bounding box. */\n\tminY = 0;\n\n\t/** The right edge of the axis aligned bounding box. */\n\tmaxX = 0;\n\n\t/** The top edge of the axis aligned bounding box. */\n\tmaxY = 0;\n\n\t/** The visible bounding boxes. */\n\tboundingBoxes = new Array<BoundingBoxAttachment>();\n\n\t/** The world vertices for the bounding box polygons. */\n\tpolygons = new Array<NumberArrayLike>();\n\n\tprivate polygonPool = new Pool<NumberArrayLike>(() => {\n\t\treturn Utils.newFloatArray(16);\n\t});\n\n\t/** Clears any previous polygons, finds all visible bounding box attachments, and computes the world vertices for each bounding\n\t * box's polygon.\n\t * @param updateAabb If true, the axis aligned bounding box containing all the polygons is computed. If false, the\n\t * SkeletonBounds AABB methods will always return true. */\n\tupdate (skeleton: Skeleton, updateAabb: boolean) {\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\t\tlet boundingBoxes = this.boundingBoxes;\n\t\tlet polygons = this.polygons;\n\t\tlet polygonPool = this.polygonPool;\n\t\tlet slots = skeleton.slots;\n\t\tlet slotCount = slots.length;\n\n\t\tboundingBoxes.length = 0;\n\t\tpolygonPool.freeAll(polygons);\n\t\tpolygons.length = 0;\n\n\t\tfor (let i = 0; i < slotCount; i++) {\n\t\t\tlet slot = slots[i];\n\t\t\tif (!slot.bone.active) continue;\n\t\t\tlet attachment = slot.getAttachment();\n\t\t\tif (attachment instanceof BoundingBoxAttachment) {\n\t\t\t\tlet boundingBox = attachment as BoundingBoxAttachment;\n\t\t\t\tboundingBoxes.push(boundingBox);\n\n\t\t\t\tlet polygon = polygonPool.obtain();\n\t\t\t\tif (polygon.length != boundingBox.worldVerticesLength) {\n\t\t\t\t\tpolygon = Utils.newFloatArray(boundingBox.worldVerticesLength);\n\t\t\t\t}\n\t\t\t\tpolygons.push(polygon);\n\t\t\t\tboundingBox.computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2);\n\t\t\t}\n\t\t}\n\n\t\tif (updateAabb) {\n\t\t\tthis.aabbCompute();\n\t\t} else {\n\t\t\tthis.minX = Number.POSITIVE_INFINITY;\n\t\t\tthis.minY = Number.POSITIVE_INFINITY;\n\t\t\tthis.maxX = Number.NEGATIVE_INFINITY;\n\t\t\tthis.maxY = Number.NEGATIVE_INFINITY;\n\t\t}\n\t}\n\n\taabbCompute () {\n\t\tlet minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\n\t\tlet polygons = this.polygons;\n\t\tfor (let i = 0, n = polygons.length; i < n; i++) {\n\t\t\tlet polygon = polygons[i];\n\t\t\tlet vertices = polygon;\n\t\t\tfor (let ii = 0, nn = polygon.length; ii < nn; ii += 2) {\n\t\t\t\tlet x = vertices[ii];\n\t\t\t\tlet y = vertices[ii + 1];\n\t\t\t\tminX = Math.min(minX, x);\n\t\t\t\tminY = Math.min(minY, y);\n\t\t\t\tmaxX = Math.max(maxX, x);\n\t\t\t\tmaxY = Math.max(maxY, y);\n\t\t\t}\n\t\t}\n\t\tthis.minX = minX;\n\t\tthis.minY = minY;\n\t\tthis.maxX = maxX;\n\t\tthis.maxY = maxY;\n\t}\n\n\t/** Returns true if the axis aligned bounding box contains the point. */\n\taabbContainsPoint (x: number, y: number) {\n\t\treturn x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY;\n\t}\n\n\t/** Returns true if the axis aligned bounding box intersects the line segment. */\n\taabbIntersectsSegment (x1: number, y1: number, x2: number, y2: number) {\n\t\tlet minX = this.minX;\n\t\tlet minY = this.minY;\n\t\tlet maxX = this.maxX;\n\t\tlet maxY = this.maxY;\n\t\tif ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY))\n\t\t\treturn false;\n\t\tlet m = (y2 - y1) / (x2 - x1);\n\t\tlet y = m * (minX - x1) + y1;\n\t\tif (y > minY && y < maxY) return true;\n\t\ty = m * (maxX - x1) + y1;\n\t\tif (y > minY && y < maxY) return true;\n\t\tlet x = (minY - y1) / m + x1;\n\t\tif (x > minX && x < maxX) return true;\n\t\tx = (maxY - y1) / m + x1;\n\t\tif (x > minX && x < maxX) return true;\n\t\treturn false;\n\t}\n\n\t/** Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. */\n\taabbIntersectsSkeleton (bounds: SkeletonBounds) {\n\t\treturn this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY;\n\t}\n\n\t/** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more\n\t * efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true. */\n\tcontainsPoint (x: number, y: number): BoundingBoxAttachment | null {\n\t\tlet polygons = this.polygons;\n\t\tfor (let i = 0, n = polygons.length; i < n; i++)\n\t\t\tif (this.containsPointPolygon(polygons[i], x, y)) return this.boundingBoxes[i];\n\t\treturn null;\n\t}\n\n\t/** Returns true if the polygon contains the point. */\n\tcontainsPointPolygon (polygon: NumberArrayLike, x: number, y: number) {\n\t\tlet vertices = polygon;\n\t\tlet nn = polygon.length;\n\n\t\tlet prevIndex = nn - 2;\n\t\tlet inside = false;\n\t\tfor (let ii = 0; ii < nn; ii += 2) {\n\t\t\tlet vertexY = vertices[ii + 1];\n\t\t\tlet prevY = vertices[prevIndex + 1];\n\t\t\tif ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) {\n\t\t\t\tlet vertexX = vertices[ii];\n\t\t\t\tif (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x) inside = !inside;\n\t\t\t}\n\t\t\tprevIndex = ii;\n\t\t}\n\t\treturn inside;\n\t}\n\n\t/** Returns the first bounding box attachment that contains any part of the line segment, or null. When doing many checks, it\n\t * is usually more efficient to only call this method if {@link #aabbIntersectsSegment()} returns\n\t * true. */\n\tintersectsSegment (x1: number, y1: number, x2: number, y2: number) {\n\t\tlet polygons = this.polygons;\n\t\tfor (let i = 0, n = polygons.length; i < n; i++)\n\t\t\tif (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2)) return this.boundingBoxes[i];\n\t\treturn null;\n\t}\n\n\t/** Returns true if the polygon contains any part of the line segment. */\n\tintersectsSegmentPolygon (polygon: NumberArrayLike, x1: number, y1: number, x2: number, y2: number) {\n\t\tlet vertices = polygon;\n\t\tlet nn = polygon.length;\n\n\t\tlet width12 = x1 - x2, height12 = y1 - y2;\n\t\tlet det1 = x1 * y2 - y1 * x2;\n\t\tlet x3 = vertices[nn - 2], y3 = vertices[nn - 1];\n\t\tfor (let ii = 0; ii < nn; ii += 2) {\n\t\t\tlet x4 = vertices[ii], y4 = vertices[ii + 1];\n\t\t\tlet det2 = x3 * y4 - y3 * x4;\n\t\t\tlet width34 = x3 - x4, height34 = y3 - y4;\n\t\t\tlet det3 = width12 * height34 - height12 * width34;\n\t\t\tlet x = (det1 * width34 - width12 * det2) / det3;\n\t\t\tif (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) {\n\t\t\t\tlet y = (det1 * height34 - height12 * det2) / det3;\n\t\t\t\tif (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) return true;\n\t\t\t}\n\t\t\tx3 = x4;\n\t\t\ty3 = y4;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/** Returns the polygon for the specified bounding box, or null. */\n\tgetPolygon (boundingBox: BoundingBoxAttachment) {\n\t\tif (!boundingBox) throw new Error(\"boundingBox cannot be null.\");\n\t\tlet index = this.boundingBoxes.indexOf(boundingBox);\n\t\treturn index == -1 ? null : this.polygons[index];\n\t}\n\n\t/** The width of the axis aligned bounding box. */\n\tgetWidth () {\n\t\treturn this.maxX - this.minX;\n\t}\n\n\t/** The height of the axis aligned bounding box. */\n\tgetHeight () {\n\t\treturn this.maxY - this.minY;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { NumberArrayLike, Pool } from \"./Utils.js\";\n\nexport class Triangulator {\n\tprivate convexPolygons = new Array<Array<number>>();\n\tprivate convexPolygonsIndices = new Array<Array<number>>();\n\n\tprivate indicesArray = new Array<number>();\n\tprivate isConcaveArray = new Array<boolean>();\n\tprivate triangles = new Array<number>();\n\n\tprivate polygonPool = new Pool<Array<number>>(() => {\n\t\treturn new Array<number>();\n\t});\n\n\tprivate polygonIndicesPool = new Pool<Array<number>>(() => {\n\t\treturn new Array<number>();\n\t});\n\n\tpublic triangulate (verticesArray: NumberArrayLike): Array<number> {\n\t\tlet vertices = verticesArray;\n\t\tlet vertexCount = verticesArray.length >> 1;\n\n\t\tlet indices = this.indicesArray;\n\t\tindices.length = 0;\n\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\tindices[i] = i;\n\n\t\tlet isConcave = this.isConcaveArray;\n\t\tisConcave.length = 0;\n\t\tfor (let i = 0, n = vertexCount; i < n; ++i)\n\t\t\tisConcave[i] = Triangulator.isConcave(i, vertexCount, vertices, indices);\n\n\t\tlet triangles = this.triangles;\n\t\ttriangles.length = 0;\n\n\t\twhile (vertexCount > 3) {\n\t\t\t// Find ear tip.\n\t\t\tlet previous = vertexCount - 1, i = 0, next = 1;\n\t\t\twhile (true) {\n\t\t\t\touter:\n\t\t\t\tif (!isConcave[i]) {\n\t\t\t\t\tlet p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1;\n\t\t\t\t\tlet p1x = vertices[p1], p1y = vertices[p1 + 1];\n\t\t\t\t\tlet p2x = vertices[p2], p2y = vertices[p2 + 1];\n\t\t\t\t\tlet p3x = vertices[p3], p3y = vertices[p3 + 1];\n\t\t\t\t\tfor (let ii = (next + 1) % vertexCount; ii != previous; ii = (ii + 1) % vertexCount) {\n\t\t\t\t\t\tif (!isConcave[ii]) continue;\n\t\t\t\t\t\tlet v = indices[ii] << 1;\n\t\t\t\t\t\tlet vx = vertices[v], vy = vertices[v + 1];\n\t\t\t\t\t\tif (Triangulator.positiveArea(p3x, p3y, p1x, p1y, vx, vy)) {\n\t\t\t\t\t\t\tif (Triangulator.positiveArea(p1x, p1y, p2x, p2y, vx, vy)) {\n\t\t\t\t\t\t\t\tif (Triangulator.positiveArea(p2x, p2y, p3x, p3y, vx, vy)) break outer;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (next == 0) {\n\t\t\t\t\tdo {\n\t\t\t\t\t\tif (!isConcave[i]) break;\n\t\t\t\t\t\ti--;\n\t\t\t\t\t} while (i > 0);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tprevious = i;\n\t\t\t\ti = next;\n\t\t\t\tnext = (next + 1) % vertexCount;\n\t\t\t}\n\n\t\t\t// Cut ear tip.\n\t\t\ttriangles.push(indices[(vertexCount + i - 1) % vertexCount]);\n\t\t\ttriangles.push(indices[i]);\n\t\t\ttriangles.push(indices[(i + 1) % vertexCount]);\n\t\t\tindices.splice(i, 1);\n\t\t\tisConcave.splice(i, 1);\n\t\t\tvertexCount--;\n\n\t\t\tlet previousIndex = (vertexCount + i - 1) % vertexCount;\n\t\t\tlet nextIndex = i == vertexCount ? 0 : i;\n\t\t\tisConcave[previousIndex] = Triangulator.isConcave(previousIndex, vertexCount, vertices, indices);\n\t\t\tisConcave[nextIndex] = Triangulator.isConcave(nextIndex, vertexCount, vertices, indices);\n\t\t}\n\n\t\tif (vertexCount == 3) {\n\t\t\ttriangles.push(indices[2]);\n\t\t\ttriangles.push(indices[0]);\n\t\t\ttriangles.push(indices[1]);\n\t\t}\n\n\t\treturn triangles;\n\t}\n\n\tdecompose (verticesArray: Array<number>, triangles: Array<number>): Array<Array<number>> {\n\t\tlet vertices = verticesArray;\n\t\tlet convexPolygons = this.convexPolygons;\n\t\tthis.polygonPool.freeAll(convexPolygons);\n\t\tconvexPolygons.length = 0;\n\n\t\tlet convexPolygonsIndices = this.convexPolygonsIndices;\n\t\tthis.polygonIndicesPool.freeAll(convexPolygonsIndices);\n\t\tconvexPolygonsIndices.length = 0;\n\n\t\tlet polygonIndices = this.polygonIndicesPool.obtain();\n\t\tpolygonIndices.length = 0;\n\n\t\tlet polygon = this.polygonPool.obtain();\n\t\tpolygon.length = 0;\n\n\t\t// Merge subsequent triangles if they form a triangle fan.\n\t\tlet fanBaseIndex = -1, lastWinding = 0;\n\t\tfor (let i = 0, n = triangles.length; i < n; i += 3) {\n\t\t\tlet t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1;\n\t\t\tlet x1 = vertices[t1], y1 = vertices[t1 + 1];\n\t\t\tlet x2 = vertices[t2], y2 = vertices[t2 + 1];\n\t\t\tlet x3 = vertices[t3], y3 = vertices[t3 + 1];\n\n\t\t\t// If the base of the last triangle is the same as this triangle, check if they form a convex polygon (triangle fan).\n\t\t\tlet merged = false;\n\t\t\tif (fanBaseIndex == t1) {\n\t\t\t\tlet o = polygon.length - 4;\n\t\t\t\tlet winding1 = Triangulator.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3);\n\t\t\t\tlet winding2 = Triangulator.winding(x3, y3, polygon[0], polygon[1], polygon[2], polygon[3]);\n\t\t\t\tif (winding1 == lastWinding && winding2 == lastWinding) {\n\t\t\t\t\tpolygon.push(x3);\n\t\t\t\t\tpolygon.push(y3);\n\t\t\t\t\tpolygonIndices.push(t3);\n\t\t\t\t\tmerged = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Otherwise make this triangle the new base.\n\t\t\tif (!merged) {\n\t\t\t\tif (polygon.length > 0) {\n\t\t\t\t\tconvexPolygons.push(polygon);\n\t\t\t\t\tconvexPolygonsIndices.push(polygonIndices);\n\t\t\t\t} else {\n\t\t\t\t\tthis.polygonPool.free(polygon)\n\t\t\t\t\tthis.polygonIndicesPool.free(polygonIndices);\n\t\t\t\t}\n\t\t\t\tpolygon = this.polygonPool.obtain();\n\t\t\t\tpolygon.length = 0;\n\t\t\t\tpolygon.push(x1);\n\t\t\t\tpolygon.push(y1);\n\t\t\t\tpolygon.push(x2);\n\t\t\t\tpolygon.push(y2);\n\t\t\t\tpolygon.push(x3);\n\t\t\t\tpolygon.push(y3);\n\t\t\t\tpolygonIndices = this.polygonIndicesPool.obtain();\n\t\t\t\tpolygonIndices.length = 0;\n\t\t\t\tpolygonIndices.push(t1);\n\t\t\t\tpolygonIndices.push(t2);\n\t\t\t\tpolygonIndices.push(t3);\n\t\t\t\tlastWinding = Triangulator.winding(x1, y1, x2, y2, x3, y3);\n\t\t\t\tfanBaseIndex = t1;\n\t\t\t}\n\t\t}\n\n\t\tif (polygon.length > 0) {\n\t\t\tconvexPolygons.push(polygon);\n\t\t\tconvexPolygonsIndices.push(polygonIndices);\n\t\t}\n\n\t\t// Go through the list of polygons and try to merge the remaining triangles with the found triangle fans.\n\t\tfor (let i = 0, n = convexPolygons.length; i < n; i++) {\n\t\t\tpolygonIndices = convexPolygonsIndices[i];\n\t\t\tif (polygonIndices.length == 0) continue;\n\t\t\tlet firstIndex = polygonIndices[0];\n\t\t\tlet lastIndex = polygonIndices[polygonIndices.length - 1];\n\n\t\t\tpolygon = convexPolygons[i];\n\t\t\tlet o = polygon.length - 4;\n\t\t\tlet prevPrevX = polygon[o], prevPrevY = polygon[o + 1];\n\t\t\tlet prevX = polygon[o + 2], prevY = polygon[o + 3];\n\t\t\tlet firstX = polygon[0], firstY = polygon[1];\n\t\t\tlet secondX = polygon[2], secondY = polygon[3];\n\t\t\tlet winding = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY);\n\n\t\t\tfor (let ii = 0; ii < n; ii++) {\n\t\t\t\tif (ii == i) continue;\n\t\t\t\tlet otherIndices = convexPolygonsIndices[ii];\n\t\t\t\tif (otherIndices.length != 3) continue;\n\t\t\t\tlet otherFirstIndex = otherIndices[0];\n\t\t\t\tlet otherSecondIndex = otherIndices[1];\n\t\t\t\tlet otherLastIndex = otherIndices[2];\n\n\t\t\t\tlet otherPoly = convexPolygons[ii];\n\t\t\t\tlet x3 = otherPoly[otherPoly.length - 2], y3 = otherPoly[otherPoly.length - 1];\n\n\t\t\t\tif (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex) continue;\n\t\t\t\tlet winding1 = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3);\n\t\t\t\tlet winding2 = Triangulator.winding(x3, y3, firstX, firstY, secondX, secondY);\n\t\t\t\tif (winding1 == winding && winding2 == winding) {\n\t\t\t\t\totherPoly.length = 0;\n\t\t\t\t\totherIndices.length = 0;\n\t\t\t\t\tpolygon.push(x3);\n\t\t\t\t\tpolygon.push(y3);\n\t\t\t\t\tpolygonIndices.push(otherLastIndex);\n\t\t\t\t\tprevPrevX = prevX;\n\t\t\t\t\tprevPrevY = prevY;\n\t\t\t\t\tprevX = x3;\n\t\t\t\t\tprevY = y3;\n\t\t\t\t\tii = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove empty polygons that resulted from the merge step above.\n\t\tfor (let i = convexPolygons.length - 1; i >= 0; i--) {\n\t\t\tpolygon = convexPolygons[i];\n\t\t\tif (polygon.length == 0) {\n\t\t\t\tconvexPolygons.splice(i, 1);\n\t\t\t\tthis.polygonPool.free(polygon);\n\t\t\t\tpolygonIndices = convexPolygonsIndices[i]\n\t\t\t\tconvexPolygonsIndices.splice(i, 1)\n\t\t\t\tthis.polygonIndicesPool.free(polygonIndices);\n\t\t\t}\n\t\t}\n\n\t\treturn convexPolygons;\n\t}\n\n\tprivate static isConcave (index: number, vertexCount: number, vertices: NumberArrayLike, indices: NumberArrayLike): boolean {\n\t\tlet previous = indices[(vertexCount + index - 1) % vertexCount] << 1;\n\t\tlet current = indices[index] << 1;\n\t\tlet next = indices[(index + 1) % vertexCount] << 1;\n\t\treturn !this.positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next],\n\t\t\tvertices[next + 1]);\n\t}\n\n\tprivate static positiveArea (p1x: number, p1y: number, p2x: number, p2y: number, p3x: number, p3y: number): boolean {\n\t\treturn p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0;\n\t}\n\n\tprivate static winding (p1x: number, p1y: number, p2x: number, p2y: number, p3x: number, p3y: number): number {\n\t\tlet px = p2x - p1x, py = p2y - p1y;\n\t\treturn p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { ClippingAttachment } from \"./attachments/ClippingAttachment.js\";\nimport { Slot } from \"./Slot.js\";\nimport { Triangulator } from \"./Triangulator.js\";\nimport { Utils, Color, NumberArrayLike } from \"./Utils.js\";\n\nexport class SkeletonClipping {\n\tprivate triangulator = new Triangulator();\n\tprivate clippingPolygon = new Array<number>();\n\tprivate clipOutput = new Array<number>();\n\tclippedVertices = new Array<number>();\n\tclippedUVs = new Array<number>();\n\tclippedTriangles = new Array<number>();\n\tprivate scratch = new Array<number>();\n\n\tprivate clipAttachment: ClippingAttachment | null = null;\n\tprivate clippingPolygons: Array<Array<number>> | null = null;\n\n\tclipStart (slot: Slot, clip: ClippingAttachment): number {\n\t\tif (this.clipAttachment) return 0;\n\t\tthis.clipAttachment = clip;\n\n\t\tlet n = clip.worldVerticesLength;\n\t\tlet vertices = Utils.setArraySize(this.clippingPolygon, n);\n\t\tclip.computeWorldVertices(slot, 0, n, vertices, 0, 2);\n\t\tlet clippingPolygon = this.clippingPolygon;\n\t\tSkeletonClipping.makeClockwise(clippingPolygon);\n\t\tlet clippingPolygons = this.clippingPolygons = this.triangulator.decompose(clippingPolygon, this.triangulator.triangulate(clippingPolygon));\n\t\tfor (let i = 0, n = clippingPolygons.length; i < n; i++) {\n\t\t\tlet polygon = clippingPolygons[i];\n\t\t\tSkeletonClipping.makeClockwise(polygon);\n\t\t\tpolygon.push(polygon[0]);\n\t\t\tpolygon.push(polygon[1]);\n\t\t}\n\n\t\treturn clippingPolygons.length;\n\t}\n\n\tclipEndWithSlot (slot: Slot) {\n\t\tif (this.clipAttachment && this.clipAttachment.endSlot == slot.data) this.clipEnd();\n\t}\n\n\tclipEnd () {\n\t\tif (!this.clipAttachment) return;\n\t\tthis.clipAttachment = null;\n\t\tthis.clippingPolygons = null;\n\t\tthis.clippedVertices.length = 0;\n\t\tthis.clippedTriangles.length = 0;\n\t\tthis.clippingPolygon.length = 0;\n\t}\n\n\tisClipping (): boolean {\n\t\treturn this.clipAttachment != null;\n\t}\n\n\t/**\n\t* @deprecated Use clipTriangles without verticesLength parameter. Mark for removal in 4.3.\n\t*/\n\tclipTriangles (vertices: NumberArrayLike, verticesLength: number, triangles: NumberArrayLike, trianglesLength: number): void;\n\n\t/**\n\t * @deprecated Use clipTriangles without verticesLength parameter. Mark for removal in 4.3.\n\t */\n\tclipTriangles (vertices: NumberArrayLike, verticesLength: number, triangles: NumberArrayLike, trianglesLength: number, uvs: NumberArrayLike, light: Color, dark: Color, twoColor: boolean): void;\n\n\tclipTriangles (vertices: NumberArrayLike, triangles: NumberArrayLike, trianglesLength: number): void;\n\tclipTriangles (vertices: NumberArrayLike, triangles: NumberArrayLike, trianglesLength: number, uvs: NumberArrayLike, light: Color, dark: Color, twoColor: boolean): void;\n\tclipTriangles (\n\t\tvertices: NumberArrayLike,\n\t\tverticesLengthOrTriangles: number | NumberArrayLike,\n\t\ttrianglesOrTrianglesLength: NumberArrayLike | number,\n\t\ttrianglesLengthOrUvs?: number | NumberArrayLike,\n\t\tuvsOrLight?: NumberArrayLike | Color,\n\t\tlightOrDark?: Color,\n\t\tdarkOrTwoColor?: Color | boolean,\n\t\ttwoColorParam?: boolean\n\t): void {\n\t\t// Determine which overload is being used\n\t\tlet triangles: NumberArrayLike;\n\t\tlet trianglesLength: number;\n\t\tlet uvs: NumberArrayLike | undefined;\n\t\tlet light: Color | undefined;\n\t\tlet dark: Color | undefined;\n\t\tlet twoColor: boolean | undefined;\n\n\t\tif (typeof verticesLengthOrTriangles === 'number') {\n\t\t\ttriangles = trianglesOrTrianglesLength as NumberArrayLike;\n\t\t\ttrianglesLength = trianglesLengthOrUvs as number;\n\t\t\tuvs = uvsOrLight as NumberArrayLike;\n\t\t\tlight = lightOrDark as Color | undefined;\n\t\t\tdark = darkOrTwoColor as Color | undefined;\n\t\t\ttwoColor = twoColorParam;\n\t\t} else {\n\t\t\ttriangles = verticesLengthOrTriangles;\n\t\t\ttrianglesLength = trianglesOrTrianglesLength as number;\n\t\t\tuvs = trianglesLengthOrUvs as NumberArrayLike;\n\t\t\tlight = uvsOrLight as Color | undefined;\n\t\t\tdark = lightOrDark as Color | undefined;\n\t\t\ttwoColor = darkOrTwoColor as boolean;\n\t\t}\n\n\t\tif (uvs && light && dark && typeof twoColor === 'boolean')\n\t\t\tthis.clipTrianglesRender(vertices, triangles, trianglesLength, uvs, light, dark, twoColor);\n\t\telse\n\t\t\tthis.clipTrianglesNoRender(vertices, triangles, trianglesLength);\n\t}\n\n\tprivate clipTrianglesNoRender (vertices: NumberArrayLike, triangles: NumberArrayLike, trianglesLength: number) {\n\n\t\tlet clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;\n\t\tlet clippedTriangles = this.clippedTriangles;\n\t\tlet polygons = this.clippingPolygons!;\n\t\tlet polygonsCount = polygons.length;\n\n\t\tlet index = 0;\n\t\tclippedVertices.length = 0;\n\t\tclippedTriangles.length = 0;\n\t\tfor (let i = 0; i < trianglesLength; i += 3) {\n\t\t\tlet vertexOffset = triangles[i] << 1;\n\t\t\tlet x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1];\n\n\t\t\tvertexOffset = triangles[i + 1] << 1;\n\t\t\tlet x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1];\n\n\t\t\tvertexOffset = triangles[i + 2] << 1;\n\t\t\tlet x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1];\n\n\t\t\tfor (let p = 0; p < polygonsCount; p++) {\n\t\t\t\tlet s = clippedVertices.length;\n\t\t\t\tif (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {\n\t\t\t\t\tlet clipOutputLength = clipOutput.length;\n\t\t\t\t\tif (clipOutputLength == 0) continue;\n\n\t\t\t\t\tlet clipOutputCount = clipOutputLength >> 1;\n\t\t\t\t\tlet clipOutputItems = this.clipOutput;\n\t\t\t\t\tlet clippedVerticesItems = Utils.setArraySize(clippedVertices, s + clipOutputCount * 2);\n\t\t\t\t\tfor (let ii = 0; ii < clipOutputLength; ii += 2, s += 2) {\n\t\t\t\t\t\tlet x = clipOutputItems[ii], y = clipOutputItems[ii + 1];\n\t\t\t\t\t\tclippedVerticesItems[s] = x;\n\t\t\t\t\t\tclippedVerticesItems[s + 1] = y;\n\t\t\t\t\t}\n\n\t\t\t\t\ts = clippedTriangles.length;\n\t\t\t\t\tlet clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2));\n\t\t\t\t\tclipOutputCount--;\n\t\t\t\t\tfor (let ii = 1; ii < clipOutputCount; ii++, s += 3) {\n\t\t\t\t\t\tclippedTrianglesItems[s] = index;\n\t\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + ii);\n\t\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + ii + 1);\n\t\t\t\t\t}\n\t\t\t\t\tindex += clipOutputCount + 1;\n\n\t\t\t\t} else {\n\t\t\t\t\tlet clippedVerticesItems = Utils.setArraySize(clippedVertices, s + 3 * 2);\n\t\t\t\t\tclippedVerticesItems[s] = x1;\n\t\t\t\t\tclippedVerticesItems[s + 1] = y1;\n\n\t\t\t\t\tclippedVerticesItems[s + 2] = x2;\n\t\t\t\t\tclippedVerticesItems[s + 3] = y2;\n\n\t\t\t\t\tclippedVerticesItems[s + 4] = x3;\n\t\t\t\t\tclippedVerticesItems[s + 5] = y3;\n\n\t\t\t\t\ts = clippedTriangles.length;\n\t\t\t\t\tlet clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3);\n\t\t\t\t\tclippedTrianglesItems[s] = index;\n\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + 1);\n\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + 2);\n\t\t\t\t\tindex += 3;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate clipTrianglesRender (vertices: NumberArrayLike, triangles: NumberArrayLike, trianglesLength: number, uvs: NumberArrayLike,\n\t\tlight: Color, dark: Color, twoColor: boolean) {\n\n\t\tlet clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;\n\t\tlet clippedTriangles = this.clippedTriangles;\n\t\tlet polygons = this.clippingPolygons!;\n\t\tlet polygonsCount = polygons.length;\n\t\tlet vertexSize = twoColor ? 12 : 8;\n\n\t\tlet index = 0;\n\t\tclippedVertices.length = 0;\n\t\tclippedTriangles.length = 0;\n\t\tfor (let i = 0; i < trianglesLength; i += 3) {\n\t\t\tlet vertexOffset = triangles[i] << 1;\n\t\t\tlet x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1];\n\t\t\tlet u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1];\n\n\t\t\tvertexOffset = triangles[i + 1] << 1;\n\t\t\tlet x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1];\n\t\t\tlet u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1];\n\n\t\t\tvertexOffset = triangles[i + 2] << 1;\n\t\t\tlet x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1];\n\t\t\tlet u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1];\n\n\t\t\tfor (let p = 0; p < polygonsCount; p++) {\n\t\t\t\tlet s = clippedVertices.length;\n\t\t\t\tif (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {\n\t\t\t\t\tlet clipOutputLength = clipOutput.length;\n\t\t\t\t\tif (clipOutputLength == 0) continue;\n\t\t\t\t\tlet d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1;\n\t\t\t\t\tlet d = 1 / (d0 * d2 + d1 * (y1 - y3));\n\n\t\t\t\t\tlet clipOutputCount = clipOutputLength >> 1;\n\t\t\t\t\tlet clipOutputItems = this.clipOutput;\n\t\t\t\t\tlet clippedVerticesItems = Utils.setArraySize(clippedVertices, s + clipOutputCount * vertexSize);\n\t\t\t\t\tfor (let ii = 0; ii < clipOutputLength; ii += 2, s += vertexSize) {\n\t\t\t\t\t\tlet x = clipOutputItems[ii], y = clipOutputItems[ii + 1];\n\t\t\t\t\t\tclippedVerticesItems[s] = x;\n\t\t\t\t\t\tclippedVerticesItems[s + 1] = y;\n\t\t\t\t\t\tclippedVerticesItems[s + 2] = light.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 3] = light.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 4] = light.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 5] = light.a;\n\t\t\t\t\t\tlet c0 = x - x3, c1 = y - y3;\n\t\t\t\t\t\tlet a = (d0 * c0 + d1 * c1) * d;\n\t\t\t\t\t\tlet b = (d4 * c0 + d2 * c1) * d;\n\t\t\t\t\t\tlet c = 1 - a - b;\n\t\t\t\t\t\tclippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c;\n\t\t\t\t\t\tclippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c;\n\t\t\t\t\t\tif (twoColor) {\n\t\t\t\t\t\t\tclippedVerticesItems[s + 8] = dark.r;\n\t\t\t\t\t\t\tclippedVerticesItems[s + 9] = dark.g;\n\t\t\t\t\t\t\tclippedVerticesItems[s + 10] = dark.b;\n\t\t\t\t\t\t\tclippedVerticesItems[s + 11] = dark.a;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ts = clippedTriangles.length;\n\t\t\t\t\tlet clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2));\n\t\t\t\t\tclipOutputCount--;\n\t\t\t\t\tfor (let ii = 1; ii < clipOutputCount; ii++, s += 3) {\n\t\t\t\t\t\tclippedTrianglesItems[s] = index;\n\t\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + ii);\n\t\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + ii + 1);\n\t\t\t\t\t}\n\t\t\t\t\tindex += clipOutputCount + 1;\n\n\t\t\t\t} else {\n\t\t\t\t\tlet clippedVerticesItems = Utils.setArraySize(clippedVertices, s + 3 * vertexSize);\n\t\t\t\t\tclippedVerticesItems[s] = x1;\n\t\t\t\t\tclippedVerticesItems[s + 1] = y1;\n\t\t\t\t\tclippedVerticesItems[s + 2] = light.r;\n\t\t\t\t\tclippedVerticesItems[s + 3] = light.g;\n\t\t\t\t\tclippedVerticesItems[s + 4] = light.b;\n\t\t\t\t\tclippedVerticesItems[s + 5] = light.a;\n\t\t\t\t\tif (!twoColor) {\n\t\t\t\t\t\tclippedVerticesItems[s + 6] = u1;\n\t\t\t\t\t\tclippedVerticesItems[s + 7] = v1;\n\n\t\t\t\t\t\tclippedVerticesItems[s + 8] = x2;\n\t\t\t\t\t\tclippedVerticesItems[s + 9] = y2;\n\t\t\t\t\t\tclippedVerticesItems[s + 10] = light.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 11] = light.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 12] = light.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 13] = light.a;\n\t\t\t\t\t\tclippedVerticesItems[s + 14] = u2;\n\t\t\t\t\t\tclippedVerticesItems[s + 15] = v2;\n\n\t\t\t\t\t\tclippedVerticesItems[s + 16] = x3;\n\t\t\t\t\t\tclippedVerticesItems[s + 17] = y3;\n\t\t\t\t\t\tclippedVerticesItems[s + 18] = light.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 19] = light.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 20] = light.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 21] = light.a;\n\t\t\t\t\t\tclippedVerticesItems[s + 22] = u3;\n\t\t\t\t\t\tclippedVerticesItems[s + 23] = v3;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclippedVerticesItems[s + 6] = u1;\n\t\t\t\t\t\tclippedVerticesItems[s + 7] = v1;\n\t\t\t\t\t\tclippedVerticesItems[s + 8] = dark.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 9] = dark.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 10] = dark.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 11] = dark.a;\n\n\t\t\t\t\t\tclippedVerticesItems[s + 12] = x2;\n\t\t\t\t\t\tclippedVerticesItems[s + 13] = y2;\n\t\t\t\t\t\tclippedVerticesItems[s + 14] = light.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 15] = light.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 16] = light.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 17] = light.a;\n\t\t\t\t\t\tclippedVerticesItems[s + 18] = u2;\n\t\t\t\t\t\tclippedVerticesItems[s + 19] = v2;\n\t\t\t\t\t\tclippedVerticesItems[s + 20] = dark.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 21] = dark.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 22] = dark.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 23] = dark.a;\n\n\t\t\t\t\t\tclippedVerticesItems[s + 24] = x3;\n\t\t\t\t\t\tclippedVerticesItems[s + 25] = y3;\n\t\t\t\t\t\tclippedVerticesItems[s + 26] = light.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 27] = light.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 28] = light.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 29] = light.a;\n\t\t\t\t\t\tclippedVerticesItems[s + 30] = u3;\n\t\t\t\t\t\tclippedVerticesItems[s + 31] = v3;\n\t\t\t\t\t\tclippedVerticesItems[s + 32] = dark.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 33] = dark.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 34] = dark.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 35] = dark.a;\n\t\t\t\t\t}\n\n\t\t\t\t\ts = clippedTriangles.length;\n\t\t\t\t\tlet clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3);\n\t\t\t\t\tclippedTrianglesItems[s] = index;\n\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + 1);\n\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + 2);\n\t\t\t\t\tindex += 3;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic clipTrianglesUnpacked (vertices: NumberArrayLike, triangles: NumberArrayLike, trianglesLength: number, uvs: NumberArrayLike) {\n\t\tlet clipOutput = this.clipOutput, clippedVertices = this.clippedVertices, clippedUVs = this.clippedUVs;\n\t\tlet clippedTriangles = this.clippedTriangles;\n\t\tlet polygons = this.clippingPolygons!;\n\t\tlet polygonsCount = polygons.length;\n\n\t\tlet index = 0;\n\t\tclippedVertices.length = 0;\n\t\tclippedUVs.length = 0;\n\t\tclippedTriangles.length = 0;\n\t\tfor (let i = 0; i < trianglesLength; i += 3) {\n\t\t\tlet vertexOffset = triangles[i] << 1;\n\t\t\tlet x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1];\n\t\t\tlet u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1];\n\n\t\t\tvertexOffset = triangles[i + 1] << 1;\n\t\t\tlet x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1];\n\t\t\tlet u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1];\n\n\t\t\tvertexOffset = triangles[i + 2] << 1;\n\t\t\tlet x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1];\n\t\t\tlet u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1];\n\n\t\t\tfor (let p = 0; p < polygonsCount; p++) {\n\t\t\t\tlet s = clippedVertices.length;\n\t\t\t\tif (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {\n\t\t\t\t\tlet clipOutputLength = clipOutput.length;\n\t\t\t\t\tif (clipOutputLength == 0) continue;\n\t\t\t\t\tlet d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1;\n\t\t\t\t\tlet d = 1 / (d0 * d2 + d1 * (y1 - y3));\n\n\t\t\t\t\tlet clipOutputCount = clipOutputLength >> 1;\n\t\t\t\t\tlet clipOutputItems = this.clipOutput;\n\t\t\t\t\tlet clippedVerticesItems = Utils.setArraySize(clippedVertices, s + clipOutputCount * 2);\n\t\t\t\t\tlet clippedUVsItems = Utils.setArraySize(clippedUVs, s + clipOutputCount * 2);\n\t\t\t\t\tfor (let ii = 0; ii < clipOutputLength; ii += 2, s += 2) {\n\t\t\t\t\t\tlet x = clipOutputItems[ii], y = clipOutputItems[ii + 1];\n\t\t\t\t\t\tclippedVerticesItems[s] = x;\n\t\t\t\t\t\tclippedVerticesItems[s + 1] = y;\n\t\t\t\t\t\tlet c0 = x - x3, c1 = y - y3;\n\t\t\t\t\t\tlet a = (d0 * c0 + d1 * c1) * d;\n\t\t\t\t\t\tlet b = (d4 * c0 + d2 * c1) * d;\n\t\t\t\t\t\tlet c = 1 - a - b;\n\t\t\t\t\t\tclippedUVsItems[s] = u1 * a + u2 * b + u3 * c;\n\t\t\t\t\t\tclippedUVsItems[s + 1] = v1 * a + v2 * b + v3 * c;\n\t\t\t\t\t}\n\n\t\t\t\t\ts = clippedTriangles.length;\n\t\t\t\t\tlet clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2));\n\t\t\t\t\tclipOutputCount--;\n\t\t\t\t\tfor (let ii = 1; ii < clipOutputCount; ii++, s += 3) {\n\t\t\t\t\t\tclippedTrianglesItems[s] = index;\n\t\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + ii);\n\t\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + ii + 1);\n\t\t\t\t\t}\n\t\t\t\t\tindex += clipOutputCount + 1;\n\n\t\t\t\t} else {\n\t\t\t\t\tlet clippedVerticesItems = Utils.setArraySize(clippedVertices, s + 3 * 2);\n\t\t\t\t\tclippedVerticesItems[s] = x1;\n\t\t\t\t\tclippedVerticesItems[s + 1] = y1;\n\t\t\t\t\tclippedVerticesItems[s + 2] = x2;\n\t\t\t\t\tclippedVerticesItems[s + 3] = y2;\n\t\t\t\t\tclippedVerticesItems[s + 4] = x3;\n\t\t\t\t\tclippedVerticesItems[s + 5] = y3;\n\n\t\t\t\t\tlet clippedUVSItems = Utils.setArraySize(clippedUVs, s + 3 * 2);\n\t\t\t\t\tclippedUVSItems[s] = u1;\n\t\t\t\t\tclippedUVSItems[s + 1] = v1;\n\t\t\t\t\tclippedUVSItems[s + 2] = u2;\n\t\t\t\t\tclippedUVSItems[s + 3] = v2;\n\t\t\t\t\tclippedUVSItems[s + 4] = u3;\n\t\t\t\t\tclippedUVSItems[s + 5] = v3;\n\n\t\t\t\t\ts = clippedTriangles.length;\n\t\t\t\t\tlet clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3);\n\t\t\t\t\tclippedTrianglesItems[s] = index;\n\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + 1);\n\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + 2);\n\t\t\t\t\tindex += 3;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Clips the input triangle against the convex, clockwise clipping area. If the triangle lies entirely within the clipping\n\t * area, false is returned. The clipping area must duplicate the first vertex at the end of the vertices list. */\n\tclip (x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, clippingArea: Array<number>, output: Array<number>) {\n\t\tlet originalOutput = output;\n\t\tlet clipped = false;\n\n\t\t// Avoid copy at the end.\n\t\tlet input: Array<number>;\n\t\tif (clippingArea.length % 4 >= 2) {\n\t\t\tinput = output;\n\t\t\toutput = this.scratch;\n\t\t} else\n\t\t\tinput = this.scratch;\n\n\t\tinput.length = 0;\n\t\tinput.push(x1);\n\t\tinput.push(y1);\n\t\tinput.push(x2);\n\t\tinput.push(y2);\n\t\tinput.push(x3);\n\t\tinput.push(y3);\n\t\tinput.push(x1);\n\t\tinput.push(y1);\n\t\toutput.length = 0;\n\n\t\tlet clippingVerticesLast = clippingArea.length - 4;\n\t\tlet clippingVertices = clippingArea;\n\t\tfor (let i = 0; ; i += 2) {\n\t\t\tlet edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1];\n\t\t\tlet ex = edgeX - clippingVertices[i + 2], ey = edgeY - clippingVertices[i + 3];\n\n\t\t\tlet outputStart = output.length;\n\t\t\tlet inputVertices = input;\n\t\t\tfor (let ii = 0, nn = input.length - 2; ii < nn;) {\n\t\t\t\tlet inputX = inputVertices[ii], inputY = inputVertices[ii + 1];\n\t\t\t\tii += 2;\n\t\t\t\tlet inputX2 = inputVertices[ii], inputY2 = inputVertices[ii + 1];\n\t\t\t\tlet s2 = ey * (edgeX - inputX2) > ex * (edgeY - inputY2);\n\t\t\t\tlet s1 = ey * (edgeX - inputX) - ex * (edgeY - inputY);\n\t\t\t\tif (s1 > 0) {\n\t\t\t\t\tif (s2) { // v1 inside, v2 inside\n\t\t\t\t\t\toutput.push(inputX2);\n\t\t\t\t\t\toutput.push(inputY2);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t// v1 inside, v2 outside\n\t\t\t\t\tlet ix = inputX2 - inputX, iy = inputY2 - inputY, t = s1 / (ix * ey - iy * ex);\n\t\t\t\t\tif (t >= 0 && t <= 1) {\n\t\t\t\t\t\toutput.push(inputX + ix * t);\n\t\t\t\t\t\toutput.push(inputY + iy * t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\toutput.push(inputX2);\n\t\t\t\t\t\toutput.push(inputY2);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t} else if (s2) { // v1 outside, v2 inside\n\t\t\t\t\tlet ix = inputX2 - inputX, iy = inputY2 - inputY, t = s1 / (ix * ey - iy * ex);\n\t\t\t\t\tif (t >= 0 && t <= 1) {\n\t\t\t\t\t\toutput.push(inputX + ix * t);\n\t\t\t\t\t\toutput.push(inputY + iy * t);\n\t\t\t\t\t\toutput.push(inputX2);\n\t\t\t\t\t\toutput.push(inputY2);\n\t\t\t\t\t} else {\n\t\t\t\t\t\toutput.push(inputX2);\n\t\t\t\t\t\toutput.push(inputY2);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tclipped = true;\n\t\t\t}\n\n\t\t\tif (outputStart == output.length) { // All edges outside.\n\t\t\t\toriginalOutput.length = 0;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\toutput.push(output[0]);\n\t\t\toutput.push(output[1]);\n\n\t\t\tif (i == clippingVerticesLast) break;\n\t\t\tlet temp = output;\n\t\t\toutput = input;\n\t\t\toutput.length = 0;\n\t\t\tinput = temp;\n\t\t}\n\n\t\tif (originalOutput != output) {\n\t\t\toriginalOutput.length = 0;\n\t\t\tfor (let i = 0, n = output.length - 2; i < n; i++)\n\t\t\t\toriginalOutput[i] = output[i];\n\t\t} else\n\t\t\toriginalOutput.length = originalOutput.length - 2;\n\n\t\treturn clipped;\n\t}\n\n\tpublic static makeClockwise (polygon: NumberArrayLike) {\n\t\tlet vertices = polygon;\n\t\tlet verticeslength = polygon.length;\n\n\t\tlet area = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1], p1x = 0, p1y = 0, p2x = 0, p2y = 0;\n\t\tfor (let i = 0, n = verticeslength - 3; i < n; i += 2) {\n\t\t\tp1x = vertices[i];\n\t\t\tp1y = vertices[i + 1];\n\t\t\tp2x = vertices[i + 2];\n\t\t\tp2y = vertices[i + 3];\n\t\t\tarea += p1x * p2y - p2x * p1y;\n\t\t}\n\t\tif (area < 0) return;\n\n\t\tfor (let i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) {\n\t\t\tlet x = vertices[i], y = vertices[i + 1];\n\t\t\tlet other = lastX - i;\n\t\t\tvertices[i] = vertices[other];\n\t\t\tvertices[i + 1] = vertices[other + 1];\n\t\t\tvertices[other] = x;\n\t\t\tvertices[other + 1] = y;\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Animation, Timeline, InheritTimeline, AttachmentTimeline, RGBATimeline, RGBTimeline, AlphaTimeline, RGBA2Timeline, RGB2Timeline, RotateTimeline, TranslateTimeline, TranslateXTimeline, TranslateYTimeline, ScaleTimeline, ScaleXTimeline, ScaleYTimeline, ShearTimeline, ShearXTimeline, ShearYTimeline, IkConstraintTimeline, TransformConstraintTimeline, PathConstraintPositionTimeline, PathConstraintSpacingTimeline, PathConstraintMixTimeline, DeformTimeline, DrawOrderTimeline, EventTimeline, CurveTimeline1, CurveTimeline2, CurveTimeline, PhysicsConstraintResetTimeline, PhysicsConstraintInertiaTimeline, PhysicsConstraintStrengthTimeline, PhysicsConstraintDampingTimeline, PhysicsConstraintMassTimeline, PhysicsConstraintWindTimeline, PhysicsConstraintGravityTimeline, PhysicsConstraintMixTimeline } from \"./Animation.js\";\nimport { VertexAttachment, Attachment } from \"./attachments/Attachment.js\";\nimport { AttachmentLoader } from \"./attachments/AttachmentLoader.js\";\nimport { MeshAttachment } from \"./attachments/MeshAttachment.js\";\nimport { BoneData, Inherit } from \"./BoneData.js\";\nimport { EventData } from \"./EventData.js\";\nimport { Event } from \"./Event.js\";\nimport { IkConstraintData } from \"./IkConstraintData.js\";\nimport { PathConstraintData, PositionMode, SpacingMode, RotateMode } from \"./PathConstraintData.js\";\nimport { SkeletonData } from \"./SkeletonData.js\";\nimport { Skin } from \"./Skin.js\";\nimport { SlotData, BlendMode } from \"./SlotData.js\";\nimport { TransformConstraintData } from \"./TransformConstraintData.js\";\nimport { Utils, Color, NumberArrayLike } from \"./Utils.js\";\nimport { Sequence, SequenceMode } from \"./attachments/Sequence.js\";\nimport { SequenceTimeline } from \"./Animation.js\";\nimport { HasTextureRegion } from \"./attachments/HasTextureRegion.js\";\nimport { PhysicsConstraintData } from \"./PhysicsConstraintData.js\";\n\n/** Loads skeleton data in the Spine JSON format.\n *\n * See [Spine JSON format](http://esotericsoftware.com/spine-json-format) and\n * [JSON and binary data](http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data) in the Spine\n * Runtimes Guide. */\nexport class SkeletonJson {\n\tattachmentLoader: AttachmentLoader;\n\n\t/** Scales bone positions, image sizes, and translations as they are loaded. This allows different size images to be used at\n\t * runtime than were used in Spine.\n\t *\n\t * See [Scaling](http://esotericsoftware.com/spine-loading-skeleton-data#Scaling) in the Spine Runtimes Guide. */\n\tscale = 1;\n\tprivate linkedMeshes = new Array<LinkedMesh>();\n\n\tconstructor (attachmentLoader: AttachmentLoader) {\n\t\tthis.attachmentLoader = attachmentLoader;\n\t}\n\n\treadSkeletonData (json: string | any): SkeletonData {\n\t\tlet scale = this.scale;\n\t\tlet skeletonData = new SkeletonData();\n\t\tlet root = typeof (json) === \"string\" ? JSON.parse(json) : json;\n\n\t\t// Skeleton\n\t\tlet skeletonMap = root.skeleton;\n\t\tif (skeletonMap) {\n\t\t\tskeletonData.hash = skeletonMap.hash;\n\t\t\tskeletonData.version = skeletonMap.spine;\n\t\t\tskeletonData.x = skeletonMap.x;\n\t\t\tskeletonData.y = skeletonMap.y;\n\t\t\tskeletonData.width = skeletonMap.width;\n\t\t\tskeletonData.height = skeletonMap.height;\n\t\t\tskeletonData.referenceScale = getValue(skeletonMap, \"referenceScale\", 100) * scale;\n\t\t\tskeletonData.fps = skeletonMap.fps;\n\t\t\tskeletonData.imagesPath = skeletonMap.images ?? null;\n\t\t\tskeletonData.audioPath = skeletonMap.audio ?? null;\n\t\t}\n\n\t\t// Bones\n\t\tif (root.bones) {\n\t\t\tfor (let i = 0; i < root.bones.length; i++) {\n\t\t\t\tlet boneMap = root.bones[i];\n\n\t\t\t\tlet parent: BoneData | null = null;\n\t\t\t\tlet parentName: string = getValue(boneMap, \"parent\", null);\n\t\t\t\tif (parentName) parent = skeletonData.findBone(parentName);\n\t\t\t\tlet data = new BoneData(skeletonData.bones.length, boneMap.name, parent);\n\t\t\t\tdata.length = getValue(boneMap, \"length\", 0) * scale;\n\t\t\t\tdata.x = getValue(boneMap, \"x\", 0) * scale;\n\t\t\t\tdata.y = getValue(boneMap, \"y\", 0) * scale;\n\t\t\t\tdata.rotation = getValue(boneMap, \"rotation\", 0);\n\t\t\t\tdata.scaleX = getValue(boneMap, \"scaleX\", 1);\n\t\t\t\tdata.scaleY = getValue(boneMap, \"scaleY\", 1);\n\t\t\t\tdata.shearX = getValue(boneMap, \"shearX\", 0);\n\t\t\t\tdata.shearY = getValue(boneMap, \"shearY\", 0);\n\t\t\t\tdata.inherit = Utils.enumValue(Inherit, getValue(boneMap, \"inherit\", \"Normal\"));\n\t\t\t\tdata.skinRequired = getValue(boneMap, \"skin\", false);\n\n\t\t\t\tlet color = getValue(boneMap, \"color\", null);\n\t\t\t\tif (color) data.color.setFromString(color);\n\n\t\t\t\tskeletonData.bones.push(data);\n\t\t\t}\n\t\t}\n\n\t\t// Slots.\n\t\tif (root.slots) {\n\t\t\tfor (let i = 0; i < root.slots.length; i++) {\n\t\t\t\tlet slotMap = root.slots[i];\n\t\t\t\tlet slotName = slotMap.name;\n\n\t\t\t\tlet boneData = skeletonData.findBone(slotMap.bone);\n\t\t\t\tif (!boneData) throw new Error(`Couldn't find bone ${slotMap.bone} for slot ${slotName}`);\n\t\t\t\tlet data = new SlotData(skeletonData.slots.length, slotName, boneData);\n\n\t\t\t\tlet color: string = getValue(slotMap, \"color\", null);\n\t\t\t\tif (color) data.color.setFromString(color);\n\n\t\t\t\tlet dark: string = getValue(slotMap, \"dark\", null);\n\t\t\t\tif (dark) data.darkColor = Color.fromString(dark);\n\n\t\t\t\tdata.attachmentName = getValue(slotMap, \"attachment\", null);\n\t\t\t\tdata.blendMode = Utils.enumValue(BlendMode, getValue(slotMap, \"blend\", \"normal\"));\n\t\t\t\tdata.visible = getValue(slotMap, \"visible\", true);\n\t\t\t\tskeletonData.slots.push(data);\n\t\t\t}\n\t\t}\n\n\t\t// IK constraints\n\t\tif (root.ik) {\n\t\t\tfor (let i = 0; i < root.ik.length; i++) {\n\t\t\t\tlet constraintMap = root.ik[i];\n\t\t\t\tlet data = new IkConstraintData(constraintMap.name);\n\t\t\t\tdata.order = getValue(constraintMap, \"order\", 0);\n\t\t\t\tdata.skinRequired = getValue(constraintMap, \"skin\", false);\n\n\t\t\t\tfor (let ii = 0; ii < constraintMap.bones.length; ii++) {\n\t\t\t\t\tlet bone = skeletonData.findBone(constraintMap.bones[ii]);\n\t\t\t\t\tif (!bone) throw new Error(`Couldn't find bone ${constraintMap.bones[ii]} for IK constraint ${constraintMap.name}.`);\n\t\t\t\t\tdata.bones.push(bone);\n\t\t\t\t}\n\n\t\t\t\tlet target = skeletonData.findBone(constraintMap.target);;\n\t\t\t\tif (!target) throw new Error(`Couldn't find target bone ${constraintMap.target} for IK constraint ${constraintMap.name}.`);\n\t\t\t\tdata.target = target;\n\n\t\t\t\tdata.mix = getValue(constraintMap, \"mix\", 1);\n\t\t\t\tdata.softness = getValue(constraintMap, \"softness\", 0) * scale;\n\t\t\t\tdata.bendDirection = getValue(constraintMap, \"bendPositive\", true) ? 1 : -1;\n\t\t\t\tdata.compress = getValue(constraintMap, \"compress\", false);\n\t\t\t\tdata.stretch = getValue(constraintMap, \"stretch\", false);\n\t\t\t\tdata.uniform = getValue(constraintMap, \"uniform\", false);\n\n\t\t\t\tskeletonData.ikConstraints.push(data);\n\t\t\t}\n\t\t}\n\n\t\t// Transform constraints.\n\t\tif (root.transform) {\n\t\t\tfor (let i = 0; i < root.transform.length; i++) {\n\t\t\t\tlet constraintMap = root.transform[i];\n\t\t\t\tlet data = new TransformConstraintData(constraintMap.name);\n\t\t\t\tdata.order = getValue(constraintMap, \"order\", 0);\n\t\t\t\tdata.skinRequired = getValue(constraintMap, \"skin\", false);\n\n\t\t\t\tfor (let ii = 0; ii < constraintMap.bones.length; ii++) {\n\t\t\t\t\tlet boneName = constraintMap.bones[ii];\n\t\t\t\t\tlet bone = skeletonData.findBone(boneName);\n\t\t\t\t\tif (!bone) throw new Error(`Couldn't find bone ${boneName} for transform constraint ${constraintMap.name}.`);\n\t\t\t\t\tdata.bones.push(bone);\n\t\t\t\t}\n\n\t\t\t\tlet targetName: string = constraintMap.target;\n\t\t\t\tlet target = skeletonData.findBone(targetName);\n\t\t\t\tif (!target) throw new Error(`Couldn't find target bone ${targetName} for transform constraint ${constraintMap.name}.`);\n\t\t\t\tdata.target = target;\n\n\t\t\t\tdata.local = getValue(constraintMap, \"local\", false);\n\t\t\t\tdata.relative = getValue(constraintMap, \"relative\", false);\n\t\t\t\tdata.offsetRotation = getValue(constraintMap, \"rotation\", 0);\n\t\t\t\tdata.offsetX = getValue(constraintMap, \"x\", 0) * scale;\n\t\t\t\tdata.offsetY = getValue(constraintMap, \"y\", 0) * scale;\n\t\t\t\tdata.offsetScaleX = getValue(constraintMap, \"scaleX\", 0);\n\t\t\t\tdata.offsetScaleY = getValue(constraintMap, \"scaleY\", 0);\n\t\t\t\tdata.offsetShearY = getValue(constraintMap, \"shearY\", 0);\n\n\t\t\t\tdata.mixRotate = getValue(constraintMap, \"mixRotate\", 1);\n\t\t\t\tdata.mixX = getValue(constraintMap, \"mixX\", 1);\n\t\t\t\tdata.mixY = getValue(constraintMap, \"mixY\", data.mixX);\n\t\t\t\tdata.mixScaleX = getValue(constraintMap, \"mixScaleX\", 1);\n\t\t\t\tdata.mixScaleY = getValue(constraintMap, \"mixScaleY\", data.mixScaleX);\n\t\t\t\tdata.mixShearY = getValue(constraintMap, \"mixShearY\", 1);\n\n\t\t\t\tskeletonData.transformConstraints.push(data);\n\t\t\t}\n\t\t}\n\n\t\t// Path constraints.\n\t\tif (root.path) {\n\t\t\tfor (let i = 0; i < root.path.length; i++) {\n\t\t\t\tlet constraintMap = root.path[i];\n\t\t\t\tlet data = new PathConstraintData(constraintMap.name);\n\t\t\t\tdata.order = getValue(constraintMap, \"order\", 0);\n\t\t\t\tdata.skinRequired = getValue(constraintMap, \"skin\", false);\n\n\t\t\t\tfor (let ii = 0; ii < constraintMap.bones.length; ii++) {\n\t\t\t\t\tlet boneName = constraintMap.bones[ii];\n\t\t\t\t\tlet bone = skeletonData.findBone(boneName);\n\t\t\t\t\tif (!bone) throw new Error(`Couldn't find bone ${boneName} for path constraint ${constraintMap.name}.`);\n\t\t\t\t\tdata.bones.push(bone);\n\t\t\t\t}\n\n\t\t\t\tlet targetName: string = constraintMap.target;\n\t\t\t\tlet target = skeletonData.findSlot(targetName);\n\t\t\t\tif (!target) throw new Error(`Couldn't find target slot ${targetName} for path constraint ${constraintMap.name}.`);\n\t\t\t\tdata.target = target;\n\n\t\t\t\tdata.positionMode = Utils.enumValue(PositionMode, getValue(constraintMap, \"positionMode\", \"Percent\"));\n\t\t\t\tdata.spacingMode = Utils.enumValue(SpacingMode, getValue(constraintMap, \"spacingMode\", \"Length\"));\n\t\t\t\tdata.rotateMode = Utils.enumValue(RotateMode, getValue(constraintMap, \"rotateMode\", \"Tangent\"));\n\t\t\t\tdata.offsetRotation = getValue(constraintMap, \"rotation\", 0);\n\t\t\t\tdata.position = getValue(constraintMap, \"position\", 0);\n\t\t\t\tif (data.positionMode == PositionMode.Fixed) data.position *= scale;\n\t\t\t\tdata.spacing = getValue(constraintMap, \"spacing\", 0);\n\t\t\t\tif (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed) data.spacing *= scale;\n\t\t\t\tdata.mixRotate = getValue(constraintMap, \"mixRotate\", 1);\n\t\t\t\tdata.mixX = getValue(constraintMap, \"mixX\", 1);\n\t\t\t\tdata.mixY = getValue(constraintMap, \"mixY\", data.mixX);\n\n\t\t\t\tskeletonData.pathConstraints.push(data);\n\t\t\t}\n\t\t}\n\n\t\t// Physics constraints.\n\t\tif (root.physics) {\n\t\t\tfor (let i = 0; i < root.physics.length; i++) {\n\t\t\t\tconst constraintMap = root.physics[i];\n\t\t\t\tconst data = new PhysicsConstraintData(constraintMap.name);\n\t\t\t\tdata.order = getValue(constraintMap, \"order\", 0);\n\t\t\t\tdata.skinRequired = getValue(constraintMap, \"skin\", false);\n\n\t\t\t\tconst boneName = constraintMap.bone;\n\t\t\t\tconst bone = skeletonData.findBone(boneName);\n\t\t\t\tif (bone == null) throw new Error(\"Physics bone not found: \" + boneName);\n\t\t\t\tdata.bone = bone;\n\n\t\t\t\tdata.x = getValue(constraintMap, \"x\", 0);\n\t\t\t\tdata.y = getValue(constraintMap, \"y\", 0);\n\t\t\t\tdata.rotate = getValue(constraintMap, \"rotate\", 0);\n\t\t\t\tdata.scaleX = getValue(constraintMap, \"scaleX\", 0);\n\t\t\t\tdata.shearX = getValue(constraintMap, \"shearX\", 0);\n\t\t\t\tdata.limit = getValue(constraintMap, \"limit\", 5000) * scale;\n\t\t\t\tdata.step = 1 / getValue(constraintMap, \"fps\", 60);\n\t\t\t\tdata.inertia = getValue(constraintMap, \"inertia\", 1);\n\t\t\t\tdata.strength = getValue(constraintMap, \"strength\", 100);\n\t\t\t\tdata.damping = getValue(constraintMap, \"damping\", 1);\n\t\t\t\tdata.massInverse = 1 / getValue(constraintMap, \"mass\", 1);\n\t\t\t\tdata.wind = getValue(constraintMap, \"wind\", 0);\n\t\t\t\tdata.gravity = getValue(constraintMap, \"gravity\", 0);\n\t\t\t\tdata.mix = getValue(constraintMap, \"mix\", 1);\n\t\t\t\tdata.inertiaGlobal = getValue(constraintMap, \"inertiaGlobal\", false);\n\t\t\t\tdata.strengthGlobal = getValue(constraintMap, \"strengthGlobal\", false);\n\t\t\t\tdata.dampingGlobal = getValue(constraintMap, \"dampingGlobal\", false);\n\t\t\t\tdata.massGlobal = getValue(constraintMap, \"massGlobal\", false);\n\t\t\t\tdata.windGlobal = getValue(constraintMap, \"windGlobal\", false);\n\t\t\t\tdata.gravityGlobal = getValue(constraintMap, \"gravityGlobal\", false);\n\t\t\t\tdata.mixGlobal = getValue(constraintMap, \"mixGlobal\", false);\n\n\t\t\t\tskeletonData.physicsConstraints.push(data);\n\t\t\t}\n\t\t}\n\n\t\t// Skins.\n\t\tif (root.skins) {\n\t\t\tfor (let i = 0; i < root.skins.length; i++) {\n\t\t\t\tlet skinMap = root.skins[i]\n\t\t\t\tlet skin = new Skin(skinMap.name);\n\n\t\t\t\tif (skinMap.bones) {\n\t\t\t\t\tfor (let ii = 0; ii < skinMap.bones.length; ii++) {\n\t\t\t\t\t\tlet boneName = skinMap.bones[ii];\n\t\t\t\t\t\tlet bone = skeletonData.findBone(boneName);\n\t\t\t\t\t\tif (!bone) throw new Error(`Couldn't find bone ${boneName} for skin ${skinMap.name}.`);\n\t\t\t\t\t\tskin.bones.push(bone);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (skinMap.ik) {\n\t\t\t\t\tfor (let ii = 0; ii < skinMap.ik.length; ii++) {\n\t\t\t\t\t\tlet constraintName = skinMap.ik[ii];\n\t\t\t\t\t\tlet constraint = skeletonData.findIkConstraint(constraintName);\n\t\t\t\t\t\tif (!constraint) throw new Error(`Couldn't find IK constraint ${constraintName} for skin ${skinMap.name}.`);\n\t\t\t\t\t\tskin.constraints.push(constraint);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (skinMap.transform) {\n\t\t\t\t\tfor (let ii = 0; ii < skinMap.transform.length; ii++) {\n\t\t\t\t\t\tlet constraintName = skinMap.transform[ii];\n\t\t\t\t\t\tlet constraint = skeletonData.findTransformConstraint(constraintName);\n\t\t\t\t\t\tif (!constraint) throw new Error(`Couldn't find transform constraint ${constraintName} for skin ${skinMap.name}.`);\n\t\t\t\t\t\tskin.constraints.push(constraint);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (skinMap.path) {\n\t\t\t\t\tfor (let ii = 0; ii < skinMap.path.length; ii++) {\n\t\t\t\t\t\tlet constraintName = skinMap.path[ii];\n\t\t\t\t\t\tlet constraint = skeletonData.findPathConstraint(constraintName);\n\t\t\t\t\t\tif (!constraint) throw new Error(`Couldn't find path constraint ${constraintName} for skin ${skinMap.name}.`);\n\t\t\t\t\t\tskin.constraints.push(constraint);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (skinMap.physics) {\n\t\t\t\t\tfor (let ii = 0; ii < skinMap.physics.length; ii++) {\n\t\t\t\t\t\tlet constraintName = skinMap.physics[ii];\n\t\t\t\t\t\tlet constraint = skeletonData.findPhysicsConstraint(constraintName);\n\t\t\t\t\t\tif (!constraint) throw new Error(`Couldn't find physics constraint ${constraintName} for skin ${skinMap.name}.`);\n\t\t\t\t\t\tskin.constraints.push(constraint);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (let slotName in skinMap.attachments) {\n\t\t\t\t\tlet slot = skeletonData.findSlot(slotName);\n\t\t\t\t\tif (!slot) throw new Error(`Couldn't find slot ${slotName} for skin ${skinMap.name}.`);\n\t\t\t\t\tlet slotMap = skinMap.attachments[slotName];\n\t\t\t\t\tfor (let entryName in slotMap) {\n\t\t\t\t\t\tlet attachment = this.readAttachment(slotMap[entryName], skin, slot.index, entryName, skeletonData);\n\t\t\t\t\t\tif (attachment) skin.setAttachment(slot.index, entryName, attachment);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tskeletonData.skins.push(skin);\n\t\t\t\tif (skin.name == \"default\") skeletonData.defaultSkin = skin;\n\t\t\t}\n\t\t}\n\n\t\t// Linked meshes.\n\t\tfor (let i = 0, n = this.linkedMeshes.length; i < n; i++) {\n\t\t\tlet linkedMesh = this.linkedMeshes[i];\n\t\t\tlet skin = !linkedMesh.skin ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\n\t\t\tif (!skin) throw new Error(`Skin not found: ${linkedMesh.skin}`);\n\t\t\tlet parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\n\t\t\tif (!parent) throw new Error(`Parent mesh not found: ${linkedMesh.parent}`);\n\t\t\tlinkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? <VertexAttachment>parent : <VertexAttachment>linkedMesh.mesh;\n\t\t\tlinkedMesh.mesh.setParentMesh(<MeshAttachment>parent);\n\t\t\tif (linkedMesh.mesh.region != null) linkedMesh.mesh.updateRegion();\n\t\t}\n\t\tthis.linkedMeshes.length = 0;\n\n\t\t// Events.\n\t\tif (root.events) {\n\t\t\tfor (let eventName in root.events) {\n\t\t\t\tlet eventMap = root.events[eventName];\n\t\t\t\tlet data = new EventData(eventName);\n\t\t\t\tdata.intValue = getValue(eventMap, \"int\", 0);\n\t\t\t\tdata.floatValue = getValue(eventMap, \"float\", 0);\n\t\t\t\tdata.stringValue = getValue(eventMap, \"string\", \"\");\n\t\t\t\tdata.audioPath = getValue(eventMap, \"audio\", null);\n\t\t\t\tif (data.audioPath) {\n\t\t\t\t\tdata.volume = getValue(eventMap, \"volume\", 1);\n\t\t\t\t\tdata.balance = getValue(eventMap, \"balance\", 0);\n\t\t\t\t}\n\t\t\t\tskeletonData.events.push(data);\n\t\t\t}\n\t\t}\n\n\t\t// Animations.\n\t\tif (root.animations) {\n\t\t\tfor (let animationName in root.animations) {\n\t\t\t\tlet animationMap = root.animations[animationName];\n\t\t\t\tthis.readAnimation(animationMap, animationName, skeletonData);\n\t\t\t}\n\t\t}\n\n\t\treturn skeletonData;\n\t}\n\n\treadAttachment (map: any, skin: Skin, slotIndex: number, name: string, skeletonData: SkeletonData): Attachment | null {\n\t\tlet scale = this.scale;\n\t\tname = getValue(map, \"name\", name);\n\n\t\tswitch (getValue(map, \"type\", \"region\")) {\n\t\t\tcase \"region\": {\n\t\t\t\tlet path = getValue(map, \"path\", name);\n\t\t\t\tlet sequence = this.readSequence(getValue(map, \"sequence\", null));\n\t\t\t\tlet region = this.attachmentLoader.newRegionAttachment(skin, name, path, sequence);\n\t\t\t\tif (!region) return null;\n\t\t\t\tregion.path = path;\n\t\t\t\tregion.x = getValue(map, \"x\", 0) * scale;\n\t\t\t\tregion.y = getValue(map, \"y\", 0) * scale;\n\t\t\t\tregion.scaleX = getValue(map, \"scaleX\", 1);\n\t\t\t\tregion.scaleY = getValue(map, \"scaleY\", 1);\n\t\t\t\tregion.rotation = getValue(map, \"rotation\", 0);\n\t\t\t\tregion.width = map.width * scale;\n\t\t\t\tregion.height = map.height * scale;\n\t\t\t\tregion.sequence = sequence;\n\n\t\t\t\tlet color: string = getValue(map, \"color\", null);\n\t\t\t\tif (color) region.color.setFromString(color);\n\n\t\t\t\tif (region.region != null) region.updateRegion();\n\t\t\t\treturn region;\n\t\t\t}\n\t\t\tcase \"boundingbox\": {\n\t\t\t\tlet box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\n\t\t\t\tif (!box) return null;\n\t\t\t\tthis.readVertices(map, box, map.vertexCount << 1);\n\t\t\t\tlet color: string = getValue(map, \"color\", null);\n\t\t\t\tif (color) box.color.setFromString(color);\n\t\t\t\treturn box;\n\t\t\t}\n\t\t\tcase \"mesh\":\n\t\t\tcase \"linkedmesh\": {\n\t\t\t\tlet path = getValue(map, \"path\", name);\n\t\t\t\tlet sequence = this.readSequence(getValue(map, \"sequence\", null));\n\t\t\t\tlet mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence);\n\t\t\t\tif (!mesh) return null;\n\t\t\t\tmesh.path = path;\n\n\t\t\t\tlet color = getValue(map, \"color\", null);\n\t\t\t\tif (color) mesh.color.setFromString(color);\n\n\t\t\t\tmesh.width = getValue(map, \"width\", 0) * scale;\n\t\t\t\tmesh.height = getValue(map, \"height\", 0) * scale;\n\t\t\t\tmesh.sequence = sequence;\n\n\t\t\t\tlet parent: string = getValue(map, \"parent\", null);\n\t\t\t\tif (parent) {\n\t\t\t\t\tthis.linkedMeshes.push(new LinkedMesh(mesh, <string>getValue(map, \"skin\", null), slotIndex, parent, getValue(map, \"timelines\", true)));\n\t\t\t\t\treturn mesh;\n\t\t\t\t}\n\n\t\t\t\tlet uvs: Array<number> = map.uvs;\n\t\t\t\tthis.readVertices(map, mesh, uvs.length);\n\t\t\t\tmesh.triangles = map.triangles;\n\t\t\t\tmesh.regionUVs = uvs;\n\t\t\t\tif (mesh.region != null) mesh.updateRegion();\n\n\t\t\t\tmesh.edges = getValue(map, \"edges\", null);\n\t\t\t\tmesh.hullLength = getValue(map, \"hull\", 0) * 2;\n\t\t\t\treturn mesh;\n\t\t\t}\n\t\t\tcase \"path\": {\n\t\t\t\tlet path = this.attachmentLoader.newPathAttachment(skin, name);\n\t\t\t\tif (!path) return null;\n\t\t\t\tpath.closed = getValue(map, \"closed\", false);\n\t\t\t\tpath.constantSpeed = getValue(map, \"constantSpeed\", true);\n\n\t\t\t\tlet vertexCount = map.vertexCount;\n\t\t\t\tthis.readVertices(map, path, vertexCount << 1);\n\n\t\t\t\tlet lengths: Array<number> = Utils.newArray(vertexCount / 3, 0);\n\t\t\t\tfor (let i = 0; i < map.lengths.length; i++)\n\t\t\t\t\tlengths[i] = map.lengths[i] * scale;\n\t\t\t\tpath.lengths = lengths;\n\n\t\t\t\tlet color: string = getValue(map, \"color\", null);\n\t\t\t\tif (color) path.color.setFromString(color);\n\t\t\t\treturn path;\n\t\t\t}\n\t\t\tcase \"point\": {\n\t\t\t\tlet point = this.attachmentLoader.newPointAttachment(skin, name);\n\t\t\t\tif (!point) return null;\n\t\t\t\tpoint.x = getValue(map, \"x\", 0) * scale;\n\t\t\t\tpoint.y = getValue(map, \"y\", 0) * scale;\n\t\t\t\tpoint.rotation = getValue(map, \"rotation\", 0);\n\n\t\t\t\tlet color = getValue(map, \"color\", null);\n\t\t\t\tif (color) point.color.setFromString(color);\n\t\t\t\treturn point;\n\t\t\t}\n\t\t\tcase \"clipping\": {\n\t\t\t\tlet clip = this.attachmentLoader.newClippingAttachment(skin, name);\n\t\t\t\tif (!clip) return null;\n\n\t\t\t\tlet end = getValue(map, \"end\", null);\n\t\t\t\tif (end) clip.endSlot = skeletonData.findSlot(end);\n\n\t\t\t\tlet vertexCount = map.vertexCount;\n\t\t\t\tthis.readVertices(map, clip, vertexCount << 1);\n\n\t\t\t\tlet color: string = getValue(map, \"color\", null);\n\t\t\t\tif (color) clip.color.setFromString(color);\n\t\t\t\treturn clip;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\treadSequence (map: any) {\n\t\tif (map == null) return null;\n\t\tlet sequence = new Sequence(getValue(map, \"count\", 0));\n\t\tsequence.start = getValue(map, \"start\", 1);\n\t\tsequence.digits = getValue(map, \"digits\", 0);\n\t\tsequence.setupIndex = getValue(map, \"setup\", 0);\n\t\treturn sequence;\n\t}\n\n\treadVertices (map: any, attachment: VertexAttachment, verticesLength: number) {\n\t\tlet scale = this.scale;\n\t\tattachment.worldVerticesLength = verticesLength;\n\t\tlet vertices: Array<number> = map.vertices;\n\t\tif (verticesLength == vertices.length) {\n\t\t\tlet scaledVertices = Utils.toFloatArray(vertices);\n\t\t\tif (scale != 1) {\n\t\t\t\tfor (let i = 0, n = vertices.length; i < n; i++)\n\t\t\t\t\tscaledVertices[i] *= scale;\n\t\t\t}\n\t\t\tattachment.vertices = scaledVertices;\n\t\t\treturn;\n\t\t}\n\t\tlet weights = new Array<number>();\n\t\tlet bones = new Array<number>();\n\t\tfor (let i = 0, n = vertices.length; i < n;) {\n\t\t\tlet boneCount = vertices[i++];\n\t\t\tbones.push(boneCount);\n\t\t\tfor (let nn = i + boneCount * 4; i < nn; i += 4) {\n\t\t\t\tbones.push(vertices[i]);\n\t\t\t\tweights.push(vertices[i + 1] * scale);\n\t\t\t\tweights.push(vertices[i + 2] * scale);\n\t\t\t\tweights.push(vertices[i + 3]);\n\t\t\t}\n\t\t}\n\t\tattachment.bones = bones;\n\t\tattachment.vertices = Utils.toFloatArray(weights);\n\t}\n\n\treadAnimation (map: any, name: string, skeletonData: SkeletonData) {\n\t\tlet scale = this.scale;\n\t\tlet timelines = new Array<Timeline>();\n\n\t\t// Slot timelines.\n\t\tif (map.slots) {\n\t\t\tfor (let slotName in map.slots) {\n\t\t\t\tlet slotMap = map.slots[slotName];\n\t\t\t\tlet slot = skeletonData.findSlot(slotName);\n\t\t\t\tif (!slot) throw new Error(\"Slot not found: \" + slotName);\n\t\t\t\tlet slotIndex = slot.index;\n\t\t\t\tfor (let timelineName in slotMap) {\n\t\t\t\t\tlet timelineMap = slotMap[timelineName];\n\t\t\t\t\tif (!timelineMap) continue;\n\t\t\t\t\tlet frames = timelineMap.length;\n\t\t\t\t\tif (timelineName == \"attachment\") {\n\t\t\t\t\t\tlet timeline = new AttachmentTimeline(frames, slotIndex);\n\t\t\t\t\t\tfor (let frame = 0; frame < frames; frame++) {\n\t\t\t\t\t\t\tlet keyMap = timelineMap[frame];\n\t\t\t\t\t\t\ttimeline.setFrame(frame, getValue(keyMap, \"time\", 0), getValue(keyMap, \"name\", null));\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\n\t\t\t\t\t} else if (timelineName == \"rgba\") {\n\t\t\t\t\t\tlet timeline = new RGBATimeline(frames, frames << 2, slotIndex);\n\t\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\tlet color = Color.fromString(keyMap.color);\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, color.r, color.g, color.b, color.a);\n\t\t\t\t\t\t\tlet nextMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\t\t\tlet newColor = Color.fromString(nextMap.color);\n\t\t\t\t\t\t\tlet curve = keyMap.curve;\n\t\t\t\t\t\t\tif (curve) {\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color.a, newColor.a, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tcolor = newColor;\n\t\t\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttimelines.push(timeline);\n\n\t\t\t\t\t} else if (timelineName == \"rgb\") {\n\t\t\t\t\t\tlet timeline = new RGBTimeline(frames, frames * 3, slotIndex);\n\t\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\tlet color = Color.fromString(keyMap.color);\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, color.r, color.g, color.b);\n\t\t\t\t\t\t\tlet nextMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\t\t\tlet newColor = Color.fromString(nextMap.color);\n\t\t\t\t\t\t\tlet curve = keyMap.curve;\n\t\t\t\t\t\t\tif (curve) {\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tcolor = newColor;\n\t\t\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttimelines.push(timeline);\n\n\t\t\t\t\t} else if (timelineName == \"alpha\") {\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, new AlphaTimeline(frames, frames, slotIndex), 0, 1));\n\t\t\t\t\t} else if (timelineName == \"rgba2\") {\n\t\t\t\t\t\tlet timeline = new RGBA2Timeline(frames, frames * 7, slotIndex);\n\n\t\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\tlet color = Color.fromString(keyMap.light);\n\t\t\t\t\t\tlet color2 = Color.fromString(keyMap.dark);\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, color.r, color.g, color.b, color.a, color2.r, color2.g, color2.b);\n\t\t\t\t\t\t\tlet nextMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\t\t\tlet newColor = Color.fromString(nextMap.light);\n\t\t\t\t\t\t\tlet newColor2 = Color.fromString(nextMap.dark);\n\t\t\t\t\t\t\tlet curve = keyMap.curve;\n\t\t\t\t\t\t\tif (curve) {\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color.a, newColor.a, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, color2.r, newColor2.r, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, color2.g, newColor2.g, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 6, time, time2, color2.b, newColor2.b, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tcolor = newColor;\n\t\t\t\t\t\t\tcolor2 = newColor2;\n\t\t\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttimelines.push(timeline);\n\n\t\t\t\t\t} else if (timelineName == \"rgb2\") {\n\t\t\t\t\t\tlet timeline = new RGB2Timeline(frames, frames * 6, slotIndex);\n\n\t\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\tlet color = Color.fromString(keyMap.light);\n\t\t\t\t\t\tlet color2 = Color.fromString(keyMap.dark);\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, color.r, color.g, color.b, color2.r, color2.g, color2.b);\n\t\t\t\t\t\t\tlet nextMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\t\t\tlet newColor = Color.fromString(nextMap.light);\n\t\t\t\t\t\t\tlet newColor2 = Color.fromString(nextMap.dark);\n\t\t\t\t\t\t\tlet curve = keyMap.curve;\n\t\t\t\t\t\t\tif (curve) {\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color2.r, newColor2.r, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, color2.g, newColor2.g, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, color2.b, newColor2.b, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tcolor = newColor;\n\t\t\t\t\t\t\tcolor2 = newColor2;\n\t\t\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Bone timelines.\n\t\tif (map.bones) {\n\t\t\tfor (let boneName in map.bones) {\n\t\t\t\tlet boneMap = map.bones[boneName];\n\t\t\t\tlet bone = skeletonData.findBone(boneName);\n\t\t\t\tif (!bone) throw new Error(\"Bone not found: \" + boneName);\n\t\t\t\tlet boneIndex = bone.index;\n\t\t\t\tfor (let timelineName in boneMap) {\n\t\t\t\t\tlet timelineMap = boneMap[timelineName];\n\t\t\t\t\tlet frames = timelineMap.length;\n\t\t\t\t\tif (frames == 0) continue;\n\n\t\t\t\t\tif (timelineName === \"rotate\") {\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, new RotateTimeline(frames, frames, boneIndex), 0, 1));\n\t\t\t\t\t} else if (timelineName === \"translate\") {\n\t\t\t\t\t\tlet timeline = new TranslateTimeline(frames, frames << 1, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline2(timelineMap, timeline, \"x\", \"y\", 0, scale));\n\t\t\t\t\t} else if (timelineName === \"translatex\") {\n\t\t\t\t\t\tlet timeline = new TranslateXTimeline(frames, frames, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 0, scale));\n\t\t\t\t\t} else if (timelineName === \"translatey\") {\n\t\t\t\t\t\tlet timeline = new TranslateYTimeline(frames, frames, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 0, scale));\n\t\t\t\t\t} else if (timelineName === \"scale\") {\n\t\t\t\t\t\tlet timeline = new ScaleTimeline(frames, frames << 1, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline2(timelineMap, timeline, \"x\", \"y\", 1, 1));\n\t\t\t\t\t} else if (timelineName === \"scalex\") {\n\t\t\t\t\t\tlet timeline = new ScaleXTimeline(frames, frames, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 1, 1));\n\t\t\t\t\t} else if (timelineName === \"scaley\") {\n\t\t\t\t\t\tlet timeline = new ScaleYTimeline(frames, frames, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 1, 1));\n\t\t\t\t\t} else if (timelineName === \"shear\") {\n\t\t\t\t\t\tlet timeline = new ShearTimeline(frames, frames << 1, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline2(timelineMap, timeline, \"x\", \"y\", 0, 1));\n\t\t\t\t\t} else if (timelineName === \"shearx\") {\n\t\t\t\t\t\tlet timeline = new ShearXTimeline(frames, frames, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 0, 1));\n\t\t\t\t\t} else if (timelineName === \"sheary\") {\n\t\t\t\t\t\tlet timeline = new ShearYTimeline(frames, frames, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 0, 1));\n\t\t\t\t\t} else if (timelineName === \"inherit\") {\n\t\t\t\t\t\tlet timeline = new InheritTimeline(frames, bone.index);\n\t\t\t\t\t\tfor (let frame = 0; frame < timelineMap.length; frame++) {\n\t\t\t\t\t\t\tlet aFrame = timelineMap[frame];\n\t\t\t\t\t\t\ttimeline.setFrame(frame, getValue(aFrame, \"time\", 0), Utils.enumValue(Inherit, getValue(aFrame, \"inherit\", \"Normal\")));\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// IK constraint timelines.\n\t\tif (map.ik) {\n\t\t\tfor (let constraintName in map.ik) {\n\t\t\t\tlet constraintMap = map.ik[constraintName];\n\t\t\t\tlet keyMap = constraintMap[0];\n\t\t\t\tif (!keyMap) continue;\n\n\t\t\t\tlet constraint = skeletonData.findIkConstraint(constraintName);\n\t\t\t\tif (!constraint) throw new Error(\"IK Constraint not found: \" + constraintName);\n\t\t\t\tlet constraintIndex = skeletonData.ikConstraints.indexOf(constraint);\n\t\t\t\tlet timeline = new IkConstraintTimeline(constraintMap.length, constraintMap.length << 1, constraintIndex);\n\n\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\tlet mix = getValue(keyMap, \"mix\", 1);\n\t\t\t\tlet softness = getValue(keyMap, \"softness\", 0) * scale;\n\n\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\ttimeline.setFrame(frame, time, mix, softness, getValue(keyMap, \"bendPositive\", true) ? 1 : -1, getValue(keyMap, \"compress\", false), getValue(keyMap, \"stretch\", false));\n\t\t\t\t\tlet nextMap = constraintMap[frame + 1];\n\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\tlet mix2 = getValue(nextMap, \"mix\", 1);\n\t\t\t\t\tlet softness2 = getValue(nextMap, \"softness\", 0) * scale;\n\t\t\t\t\tlet curve = keyMap.curve;\n\t\t\t\t\tif (curve) {\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mix, mix2, 1);\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, softness, softness2, scale);\n\t\t\t\t\t}\n\n\t\t\t\t\ttime = time2;\n\t\t\t\t\tmix = mix2;\n\t\t\t\t\tsoftness = softness2;\n\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t}\n\t\t\t\ttimelines.push(timeline);\n\t\t\t}\n\t\t}\n\n\t\t// Transform constraint timelines.\n\t\tif (map.transform) {\n\t\t\tfor (let constraintName in map.transform) {\n\t\t\t\tlet timelineMap = map.transform[constraintName];\n\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\tif (!keyMap) continue;\n\n\t\t\t\tlet constraint = skeletonData.findTransformConstraint(constraintName);\n\t\t\t\tif (!constraint) throw new Error(\"Transform constraint not found: \" + constraintName);\n\t\t\t\tlet constraintIndex = skeletonData.transformConstraints.indexOf(constraint);\n\t\t\t\tlet timeline = new TransformConstraintTimeline(timelineMap.length, timelineMap.length * 6, constraintIndex);\n\n\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\tlet mixRotate = getValue(keyMap, \"mixRotate\", 1);\n\t\t\t\tlet mixX = getValue(keyMap, \"mixX\", 1);\n\t\t\t\tlet mixY = getValue(keyMap, \"mixY\", mixX);\n\t\t\t\tlet mixScaleX = getValue(keyMap, \"mixScaleX\", 1);\n\t\t\t\tlet mixScaleY = getValue(keyMap, \"mixScaleY\", mixScaleX);\n\t\t\t\tlet mixShearY = getValue(keyMap, \"mixShearY\", 1);\n\n\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\ttimeline.setFrame(frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY);\n\t\t\t\t\tlet nextMap = timelineMap[frame + 1];\n\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\tlet mixRotate2 = getValue(nextMap, \"mixRotate\", 1);\n\t\t\t\t\tlet mixX2 = getValue(nextMap, \"mixX\", 1);\n\t\t\t\t\tlet mixY2 = getValue(nextMap, \"mixY\", mixX2);\n\t\t\t\t\tlet mixScaleX2 = getValue(nextMap, \"mixScaleX\", 1);\n\t\t\t\t\tlet mixScaleY2 = getValue(nextMap, \"mixScaleY\", mixScaleX2);\n\t\t\t\t\tlet mixShearY2 = getValue(nextMap, \"mixShearY\", 1);\n\t\t\t\t\tlet curve = keyMap.curve;\n\t\t\t\t\tif (curve) {\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mixRotate, mixRotate2, 1);\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, mixX, mixX2, 1);\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, mixY, mixY2, 1);\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, mixScaleX, mixScaleX2, 1);\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, mixScaleY, mixScaleY2, 1);\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, mixShearY, mixShearY2, 1);\n\t\t\t\t\t}\n\n\t\t\t\t\ttime = time2;\n\t\t\t\t\tmixRotate = mixRotate2;\n\t\t\t\t\tmixX = mixX2;\n\t\t\t\t\tmixY = mixY2;\n\t\t\t\t\tmixScaleX = mixScaleX2;\n\t\t\t\t\tmixScaleY = mixScaleY2;\n\t\t\t\t\tmixScaleX = mixScaleX2;\n\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t}\n\t\t\t\ttimelines.push(timeline);\n\t\t\t}\n\t\t}\n\n\t\t// Path constraint timelines.\n\t\tif (map.path) {\n\t\t\tfor (let constraintName in map.path) {\n\t\t\t\tlet constraintMap = map.path[constraintName];\n\t\t\t\tlet constraint = skeletonData.findPathConstraint(constraintName);\n\t\t\t\tif (!constraint) throw new Error(\"Path constraint not found: \" + constraintName);\n\t\t\t\tlet constraintIndex = skeletonData.pathConstraints.indexOf(constraint);\n\t\t\t\tfor (let timelineName in constraintMap) {\n\t\t\t\t\tlet timelineMap = constraintMap[timelineName];\n\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\tif (!keyMap) continue;\n\n\t\t\t\t\tlet frames = timelineMap.length;\n\t\t\t\t\tif (timelineName === \"position\") {\n\t\t\t\t\t\tlet timeline = new PathConstraintPositionTimeline(frames, frames, constraintIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 0, constraint.positionMode == PositionMode.Fixed ? scale : 1));\n\t\t\t\t\t} else if (timelineName === \"spacing\") {\n\t\t\t\t\t\tlet timeline = new PathConstraintSpacingTimeline(frames, frames, constraintIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 0, constraint.spacingMode == SpacingMode.Length || constraint.spacingMode == SpacingMode.Fixed ? scale : 1));\n\t\t\t\t\t} else if (timelineName === \"mix\") {\n\t\t\t\t\t\tlet timeline = new PathConstraintMixTimeline(frames, frames * 3, constraintIndex);\n\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\tlet mixRotate = getValue(keyMap, \"mixRotate\", 1);\n\t\t\t\t\t\tlet mixX = getValue(keyMap, \"mixX\", 1);\n\t\t\t\t\t\tlet mixY = getValue(keyMap, \"mixY\", mixX);\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, mixRotate, mixX, mixY);\n\t\t\t\t\t\t\tlet nextMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\t\t\tlet mixRotate2 = getValue(nextMap, \"mixRotate\", 1);\n\t\t\t\t\t\t\tlet mixX2 = getValue(nextMap, \"mixX\", 1);\n\t\t\t\t\t\t\tlet mixY2 = getValue(nextMap, \"mixY\", mixX2);\n\t\t\t\t\t\t\tlet curve = keyMap.curve;\n\t\t\t\t\t\t\tif (curve) {\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mixRotate, mixRotate2, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, mixX, mixX2, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, mixY, mixY2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tmixRotate = mixRotate2;\n\t\t\t\t\t\t\tmixX = mixX2;\n\t\t\t\t\t\t\tmixY = mixY2;\n\t\t\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Physics constraint timelines.\n\t\tif (map.physics) {\n\t\t\tfor (let constraintName in map.physics) {\n\t\t\t\tlet constraintMap = map.physics[constraintName];\n\t\t\t\tlet constraintIndex = -1;\n\t\t\t\tif (constraintName.length > 0) {\n\t\t\t\t\tlet constraint = skeletonData.findPhysicsConstraint(constraintName);\n\t\t\t\t\tif (!constraint) throw new Error(\"Physics constraint not found: \" + constraintName);\n\t\t\t\t\tconstraintIndex = skeletonData.physicsConstraints.indexOf(constraint);\n\t\t\t\t}\n\t\t\t\tfor (let timelineName in constraintMap) {\n\t\t\t\t\tlet timelineMap = constraintMap[timelineName];\n\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\tif (!keyMap) continue;\n\n\t\t\t\t\tlet frames = timelineMap.length;\n\t\t\t\t\tif (timelineName == \"reset\") {\n\t\t\t\t\t\tconst timeline = new PhysicsConstraintResetTimeline(frames, constraintIndex);\n\t\t\t\t\t\tfor (let frame = 0; keyMap != null; keyMap = timelineMap[frame + 1], frame++)\n\t\t\t\t\t\t\ttimeline.setFrame(frame, getValue(keyMap, \"time\", 0));\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet timeline;\n\t\t\t\t\tif (timelineName == \"inertia\")\n\t\t\t\t\t\ttimeline = new PhysicsConstraintInertiaTimeline(frames, frames, constraintIndex);\n\t\t\t\t\telse if (timelineName == \"strength\")\n\t\t\t\t\t\ttimeline = new PhysicsConstraintStrengthTimeline(frames, frames, constraintIndex);\n\t\t\t\t\telse if (timelineName == \"damping\")\n\t\t\t\t\t\ttimeline = new PhysicsConstraintDampingTimeline(frames, frames, constraintIndex);\n\t\t\t\t\telse if (timelineName == \"mass\")\n\t\t\t\t\t\ttimeline = new PhysicsConstraintMassTimeline(frames, frames, constraintIndex);\n\t\t\t\t\telse if (timelineName == \"wind\")\n\t\t\t\t\t\ttimeline = new PhysicsConstraintWindTimeline(frames, frames, constraintIndex);\n\t\t\t\t\telse if (timelineName == \"gravity\")\n\t\t\t\t\t\ttimeline = new PhysicsConstraintGravityTimeline(frames, frames, constraintIndex);\n\t\t\t\t\telse if (timelineName == \"mix\") //\n\t\t\t\t\t\ttimeline = new PhysicsConstraintMixTimeline(frames, frames, constraintIndex);\n\t\t\t\t\telse\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 0, 1));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Attachment timelines.\n\t\tif (map.attachments) {\n\t\t\tfor (let attachmentsName in map.attachments) {\n\t\t\t\tlet attachmentsMap = map.attachments[attachmentsName];\n\t\t\t\tlet skin = skeletonData.findSkin(attachmentsName);\n\t\t\t\tif (!skin) throw new Error(\"Skin not found: \" + attachmentsName);\n\t\t\t\tfor (let slotMapName in attachmentsMap) {\n\t\t\t\t\tlet slotMap = attachmentsMap[slotMapName];\n\t\t\t\t\tlet slot = skeletonData.findSlot(slotMapName);\n\t\t\t\t\tif (!slot) throw new Error(\"Slot not found: \" + slotMapName);\n\t\t\t\t\tlet slotIndex = slot.index;\n\t\t\t\t\tfor (let attachmentMapName in slotMap) {\n\t\t\t\t\t\tlet attachmentMap = slotMap[attachmentMapName];\n\t\t\t\t\t\tlet attachment = <VertexAttachment>skin.getAttachment(slotIndex, attachmentMapName);\n\n\t\t\t\t\t\tfor (let timelineMapName in attachmentMap) {\n\t\t\t\t\t\t\tlet timelineMap = attachmentMap[timelineMapName];\n\t\t\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\t\t\tif (!keyMap) continue;\n\n\t\t\t\t\t\t\tif (timelineMapName == \"deform\") {\n\t\t\t\t\t\t\t\tlet weighted = attachment.bones;\n\t\t\t\t\t\t\t\tlet vertices = attachment.vertices;\n\t\t\t\t\t\t\t\tlet deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\n\n\t\t\t\t\t\t\t\tlet timeline = new DeformTimeline(timelineMap.length, timelineMap.length, slotIndex, attachment);\n\t\t\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\t\t\tlet deform: NumberArrayLike;\n\t\t\t\t\t\t\t\t\tlet verticesValue: Array<Number> = getValue(keyMap, \"vertices\", null);\n\t\t\t\t\t\t\t\t\tif (!verticesValue)\n\t\t\t\t\t\t\t\t\t\tdeform = weighted ? Utils.newFloatArray(deformLength) : vertices;\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tdeform = Utils.newFloatArray(deformLength);\n\t\t\t\t\t\t\t\t\t\tlet start = <number>getValue(keyMap, \"offset\", 0);\n\t\t\t\t\t\t\t\t\t\tUtils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length);\n\t\t\t\t\t\t\t\t\t\tif (scale != 1) {\n\t\t\t\t\t\t\t\t\t\t\tfor (let i = start, n = i + verticesValue.length; i < n; i++)\n\t\t\t\t\t\t\t\t\t\t\t\tdeform[i] *= scale;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (!weighted) {\n\t\t\t\t\t\t\t\t\t\t\tfor (let i = 0; i < deformLength; i++)\n\t\t\t\t\t\t\t\t\t\t\t\tdeform[i] += vertices[i];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\ttimeline.setFrame(frame, time, deform);\n\t\t\t\t\t\t\t\t\tlet nextMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\t\t\t\t\tlet curve = keyMap.curve;\n\t\t\t\t\t\t\t\t\tif (curve) bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, 0, 1, 1);\n\t\t\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\t\t} else if (timelineMapName == \"sequence\") {\n\t\t\t\t\t\t\t\tlet timeline = new SequenceTimeline(timelineMap.length, slotIndex, attachment as unknown as HasTextureRegion);\n\t\t\t\t\t\t\t\tlet lastDelay = 0;\n\t\t\t\t\t\t\t\tfor (let frame = 0; frame < timelineMap.length; frame++) {\n\t\t\t\t\t\t\t\t\tlet delay = getValue(keyMap, \"delay\", lastDelay);\n\t\t\t\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\t\t\t\tlet mode = SequenceMode[getValue(keyMap, \"mode\", \"hold\")] as unknown as number;\n\t\t\t\t\t\t\t\t\tlet index = getValue(keyMap, \"index\", 0);\n\t\t\t\t\t\t\t\t\ttimeline.setFrame(frame, time, mode, index, delay);\n\t\t\t\t\t\t\t\t\tlastDelay = delay;\n\t\t\t\t\t\t\t\t\tkeyMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Draw order timelines.\n\t\tif (map.drawOrder) {\n\t\t\tlet timeline = new DrawOrderTimeline(map.drawOrder.length);\n\t\t\tlet slotCount = skeletonData.slots.length;\n\t\t\tlet frame = 0;\n\t\t\tfor (let i = 0; i < map.drawOrder.length; i++, frame++) {\n\t\t\t\tlet drawOrderMap = map.drawOrder[i];\n\t\t\t\tlet drawOrder: Array<number> | null = null;\n\t\t\t\tlet offsets = getValue(drawOrderMap, \"offsets\", null);\n\t\t\t\tif (offsets) {\n\t\t\t\t\tdrawOrder = Utils.newArray<number>(slotCount, -1);\n\t\t\t\t\tlet unchanged = Utils.newArray<number>(slotCount - offsets.length, 0);\n\t\t\t\t\tlet originalIndex = 0, unchangedIndex = 0;\n\t\t\t\t\tfor (let ii = 0; ii < offsets.length; ii++) {\n\t\t\t\t\t\tlet offsetMap = offsets[ii];\n\t\t\t\t\t\tlet slot = skeletonData.findSlot(offsetMap.slot);\n\t\t\t\t\t\tif (!slot) throw new Error(\"Slot not found: \" + slot);\n\t\t\t\t\t\tlet slotIndex = slot.index;\n\t\t\t\t\t\t// Collect unchanged items.\n\t\t\t\t\t\twhile (originalIndex != slotIndex)\n\t\t\t\t\t\t\tunchanged[unchangedIndex++] = originalIndex++;\n\t\t\t\t\t\t// Set changed items.\n\t\t\t\t\t\tdrawOrder[originalIndex + offsetMap.offset] = originalIndex++;\n\t\t\t\t\t}\n\t\t\t\t\t// Collect remaining unchanged items.\n\t\t\t\t\twhile (originalIndex < slotCount)\n\t\t\t\t\t\tunchanged[unchangedIndex++] = originalIndex++;\n\t\t\t\t\t// Fill in unchanged items.\n\t\t\t\t\tfor (let ii = slotCount - 1; ii >= 0; ii--)\n\t\t\t\t\t\tif (drawOrder[ii] == -1) drawOrder[ii] = unchanged[--unchangedIndex];\n\t\t\t\t}\n\t\t\t\ttimeline.setFrame(frame, getValue(drawOrderMap, \"time\", 0), drawOrder);\n\t\t\t}\n\t\t\ttimelines.push(timeline);\n\t\t}\n\n\t\t// Event timelines.\n\t\tif (map.events) {\n\t\t\tlet timeline = new EventTimeline(map.events.length);\n\t\t\tlet frame = 0;\n\t\t\tfor (let i = 0; i < map.events.length; i++, frame++) {\n\t\t\t\tlet eventMap = map.events[i];\n\t\t\t\tlet eventData = skeletonData.findEvent(eventMap.name);\n\t\t\t\tif (!eventData) throw new Error(\"Event not found: \" + eventMap.name);\n\t\t\t\tlet event = new Event(Utils.toSinglePrecision(getValue(eventMap, \"time\", 0)), eventData);\n\t\t\t\tevent.intValue = getValue(eventMap, \"int\", eventData.intValue);\n\t\t\t\tevent.floatValue = getValue(eventMap, \"float\", eventData.floatValue);\n\t\t\t\tevent.stringValue = getValue(eventMap, \"string\", eventData.stringValue);\n\t\t\t\tif (event.data.audioPath) {\n\t\t\t\t\tevent.volume = getValue(eventMap, \"volume\", 1);\n\t\t\t\t\tevent.balance = getValue(eventMap, \"balance\", 0);\n\t\t\t\t}\n\t\t\t\ttimeline.setFrame(frame, event);\n\t\t\t}\n\t\t\ttimelines.push(timeline);\n\t\t}\n\n\t\tlet duration = 0;\n\t\tfor (let i = 0, n = timelines.length; i < n; i++)\n\t\t\tduration = Math.max(duration, timelines[i].getDuration());\n\t\tskeletonData.animations.push(new Animation(name, timelines, duration));\n\t}\n}\n\nclass LinkedMesh {\n\tparent: string; skin: string;\n\tslotIndex: number;\n\tmesh: MeshAttachment;\n\tinheritTimeline: boolean;\n\n\tconstructor (mesh: MeshAttachment, skin: string, slotIndex: number, parent: string, inheritDeform: boolean) {\n\t\tthis.mesh = mesh;\n\t\tthis.skin = skin;\n\t\tthis.slotIndex = slotIndex;\n\t\tthis.parent = parent;\n\t\tthis.inheritTimeline = inheritDeform;\n\t}\n}\n\nfunction readTimeline1 (keys: any[], timeline: CurveTimeline1, defaultValue: number, scale: number) {\n\tlet keyMap = keys[0];\n\tlet time = getValue(keyMap, \"time\", 0);\n\tlet value = getValue(keyMap, \"value\", defaultValue) * scale;\n\tlet bezier = 0;\n\tfor (let frame = 0; ; frame++) {\n\t\ttimeline.setFrame(frame, time, value);\n\t\tlet nextMap = keys[frame + 1];\n\t\tif (!nextMap) {\n\t\t\ttimeline.shrink(bezier);\n\t\t\treturn timeline;\n\t\t}\n\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\tlet value2 = getValue(nextMap, \"value\", defaultValue) * scale;\n\t\tif (keyMap.curve) bezier = readCurve(keyMap.curve, timeline, bezier, frame, 0, time, time2, value, value2, scale);\n\t\ttime = time2;\n\t\tvalue = value2;\n\t\tkeyMap = nextMap;\n\t}\n}\n\nfunction readTimeline2 (keys: any[], timeline: CurveTimeline2, name1: string, name2: string, defaultValue: number, scale: number) {\n\tlet keyMap = keys[0];\n\tlet time = getValue(keyMap, \"time\", 0);\n\tlet value1 = getValue(keyMap, name1, defaultValue) * scale;\n\tlet value2 = getValue(keyMap, name2, defaultValue) * scale;\n\tlet bezier = 0;\n\tfor (let frame = 0; ; frame++) {\n\t\ttimeline.setFrame(frame, time, value1, value2);\n\t\tlet nextMap = keys[frame + 1];\n\t\tif (!nextMap) {\n\t\t\ttimeline.shrink(bezier);\n\t\t\treturn timeline;\n\t\t}\n\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\tlet nvalue1 = getValue(nextMap, name1, defaultValue) * scale;\n\t\tlet nvalue2 = getValue(nextMap, name2, defaultValue) * scale;\n\t\tlet curve = keyMap.curve;\n\t\tif (curve) {\n\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, value1, nvalue1, scale);\n\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, value2, nvalue2, scale);\n\t\t}\n\t\ttime = time2;\n\t\tvalue1 = nvalue1;\n\t\tvalue2 = nvalue2;\n\t\tkeyMap = nextMap;\n\t}\n}\n\nfunction readCurve (curve: any, timeline: CurveTimeline, bezier: number, frame: number, value: number, time1: number, time2: number,\n\tvalue1: number, value2: number, scale: number) {\n\tif (curve == \"stepped\") {\n\t\ttimeline.setStepped(frame);\n\t\treturn bezier;\n\t}\n\tlet i = value << 2;\n\tlet cx1 = curve[i];\n\tlet cy1 = curve[i + 1] * scale;\n\tlet cx2 = curve[i + 2];\n\tlet cy2 = curve[i + 3] * scale;\n\ttimeline.setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2);\n\treturn bezier + 1;\n}\n\nfunction getValue (map: any, property: string, defaultValue: any) {\n\treturn map[property] !== undefined ? map[property] : defaultValue;\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n(() => {\n\tif (typeof Math.fround === \"undefined\") {\n\t\tMath.fround = (function (array) {\n\t\t\treturn function (x: number) {\n\t\t\t\treturn array[0] = x, array[0];\n\t\t\t};\n\t\t})(new Float32Array(1));\n\t}\n})();\n\nexport { }\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Restorable, BlendMode } from \"@esotericsoftware/spine-core\";\n\nexport class ManagedWebGLRenderingContext {\n\tpublic canvas: HTMLCanvasElement | OffscreenCanvas;\n\tpublic gl: WebGLRenderingContext;\n\tprivate restorables = new Array<Restorable>();\n\n\tconstructor (canvasOrContext: HTMLCanvasElement | WebGLRenderingContext, contextConfig: any = { alpha: \"true\" }) {\n\t\tif (!((canvasOrContext instanceof WebGLRenderingContext) || (typeof WebGL2RenderingContext !== 'undefined' && canvasOrContext instanceof WebGL2RenderingContext))) {\n\t\t\tlet canvas: HTMLCanvasElement = canvasOrContext;\n\t\t\tthis.gl = <WebGLRenderingContext>(canvas.getContext(\"webgl2\", contextConfig) || canvas.getContext(\"webgl\", contextConfig));\n\t\t\tthis.canvas = canvas;\n\t\t\tcanvas.addEventListener(\"webglcontextlost\", (e: any) => {\n\t\t\t\tlet event = <WebGLContextEvent>e;\n\t\t\t\tif (e) e.preventDefault();\n\t\t\t});\n\t\t\tcanvas.addEventListener(\"webglcontextrestored\", (e: any) => {\n\t\t\t\tfor (let i = 0, n = this.restorables.length; i < n; i++)\n\t\t\t\t\tthis.restorables[i].restore();\n\t\t\t});\n\t\t} else {\n\t\t\tthis.gl = canvasOrContext;\n\t\t\tthis.canvas = this.gl.canvas;\n\t\t}\n\t}\n\n\taddRestorable (restorable: Restorable) {\n\t\tthis.restorables.push(restorable);\n\t}\n\n\tremoveRestorable (restorable: Restorable) {\n\t\tlet index = this.restorables.indexOf(restorable);\n\t\tif (index > -1) this.restorables.splice(index, 1);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Texture, Disposable, Restorable, TextureFilter, TextureWrap } from \"@esotericsoftware/spine-core\";\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\n\nexport class GLTexture extends Texture implements Disposable, Restorable {\n\tcontext: ManagedWebGLRenderingContext;\n\tprivate texture: WebGLTexture | null = null;\n\tprivate boundUnit = 0;\n\tprivate useMipMaps = false;\n\n\tpublic static DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL = false;\n\n\tconstructor (context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement | ImageBitmap, useMipMaps: boolean = false) {\n\t\tsuper(image);\n\t\tthis.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context);\n\t\tthis.useMipMaps = useMipMaps;\n\t\tthis.restore();\n\t\tthis.context.addRestorable(this);\n\t}\n\n\tsetFilters (minFilter: TextureFilter, magFilter: TextureFilter) {\n\t\tlet gl = this.context.gl;\n\t\tthis.bind();\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, GLTexture.validateMagFilter(magFilter));\n\t\tthis.useMipMaps = GLTexture.usesMipMaps(minFilter);\n\t\tif (this.useMipMaps) gl.generateMipmap(gl.TEXTURE_2D);\n\t}\n\n\tstatic validateMagFilter (magFilter: TextureFilter) {\n\t\tswitch (magFilter) {\n\t\t\tcase TextureFilter.MipMapLinearLinear:\n\t\t\tcase TextureFilter.MipMapLinearNearest:\n\t\t\tcase TextureFilter.MipMapNearestLinear:\n\t\t\tcase TextureFilter.MipMapNearestNearest:\n\t\t\t\treturn TextureFilter.Linear;\n\t\t\tdefault:\n\t\t\t\treturn magFilter;\n\t\t}\n\t}\n\n\tstatic usesMipMaps (filter: TextureFilter) {\n\t\tswitch (filter) {\n\t\t\tcase TextureFilter.MipMapLinearLinear:\n\t\t\tcase TextureFilter.MipMapLinearNearest:\n\t\t\tcase TextureFilter.MipMapNearestLinear:\n\t\t\tcase TextureFilter.MipMapNearestNearest:\n\t\t\t\treturn true;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t}\n\n\tsetWraps (uWrap: TextureWrap, vWrap: TextureWrap) {\n\t\tlet gl = this.context.gl;\n\t\tthis.bind();\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, uWrap);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, vWrap);\n\t}\n\n\tupdate (useMipMaps: boolean) {\n\t\tlet gl = this.context.gl;\n\t\tif (!this.texture) this.texture = this.context.gl.createTexture();\n\t\tthis.bind();\n\t\tif (GLTexture.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL) gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n\t\tgl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._image);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\t\tif (useMipMaps) gl.generateMipmap(gl.TEXTURE_2D);\n\t}\n\n\trestore () {\n\t\tthis.texture = null;\n\t\tthis.update(this.useMipMaps);\n\t}\n\n\tbind (unit: number = 0) {\n\t\tlet gl = this.context.gl;\n\t\tthis.boundUnit = unit;\n\t\tgl.activeTexture(gl.TEXTURE0 + unit);\n\t\tgl.bindTexture(gl.TEXTURE_2D, this.texture);\n\t}\n\n\tunbind () {\n\t\tlet gl = this.context.gl;\n\t\tgl.activeTexture(gl.TEXTURE0 + this.boundUnit);\n\t\tgl.bindTexture(gl.TEXTURE_2D, null);\n\t}\n\n\tdispose () {\n\t\tthis.context.removeRestorable(this);\n\t\tlet gl = this.context.gl;\n\t\tgl.deleteTexture(this.texture);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { AssetManagerBase, Downloader } from \"@esotericsoftware/spine-core\"\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\nimport { GLTexture } from \"./GLTexture.js\";\n\n\nexport class AssetManager extends AssetManagerBase {\n\tconstructor (context: ManagedWebGLRenderingContext | WebGLRenderingContext, pathPrefix: string = \"\", downloader: Downloader = new Downloader()) {\n\t\tsuper((image: HTMLImageElement | ImageBitmap) => {\n\t\t\treturn new GLTexture(context, image);\n\t\t}, pathPrefix, downloader);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Matrix4, M00, M01, M02, M03, M10, M11, M12, M13, M20, M21, M22, M23, M30, M31, M32, M33 } from \"./Matrix4.js\";\n\nexport class Vector3 {\n\tx = 0;\n\ty = 0;\n\tz = 0;\n\n\tconstructor (x: number = 0, y: number = 0, z: number = 0) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t}\n\n\tsetFrom (v: Vector3): Vector3 {\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\t\treturn this;\n\t}\n\n\tset (x: number, y: number, z: number): Vector3 {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\treturn this;\n\t}\n\n\tadd (v: Vector3): Vector3 {\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\t\treturn this;\n\t}\n\n\tsub (v: Vector3): Vector3 {\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\t\treturn this;\n\t}\n\n\tscale (s: number): Vector3 {\n\t\tthis.x *= s;\n\t\tthis.y *= s;\n\t\tthis.z *= s;\n\t\treturn this;\n\t}\n\n\tnormalize (): Vector3 {\n\t\tlet len = this.length();\n\t\tif (len == 0) return this;\n\t\tlen = 1 / len;\n\t\tthis.x *= len;\n\t\tthis.y *= len;\n\t\tthis.z *= len;\n\t\treturn this;\n\t}\n\n\tcross (v: Vector3): Vector3 {\n\t\treturn this.set(this.y * v.z - this.z * v.y, this.z * v.x - this.x * v.z, this.x * v.y - this.y * v.x)\n\t}\n\n\tmultiply (matrix: Matrix4): Vector3 {\n\t\tlet l_mat = matrix.values;\n\t\treturn this.set(this.x * l_mat[M00] + this.y * l_mat[M01] + this.z * l_mat[M02] + l_mat[M03],\n\t\t\tthis.x * l_mat[M10] + this.y * l_mat[M11] + this.z * l_mat[M12] + l_mat[M13],\n\t\t\tthis.x * l_mat[M20] + this.y * l_mat[M21] + this.z * l_mat[M22] + l_mat[M23]);\n\t}\n\n\tproject (matrix: Matrix4): Vector3 {\n\t\tlet l_mat = matrix.values;\n\t\tlet l_w = 1 / (this.x * l_mat[M30] + this.y * l_mat[M31] + this.z * l_mat[M32] + l_mat[M33]);\n\t\treturn this.set((this.x * l_mat[M00] + this.y * l_mat[M01] + this.z * l_mat[M02] + l_mat[M03]) * l_w,\n\t\t\t(this.x * l_mat[M10] + this.y * l_mat[M11] + this.z * l_mat[M12] + l_mat[M13]) * l_w,\n\t\t\t(this.x * l_mat[M20] + this.y * l_mat[M21] + this.z * l_mat[M22] + l_mat[M23]) * l_w);\n\t}\n\n\tdot (v: Vector3): number {\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z;\n\t}\n\n\tlength (): number {\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n\t}\n\n\tdistance (v: Vector3): number {\n\t\tlet a = v.x - this.x;\n\t\tlet b = v.y - this.y;\n\t\tlet c = v.z - this.z;\n\t\treturn Math.sqrt(a * a + b * b + c * c);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Vector3 } from \"./Vector3.js\";\n\nexport const M00 = 0;\nexport const M01 = 4;\nexport const M02 = 8;\nexport const M03 = 12;\nexport const M10 = 1;\nexport const M11 = 5;\nexport const M12 = 9;\nexport const M13 = 13;\nexport const M20 = 2;\nexport const M21 = 6;\nexport const M22 = 10;\nexport const M23 = 14;\nexport const M30 = 3;\nexport const M31 = 7;\nexport const M32 = 11;\nexport const M33 = 15;\n\nexport class Matrix4 {\n\ttemp: Float32Array = new Float32Array(16);\n\tvalues: Float32Array = new Float32Array(16);\n\n\tprivate static xAxis = new Vector3();\n\tprivate static yAxis = new Vector3();\n\tprivate static zAxis = new Vector3();\n\tprivate static tmpMatrix = new Matrix4();\n\n\tconstructor () {\n\t\tlet v = this.values;\n\t\tv[M00] = 1;\n\t\tv[M11] = 1;\n\t\tv[M22] = 1;\n\t\tv[M33] = 1;\n\t}\n\n\tset (values: ArrayLike<number>): Matrix4 {\n\t\tthis.values.set(values);\n\t\treturn this;\n\t}\n\n\ttranspose (): Matrix4 {\n\t\tlet t = this.temp;\n\t\tlet v = this.values;\n\t\tt[M00] = v[M00];\n\t\tt[M01] = v[M10];\n\t\tt[M02] = v[M20];\n\t\tt[M03] = v[M30];\n\t\tt[M10] = v[M01];\n\t\tt[M11] = v[M11];\n\t\tt[M12] = v[M21];\n\t\tt[M13] = v[M31];\n\t\tt[M20] = v[M02];\n\t\tt[M21] = v[M12];\n\t\tt[M22] = v[M22];\n\t\tt[M23] = v[M32];\n\t\tt[M30] = v[M03];\n\t\tt[M31] = v[M13];\n\t\tt[M32] = v[M23];\n\t\tt[M33] = v[M33];\n\t\treturn this.set(t);\n\t}\n\n\tidentity (): Matrix4 {\n\t\tlet v = this.values;\n\t\tv[M00] = 1;\n\t\tv[M01] = 0;\n\t\tv[M02] = 0;\n\t\tv[M03] = 0;\n\t\tv[M10] = 0;\n\t\tv[M11] = 1;\n\t\tv[M12] = 0;\n\t\tv[M13] = 0;\n\t\tv[M20] = 0;\n\t\tv[M21] = 0;\n\t\tv[M22] = 1;\n\t\tv[M23] = 0;\n\t\tv[M30] = 0;\n\t\tv[M31] = 0;\n\t\tv[M32] = 0;\n\t\tv[M33] = 1;\n\t\treturn this;\n\t}\n\n\tinvert (): Matrix4 {\n\t\tlet v = this.values;\n\t\tlet t = this.temp;\n\t\tlet l_det = v[M30] * v[M21] * v[M12] * v[M03] - v[M20] * v[M31] * v[M12] * v[M03] - v[M30] * v[M11] * v[M22] * v[M03]\n\t\t\t+ v[M10] * v[M31] * v[M22] * v[M03] + v[M20] * v[M11] * v[M32] * v[M03] - v[M10] * v[M21] * v[M32] * v[M03]\n\t\t\t- v[M30] * v[M21] * v[M02] * v[M13] + v[M20] * v[M31] * v[M02] * v[M13] + v[M30] * v[M01] * v[M22] * v[M13]\n\t\t\t- v[M00] * v[M31] * v[M22] * v[M13] - v[M20] * v[M01] * v[M32] * v[M13] + v[M00] * v[M21] * v[M32] * v[M13]\n\t\t\t+ v[M30] * v[M11] * v[M02] * v[M23] - v[M10] * v[M31] * v[M02] * v[M23] - v[M30] * v[M01] * v[M12] * v[M23]\n\t\t\t+ v[M00] * v[M31] * v[M12] * v[M23] + v[M10] * v[M01] * v[M32] * v[M23] - v[M00] * v[M11] * v[M32] * v[M23]\n\t\t\t- v[M20] * v[M11] * v[M02] * v[M33] + v[M10] * v[M21] * v[M02] * v[M33] + v[M20] * v[M01] * v[M12] * v[M33]\n\t\t\t- v[M00] * v[M21] * v[M12] * v[M33] - v[M10] * v[M01] * v[M22] * v[M33] + v[M00] * v[M11] * v[M22] * v[M33];\n\t\tif (l_det == 0) throw new Error(\"non-invertible matrix\");\n\t\tlet inv_det = 1.0 / l_det;\n\t\tt[M00] = v[M12] * v[M23] * v[M31] - v[M13] * v[M22] * v[M31] + v[M13] * v[M21] * v[M32]\n\t\t\t- v[M11] * v[M23] * v[M32] - v[M12] * v[M21] * v[M33] + v[M11] * v[M22] * v[M33];\n\t\tt[M01] = v[M03] * v[M22] * v[M31] - v[M02] * v[M23] * v[M31] - v[M03] * v[M21] * v[M32]\n\t\t\t+ v[M01] * v[M23] * v[M32] + v[M02] * v[M21] * v[M33] - v[M01] * v[M22] * v[M33];\n\t\tt[M02] = v[M02] * v[M13] * v[M31] - v[M03] * v[M12] * v[M31] + v[M03] * v[M11] * v[M32]\n\t\t\t- v[M01] * v[M13] * v[M32] - v[M02] * v[M11] * v[M33] + v[M01] * v[M12] * v[M33];\n\t\tt[M03] = v[M03] * v[M12] * v[M21] - v[M02] * v[M13] * v[M21] - v[M03] * v[M11] * v[M22]\n\t\t\t+ v[M01] * v[M13] * v[M22] + v[M02] * v[M11] * v[M23] - v[M01] * v[M12] * v[M23];\n\t\tt[M10] = v[M13] * v[M22] * v[M30] - v[M12] * v[M23] * v[M30] - v[M13] * v[M20] * v[M32]\n\t\t\t+ v[M10] * v[M23] * v[M32] + v[M12] * v[M20] * v[M33] - v[M10] * v[M22] * v[M33];\n\t\tt[M11] = v[M02] * v[M23] * v[M30] - v[M03] * v[M22] * v[M30] + v[M03] * v[M20] * v[M32]\n\t\t\t- v[M00] * v[M23] * v[M32] - v[M02] * v[M20] * v[M33] + v[M00] * v[M22] * v[M33];\n\t\tt[M12] = v[M03] * v[M12] * v[M30] - v[M02] * v[M13] * v[M30] - v[M03] * v[M10] * v[M32]\n\t\t\t+ v[M00] * v[M13] * v[M32] + v[M02] * v[M10] * v[M33] - v[M00] * v[M12] * v[M33];\n\t\tt[M13] = v[M02] * v[M13] * v[M20] - v[M03] * v[M12] * v[M20] + v[M03] * v[M10] * v[M22]\n\t\t\t- v[M00] * v[M13] * v[M22] - v[M02] * v[M10] * v[M23] + v[M00] * v[M12] * v[M23];\n\t\tt[M20] = v[M11] * v[M23] * v[M30] - v[M13] * v[M21] * v[M30] + v[M13] * v[M20] * v[M31]\n\t\t\t- v[M10] * v[M23] * v[M31] - v[M11] * v[M20] * v[M33] + v[M10] * v[M21] * v[M33];\n\t\tt[M21] = v[M03] * v[M21] * v[M30] - v[M01] * v[M23] * v[M30] - v[M03] * v[M20] * v[M31]\n\t\t\t+ v[M00] * v[M23] * v[M31] + v[M01] * v[M20] * v[M33] - v[M00] * v[M21] * v[M33];\n\t\tt[M22] = v[M01] * v[M13] * v[M30] - v[M03] * v[M11] * v[M30] + v[M03] * v[M10] * v[M31]\n\t\t\t- v[M00] * v[M13] * v[M31] - v[M01] * v[M10] * v[M33] + v[M00] * v[M11] * v[M33];\n\t\tt[M23] = v[M03] * v[M11] * v[M20] - v[M01] * v[M13] * v[M20] - v[M03] * v[M10] * v[M21]\n\t\t\t+ v[M00] * v[M13] * v[M21] + v[M01] * v[M10] * v[M23] - v[M00] * v[M11] * v[M23];\n\t\tt[M30] = v[M12] * v[M21] * v[M30] - v[M11] * v[M22] * v[M30] - v[M12] * v[M20] * v[M31]\n\t\t\t+ v[M10] * v[M22] * v[M31] + v[M11] * v[M20] * v[M32] - v[M10] * v[M21] * v[M32];\n\t\tt[M31] = v[M01] * v[M22] * v[M30] - v[M02] * v[M21] * v[M30] + v[M02] * v[M20] * v[M31]\n\t\t\t- v[M00] * v[M22] * v[M31] - v[M01] * v[M20] * v[M32] + v[M00] * v[M21] * v[M32];\n\t\tt[M32] = v[M02] * v[M11] * v[M30] - v[M01] * v[M12] * v[M30] - v[M02] * v[M10] * v[M31]\n\t\t\t+ v[M00] * v[M12] * v[M31] + v[M01] * v[M10] * v[M32] - v[M00] * v[M11] * v[M32];\n\t\tt[M33] = v[M01] * v[M12] * v[M20] - v[M02] * v[M11] * v[M20] + v[M02] * v[M10] * v[M21]\n\t\t\t- v[M00] * v[M12] * v[M21] - v[M01] * v[M10] * v[M22] + v[M00] * v[M11] * v[M22];\n\t\tv[M00] = t[M00] * inv_det;\n\t\tv[M01] = t[M01] * inv_det;\n\t\tv[M02] = t[M02] * inv_det;\n\t\tv[M03] = t[M03] * inv_det;\n\t\tv[M10] = t[M10] * inv_det;\n\t\tv[M11] = t[M11] * inv_det;\n\t\tv[M12] = t[M12] * inv_det;\n\t\tv[M13] = t[M13] * inv_det;\n\t\tv[M20] = t[M20] * inv_det;\n\t\tv[M21] = t[M21] * inv_det;\n\t\tv[M22] = t[M22] * inv_det;\n\t\tv[M23] = t[M23] * inv_det;\n\t\tv[M30] = t[M30] * inv_det;\n\t\tv[M31] = t[M31] * inv_det;\n\t\tv[M32] = t[M32] * inv_det;\n\t\tv[M33] = t[M33] * inv_det;\n\t\treturn this;\n\t}\n\n\tdeterminant (): number {\n\t\tlet v = this.values;\n\t\treturn v[M30] * v[M21] * v[M12] * v[M03] - v[M20] * v[M31] * v[M12] * v[M03] - v[M30] * v[M11] * v[M22] * v[M03]\n\t\t\t+ v[M10] * v[M31] * v[M22] * v[M03] + v[M20] * v[M11] * v[M32] * v[M03] - v[M10] * v[M21] * v[M32] * v[M03]\n\t\t\t- v[M30] * v[M21] * v[M02] * v[M13] + v[M20] * v[M31] * v[M02] * v[M13] + v[M30] * v[M01] * v[M22] * v[M13]\n\t\t\t- v[M00] * v[M31] * v[M22] * v[M13] - v[M20] * v[M01] * v[M32] * v[M13] + v[M00] * v[M21] * v[M32] * v[M13]\n\t\t\t+ v[M30] * v[M11] * v[M02] * v[M23] - v[M10] * v[M31] * v[M02] * v[M23] - v[M30] * v[M01] * v[M12] * v[M23]\n\t\t\t+ v[M00] * v[M31] * v[M12] * v[M23] + v[M10] * v[M01] * v[M32] * v[M23] - v[M00] * v[M11] * v[M32] * v[M23]\n\t\t\t- v[M20] * v[M11] * v[M02] * v[M33] + v[M10] * v[M21] * v[M02] * v[M33] + v[M20] * v[M01] * v[M12] * v[M33]\n\t\t\t- v[M00] * v[M21] * v[M12] * v[M33] - v[M10] * v[M01] * v[M22] * v[M33] + v[M00] * v[M11] * v[M22] * v[M33];\n\t}\n\n\ttranslate (x: number, y: number, z: number): Matrix4 {\n\t\tlet v = this.values;\n\t\tv[M03] += x;\n\t\tv[M13] += y;\n\t\tv[M23] += z;\n\t\treturn this;\n\t}\n\n\tcopy (): Matrix4 {\n\t\treturn new Matrix4().set(this.values);\n\t}\n\n\tprojection (near: number, far: number, fovy: number, aspectRatio: number): Matrix4 {\n\t\tthis.identity();\n\t\tlet l_fd = (1.0 / Math.tan((fovy * (Math.PI / 180)) / 2.0));\n\t\tlet l_a1 = (far + near) / (near - far);\n\t\tlet l_a2 = (2 * far * near) / (near - far);\n\t\tlet v = this.values;\n\t\tv[M00] = l_fd / aspectRatio;\n\t\tv[M10] = 0;\n\t\tv[M20] = 0;\n\t\tv[M30] = 0;\n\t\tv[M01] = 0;\n\t\tv[M11] = l_fd;\n\t\tv[M21] = 0;\n\t\tv[M31] = 0;\n\t\tv[M02] = 0;\n\t\tv[M12] = 0;\n\t\tv[M22] = l_a1;\n\t\tv[M32] = -1;\n\t\tv[M03] = 0;\n\t\tv[M13] = 0;\n\t\tv[M23] = l_a2;\n\t\tv[M33] = 0;\n\t\treturn this;\n\t}\n\n\tortho2d (x: number, y: number, width: number, height: number): Matrix4 {\n\t\treturn this.ortho(x, x + width, y, y + height, 0, 1);\n\t}\n\n\tortho (left: number, right: number, bottom: number, top: number, near: number, far: number): Matrix4 {\n\t\tthis.identity();\n\t\tlet x_orth = 2 / (right - left);\n\t\tlet y_orth = 2 / (top - bottom);\n\t\tlet z_orth = -2 / (far - near);\n\n\t\tlet tx = -(right + left) / (right - left);\n\t\tlet ty = -(top + bottom) / (top - bottom);\n\t\tlet tz = -(far + near) / (far - near);\n\n\t\tlet v = this.values;\n\t\tv[M00] = x_orth;\n\t\tv[M10] = 0;\n\t\tv[M20] = 0;\n\t\tv[M30] = 0;\n\t\tv[M01] = 0;\n\t\tv[M11] = y_orth;\n\t\tv[M21] = 0;\n\t\tv[M31] = 0;\n\t\tv[M02] = 0;\n\t\tv[M12] = 0;\n\t\tv[M22] = z_orth;\n\t\tv[M32] = 0;\n\t\tv[M03] = tx;\n\t\tv[M13] = ty;\n\t\tv[M23] = tz;\n\t\tv[M33] = 1;\n\t\treturn this;\n\t}\n\n\tmultiply (matrix: Matrix4): Matrix4 {\n\t\tlet t = this.temp;\n\t\tlet v = this.values;\n\t\tlet m = matrix.values;\n\t\tt[M00] = v[M00] * m[M00] + v[M01] * m[M10] + v[M02] * m[M20] + v[M03] * m[M30];\n\t\tt[M01] = v[M00] * m[M01] + v[M01] * m[M11] + v[M02] * m[M21] + v[M03] * m[M31];\n\t\tt[M02] = v[M00] * m[M02] + v[M01] * m[M12] + v[M02] * m[M22] + v[M03] * m[M32];\n\t\tt[M03] = v[M00] * m[M03] + v[M01] * m[M13] + v[M02] * m[M23] + v[M03] * m[M33];\n\t\tt[M10] = v[M10] * m[M00] + v[M11] * m[M10] + v[M12] * m[M20] + v[M13] * m[M30];\n\t\tt[M11] = v[M10] * m[M01] + v[M11] * m[M11] + v[M12] * m[M21] + v[M13] * m[M31];\n\t\tt[M12] = v[M10] * m[M02] + v[M11] * m[M12] + v[M12] * m[M22] + v[M13] * m[M32];\n\t\tt[M13] = v[M10] * m[M03] + v[M11] * m[M13] + v[M12] * m[M23] + v[M13] * m[M33];\n\t\tt[M20] = v[M20] * m[M00] + v[M21] * m[M10] + v[M22] * m[M20] + v[M23] * m[M30];\n\t\tt[M21] = v[M20] * m[M01] + v[M21] * m[M11] + v[M22] * m[M21] + v[M23] * m[M31];\n\t\tt[M22] = v[M20] * m[M02] + v[M21] * m[M12] + v[M22] * m[M22] + v[M23] * m[M32];\n\t\tt[M23] = v[M20] * m[M03] + v[M21] * m[M13] + v[M22] * m[M23] + v[M23] * m[M33];\n\t\tt[M30] = v[M30] * m[M00] + v[M31] * m[M10] + v[M32] * m[M20] + v[M33] * m[M30];\n\t\tt[M31] = v[M30] * m[M01] + v[M31] * m[M11] + v[M32] * m[M21] + v[M33] * m[M31];\n\t\tt[M32] = v[M30] * m[M02] + v[M31] * m[M12] + v[M32] * m[M22] + v[M33] * m[M32];\n\t\tt[M33] = v[M30] * m[M03] + v[M31] * m[M13] + v[M32] * m[M23] + v[M33] * m[M33];\n\t\treturn this.set(this.temp);\n\t}\n\n\tmultiplyLeft (matrix: Matrix4): Matrix4 {\n\t\tlet t = this.temp;\n\t\tlet v = this.values;\n\t\tlet m = matrix.values;\n\t\tt[M00] = m[M00] * v[M00] + m[M01] * v[M10] + m[M02] * v[M20] + m[M03] * v[M30];\n\t\tt[M01] = m[M00] * v[M01] + m[M01] * v[M11] + m[M02] * v[M21] + m[M03] * v[M31];\n\t\tt[M02] = m[M00] * v[M02] + m[M01] * v[M12] + m[M02] * v[M22] + m[M03] * v[M32];\n\t\tt[M03] = m[M00] * v[M03] + m[M01] * v[M13] + m[M02] * v[M23] + m[M03] * v[M33];\n\t\tt[M10] = m[M10] * v[M00] + m[M11] * v[M10] + m[M12] * v[M20] + m[M13] * v[M30];\n\t\tt[M11] = m[M10] * v[M01] + m[M11] * v[M11] + m[M12] * v[M21] + m[M13] * v[M31];\n\t\tt[M12] = m[M10] * v[M02] + m[M11] * v[M12] + m[M12] * v[M22] + m[M13] * v[M32];\n\t\tt[M13] = m[M10] * v[M03] + m[M11] * v[M13] + m[M12] * v[M23] + m[M13] * v[M33];\n\t\tt[M20] = m[M20] * v[M00] + m[M21] * v[M10] + m[M22] * v[M20] + m[M23] * v[M30];\n\t\tt[M21] = m[M20] * v[M01] + m[M21] * v[M11] + m[M22] * v[M21] + m[M23] * v[M31];\n\t\tt[M22] = m[M20] * v[M02] + m[M21] * v[M12] + m[M22] * v[M22] + m[M23] * v[M32];\n\t\tt[M23] = m[M20] * v[M03] + m[M21] * v[M13] + m[M22] * v[M23] + m[M23] * v[M33];\n\t\tt[M30] = m[M30] * v[M00] + m[M31] * v[M10] + m[M32] * v[M20] + m[M33] * v[M30];\n\t\tt[M31] = m[M30] * v[M01] + m[M31] * v[M11] + m[M32] * v[M21] + m[M33] * v[M31];\n\t\tt[M32] = m[M30] * v[M02] + m[M31] * v[M12] + m[M32] * v[M22] + m[M33] * v[M32];\n\t\tt[M33] = m[M30] * v[M03] + m[M31] * v[M13] + m[M32] * v[M23] + m[M33] * v[M33];\n\t\treturn this.set(this.temp);\n\t}\n\n\tlookAt (position: Vector3, direction: Vector3, up: Vector3) {\n\t\tlet xAxis = Matrix4.xAxis, yAxis = Matrix4.yAxis, zAxis = Matrix4.zAxis;\n\t\tzAxis.setFrom(direction).normalize();\n\t\txAxis.setFrom(direction).normalize();\n\t\txAxis.cross(up).normalize();\n\t\tyAxis.setFrom(xAxis).cross(zAxis).normalize();\n\t\tthis.identity();\n\t\tlet val = this.values;\n\t\tval[M00] = xAxis.x;\n\t\tval[M01] = xAxis.y;\n\t\tval[M02] = xAxis.z;\n\t\tval[M10] = yAxis.x;\n\t\tval[M11] = yAxis.y;\n\t\tval[M12] = yAxis.z;\n\t\tval[M20] = -zAxis.x;\n\t\tval[M21] = -zAxis.y;\n\t\tval[M22] = -zAxis.z;\n\n\t\tMatrix4.tmpMatrix.identity();\n\t\tMatrix4.tmpMatrix.values[M03] = -position.x;\n\t\tMatrix4.tmpMatrix.values[M13] = -position.y;\n\t\tMatrix4.tmpMatrix.values[M23] = -position.z;\n\t\tthis.multiply(Matrix4.tmpMatrix)\n\n\t\treturn this;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Matrix4 } from \"./Matrix4.js\";\nimport { Vector3 } from \"./Vector3.js\";\n\nexport class OrthoCamera {\n\tposition = new Vector3(0, 0, 0);\n\tdirection = new Vector3(0, 0, -1);\n\tup = new Vector3(0, 1, 0);\n\tnear = 0;\n\tfar = 100;\n\tzoom = 1;\n\tviewportWidth = 0;\n\tviewportHeight = 0;\n\tprojectionView = new Matrix4();\n\tinverseProjectionView = new Matrix4();\n\tprojection = new Matrix4();\n\tview = new Matrix4();\n\n\tconstructor (viewportWidth: number, viewportHeight: number) {\n\t\tthis.viewportWidth = viewportWidth;\n\t\tthis.viewportHeight = viewportHeight;\n\t\tthis.update();\n\t}\n\n\tupdate () {\n\t\tlet projection = this.projection;\n\t\tlet view = this.view;\n\t\tlet projectionView = this.projectionView;\n\t\tlet inverseProjectionView = this.inverseProjectionView;\n\t\tlet zoom = this.zoom, viewportWidth = this.viewportWidth, viewportHeight = this.viewportHeight;\n\t\tprojection.ortho(zoom * (-viewportWidth / 2), zoom * (viewportWidth / 2),\n\t\t\tzoom * (-viewportHeight / 2), zoom * (viewportHeight / 2),\n\t\t\tthis.near, this.far);\n\t\tview.lookAt(this.position, this.direction, this.up);\n\t\tprojectionView.set(projection.values);\n\t\tprojectionView.multiply(view);\n\t\tinverseProjectionView.set(projectionView.values).invert();\n\t}\n\n\tscreenToWorld (screenCoords: Vector3, screenWidth: number, screenHeight: number) {\n\t\tlet x = screenCoords.x, y = screenHeight - screenCoords.y - 1;\n\t\tscreenCoords.x = (2 * x) / screenWidth - 1;\n\t\tscreenCoords.y = (2 * y) / screenHeight - 1;\n\t\tscreenCoords.z = (2 * screenCoords.z) - 1;\n\t\tscreenCoords.project(this.inverseProjectionView);\n\t\treturn screenCoords;\n\t}\n\n\tworldToScreen (worldCoords: Vector3, screenWidth: number, screenHeight: number) {\n\t\tworldCoords.project(this.projectionView);\n\t\tworldCoords.x = screenWidth * (worldCoords.x + 1) / 2;\n\t\tworldCoords.y = screenHeight * (worldCoords.y + 1) / 2;\n\t\tworldCoords.z = (worldCoords.z + 1) / 2;\n\t\treturn worldCoords;\n\t}\n\n\tsetViewport (viewportWidth: number, viewportHeight: number) {\n\t\tthis.viewportWidth = viewportWidth;\n\t\tthis.viewportHeight = viewportHeight;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class Input {\n\telement: HTMLElement;\n\tmouseX = 0;\n\tmouseY = 0;\n\tbuttonDown = false;\n\ttouch0: Touch | null = null;\n\ttouch1: Touch | null = null;\n\tinitialPinchDistance = 0;\n\tprivate listeners = new Array<InputListener>();\n\tprivate eventListeners: Array<{ target: any, event: any, func: any }> = [];\n\n\tconstructor (element: HTMLElement) {\n\t\tthis.element = element;\n\t\tthis.setupCallbacks(element);\n\t}\n\n\tprivate setupCallbacks (element: HTMLElement) {\n\t\tlet mouseDown = (ev: UIEvent) => {\n\t\t\tif (ev instanceof MouseEvent) {\n\t\t\t\tlet rect = element.getBoundingClientRect();\n\t\t\t\tthis.mouseX = ev.clientX - rect.left;;\n\t\t\t\tthis.mouseY = ev.clientY - rect.top;\n\t\t\t\tthis.buttonDown = true;\n\t\t\t\tthis.listeners.map((listener) => { if (listener.down) listener.down(this.mouseX, this.mouseY); });\n\n\t\t\t\tdocument.addEventListener(\"mousemove\", mouseMove);\n\t\t\t\tdocument.addEventListener(\"mouseup\", mouseUp);\n\t\t\t}\n\t\t}\n\n\t\tlet mouseMove = (ev: UIEvent) => {\n\t\t\tif (ev instanceof MouseEvent) {\n\t\t\t\tlet rect = element.getBoundingClientRect();\n\t\t\t\tthis.mouseX = ev.clientX - rect.left;;\n\t\t\t\tthis.mouseY = ev.clientY - rect.top;\n\n\t\t\t\tthis.listeners.map((listener) => {\n\t\t\t\t\tif (this.buttonDown) {\n\t\t\t\t\t\tif (listener.dragged) listener.dragged(this.mouseX, this.mouseY);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (listener.moved) listener.moved(this.mouseX, this.mouseY);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tlet mouseUp = (ev: UIEvent) => {\n\t\t\tif (ev instanceof MouseEvent) {\n\t\t\t\tlet rect = element.getBoundingClientRect();\n\t\t\t\tthis.mouseX = ev.clientX - rect.left;;\n\t\t\t\tthis.mouseY = ev.clientY - rect.top;\n\t\t\t\tthis.buttonDown = false;\n\t\t\t\tthis.listeners.map((listener) => { if (listener.up) listener.up(this.mouseX, this.mouseY); });\n\n\t\t\t\tdocument.removeEventListener(\"mousemove\", mouseMove);\n\t\t\t\tdocument.removeEventListener(\"mouseup\", mouseUp);\n\t\t\t}\n\t\t}\n\n\t\tlet mouseWheel = (e: WheelEvent) => {\n\t\t\te.preventDefault();\n\t\t\tlet deltaY = e.deltaY;\n\t\t\tif (e.deltaMode == WheelEvent.DOM_DELTA_LINE) deltaY *= 8;\n\t\t\tif (e.deltaMode == WheelEvent.DOM_DELTA_PAGE) deltaY *= 24;\n\t\t\tthis.listeners.map((listener) => { if (listener.wheel) listener.wheel(e.deltaY); });\n\t\t};\n\n\t\telement.addEventListener(\"mousedown\", mouseDown, true);\n\t\telement.addEventListener(\"mousemove\", mouseMove, true);\n\t\telement.addEventListener(\"mouseup\", mouseUp, true);\n\t\telement.addEventListener(\"wheel\", mouseWheel, true);\n\n\n\t\telement.addEventListener(\"touchstart\", (ev: TouchEvent) => {\n\t\t\tif (!this.touch0 || !this.touch1) {\n\t\t\t\tvar touches = ev.changedTouches;\n\t\t\t\tlet nativeTouch = touches.item(0);\n\t\t\t\tif (!nativeTouch) return;\n\t\t\t\tlet rect = element.getBoundingClientRect();\n\t\t\t\tlet x = nativeTouch.clientX - rect.left;\n\t\t\t\tlet y = nativeTouch.clientY - rect.top;\n\t\t\t\tlet touch = new Touch(nativeTouch.identifier, x, y);\n\t\t\t\tthis.mouseX = x;\n\t\t\t\tthis.mouseY = y;\n\t\t\t\tthis.buttonDown = true;\n\n\t\t\t\tif (!this.touch0) {\n\t\t\t\t\tthis.touch0 = touch;\n\t\t\t\t\tthis.listeners.map((listener) => { if (listener.down) listener.down(touch.x, touch.y) })\n\t\t\t\t} else if (!this.touch1) {\n\t\t\t\t\tthis.touch1 = touch;\n\t\t\t\t\tlet dx = this.touch1.x - this.touch0.x;\n\t\t\t\t\tlet dy = this.touch1.x - this.touch0.x;\n\t\t\t\t\tthis.initialPinchDistance = Math.sqrt(dx * dx + dy * dy);\n\t\t\t\t\tthis.listeners.map((listener) => { if (listener.zoom) listener.zoom(this.initialPinchDistance, this.initialPinchDistance) });\n\t\t\t\t}\n\t\t\t}\n\t\t\tev.preventDefault();\n\t\t}, false);\n\n\t\telement.addEventListener(\"touchmove\", (ev: TouchEvent) => {\n\t\t\tif (this.touch0) {\n\t\t\t\tvar touches = ev.changedTouches;\n\t\t\t\tlet rect = element.getBoundingClientRect();\n\t\t\t\tfor (var i = 0; i < touches.length; i++) {\n\t\t\t\t\tvar nativeTouch = touches[i];\n\t\t\t\t\tlet x = nativeTouch.clientX - rect.left;\n\t\t\t\t\tlet y = nativeTouch.clientY - rect.top;\n\n\t\t\t\t\tif (this.touch0.identifier === nativeTouch.identifier) {\n\t\t\t\t\t\tthis.touch0.x = this.mouseX = x;\n\t\t\t\t\t\tthis.touch0.y = this.mouseY = y;\n\t\t\t\t\t\tthis.listeners.map((listener) => { if (listener.dragged) listener.dragged(x, y) });\n\t\t\t\t\t}\n\t\t\t\t\tif (this.touch1 && this.touch1.identifier === nativeTouch.identifier) {\n\t\t\t\t\t\tthis.touch1.x = this.mouseX = x;\n\t\t\t\t\t\tthis.touch1.y = this.mouseY = y;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.touch0 && this.touch1) {\n\t\t\t\t\tlet dx = this.touch1.x - this.touch0.x;\n\t\t\t\t\tlet dy = this.touch1.x - this.touch0.x;\n\t\t\t\t\tlet distance = Math.sqrt(dx * dx + dy * dy);\n\t\t\t\t\tthis.listeners.map((listener) => { if (listener.zoom) listener.zoom(this.initialPinchDistance, distance) });\n\t\t\t\t}\n\t\t\t}\n\t\t\tev.preventDefault();\n\t\t}, false);\n\n\t\tlet touchEnd = (ev: TouchEvent) => {\n\t\t\tif (this.touch0) {\n\t\t\t\tvar touches = ev.changedTouches;\n\t\t\t\tlet rect = element.getBoundingClientRect();\n\n\t\t\t\tfor (var i = 0; i < touches.length; i++) {\n\t\t\t\t\tvar nativeTouch = touches[i];\n\t\t\t\t\tlet x = nativeTouch.clientX - rect.left;\n\t\t\t\t\tlet y = nativeTouch.clientY - rect.top;\n\n\t\t\t\t\tif (this.touch0.identifier === nativeTouch.identifier) {\n\t\t\t\t\t\tthis.touch0 = null;\n\t\t\t\t\t\tthis.mouseX = x;\n\t\t\t\t\t\tthis.mouseY = y;\n\t\t\t\t\t\tthis.listeners.map((listener) => { if (listener.up) listener.up(x, y) });\n\n\t\t\t\t\t\tif (!this.touch1) {\n\t\t\t\t\t\t\tthis.buttonDown = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.touch0 = this.touch1;\n\t\t\t\t\t\t\tthis.touch1 = null;\n\t\t\t\t\t\t\tthis.mouseX = this.touch0.x;\n\t\t\t\t\t\t\tthis.mouseX = this.touch0.x;\n\t\t\t\t\t\t\tthis.buttonDown = true;\n\t\t\t\t\t\t\tthis.listeners.map((listener) => { if (listener.down) listener.down(this.touch0!.x, this.touch0!.y) });\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.touch1 && this.touch1.identifier) {\n\t\t\t\t\t\tthis.touch1 = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tev.preventDefault();\n\t\t};\n\t\telement.addEventListener(\"touchend\", touchEnd, false);\n\t\telement.addEventListener(\"touchcancel\", touchEnd);\n\t}\n\n\taddListener (listener: InputListener) {\n\t\tthis.listeners.push(listener);\n\t}\n\n\tremoveListener (listener: InputListener) {\n\t\tlet idx = this.listeners.indexOf(listener);\n\t\tif (idx > -1) {\n\t\t\tthis.listeners.splice(idx, 1);\n\t\t}\n\t}\n}\n\nexport class Touch {\n\tconstructor (public identifier: number, public x: number, public y: number) {\n\t}\n}\n\nexport interface InputListener {\n\tdown?(x: number, y: number): void;\n\tup?(x: number, y: number): void;\n\tmoved?(x: number, y: number): void;\n\tdragged?(x: number, y: number): void;\n\twheel?(delta: number): void;\n\tzoom?(initialDistance: number, distance: number): void;\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Input } from \"./Input.js\";\nimport { OrthoCamera } from \"./Camera.js\";\nimport { Vector3 } from \"./Vector3.js\";\n\nexport class CameraController {\n\tconstructor (public canvas: HTMLElement, public camera: OrthoCamera) {\n\t\tlet cameraX = 0, cameraY = 0, cameraZoom = 0;\n\t\tlet mouseX = 0, mouseY = 0;\n\t\tlet lastX = 0, lastY = 0;\n\t\tlet initialZoom = 0;\n\n\t\tnew Input(canvas).addListener({\n\t\t\tdown: (x: number, y: number) => {\n\t\t\t\tcameraX = camera.position.x;\n\t\t\t\tcameraY = camera.position.y;\n\t\t\t\tmouseX = lastX = x;\n\t\t\t\tmouseY = lastY = y;\n\t\t\t\tinitialZoom = camera.zoom;\n\t\t\t},\n\t\t\tdragged: (x: number, y: number) => {\n\t\t\t\tlet deltaX = x - mouseX;\n\t\t\t\tlet deltaY = y - mouseY;\n\t\t\t\tlet originWorld = camera.screenToWorld(new Vector3(0, 0), canvas.clientWidth, canvas.clientHeight);\n\t\t\t\tlet deltaWorld = camera.screenToWorld(new Vector3(deltaX, deltaY), canvas.clientWidth, canvas.clientHeight).sub(originWorld);\n\t\t\t\tcamera.position.set(cameraX - deltaWorld.x, cameraY - deltaWorld.y, 0);\n\t\t\t\tcamera.update();\n\t\t\t\tlastX = x;\n\t\t\t\tlastY = y;\n\t\t\t},\n\t\t\twheel: (delta: number) => {\n\t\t\t\tlet zoomAmount = delta / 200 * camera.zoom;\n\t\t\t\tlet newZoom = camera.zoom + zoomAmount;\n\t\t\t\tif (newZoom > 0) {\n\t\t\t\t\tlet x = 0, y = 0;\n\t\t\t\t\tif (delta < 0) {\n\t\t\t\t\t\tx = lastX; y = lastY;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet viewCenter = new Vector3(canvas.clientWidth / 2 + 15, canvas.clientHeight / 2);\n\t\t\t\t\t\tlet mouseToCenterX = lastX - viewCenter.x;\n\t\t\t\t\t\tlet mouseToCenterY = canvas.clientHeight - 1 - lastY - viewCenter.y;\n\t\t\t\t\t\tx = viewCenter.x - mouseToCenterX;\n\t\t\t\t\t\ty = canvas.clientHeight - 1 - viewCenter.y + mouseToCenterY;\n\t\t\t\t\t}\n\t\t\t\t\tlet oldDistance = camera.screenToWorld(new Vector3(x, y), canvas.clientWidth, canvas.clientHeight);\n\t\t\t\t\tcamera.zoom = newZoom;\n\t\t\t\t\tcamera.update();\n\t\t\t\t\tlet newDistance = camera.screenToWorld(new Vector3(x, y), canvas.clientWidth, canvas.clientHeight);\n\t\t\t\t\tcamera.position.add(oldDistance.sub(newDistance));\n\t\t\t\t\tcamera.update();\n\t\t\t\t}\n\t\t\t},\n\t\t\tzoom: (initialDistance, distance) => {\n\t\t\t\tlet newZoom = initialDistance / distance;\n\t\t\t\tcamera.zoom = initialZoom * newZoom;\n\t\t\t},\n\t\t\tup: (x: number, y: number) => {\n\t\t\t\tlastX = x;\n\t\t\t\tlastY = y;\n\t\t\t},\n\t\t\tmoved: (x: number, y: number) => {\n\t\t\t\tlastX = x;\n\t\t\t\tlastY = y;\n\t\t\t},\n\t\t});\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Disposable, Restorable } from \"@esotericsoftware/spine-core\";\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\n\nexport class Shader implements Disposable, Restorable {\n\tpublic static MVP_MATRIX = \"u_projTrans\";\n\tpublic static POSITION = \"a_position\";\n\tpublic static COLOR = \"a_color\";\n\tpublic static COLOR2 = \"a_color2\";\n\tpublic static TEXCOORDS = \"a_texCoords\";\n\tpublic static SAMPLER = \"u_texture\";\n\n\tprivate context: ManagedWebGLRenderingContext;\n\tprivate vs: WebGLShader | null = null;\n\tprivate vsSource: string;\n\tprivate fs: WebGLShader | null = null;\n\tprivate fsSource: string;\n\tprivate program: WebGLProgram | null = null;\n\tprivate tmp2x2: Float32Array = new Float32Array(2 * 2);\n\tprivate tmp3x3: Float32Array = new Float32Array(3 * 3);\n\tprivate tmp4x4: Float32Array = new Float32Array(4 * 4);\n\n\tpublic getProgram () { return this.program; }\n\tpublic getVertexShader () { return this.vertexShader; }\n\tpublic getFragmentShader () { return this.fragmentShader; }\n\tpublic getVertexShaderSource () { return this.vsSource; }\n\tpublic getFragmentSource () { return this.fsSource; }\n\n\tconstructor (context: ManagedWebGLRenderingContext | WebGLRenderingContext, private vertexShader: string, private fragmentShader: string) {\n\t\tthis.vsSource = vertexShader;\n\t\tthis.fsSource = fragmentShader;\n\t\tthis.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context);\n\t\tthis.context.addRestorable(this);\n\t\tthis.compile();\n\t}\n\n\tprivate compile () {\n\t\tlet gl = this.context.gl;\n\t\ttry {\n\t\t\tthis.vs = this.compileShader(gl.VERTEX_SHADER, this.vertexShader);\n\t\t\tif (!this.vs) throw new Error(\"Couldn't compile vertex shader.\");\n\t\t\tthis.fs = this.compileShader(gl.FRAGMENT_SHADER, this.fragmentShader);\n\t\t\tif (!this.fs) throw new Error(\"Couldn#t compile fragment shader.\");\n\t\t\tthis.program = this.compileProgram(this.vs, this.fs);\n\t\t} catch (e) {\n\t\t\tthis.dispose();\n\t\t\tthrow e;\n\t\t}\n\t}\n\n\tprivate compileShader (type: number, source: string) {\n\t\tlet gl = this.context.gl;\n\t\tlet shader = gl.createShader(type);\n\t\tif (!shader) throw new Error(\"Couldn't create shader.\");\n\t\tgl.shaderSource(shader, source);\n\t\tgl.compileShader(shader);\n\t\tif (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n\t\t\tlet error = \"Couldn't compile shader: \" + gl.getShaderInfoLog(shader);\n\t\t\tgl.deleteShader(shader);\n\t\t\tif (!gl.isContextLost()) throw new Error(error);\n\t\t}\n\t\treturn shader;\n\t}\n\n\tprivate compileProgram (vs: WebGLShader, fs: WebGLShader) {\n\t\tlet gl = this.context.gl;\n\t\tlet program = gl.createProgram();\n\t\tif (!program) throw new Error(\"Couldn't compile program.\");\n\t\tgl.attachShader(program, vs);\n\t\tgl.attachShader(program, fs);\n\t\tgl.linkProgram(program);\n\n\t\tif (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n\t\t\tlet error = \"Couldn't compile shader program: \" + gl.getProgramInfoLog(program);\n\t\t\tgl.deleteProgram(program);\n\t\t\tif (!gl.isContextLost()) throw new Error(error);\n\t\t}\n\t\treturn program;\n\t}\n\n\trestore () {\n\t\tthis.compile();\n\t}\n\n\tpublic bind () {\n\t\tthis.context.gl.useProgram(this.program);\n\t}\n\n\tpublic unbind () {\n\t\tthis.context.gl.useProgram(null);\n\t}\n\n\tpublic setUniformi (uniform: string, value: number) {\n\t\tthis.context.gl.uniform1i(this.getUniformLocation(uniform), value);\n\t}\n\n\tpublic setUniformf (uniform: string, value: number) {\n\t\tthis.context.gl.uniform1f(this.getUniformLocation(uniform), value);\n\t}\n\n\tpublic setUniform2f (uniform: string, value: number, value2: number) {\n\t\tthis.context.gl.uniform2f(this.getUniformLocation(uniform), value, value2);\n\t}\n\n\tpublic setUniform3f (uniform: string, value: number, value2: number, value3: number) {\n\t\tthis.context.gl.uniform3f(this.getUniformLocation(uniform), value, value2, value3);\n\t}\n\n\tpublic setUniform4f (uniform: string, value: number, value2: number, value3: number, value4: number) {\n\t\tthis.context.gl.uniform4f(this.getUniformLocation(uniform), value, value2, value3, value4);\n\t}\n\n\tpublic setUniform2x2f (uniform: string, value: ArrayLike<number>) {\n\t\tlet gl = this.context.gl;\n\t\tthis.tmp2x2.set(value);\n\t\tgl.uniformMatrix2fv(this.getUniformLocation(uniform), false, this.tmp2x2);\n\t}\n\n\tpublic setUniform3x3f (uniform: string, value: ArrayLike<number>) {\n\t\tlet gl = this.context.gl;\n\t\tthis.tmp3x3.set(value);\n\t\tgl.uniformMatrix3fv(this.getUniformLocation(uniform), false, this.tmp3x3);\n\t}\n\n\tpublic setUniform4x4f (uniform: string, value: ArrayLike<number>) {\n\t\tlet gl = this.context.gl;\n\t\tthis.tmp4x4.set(value);\n\t\tgl.uniformMatrix4fv(this.getUniformLocation(uniform), false, this.tmp4x4);\n\t}\n\n\tpublic getUniformLocation (uniform: string): WebGLUniformLocation | null {\n\t\tlet gl = this.context.gl;\n\t\tif (!this.program) throw new Error(\"Shader not compiled.\");\n\t\tlet location = gl.getUniformLocation(this.program, uniform);\n\t\tif (!location && !gl.isContextLost()) throw new Error(`Couldn't find location for uniform ${uniform}`);\n\t\treturn location;\n\t}\n\n\tpublic getAttributeLocation (attribute: string): number {\n\t\tlet gl = this.context.gl;\n\t\tif (!this.program) throw new Error(\"Shader not compiled.\");\n\t\tlet location = gl.getAttribLocation(this.program, attribute);\n\t\tif (location == -1 && !gl.isContextLost()) throw new Error(`Couldn't find location for attribute ${attribute}`);\n\t\treturn location;\n\t}\n\n\tpublic dispose () {\n\t\tthis.context.removeRestorable(this);\n\n\t\tlet gl = this.context.gl;\n\t\tif (this.vs) {\n\t\t\tgl.deleteShader(this.vs);\n\t\t\tthis.vs = null;\n\t\t}\n\n\t\tif (this.fs) {\n\t\t\tgl.deleteShader(this.fs);\n\t\t\tthis.fs = null;\n\t\t}\n\n\t\tif (this.program) {\n\t\t\tgl.deleteProgram(this.program);\n\t\t\tthis.program = null;\n\t\t}\n\t}\n\n\tpublic static newColoredTextured (context: ManagedWebGLRenderingContext | WebGLRenderingContext): Shader {\n\t\tlet vs = `\nattribute vec4 ${Shader.POSITION};\nattribute vec4 ${Shader.COLOR};\nattribute vec2 ${Shader.TEXCOORDS};\nuniform mat4 ${Shader.MVP_MATRIX};\nvarying vec4 v_color;\nvarying vec2 v_texCoords;\n\nvoid main () {\n\tv_color = ${Shader.COLOR};\n\tv_texCoords = ${Shader.TEXCOORDS};\n\tgl_Position = ${Shader.MVP_MATRIX} * ${Shader.POSITION};\n}\n`;\n\n\t\tlet fs = `\n#ifdef GL_ES\n\t#define LOWP lowp\n\tprecision mediump float;\n#else\n\t#define LOWP\n#endif\nvarying LOWP vec4 v_color;\nvarying vec2 v_texCoords;\nuniform sampler2D u_texture;\n\nvoid main () {\n\tgl_FragColor = v_color * texture2D(u_texture, v_texCoords);\n}\n`;\n\n\t\treturn new Shader(context, vs, fs);\n\t}\n\n\tpublic static newTwoColoredTextured (context: ManagedWebGLRenderingContext | WebGLRenderingContext): Shader {\n\t\tlet vs = `\nattribute vec4 ${Shader.POSITION};\nattribute vec4 ${Shader.COLOR};\nattribute vec4 ${Shader.COLOR2};\nattribute vec2 ${Shader.TEXCOORDS};\nuniform mat4 ${Shader.MVP_MATRIX};\nvarying vec4 v_light;\nvarying vec4 v_dark;\nvarying vec2 v_texCoords;\n\nvoid main () {\n\tv_light = ${Shader.COLOR};\n\tv_dark = ${Shader.COLOR2};\n\tv_texCoords = ${Shader.TEXCOORDS};\n\tgl_Position = ${Shader.MVP_MATRIX} * ${Shader.POSITION};\n}\n`;\n\n\t\tlet fs = `\n#ifdef GL_ES\n\t#define LOWP lowp\n\tprecision mediump float;\n#else\n\t#define LOWP\n#endif\nvarying LOWP vec4 v_light;\nvarying LOWP vec4 v_dark;\nvarying vec2 v_texCoords;\nuniform sampler2D u_texture;\n\nvoid main () {\n\tvec4 texColor = texture2D(u_texture, v_texCoords);\n\tgl_FragColor.a = texColor.a * v_light.a;\n\tgl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb;\n}\n`;\n\n\t\treturn new Shader(context, vs, fs);\n\t}\n\n\tpublic static newColored (context: ManagedWebGLRenderingContext | WebGLRenderingContext): Shader {\n\t\tlet vs = `\nattribute vec4 ${Shader.POSITION};\nattribute vec4 ${Shader.COLOR};\nuniform mat4 ${Shader.MVP_MATRIX};\nvarying vec4 v_color;\n\nvoid main () {\n\tv_color = ${Shader.COLOR};\n\tgl_Position = ${Shader.MVP_MATRIX} * ${Shader.POSITION};\n}\n`;\n\n\t\tlet fs = `\n#ifdef GL_ES\n\t#define LOWP lowp\n\tprecision mediump float;\n#else\n\t#define LOWP\n#endif\nvarying LOWP vec4 v_color;\n\nvoid main () {\n\tgl_FragColor = v_color;\n}\n`;\n\n\t\treturn new Shader(context, vs, fs);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Disposable, Restorable } from \"@esotericsoftware/spine-core\";\nimport { Shader } from \"./Shader.js\";\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\n\n\nexport class Mesh implements Disposable, Restorable {\n\tprivate context: ManagedWebGLRenderingContext;\n\tprivate vertices: Float32Array;\n\tprivate verticesBuffer: WebGLBuffer | null = null;\n\tprivate verticesLength = 0;\n\tprivate dirtyVertices = false;\n\tprivate indices: Uint16Array;\n\tprivate indicesBuffer: WebGLBuffer | null = null;\n\tprivate indicesLength = 0;\n\tprivate dirtyIndices = false;\n\tprivate elementsPerVertex = 0;\n\n\tgetAttributes (): VertexAttribute[] { return this.attributes; }\n\n\tmaxVertices (): number { return this.vertices.length / this.elementsPerVertex; }\n\tnumVertices (): number { return this.verticesLength / this.elementsPerVertex; }\n\tsetVerticesLength (length: number) {\n\t\tthis.dirtyVertices = true;\n\t\tthis.verticesLength = length;\n\t}\n\tgetVertices (): Float32Array { return this.vertices; }\n\n\tmaxIndices (): number { return this.indices.length; }\n\tnumIndices (): number { return this.indicesLength; }\n\tsetIndicesLength (length: number) {\n\t\tthis.dirtyIndices = true;\n\t\tthis.indicesLength = length;\n\t}\n\tgetIndices (): Uint16Array { return this.indices };\n\n\tgetVertexSizeInFloats (): number {\n\t\tlet size = 0;\n\t\tfor (var i = 0; i < this.attributes.length; i++) {\n\t\t\tlet attribute = this.attributes[i];\n\t\t\tsize += attribute.numElements;\n\t\t}\n\t\treturn size;\n\t}\n\n\tconstructor (context: ManagedWebGLRenderingContext | WebGLRenderingContext, private attributes: VertexAttribute[], maxVertices: number, maxIndices: number) {\n\t\tthis.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context);\n\t\tthis.elementsPerVertex = 0;\n\t\tfor (let i = 0; i < attributes.length; i++) {\n\t\t\tthis.elementsPerVertex += attributes[i].numElements;\n\t\t}\n\t\tthis.vertices = new Float32Array(maxVertices * this.elementsPerVertex);\n\t\tthis.indices = new Uint16Array(maxIndices);\n\t\tthis.context.addRestorable(this);\n\t}\n\n\tsetVertices (vertices: Array<number>) {\n\t\tthis.dirtyVertices = true;\n\t\tif (vertices.length > this.vertices.length) throw Error(\"Mesh can't store more than \" + this.maxVertices() + \" vertices\");\n\t\tthis.vertices.set(vertices, 0);\n\t\tthis.verticesLength = vertices.length;\n\t}\n\n\tsetIndices (indices: Array<number>) {\n\t\tthis.dirtyIndices = true;\n\t\tif (indices.length > this.indices.length) throw Error(\"Mesh can't store more than \" + this.maxIndices() + \" indices\");\n\t\tthis.indices.set(indices, 0);\n\t\tthis.indicesLength = indices.length;\n\t}\n\n\tdraw (shader: Shader, primitiveType: number) {\n\t\tthis.drawWithOffset(shader, primitiveType, 0, this.indicesLength > 0 ? this.indicesLength : this.verticesLength / this.elementsPerVertex);\n\t}\n\n\tdrawWithOffset (shader: Shader, primitiveType: number, offset: number, count: number) {\n\t\tlet gl = this.context.gl;\n\t\tif (this.dirtyVertices || this.dirtyIndices) this.update();\n\t\tthis.bind(shader);\n\t\tif (this.indicesLength > 0) {\n\t\t\tgl.drawElements(primitiveType, count, gl.UNSIGNED_SHORT, offset * 2);\n\t\t} else {\n\t\t\tgl.drawArrays(primitiveType, offset, count);\n\t\t}\n\t\tthis.unbind(shader);\n\t}\n\n\tbind (shader: Shader) {\n\t\tlet gl = this.context.gl;\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer);\n\t\tlet offset = 0;\n\t\tfor (let i = 0; i < this.attributes.length; i++) {\n\t\t\tlet attrib = this.attributes[i];\n\t\t\tlet location = shader.getAttributeLocation(attrib.name);\n\t\t\tgl.enableVertexAttribArray(location);\n\t\t\tgl.vertexAttribPointer(location, attrib.numElements, gl.FLOAT, false, this.elementsPerVertex * 4, offset * 4);\n\t\t\toffset += attrib.numElements;\n\t\t}\n\t\tif (this.indicesLength > 0) gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer);\n\t}\n\n\tunbind (shader: Shader) {\n\t\tlet gl = this.context.gl;\n\t\tfor (let i = 0; i < this.attributes.length; i++) {\n\t\t\tlet attrib = this.attributes[i];\n\t\t\tlet location = shader.getAttributeLocation(attrib.name);\n\t\t\tgl.disableVertexAttribArray(location);\n\t\t}\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, null);\n\t\tif (this.indicesLength > 0) gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);\n\t}\n\n\tprivate update () {\n\t\tlet gl = this.context.gl;\n\t\tif (this.dirtyVertices) {\n\t\t\tif (!this.verticesBuffer) {\n\t\t\t\tthis.verticesBuffer = gl.createBuffer();\n\t\t\t}\n\t\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer);\n\t\t\tgl.bufferData(gl.ARRAY_BUFFER, this.vertices.subarray(0, this.verticesLength), gl.DYNAMIC_DRAW);\n\t\t\tthis.dirtyVertices = false;\n\t\t}\n\n\t\tif (this.dirtyIndices) {\n\t\t\tif (!this.indicesBuffer) {\n\t\t\t\tthis.indicesBuffer = gl.createBuffer();\n\t\t\t}\n\t\t\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer);\n\t\t\tgl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices.subarray(0, this.indicesLength), gl.DYNAMIC_DRAW);\n\t\t\tthis.dirtyIndices = false;\n\t\t}\n\t}\n\n\trestore () {\n\t\tthis.verticesBuffer = null;\n\t\tthis.indicesBuffer = null;\n\t\tthis.update();\n\t}\n\n\tdispose () {\n\t\tthis.context.removeRestorable(this);\n\t\tlet gl = this.context.gl;\n\t\tgl.deleteBuffer(this.verticesBuffer);\n\t\tgl.deleteBuffer(this.indicesBuffer);\n\t}\n}\n\nexport class VertexAttribute {\n\tconstructor (public name: string, public type: VertexAttributeType, public numElements: number) { }\n}\n\nexport class Position2Attribute extends VertexAttribute {\n\tconstructor () {\n\t\tsuper(Shader.POSITION, VertexAttributeType.Float, 2);\n\t}\n}\n\nexport class Position3Attribute extends VertexAttribute {\n\tconstructor () {\n\t\tsuper(Shader.POSITION, VertexAttributeType.Float, 3);\n\t}\n}\n\nexport class TexCoordAttribute extends VertexAttribute {\n\tconstructor (unit: number = 0) {\n\t\tsuper(Shader.TEXCOORDS + (unit == 0 ? \"\" : unit), VertexAttributeType.Float, 2);\n\t}\n}\n\nexport class ColorAttribute extends VertexAttribute {\n\tconstructor () {\n\t\tsuper(Shader.COLOR, VertexAttributeType.Float, 4);\n\t}\n}\n\nexport class Color2Attribute extends VertexAttribute {\n\tconstructor () {\n\t\tsuper(Shader.COLOR2, VertexAttributeType.Float, 4);\n\t}\n}\n\nexport enum VertexAttributeType {\n\tFloat\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BlendMode, Disposable } from \"@esotericsoftware/spine-core\";\nimport { GLTexture } from \"./GLTexture.js\";\nimport { Mesh, Position2Attribute, ColorAttribute, TexCoordAttribute, Color2Attribute } from \"./Mesh.js\";\nimport { Shader } from \"./Shader.js\";\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\n\nconst GL_ONE = 1;\nconst GL_ONE_MINUS_SRC_COLOR = 0x0301;\nconst GL_SRC_ALPHA = 0x0302;\nconst GL_ONE_MINUS_SRC_ALPHA = 0x0303;\nconst GL_ONE_MINUS_DST_ALPHA = 0x0305;\nconst GL_DST_COLOR = 0x0306;\n\nexport class PolygonBatcher implements Disposable {\n\tpublic static disableCulling = false;\n\n\tprivate context: ManagedWebGLRenderingContext;\n\tprivate drawCalls = 0;\n\tprivate static globalDrawCalls = 0;\n\tisDrawing = false;\n\tprivate mesh: Mesh;\n\tprivate shader: Shader | null = null;\n\tprivate lastTexture: GLTexture | null = null;\n\tprivate verticesLength = 0;\n\tprivate indicesLength = 0;\n\tprivate srcColorBlend: number;\n\tprivate srcAlphaBlend: number;\n\tprivate dstBlend: number;\n\tprivate cullWasEnabled = false;\n\n\tconstructor (context: ManagedWebGLRenderingContext | WebGLRenderingContext, twoColorTint: boolean = true, maxVertices: number = 10920) {\n\t\tif (maxVertices > 10920) throw new Error(\"Can't have more than 10920 triangles per batch: \" + maxVertices);\n\t\tthis.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context);\n\t\tlet attributes = twoColorTint ?\n\t\t\t[new Position2Attribute(), new ColorAttribute(), new TexCoordAttribute(), new Color2Attribute()] :\n\t\t\t[new Position2Attribute(), new ColorAttribute(), new TexCoordAttribute()];\n\t\tthis.mesh = new Mesh(context, attributes, maxVertices, maxVertices * 3);\n\t\tlet gl = this.context.gl;\n\t\tthis.srcColorBlend = gl.SRC_ALPHA;\n\t\tthis.srcAlphaBlend = gl.ONE;\n\t\tthis.dstBlend = gl.ONE_MINUS_SRC_ALPHA;\n\t}\n\n\tbegin (shader: Shader) {\n\t\tif (this.isDrawing) throw new Error(\"PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()\");\n\t\tthis.drawCalls = 0;\n\t\tthis.shader = shader;\n\t\tthis.lastTexture = null;\n\t\tthis.isDrawing = true;\n\n\t\tlet gl = this.context.gl;\n\t\tgl.enable(gl.BLEND);\n\t\tgl.blendFuncSeparate(this.srcColorBlend, this.dstBlend, this.srcAlphaBlend, this.dstBlend);\n\n\t\tif (PolygonBatcher.disableCulling) {\n\t\t\tthis.cullWasEnabled = gl.isEnabled(gl.CULL_FACE);\n\t\t\tif (this.cullWasEnabled) gl.disable(gl.CULL_FACE);\n\t\t}\n\t}\n\n\tprivate static blendModesGL: { srcRgb: number, srcRgbPma: number, dstRgb: number, srcAlpha: number }[] = [\n\t\t{ srcRgb: GL_SRC_ALPHA, srcRgbPma: GL_ONE, dstRgb: GL_ONE_MINUS_SRC_ALPHA, srcAlpha: GL_ONE },\n\t\t{ srcRgb: GL_SRC_ALPHA, srcRgbPma: GL_ONE, dstRgb: GL_ONE, srcAlpha: GL_ONE },\n\t\t{ srcRgb: GL_DST_COLOR, srcRgbPma: GL_DST_COLOR, dstRgb: GL_ONE_MINUS_SRC_ALPHA, srcAlpha: GL_ONE },\n\t\t{ srcRgb: GL_ONE, srcRgbPma: GL_ONE, dstRgb: GL_ONE_MINUS_SRC_COLOR, srcAlpha: GL_ONE }\n\t]\n\n\tsetBlendMode (blendMode: BlendMode, premultipliedAlpha: boolean) {\n\t\tconst blendModeGL = PolygonBatcher.blendModesGL[blendMode];\n\t\tconst srcColorBlend = premultipliedAlpha ? blendModeGL.srcRgbPma : blendModeGL.srcRgb;\n\t\tconst srcAlphaBlend = blendModeGL.srcAlpha;\n\t\tconst dstBlend = blendModeGL.dstRgb;\n\n\t\tif (this.srcColorBlend == srcColorBlend && this.srcAlphaBlend == srcAlphaBlend && this.dstBlend == dstBlend) return;\n\t\tthis.srcColorBlend = srcColorBlend;\n\t\tthis.srcAlphaBlend = srcAlphaBlend;\n\t\tthis.dstBlend = dstBlend;\n\t\tif (this.isDrawing) {\n\t\t\tthis.flush();\n\t\t}\n\t\tlet gl = this.context.gl;\n\t\tgl.blendFuncSeparate(srcColorBlend, dstBlend, srcAlphaBlend, dstBlend);\n\t}\n\n\tdraw (texture: GLTexture, vertices: ArrayLike<number>, indices: Array<number>) {\n\t\tif (texture != this.lastTexture) {\n\t\t\tthis.flush();\n\t\t\tthis.lastTexture = texture;\n\t\t} else if (this.verticesLength + vertices.length > this.mesh.getVertices().length ||\n\t\t\tthis.indicesLength + indices.length > this.mesh.getIndices().length) {\n\t\t\tthis.flush();\n\t\t}\n\n\t\tlet indexStart = this.mesh.numVertices();\n\t\tthis.mesh.getVertices().set(vertices, this.verticesLength);\n\t\tthis.verticesLength += vertices.length;\n\t\tthis.mesh.setVerticesLength(this.verticesLength)\n\n\t\tlet indicesArray = this.mesh.getIndices();\n\t\tfor (let i = this.indicesLength, j = 0; j < indices.length; i++, j++)\n\t\t\tindicesArray[i] = indices[j] + indexStart;\n\t\tthis.indicesLength += indices.length;\n\t\tthis.mesh.setIndicesLength(this.indicesLength);\n\t}\n\n\tflush () {\n\t\tif (this.verticesLength == 0) return;\n\t\tif (!this.lastTexture) throw new Error(\"No texture set.\");\n\t\tif (!this.shader) throw new Error(\"No shader set.\");\n\t\tthis.lastTexture.bind();\n\t\tthis.mesh.draw(this.shader, this.context.gl.TRIANGLES);\n\n\t\tthis.verticesLength = 0;\n\t\tthis.indicesLength = 0;\n\t\tthis.mesh.setVerticesLength(0);\n\t\tthis.mesh.setIndicesLength(0);\n\t\tthis.drawCalls++;\n\t\tPolygonBatcher.globalDrawCalls++;\n\t}\n\n\tend () {\n\t\tif (!this.isDrawing) throw new Error(\"PolygonBatch is not drawing. Call PolygonBatch.begin() before calling PolygonBatch.end()\");\n\t\tif (this.verticesLength > 0 || this.indicesLength > 0) this.flush();\n\t\tthis.shader = null;\n\t\tthis.lastTexture = null;\n\t\tthis.isDrawing = false;\n\n\t\tlet gl = this.context.gl;\n\t\tgl.disable(gl.BLEND);\n\t\tif (PolygonBatcher.disableCulling) {\n\t\t\tif (this.cullWasEnabled) gl.enable(gl.CULL_FACE);\n\t\t}\n\t}\n\n\tgetDrawCalls () {\n\t\treturn this.drawCalls;\n\t}\n\n\tstatic getAndResetGlobalDrawCalls () {\n\t\tlet result = PolygonBatcher.globalDrawCalls;\n\t\tPolygonBatcher.globalDrawCalls = 0;\n\t\treturn result;\n\t}\n\n\tdispose () {\n\t\tthis.mesh.dispose();\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Disposable, Color, Vector2, MathUtils } from \"@esotericsoftware/spine-core\";\nimport { Mesh, Position2Attribute, ColorAttribute } from \"./Mesh.js\";\nimport { Shader } from \"./Shader.js\";\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\n\nexport class ShapeRenderer implements Disposable {\n\tprivate context: ManagedWebGLRenderingContext;\n\tprivate isDrawing = false;\n\tprivate mesh: Mesh;\n\tprivate shapeType = ShapeType.Filled;\n\tprivate color = new Color(1, 1, 1, 1);\n\tprivate shader: Shader | null = null;\n\tprivate vertexIndex = 0;\n\tprivate tmp = new Vector2();\n\tprivate srcColorBlend: number;\n\tprivate srcAlphaBlend: number;\n\tprivate dstBlend: number;\n\n\tconstructor (context: ManagedWebGLRenderingContext | WebGLRenderingContext, maxVertices: number = 10920) {\n\t\tif (maxVertices > 10920) throw new Error(\"Can't have more than 10920 triangles per batch: \" + maxVertices);\n\t\tthis.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context);\n\t\tthis.mesh = new Mesh(context, [new Position2Attribute(), new ColorAttribute()], maxVertices, 0);\n\t\tlet gl = this.context.gl;\n\t\tthis.srcColorBlend = gl.SRC_ALPHA;\n\t\tthis.srcAlphaBlend = gl.ONE;\n\t\tthis.dstBlend = gl.ONE_MINUS_SRC_ALPHA;\n\t}\n\n\tbegin (shader: Shader) {\n\t\tif (this.isDrawing) throw new Error(\"ShapeRenderer.begin() has already been called\");\n\t\tthis.shader = shader;\n\t\tthis.vertexIndex = 0;\n\t\tthis.isDrawing = true;\n\n\t\tlet gl = this.context.gl;\n\t\tgl.enable(gl.BLEND);\n\t\tgl.blendFuncSeparate(this.srcColorBlend, this.dstBlend, this.srcAlphaBlend, this.dstBlend);\n\t}\n\n\tsetBlendMode (srcColorBlend: number, srcAlphaBlend: number, dstBlend: number) {\n\t\tthis.srcColorBlend = srcColorBlend;\n\t\tthis.srcAlphaBlend = srcAlphaBlend;\n\t\tthis.dstBlend = dstBlend;\n\t\tif (this.isDrawing) {\n\t\t\tthis.flush();\n\t\t\tlet gl = this.context.gl;\n\t\t\tgl.blendFuncSeparate(srcColorBlend, dstBlend, srcAlphaBlend, dstBlend);\n\t\t}\n\t}\n\n\tsetColor (color: Color) {\n\t\tthis.color.setFromColor(color);\n\t}\n\n\tsetColorWith (r: number, g: number, b: number, a: number) {\n\t\tthis.color.set(r, g, b, a);\n\t}\n\n\tpoint (x: number, y: number, color?: Color) {\n\t\tthis.check(ShapeType.Point, 1);\n\t\tif (!color) color = this.color;\n\t\tthis.vertex(x, y, color);\n\t}\n\n\tline (x: number, y: number, x2: number, y2: number, color?: Color) {\n\t\tthis.check(ShapeType.Line, 2);\n\t\tlet vertices = this.mesh.getVertices();\n\t\tlet idx = this.vertexIndex;\n\t\tif (!color) color = this.color;\n\t\tthis.vertex(x, y, color);\n\t\tthis.vertex(x2, y2, color);\n\t}\n\n\ttriangle (filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, color?: Color, color2?: Color, color3?: Color) {\n\t\tthis.check(filled ? ShapeType.Filled : ShapeType.Line, 3);\n\t\tlet vertices = this.mesh.getVertices();\n\t\tlet idx = this.vertexIndex;\n\t\tif (!color) color = this.color;\n\t\tif (!color2) color2 = this.color;\n\t\tif (!color3) color3 = this.color;\n\t\tif (filled) {\n\t\t\tthis.vertex(x, y, color);\n\t\t\tthis.vertex(x2, y2, color2);\n\t\t\tthis.vertex(x3, y3, color3);\n\t\t} else {\n\t\t\tthis.vertex(x, y, color);\n\t\t\tthis.vertex(x2, y2, color2);\n\n\t\t\tthis.vertex(x2, y2, color);\n\t\t\tthis.vertex(x3, y3, color2);\n\n\t\t\tthis.vertex(x3, y3, color);\n\t\t\tthis.vertex(x, y, color2);\n\t\t}\n\t}\n\n\tquad (filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number, color?: Color, color2?: Color, color3?: Color, color4?: Color) {\n\t\tthis.check(filled ? ShapeType.Filled : ShapeType.Line, 3);\n\t\tlet vertices = this.mesh.getVertices();\n\t\tlet idx = this.vertexIndex;\n\t\tif (!color) color = this.color;\n\t\tif (!color2) color2 = this.color;\n\t\tif (!color3) color3 = this.color;\n\t\tif (!color4) color4 = this.color;\n\t\tif (filled) {\n\t\t\tthis.vertex(x, y, color); this.vertex(x2, y2, color2); this.vertex(x3, y3, color3);\n\t\t\tthis.vertex(x3, y3, color3); this.vertex(x4, y4, color4); this.vertex(x, y, color);\n\t\t} else {\n\t\t\tthis.vertex(x, y, color); this.vertex(x2, y2, color2);\n\t\t\tthis.vertex(x2, y2, color2); this.vertex(x3, y3, color3);\n\t\t\tthis.vertex(x3, y3, color3); this.vertex(x4, y4, color4);\n\t\t\tthis.vertex(x4, y4, color4); this.vertex(x, y, color);\n\t\t}\n\t}\n\n\trect (filled: boolean, x: number, y: number, width: number, height: number, color?: Color) {\n\t\tthis.quad(filled, x, y, x + width, y, x + width, y + height, x, y + height, color, color, color, color);\n\t}\n\n\trectLine (filled: boolean, x1: number, y1: number, x2: number, y2: number, width: number, color?: Color) {\n\t\tthis.check(filled ? ShapeType.Filled : ShapeType.Line, 8);\n\t\tif (!color) color = this.color;\n\t\tlet t = this.tmp.set(y2 - y1, x1 - x2);\n\t\tt.normalize();\n\t\twidth *= 0.5;\n\t\tlet tx = t.x * width;\n\t\tlet ty = t.y * width;\n\t\tif (!filled) {\n\t\t\tthis.vertex(x1 + tx, y1 + ty, color);\n\t\t\tthis.vertex(x1 - tx, y1 - ty, color);\n\t\t\tthis.vertex(x2 + tx, y2 + ty, color);\n\t\t\tthis.vertex(x2 - tx, y2 - ty, color);\n\n\t\t\tthis.vertex(x2 + tx, y2 + ty, color);\n\t\t\tthis.vertex(x1 + tx, y1 + ty, color);\n\n\t\t\tthis.vertex(x2 - tx, y2 - ty, color);\n\t\t\tthis.vertex(x1 - tx, y1 - ty, color);\n\t\t} else {\n\t\t\tthis.vertex(x1 + tx, y1 + ty, color);\n\t\t\tthis.vertex(x1 - tx, y1 - ty, color);\n\t\t\tthis.vertex(x2 + tx, y2 + ty, color);\n\n\t\t\tthis.vertex(x2 - tx, y2 - ty, color);\n\t\t\tthis.vertex(x2 + tx, y2 + ty, color);\n\t\t\tthis.vertex(x1 - tx, y1 - ty, color);\n\t\t}\n\t}\n\n\tx (x: number, y: number, size: number) {\n\t\tthis.line(x - size, y - size, x + size, y + size);\n\t\tthis.line(x - size, y + size, x + size, y - size);\n\t}\n\n\tpolygon (polygonVertices: ArrayLike<number>, offset: number, count: number, color?: Color) {\n\t\tif (count < 3) throw new Error(\"Polygon must contain at least 3 vertices\");\n\t\tthis.check(ShapeType.Line, count * 2);\n\t\tif (!color) color = this.color;\n\t\tlet vertices = this.mesh.getVertices();\n\t\tlet idx = this.vertexIndex;\n\n\t\toffset <<= 1;\n\t\tcount <<= 1;\n\n\t\tlet firstX = polygonVertices[offset];\n\t\tlet firstY = polygonVertices[offset + 1];\n\t\tlet last = offset + count;\n\n\t\tfor (let i = offset, n = offset + count - 2; i < n; i += 2) {\n\t\t\tlet x1 = polygonVertices[i];\n\t\t\tlet y1 = polygonVertices[i + 1];\n\n\t\t\tlet x2 = 0;\n\t\t\tlet y2 = 0;\n\n\t\t\tif (i + 2 >= last) {\n\t\t\t\tx2 = firstX;\n\t\t\t\ty2 = firstY;\n\t\t\t} else {\n\t\t\t\tx2 = polygonVertices[i + 2];\n\t\t\t\ty2 = polygonVertices[i + 3];\n\t\t\t}\n\n\t\t\tthis.vertex(x1, y1, color!);\n\t\t\tthis.vertex(x2, y2, color!);\n\t\t}\n\t}\n\n\tcircle (filled: boolean, x: number, y: number, radius: number, color?: Color, segments: number = 0) {\n\t\tif (segments == 0) segments = Math.max(1, (6 * MathUtils.cbrt(radius)) | 0);\n\t\tif (segments <= 0) throw new Error(\"segments must be > 0.\");\n\t\tif (!color) color = this.color;\n\t\tlet angle = 2 * MathUtils.PI / segments;\n\t\tlet cos = Math.cos(angle);\n\t\tlet sin = Math.sin(angle);\n\t\tlet cx = radius, cy = 0;\n\t\tif (!filled) {\n\t\t\tthis.check(ShapeType.Line, segments * 2 + 2);\n\t\t\tfor (let i = 0; i < segments; i++) {\n\t\t\t\tthis.vertex(x + cx, y + cy, color);\n\t\t\t\tlet temp = cx;\n\t\t\t\tcx = cos * cx - sin * cy;\n\t\t\t\tcy = sin * temp + cos * cy;\n\t\t\t\tthis.vertex(x + cx, y + cy, color);\n\t\t\t}\n\t\t\t// Ensure the last segment is identical to the first.\n\t\t\tthis.vertex(x + cx, y + cy, color);\n\t\t} else {\n\t\t\tthis.check(ShapeType.Filled, segments * 3 + 3);\n\t\t\tsegments--;\n\t\t\tfor (let i = 0; i < segments; i++) {\n\t\t\t\tthis.vertex(x, y, color);\n\t\t\t\tthis.vertex(x + cx, y + cy, color);\n\t\t\t\tlet temp = cx;\n\t\t\t\tcx = cos * cx - sin * cy;\n\t\t\t\tcy = sin * temp + cos * cy;\n\t\t\t\tthis.vertex(x + cx, y + cy, color);\n\t\t\t}\n\t\t\t// Ensure the last segment is identical to the first.\n\t\t\tthis.vertex(x, y, color);\n\t\t\tthis.vertex(x + cx, y + cy, color);\n\t\t}\n\n\t\tlet temp = cx;\n\t\tcx = radius;\n\t\tcy = 0;\n\t\tthis.vertex(x + cx, y + cy, color);\n\t}\n\n\tcurve (x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color) {\n\t\tthis.check(ShapeType.Line, segments * 2 + 2);\n\t\tif (!color) color = this.color;\n\n\t\t// Algorithm from: http://www.antigrain.com/research/bezier_interpolation/index.html#PAGE_BEZIER_INTERPOLATION\n\t\tlet subdiv_step = 1 / segments;\n\t\tlet subdiv_step2 = subdiv_step * subdiv_step;\n\t\tlet subdiv_step3 = subdiv_step * subdiv_step * subdiv_step;\n\n\t\tlet pre1 = 3 * subdiv_step;\n\t\tlet pre2 = 3 * subdiv_step2;\n\t\tlet pre4 = 6 * subdiv_step2;\n\t\tlet pre5 = 6 * subdiv_step3;\n\n\t\tlet tmp1x = x1 - cx1 * 2 + cx2;\n\t\tlet tmp1y = y1 - cy1 * 2 + cy2;\n\n\t\tlet tmp2x = (cx1 - cx2) * 3 - x1 + x2;\n\t\tlet tmp2y = (cy1 - cy2) * 3 - y1 + y2;\n\n\t\tlet fx = x1;\n\t\tlet fy = y1;\n\n\t\tlet dfx = (cx1 - x1) * pre1 + tmp1x * pre2 + tmp2x * subdiv_step3;\n\t\tlet dfy = (cy1 - y1) * pre1 + tmp1y * pre2 + tmp2y * subdiv_step3;\n\n\t\tlet ddfx = tmp1x * pre4 + tmp2x * pre5;\n\t\tlet ddfy = tmp1y * pre4 + tmp2y * pre5;\n\n\t\tlet dddfx = tmp2x * pre5;\n\t\tlet dddfy = tmp2y * pre5;\n\n\t\twhile (segments-- > 0) {\n\t\t\tthis.vertex(fx, fy, color!);\n\t\t\tfx += dfx;\n\t\t\tfy += dfy;\n\t\t\tdfx += ddfx;\n\t\t\tdfy += ddfy;\n\t\t\tddfx += dddfx;\n\t\t\tddfy += dddfy;\n\t\t\tthis.vertex(fx, fy, color!);\n\t\t}\n\t\tthis.vertex(fx, fy, color!);\n\t\tthis.vertex(x2, y2, color!);\n\t}\n\n\tprivate vertex (x: number, y: number, color: Color) {\n\t\tlet idx = this.vertexIndex;\n\t\tlet vertices = this.mesh.getVertices();\n\t\tvertices[idx++] = x;\n\t\tvertices[idx++] = y;\n\t\tvertices[idx++] = color.r;\n\t\tvertices[idx++] = color.g;\n\t\tvertices[idx++] = color.b;\n\t\tvertices[idx++] = color.a;\n\t\tthis.vertexIndex = idx;\n\t}\n\n\tend () {\n\t\tif (!this.isDrawing) throw new Error(\"ShapeRenderer.begin() has not been called\");\n\t\tthis.flush();\n\t\tlet gl = this.context.gl;\n\t\tgl.disable(gl.BLEND);\n\t\tthis.isDrawing = false;\n\t}\n\n\tprivate flush () {\n\t\tif (this.vertexIndex == 0) return;\n\t\tif (!this.shader) throw new Error(\"No shader set.\");\n\t\tthis.mesh.setVerticesLength(this.vertexIndex);\n\t\tthis.mesh.draw(this.shader, this.shapeType);\n\t\tthis.vertexIndex = 0;\n\t}\n\n\tprivate check (shapeType: ShapeType, numVertices: number) {\n\t\tif (!this.isDrawing) throw new Error(\"ShapeRenderer.begin() has not been called\");\n\t\tif (this.shapeType == shapeType) {\n\t\t\tif (this.mesh.maxVertices() - this.mesh.numVertices() < numVertices) this.flush();\n\t\t\telse return;\n\t\t} else {\n\t\t\tthis.flush();\n\t\t\tthis.shapeType = shapeType;\n\t\t}\n\t}\n\n\tdispose () {\n\t\tthis.mesh.dispose();\n\t}\n}\n\nexport enum ShapeType {\n\tPoint = 0x0000,\n\tLine = 0x0001,\n\tFilled = 0x0004\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Disposable, Color, SkeletonBounds, Utils, Skeleton, RegionAttachment, MeshAttachment, PathAttachment, ClippingAttachment } from \"@esotericsoftware/spine-core\";\nimport { ShapeRenderer } from \"./ShapeRenderer.js\";\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\n\nexport class SkeletonDebugRenderer implements Disposable {\n\tboneLineColor = new Color(1, 0, 0, 1);\n\tboneOriginColor = new Color(0, 1, 0, 1);\n\tattachmentLineColor = new Color(0, 0, 1, 0.5);\n\ttriangleLineColor = new Color(1, 0.64, 0, 0.5);\n\tpathColor = new Color().setFromString(\"FF7F00\");\n\tclipColor = new Color(0.8, 0, 0, 2);\n\taabbColor = new Color(0, 1, 0, 0.5);\n\tdrawBones = true;\n\tdrawRegionAttachments = true;\n\tdrawBoundingBoxes = true;\n\tdrawMeshHull = true;\n\tdrawMeshTriangles = true;\n\tdrawPaths = true;\n\tdrawSkeletonXY = false;\n\tdrawClipping = true;\n\tpremultipliedAlpha = false;\n\tscale = 1;\n\tboneWidth = 2;\n\n\tprivate context: ManagedWebGLRenderingContext;\n\tprivate bounds = new SkeletonBounds();\n\tprivate temp = new Array<number>();\n\tprivate vertices = Utils.newFloatArray(2 * 1024);\n\tprivate static LIGHT_GRAY = new Color(192 / 255, 192 / 255, 192 / 255, 1);\n\tprivate static GREEN = new Color(0, 1, 0, 1);\n\n\tconstructor (context: ManagedWebGLRenderingContext | WebGLRenderingContext) {\n\t\tthis.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context);\n\t}\n\n\tdraw (shapes: ShapeRenderer, skeleton: Skeleton, ignoredBones?: Array<string>) {\n\t\tlet skeletonX = skeleton.x;\n\t\tlet skeletonY = skeleton.y;\n\t\tlet gl = this.context.gl;\n\t\tlet srcFunc = this.premultipliedAlpha ? gl.ONE : gl.SRC_ALPHA;\n\t\tshapes.setBlendMode(srcFunc, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n\n\t\tlet bones = skeleton.bones;\n\t\tif (this.drawBones) {\n\t\t\tshapes.setColor(this.boneLineColor);\n\t\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\t\tlet bone = bones[i];\n\t\t\t\tif (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) continue;\n\t\t\t\tif (!bone.parent) continue;\n\t\t\t\tlet x = bone.data.length * bone.a + bone.worldX;\n\t\t\t\tlet y = bone.data.length * bone.c + bone.worldY;\n\t\t\t\tshapes.rectLine(true, bone.worldX, bone.worldY, x, y, this.boneWidth * this.scale);\n\t\t\t}\n\t\t\tif (this.drawSkeletonXY) shapes.x(skeletonX, skeletonY, 4 * this.scale);\n\t\t}\n\n\t\tif (this.drawRegionAttachments) {\n\t\t\tshapes.setColor(this.attachmentLineColor);\n\t\t\tlet slots = skeleton.slots;\n\t\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\t\tlet slot = slots[i];\n\t\t\t\tlet attachment = slot.getAttachment();\n\t\t\t\tif (attachment instanceof RegionAttachment) {\n\t\t\t\t\tlet regionAttachment = <RegionAttachment>attachment;\n\t\t\t\t\tlet vertices = this.vertices;\n\t\t\t\t\tregionAttachment.computeWorldVertices(slot, vertices, 0, 2);\n\t\t\t\t\tshapes.line(vertices[0], vertices[1], vertices[2], vertices[3]);\n\t\t\t\t\tshapes.line(vertices[2], vertices[3], vertices[4], vertices[5]);\n\t\t\t\t\tshapes.line(vertices[4], vertices[5], vertices[6], vertices[7]);\n\t\t\t\t\tshapes.line(vertices[6], vertices[7], vertices[0], vertices[1]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.drawMeshHull || this.drawMeshTriangles) {\n\t\t\tlet slots = skeleton.slots;\n\t\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\t\tlet slot = slots[i];\n\t\t\t\tif (!slot.bone.active) continue;\n\t\t\t\tlet attachment = slot.getAttachment();\n\t\t\t\tif (!(attachment instanceof MeshAttachment)) continue;\n\t\t\t\tlet mesh = <MeshAttachment>attachment;\n\t\t\t\tlet vertices = this.vertices;\n\t\t\t\tmesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, 2);\n\t\t\t\tlet triangles = mesh.triangles;\n\t\t\t\tlet hullLength = mesh.hullLength;\n\t\t\t\tif (this.drawMeshTriangles) {\n\t\t\t\t\tshapes.setColor(this.triangleLineColor);\n\t\t\t\t\tfor (let ii = 0, nn = triangles.length; ii < nn; ii += 3) {\n\t\t\t\t\t\tlet v1 = triangles[ii] * 2, v2 = triangles[ii + 1] * 2, v3 = triangles[ii + 2] * 2;\n\t\t\t\t\t\tshapes.triangle(false, vertices[v1], vertices[v1 + 1], //\n\t\t\t\t\t\t\tvertices[v2], vertices[v2 + 1], //\n\t\t\t\t\t\t\tvertices[v3], vertices[v3 + 1] //\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.drawMeshHull && hullLength > 0) {\n\t\t\t\t\tshapes.setColor(this.attachmentLineColor);\n\t\t\t\t\thullLength = (hullLength >> 1) * 2;\n\t\t\t\t\tlet lastX = vertices[hullLength - 2], lastY = vertices[hullLength - 1];\n\t\t\t\t\tfor (let ii = 0, nn = hullLength; ii < nn; ii += 2) {\n\t\t\t\t\t\tlet x = vertices[ii], y = vertices[ii + 1];\n\t\t\t\t\t\tshapes.line(x, y, lastX, lastY);\n\t\t\t\t\t\tlastX = x;\n\t\t\t\t\t\tlastY = y;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.drawBoundingBoxes) {\n\t\t\tlet bounds = this.bounds;\n\t\t\tbounds.update(skeleton, true);\n\t\t\tshapes.setColor(this.aabbColor);\n\t\t\tshapes.rect(false, bounds.minX, bounds.minY, bounds.getWidth(), bounds.getHeight());\n\t\t\tlet polygons = bounds.polygons;\n\t\t\tlet boxes = bounds.boundingBoxes;\n\t\t\tfor (let i = 0, n = polygons.length; i < n; i++) {\n\t\t\t\tlet polygon = polygons[i];\n\t\t\t\tshapes.setColor(boxes[i].color);\n\t\t\t\tshapes.polygon(polygon, 0, polygon.length);\n\t\t\t}\n\t\t}\n\n\t\tif (this.drawPaths) {\n\t\t\tlet slots = skeleton.slots;\n\t\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\t\tlet slot = slots[i];\n\t\t\t\tif (!slot.bone.active) continue;\n\t\t\t\tlet attachment = slot.getAttachment();\n\t\t\t\tif (!(attachment instanceof PathAttachment)) continue;\n\t\t\t\tlet path = <PathAttachment>attachment;\n\t\t\t\tlet nn = path.worldVerticesLength;\n\t\t\t\tlet world = this.temp = Utils.setArraySize(this.temp, nn, 0);\n\t\t\t\tpath.computeWorldVertices(slot, 0, nn, world, 0, 2);\n\t\t\t\tlet color = this.pathColor;\n\t\t\t\tlet x1 = world[2], y1 = world[3], x2 = 0, y2 = 0;\n\t\t\t\tif (path.closed) {\n\t\t\t\t\tshapes.setColor(color);\n\t\t\t\t\tlet cx1 = world[0], cy1 = world[1], cx2 = world[nn - 2], cy2 = world[nn - 1];\n\t\t\t\t\tx2 = world[nn - 4];\n\t\t\t\t\ty2 = world[nn - 3];\n\t\t\t\t\tshapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32);\n\t\t\t\t\tshapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY);\n\t\t\t\t\tshapes.line(x1, y1, cx1, cy1);\n\t\t\t\t\tshapes.line(x2, y2, cx2, cy2);\n\t\t\t\t}\n\t\t\t\tnn -= 4;\n\t\t\t\tfor (let ii = 4; ii < nn; ii += 6) {\n\t\t\t\t\tlet cx1 = world[ii], cy1 = world[ii + 1], cx2 = world[ii + 2], cy2 = world[ii + 3];\n\t\t\t\t\tx2 = world[ii + 4];\n\t\t\t\t\ty2 = world[ii + 5];\n\t\t\t\t\tshapes.setColor(color);\n\t\t\t\t\tshapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32);\n\t\t\t\t\tshapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY);\n\t\t\t\t\tshapes.line(x1, y1, cx1, cy1);\n\t\t\t\t\tshapes.line(x2, y2, cx2, cy2);\n\t\t\t\t\tx1 = x2;\n\t\t\t\t\ty1 = y2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.drawBones) {\n\t\t\tshapes.setColor(this.boneOriginColor);\n\t\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\t\tlet bone = bones[i];\n\t\t\t\tif (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) continue;\n\t\t\t\tshapes.circle(true, bone.worldX, bone.worldY, 3 * this.scale, this.boneOriginColor, 8);\n\t\t\t}\n\t\t}\n\n\t\tif (this.drawClipping) {\n\t\t\tlet slots = skeleton.slots;\n\t\t\tshapes.setColor(this.clipColor)\n\t\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\t\tlet slot = slots[i];\n\t\t\t\tif (!slot.bone.active) continue;\n\t\t\t\tlet attachment = slot.getAttachment();\n\t\t\t\tif (!(attachment instanceof ClippingAttachment)) continue;\n\t\t\t\tlet clip = <ClippingAttachment>attachment;\n\t\t\t\tlet nn = clip.worldVerticesLength;\n\t\t\t\tlet world = this.temp = Utils.setArraySize(this.temp, nn, 0);\n\t\t\t\tclip.computeWorldVertices(slot, 0, nn, world, 0, 2);\n\t\t\t\tfor (let i = 0, n = world.length; i < n; i += 2) {\n\t\t\t\t\tlet x = world[i];\n\t\t\t\t\tlet y = world[i + 1];\n\t\t\t\t\tlet x2 = world[(i + 2) % world.length];\n\t\t\t\t\tlet y2 = world[(i + 3) % world.length];\n\t\t\t\t\tshapes.line(x, y, x2, y2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tdispose () {\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { NumberArrayLike, Color, SkeletonClipping, Vector2, Utils, Skeleton, BlendMode, RegionAttachment, TextureAtlasRegion, MeshAttachment, ClippingAttachment } from \"@esotericsoftware/spine-core\";\nimport { GLTexture } from \"./GLTexture.js\";\nimport { PolygonBatcher } from \"./PolygonBatcher.js\";\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\n\n\nclass Renderable {\n\tconstructor (public vertices: NumberArrayLike, public numVertices: number, public numFloats: number) { }\n};\n\nexport type VertexTransformer = (vertices: NumberArrayLike, numVertices: number, stride: number) => void;\n\nexport class SkeletonRenderer {\n\tstatic QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];\n\n\tpremultipliedAlpha = false;\n\tprivate tempColor = new Color();\n\tprivate tempColor2 = new Color();\n\tprivate vertices: NumberArrayLike;\n\tprivate vertexSize = 2 + 2 + 4;\n\tprivate twoColorTint = false;\n\tprivate renderable: Renderable = new Renderable([], 0, 0);\n\tprivate clipper: SkeletonClipping = new SkeletonClipping();\n\tprivate temp = new Vector2();\n\tprivate temp2 = new Vector2();\n\tprivate temp3 = new Color();\n\tprivate temp4 = new Color();\n\n\tconstructor (context: ManagedWebGLRenderingContext, twoColorTint: boolean = true) {\n\t\tthis.twoColorTint = twoColorTint;\n\t\tif (twoColorTint)\n\t\t\tthis.vertexSize += 4;\n\t\tthis.vertices = Utils.newFloatArray(this.vertexSize * 1024);\n\t}\n\n\tdraw (batcher: PolygonBatcher, skeleton: Skeleton, slotRangeStart: number = -1, slotRangeEnd: number = -1, transformer: VertexTransformer | null = null) {\n\t\tlet clipper = this.clipper;\n\t\tlet premultipliedAlpha = this.premultipliedAlpha;\n\t\tlet twoColorTint = this.twoColorTint;\n\t\tlet blendMode: BlendMode | null = null;\n\n\t\tlet renderable: Renderable = this.renderable;\n\t\tlet uvs: NumberArrayLike;\n\t\tlet triangles: Array<number>;\n\t\tlet drawOrder = skeleton.drawOrder;\n\t\tlet attachmentColor: Color;\n\t\tlet skeletonColor = skeleton.color;\n\t\tlet vertexSize = twoColorTint ? 12 : 8;\n\t\tlet inRange = false;\n\t\tif (slotRangeStart == -1) inRange = true;\n\t\tfor (let i = 0, n = drawOrder.length; i < n; i++) {\n\t\t\tlet clippedVertexSize = clipper.isClipping() ? 2 : vertexSize;\n\t\t\tlet slot = drawOrder[i];\n\t\t\tif (!slot.bone.active) {\n\t\t\t\tclipper.clipEndWithSlot(slot);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (slotRangeStart >= 0 && slotRangeStart == slot.data.index) {\n\t\t\t\tinRange = true;\n\t\t\t}\n\n\t\t\tif (!inRange) {\n\t\t\t\tclipper.clipEndWithSlot(slot);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (slotRangeEnd >= 0 && slotRangeEnd == slot.data.index) {\n\t\t\t\tinRange = false;\n\t\t\t}\n\n\t\t\tlet attachment = slot.getAttachment();\n\t\t\tlet texture: GLTexture;\n\t\t\tif (attachment instanceof RegionAttachment) {\n\t\t\t\tlet region = <RegionAttachment>attachment;\n\t\t\t\trenderable.vertices = this.vertices;\n\t\t\t\trenderable.numVertices = 4;\n\t\t\t\trenderable.numFloats = clippedVertexSize << 2;\n\t\t\t\tregion.computeWorldVertices(slot, renderable.vertices, 0, clippedVertexSize);\n\t\t\t\ttriangles = SkeletonRenderer.QUAD_TRIANGLES;\n\t\t\t\tuvs = region.uvs;\n\t\t\t\ttexture = <GLTexture>region.region!.texture;\n\t\t\t\tattachmentColor = region.color;\n\t\t\t} else if (attachment instanceof MeshAttachment) {\n\t\t\t\tlet mesh = <MeshAttachment>attachment;\n\t\t\t\trenderable.vertices = this.vertices;\n\t\t\t\trenderable.numVertices = (mesh.worldVerticesLength >> 1);\n\t\t\t\trenderable.numFloats = renderable.numVertices * clippedVertexSize;\n\t\t\t\tif (renderable.numFloats > renderable.vertices.length) {\n\t\t\t\t\trenderable.vertices = this.vertices = Utils.newFloatArray(renderable.numFloats);\n\t\t\t\t}\n\t\t\t\tmesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, renderable.vertices, 0, clippedVertexSize);\n\t\t\t\ttriangles = mesh.triangles;\n\t\t\t\ttexture = <GLTexture>mesh.region!.texture;\n\t\t\t\tuvs = mesh.uvs;\n\t\t\t\tattachmentColor = mesh.color;\n\t\t\t} else if (attachment instanceof ClippingAttachment) {\n\t\t\t\tlet clip = <ClippingAttachment>(attachment);\n\t\t\t\tclipper.clipStart(slot, clip);\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tclipper.clipEndWithSlot(slot);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (texture) {\n\t\t\t\tlet slotColor = slot.color;\n\t\t\t\tlet finalColor = this.tempColor;\n\t\t\t\tfinalColor.r = skeletonColor.r * slotColor.r * attachmentColor.r;\n\t\t\t\tfinalColor.g = skeletonColor.g * slotColor.g * attachmentColor.g;\n\t\t\t\tfinalColor.b = skeletonColor.b * slotColor.b * attachmentColor.b;\n\t\t\t\tfinalColor.a = skeletonColor.a * slotColor.a * attachmentColor.a;\n\t\t\t\tif (premultipliedAlpha) {\n\t\t\t\t\tfinalColor.r *= finalColor.a;\n\t\t\t\t\tfinalColor.g *= finalColor.a;\n\t\t\t\t\tfinalColor.b *= finalColor.a;\n\t\t\t\t}\n\t\t\t\tlet darkColor = this.tempColor2;\n\t\t\t\tif (!slot.darkColor)\n\t\t\t\t\tdarkColor.set(0, 0, 0, 1.0);\n\t\t\t\telse {\n\t\t\t\t\tif (premultipliedAlpha) {\n\t\t\t\t\t\tdarkColor.r = slot.darkColor.r * finalColor.a;\n\t\t\t\t\t\tdarkColor.g = slot.darkColor.g * finalColor.a;\n\t\t\t\t\t\tdarkColor.b = slot.darkColor.b * finalColor.a;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdarkColor.setFromColor(slot.darkColor);\n\t\t\t\t\t}\n\t\t\t\t\tdarkColor.a = premultipliedAlpha ? 1.0 : 0.0;\n\t\t\t\t}\n\n\t\t\t\tlet slotBlendMode = slot.data.blendMode;\n\t\t\t\tif (slotBlendMode != blendMode) {\n\t\t\t\t\tblendMode = slotBlendMode;\n\t\t\t\t\tbatcher.setBlendMode(blendMode, premultipliedAlpha);\n\t\t\t\t}\n\n\t\t\t\tif (clipper.isClipping()) {\n\t\t\t\t\tclipper.clipTriangles(renderable.vertices, triangles, triangles.length, uvs, finalColor, darkColor, twoColorTint);\n\t\t\t\t\tlet clippedVertices = new Float32Array(clipper.clippedVertices);\n\t\t\t\t\tlet clippedTriangles = clipper.clippedTriangles;\n\t\t\t\t\tif (transformer) transformer(clippedVertices, clippedVertices.length, vertexSize);\n\t\t\t\t\tbatcher.draw(texture, clippedVertices, clippedTriangles);\n\t\t\t\t} else {\n\t\t\t\t\tlet verts = renderable.vertices;\n\t\t\t\t\tif (!twoColorTint) {\n\t\t\t\t\t\tfor (let v = 2, u = 0, n = renderable.numFloats; v < n; v += vertexSize, u += 2) {\n\t\t\t\t\t\t\tverts[v] = finalColor.r;\n\t\t\t\t\t\t\tverts[v + 1] = finalColor.g;\n\t\t\t\t\t\t\tverts[v + 2] = finalColor.b;\n\t\t\t\t\t\t\tverts[v + 3] = finalColor.a;\n\t\t\t\t\t\t\tverts[v + 4] = uvs[u];\n\t\t\t\t\t\t\tverts[v + 5] = uvs[u + 1];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfor (let v = 2, u = 0, n = renderable.numFloats; v < n; v += vertexSize, u += 2) {\n\t\t\t\t\t\t\tverts[v] = finalColor.r;\n\t\t\t\t\t\t\tverts[v + 1] = finalColor.g;\n\t\t\t\t\t\t\tverts[v + 2] = finalColor.b;\n\t\t\t\t\t\t\tverts[v + 3] = finalColor.a;\n\t\t\t\t\t\t\tverts[v + 4] = uvs[u];\n\t\t\t\t\t\t\tverts[v + 5] = uvs[u + 1];\n\t\t\t\t\t\t\tverts[v + 6] = darkColor.r;\n\t\t\t\t\t\t\tverts[v + 7] = darkColor.g;\n\t\t\t\t\t\t\tverts[v + 8] = darkColor.b;\n\t\t\t\t\t\t\tverts[v + 9] = darkColor.a;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlet view = (renderable.vertices as Float32Array).subarray(0, renderable.numFloats);\n\t\t\t\t\tif (transformer) transformer(renderable.vertices, renderable.numFloats, vertexSize);\n\t\t\t\t\tbatcher.draw(texture, view, triangles);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tclipper.clipEndWithSlot(slot);\n\t\t}\n\t\tclipper.clipEnd();\n\t}\n\n\t/** Returns the {@link SkeletonClipping} used by this renderer for use with e.g. {@link Skeleton.getBounds} **/\n\tpublic getSkeletonClipping (): SkeletonClipping {\n\t\treturn this.clipper;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Color, Disposable, Skeleton, MathUtils, TextureAtlasRegion } from \"@esotericsoftware/spine-core\";\nimport { OrthoCamera } from \"./Camera.js\";\nimport { GLTexture } from \"./GLTexture.js\";\nimport { PolygonBatcher } from \"./PolygonBatcher.js\";\nimport { Shader } from \"./Shader.js\";\nimport { ShapeRenderer } from \"./ShapeRenderer.js\";\nimport { SkeletonDebugRenderer } from \"./SkeletonDebugRenderer.js\";\nimport { SkeletonRenderer, VertexTransformer } from \"./SkeletonRenderer.js\";\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\n;\n\nconst quad = [\n\t0, 0, 1, 1, 1, 1, 0, 0,\n\t0, 0, 1, 1, 1, 1, 0, 0,\n\t0, 0, 1, 1, 1, 1, 0, 0,\n\t0, 0, 1, 1, 1, 1, 0, 0,\n];\nconst QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];\nconst WHITE = new Color(1, 1, 1, 1);\n\nexport class SceneRenderer implements Disposable {\n\tcontext: ManagedWebGLRenderingContext;\n\tcanvas: HTMLCanvasElement;\n\tcamera: OrthoCamera;\n\tbatcher: PolygonBatcher;\n\tprivate twoColorTint = false;\n\tprivate batcherShader: Shader;\n\tprivate shapes: ShapeRenderer;\n\tprivate shapesShader: Shader;\n\tprivate activeRenderer: PolygonBatcher | ShapeRenderer | SkeletonDebugRenderer | null = null;\n\tskeletonRenderer: SkeletonRenderer;\n\tskeletonDebugRenderer: SkeletonDebugRenderer;\n\n\tconstructor (canvas: HTMLCanvasElement, context: ManagedWebGLRenderingContext | WebGLRenderingContext, twoColorTint: boolean = true) {\n\t\tthis.canvas = canvas;\n\t\tthis.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context);\n\t\tthis.twoColorTint = twoColorTint;\n\t\tthis.camera = new OrthoCamera(canvas.width, canvas.height);\n\t\tthis.batcherShader = twoColorTint ? Shader.newTwoColoredTextured(this.context) : Shader.newColoredTextured(this.context);\n\t\tthis.batcher = new PolygonBatcher(this.context, twoColorTint);\n\t\tthis.shapesShader = Shader.newColored(this.context);\n\t\tthis.shapes = new ShapeRenderer(this.context);\n\t\tthis.skeletonRenderer = new SkeletonRenderer(this.context, twoColorTint);\n\t\tthis.skeletonDebugRenderer = new SkeletonDebugRenderer(this.context);\n\t}\n\n\tdispose () {\n\t\tthis.batcher.dispose();\n\t\tthis.batcherShader.dispose();\n\t\tthis.shapes.dispose();\n\t\tthis.shapesShader.dispose();\n\t\tthis.skeletonDebugRenderer.dispose();\n\t}\n\n\tbegin () {\n\t\tthis.camera.update();\n\t\tthis.enableRenderer(this.batcher);\n\t}\n\n\tdrawSkeleton (skeleton: Skeleton, premultipliedAlpha = false, slotRangeStart = -1, slotRangeEnd = -1, transform: VertexTransformer | null = null) {\n\t\tthis.enableRenderer(this.batcher);\n\t\tthis.skeletonRenderer.premultipliedAlpha = premultipliedAlpha;\n\t\tthis.skeletonRenderer.draw(this.batcher, skeleton, slotRangeStart, slotRangeEnd, transform);\n\t}\n\n\tdrawSkeletonDebug (skeleton: Skeleton, premultipliedAlpha = false, ignoredBones?: Array<string>) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.skeletonDebugRenderer.premultipliedAlpha = premultipliedAlpha;\n\t\tthis.skeletonDebugRenderer.draw(this.shapes, skeleton, ignoredBones);\n\t}\n\n\tdrawTexture (texture: GLTexture, x: number, y: number, width: number, height: number, color?: Color) {\n\t\tthis.enableRenderer(this.batcher);\n\t\tif (!color) color = WHITE;\n\t\tvar i = 0;\n\t\tquad[i++] = x;\n\t\tquad[i++] = y;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = 0;\n\t\tquad[i++] = 1;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x + width;\n\t\tquad[i++] = y;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = 1;\n\t\tquad[i++] = 1;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x + width;\n\t\tquad[i++] = y + height;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = 1;\n\t\tquad[i++] = 0;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x;\n\t\tquad[i++] = y + height;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = 0;\n\t\tquad[i++] = 0;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i] = 0;\n\t\t}\n\t\tthis.batcher.draw(texture, quad, QUAD_TRIANGLES);\n\t}\n\n\tdrawTextureUV (texture: GLTexture, x: number, y: number, width: number, height: number, u: number, v: number, u2: number, v2: number, color?: Color) {\n\t\tthis.enableRenderer(this.batcher);\n\t\tif (!color) color = WHITE;\n\t\tvar i = 0;\n\t\tquad[i++] = x;\n\t\tquad[i++] = y;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = u;\n\t\tquad[i++] = v;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x + width;\n\t\tquad[i++] = y;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = u2;\n\t\tquad[i++] = v;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x + width;\n\t\tquad[i++] = y + height;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = u2;\n\t\tquad[i++] = v2;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x;\n\t\tquad[i++] = y + height;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = u;\n\t\tquad[i++] = v2;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i] = 0;\n\t\t}\n\t\tthis.batcher.draw(texture, quad, QUAD_TRIANGLES);\n\t}\n\n\tdrawTextureRotated (texture: GLTexture, x: number, y: number, width: number, height: number, pivotX: number, pivotY: number, angle: number, color?: Color) {\n\t\tthis.enableRenderer(this.batcher);\n\t\tif (!color) color = WHITE;\n\n\t\t// bottom left and top right corner points relative to origin\n\t\tlet worldOriginX = x + pivotX;\n\t\tlet worldOriginY = y + pivotY;\n\t\tlet fx = -pivotX;\n\t\tlet fy = -pivotY;\n\t\tlet fx2 = width - pivotX;\n\t\tlet fy2 = height - pivotY;\n\n\t\t// construct corner points, start from top left and go counter clockwise\n\t\tlet p1x = fx;\n\t\tlet p1y = fy;\n\t\tlet p2x = fx;\n\t\tlet p2y = fy2;\n\t\tlet p3x = fx2;\n\t\tlet p3y = fy2;\n\t\tlet p4x = fx2;\n\t\tlet p4y = fy;\n\n\t\tlet x1 = 0;\n\t\tlet y1 = 0;\n\t\tlet x2 = 0;\n\t\tlet y2 = 0;\n\t\tlet x3 = 0;\n\t\tlet y3 = 0;\n\t\tlet x4 = 0;\n\t\tlet y4 = 0;\n\n\t\t// rotate\n\t\tif (angle != 0) {\n\t\t\tlet cos = MathUtils.cosDeg(angle);\n\t\t\tlet sin = MathUtils.sinDeg(angle);\n\n\t\t\tx1 = cos * p1x - sin * p1y;\n\t\t\ty1 = sin * p1x + cos * p1y;\n\n\t\t\tx4 = cos * p2x - sin * p2y;\n\t\t\ty4 = sin * p2x + cos * p2y;\n\n\t\t\tx3 = cos * p3x - sin * p3y;\n\t\t\ty3 = sin * p3x + cos * p3y;\n\n\t\t\tx2 = x3 + (x1 - x4);\n\t\t\ty2 = y3 + (y1 - y4);\n\t\t} else {\n\t\t\tx1 = p1x;\n\t\t\ty1 = p1y;\n\n\t\t\tx4 = p2x;\n\t\t\ty4 = p2y;\n\n\t\t\tx3 = p3x;\n\t\t\ty3 = p3y;\n\n\t\t\tx2 = p4x;\n\t\t\ty2 = p4y;\n\t\t}\n\n\t\tx1 += worldOriginX;\n\t\ty1 += worldOriginY;\n\t\tx2 += worldOriginX;\n\t\ty2 += worldOriginY;\n\t\tx3 += worldOriginX;\n\t\ty3 += worldOriginY;\n\t\tx4 += worldOriginX;\n\t\ty4 += worldOriginY;\n\n\t\tvar i = 0;\n\t\tquad[i++] = x1;\n\t\tquad[i++] = y1;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = 0;\n\t\tquad[i++] = 1;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x2;\n\t\tquad[i++] = y2;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = 1;\n\t\tquad[i++] = 1;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x3;\n\t\tquad[i++] = y3;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = 1;\n\t\tquad[i++] = 0;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x4;\n\t\tquad[i++] = y4;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = 0;\n\t\tquad[i++] = 0;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i] = 0;\n\t\t}\n\t\tthis.batcher.draw(texture, quad, QUAD_TRIANGLES);\n\t}\n\n\tdrawRegion (region: TextureAtlasRegion, x: number, y: number, width: number, height: number, color?: Color) {\n\t\tthis.enableRenderer(this.batcher);\n\t\tif (!color) color = WHITE;\n\t\tvar i = 0;\n\t\tquad[i++] = x;\n\t\tquad[i++] = y;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = region.u;\n\t\tquad[i++] = region.v2;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x + width;\n\t\tquad[i++] = y;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = region.u2;\n\t\tquad[i++] = region.v2;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x + width;\n\t\tquad[i++] = y + height;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = region.u2;\n\t\tquad[i++] = region.v;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x;\n\t\tquad[i++] = y + height;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = region.u;\n\t\tquad[i++] = region.v;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i] = 0;\n\t\t}\n\t\tthis.batcher.draw(<GLTexture>region.page.texture, quad, QUAD_TRIANGLES);\n\t}\n\n\tline (x: number, y: number, x2: number, y2: number, color?: Color, color2?: Color) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.shapes.line(x, y, x2, y2, color);\n\t}\n\n\ttriangle (filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, color?: Color, color2?: Color, color3?: Color) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.shapes.triangle(filled, x, y, x2, y2, x3, y3, color, color2, color3);\n\t}\n\n\tquad (filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number, color?: Color, color2?: Color, color3?: Color, color4?: Color) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.shapes.quad(filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4);\n\t}\n\n\trect (filled: boolean, x: number, y: number, width: number, height: number, color?: Color) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.shapes.rect(filled, x, y, width, height, color);\n\t}\n\n\trectLine (filled: boolean, x1: number, y1: number, x2: number, y2: number, width: number, color?: Color) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.shapes.rectLine(filled, x1, y1, x2, y2, width, color);\n\t}\n\n\tpolygon (polygonVertices: ArrayLike<number>, offset: number, count: number, color?: Color) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.shapes.polygon(polygonVertices, offset, count, color);\n\t}\n\n\tcircle (filled: boolean, x: number, y: number, radius: number, color?: Color, segments: number = 0) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.shapes.circle(filled, x, y, radius, color, segments);\n\t}\n\n\tcurve (x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color);\n\t}\n\n\tend () {\n\t\tif (this.activeRenderer === this.batcher) this.batcher.end();\n\t\telse if (this.activeRenderer === this.shapes) this.shapes.end();\n\t\tthis.activeRenderer = null;\n\t}\n\n\tresize (resizeMode: ResizeMode) {\n\t\tlet canvas = this.canvas;\n\t\tvar dpr = window.devicePixelRatio || 1;\n\t\tvar w = Math.round(canvas.clientWidth * dpr);\n\t\tvar h = Math.round(canvas.clientHeight * dpr);\n\n\t\tif (canvas.width != w || canvas.height != h) {\n\t\t\tcanvas.width = w;\n\t\t\tcanvas.height = h;\n\t\t}\n\t\tthis.context.gl.viewport(0, 0, canvas.width, canvas.height);\n\n\t\t// Nothing to do for stretch, we simply apply the viewport size of the camera.\n\t\tif (resizeMode === ResizeMode.Expand)\n\t\t\tthis.camera.setViewport(w, h);\n\t\telse if (resizeMode === ResizeMode.Fit) {\n\t\t\tlet sourceWidth = canvas.width, sourceHeight = canvas.height;\n\t\t\tlet targetWidth = this.camera.viewportWidth, targetHeight = this.camera.viewportHeight;\n\t\t\tlet targetRatio = targetHeight / targetWidth;\n\t\t\tlet sourceRatio = sourceHeight / sourceWidth;\n\t\t\tlet scale = targetRatio < sourceRatio ? targetWidth / sourceWidth : targetHeight / sourceHeight;\n\t\t\tthis.camera.setViewport(sourceWidth * scale, sourceHeight * scale);\n\t\t}\n\t\tthis.camera.update();\n\t}\n\n\tprivate enableRenderer (renderer: PolygonBatcher | ShapeRenderer | SkeletonDebugRenderer) {\n\t\tif (this.activeRenderer === renderer) return;\n\t\tthis.end();\n\t\tif (renderer instanceof PolygonBatcher) {\n\t\t\tthis.batcherShader.bind();\n\t\t\tthis.batcherShader.setUniform4x4f(Shader.MVP_MATRIX, this.camera.projectionView.values);\n\t\t\tthis.batcherShader.setUniformi(\"u_texture\", 0);\n\t\t\tthis.batcher.begin(this.batcherShader);\n\t\t\tthis.activeRenderer = this.batcher;\n\t\t} else if (renderer instanceof ShapeRenderer) {\n\t\t\tthis.shapesShader.bind();\n\t\t\tthis.shapesShader.setUniform4x4f(Shader.MVP_MATRIX, this.camera.projectionView.values);\n\t\t\tthis.shapes.begin(this.shapesShader);\n\t\t\tthis.activeRenderer = this.shapes;\n\t\t} else\n\t\t\tthis.activeRenderer = this.skeletonDebugRenderer;\n\t}\n}\n\nexport enum ResizeMode {\n\tStretch,\n\tExpand,\n\tFit\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BlendMode, Color, Disposable, TimeKeeper } from \"@esotericsoftware/spine-core\";\nimport { GLTexture } from \"./GLTexture.js\";\nimport { ResizeMode, SceneRenderer } from \"./SceneRenderer.js\";\n\nlet spinnerImage: HTMLImageElement;\nlet logoImage: HTMLImageElement;\nlet loaded = 0;\n\nconst FADE_IN = 1, FADE_OUT = 1;\nconst logoWidth = 165, logoHeight = 108, spinnerSize = 163;\n\nexport class LoadingScreen implements Disposable {\n\tprivate renderer: SceneRenderer;\n\tprivate logo: GLTexture | null = null;\n\tprivate spinner: GLTexture | null = null;\n\tprivate angle = 0;\n\tprivate fadeOut = 0;\n\tprivate fadeIn = 0;\n\tprivate timeKeeper = new TimeKeeper();\n\tbackgroundColor = new Color(0.135, 0.135, 0.135, 1);\n\tprivate tempColor = new Color();\n\n\tconstructor (renderer: SceneRenderer) {\n\t\tthis.renderer = renderer;\n\n\t\tthis.timeKeeper.maxDelta = 9;\n\n\t\tif (!logoImage) {\n\t\t\tlet isSafari = navigator.userAgent.indexOf(\"Safari\") > -1; // Thank you Apple Inc.\n\t\t\tlet onload = () => loaded++;\n\n\t\t\tlogoImage = new Image();\n\t\t\tlogoImage.src = SPINE_LOGO_DATA;\n\t\t\tif (!isSafari) logoImage.crossOrigin = \"anonymous\";\n\t\t\tlogoImage.onload = onload;\n\n\t\t\tspinnerImage = new Image();\n\t\t\tspinnerImage.src = SPINNER_DATA;\n\t\t\tif (!isSafari) spinnerImage.crossOrigin = \"anonymous\";\n\t\t\tspinnerImage.onload = onload;\n\t\t}\n\t}\n\tdispose (): void {\n\t\tthis.logo?.dispose();\n\t\tthis.spinner?.dispose();\n\t}\n\n\tdraw (complete = false) {\n\t\tif (loaded < 2 || (complete && this.fadeOut > FADE_OUT)) return;\n\n\t\tthis.timeKeeper.update();\n\t\tlet a = Math.abs(Math.sin(this.timeKeeper.totalTime + 0.25));\n\t\tthis.angle -= this.timeKeeper.delta * 200 * (1 + 1.5 * Math.pow(a, 5));\n\n\t\tlet tempColor = this.tempColor;\n\t\tlet renderer = this.renderer;\n\t\tlet canvas = renderer.canvas;\n\t\tlet gl = renderer.context.gl;\n\n\t\trenderer.resize(ResizeMode.Expand);\n\t\trenderer.camera.position.set(canvas.width / 2, canvas.height / 2, 0);\n\t\trenderer.batcher.setBlendMode(BlendMode.Normal, true);\n\n\t\tif (complete) {\n\t\t\tthis.fadeOut += this.timeKeeper.delta * (this.timeKeeper.totalTime < 1 ? 2 : 1);\n\t\t\tif (this.fadeOut > FADE_OUT) return;\n\t\t\ttempColor.setFromColor(this.backgroundColor);\n\t\t\ta = 1 - this.fadeOut / FADE_OUT;\n\t\t\ta = 1 - (a - 1) * (a - 1);\n\t\t\ttempColor.a *= a;\n\t\t\tif (tempColor.a > 0) {\n\t\t\t\trenderer.camera.zoom = 1;\n\t\t\t\trenderer.begin();\n\t\t\t\trenderer.quad(true, 0, 0, canvas.width, 0, canvas.width, canvas.height, 0, canvas.height,\n\t\t\t\t\ttempColor, tempColor, tempColor, tempColor);\n\t\t\t\trenderer.end();\n\t\t\t}\n\t\t} else {\n\t\t\tthis.fadeIn += this.timeKeeper.delta;\n\t\t\tif (this.backgroundColor.a > 0) {\n\t\t\t\tgl.clearColor(this.backgroundColor.r, this.backgroundColor.g, this.backgroundColor.b, this.backgroundColor.a);\n\t\t\t\tgl.clear(gl.COLOR_BUFFER_BIT);\n\t\t\t}\n\t\t\ta = 1;\n\t\t}\n\t\ta *= Math.min(this.fadeIn / FADE_IN, 1);\n\t\ttempColor.set(a, a, a, a);\n\n\t\tif (!this.logo) {\n\t\t\tthis.logo = new GLTexture(renderer.context, logoImage);\n\t\t\tthis.spinner = new GLTexture(renderer.context, spinnerImage);\n\t\t}\n\t\trenderer.camera.zoom = Math.max(1, spinnerSize / canvas.height);\n\t\trenderer.begin();\n\t\trenderer.drawTexture(this.logo, (canvas.width - logoWidth) / 2, (canvas.height - logoHeight) / 2, logoWidth, logoHeight, tempColor);\n\t\tif (this.spinner) renderer.drawTextureRotated(this.spinner, (canvas.width - spinnerSize) / 2, (canvas.height - spinnerSize) / 2, spinnerSize, spinnerSize, spinnerSize / 2, spinnerSize / 2, this.angle, tempColor);\n\t\trenderer.end();\n\t}\n}\n\nlet SPINNER_DATA = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAACjCAYAAADmbK6AAAALKElEQVR42u2de2iW5R/GPzuqcwfnnKfNmafl5tTNHWzqNi3DEMQykcAoJSsySkspjSIk0iD/07Kf4R+FnVBDUTshZGpWUEJaaiWFgZlUFmXmIe3HNXthyebeZ77P9H13ffBG8Y8H7ut7vff93N/7fu4vGGPiFZiez/Qtw9lytJajfzfw9z/j+efPOv7cV8W+lUNY2a8T/ayTCRsWFLJA5rtUO1LLkV5p9LJeJizQiHeqnlOtmVFtdTGrrZkJCxYXsTgaI6r9MY4/UpNItW4mFDaXsTlaM6qVZlBq3UwofFrJp0HMWJ9DvXUzobCznJ1BzFjWlTLrZkJh/TDWBzFjTgo51s2EgnKI0Rrx+FiOWzNzVaym91Syx5qZsGBWb2ZFa0ZN6dbMhAWTcpkUrRmXD2K5NTNhgVbH0Zpxbl/mWjMTFvRIo0e0ZpzcncnWzISKtvmiMWNRJ4qslwmVXRXsas2Ix8ZwzFqZsGFREYtaM+Oaa1ljrUzYkJ9G/ok6TlzKjJWZVFor0y7c1Zu7WjLiqiGsskamXdHopyT4vALmzS9k/t19uHtKHlOSIMn6xAtARjIZ1sFcUSZ0Y4La+G6M18hS2IlCn4a+WoC0JNL0d/dUupdnUj40g6EJ2VEdMnhrOG/p5f/jUXz8SgmvaGU6KpNRNsLVQV0OdXf24s63h/P2gWoOrBjMCr2GJFQnnxnIM3q5P1PPmaYv+4ev4/C6UtbpV2gzXCkgL5W8Bwt48OI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xIXIxlg2SBbMvECY3e7oApbDaIgQu5/2HmeEKEINYiwSRi7EQkLFgumZOCuggctKGI4ULZN/vMeSLj0AYMytWEqMLzFg4fYDaoKaC6wvOFR4FkIPQFaILxrJAOsHsc/zlfYDWXE8qF22s8Pz5KHxcgEVALBtjJXBSSEOwFhk1Zgy4hitCT4hVw+gFs8/zwxqIBbUgyK7fcyA0PD9XX4iVxhiC0xdof6STWCsoBmKF7+cVCWFXQYyBMxRpf+STX1b0x45AhN0OMSrOGEirhrY/dfQAdjvS7oy+WCF6r1RIFxXWvlTRg1YVqFWBmxZbD99ig9pt0YPQw9rD1nstVri9V+/Ve3XrS/wfim4P5fIFxLoAAAAASUVORK5CYII=\";\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { TimeKeeper, AssetManager, ManagedWebGLRenderingContext, SceneRenderer, Input, StringMap } from \"./index.js\";\n\n/** An app running inside a {@link SpineCanvas}. The app life-cycle\n * is as follows:\n *\n * 1. `loadAssets()` is called. The app can queue assets for loading via {@link SpineCanvas.assetManager}.\n * 2. `initialize()` is called when all assets are loaded. The app can setup anything it needs to enter the main application logic.\n * 3. `update()` is called periodically at screen refresh rate. The app can update its state.\n * 4. `render()` is called periodically at screen refresh rate. The app can render its state via {@link SpineCanvas.renderer} or directly via the WebGL context in {@link SpineCanvas.gl}.\n *\n * The `error()` method is called in case the assets could not be loaded. The `dispose()` method is called in case the canvas has been disposed via {@link SpineCanvas.dispose}.\n */\nexport interface SpineCanvasApp {\n\tloadAssets?(canvas: SpineCanvas): void;\n\tinitialize?(canvas: SpineCanvas): void;\n\tupdate?(canvas: SpineCanvas, delta: number): void;\n\trender?(canvas: SpineCanvas): void;\n\terror?(canvas: SpineCanvas, errors: StringMap<string>): void;\n\tdispose?(canvas: SpineCanvas): void;\n}\n\n/** Configuration passed to the {@link SpineCanvas} constructor */\nexport interface SpineCanvasConfig {\n\t/* The {@link SpineCanvasApp} to be run in the canvas. */\n\tapp: SpineCanvasApp;\n\t/* The path prefix to be used by the {@link AssetManager}. */\n\tpathPrefix?: string;\n\t/* The WebGL context configuration */\n\twebglConfig?: any;\n}\n\n/** Manages the life-cycle and WebGL context of a {@link SpineCanvasApp}. The app loads\n * assets and initializes itself, then updates and renders its state at the screen refresh rate. */\nexport class SpineCanvas {\n\treadonly context: ManagedWebGLRenderingContext;\n\n\t/** Tracks the current time, delta, and other time related statistics. */\n\treadonly time = new TimeKeeper();\n\t/** The HTML canvas to render to. */\n\treadonly htmlCanvas: HTMLCanvasElement;\n\t/** The WebGL rendering context. */\n\treadonly gl: WebGLRenderingContext;\n\t/** The scene renderer for easy drawing of skeletons, shapes, and images. */\n\treadonly renderer: SceneRenderer;\n\t/** The asset manager to load assets with. */\n\treadonly assetManager: AssetManager;\n\t/** The input processor used to listen to mouse, touch, and keyboard events. */\n\treadonly input: Input;\n\n\tprivate disposed = false;\n\n\t/** Constructs a new spine canvas, rendering to the provided HTML canvas. */\n\tconstructor (canvas: HTMLCanvasElement, private config: SpineCanvasConfig) {\n\t\tif (!config.pathPrefix) config.pathPrefix = \"\";\n\t\tif (!config.app) config.app = {\n\t\t\tloadAssets: () => { },\n\t\t\tinitialize: () => { },\n\t\t\tupdate: () => { },\n\t\t\trender: () => { },\n\t\t\terror: () => { },\n\t\t\tdispose: () => { },\n\t\t}\n\t\tif (!config.webglConfig) config.webglConfig = { alpha: true };\n\n\t\tthis.htmlCanvas = canvas;\n\t\tthis.context = new ManagedWebGLRenderingContext(canvas, config.webglConfig);\n\t\tthis.renderer = new SceneRenderer(canvas, this.context);\n\t\tthis.gl = this.context.gl;\n\t\tthis.assetManager = new AssetManager(this.context, config.pathPrefix);\n\t\tthis.input = new Input(canvas);\n\n\t\tif (config.app.loadAssets) config.app.loadAssets(this);\n\n\t\tlet loop = () => {\n\t\t\tif (this.disposed) return;\n\t\t\trequestAnimationFrame(loop);\n\t\t\tthis.time.update();\n\t\t\tif (config.app.update) config.app.update(this, this.time.delta);\n\t\t\tif (config.app.render) config.app.render(this);\n\t\t}\n\n\t\tlet waitForAssets = () => {\n\t\t\tif (this.disposed) return;\n\t\t\tif (this.assetManager.isLoadingComplete()) {\n\t\t\t\tif (this.assetManager.hasErrors()) {\n\t\t\t\t\tif (config.app.error) config.app.error(this, this.assetManager.getErrors());\n\t\t\t\t} else {\n\t\t\t\t\tif (config.app.initialize) config.app.initialize(this);\n\t\t\t\t\tloop();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\trequestAnimationFrame(waitForAssets);\n\t\t}\n\t\trequestAnimationFrame(waitForAssets);\n\t}\n\n\t/** Clears the canvas with the given color. The color values are given in the range [0,1]. */\n\tclear (r: number, g: number, b: number, a: number) {\n\t\tthis.gl.clearColor(r, g, b, a);\n\t\tthis.gl.clear(this.gl.COLOR_BUFFER_BIT);\n\t}\n\n\t/** Disposes the app, so the update() and render() functions are no longer called. Calls the dispose() callback.*/\n\tdispose () {\n\t\tif (this.config.app.dispose) this.config.app.dispose(this);\n\t\tthis.disposed = true;\n\t}\n}\n", "/*\nThe MIT License (MIT)\n\nCopyright (c) 2021-present AgogPixel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\n// Adapted from https://github.com/agogpixel/phaser3-ts-utils/tree/main\n\nlet components = (Phaser.GameObjects.Components as any);\nexport const ComputedSize = components.ComputedSize;\nexport const Depth = components.Depth;\nexport const Flip = components.Flip;\nexport const ScrollFactor = components.ScrollFactor;\nexport const Transform = components.Transform;\nexport const Visible = components.Visible;\nexport const Origin = components.Origin;\nexport const Alpha = components.Alpha;\n\nexport interface Type<\n\tT,\n\tP extends any[] = any[]\n\t> extends Function {\n\tnew(...args: P): T;\n}\n\nexport type Mixin<GameObjectComponent, GameObjectConstraint extends Phaser.GameObjects.GameObject> = <\n\tGameObjectType extends Type<GameObjectConstraint>\n\t>(\n\tBaseGameObject: GameObjectType\n) => GameObjectType & Type<GameObjectComponent>;\n\nexport function createMixin<\n\tGameObjectComponent,\n\tGameObjectConstraint extends Phaser.GameObjects.GameObject = Phaser.GameObjects.GameObject\n> (\n\t...component: GameObjectComponent[]\n): Mixin<GameObjectComponent, GameObjectConstraint> {\n\treturn (BaseGameObject) => {\n\t\t(Phaser as any).Class.mixin(BaseGameObject, component);\n\t\treturn BaseGameObject as any;\n\t};\n}\n\ntype ComputedSizeMixin = Mixin<Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.GameObject>;\nexport const ComputedSizeMixin: ComputedSizeMixin = createMixin<Phaser.GameObjects.Components.ComputedSize>(ComputedSize);\n\ntype DepthMixin = Mixin<Phaser.GameObjects.Components.Depth, Phaser.GameObjects.GameObject>;\nexport const DepthMixin: DepthMixin = createMixin<Phaser.GameObjects.Components.Depth>(Depth);\n\ntype FlipMixin = Mixin<Phaser.GameObjects.Components.Flip, Phaser.GameObjects.GameObject>;\nexport const FlipMixin: FlipMixin = createMixin<Phaser.GameObjects.Components.Flip>(Flip);\n\ntype ScrollFactorMixin = Mixin<Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.GameObject>;\nexport const ScrollFactorMixin: ScrollFactorMixin = createMixin<Phaser.GameObjects.Components.ScrollFactor>(ScrollFactor);\n\ntype TransformMixin = Mixin<Phaser.GameObjects.Components.Transform, Phaser.GameObjects.GameObject>;\nexport const TransformMixin: TransformMixin = createMixin<Phaser.GameObjects.Components.Transform>(Transform);\n\ntype VisibleMixin = Mixin<Phaser.GameObjects.Components.Visible, Phaser.GameObjects.GameObject>;\nexport const VisibleMixin: VisibleMixin = createMixin<Phaser.GameObjects.Components.Visible>(Visible);\n\ntype OriginMixin = Mixin<Phaser.GameObjects.Components.Origin, Phaser.GameObjects.GameObject>;\nexport const OriginMixin: OriginMixin = createMixin<Phaser.GameObjects.Components.Origin>(Origin);\n\ntype AlphaMixin = Mixin<Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.GameObject>;\nexport const AlphaMixin: AlphaMixin = createMixin<Phaser.GameObjects.Components.Alpha>(Alpha);", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { SPINE_GAME_OBJECT_TYPE } from \"./keys.js\";\nimport { SpinePlugin } from \"./SpinePlugin.js\";\nimport {\n\tComputedSizeMixin,\n\tDepthMixin,\n\tFlipMixin,\n\tScrollFactorMixin,\n\tTransformMixin,\n\tVisibleMixin,\n\tAlphaMixin,\n\tOriginMixin,\n} from \"./mixins.js\";\nimport {\n\tAnimationState,\n\tAnimationStateData,\n\tBone,\n\tMathUtils,\n\tPhysics,\n\tSkeleton,\n\tSkeletonClipping,\n\tSkin,\n\tVector2,\n} from \"@esotericsoftware/spine-core\";\n\nclass BaseSpineGameObject extends Phaser.GameObjects.GameObject {\n\tconstructor (scene: Phaser.Scene, type: string) {\n\t\tsuper(scene, type);\n\t}\n}\n\n/** A bounds provider calculates the bounding box for a skeleton, which is then assigned as the size of the SpineGameObject. */\nexport interface SpineGameObjectBoundsProvider {\n\t// Returns the bounding box for the skeleton, in skeleton space.\n\tcalculateBounds (gameObject: SpineGameObject): {\n\t\tx: number;\n\t\ty: number;\n\t\twidth: number;\n\t\theight: number;\n\t};\n}\n\n/** A bounds provider that calculates the bounding box from the setup pose. */\nexport class SetupPoseBoundsProvider implements SpineGameObjectBoundsProvider {\n\t/**\n\t * @param clipping If true, clipping attachments are used to compute the bounds. False, by default.\n\t */\n\tconstructor (\n\t\tprivate clipping = false,\n\t) { }\n\n\tcalculateBounds (gameObject: SpineGameObject) {\n\t\tif (!gameObject.skeleton) return { x: 0, y: 0, width: 0, height: 0 };\n\t\t// Make a copy of animation state and skeleton as this might be called while\n\t\t// the skeleton in the GameObject has already been heavily modified. We can not\n\t\t// reconstruct that state.\n\t\tconst skeleton = new Skeleton(gameObject.skeleton.data);\n\t\tskeleton.setToSetupPose();\n\t\tskeleton.updateWorldTransform(Physics.update);\n\t\tconst bounds = skeleton.getBoundsRect(this.clipping ? new SkeletonClipping() : undefined);\n\t\treturn bounds.width == Number.NEGATIVE_INFINITY\n\t\t\t? { x: 0, y: 0, width: 0, height: 0 }\n\t\t\t: bounds;\n\t}\n}\n\n/** A bounds provider that calculates the bounding box by taking the maximumg bounding box for a combination of skins and specific animation. */\nexport class SkinsAndAnimationBoundsProvider\n\timplements SpineGameObjectBoundsProvider {\n\t/**\n\t * @param animation The animation to use for calculating the bounds. If null, the setup pose is used.\n\t * @param skins The skins to use for calculating the bounds. If empty, the default skin is used.\n\t * @param timeStep The time step to use for calculating the bounds. A smaller time step means more precision, but slower calculation.\n\t * @param clipping If true, clipping attachments are used to compute the bounds. False, by default.\n\t */\n\tconstructor (\n\t\tprivate animation: string | null,\n\t\tprivate skins: string[] = [],\n\t\tprivate timeStep: number = 0.05,\n\t\tprivate clipping = false,\n\t) { }\n\n\tcalculateBounds (gameObject: SpineGameObject): {\n\t\tx: number;\n\t\ty: number;\n\t\twidth: number;\n\t\theight: number;\n\t} {\n\t\tif (!gameObject.skeleton || !gameObject.animationState)\n\t\t\treturn { x: 0, y: 0, width: 0, height: 0 };\n\t\t// Make a copy of animation state and skeleton as this might be called while\n\t\t// the skeleton in the GameObject has already been heavily modified. We can not\n\t\t// reconstruct that state.\n\t\tconst animationState = new AnimationState(gameObject.animationState.data);\n\t\tconst skeleton = new Skeleton(gameObject.skeleton.data);\n\t\tconst clipper = this.clipping ? new SkeletonClipping() : undefined;\n\t\tconst data = skeleton.data;\n\t\tif (this.skins.length > 0) {\n\t\t\tlet customSkin = new Skin(\"custom-skin\");\n\t\t\tfor (const skinName of this.skins) {\n\t\t\t\tconst skin = data.findSkin(skinName);\n\t\t\t\tif (skin == null) continue;\n\t\t\t\tcustomSkin.addSkin(skin);\n\t\t\t}\n\t\t\tskeleton.setSkin(customSkin);\n\t\t}\n\t\tskeleton.setToSetupPose();\n\n\t\tconst animation =\n\t\t\tthis.animation != null ? data.findAnimation(this.animation!) : null;\n\t\tif (animation == null) {\n\t\t\tskeleton.updateWorldTransform(Physics.update);\n\t\t\tconst bounds = skeleton.getBoundsRect(clipper);\n\t\t\treturn bounds.width == Number.NEGATIVE_INFINITY\n\t\t\t\t? { x: 0, y: 0, width: 0, height: 0 }\n\t\t\t\t: bounds;\n\t\t} else {\n\t\t\tlet minX = Number.POSITIVE_INFINITY,\n\t\t\t\tminY = Number.POSITIVE_INFINITY,\n\t\t\t\tmaxX = Number.NEGATIVE_INFINITY,\n\t\t\t\tmaxY = Number.NEGATIVE_INFINITY;\n\t\t\tanimationState.clearTracks();\n\t\t\tanimationState.setAnimationWith(0, animation, false);\n\t\t\tconst steps = Math.max(animation.duration / this.timeStep, 1.0);\n\t\t\tfor (let i = 0; i < steps; i++) {\n\t\t\t\tconst delta = i > 0 ? this.timeStep : 0;\n\t\t\t\tanimationState.update(delta);\n\t\t\t\tanimationState.apply(skeleton);\n\t\t\t\tskeleton.update(delta);\n\t\t\t\tskeleton.updateWorldTransform(Physics.update);\n\n\t\t\t\tconst bounds = skeleton.getBoundsRect(clipper);\n\t\t\t\tminX = Math.min(minX, bounds.x);\n\t\t\t\tminY = Math.min(minY, bounds.y);\n\t\t\t\tmaxX = Math.max(maxX, bounds.x + bounds.width);\n\t\t\t\tmaxY = Math.max(maxY, bounds.y + bounds.height);\n\t\t\t}\n\t\t\tconst bounds = {\n\t\t\t\tx: minX,\n\t\t\t\ty: minY,\n\t\t\t\twidth: maxX - minX,\n\t\t\t\theight: maxY - minY,\n\t\t\t};\n\t\t\treturn bounds.width == Number.NEGATIVE_INFINITY\n\t\t\t\t? { x: 0, y: 0, width: 0, height: 0 }\n\t\t\t\t: bounds;\n\t\t}\n\t}\n}\n\n/**\n * A SpineGameObject is a Phaser {@link GameObject} that can be added to a Phaser Scene and render a Spine skeleton.\n *\n * The Spine GameObject is a thin wrapper around a Spine {@link Skeleton}, {@link AnimationState} and {@link AnimationStateData}. It is responsible for:\n * - updating the animation state\n * - applying the animation state to the skeleton's bones, slots, attachments, and draw order.\n * - updating the skeleton's bone world transforms\n * - rendering the skeleton\n *\n * See the {@link SpinePlugin} class for more information on how to create a `SpineGameObject`.\n *\n * The skeleton, animation state, and animation state data can be accessed via the repsective fields. They can be manually updated via {@link updatePose}.\n *\n * To modify the bone hierarchy before the world transforms are computed, a callback can be set via the {@link beforeUpdateWorldTransforms} field.\n *\n * To modify the bone hierarchy after the world transforms are computed, a callback can be set via the {@link afterUpdateWorldTransforms} field.\n *\n * The class also features methods to convert between the skeleton coordinate system and the Phaser coordinate system.\n *\n * See {@link skeletonToPhaserWorldCoordinates}, {@link phaserWorldCoordinatesToSkeleton}, and {@link phaserWorldCoordinatesToBoneLocal.}\n */\nexport class SpineGameObject extends DepthMixin(\n\tOriginMixin(\n\t\tComputedSizeMixin(\n\t\t\tFlipMixin(\n\t\t\t\tScrollFactorMixin(\n\t\t\t\t\tTransformMixin(VisibleMixin(AlphaMixin(BaseSpineGameObject)))\n\t\t\t\t)\n\t\t\t)\n\t\t)\n\t)\n) {\n\tblendMode = -1;\n\tskeleton: Skeleton;\n\tanimationStateData: AnimationStateData;\n\tanimationState: AnimationState;\n\tbeforeUpdateWorldTransforms: (object: SpineGameObject) => void = () => { };\n\tafterUpdateWorldTransforms: (object: SpineGameObject) => void = () => { };\n\tprivate premultipliedAlpha = false;\n\n\tconstructor (\n\t\tscene: Phaser.Scene,\n\t\tprivate plugin: SpinePlugin,\n\t\tx: number,\n\t\ty: number,\n\t\tdataKey: string,\n\t\tatlasKey: string,\n\t\tpublic boundsProvider: SpineGameObjectBoundsProvider = new SetupPoseBoundsProvider()\n\t) {\n\t\tsuper(scene, (window as any).SPINE_GAME_OBJECT_TYPE ? (window as any).SPINE_GAME_OBJECT_TYPE : SPINE_GAME_OBJECT_TYPE);\n\t\tthis.setPosition(x, y);\n\n\t\tthis.premultipliedAlpha = this.plugin.isAtlasPremultiplied(atlasKey);\n\t\tthis.skeleton = this.plugin.createSkeleton(dataKey, atlasKey);\n\t\tthis.animationStateData = new AnimationStateData(this.skeleton.data);\n\t\tthis.animationState = new AnimationState(this.animationStateData);\n\t\tthis.skeleton.updateWorldTransform(Physics.update);\n\t\tthis.updateSize();\n\t}\n\n\tupdateSize () {\n\t\tif (!this.skeleton) return;\n\t\tlet bounds = this.boundsProvider.calculateBounds(this);\n\t\t// For some reason the TS compiler and the ComputedSize mixin don't work well together and we have\n\t\t// to cast to any.\n\t\tlet self = this as any;\n\t\tself.width = bounds.width;\n\t\tself.height = bounds.height;\n\t\tthis.displayOriginX = -bounds.x;\n\t\tthis.displayOriginY = -bounds.y;\n\t}\n\n\t/** Converts a point from the skeleton coordinate system to the Phaser world coordinate system. */\n\tskeletonToPhaserWorldCoordinates (point: { x: number; y: number }) {\n\t\tlet transform = this.getWorldTransformMatrix();\n\t\tlet a = transform.a,\n\t\t\tb = transform.b,\n\t\t\tc = transform.c,\n\t\t\td = transform.d,\n\t\t\ttx = transform.tx,\n\t\t\tty = transform.ty;\n\t\tlet x = point.x;\n\t\tlet y = point.y;\n\t\tpoint.x = x * a + y * c + tx;\n\t\tpoint.y = x * b + y * d + ty;\n\t}\n\n\t/** Converts a point from the Phaser world coordinate system to the skeleton coordinate system. */\n\tphaserWorldCoordinatesToSkeleton (point: { x: number; y: number }) {\n\t\tlet transform = this.getWorldTransformMatrix();\n\t\ttransform = transform.invert();\n\t\tlet a = transform.a,\n\t\t\tb = transform.b,\n\t\t\tc = transform.c,\n\t\t\td = transform.d,\n\t\t\ttx = transform.tx,\n\t\t\tty = transform.ty;\n\t\tlet x = point.x;\n\t\tlet y = point.y;\n\t\tpoint.x = x * a + y * c + tx;\n\t\tpoint.y = x * b + y * d + ty;\n\t}\n\n\t/** Converts a point from the Phaser world coordinate system to the bone's local coordinate system. */\n\tphaserWorldCoordinatesToBone (point: { x: number; y: number }, bone: Bone) {\n\t\tthis.phaserWorldCoordinatesToSkeleton(point);\n\t\tif (bone.parent) {\n\t\t\tbone.parent.worldToLocal(point as Vector2);\n\t\t} else {\n\t\t\tbone.worldToLocal(point as Vector2);\n\t\t}\n\t}\n\n\t/**\n\t * Updates the {@link AnimationState}, applies it to the {@link Skeleton}, then updates the world transforms of all bones.\n\t * @param delta The time delta in milliseconds\n\t */\n\tupdatePose (delta: number) {\n\t\tthis.animationState.update(delta / 1000);\n\t\tthis.animationState.apply(this.skeleton);\n\t\tthis.beforeUpdateWorldTransforms(this);\n\t\tthis.skeleton.update(delta / 1000);\n\t\tthis.skeleton.updateWorldTransform(Physics.update);\n\t\tthis.afterUpdateWorldTransforms(this);\n\t}\n\n\tpreUpdate (time: number, delta: number) {\n\t\tif (!this.skeleton || !this.animationState) return;\n\t\tthis.updatePose(delta);\n\t}\n\n\tpreDestroy () {\n\t\t// FIXME tear down any event emitters\n\t}\n\n\twillRender (camera: Phaser.Cameras.Scene2D.Camera) {\n\t\tvar GameObjectRenderMask = 0xf;\n\t\tvar result = !this.skeleton || !(GameObjectRenderMask !== this.renderFlags || (this.cameraFilter !== 0 && this.cameraFilter & camera.id));\n\t\tif (!this.visible) result = false;\n\n\t\tif (!result && this.parentContainer && this.plugin.webGLRenderer) {\n\t\t\tvar sceneRenderer = this.plugin.webGLRenderer;\n\n\t\t\tif (this.plugin.gl && this.plugin.phaserRenderer instanceof Phaser.Renderer.WebGL.WebGLRenderer && sceneRenderer.batcher.isDrawing) {\n\t\t\t\tsceneRenderer.end();\n\t\t\t\tthis.plugin.phaserRenderer.pipelines.rebind();\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\trenderWebGL (\n\t\trenderer: Phaser.Renderer.WebGL.WebGLRenderer,\n\t\tsrc: SpineGameObject,\n\t\tcamera: Phaser.Cameras.Scene2D.Camera,\n\t\tparentMatrix: Phaser.GameObjects.Components.TransformMatrix\n\t) {\n\t\tif (!this.skeleton || !this.animationState || !this.plugin.webGLRenderer)\n\t\t\treturn;\n\n\t\tlet sceneRenderer = this.plugin.webGLRenderer;\n\t\tif (renderer.newType) {\n\t\t\trenderer.pipelines.clear();\n\t\t\tsceneRenderer.begin();\n\t\t}\n\n\t\tcamera.addToRenderList(src);\n\t\tlet transform = Phaser.GameObjects.GetCalcMatrix(\n\t\t\tsrc,\n\t\t\tcamera,\n\t\t\tparentMatrix\n\t\t).calc;\n\t\tlet a = transform.a,\n\t\t\tb = transform.b,\n\t\t\tc = transform.c,\n\t\t\td = transform.d,\n\t\t\ttx = transform.tx,\n\t\t\tty = transform.ty;\n\t\tsceneRenderer.drawSkeleton(\n\t\t\tthis.skeleton,\n\t\t\tthis.premultipliedAlpha,\n\t\t\t-1,\n\t\t\t-1,\n\t\t\t(vertices, numVertices, stride) => {\n\t\t\t\tfor (let i = 0; i < numVertices; i += stride) {\n\t\t\t\t\tlet vx = vertices[i];\n\t\t\t\t\tlet vy = vertices[i + 1];\n\t\t\t\t\tvertices[i] = vx * a + vy * c + tx;\n\t\t\t\t\tvertices[i + 1] = vx * b + vy * d + ty;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tif (!renderer.nextTypeMatch) {\n\t\t\tsceneRenderer.end();\n\t\t\trenderer.pipelines.rebind();\n\t\t}\n\t}\n\n\trenderCanvas (\n\t\trenderer: Phaser.Renderer.Canvas.CanvasRenderer,\n\t\tsrc: SpineGameObject,\n\t\tcamera: Phaser.Cameras.Scene2D.Camera,\n\t\tparentMatrix: Phaser.GameObjects.Components.TransformMatrix\n\t) {\n\t\tif (!this.skeleton || !this.animationState || !this.plugin.canvasRenderer)\n\t\t\treturn;\n\n\t\tlet context = renderer.currentContext;\n\t\tlet skeletonRenderer = this.plugin.canvasRenderer;\n\t\t(skeletonRenderer as any).ctx = context;\n\n\t\tcamera.addToRenderList(src);\n\t\tlet transform = Phaser.GameObjects.GetCalcMatrix(\n\t\t\tsrc,\n\t\t\tcamera,\n\t\t\tparentMatrix\n\t\t).calc;\n\t\tlet skeleton = this.skeleton;\n\t\tskeleton.x = transform.tx;\n\t\tskeleton.y = transform.ty;\n\t\tskeleton.scaleX = transform.scaleX;\n\t\tskeleton.scaleY = transform.scaleY;\n\t\tlet root = skeleton.getRootBone()!;\n\t\troot.rotation = -MathUtils.radiansToDegrees * transform.rotationNormalized;\n\t\tthis.skeleton.updateWorldTransform(Physics.update);\n\n\t\tcontext.save();\n\t\tskeletonRenderer.draw(skeleton);\n\t\tcontext.restore();\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Texture, TextureFilter, TextureWrap } from \"@esotericsoftware/spine-core\";\n\nexport class CanvasTexture extends Texture {\n\tconstructor (image: HTMLImageElement | ImageBitmap) {\n\t\tsuper(image);\n\t}\n\n\tsetFilters (minFilter: TextureFilter, magFilter: TextureFilter) { }\n\tsetWraps (uWrap: TextureWrap, vWrap: TextureWrap) { }\n\tdispose () { }\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Utils, Color, Skeleton, RegionAttachment, BlendMode, MeshAttachment, Slot, TextureRegion, TextureAtlasRegion } from \"@esotericsoftware/spine-core\";\nimport { CanvasTexture } from \"./CanvasTexture.js\";\n\nconst worldVertices = Utils.newFloatArray(8);\n\nexport class SkeletonRenderer {\n\tstatic QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];\n\tstatic VERTEX_SIZE = 2 + 2 + 4;\n\n\tprivate ctx: CanvasRenderingContext2D;\n\n\tpublic triangleRendering = false;\n\tpublic debugRendering = false;\n\tprivate vertices = Utils.newFloatArray(8 * 1024);\n\tprivate tempColor = new Color();\n\n\tconstructor (context: CanvasRenderingContext2D) {\n\t\tthis.ctx = context;\n\t}\n\n\tdraw (skeleton: Skeleton) {\n\t\tif (this.triangleRendering) this.drawTriangles(skeleton);\n\t\telse this.drawImages(skeleton);\n\t}\n\n\tprivate drawImages (skeleton: Skeleton) {\n\t\tlet ctx = this.ctx;\n\t\tlet color = this.tempColor;\n\t\tlet skeletonColor = skeleton.color;\n\t\tlet drawOrder = skeleton.drawOrder;\n\n\t\tif (this.debugRendering) ctx.strokeStyle = \"green\";\n\n\t\tfor (let i = 0, n = drawOrder.length; i < n; i++) {\n\t\t\tlet slot = drawOrder[i];\n\t\t\tlet bone = slot.bone;\n\t\t\tif (!bone.active) continue;\n\n\t\t\tlet attachment = slot.getAttachment();\n\t\t\tif (!(attachment instanceof RegionAttachment)) continue;\n\t\t\tattachment.computeWorldVertices(slot, worldVertices, 0, 2);\n\t\t\tlet region: TextureRegion = <TextureRegion>attachment.region;\n\n\t\t\tlet image: HTMLImageElement = (<CanvasTexture>region.texture).getImage() as HTMLImageElement;\n\n\t\t\tlet slotColor = slot.color;\n\t\t\tlet regionColor = attachment.color;\n\t\t\tcolor.set(skeletonColor.r * slotColor.r * regionColor.r,\n\t\t\t\tskeletonColor.g * slotColor.g * regionColor.g,\n\t\t\t\tskeletonColor.b * slotColor.b * regionColor.b,\n\t\t\t\tskeletonColor.a * slotColor.a * regionColor.a);\n\n\t\t\tctx.save();\n\t\t\tctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY);\n\t\t\tctx.translate(attachment.offset[0], attachment.offset[1]);\n\t\t\tctx.rotate(attachment.rotation * Math.PI / 180);\n\n\t\t\tlet atlasScale = attachment.width / region.originalWidth;\n\t\t\tctx.scale(atlasScale * attachment.scaleX, atlasScale * attachment.scaleY);\n\n\t\t\tlet w = region.width, h = region.height;\n\t\t\tctx.translate(w / 2, h / 2);\n\t\t\tif (attachment.region!.degrees == 90) {\n\t\t\t\tlet t = w;\n\t\t\t\tw = h;\n\t\t\t\th = t;\n\t\t\t\tctx.rotate(-Math.PI / 2);\n\t\t\t}\n\t\t\tctx.scale(1, -1);\n\t\t\tctx.translate(-w / 2, -h / 2);\n\n\t\t\tctx.globalAlpha = color.a;\n\t\t\tctx.drawImage(image, image.width * region.u, image.height * region.v, w, h, 0, 0, w, h);\n\t\t\tif (this.debugRendering) ctx.strokeRect(0, 0, w, h);\n\t\t\tctx.restore();\n\t\t}\n\t}\n\n\tprivate drawTriangles (skeleton: Skeleton) {\n\t\tlet ctx = this.ctx;\n\t\tlet color = this.tempColor;\n\t\tlet skeletonColor = skeleton.color;\n\t\tlet drawOrder = skeleton.drawOrder;\n\n\t\tlet blendMode: BlendMode | null = null;\n\t\tlet vertices: ArrayLike<number> = this.vertices;\n\t\tlet triangles: Array<number> | null = null;\n\n\t\tfor (let i = 0, n = drawOrder.length; i < n; i++) {\n\t\t\tlet slot = drawOrder[i];\n\t\t\tlet attachment = slot.getAttachment();\n\n\t\t\tlet texture: HTMLImageElement;\n\t\t\tlet region: TextureAtlasRegion;\n\t\t\tif (attachment instanceof RegionAttachment) {\n\t\t\t\tlet regionAttachment = <RegionAttachment>attachment;\n\t\t\t\tvertices = this.computeRegionVertices(slot, regionAttachment, false);\n\t\t\t\ttriangles = SkeletonRenderer.QUAD_TRIANGLES;\n\t\t\t\ttexture = (<CanvasTexture>regionAttachment.region!.texture).getImage() as HTMLImageElement;\n\t\t\t} else if (attachment instanceof MeshAttachment) {\n\t\t\t\tlet mesh = <MeshAttachment>attachment;\n\t\t\t\tvertices = this.computeMeshVertices(slot, mesh, false);\n\t\t\t\ttriangles = mesh.triangles;\n\t\t\t\ttexture = (<CanvasTexture>mesh.region!.texture).getImage() as HTMLImageElement;\n\t\t\t} else\n\t\t\t\tcontinue;\n\n\t\t\tif (texture) {\n\t\t\t\tif (slot.data.blendMode != blendMode) blendMode = slot.data.blendMode;\n\n\t\t\t\tlet slotColor = slot.color;\n\t\t\t\tlet attachmentColor = attachment.color;\n\t\t\t\tcolor.set(skeletonColor.r * slotColor.r * attachmentColor.r,\n\t\t\t\t\tskeletonColor.g * slotColor.g * attachmentColor.g,\n\t\t\t\t\tskeletonColor.b * slotColor.b * attachmentColor.b,\n\t\t\t\t\tskeletonColor.a * slotColor.a * attachmentColor.a);\n\n\t\t\t\tctx.globalAlpha = color.a;\n\n\t\t\t\tfor (var j = 0; j < triangles.length; j += 3) {\n\t\t\t\t\tlet t1 = triangles[j] * 8, t2 = triangles[j + 1] * 8, t3 = triangles[j + 2] * 8;\n\n\t\t\t\t\tlet x0 = vertices[t1], y0 = vertices[t1 + 1], u0 = vertices[t1 + 6], v0 = vertices[t1 + 7];\n\t\t\t\t\tlet x1 = vertices[t2], y1 = vertices[t2 + 1], u1 = vertices[t2 + 6], v1 = vertices[t2 + 7];\n\t\t\t\t\tlet x2 = vertices[t3], y2 = vertices[t3 + 1], u2 = vertices[t3 + 6], v2 = vertices[t3 + 7];\n\n\t\t\t\t\tthis.drawTriangle(texture, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2);\n\n\t\t\t\t\tif (this.debugRendering) {\n\t\t\t\t\t\tctx.strokeStyle = \"green\";\n\t\t\t\t\t\tctx.beginPath();\n\t\t\t\t\t\tctx.moveTo(x0, y0);\n\t\t\t\t\t\tctx.lineTo(x1, y1);\n\t\t\t\t\t\tctx.lineTo(x2, y2);\n\t\t\t\t\t\tctx.lineTo(x0, y0);\n\t\t\t\t\t\tctx.stroke();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.ctx.globalAlpha = 1;\n\t}\n\n\t// Adapted from http://extremelysatisfactorytotalitarianism.com/blog/?p=2120\n\t// Apache 2 licensed\n\tprivate drawTriangle (img: HTMLImageElement, x0: number, y0: number, u0: number, v0: number,\n\t\tx1: number, y1: number, u1: number, v1: number,\n\t\tx2: number, y2: number, u2: number, v2: number) {\n\t\tlet ctx = this.ctx;\n\n\t\tconst width = img.width - 1;\n\t\tconst height = img.height - 1;\n\t\tu0 *= width;\n\t\tv0 *= height;\n\t\tu1 *= width;\n\t\tv1 *= height;\n\t\tu2 *= width;\n\t\tv2 *= height;\n\n\t\tctx.beginPath();\n\t\tctx.moveTo(x0, y0);\n\t\tctx.lineTo(x1, y1);\n\t\tctx.lineTo(x2, y2);\n\t\tctx.closePath();\n\n\t\tx1 -= x0;\n\t\ty1 -= y0;\n\t\tx2 -= x0;\n\t\ty2 -= y0;\n\n\t\tu1 -= u0;\n\t\tv1 -= v0;\n\t\tu2 -= u0;\n\t\tv2 -= v0;\n\n\t\tlet det = u1 * v2 - u2 * v1;\n\t\tif (det == 0) return;\n\t\tdet = 1 / det;\n\n\t\t// linear transformation\n\t\tconst a = (v2 * x1 - v1 * x2) * det;\n\t\tconst b = (v2 * y1 - v1 * y2) * det;\n\t\tconst c = (u1 * x2 - u2 * x1) * det;\n\t\tconst d = (u1 * y2 - u2 * y1) * det;\n\n\t\t// translation\n\t\tconst e = x0 - a * u0 - c * v0;\n\t\tconst f = y0 - b * u0 - d * v0;\n\n\t\tctx.save();\n\t\tctx.transform(a, b, c, d, e, f);\n\t\tctx.clip();\n\t\tctx.drawImage(img, 0, 0);\n\t\tctx.restore();\n\t}\n\n\tprivate computeRegionVertices (slot: Slot, region: RegionAttachment, pma: boolean) {\n\t\tlet skeletonColor = slot.bone.skeleton.color;\n\t\tlet slotColor = slot.color;\n\t\tlet regionColor = region.color;\n\t\tlet alpha = skeletonColor.a * slotColor.a * regionColor.a;\n\t\tlet multiplier = pma ? alpha : 1;\n\t\tlet color = this.tempColor;\n\t\tcolor.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier,\n\t\t\tskeletonColor.g * slotColor.g * regionColor.g * multiplier,\n\t\t\tskeletonColor.b * slotColor.b * regionColor.b * multiplier,\n\t\t\talpha);\n\n\t\tregion.computeWorldVertices(slot, this.vertices, 0, SkeletonRenderer.VERTEX_SIZE);\n\n\t\tlet vertices = this.vertices;\n\t\tlet uvs = region.uvs;\n\n\t\tvertices[RegionAttachment.C1R] = color.r;\n\t\tvertices[RegionAttachment.C1G] = color.g;\n\t\tvertices[RegionAttachment.C1B] = color.b;\n\t\tvertices[RegionAttachment.C1A] = color.a;\n\t\tvertices[RegionAttachment.U1] = uvs[0];\n\t\tvertices[RegionAttachment.V1] = uvs[1];\n\n\t\tvertices[RegionAttachment.C2R] = color.r;\n\t\tvertices[RegionAttachment.C2G] = color.g;\n\t\tvertices[RegionAttachment.C2B] = color.b;\n\t\tvertices[RegionAttachment.C2A] = color.a;\n\t\tvertices[RegionAttachment.U2] = uvs[2];\n\t\tvertices[RegionAttachment.V2] = uvs[3];\n\n\t\tvertices[RegionAttachment.C3R] = color.r;\n\t\tvertices[RegionAttachment.C3G] = color.g;\n\t\tvertices[RegionAttachment.C3B] = color.b;\n\t\tvertices[RegionAttachment.C3A] = color.a;\n\t\tvertices[RegionAttachment.U3] = uvs[4];\n\t\tvertices[RegionAttachment.V3] = uvs[5];\n\n\t\tvertices[RegionAttachment.C4R] = color.r;\n\t\tvertices[RegionAttachment.C4G] = color.g;\n\t\tvertices[RegionAttachment.C4B] = color.b;\n\t\tvertices[RegionAttachment.C4A] = color.a;\n\t\tvertices[RegionAttachment.U4] = uvs[6];\n\t\tvertices[RegionAttachment.V4] = uvs[7];\n\n\t\treturn vertices;\n\t}\n\n\tprivate computeMeshVertices (slot: Slot, mesh: MeshAttachment, pma: boolean) {\n\t\tlet skeletonColor = slot.bone.skeleton.color;\n\t\tlet slotColor = slot.color;\n\t\tlet regionColor = mesh.color;\n\t\tlet alpha = skeletonColor.a * slotColor.a * regionColor.a;\n\t\tlet multiplier = pma ? alpha : 1;\n\t\tlet color = this.tempColor;\n\t\tcolor.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier,\n\t\t\tskeletonColor.g * slotColor.g * regionColor.g * multiplier,\n\t\t\tskeletonColor.b * slotColor.b * regionColor.b * multiplier,\n\t\t\talpha);\n\n\t\tlet vertexCount = mesh.worldVerticesLength / 2;\n\t\tlet vertices = this.vertices;\n\t\tif (vertices.length < mesh.worldVerticesLength) this.vertices = vertices = Utils.newFloatArray(mesh.worldVerticesLength);\n\t\tmesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, SkeletonRenderer.VERTEX_SIZE);\n\n\t\tlet uvs = mesh.uvs;\n\t\tfor (let i = 0, u = 0, v = 2; i < vertexCount; i++) {\n\t\t\tvertices[v++] = color.r;\n\t\t\tvertices[v++] = color.g;\n\t\t\tvertices[v++] = color.b;\n\t\t\tvertices[v++] = color.a;\n\t\t\tvertices[v++] = uvs[u++];\n\t\t\tvertices[v++] = uvs[u++];\n\t\t\tv += 2;\n\t\t}\n\n\t\treturn vertices;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport * from \"./require-shim.js\"\nexport * from \"./SpinePlugin.js\"\nexport * from \"./SpineGameObject.js\"\nexport * from \"./mixins.js\"\nexport * from \"@esotericsoftware/spine-core\";\nexport * from \"@esotericsoftware/spine-webgl\";\nimport { SpineGameObjectConfig, SpinePlugin } from \"./SpinePlugin.js\";\n(window as any).spine = { SpinePlugin: SpinePlugin };\n(window as any)[\"spine.SpinePlugin\"] = SpinePlugin;\n\nimport { SpineGameObject, SpineGameObjectBoundsProvider } from \"./SpineGameObject.js\";\n\ndeclare global {\n\tnamespace Phaser.Loader {\n\t\texport interface LoaderPlugin {\n\t\t\tspineJson (key: string, url: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin;\n\t\t\tspineBinary (key: string, url: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin;\n\t\t\tspineAtlas (key: string, url: string, premultipliedAlpha?: boolean, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin;\n\t\t}\n\t}\n\n\tnamespace Phaser.GameObjects {\n\t\texport interface GameObjectFactory {\n\t\t\tspine (x: number, y: number, dataKey: string, atlasKey: string, boundsProvider?: SpineGameObjectBoundsProvider): SpineGameObject;\n\t\t}\n\n\t\texport interface GameObjectCreator {\n\t\t\tspine (config: SpineGameObjectConfig, addToScene?: boolean): SpineGameObject;\n\t\t}\n\t}\n\n\tnamespace Phaser {\n\t\texport interface Scene {\n\t\t\tspine: SpinePlugin;\n\t\t}\n\t}\n}\n"],
"mappings": ";;;;;;;;AAgCA,IAAI,OAAO,WAAW,eAAe,OAAO,QAAQ;AACnD,MAAI,cAAc,OAAO;AACzB,SAAO,UAAU,CAAC,MAAc;AAC/B,QAAI;AAAa,aAAO,YAAY,CAAC;AAAA,aAC5B,MAAM;AAAU,aAAO,OAAO;AAAA,EACxC;AACD;;;ACTA,YAAYA,aAAY;;;ACAjB,IAAM,gCAAgC;AACtC,IAAM,wBAAwB;AAE9B,IAAM,gCAAgC;AACtC,IAAM,wBAAwB;AAC9B,IAAM,yBAAyB;;;ACE/B,IAAM,SAAN,MAAa;AAAA,EACnB,QAAQ,IAAI,MAA0B;AAAA,EAEtC,IAAK,OAAwB;AAC5B,QAAI,WAAW,KAAK,SAAS,KAAK;AAClC,SAAK,MAAM,QAAQ,CAAC,IAAI,QAAQ;AAChC,WAAO,CAAC;AAAA,EACT;AAAA,EAEA,SAAU,OAAe;AACxB,WAAO,KAAK,MAAM,QAAQ,CAAC,KAAK;AAAA,EACjC;AAAA,EAEA,OAAQ,OAAe;AACtB,SAAK,MAAM,QAAQ,CAAC,IAAI;AAAA,EACzB;AAAA,EAEA,QAAS;AACR,SAAK,MAAM,SAAS;AAAA,EACrB;AACD;AAEO,IAAM,YAAN,MAAgB;AAAA,EACtB,UAA8B,CAAC;AAAA,EAC/B,OAAO;AAAA,EAEP,IAAK,OAAwB;AAC5B,QAAI,WAAW,KAAK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,uBAAuB,KAAK,KAAK,QAAQ,WAAW,KAAK,KAAK,KAAK,KAAK,QAAQ,UAAU,KAAK;AAC9H,eAAK,OAAO;AAAA,YACX,MAAM,KAAK;AAAA,YACX,oBAAoB,KAAK;AAAA,UAC1B;AACA,eAAK,WAAW;AAAA,QACjB;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;;;A+DlXC,OAAe,QAAQ,EAAE,YAAyB;AAClD,OAAe,mBAAmB,IAAI;",
"names": ["Phaser", "worldVertices", "v", "SequenceMode", "MixBlend", "MixDirection", "x", "y", "i", "vertexAttachment", "constraint", "i", "n", "timeline", "EventType", "TextureFilter", "TextureWrap", "page", "worldVertices", "worldVertices", "Inherit", "s", "PositionMode", "SpacingMode", "RotateMode", "closed", "pathLength", "multiplier", "Physics", "BlendMode", "closed", "AttachmentType", "n", "LinkedMesh", "readTimeline1", "readTimeline2", "timeline", "Matrix4", "Matrix4", "VertexAttributeType", "temp", "ShapeType", "i", "n", "n", "ResizeMode", "bounds", "_SkeletonRenderer", "SkeletonRenderer", "SkeletonRenderer", "SpineSkeletonDataFileType"]
}