kiwiengine 0.0.1-alpha → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (599) hide show
  1. package/README.ko.md +550 -0
  2. package/README.md +575 -4
  3. package/examples/auto-battle/assets/bgm/battle.mp3 +0 -0
  4. package/examples/auto-battle/assets/bitmap-fonts/white-peaberry.fnt +107 -0
  5. package/examples/auto-battle/assets/bitmap-fonts/white-peaberry.png +0 -0
  6. package/examples/auto-battle/assets/joystick/joystick.png +0 -0
  7. package/examples/auto-battle/assets/joystick/knob.png +0 -0
  8. package/examples/auto-battle/assets/sfx/hero/die/die.wav +0 -0
  9. package/examples/auto-battle/assets/sfx/hero/heal/heal.wav +0 -0
  10. package/examples/auto-battle/assets/sfx/hero/hit/hit1.wav +0 -0
  11. package/examples/auto-battle/assets/sfx/hero/hit/hit2.wav +0 -0
  12. package/examples/auto-battle/assets/sfx/hero/hit/hit3.wav +0 -0
  13. package/examples/auto-battle/assets/sfx/hero/miss/miss1.wav +0 -0
  14. package/examples/auto-battle/assets/sfx/hero/miss/miss2.wav +0 -0
  15. package/examples/auto-battle/assets/sfx/hero/miss/miss3.wav +0 -0
  16. package/examples/auto-battle/assets/sfx/orc/die/die.wav +0 -0
  17. package/examples/auto-battle/assets/sfx/orc/hit/hit1.wav +0 -0
  18. package/examples/auto-battle/assets/sfx/orc/hit/hit2.wav +0 -0
  19. package/examples/auto-battle/assets/sfx/orc/hit/hit3.wav +0 -0
  20. package/examples/auto-battle/assets/sfx/orc/miss/miss1.wav +0 -0
  21. package/examples/auto-battle/assets/sfx/orc/miss/miss2.wav +0 -0
  22. package/examples/auto-battle/assets/sfx/orc/miss/miss3.wav +0 -0
  23. package/examples/auto-battle/assets/spritesheets/hero-atlas.json +246 -0
  24. package/examples/auto-battle/assets/spritesheets/hero.png +0 -0
  25. package/examples/auto-battle/assets/spritesheets/orc-atlas.json +246 -0
  26. package/examples/auto-battle/assets/spritesheets/orc.png +0 -0
  27. package/examples/auto-battle/assets/spritesheets/potion-atlas.json +68 -0
  28. package/examples/auto-battle/assets/spritesheets/potion.png +0 -0
  29. package/examples/auto-battle/dist/game.js +2 -0
  30. package/examples/auto-battle/dist/game.js.LICENSE.txt +35 -0
  31. package/examples/auto-battle/hud/damage-text.ts +46 -0
  32. package/examples/auto-battle/hud/heal-text.ts +46 -0
  33. package/examples/auto-battle/hud/hp-bar.ts +38 -0
  34. package/examples/auto-battle/index.ts +41 -0
  35. package/examples/auto-battle/objects/character.ts +95 -0
  36. package/examples/auto-battle/objects/hero.ts +119 -0
  37. package/examples/auto-battle/objects/orc.ts +107 -0
  38. package/examples/auto-battle/objects/potion.ts +27 -0
  39. package/examples/auto-battle/stage.ts +366 -0
  40. package/examples/battle-benchmark-matterjs/assets/bgm/battle.mp3 +0 -0
  41. package/examples/battle-benchmark-matterjs/assets/bitmap-fonts/white-peaberry.fnt +107 -0
  42. package/examples/battle-benchmark-matterjs/assets/bitmap-fonts/white-peaberry.png +0 -0
  43. package/examples/battle-benchmark-matterjs/assets/joystick/joystick.png +0 -0
  44. package/examples/battle-benchmark-matterjs/assets/joystick/knob.png +0 -0
  45. package/examples/battle-benchmark-matterjs/assets/sfx/hero/die/die.wav +0 -0
  46. package/examples/battle-benchmark-matterjs/assets/sfx/hero/heal/heal.wav +0 -0
  47. package/examples/battle-benchmark-matterjs/assets/sfx/hero/hit/hit1.wav +0 -0
  48. package/examples/battle-benchmark-matterjs/assets/sfx/hero/hit/hit2.wav +0 -0
  49. package/examples/battle-benchmark-matterjs/assets/sfx/hero/hit/hit3.wav +0 -0
  50. package/examples/battle-benchmark-matterjs/assets/sfx/hero/miss/miss1.wav +0 -0
  51. package/examples/battle-benchmark-matterjs/assets/sfx/hero/miss/miss2.wav +0 -0
  52. package/examples/battle-benchmark-matterjs/assets/sfx/hero/miss/miss3.wav +0 -0
  53. package/examples/battle-benchmark-matterjs/assets/sfx/orc/die/die.wav +0 -0
  54. package/examples/battle-benchmark-matterjs/assets/sfx/orc/hit/hit1.wav +0 -0
  55. package/examples/battle-benchmark-matterjs/assets/sfx/orc/hit/hit2.wav +0 -0
  56. package/examples/battle-benchmark-matterjs/assets/sfx/orc/hit/hit3.wav +0 -0
  57. package/examples/battle-benchmark-matterjs/assets/sfx/orc/miss/miss1.wav +0 -0
  58. package/examples/battle-benchmark-matterjs/assets/sfx/orc/miss/miss2.wav +0 -0
  59. package/examples/battle-benchmark-matterjs/assets/sfx/orc/miss/miss3.wav +0 -0
  60. package/examples/battle-benchmark-matterjs/assets/spritesheets/hero-atlas.json +246 -0
  61. package/examples/battle-benchmark-matterjs/assets/spritesheets/hero.png +0 -0
  62. package/examples/battle-benchmark-matterjs/assets/spritesheets/orc-atlas.json +246 -0
  63. package/examples/battle-benchmark-matterjs/assets/spritesheets/orc.png +0 -0
  64. package/examples/battle-benchmark-matterjs/assets/spritesheets/potion-atlas.json +68 -0
  65. package/examples/battle-benchmark-matterjs/assets/spritesheets/potion.png +0 -0
  66. package/examples/battle-benchmark-matterjs/dist/game.js +2 -0
  67. package/examples/battle-benchmark-matterjs/dist/game.js.LICENSE.txt +35 -0
  68. package/examples/battle-benchmark-matterjs/hud/damage-text.ts +46 -0
  69. package/examples/battle-benchmark-matterjs/hud/heal-text.ts +46 -0
  70. package/examples/battle-benchmark-matterjs/hud/hp-bar.ts +38 -0
  71. package/examples/battle-benchmark-matterjs/index.html +24 -0
  72. package/examples/battle-benchmark-matterjs/index.ts +41 -0
  73. package/examples/battle-benchmark-matterjs/objects/character.ts +95 -0
  74. package/examples/battle-benchmark-matterjs/objects/hero.ts +111 -0
  75. package/examples/battle-benchmark-matterjs/objects/orc.ts +107 -0
  76. package/examples/battle-benchmark-matterjs/objects/potion.ts +27 -0
  77. package/examples/battle-benchmark-matterjs/stage.ts +177 -0
  78. package/examples/battle-benchmark-separation/assets/bgm/battle.mp3 +0 -0
  79. package/examples/battle-benchmark-separation/assets/bitmap-fonts/white-peaberry.fnt +107 -0
  80. package/examples/battle-benchmark-separation/assets/bitmap-fonts/white-peaberry.png +0 -0
  81. package/examples/battle-benchmark-separation/assets/joystick/joystick.png +0 -0
  82. package/examples/battle-benchmark-separation/assets/joystick/knob.png +0 -0
  83. package/examples/battle-benchmark-separation/assets/sfx/hero/die/die.wav +0 -0
  84. package/examples/battle-benchmark-separation/assets/sfx/hero/heal/heal.wav +0 -0
  85. package/examples/battle-benchmark-separation/assets/sfx/hero/hit/hit1.wav +0 -0
  86. package/examples/battle-benchmark-separation/assets/sfx/hero/hit/hit2.wav +0 -0
  87. package/examples/battle-benchmark-separation/assets/sfx/hero/hit/hit3.wav +0 -0
  88. package/examples/battle-benchmark-separation/assets/sfx/hero/miss/miss1.wav +0 -0
  89. package/examples/battle-benchmark-separation/assets/sfx/hero/miss/miss2.wav +0 -0
  90. package/examples/battle-benchmark-separation/assets/sfx/hero/miss/miss3.wav +0 -0
  91. package/examples/battle-benchmark-separation/assets/sfx/orc/die/die.wav +0 -0
  92. package/examples/battle-benchmark-separation/assets/sfx/orc/hit/hit1.wav +0 -0
  93. package/examples/battle-benchmark-separation/assets/sfx/orc/hit/hit2.wav +0 -0
  94. package/examples/battle-benchmark-separation/assets/sfx/orc/hit/hit3.wav +0 -0
  95. package/examples/battle-benchmark-separation/assets/sfx/orc/miss/miss1.wav +0 -0
  96. package/examples/battle-benchmark-separation/assets/sfx/orc/miss/miss2.wav +0 -0
  97. package/examples/battle-benchmark-separation/assets/sfx/orc/miss/miss3.wav +0 -0
  98. package/examples/battle-benchmark-separation/assets/spritesheets/hero-atlas.json +246 -0
  99. package/examples/battle-benchmark-separation/assets/spritesheets/hero.png +0 -0
  100. package/examples/battle-benchmark-separation/assets/spritesheets/orc-atlas.json +246 -0
  101. package/examples/battle-benchmark-separation/assets/spritesheets/orc.png +0 -0
  102. package/examples/battle-benchmark-separation/assets/spritesheets/potion-atlas.json +68 -0
  103. package/examples/battle-benchmark-separation/assets/spritesheets/potion.png +0 -0
  104. package/examples/battle-benchmark-separation/dist/game.js +2 -0
  105. package/examples/battle-benchmark-separation/dist/game.js.LICENSE.txt +35 -0
  106. package/examples/battle-benchmark-separation/hud/damage-text.ts +46 -0
  107. package/examples/battle-benchmark-separation/hud/heal-text.ts +46 -0
  108. package/examples/battle-benchmark-separation/hud/hp-bar.ts +38 -0
  109. package/examples/battle-benchmark-separation/index.html +24 -0
  110. package/examples/battle-benchmark-separation/index.ts +41 -0
  111. package/examples/battle-benchmark-separation/objects/character.ts +225 -0
  112. package/examples/battle-benchmark-separation/objects/hero.ts +110 -0
  113. package/examples/battle-benchmark-separation/objects/orc.ts +213 -0
  114. package/examples/battle-benchmark-separation/objects/potion.ts +27 -0
  115. package/examples/battle-benchmark-separation/stage.ts +178 -0
  116. package/examples/battle-benchmark-separation2/assets/bgm/battle.mp3 +0 -0
  117. package/examples/battle-benchmark-separation2/assets/bitmap-fonts/white-peaberry.fnt +107 -0
  118. package/examples/battle-benchmark-separation2/assets/bitmap-fonts/white-peaberry.png +0 -0
  119. package/examples/battle-benchmark-separation2/assets/joystick/joystick.png +0 -0
  120. package/examples/battle-benchmark-separation2/assets/joystick/knob.png +0 -0
  121. package/examples/battle-benchmark-separation2/assets/sfx/hero/die/die.wav +0 -0
  122. package/examples/battle-benchmark-separation2/assets/sfx/hero/heal/heal.wav +0 -0
  123. package/examples/battle-benchmark-separation2/assets/sfx/hero/hit/hit1.wav +0 -0
  124. package/examples/battle-benchmark-separation2/assets/sfx/hero/hit/hit2.wav +0 -0
  125. package/examples/battle-benchmark-separation2/assets/sfx/hero/hit/hit3.wav +0 -0
  126. package/examples/battle-benchmark-separation2/assets/sfx/hero/miss/miss1.wav +0 -0
  127. package/examples/battle-benchmark-separation2/assets/sfx/hero/miss/miss2.wav +0 -0
  128. package/examples/battle-benchmark-separation2/assets/sfx/hero/miss/miss3.wav +0 -0
  129. package/examples/battle-benchmark-separation2/assets/sfx/orc/die/die.wav +0 -0
  130. package/examples/battle-benchmark-separation2/assets/sfx/orc/hit/hit1.wav +0 -0
  131. package/examples/battle-benchmark-separation2/assets/sfx/orc/hit/hit2.wav +0 -0
  132. package/examples/battle-benchmark-separation2/assets/sfx/orc/hit/hit3.wav +0 -0
  133. package/examples/battle-benchmark-separation2/assets/sfx/orc/miss/miss1.wav +0 -0
  134. package/examples/battle-benchmark-separation2/assets/sfx/orc/miss/miss2.wav +0 -0
  135. package/examples/battle-benchmark-separation2/assets/sfx/orc/miss/miss3.wav +0 -0
  136. package/examples/battle-benchmark-separation2/assets/spritesheets/hero-atlas.json +246 -0
  137. package/examples/battle-benchmark-separation2/assets/spritesheets/hero.png +0 -0
  138. package/examples/battle-benchmark-separation2/assets/spritesheets/orc-atlas.json +246 -0
  139. package/examples/battle-benchmark-separation2/assets/spritesheets/orc.png +0 -0
  140. package/examples/battle-benchmark-separation2/assets/spritesheets/potion-atlas.json +68 -0
  141. package/examples/battle-benchmark-separation2/assets/spritesheets/potion.png +0 -0
  142. package/examples/battle-benchmark-separation2/dist/game.js +2 -0
  143. package/examples/battle-benchmark-separation2/dist/game.js.LICENSE.txt +35 -0
  144. package/examples/battle-benchmark-separation2/hud/damage-text.ts +46 -0
  145. package/examples/battle-benchmark-separation2/hud/heal-text.ts +46 -0
  146. package/examples/battle-benchmark-separation2/hud/hp-bar.ts +38 -0
  147. package/examples/battle-benchmark-separation2/index.html +24 -0
  148. package/examples/battle-benchmark-separation2/index.ts +41 -0
  149. package/examples/battle-benchmark-separation2/objects/character.ts +195 -0
  150. package/examples/battle-benchmark-separation2/objects/hero.ts +110 -0
  151. package/examples/battle-benchmark-separation2/objects/orc.ts +213 -0
  152. package/examples/battle-benchmark-separation2/objects/potion.ts +27 -0
  153. package/examples/battle-benchmark-separation2/stage.ts +178 -0
  154. package/examples/collision-test/assets/cat.png +0 -0
  155. package/examples/collision-test/dist/game.js +2 -0
  156. package/examples/collision-test/dist/game.js.LICENSE.txt +35 -0
  157. package/examples/collision-test/index.html +24 -0
  158. package/examples/collision-test/index.ts +30 -0
  159. package/examples/dom-particle-test/assets/bird.png +0 -0
  160. package/examples/dom-particle-test/dist/game.js +2 -0
  161. package/examples/dom-particle-test/dist/game.js.LICENSE.txt +35 -0
  162. package/examples/dom-particle-test/index.html +24 -0
  163. package/examples/dom-particle-test/index.ts +27 -0
  164. package/examples/dom-sprite-test/assets/bird.png +0 -0
  165. package/examples/dom-sprite-test/assets/fire.png +0 -0
  166. package/examples/dom-sprite-test/assets/run.png +0 -0
  167. package/examples/dom-sprite-test/dist/game.js +2 -0
  168. package/examples/dom-sprite-test/dist/game.js.LICENSE.txt +35 -0
  169. package/examples/dom-sprite-test/index.html +24 -0
  170. package/examples/dom-sprite-test/index.ts +35 -0
  171. package/examples/dom-test/dist/game.js +2 -0
  172. package/examples/dom-test/dist/game.js.LICENSE.txt +35 -0
  173. package/examples/dom-test/index.html +24 -0
  174. package/examples/dom-test/index.ts +22 -0
  175. package/examples/particle-test/assets/bird.png +0 -0
  176. package/examples/particle-test/dist/game.js +2 -0
  177. package/examples/particle-test/dist/game.js.LICENSE.txt +35 -0
  178. package/examples/particle-test/index.html +24 -0
  179. package/examples/particle-test/index.ts +30 -0
  180. package/examples/renderer-test/dist/game.js +2 -0
  181. package/examples/renderer-test/dist/game.js.LICENSE.txt +35 -0
  182. package/examples/renderer-test/index.html +24 -0
  183. package/examples/renderer-test/index.ts +9 -0
  184. package/examples/simple-battle/assets/bgm/battle.mp3 +0 -0
  185. package/examples/simple-battle/assets/bitmap-fonts/white-peaberry.fnt +107 -0
  186. package/examples/simple-battle/assets/bitmap-fonts/white-peaberry.png +0 -0
  187. package/examples/simple-battle/assets/joystick/joystick.png +0 -0
  188. package/examples/simple-battle/assets/joystick/knob.png +0 -0
  189. package/examples/simple-battle/assets/sfx/hero/die/die.wav +0 -0
  190. package/examples/simple-battle/assets/sfx/hero/heal/heal.wav +0 -0
  191. package/examples/simple-battle/assets/sfx/hero/hit/hit1.wav +0 -0
  192. package/examples/simple-battle/assets/sfx/hero/hit/hit2.wav +0 -0
  193. package/examples/simple-battle/assets/sfx/hero/hit/hit3.wav +0 -0
  194. package/examples/simple-battle/assets/sfx/hero/miss/miss1.wav +0 -0
  195. package/examples/simple-battle/assets/sfx/hero/miss/miss2.wav +0 -0
  196. package/examples/simple-battle/assets/sfx/hero/miss/miss3.wav +0 -0
  197. package/examples/simple-battle/assets/sfx/orc/die/die.wav +0 -0
  198. package/examples/simple-battle/assets/sfx/orc/hit/hit1.wav +0 -0
  199. package/examples/simple-battle/assets/sfx/orc/hit/hit2.wav +0 -0
  200. package/examples/simple-battle/assets/sfx/orc/hit/hit3.wav +0 -0
  201. package/examples/simple-battle/assets/sfx/orc/miss/miss1.wav +0 -0
  202. package/examples/simple-battle/assets/sfx/orc/miss/miss2.wav +0 -0
  203. package/examples/simple-battle/assets/sfx/orc/miss/miss3.wav +0 -0
  204. package/examples/simple-battle/assets/spritesheets/hero-atlas.json +246 -0
  205. package/examples/simple-battle/assets/spritesheets/hero.png +0 -0
  206. package/examples/simple-battle/assets/spritesheets/orc-atlas.json +246 -0
  207. package/examples/simple-battle/assets/spritesheets/orc.png +0 -0
  208. package/examples/simple-battle/assets/spritesheets/potion-atlas.json +68 -0
  209. package/examples/simple-battle/assets/spritesheets/potion.png +0 -0
  210. package/examples/simple-battle/dist/game.js +2 -0
  211. package/examples/simple-battle/dist/game.js.LICENSE.txt +35 -0
  212. package/examples/simple-battle/hud/damage-text.ts +46 -0
  213. package/examples/simple-battle/hud/heal-text.ts +46 -0
  214. package/examples/simple-battle/hud/hp-bar.ts +38 -0
  215. package/examples/simple-battle/index.html +24 -0
  216. package/examples/simple-battle/index.ts +41 -0
  217. package/examples/simple-battle/objects/character.ts +95 -0
  218. package/examples/simple-battle/objects/hero.ts +111 -0
  219. package/examples/simple-battle/objects/orc.ts +107 -0
  220. package/examples/simple-battle/objects/potion.ts +27 -0
  221. package/examples/simple-battle/stage.ts +174 -0
  222. package/examples/spine-test/assets/spine/spineboy.atlas +95 -0
  223. package/examples/spine-test/assets/spine/spineboy.png +0 -0
  224. package/examples/spine-test/assets/spine/spineboy.skel +0 -0
  225. package/examples/spine-test/dist/game.js +2 -0
  226. package/examples/spine-test/dist/game.js.LICENSE.txt +35 -0
  227. package/examples/spine-test/index.html +24 -0
  228. package/examples/spine-test/index.ts +29 -0
  229. package/examples/sprite-test/assets/bird.png +0 -0
  230. package/examples/sprite-test/assets/fire.png +0 -0
  231. package/examples/sprite-test/dist/game.js +2 -0
  232. package/examples/sprite-test/dist/game.js.LICENSE.txt +35 -0
  233. package/examples/sprite-test/index.html +24 -0
  234. package/examples/sprite-test/index.ts +38 -0
  235. package/examples/tsconfig.json +2 -1
  236. package/examples/webpack.config.js +17 -3
  237. package/jest.config.ts +10 -0
  238. package/lib/asset/audio.js +47 -11
  239. package/lib/asset/audio.js.map +1 -1
  240. package/lib/asset/loaders/audio.js +7 -4
  241. package/lib/asset/loaders/audio.js.map +1 -1
  242. package/lib/asset/loaders/binary.js +7 -4
  243. package/lib/asset/loaders/binary.js.map +1 -1
  244. package/lib/asset/loaders/bitmap-font.js +74 -0
  245. package/lib/asset/loaders/bitmap-font.js.map +1 -0
  246. package/lib/asset/loaders/font.js +4 -1
  247. package/lib/asset/loaders/font.js.map +1 -1
  248. package/lib/asset/loaders/loader.js +17 -12
  249. package/lib/asset/loaders/loader.js.map +1 -1
  250. package/lib/asset/loaders/spritesheet.js +18 -8
  251. package/lib/asset/loaders/spritesheet.js.map +1 -1
  252. package/lib/asset/loaders/text.js +6 -3
  253. package/lib/asset/loaders/text.js.map +1 -1
  254. package/lib/asset/loaders/texture.js +22 -26
  255. package/lib/asset/loaders/texture.js.map +1 -1
  256. package/lib/asset/preload.js +60 -56
  257. package/lib/asset/preload.js.map +1 -1
  258. package/lib/collision/check-collision.js +804 -0
  259. package/lib/collision/check-collision.js.map +1 -0
  260. package/lib/collision/check-collision.test.js +300 -0
  261. package/lib/collision/check-collision.test.js.map +1 -0
  262. package/lib/collision/colliders.js +8 -0
  263. package/lib/collision/colliders.js.map +1 -0
  264. package/lib/debug.js.map +1 -0
  265. package/lib/dom/dom-animated-sprite.js +106 -0
  266. package/lib/dom/dom-animated-sprite.js.map +1 -0
  267. package/lib/dom/dom-game-object.js +108 -0
  268. package/lib/dom/dom-game-object.js.map +1 -0
  269. package/lib/dom/dom-particle.js +105 -0
  270. package/lib/dom/dom-particle.js.map +1 -0
  271. package/lib/dom/dom-preload.js +43 -0
  272. package/lib/dom/dom-preload.js.map +1 -0
  273. package/lib/dom/dom-sprite.js +40 -0
  274. package/lib/dom/dom-sprite.js.map +1 -0
  275. package/lib/dom/dom-texture-loader.js +36 -0
  276. package/lib/dom/dom-texture-loader.js.map +1 -0
  277. package/lib/dom/dom-utils.js +20 -0
  278. package/lib/dom/dom-utils.js.map +1 -0
  279. package/lib/index copy.js +16 -0
  280. package/lib/index copy.js.map +1 -0
  281. package/lib/index.js +36 -10
  282. package/lib/index.js.map +1 -1
  283. package/lib/input/joystick.js +262 -0
  284. package/lib/input/joystick.js.map +1 -0
  285. package/lib/node/core/dirty-number.js +19 -0
  286. package/lib/node/core/dirty-number.js.map +1 -0
  287. package/lib/node/core/game-node.js +63 -0
  288. package/lib/node/core/game-node.js.map +1 -0
  289. package/lib/node/core/game-object.js +8 -0
  290. package/lib/node/core/game-object.js.map +1 -0
  291. package/lib/node/core/renderable.js +59 -0
  292. package/lib/node/core/renderable.js.map +1 -0
  293. package/lib/node/core/transform.js +70 -0
  294. package/lib/node/core/transform.js.map +1 -0
  295. package/lib/node/core/transformable.js +85 -0
  296. package/lib/node/core/transformable.js.map +1 -0
  297. package/lib/node/ext/animated-sprite.js +77 -0
  298. package/lib/node/ext/animated-sprite.js.map +1 -0
  299. package/lib/node/ext/bitmap-text.js +93 -0
  300. package/lib/node/ext/bitmap-text.js.map +1 -0
  301. package/lib/node/ext/circle.js +43 -0
  302. package/lib/node/ext/circle.js.map +1 -0
  303. package/lib/node/ext/deplay.js +22 -0
  304. package/lib/node/ext/deplay.js.map +1 -0
  305. package/lib/node/ext/dom-container.js +51 -0
  306. package/lib/node/ext/dom-container.js.map +1 -0
  307. package/lib/node/ext/interval.js +22 -0
  308. package/lib/node/ext/interval.js.map +1 -0
  309. package/lib/node/ext/particle.js +98 -0
  310. package/lib/node/ext/particle.js.map +1 -0
  311. package/lib/node/ext/rectangle.js +52 -0
  312. package/lib/node/ext/rectangle.js.map +1 -0
  313. package/lib/node/ext/spine.js +272 -0
  314. package/lib/node/ext/spine.js.map +1 -0
  315. package/lib/node/ext/sprite.js +42 -0
  316. package/lib/node/ext/sprite.js.map +1 -0
  317. package/lib/node/physics/physics-object.js +92 -0
  318. package/lib/node/physics/physics-object.js.map +1 -0
  319. package/lib/node/physics/physics-world.js +29 -0
  320. package/lib/node/physics/physics-world.js.map +1 -0
  321. package/lib/node/physics/rigidbodies.js +7 -0
  322. package/lib/node/physics/rigidbodies.js.map +1 -0
  323. package/lib/renderer/camera.js +19 -0
  324. package/lib/renderer/camera.js.map +1 -0
  325. package/lib/renderer/container-manager.js +29 -0
  326. package/lib/renderer/container-manager.js.map +1 -0
  327. package/lib/renderer/fps-display.js +18 -0
  328. package/lib/renderer/fps-display.js.map +1 -0
  329. package/lib/renderer/layer.js +12 -0
  330. package/lib/renderer/layer.js.map +1 -0
  331. package/lib/renderer/renderer.js +146 -0
  332. package/lib/renderer/renderer.js.map +1 -0
  333. package/lib/renderer/ticker.js +56 -0
  334. package/lib/renderer/ticker.js.map +1 -0
  335. package/lib/renderer/ticker.test.js +241 -0
  336. package/lib/renderer/ticker.test.js.map +1 -0
  337. package/lib/types/animation-atlas.js +2 -0
  338. package/lib/types/animation-atlas.js.map +1 -0
  339. package/lib/types/asset/audio.d.ts +5 -4
  340. package/lib/types/asset/audio.d.ts.map +1 -1
  341. package/lib/types/asset/loaders/audio.d.ts +2 -1
  342. package/lib/types/asset/loaders/audio.d.ts.map +1 -1
  343. package/lib/types/asset/loaders/binary.d.ts +2 -1
  344. package/lib/types/asset/loaders/binary.d.ts.map +1 -1
  345. package/lib/types/asset/loaders/bitmap-font.d.ts +17 -0
  346. package/lib/types/asset/loaders/bitmap-font.d.ts.map +1 -0
  347. package/lib/types/asset/loaders/font.d.ts +2 -1
  348. package/lib/types/asset/loaders/font.d.ts.map +1 -1
  349. package/lib/types/asset/loaders/loader.d.ts +6 -6
  350. package/lib/types/asset/loaders/loader.d.ts.map +1 -1
  351. package/lib/types/asset/loaders/spritesheet.d.ts +14 -6
  352. package/lib/types/asset/loaders/spritesheet.d.ts.map +1 -1
  353. package/lib/types/asset/loaders/text.d.ts +2 -1
  354. package/lib/types/asset/loaders/text.d.ts.map +1 -1
  355. package/lib/types/asset/loaders/texture.d.ts +2 -2
  356. package/lib/types/asset/loaders/texture.d.ts.map +1 -1
  357. package/lib/types/asset/preload.d.ts +7 -5
  358. package/lib/types/asset/preload.d.ts.map +1 -1
  359. package/lib/types/atlas copy.js +2 -0
  360. package/lib/types/atlas copy.js.map +1 -0
  361. package/lib/types/atlas.js +2 -0
  362. package/lib/types/atlas.js.map +1 -0
  363. package/lib/types/bitmap-font.js +2 -0
  364. package/lib/types/bitmap-font.js.map +1 -0
  365. package/lib/types/collision/check-collision.d.ts +4 -0
  366. package/lib/types/collision/check-collision.d.ts.map +1 -0
  367. package/lib/types/collision/check-collision.test.d.ts +2 -0
  368. package/lib/types/collision/check-collision.test.d.ts.map +1 -0
  369. package/lib/types/collision/colliders.d.ts +34 -0
  370. package/lib/types/collision/colliders.d.ts.map +1 -0
  371. package/lib/types/debug.d.ts.map +1 -0
  372. package/lib/types/dom/dom-animated-sprite.d.ts +23 -0
  373. package/lib/types/dom/dom-animated-sprite.d.ts.map +1 -0
  374. package/lib/types/dom/dom-game-object.d.ts +44 -0
  375. package/lib/types/dom/dom-game-object.d.ts.map +1 -0
  376. package/lib/types/dom/dom-particle.d.ts +30 -0
  377. package/lib/types/dom/dom-particle.d.ts.map +1 -0
  378. package/lib/types/dom/dom-preload.d.ts +2 -0
  379. package/lib/types/dom/dom-preload.d.ts.map +1 -0
  380. package/lib/types/dom/dom-sprite.d.ts +13 -0
  381. package/lib/types/dom/dom-sprite.d.ts.map +1 -0
  382. package/lib/types/dom/dom-texture-loader.d.ts +8 -0
  383. package/lib/types/dom/dom-texture-loader.d.ts.map +1 -0
  384. package/lib/types/dom/dom-utils.d.ts +3 -0
  385. package/lib/types/dom/dom-utils.d.ts.map +1 -0
  386. package/lib/types/index copy.d.ts +16 -0
  387. package/lib/types/index copy.d.ts.map +1 -0
  388. package/lib/types/index.d.ts +26 -11
  389. package/lib/types/index.d.ts.map +1 -1
  390. package/lib/types/input/joystick.d.ts +28 -0
  391. package/lib/types/input/joystick.d.ts.map +1 -0
  392. package/lib/types/node/core/dirty-number.d.ts +9 -0
  393. package/lib/types/node/core/dirty-number.d.ts.map +1 -0
  394. package/lib/types/node/core/game-node.d.ts +16 -0
  395. package/lib/types/node/core/game-node.d.ts.map +1 -0
  396. package/lib/types/node/core/game-object.d.ts +8 -0
  397. package/lib/types/node/core/game-object.d.ts.map +1 -0
  398. package/lib/types/node/core/renderable.d.ts +23 -0
  399. package/lib/types/node/core/renderable.d.ts.map +1 -0
  400. package/lib/types/node/core/transform.d.ts +27 -0
  401. package/lib/types/node/core/transform.d.ts.map +1 -0
  402. package/lib/types/node/core/transformable.d.ts +44 -0
  403. package/lib/types/node/core/transformable.d.ts.map +1 -0
  404. package/lib/types/node/ext/animated-sprite.d.ts +22 -0
  405. package/lib/types/node/ext/animated-sprite.d.ts.map +1 -0
  406. package/lib/types/node/ext/bitmap-text.d.ts +14 -0
  407. package/lib/types/node/ext/bitmap-text.d.ts.map +1 -0
  408. package/lib/types/node/ext/circle.d.ts +19 -0
  409. package/lib/types/node/ext/circle.d.ts.map +1 -0
  410. package/lib/types/node/ext/deplay.d.ts +8 -0
  411. package/lib/types/node/ext/deplay.d.ts.map +1 -0
  412. package/lib/types/node/ext/dom-container.d.ts +12 -0
  413. package/lib/types/node/ext/dom-container.d.ts.map +1 -0
  414. package/lib/types/node/ext/interval.d.ts +9 -0
  415. package/lib/types/node/ext/interval.d.ts.map +1 -0
  416. package/lib/types/node/ext/particle.d.ts +30 -0
  417. package/lib/types/node/ext/particle.d.ts.map +1 -0
  418. package/lib/types/node/ext/rectangle.d.ts +22 -0
  419. package/lib/types/node/ext/rectangle.d.ts.map +1 -0
  420. package/lib/types/node/ext/spine.d.ts +36 -0
  421. package/lib/types/node/ext/spine.d.ts.map +1 -0
  422. package/lib/types/node/ext/sprite.d.ts +13 -0
  423. package/lib/types/node/ext/sprite.d.ts.map +1 -0
  424. package/lib/types/node/physics/physics-object.d.ts +38 -0
  425. package/lib/types/node/physics/physics-object.d.ts.map +1 -0
  426. package/lib/types/node/physics/physics-world.d.ts +18 -0
  427. package/lib/types/node/physics/physics-world.d.ts.map +1 -0
  428. package/lib/types/node/physics/rigidbodies.d.ts +23 -0
  429. package/lib/types/node/physics/rigidbodies.d.ts.map +1 -0
  430. package/lib/types/renderer/camera.d.ts +13 -0
  431. package/lib/types/renderer/camera.d.ts.map +1 -0
  432. package/lib/types/renderer/container-manager.d.ts +9 -0
  433. package/lib/types/renderer/container-manager.d.ts.map +1 -0
  434. package/lib/types/renderer/fps-display.d.ts +7 -0
  435. package/lib/types/renderer/fps-display.d.ts.map +1 -0
  436. package/lib/types/renderer/layer.d.ts +7 -0
  437. package/lib/types/renderer/layer.d.ts.map +1 -0
  438. package/lib/types/renderer/renderer.d.ts +40 -0
  439. package/lib/types/renderer/renderer.d.ts.map +1 -0
  440. package/lib/types/renderer/ticker.d.ts +6 -0
  441. package/lib/types/renderer/ticker.d.ts.map +1 -0
  442. package/lib/types/renderer/ticker.test.d.ts +40 -0
  443. package/lib/types/renderer/ticker.test.d.ts.map +1 -0
  444. package/lib/types/sprite-atlas.js +2 -0
  445. package/lib/types/sprite-atlas.js.map +1 -0
  446. package/lib/types/types/animation-atlas.d.ts +14 -0
  447. package/lib/types/types/animation-atlas.d.ts.map +1 -0
  448. package/lib/types/types/atlas copy.d.ts +12 -0
  449. package/lib/types/types/atlas copy.d.ts.map +1 -0
  450. package/lib/types/types/atlas.d.ts +16 -0
  451. package/lib/types/types/atlas.d.ts.map +1 -0
  452. package/lib/types/types/bitmap-font.d.ts +18 -0
  453. package/lib/types/types/bitmap-font.d.ts.map +1 -0
  454. package/lib/types/types/sprite-atlas.d.ts +13 -0
  455. package/lib/types/types/sprite-atlas.d.ts.map +1 -0
  456. package/lib/types/utils/device.d.ts +2 -0
  457. package/lib/types/utils/device.d.ts.map +1 -0
  458. package/lib/utils/device.js +2 -0
  459. package/lib/utils/device.js.map +1 -0
  460. package/package.json +8 -7
  461. package/src/asset/audio.ts +134 -90
  462. package/src/asset/loaders/audio.ts +23 -20
  463. package/src/asset/loaders/binary.ts +20 -16
  464. package/src/asset/loaders/bitmap-font.ts +91 -0
  465. package/src/asset/loaders/font.ts +18 -14
  466. package/src/asset/loaders/loader.ts +27 -23
  467. package/src/asset/loaders/spritesheet.ts +47 -36
  468. package/src/asset/loaders/text.ts +19 -15
  469. package/src/asset/loaders/texture.ts +30 -37
  470. package/src/asset/preload.ts +71 -64
  471. package/src/collision/check-collision.test.ts +349 -0
  472. package/src/collision/check-collision.ts +821 -0
  473. package/src/collision/colliders.ts +19 -0
  474. package/src/debug.ts +5 -0
  475. package/src/dom/dom-animated-sprite.ts +132 -0
  476. package/src/dom/dom-game-object.ts +134 -0
  477. package/src/dom/dom-particle.ts +151 -0
  478. package/src/dom/dom-preload.ts +54 -0
  479. package/src/dom/dom-sprite.ts +50 -0
  480. package/src/dom/dom-texture-loader.ts +44 -0
  481. package/src/dom/dom-utils.ts +19 -0
  482. package/src/index.ts +47 -13
  483. package/src/input/joystick.ts +316 -0
  484. package/src/node/core/dirty-number.ts +21 -0
  485. package/src/node/core/game-node.ts +74 -0
  486. package/src/node/core/game-object.ts +11 -0
  487. package/src/node/core/renderable.ts +72 -0
  488. package/src/node/core/transform.ts +82 -0
  489. package/src/node/core/transformable.ts +111 -0
  490. package/src/node/ext/animated-sprite.ts +103 -0
  491. package/src/node/ext/bitmap-text.ts +113 -0
  492. package/src/node/ext/circle.ts +55 -0
  493. package/src/node/ext/deplay.ts +25 -0
  494. package/src/node/ext/dom-container.ts +62 -0
  495. package/src/node/ext/interval.ts +25 -0
  496. package/src/node/ext/particle.ts +142 -0
  497. package/src/node/ext/rectangle.ts +71 -0
  498. package/src/node/ext/spine.ts +323 -0
  499. package/src/node/ext/sprite.ts +53 -0
  500. package/src/node/physics/physics-object.ts +127 -0
  501. package/src/node/physics/physics-world.ts +41 -0
  502. package/src/node/physics/rigidbodies.ts +14 -0
  503. package/src/renderer/camera.ts +25 -0
  504. package/src/renderer/container-manager.ts +36 -0
  505. package/src/renderer/fps-display.ts +21 -0
  506. package/src/renderer/layer.ts +15 -0
  507. package/src/renderer/renderer.ts +181 -0
  508. package/src/renderer/ticker.test.ts +325 -0
  509. package/src/renderer/ticker.ts +54 -0
  510. package/src/types/atlas.ts +17 -0
  511. package/src/types/bitmap-font.ts +19 -0
  512. package/src/utils/device.ts +1 -0
  513. package/examples/test-dom/index.ts +0 -21
  514. package/lib/game-object/game-object-physics.js +0 -188
  515. package/lib/game-object/game-object-physics.js.map +0 -1
  516. package/lib/game-object/game-object-rendering.js +0 -35
  517. package/lib/game-object/game-object-rendering.js.map +0 -1
  518. package/lib/game-object/game-object.js +0 -162
  519. package/lib/game-object/game-object.js.map +0 -1
  520. package/lib/game-object/transform.js +0 -118
  521. package/lib/game-object/transform.js.map +0 -1
  522. package/lib/game-object-ext/animated-sprite.js +0 -117
  523. package/lib/game-object-ext/animated-sprite.js.map +0 -1
  524. package/lib/game-object-ext/dom-container.js +0 -56
  525. package/lib/game-object-ext/dom-container.js.map +0 -1
  526. package/lib/game-object-ext/rect.js +0 -30
  527. package/lib/game-object-ext/rect.js.map +0 -1
  528. package/lib/game-object-ext/spine.js +0 -206
  529. package/lib/game-object-ext/spine.js.map +0 -1
  530. package/lib/game-object-ext/sprite.js +0 -46
  531. package/lib/game-object-ext/sprite.js.map +0 -1
  532. package/lib/game-object-ext/text.js +0 -68
  533. package/lib/game-object-ext/text.js.map +0 -1
  534. package/lib/game-object-ext/tiling-sprite.js +0 -64
  535. package/lib/game-object-ext/tiling-sprite.js.map +0 -1
  536. package/lib/types/game-object/game-object-physics.d.ts +0 -42
  537. package/lib/types/game-object/game-object-physics.d.ts.map +0 -1
  538. package/lib/types/game-object/game-object-rendering.d.ts +0 -15
  539. package/lib/types/game-object/game-object-rendering.d.ts.map +0 -1
  540. package/lib/types/game-object/game-object.d.ts +0 -81
  541. package/lib/types/game-object/game-object.d.ts.map +0 -1
  542. package/lib/types/game-object/transform.d.ts +0 -43
  543. package/lib/types/game-object/transform.d.ts.map +0 -1
  544. package/lib/types/game-object-ext/animated-sprite.d.ts +0 -29
  545. package/lib/types/game-object-ext/animated-sprite.d.ts.map +0 -1
  546. package/lib/types/game-object-ext/dom-container.d.ts +0 -16
  547. package/lib/types/game-object-ext/dom-container.d.ts.map +0 -1
  548. package/lib/types/game-object-ext/rect.d.ts +0 -17
  549. package/lib/types/game-object-ext/rect.d.ts.map +0 -1
  550. package/lib/types/game-object-ext/spine.d.ts +0 -35
  551. package/lib/types/game-object-ext/spine.d.ts.map +0 -1
  552. package/lib/types/game-object-ext/sprite.d.ts +0 -14
  553. package/lib/types/game-object-ext/sprite.d.ts.map +0 -1
  554. package/lib/types/game-object-ext/text.d.ts +0 -26
  555. package/lib/types/game-object-ext/text.d.ts.map +0 -1
  556. package/lib/types/game-object-ext/tiling-sprite.d.ts +0 -20
  557. package/lib/types/game-object-ext/tiling-sprite.d.ts.map +0 -1
  558. package/lib/types/utils/debug.d.ts.map +0 -1
  559. package/lib/types/utils/go.d.ts +0 -26
  560. package/lib/types/utils/go.d.ts.map +0 -1
  561. package/lib/types/world/world-debug.d.ts +0 -11
  562. package/lib/types/world/world-debug.d.ts.map +0 -1
  563. package/lib/types/world/world-physics.d.ts +0 -16
  564. package/lib/types/world/world-physics.d.ts.map +0 -1
  565. package/lib/types/world/world-rendering.d.ts +0 -28
  566. package/lib/types/world/world-rendering.d.ts.map +0 -1
  567. package/lib/types/world/world.d.ts +0 -38
  568. package/lib/types/world/world.d.ts.map +0 -1
  569. package/lib/utils/debug.js.map +0 -1
  570. package/lib/utils/go.js +0 -33
  571. package/lib/utils/go.js.map +0 -1
  572. package/lib/world/world-debug.js +0 -89
  573. package/lib/world/world-debug.js.map +0 -1
  574. package/lib/world/world-physics.js +0 -45
  575. package/lib/world/world-physics.js.map +0 -1
  576. package/lib/world/world-rendering.js +0 -123
  577. package/lib/world/world-rendering.js.map +0 -1
  578. package/lib/world/world.js +0 -147
  579. package/lib/world/world.js.map +0 -1
  580. package/src/game-object/game-object-physics.ts +0 -191
  581. package/src/game-object/game-object-rendering.ts +0 -27
  582. package/src/game-object/game-object.ts +0 -190
  583. package/src/game-object/transform.ts +0 -164
  584. package/src/game-object-ext/animated-sprite.ts +0 -140
  585. package/src/game-object-ext/dom-container.ts +0 -67
  586. package/src/game-object-ext/rect.ts +0 -40
  587. package/src/game-object-ext/spine.ts +0 -235
  588. package/src/game-object-ext/sprite.ts +0 -55
  589. package/src/game-object-ext/text.ts +0 -83
  590. package/src/game-object-ext/tiling-sprite.ts +0 -73
  591. package/src/utils/debug.ts +0 -5
  592. package/src/utils/go.ts +0 -53
  593. package/src/world/world-debug.ts +0 -114
  594. package/src/world/world-physics.ts +0 -52
  595. package/src/world/world-rendering.ts +0 -145
  596. package/src/world/world.ts +0 -171
  597. /package/examples/{test-dom → auto-battle}/index.html +0 -0
  598. /package/lib/{utils/debug.js → debug.js} +0 -0
  599. /package/lib/types/{utils/debug.d.ts → debug.d.ts} +0 -0
@@ -0,0 +1,2 @@
1
+ /*! For license information please see game.js.LICENSE.txt */
2
+ (()=>{var t,e,s,r,i,n={59:(t,e,s)=>{"use strict";s.d(e,{b:()=>r});class r{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new r(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,e=t){return this.x=t,this.y=e,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return i.x=0,i.y=0,i}}const i=new r},112:t=>{"use strict";t.exports=JSON.parse('{"frames":{"idle-1":{"frame":{"x":0,"y":0,"w":100,"h":100}},"idle-2":{"frame":{"x":100,"y":0,"w":100,"h":100}},"idle-3":{"frame":{"x":200,"y":0,"w":100,"h":100}},"idle-4":{"frame":{"x":300,"y":0,"w":100,"h":100}},"idle-5":{"frame":{"x":400,"y":0,"w":100,"h":100}},"idle-6":{"frame":{"x":500,"y":0,"w":100,"h":100}},"walk-1":{"frame":{"x":0,"y":100,"w":100,"h":100}},"walk-2":{"frame":{"x":100,"y":100,"w":100,"h":100}},"walk-3":{"frame":{"x":200,"y":100,"w":100,"h":100}},"walk-4":{"frame":{"x":300,"y":100,"w":100,"h":100}},"walk-5":{"frame":{"x":400,"y":100,"w":100,"h":100}},"walk-6":{"frame":{"x":500,"y":100,"w":100,"h":100}},"walk-7":{"frame":{"x":600,"y":100,"w":100,"h":100}},"walk-8":{"frame":{"x":700,"y":100,"w":100,"h":100}},"attack1-1":{"frame":{"x":0,"y":200,"w":100,"h":100}},"attack1-2":{"frame":{"x":100,"y":200,"w":100,"h":100}},"attack1-3":{"frame":{"x":200,"y":200,"w":100,"h":100}},"attack1-4":{"frame":{"x":300,"y":200,"w":100,"h":100}},"attack1-5":{"frame":{"x":400,"y":200,"w":100,"h":100}},"attack1-6":{"frame":{"x":500,"y":200,"w":100,"h":100}},"attack2-1":{"frame":{"x":0,"y":300,"w":100,"h":100}},"attack2-2":{"frame":{"x":100,"y":300,"w":100,"h":100}},"attack2-3":{"frame":{"x":200,"y":300,"w":100,"h":100}},"attack2-4":{"frame":{"x":300,"y":300,"w":100,"h":100}},"attack2-5":{"frame":{"x":400,"y":300,"w":100,"h":100}},"attack2-6":{"frame":{"x":500,"y":300,"w":100,"h":100}},"die-1":{"frame":{"x":0,"y":600,"w":100,"h":100}},"die-2":{"frame":{"x":100,"y":600,"w":100,"h":100}},"die-3":{"frame":{"x":200,"y":600,"w":100,"h":100}},"die-4":{"frame":{"x":300,"y":600,"w":100,"h":100}}},"meta":{"scale":1},"animations":{"idle":["idle-1","idle-2","idle-3","idle-4","idle-5","idle-6"],"walk":["walk-1","walk-2","walk-3","walk-4","walk-5","walk-6","walk-7","walk-8"],"attack1":["attack1-1","attack1-2","attack1-3","attack1-4","attack1-5","attack1-6"],"attack2":["attack2-1","attack2-2","attack2-3","attack2-4","attack2-5","attack2-6"],"die":["die-1","die-2","die-3","die-4"]}}')},159:(t,e,s)=>{"use strict";s.d(e,{q:()=>r});class r{name;order;skinRequired;constructor(t,e,s){this.name=t,this.order=e,this.skinRequired=s}}},166:(t,e,s)=>{"use strict";s.d(e,{A1g:()=>k.A,AeT:()=>O.A,AgS:()=>n.Ag,Dl5:()=>R.D,FFI:()=>x.F,Ivi:()=>g.I,M_G:()=>f.M,Mtr:()=>C.M,PDq:()=>y.P,Q1f:()=>d.Q,RvI:()=>D.R,Sdw:()=>T.S,T9C:()=>l.T,V23:()=>A.V,WOU:()=>c.W,Whu:()=>S.W,XOh:()=>n.XO,Y8S:()=>u.Y,_1d:()=>y._,a4b:()=>x.a,b3l:()=>v.b,eBH:()=>p.e,gPd:()=>E.g,hpe:()=>w.h,i4V:()=>m.i,kxk:()=>B.k,l2R:()=>o.l,lZB:()=>I.l,mcf:()=>M.mc,mx8:()=>v.m,n2X:()=>b.n,q5F:()=>_.q,sP:()=>a.s,v9C:()=>P.v,vfs:()=>g.v,xR6:()=>h.x,zo6:()=>F.z});var r=s(3472),i=s(9836),n=s(1065),a=(s(2542),s(2517),s(7455)),o=s(2445),l=s(3463),h=s(2027),c=s(4173),u=s(9279),d=s(6675),p=s(5423),f=s(9390),m=s(656),g=s(9677),x=s(2305),y=s(1570),v=s(7335),_=s(6863),b=s(2478),w=s(1579),T=s(9798),S=s(9062),A=s(8337),C=s(1657),P=s(4269),E=s(9739),M=(s(7935),s(4687)),k=s(4454),R=s(7903),B=s(4242),I=s(4543),F=s(2043),D=s(3651),O=(s(4872),s(8869));n.XO.add(r.I,i.S)},192:(t,e,s)=>{"use strict";s.d(e,{R:()=>i});var r=s(2432);class i extends r.b{#t;children=[];paused=!1;set parent(t){this.#t=t}get parent(){return this.#t}add(...t){for(const e of t){if(e.#t){const t=e.#t.children.indexOf(e);-1!==t&&e.#t.children.splice(t,1)}e.parent=this,this.children.push(e)}}remove(){if(super.remove(),this.#t){const t=this.#t.children.indexOf(this);-1!==t&&this.#t.children.splice(t,1),this.#t=void 0}for(const t of this.children)t.parent=void 0,t.remove();this.children.length=0}pause(){this.paused=!0;for(const t of this.children)t.pause()}resume(){this.paused=!1;for(const t of this.children)t.resume()}update(t){if(!this.paused){for(const e of this.children)e.paused||e.update(t);this.emit("update",t)}}}},275:(t,e,s)=>{"use strict";function r(t,e){if(t)return Object.assign(t.style,e),t}s.d(e,{e:()=>r})},432:(t,e,s)=>{"use strict";s.d(e,{Lw:()=>n.Lw,MR:()=>n.MR,Rt:()=>i.R,mI:()=>n.mI,qd:()=>n.qd,t7:()=>n.t7,yE:()=>r.yE}),s(6093),s(3916),s(3394),s(564),s(9031);var r=s(9155),i=(s(5851),s(6836)),n=s(8034)},498:(t,e,s)=>{"use strict";s.d(e,{q:()=>n});var r=s(7694),i=s(4988);function n(t,e){for(const s in t.attributes){const i=t.attributes[s],n=e[s];n?(i.format??(i.format=n.format),i.offset??(i.offset=n.offset),i.instance??(i.instance=n.instance)):(0,r.R)(`Attribute ${s} is not present in the shader, but is present in the geometry. Unable to infer attribute details.`)}!function(t){const{buffers:e,attributes:s}=t,r={},n={};for(const t in e){const s=e[t];r[s.uid]=0,n[s.uid]=0}for(const t in s){const e=s[t];r[e.buffer.uid]+=(0,i.m)(e.format).stride}for(const t in s){const e=s[t];e.stride??(e.stride=r[e.buffer.uid]),e.start??(e.start=n[e.buffer.uid]),n[e.buffer.uid]+=(0,i.m)(e.format).stride}}(t)}},499:(t,e,s)=>{"use strict";s.d(e,{W:()=>n});var r=s(166),i=s(2437);class n extends i.N{constructor(t){super(new r.mcf({sortableChildren:!0})),this._pixiContainer.zIndex=t,this.worldTransform.x.v=0,this.worldTransform.y.v=0,this.worldTransform.resetDirty()}}},528:(t,e,s)=>{"use strict";s.d(e,{c:()=>n});var r=s(946),i=s(1347);class n{data;bones;target;bendDirection=0;compress=!1;stretch=!1;mix=1;softness=0;active=!1;constructor(t,e){if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let s=0;s<t.bones.length;s++){let r=e.findBone(t.bones[s].name);if(!r)throw new Error(`Couldn't find bone ${t.bones[s].name}`);this.bones.push(r)}let s=e.findBone(t.target.name);if(!s)throw new Error(`Couldn't find bone ${t.target.name}`);this.target=s,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch}isActive(){return this.active}setToSetupPose(){const t=this.data;this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch}update(t){if(0==this.mix)return;let e=this.target,s=this.bones;switch(s.length){case 1:this.apply1(s[0],e.worldX,e.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(s[0],s[1],e.worldX,e.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix)}}apply1(t,e,s,n,a,o,l){let h=t.parent;if(!h)throw new Error("IK bone must have parent.");let c=h.a,u=h.b,d=h.c,p=h.d,f=-t.ashearX-t.arotation,m=0,g=0;switch(t.inherit){case r.u.OnlyTranslation:m=(e-t.worldX)*i.cj.signum(t.skeleton.scaleX),g=(s-t.worldY)*i.cj.signum(t.skeleton.scaleY);break;case r.u.NoRotationOrReflection:let n=Math.abs(c*p-u*d)/Math.max(1e-4,c*c+d*d),a=c/t.skeleton.scaleX,o=d/t.skeleton.scaleY;u=-o*n*t.skeleton.scaleX,p=a*n*t.skeleton.scaleY,f+=Math.atan2(o,a)*i.cj.radDeg;default:let l=e-h.worldX,x=s-h.worldY,y=c*p-u*d;Math.abs(y)<=1e-4?(m=0,g=0):(m=(l*p-x*u)/y-t.ax,g=(x*c-l*d)/y-t.ay)}f+=Math.atan2(g,m)*i.cj.radDeg,t.ascaleX<0&&(f+=180),f>180?f-=360:f<-180&&(f+=360);let x=t.ascaleX,y=t.ascaleY;if(n||a){switch(t.inherit){case r.u.NoScale:case r.u.NoScaleOrReflection:m=e-t.worldX,g=s-t.worldY}const i=t.data.length*x;if(i>1e-4){const t=m*m+g*g;if(n&&t<i*i||a&&t>i*i){const e=(Math.sqrt(t)/i-1)*l+1;x*=e,o&&(y*=e)}}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*l,x,y,t.ashearX,t.ashearY)}apply2(t,e,s,n,a,o,l,h,c){if(t.inherit!=r.u.Normal||e.inherit!=r.u.Normal)return;let u=t.ax,d=t.ay,p=t.ascaleX,f=t.ascaleY,m=p,g=f,x=e.ascaleX,y=0,v=0,_=0;p<0?(p=-p,y=180,_=-1):(y=0,_=1),f<0&&(f=-f,_=-_),x<0?(x=-x,v=180):v=0;let b=e.ax,w=0,T=0,S=0,A=t.a,C=t.b,P=t.c,E=t.d,M=Math.abs(p-f)<=1e-4;!M||o?(w=0,T=A*b+t.worldX,S=P*b+t.worldY):(w=e.ay,T=A*b+C*w+t.worldX,S=P*b+E*w+t.worldY);let k=t.parent;if(!k)throw new Error("IK parent must itself have a parent.");A=k.a,C=k.b,P=k.c,E=k.d;let R=A*E-C*P,B=T-k.worldX,I=S-k.worldY;R=Math.abs(R)<=1e-4?0:1/R;let F,D,O=(B*E-I*C)*R-u,G=(I*A-B*P)*R-d,U=Math.sqrt(O*O+G*G),L=e.data.length*x;if(U<1e-4)return this.apply1(t,s,n,!1,o,!1,c),void e.updateWorldTransformWith(b,w,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);B=s-k.worldX,I=n-k.worldY;let N=(B*E-I*C)*R-u,X=(I*A-B*P)*R-d,Y=N*N+X*X;if(0!=h){h*=p*(x+1)*.5;let t=Math.sqrt(Y),e=t-U-L*p+h;if(e>0){let s=Math.min(1,e/(2*h))-1;s=(e-h*(1-s*s))/t,N-=s*N,X-=s*X,Y=N*N+X*X}}t:if(M){L*=p;let t=(Y-U*U-L*L)/(2*U*L);t<-1?(t=-1,D=Math.PI*a):t>1?(t=1,D=0,o&&(A=(Math.sqrt(Y)/(U+L)-1)*c+1,m*=A,l&&(g*=A))):D=Math.acos(t)*a,A=U+L*t,C=L*Math.sin(D),F=Math.atan2(X*A-N*C,N*A+X*C)}else{A=p*L,C=f*L;let t=A*A,e=C*C,s=Math.atan2(X,N);P=e*U*U+t*Y-t*e;let r=-2*e*U,n=e-t;if(E=r*r-4*n*P,E>=0){let t=Math.sqrt(E);r<0&&(t=-t),t=.5*-(r+t);let e=t/n,i=P/t,o=Math.abs(e)<Math.abs(i)?e:i;if(e=Y-o*o,e>=0){I=Math.sqrt(e)*a,F=s-Math.atan2(I,o),D=Math.atan2(I/f,(o-U)/p);break t}}let o=i.cj.PI,l=U-A,h=l*l,c=0,u=0,d=U+A,m=d*d,g=0;P=-A*U/(t-e),P>=-1&&P<=1&&(P=Math.acos(P),B=A*Math.cos(P)+U,I=C*Math.sin(P),E=B*B+I*I,E<h&&(o=P,h=E,l=B,c=I),E>m&&(u=P,m=E,d=B,g=I)),Y<=.5*(h+m)?(F=s-Math.atan2(c*a,l),D=o*a):(F=s-Math.atan2(g*a,d),D=u*a)}let V=Math.atan2(w,b)*_,z=t.arotation;F=(F-V)*i.cj.radDeg+y-z,F>180?F-=360:F<-180&&(F+=360),t.updateWorldTransformWith(u,d,z+F*c,m,g,0,0),z=e.arotation,D=((D+V)*i.cj.radDeg-e.ashearX)*_+v-z,D>180?D-=360:D<-180&&(D+=360),e.updateWorldTransformWith(b,w,z+D*c,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}}},564:(t,e,s)=>{"use strict";var r=s(166),i=s(6679),n=s(8826);let a=null;class o extends r.i4V{static extension={type:[r.AgS.Batcher],name:"darkTint"};geometry=new i.A;shader=a||(a=new n.f(this.maxTextures));name=o.extension.name;vertexSize=7;packAttributes(t,e,s,i,n){const a=n<<16|65535&t.roundPixels,o=t.transform,l=o.a,h=o.b,c=o.c,u=o.d,d=o.tx,p=o.ty,{positions:f,uvs:m}=t,g=t.color,x=(g>>24&255)/255,y=r.Q1f.shared.setValue(t.darkColor).premultiply(x,!0).toPremultiplied(1,!1),v=t.attributeOffset,_=v+t.attributeSize;for(let t=v;t<_;t++){const r=2*t,n=f[r],o=f[r+1];e[i++]=l*n+c*o+d,e[i++]=u*o+h*n+p,e[i++]=m[r],e[i++]=m[r+1],s[i++]=g,s[i++]=y,s[i++]=a}}packQuadAttributes(t,e,s,r,i){const n=t.texture,a=t.transform,o=a.a,l=a.b,h=a.c,c=a.d,u=a.tx,d=a.ty,p=t.bounds,f=p.maxX,m=p.minX,g=p.maxY,x=p.minY,y=n.uvs,v=t.color,_=t.darkColor,b=i<<16|65535&t.roundPixels;e[r+0]=o*m+h*x+u,e[r+1]=c*x+l*m+d,e[r+2]=y.x0,e[r+3]=y.y0,s[r+4]=v,s[r+5]=_,s[r+6]=b,e[r+7]=o*f+h*x+u,e[r+8]=c*x+l*f+d,e[r+9]=y.x1,e[r+10]=y.y1,s[r+11]=v,s[r+12]=_,s[r+13]=b,e[r+14]=o*f+h*g+u,e[r+15]=c*g+l*f+d,e[r+16]=y.x2,e[r+17]=y.y2,s[r+18]=v,s[r+19]=_,s[r+20]=b,e[r+21]=o*m+h*g+u,e[r+22]=c*g+l*m+d,e[r+23]=y.x3,e[r+24]=y.y3,s[r+25]=v,s[r+26]=_,s[r+27]=b}}r.XOh.add(o)},592:(t,e,s)=>{"use strict";s.d(e,{U:()=>h});var r=s(8147),i=s(192),n=s(2437),a=s(6121),o=s(275);class l extends i.R{worldTransform=new a.Z;worldAlpha=new r.w(1);constructor(){super(),this.worldTransform.x.v=0,this.worldTransform.y.v=0,this.worldTransform.resetDirty()}}class h extends i.R{el=document.createElement("div");#e=new a.U;worldTransform=new a.Z;alpha=1;worldAlpha=new r.w(1);#s=!1;constructor(t){super(),(0,o.e)(this.el,{position:"absolute",left:"50%",top:"50%",zIndex:"1",transform:"translate(-50%, -50%)"}),t&&(void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.scale&&(this.scale=t.scale),void 0!==t.scaleX&&(this.scaleX=t.scaleX),void 0!==t.scaleY&&(this.scaleY=t.scaleY),void 0!==t.pivotX&&(this.pivotX=t.pivotX),void 0!==t.pivotY&&(this.pivotY=t.pivotY),void 0!==t.rotation&&(this.rotation=t.rotation),void 0!==t.alpha&&(this.alpha=t.alpha),this.#s=t.useYSort??!1)}render(t){this.update(t),this._updateWorldTransform()}_updateWorldTransform(){const t=this.parent;if(t&&(0,n.l)(t)&&(this.worldTransform.update(t.worldTransform,this.#e),this.worldAlpha.v=t.worldAlpha.v*this.alpha),this.worldTransform.dirty){const t=this.worldTransform;this.el.style.transform=`\n translate(\n calc(-50% + ${t.x.v}px),\n calc(-50% + ${t.y.v}px)\n )\n scale(${t.scaleX.v}, ${t.scaleY.v})\n rotate(${t.rotation.v}rad)\n `}this.worldAlpha.dirty&&(this.el.style.opacity=this.worldAlpha.v.toString());for(const t of this.children)(0,n.l)(t)&&t._updateWorldTransform();this.worldTransform.resetDirty()}attachTo(t){return t.appendChild(this.el),this.parent=new l,this._updateWorldTransform(),this}set x(t){this.#e.x=t}get x(){return this.#e.x}set y(t){this.#e.y=t}get y(){return this.#e.y}set scale(t){this.#e.scaleX=t,this.#e.scaleY=t}get scale(){return this.#e.scaleX}set scaleX(t){this.#e.scaleX=t}get scaleX(){return this.#e.scaleX}set scaleY(t){this.#e.scaleY=t}get scaleY(){return this.#e.scaleY}set pivotX(t){this.#e.pivotX=t}get pivotX(){return this.#e.pivotX}set pivotY(t){this.#e.pivotY=t}get pivotY(){return this.#e.pivotY}set rotation(t){this.#e.rotation=t}get rotation(){return this.#e.rotation}}},605:(t,e,s)=>{"use strict";s.d(e,{h:()=>n});var r=s(166),i=s(7249);class n extends i.X{#r;#i;#n;constructor(t){super(new r.A1g({sortableChildren:!0}),t),this.#r=t.radius,this.#i=t.fill,this.#n=t.stroke,this.#a()}#a(){this._pixiContainer.clear().circle(0,0,this.#r),this.#i&&this._pixiContainer.fill(this.#i),this.#n&&this._pixiContainer.stroke(this.#n)}get radius(){return this.#r}set radius(t){this.#r=t,this.#a()}get fill(){return this.#i}set fill(t){this.#i=t,this.#a()}get stroke(){return this.#n}set stroke(t){this.#n=t,this.#a()}}},646:(t,e,s)=>{"use strict";s.d(e,{gd:()=>n,l8:()=>a,zu:()=>r});var r,i=s(1347);class n{static _nextID=0;id=n.nextID();regions;start=0;digits=0;setupIndex=0;constructor(t){this.regions=new Array(t)}copy(){let t=new n(this.regions.length);return i.Aq.arrayCopy(this.regions,0,t.regions,0,this.regions.length),t.start=this.start,t.digits=this.digits,t.setupIndex=this.setupIndex,t}apply(t,e){let s=t.sequenceIndex;-1==s&&(s=this.setupIndex),s>=this.regions.length&&(s=this.regions.length-1);let r=this.regions[s];e.region!=r&&(e.region=r,e.updateRegion())}getPath(t,e){let s=t,r=(this.start+e).toString();for(let t=this.digits-r.length;t>0;t--)s+="0";return s+=r,s}static nextID(){return n._nextID++}}!function(t){t[t.hold=0]="hold",t[t.once=1]="once",t[t.loop=2]="loop",t[t.pingpong=3]="pingpong",t[t.onceReverse=4]="onceReverse",t[t.loopReverse=5]="loopReverse",t[t.pingpongReverse=6]="pingpongReverse"}(r||(r={}));const a=[r.hold,r.once,r.loop,r.pingpong,r.onceReverse,r.loopReverse,r.pingpongReverse]},656:(t,e,s)=>{"use strict";s.d(e,{i:()=>_});var r=s(9375),i=s(4142),n=s(4696),a=s(1753),o=s(9062),l=s(3769),h=s(8574),c=s(6890);let u=null;class d{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let t=0;t<this.count;t++){const e=this.textures[t];this.textures[t]=null,this.ids[e.uid]=null}this.count=0}}class p{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new d,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=!0}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null}}const f=[];let m=0;function g(){return m>0?f[--m]:new p}function x(t){f[m++]=t}a.L.register({clear:()=>{if(f.length>0)for(const t of f)t&&t.destroy();f.length=0,m=0}});let y=0;const v=class t{constructor(e){this.uid=(0,r.L)("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],(e={...t.defaultOptions,...e}).maxTextures||((0,n.t6)("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),e.maxTextures=function(){if(u)return u;const t=(0,h.W)();return u=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),u=(0,c.u)(u,t),t.getExtension("WEBGL_lose_context")?.loseContext(),u}());const{maxTextures:s,attributesInitialSize:a,indicesInitialSize:o}=e;this.attributeBuffer=new i.u(4*a),this.indexBuffer=new Uint16Array(o),this.maxTextures=s}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let t=0;t<this.batchIndex;t++)x(this.batches[t]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=!0}add(t){this._elements[this.elementSize++]=t,t._indexStart=this.indexSize,t._attributeStart=this.attributeSize,t._batcher=this,this.indexSize+=t.indexSize,this.attributeSize+=t.attributeSize*this.vertexSize}checkAndUpdateTexture(t,e){const s=t._batch.textures.ids[e._source.uid];return!(!s&&0!==s||(t._textureId=s,t.texture=e,0))}updateElement(t){this.dirty=!0;const e=this.attributeBuffer;t.packAsQuad?this.packQuadAttributes(t,e.float32View,e.uint32View,t._attributeStart,t._textureId):this.packAttributes(t,e.float32View,e.uint32View,t._attributeStart,t._textureId)}break(t){const e=this._elements;if(!e[this.elementStart])return;let s=g(),r=s.textures;r.clear();const i=e[this.elementStart];let n=(0,l.i)(i.blendMode,i.texture._source),a=i.topology;4*this.attributeSize>this.attributeBuffer.size&&this._resizeAttributeBuffer(4*this.attributeSize),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const o=this.attributeBuffer.float32View,h=this.attributeBuffer.uint32View,c=this.indexBuffer;let u=this._batchIndexSize,d=this._batchIndexStart,p="startBatch";const f=this.maxTextures;for(let i=this.elementStart;i<this.elementSize;++i){const m=e[i];e[i]=null;const x=m.texture._source,v=(0,l.i)(m.blendMode,x),_=n!==v||a!==m.topology;x._batchTick!==y||_?(x._batchTick=y,(r.count>=f||_)&&(this._finishBatch(s,d,u-d,r,n,a,t,p),p="renderBatch",d=u,n=v,a=m.topology,s=g(),r=s.textures,r.clear(),++y),m._textureId=x._textureBindLocation=r.count,r.ids[x.uid]=r.count,r.textures[r.count++]=x,m._batch=s,u+=m.indexSize,m.packAsQuad?(this.packQuadAttributes(m,o,h,m._attributeStart,m._textureId),this.packQuadIndex(c,m._indexStart,m._attributeStart/this.vertexSize)):(this.packAttributes(m,o,h,m._attributeStart,m._textureId),this.packIndex(m,c,m._indexStart,m._attributeStart/this.vertexSize))):(m._textureId=x._textureBindLocation,u+=m.indexSize,m.packAsQuad?(this.packQuadAttributes(m,o,h,m._attributeStart,m._textureId),this.packQuadIndex(c,m._indexStart,m._attributeStart/this.vertexSize)):(this.packAttributes(m,o,h,m._attributeStart,m._textureId),this.packIndex(m,c,m._indexStart,m._attributeStart/this.vertexSize)),m._batch=s)}r.count>0&&(this._finishBatch(s,d,u-d,r,n,a,t,p),d=u,++y),this.elementStart=this.elementSize,this._batchIndexStart=d,this._batchIndexSize=u}_finishBatch(t,e,s,r,i,n,a,o){t.gpuBindGroup=null,t.bindGroup=null,t.action=o,t.batcher=this,t.textures=r,t.blendMode=i,t.topology=n,t.start=e,t.size=s,++y,this.batches[this.batchIndex++]=t,a.add(t)}finish(t){this.break(t)}ensureAttributeBuffer(t){4*t<=this.attributeBuffer.size||this._resizeAttributeBuffer(4*t)}ensureIndexBuffer(t){t<=this.indexBuffer.length||this._resizeIndexBuffer(t)}_resizeAttributeBuffer(t){const e=Math.max(t,2*this.attributeBuffer.size),s=new i.u(e);(0,o.W)(this.attributeBuffer.rawBinaryData,s.rawBinaryData),this.attributeBuffer=s}_resizeIndexBuffer(t){const e=this.indexBuffer;let s=Math.max(t,1.5*e.length);s+=s%2;const r=s>65535?new Uint32Array(s):new Uint16Array(s);if(r.BYTES_PER_ELEMENT!==e.BYTES_PER_ELEMENT)for(let t=0;t<e.length;t++)r[t]=e[t];else(0,o.W)(e.buffer,r.buffer);this.indexBuffer=r}packQuadIndex(t,e,s){t[e]=s+0,t[e+1]=s+1,t[e+2]=s+2,t[e+3]=s+0,t[e+4]=s+2,t[e+5]=s+3}packIndex(t,e,s,r){const i=t.indices,n=t.indexSize,a=t.indexOffset,o=t.attributeOffset;for(let t=0;t<n;t++)e[s++]=r+i[t+a]-o}destroy(){if(null!==this.batches){for(let t=0;t<this.batches.length;t++)x(this.batches[t]);this.batches=null;for(let t=0;t<this._elements.length;t++)this._elements[t]&&(this._elements[t]._batch=null);this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null}}};v.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};let _=v},761:(t,e,s)=>{"use strict";s.d(e,{Z:()=>n});var r=s(1753);class i{constructor(t,e){this._pool=[],this._count=0,this._index=0,this._classType=t,e&&this.prepopulate(e)}prepopulate(t){for(let e=0;e<t;e++)this._pool[this._index++]=new this._classType;this._count+=t}get(t){let e;return e=this._index>0?this._pool[--this._index]:new this._classType,e.init?.(t),e}return(t){t.reset?.(),this._pool[this._index++]=t}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){if(this._pool.length>0&&this._pool[0].destroy)for(let t=0;t<this._index;t++)this._pool[t].destroy();this._pool.length=0,this._count=0,this._index=0}}const n=new class{constructor(){this._poolsByClass=new Map}prepopulate(t,e){this.getPool(t).prepopulate(e)}get(t,e){return this.getPool(t).get(e)}return(t){this.getPool(t.constructor).return(t)}getPool(t){return this._poolsByClass.has(t)||this._poolsByClass.set(t,new i(t)),this._poolsByClass.get(t)}stats(){const t={};return this._poolsByClass.forEach(e=>{const s=t[e._classType.name]?e._classType.name+e._classType.ID:e._classType.name;t[s]={free:e.totalFree,used:e.totalUsed,size:e.totalSize}}),t}clear(){this._poolsByClass.forEach(t=>t.clear()),this._poolsByClass.clear()}};r.L.register(n)},769:(t,e,s)=>{"use strict";s.d(e,{E:()=>u});var r=s(5199);const i=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],n=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],a=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],o=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],l=[],h=[],c=Math.sign;!function(){for(let t=0;t<16;t++){const e=[];l.push(e);for(let s=0;s<16;s++){const r=c(i[t]*i[s]+a[t]*n[s]),l=c(n[t]*i[s]+o[t]*n[s]),h=c(i[t]*a[s]+a[t]*o[s]),u=c(n[t]*a[s]+o[t]*o[s]);for(let t=0;t<16;t++)if(i[t]===r&&n[t]===l&&a[t]===h&&o[t]===u){e.push(t);break}}}for(let t=0;t<16;t++){const e=new r.u;e.set(i[t],n[t],a[t],o[t],0,0),h.push(e)}}();const u={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:t=>i[t],uY:t=>n[t],vX:t=>a[t],vY:t=>o[t],inv:t=>8&t?15&t:7&-t,add:(t,e)=>l[t][e],sub:(t,e)=>l[t][u.inv(e)],rotate180:t=>4^t,isVertical:t=>2==(3&t),byDirection:(t,e)=>2*Math.abs(t)<=Math.abs(e)?e>=0?u.S:u.N:2*Math.abs(e)<=Math.abs(t)?t>0?u.E:u.W:e>0?t>0?u.SE:u.SW:t>0?u.NE:u.NW,matrixAppendRotationInv:(t,e,s=0,r=0)=>{const i=h[u.inv(e)];i.tx=s,i.ty=r,t.append(i)},transformRectCoords:(t,e,s,r)=>{const{x:i,y:n,width:a,height:o}=t,{x:l,y:h,width:c,height:d}=e;return s===u.E?(r.set(i+l,n+h,a,o),r):s===u.S?r.set(c-n-o+l,i+h,o,a):s===u.W?r.set(c-i-a+l,d-n-o+h,a,o):s===u.N?r.set(n+l,d-i-a+h,o,a):r.set(i+l,n+h,a,o)}}},791:(t,e,s)=>{"use strict";s.d(e,{S:()=>a});var r=s(6793),i=s(7635);class n extends r.a{#o=new Map;async doLoad(t,e){this.#o.set(t,e);const s=(async()=>{const s=await i.V.load(e);if(!s)return void console.error(`Failed to load texture: ${e}`);const r=await fetch(t);if(r.ok)try{const n=await r.text(),a=(new DOMParser).parseFromString(n,"application/xml"),o=a.getElementsByTagName("info")[0],l=a.getElementsByTagName("common")[0],h=a.getElementsByTagName("char"),c=parseInt(o.getAttribute("size")||"16",10),u=parseInt(l.getAttribute("lineHeight")||"32",10),d={};for(let t=0;t<h.length;t++){const e=h[t],s=parseInt(e.getAttribute("id"),10),r=parseInt(e.getAttribute("x"),10),i=parseInt(e.getAttribute("y"),10),n=parseInt(e.getAttribute("width"),10),a=parseInt(e.getAttribute("height"),10),o=parseInt(e.getAttribute("xoffset"),10),l=parseInt(e.getAttribute("yoffset"),10),c=parseInt(e.getAttribute("xadvance"),10);d[s]={x:r,y:i,width:n,height:a,xoffset:o,yoffset:l,xadvance:c}}this.loadingPromises.delete(t);const p={src:e,chars:d,texture:s,size:c,lineHeight:u};if(this.hasActiveRef(t)){if(!this.cachedAssets.has(t))return this.cachedAssets.set(t,p),p;i.V.release(e),console.error(`Bitmap font already exists: ${t}`)}else i.V.release(e)}catch(e){console.error(`Failed to decode font xml: ${t}`,e),this.loadingPromises.delete(t)}else console.error(`Failed to load font xml: ${t}`)})();return this.loadingPromises.set(t,s),await s}cleanup(t){const e=this.#o.get(t);e&&i.V.release(e)}}const a=new n},792:t=>{"use strict";var e=Object.prototype.hasOwnProperty,s="~";function r(){}function i(t,e,s){this.fn=t,this.context=e,this.once=s||!1}function n(t,e,r,n,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var o=new i(r,n||t,a),l=s?s+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],o]:t._events[l].push(o):(t._events[l]=o,t._eventsCount++),t}function a(t,e){0===--t._eventsCount?t._events=new r:delete t._events[e]}function o(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(s=!1)),o.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(s?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},o.prototype.listeners=function(t){var e=s?s+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,n=r.length,a=new Array(n);i<n;i++)a[i]=r[i].fn;return a},o.prototype.listenerCount=function(t){var e=s?s+t:t,r=this._events[e];return r?r.fn?1:r.length:0},o.prototype.emit=function(t,e,r,i,n,a){var o=s?s+t:t;if(!this._events[o])return!1;var l,h,c=this._events[o],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,r),!0;case 4:return c.fn.call(c.context,e,r,i),!0;case 5:return c.fn.call(c.context,e,r,i,n),!0;case 6:return c.fn.call(c.context,e,r,i,n,a),!0}for(h=1,l=new Array(u-1);h<u;h++)l[h-1]=arguments[h];c.fn.apply(c.context,l)}else{var d,p=c.length;for(h=0;h<p;h++)switch(c[h].once&&this.removeListener(t,c[h].fn,void 0,!0),u){case 1:c[h].fn.call(c[h].context);break;case 2:c[h].fn.call(c[h].context,e);break;case 3:c[h].fn.call(c[h].context,e,r);break;case 4:c[h].fn.call(c[h].context,e,r,i);break;default:if(!l)for(d=1,l=new Array(u-1);d<u;d++)l[d-1]=arguments[d];c[h].fn.apply(c[h].context,l)}}return!0},o.prototype.on=function(t,e,s){return n(this,t,e,s,!1)},o.prototype.once=function(t,e,s){return n(this,t,e,s,!0)},o.prototype.removeListener=function(t,e,r,i){var n=s?s+t:t;if(!this._events[n])return this;if(!e)return a(this,n),this;var o=this._events[n];if(o.fn)o.fn!==e||i&&!o.once||r&&o.context!==r||a(this,n);else{for(var l=0,h=[],c=o.length;l<c;l++)(o[l].fn!==e||i&&!o[l].once||r&&o[l].context!==r)&&h.push(o[l]);h.length?this._events[n]=1===h.length?h[0]:h:a(this,n)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=s?s+t:t,this._events[e]&&a(this,e)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=s,o.EventEmitter=o,t.exports=o},796:(t,e,s)=>{"use strict";s.d(e,{e:()=>x});var r=s(5423),i=s(1065),n=s(7694),a=s(8869),o=s(2445),l=s(3761),h=s(4173),c=s(3463);const u=["normal","bold","100","200","300","400","500","600","700","800","900"],d=[".ttf",".otf",".woff",".woff2"],p=["font/ttf","font/otf","font/woff","font/woff2"],f=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i,m=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;function g(t){return m.test(t)?t:encodeURI(t)}const x={extension:{type:i.Ag.LoadParser,priority:c.T.Low},name:"loadWebFont",id:"web-font",test:t=>(0,l.s)(t,p)||(0,h.W)(t,d),async load(t,e){const s=r.e.get().getFontFaceSet();if(s){const r=[],i=e.data?.family??function(t){const e=a.A.extname(t),s=a.A.basename(t,e).replace(/(-|_)/g," ").toLowerCase().split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1));let r=s.length>0;for(const t of s)if(!t.match(f)){r=!1;break}let i=s.join(" ");return r||(i=`"${i.replace(/[\\"]/g,"\\$&")}"`),i}(t),n=e.data?.weights?.filter(t=>u.includes(t))??["normal"],l=e.data??{};for(let e=0;e<n.length;e++){const a=n[e],o=new FontFace(i,`url(${g(t)})`,{...l,weight:a});await o.load(),s.add(o),r.push(o)}return o.l.has(`${i}-and-url`)?o.l.get(`${i}-and-url`).entries.push({url:t,faces:r}):o.l.set(`${i}-and-url`,{entries:[{url:t,faces:r}]}),1===r.length?r[0]:r}return(0,n.R)("[loadWebFont] FontFace API is not supported. Skipping loading font"),null},unload(t){const e=Array.isArray(t)?t:[t],s=e[0].family,i=o.l.get(`${s}-and-url`),n=i.entries.find(t=>t.faces.some(t=>-1!==e.indexOf(t)));n.faces=n.faces.filter(t=>-1===e.indexOf(t)),0===n.faces.length&&(i.entries=i.entries.filter(t=>t!==n)),e.forEach(t=>{r.e.get().getFontFaceSet().delete(t)}),0===i.entries.length&&o.l.remove(`${s}-and-url`)}}},826:(t,e,s)=>{"use strict";s.d(e,{R:()=>r});class r{name;intValue=0;floatValue=0;stringValue=null;audioPath=null;volume=0;balance=0;constructor(t){this.name=t}}},903:(t,e,s)=>{"use strict";s.d(e,{V:()=>n});var r=s(5423);let i;async function n(t={}){return void 0!==i||(i=await(async()=>{const e=r.e.get().getNavigator().gpu;if(!e)return!1;try{const s=await e.requestAdapter(t);return await s.requestDevice(),!0}catch(t){return!1}})()),i}},946:(t,e,s)=>{"use strict";s.d(e,{h:()=>n,u:()=>r});var r,i=s(1347);class n{index=0;name;parent=null;length=0;x=0;y=0;rotation=0;scaleX=1;scaleY=1;shearX=0;shearY=0;inherit=r.Normal;skinRequired=!1;color=new i.Q1;icon;visible=!1;constructor(t,e,s){if(t<0)throw new Error("index must be >= 0.");if(!e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=s}}!function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(r||(r={}))},966:(t,e,s)=>{"use strict";var r=s(1065),i=s(2445),n=s(4454),a=s(7926),o=s(5199),l=s(9677),h=s(2305),c=s(1570),u=s(7335),d=s(2478),p=s(1657),f=s(4449);const m={name:"local-uniform-msdf-bit",vertex:{header:"\n struct LocalUniforms {\n uColor:vec4<f32>,\n uTransformMatrix:mat3x3<f32>,\n uDistance: f32,\n uRound:f32,\n }\n\n @group(2) @binding(0) var<uniform> localUniforms : LocalUniforms;\n ",main:"\n vColor *= localUniforms.uColor;\n modelMatrix *= localUniforms.uTransformMatrix;\n ",end:"\n if(localUniforms.uRound == 1)\n {\n vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);\n }\n "},fragment:{header:"\n struct LocalUniforms {\n uColor:vec4<f32>,\n uTransformMatrix:mat3x3<f32>,\n uDistance: f32\n }\n\n @group(2) @binding(0) var<uniform> localUniforms : LocalUniforms;\n ",main:"\n outColor = vec4<f32>(calculateMSDFAlpha(outColor, localUniforms.uColor, localUniforms.uDistance));\n "}},g={name:"local-uniform-msdf-bit",vertex:{header:"\n uniform mat3 uTransformMatrix;\n uniform vec4 uColor;\n uniform float uRound;\n ",main:"\n vColor *= uColor;\n modelMatrix *= uTransformMatrix;\n ",end:"\n if(uRound == 1.)\n {\n gl_Position.xy = roundPixels(gl_Position.xy, uResolution);\n }\n "},fragment:{header:"\n uniform float uDistance;\n ",main:"\n outColor = vec4(calculateMSDFAlpha(outColor, vColor, uDistance));\n "}},x={name:"msdf-bit",fragment:{header:"\n fn calculateMSDFAlpha(msdfColor:vec4<f32>, shapeColor:vec4<f32>, distance:f32) -> f32 {\n\n // MSDF\n var median = msdfColor.r + msdfColor.g + msdfColor.b -\n min(msdfColor.r, min(msdfColor.g, msdfColor.b)) -\n max(msdfColor.r, max(msdfColor.g, msdfColor.b));\n\n // SDF\n median = min(median, msdfColor.a);\n\n var screenPxDistance = distance * (median - 0.5);\n var alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\n if (median < 0.01) {\n alpha = 0.0;\n } else if (median > 0.99) {\n alpha = 1.0;\n }\n\n // Gamma correction for coverage-like alpha\n var luma: f32 = dot(shapeColor.rgb, vec3<f32>(0.299, 0.587, 0.114));\n var gamma: f32 = mix(1.0, 1.0 / 2.2, luma);\n var coverage: f32 = pow(shapeColor.a * alpha, gamma);\n\n return coverage;\n\n }\n "}},y={name:"msdf-bit",fragment:{header:"\n float calculateMSDFAlpha(vec4 msdfColor, vec4 shapeColor, float distance) {\n\n // MSDF\n float median = msdfColor.r + msdfColor.g + msdfColor.b -\n min(msdfColor.r, min(msdfColor.g, msdfColor.b)) -\n max(msdfColor.r, max(msdfColor.g, msdfColor.b));\n\n // SDF\n median = min(median, msdfColor.a);\n\n float screenPxDistance = distance * (median - 0.5);\n float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\n\n if (median < 0.01) {\n alpha = 0.0;\n } else if (median > 0.99) {\n alpha = 1.0;\n }\n\n // Gamma correction for coverage-like alpha\n float luma = dot(shapeColor.rgb, vec3(0.299, 0.587, 0.114));\n float gamma = mix(1.0, 1.0 / 2.2, luma);\n float coverage = pow(shapeColor.a * alpha, gamma);\n\n return coverage;\n }\n "}};let v,_;class b extends p.M{constructor(t){const e=new f.k({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new o.u,type:"mat3x3<f32>"},uDistance:{value:4,type:"f32"},uRound:{value:0,type:"f32"}});v??(v=(0,l.v)({name:"sdf-shader",bits:[h.F,(0,c._)(t),m,x,u.b]})),_??(_=(0,l.I)({name:"sdf-shader",bits:[h.a,(0,c.P)(t),g,y,u.m]})),super({glProgram:_,gpuProgram:v,resources:{localUniforms:e,batchSamplers:(0,d.n)(t)}})}}var w=s(8598),T=s(5353);class S extends n.A{destroy(){this.context.customShader&&this.context.customShader.destroy(),super.destroy()}}class A{constructor(t){this._renderer=t}validateRenderable(t){const e=this._getGpuBitmapText(t);return this._renderer.renderPipes.graphics.validateRenderable(e)}addRenderable(t,e){const s=this._getGpuBitmapText(t);C(t,s),t._didTextUpdate&&(t._didTextUpdate=!1,this._updateContext(t,s)),this._renderer.renderPipes.graphics.addRenderable(s,e),s.context.customShader&&this._updateDistanceField(t)}updateRenderable(t){const e=this._getGpuBitmapText(t);C(t,e),this._renderer.renderPipes.graphics.updateRenderable(e),e.context.customShader&&this._updateDistanceField(t)}_updateContext(t,e){const{context:s}=e,r=w.c.getFont(t.text,t._style);s.clear(),"none"!==r.distanceField.type&&(s.customShader||(s.customShader=new b(this._renderer.limits.maxBatchableTextures)));const i=a.P.graphemeSegmenter(t.text),n=t._style;let o=r.baseLineOffset;const l=(0,T.Z)(i,n,r,!0),h=n.padding,c=l.scale;let u=l.width,d=l.height+l.offsetY;n._stroke&&(u+=n._stroke.width/c,d+=n._stroke.width/c),s.translate(-t._anchor._x*u-h,-t._anchor._y*d-h).scale(c,c);const p=r.applyFillAsTint?n._fill.color:16777215;let f=r.fontMetrics.fontSize,m=r.lineHeight;n.lineHeight&&(f=n.fontSize/c,m=n.lineHeight/c);let g=(m-f)/2;g-r.baseLineOffset<0&&(g=0);for(let t=0;t<l.lines.length;t++){const e=l.lines[t];for(let t=0;t<e.charPositions.length;t++){const i=e.chars[t],n=r.chars[i];if(n?.texture){const r=n.texture;s.texture(r,p||"black",Math.round(e.charPositions[t]+n.xOffset),Math.round(o+n.yOffset+g),r.orig.width,r.orig.height)}}o+=m}}_getGpuBitmapText(t){return t._gpuData[this._renderer.uid]||this.initGpuText(t)}initGpuText(t){const e=new S;return t._gpuData[this._renderer.uid]=e,this._updateContext(t,e),e}_updateDistanceField(t){const e=this._getGpuBitmapText(t).context,s=t._style.fontFamily,r=i.l.get(`${s}-bitmap`),{a:n,b:a,c:o,d:l}=t.groupTransform,h=Math.sqrt(n*n+a*a),c=Math.sqrt(o*o+l*l),u=(Math.abs(h)+Math.abs(c))/2,d=r.baseRenderedFontSize/t._style.fontSize,p=u*r.distanceField.range*(1/d);e.customShader.resources.localUniforms.uniforms.uDistance=p}destroy(){this._renderer=null}}function C(t,e){e.groupTransform=t.groupTransform,e.groupColorAlpha=t.groupColorAlpha,e.groupColor=t.groupColor,e.groupBlendMode=t.groupBlendMode,e.globalDisplayStatus=t.globalDisplayStatus,e.groupTransform=t.groupTransform,e.localDisplayStatus=t.localDisplayStatus,e.groupAlpha=t.groupAlpha,e._roundPixels=t._roundPixels}A.extension={type:[r.Ag.WebGLPipes,r.Ag.WebGPUPipes,r.Ag.CanvasPipes],name:"bitmapText"},r.XO.add(A)},992:(t,e,s)=>{"use strict";s.d(e,{R:()=>r,i:()=>i});const r={name:"color-bit",vertex:{header:"\n @in aDarkColor: vec4<f32>;\n @out vDarkColor: vec4<f32>;\n ",main:"\n vDarkColor = aDarkColor;\n "},fragment:{header:"\n @in vDarkColor: vec4<f32>;\n ",end:"\n\n let alpha = outColor.a * vColor.a;\n let rgb = ((outColor.a - 1.0) * vDarkColor.a + 1.0 - outColor.rgb) * vDarkColor.rgb + outColor.rgb * vColor.rgb;\n\n finalColor = vec4<f32>(rgb, alpha);\n\n "}},i={name:"color-bit",vertex:{header:"\n in vec4 aDarkColor;\n out vec4 vDarkColor;\n ",main:"\n vDarkColor = aDarkColor;\n "},fragment:{header:"\n in vec4 vDarkColor;\n ",end:"\n\n finalColor.a = outColor.a * vColor.a;\n finalColor.rgb = ((outColor.a - 1.0) * vDarkColor.a + 1.0 - outColor.rgb) * vDarkColor.rgb + outColor.rgb * vColor.rgb;\n "}}},1009:(t,e,s)=>{"use strict";s.d(e,{W:()=>a});var r=s(8883),i=s(1579),n=s(9798);class a{constructor(t){this._syncFunctionHash=Object.create(null),this._adaptor=t,this._systemCheck()}_systemCheck(){if(!(0,r.f)())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}ensureUniformGroup(t){const e=this.getUniformGroupData(t);t.buffer||(t.buffer=new i.h({data:new Float32Array(e.layout.size/4),usage:n.S.UNIFORM|n.S.COPY_DST}))}getUniformGroupData(t){return this._syncFunctionHash[t._signature]||this._initUniformGroup(t)}_initUniformGroup(t){const e=t._signature;let s=this._syncFunctionHash[e];if(!s){const r=Object.keys(t.uniformStructures).map(e=>t.uniformStructures[e]),i=this._adaptor.createUboElements(r),n=this._generateUboSync(i.uboElements);s=this._syncFunctionHash[e]={layout:i,syncFunction:n}}return this._syncFunctionHash[e]}_generateUboSync(t){return this._adaptor.generateUboSync(t)}syncUniformGroup(t,e,s){const r=this.getUniformGroupData(t);t.buffer||(t.buffer=new i.h({data:new Float32Array(r.layout.size/4),usage:n.S.UNIFORM|n.S.COPY_DST}));let a=null;return e||(e=t.buffer.data,a=t.buffer.dataInt32),s||(s=0),r.syncFunction(t.uniforms,e,a,s),!0}updateUniformGroup(t){if(t.isStatic&&!t._dirtyId)return!1;t._dirtyId=0;const e=this.syncUniformGroup(t);return t.buffer.update(),e}destroy(){this._syncFunctionHash=null}}},1055:(t,e,s)=>{"use strict";s.d(e,{A:()=>i});let r=null;class i{constructor(){r||(r=URL.createObjectURL(new Blob(['(function () {\n \'use strict\';\n\n async function loadImageBitmap(url, alphaMode) {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(`[WorkerManager.loadImageBitmap] Failed to fetch ${url}: ${response.status} ${response.statusText}`);\n }\n const imageBlob = await response.blob();\n return alphaMode === "premultiplied-alpha" ? createImageBitmap(imageBlob, { premultiplyAlpha: "none" }) : createImageBitmap(imageBlob);\n }\n self.onmessage = async (event) => {\n try {\n const imageBitmap = await loadImageBitmap(event.data.data[0], event.data.data[1]);\n self.postMessage({\n data: imageBitmap,\n uuid: event.data.uuid,\n id: event.data.id\n }, [imageBitmap]);\n } catch (e) {\n self.postMessage({\n error: e,\n uuid: event.data.uuid,\n id: event.data.id\n });\n }\n };\n\n})();\n'],{type:"application/javascript"}))),this.worker=new Worker(r)}}i.revokeObjectURL=function(){r&&(URL.revokeObjectURL(r),r=null)}},1065:(t,e,s)=>{"use strict";s.d(e,{Ag:()=>r,XO:()=>a});var r=(t=>(t.Application="application",t.WebGLPipes="webgl-pipes",t.WebGLPipesAdaptor="webgl-pipes-adaptor",t.WebGLSystem="webgl-system",t.WebGPUPipes="webgpu-pipes",t.WebGPUPipesAdaptor="webgpu-pipes-adaptor",t.WebGPUSystem="webgpu-system",t.CanvasSystem="canvas-system",t.CanvasPipesAdaptor="canvas-pipes-adaptor",t.CanvasPipes="canvas-pipes",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t.MaskEffect="mask-effect",t.BlendMode="blend-mode",t.TextureSource="texture-source",t.Environment="environment",t.ShapeBuilder="shape-builder",t.Batcher="batcher",t))(r||{});const i=t=>{if("function"==typeof t||"object"==typeof t&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={..."object"!=typeof t.extension?{type:t.extension}:t.extension,ref:t}}if("object"!=typeof t)throw new Error("Invalid extension type");return"string"==typeof(t={...t}).type&&(t.type=[t.type]),t},n=(t,e)=>i(t).priority??e,a={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(i).forEach(t=>{t.type.forEach(e=>this._removeHandlers[e]?.(t))}),this},add(...t){return t.map(i).forEach(t=>{t.type.forEach(e=>{const s=this._addHandlers,r=this._queue;s[e]?s[e]?.(t):(r[e]=r[e]||[],r[e]?.push(t))})}),this},handle(t,e,s){const r=this._addHandlers,i=this._removeHandlers;if(r[t]||i[t])throw new Error(`Extension type ${t} already has a handler`);r[t]=e,i[t]=s;const n=this._queue;return n[t]&&(n[t]?.forEach(t=>e(t)),delete n[t]),this},handleByMap(t,e){return this.handle(t,t=>{t.name&&(e[t.name]=t.ref)},t=>{t.name&&delete e[t.name]})},handleByNamedList(t,e,s=-1){return this.handle(t,t=>{e.findIndex(e=>e.name===t.name)>=0||(e.push({name:t.name,value:t.ref}),e.sort((t,e)=>n(e.value,s)-n(t.value,s)))},t=>{const s=e.findIndex(e=>e.name===t.name);-1!==s&&e.splice(s,1)})},handleByList(t,e,s=-1){return this.handle(t,t=>{e.includes(t.ref)||(e.push(t.ref),e.sort((t,e)=>n(e,s)-n(t,s)))},t=>{const s=e.indexOf(t.ref);-1!==s&&e.splice(s,1)})},mixin(t,...e){for(const s of e)Object.defineProperties(t.prototype,Object.getOwnPropertyDescriptors(s))}}},1143:(t,e,s)=>{"use strict";s.d(e,{s:()=>n});var r=s(5423),i=s(3212);const n={test:t=>!("string"!=typeof t||!t.includes("<font>"))&&i.f.test(r.e.get().parseXML(t)),parse:t=>i.f.parse(r.e.get().parseXML(t))}},1174:(t,e,s)=>{"use strict";s.d(e,{u:()=>l});var r=s(1579),i=s(9798),n=s(8337),a=s(4696);const o=class t extends n.V{constructor(...e){let s=e[0]??{};s instanceof Float32Array&&((0,a.t6)(a.lj,"use new MeshGeometry({ positions, uvs, indices }) instead"),s={positions:s,uvs:e[1],indices:e[2]}),s={...t.defaultOptions,...s};const n=s.positions||new Float32Array([0,0,1,0,1,1,0,1]);let o=s.uvs;o||(o=s.positions?new Float32Array(n.length):new Float32Array([0,0,1,0,1,1,0,1]));const l=s.indices||new Uint32Array([0,1,2,0,2,3]),h=s.shrinkBuffersToFit;super({attributes:{aPosition:{buffer:new r.h({data:n,label:"attribute-mesh-positions",shrinkToFit:h,usage:i.S.VERTEX|i.S.COPY_DST}),format:"float32x2",stride:8,offset:0},aUV:{buffer:new r.h({data:o,label:"attribute-mesh-uvs",shrinkToFit:h,usage:i.S.VERTEX|i.S.COPY_DST}),format:"float32x2",stride:8,offset:0}},indexBuffer:new r.h({data:l,label:"index-mesh-buffer",shrinkToFit:h,usage:i.S.INDEX|i.S.COPY_DST}),topology:s.topology}),this.batchMode="auto"}get positions(){return this.attributes.aPosition.buffer.data}set positions(t){this.attributes.aPosition.buffer.data=t}get uvs(){return this.attributes.aUV.buffer.data}set uvs(t){this.attributes.aUV.buffer.data=t}get indices(){return this.indexBuffer.data}set indices(t){this.indexBuffer.data=t}};o.defaultOptions={topology:"triangle-list",shrinkBuffersToFit:!1};let l=o},1228:(t,e,s)=>{"use strict";s.d(e,{U:()=>r});class r{constructor(){this.batcherName="default",this.packAsQuad=!1,this.indexOffset=0,this.attributeOffset=0,this.roundPixels=0,this._batcher=null,this._batch=null,this._textureMatrixUpdateId=-1,this._uvUpdateId=-1}get blendMode(){return this.renderable.groupBlendMode}get topology(){return this._topology||this.geometry.topology}set topology(t){this._topology=t}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.geometry=null,this._uvUpdateId=-1,this._textureMatrixUpdateId=-1}setTexture(t){this.texture!==t&&(this.texture=t,this._textureMatrixUpdateId=-1)}get uvs(){const t=this.geometry.getBuffer("aUV"),e=t.data;let s=e;const r=this.texture.textureMatrix;return r.isSimple||(s=this._transformedUvs,this._textureMatrixUpdateId===r._updateID&&this._uvUpdateId===t._updateID||((!s||s.length<e.length)&&(s=this._transformedUvs=new Float32Array(e.length)),this._textureMatrixUpdateId=r._updateID,this._uvUpdateId=t._updateID,r.multiplyUvs(e,s))),s}get positions(){return this.geometry.positions}get indices(){return this.geometry.indices}get color(){return this.renderable.groupColorAlpha}get groupTransform(){return this.renderable.groupTransform}get attributeSize(){return this.geometry.positions.length/2}get indexSize(){return this.geometry.indices.length}}},1268:(t,e,s)=>{"use strict";s.d(e,{M:()=>n});var r=s(8851);const i=new(s(6170).c);function n(t,e,s,n){const a=i;a.minX=0,a.minY=0,a.maxX=t.width/n|0,a.maxY=t.height/n|0;const o=r.W.getOptimalTexture(a.width,a.height,n,!1);return o.source.uploadMethodId="image",o.source.resource=t,o.source.alphaMode="premultiply-alpha-on-upload",o.frame.width=e/n,o.frame.height=s/n,o.source.emit("update",o.source),o.updateUvs(),o}},1274:(t,e,s)=>{"use strict";s(5242),new Map},1298:(t,e,s)=>{"use strict";s.d(e,{K:()=>n});var r=s(9087),i=s.n(r);class n{#l;constructor(t){const e=new(i());e.dom.style.position="absolute",e.showPanel(0),t.appendChild(e.dom),this.#l=e}update(){this.#l.update()}remove(){this.#l.dom.remove()}}},1347:(t,e,s)=>{"use strict";s.d(e,{Aq:()=>a,I9:()=>l,Q1:()=>i,bC:()=>o,cj:()=>n,eE:()=>r});class r{entries={};size=0;add(t){let e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}addAll(t){let e=this.size;for(var s=0,r=t.length;s<r;s++)this.add(t[s]);return e!=this.size}contains(t){return this.entries[t]}clear(){this.entries={},this.size=0}}class i{r;g;b;a;static WHITE=new i(1,1,1,1);static RED=new i(1,0,0,1);static GREEN=new i(0,1,0,1);static BLUE=new i(0,0,1,1);static MAGENTA=new i(1,0,1,1);constructor(t=0,e=0,s=0,r=0){this.r=t,this.g=e,this.b=s,this.a=r}set(t,e,s,r){return this.r=t,this.g=e,this.b=s,this.a=r,this.clamp()}setFromColor(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}setFromString(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=8!=t.length?1:parseInt(t.substr(6,2),16)/255,this}add(t,e,s,r){return this.r+=t,this.g+=e,this.b+=s,this.a+=r,this.clamp()}clamp(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255}static rgb888ToColor(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}toRgb888(){const t=t=>("0"+(255*t).toString(16)).slice(-2);return Number("0x"+t(this.r)+t(this.g)+t(this.b))}static fromString(t,e=new i){return e.setFromString(t)}}class n{static PI=3.1415927;static PI2=2*n.PI;static invPI2=1/n.PI2;static radiansToDegrees=180/n.PI;static radDeg=n.radiansToDegrees;static degreesToRadians=n.PI/180;static degRad=n.degreesToRadians;static clamp(t,e,s){return t<e?e:t>s?s:t}static cosDeg(t){return Math.cos(t*n.degRad)}static sinDeg(t){return Math.sin(t*n.degRad)}static atan2Deg(t,e){return Math.atan2(t,e)*n.degRad}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){let e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}static randomTriangular(t,e){return n.randomTriangularWith(t,e,.5*(t+e))}static randomTriangularWith(t,e,s){let r=Math.random(),i=e-t;return r<=(s-t)/i?t+Math.sqrt(r*i*(s-t)):e-Math.sqrt((1-r)*i*(e-s))}static isPowerOfTwo(t){return t&&!(t&t-1)}}class a{static SUPPORTS_TYPED_ARRAYS="undefined"!=typeof Float32Array;static arrayCopy(t,e,s,r,i){for(let n=e,a=r;n<e+i;n++,a++)s[a]=t[n]}static arrayFill(t,e,s,r){for(let i=e;i<s;i++)t[i]=r}static setArraySize(t,e,s=0){let r=t.length;if(r==e)return t;if(t.length=e,r<e)for(let i=r;i<e;i++)t[i]=s;return t}static ensureArrayCapacity(t,e,s=0){return t.length>=e?t:a.setArraySize(t,e,s)}static newArray(t,e){let s=new Array(t);for(let r=0;r<t;r++)s[r]=e;return s}static newFloatArray(t){if(a.SUPPORTS_TYPED_ARRAYS)return new Float32Array(t);{let e=new Array(t);for(let t=0;t<e.length;t++)e[t]=0;return e}}static newShortArray(t){if(a.SUPPORTS_TYPED_ARRAYS)return new Int16Array(t);{let e=new Array(t);for(let t=0;t<e.length;t++)e[t]=0;return e}}static toFloatArray(t){return a.SUPPORTS_TYPED_ARRAYS?new Float32Array(t):t}static toSinglePrecision(t){return a.SUPPORTS_TYPED_ARRAYS?Math.fround(t):t}static webkit602BugfixHelper(t,e){}static contains(t,e,s=!0){for(var r=0;r<t.length;r++)if(t[r]==e)return!0;return!1}static enumValue(t,e){return t[e[0].toUpperCase()+e.slice(1)]}}class o{items=new Array;instantiator;constructor(t){this.instantiator=t}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let e=0;e<t.length;e++)this.free(t[e])}clear(){this.items.length=0}}class l{x;y;constructor(t=0,e=0){this.x=t,this.y=e}set(t,e){return this.x=t,this.y=e,this}length(){let t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}normalize(){let t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this}}},1351:(t,e,s)=>{"use strict";s.d(e,{M:()=>n});var r=s(1065);const i=["png","jpg","jpeg"],n={extension:{type:r.Ag.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async t=>[...t,...i],remove:async t=>t.filter(t=>!i.includes(t))}},1386:(t,e,s)=>{"use strict";s.d(e,{q:()=>a});var r=s(5423),i=s(1065),n=s(4269);class a extends n.v{constructor(t){t.resource||(t.resource=r.e.get().createCanvas()),t.width||(t.width=t.resource.width,t.autoDensity||(t.width/=t.resolution)),t.height||(t.height=t.resource.height,t.autoDensity||(t.height/=t.resolution)),super(t),this.uploadMethodId="image",this.autoDensity=t.autoDensity,this.resizeCanvas(),this.transparent=!!t.transparent}resizeCanvas(){this.autoDensity&&"style"in this.resource&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),this.resource.width===this.pixelWidth&&this.resource.height===this.pixelHeight||(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(t=this.width,e=this.height,s=this._resolution){const r=super.resize(t,e,s);return r&&this.resizeCanvas(),r}static test(t){return globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&t instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}}a.extension=i.Ag.TextureSource},1422:(t,e,s)=>{"use strict";s.d(e,{m:()=>a});var r=s(5199),i=s(4582),n=s(8851);class a{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new r.u,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.gcTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=!0,this.instructionSet=new i.L,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(t){this.root=t,t._onRender&&this.addOnRender(t),t.didChange=!0;const e=t.children;for(let t=0;t<e.length;t++){const s=e[t];s._updateFlags=15,this.addChild(s)}}enableCacheAsTexture(t={}){this.textureOptions=t,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(n.W.returnTexture(this.texture,!0),this.texture=null)}updateCacheTexture(){this.textureNeedsUpdate=!0;const t=this._parentCacheAsTextureRenderGroup;t&&!t.textureNeedsUpdate&&t.updateCacheTexture()}reset(){this.renderGroupChildren.length=0;for(const t in this.childrenToUpdate){const e=this.childrenToUpdate[t];e.list.fill(null),e.index=0}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=!0,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture()}get localTransform(){return this.root.localTransform}addRenderGroupChild(t){t.renderGroupParent&&t.renderGroupParent._removeRenderGroupChild(t),t.renderGroupParent=this,this.renderGroupChildren.push(t)}_removeRenderGroupChild(t){const e=this.renderGroupChildren.indexOf(t);e>-1&&this.renderGroupChildren.splice(e,1),t.renderGroupParent=null}addChild(t){if(this.structureDidChange=!0,t.parentRenderGroup=this,t.updateTick=-1,t.parent===this.root?t.relativeRenderGroupDepth=1:t.relativeRenderGroupDepth=t.parent.relativeRenderGroupDepth+1,t.didChange=!0,this.onChildUpdate(t),t.renderGroup)return void this.addRenderGroupChild(t.renderGroup);t._onRender&&this.addOnRender(t);const e=t.children;for(let t=0;t<e.length;t++)this.addChild(e[t])}removeChild(t){if(this.structureDidChange=!0,t._onRender&&(t.renderGroup||this.removeOnRender(t)),t.parentRenderGroup=null,t.renderGroup)return void this._removeRenderGroupChild(t.renderGroup);const e=t.children;for(let t=0;t<e.length;t++)this.removeChild(e[t])}removeChildren(t){for(let e=0;e<t.length;e++)this.removeChild(t[e])}onChildUpdate(t){let e=this.childrenToUpdate[t.relativeRenderGroupDepth];e||(e=this.childrenToUpdate[t.relativeRenderGroupDepth]={index:0,list:[]}),e.list[e.index++]=t}updateRenderable(t){t.globalDisplayStatus<7||(this.instructionSet.renderPipes[t.renderPipeId].updateRenderable(t),t.didViewUpdate=!1)}onChildViewUpdate(t){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=t}get isRenderable(){return 7===this.root.localDisplayStatus&&this.worldAlpha>0}addOnRender(t){this._onRenderContainers.push(t)}removeOnRender(t){this._onRenderContainers.splice(this._onRenderContainers.indexOf(t),1)}runOnRender(t){for(let e=0;e<this._onRenderContainers.length;e++)this._onRenderContainers[e]._onRender(t)}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null}getChildren(t=[]){const e=this.root.children;for(let s=0;s<e.length;s++)this._getChildren(e[s],t);return t}_getChildren(t,e=[]){if(e.push(t),t.renderGroup)return e;const s=t.children;for(let t=0;t<s.length;t++)this._getChildren(s[t],e);return e}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return 1&this._matrixDirty?(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new r.u),this._inverseWorldTransform.copyFrom(this.worldTransform).invert()):this._inverseWorldTransform}get textureOffsetInverseTransform(){return 2&this._matrixDirty?(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new r.u),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y)):this._textureOffsetInverseTransform}get inverseParentTextureTransform(){if(!(4&this._matrixDirty))return this._inverseParentTextureTransform;this._matrixDirty&=-5;const t=this._parentCacheAsTextureRenderGroup;return t?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new r.u),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(t.inverseWorldTransform).translate(-t._textureBounds.x,-t._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}}},1566:(t,e,s)=>{"use strict";s.d(e,{N:()=>a});var r=s(5423),i=s(9437),n=s(1753);const a=new class{constructor(t){this._canvasPool=Object.create(null),this.canvasOptions=t||{},this.enableFullScreen=!1}_createCanvasAndContext(t,e){const s=r.e.get().createCanvas();s.width=t,s.height=e;const i=s.getContext("2d");return{canvas:s,context:i}}getOptimalCanvasAndContext(t,e,s=1){t=Math.ceil(t*s-1e-6),e=Math.ceil(e*s-1e-6);const r=((t=(0,i.U5)(t))<<17)+((e=(0,i.U5)(e))<<1);this._canvasPool[r]||(this._canvasPool[r]=[]);let n=this._canvasPool[r].pop();return n||(n=this._createCanvasAndContext(t,e)),n}returnCanvasAndContext(t){const e=t.canvas,{width:s,height:r}=e,i=(s<<17)+(r<<1);t.context.resetTransform(),t.context.clearRect(0,0,s,r),this._canvasPool[i].push(t)}clear(){this._canvasPool={}}};n.L.register(a)},1570:(t,e,s)=>{"use strict";s.d(e,{P:()=>h,_:()=>a});const r={};function i(t){const e=[];if(1===t)e.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"),e.push("@group(1) @binding(1) var textureSampler1: sampler;");else{let s=0;for(let r=0;r<t;r++)e.push(`@group(1) @binding(${s++}) var textureSource${r+1}: texture_2d<f32>;`),e.push(`@group(1) @binding(${s++}) var textureSampler${r+1}: sampler;`)}return e.join("\n")}function n(t){const e=[];if(1===t)e.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else{e.push("switch vTextureId {");for(let s=0;s<t;s++)s===t-1?e.push(" default:{"):e.push(` case ${s}:{`),e.push(` outColor = textureSampleGrad(textureSource${s+1}, textureSampler${s+1}, vUV, uvDx, uvDy);`),e.push(" break;}");e.push("}")}return e.join("\n")}function a(t){return r[t]||(r[t]={name:"texture-batch-bit",vertex:{header:"\n @in aTextureIdAndRound: vec2<u32>;\n @out @interpolate(flat) vTextureId : u32;\n ",main:"\n vTextureId = aTextureIdAndRound.y;\n ",end:"\n if(aTextureIdAndRound.x == 1)\n {\n vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);\n }\n "},fragment:{header:`\n @in @interpolate(flat) vTextureId: u32;\n\n ${i(t)}\n `,main:`\n var uvDx = dpdx(vUV);\n var uvDy = dpdy(vUV);\n\n ${n(t)}\n `}}),r[t]}const o={};function l(t){const e=[];for(let s=0;s<t;s++)s>0&&e.push("else"),s<t-1&&e.push(`if(vTextureId < ${s}.5)`),e.push("{"),e.push(`\toutColor = texture(uTextures[${s}], vUV);`),e.push("}");return e.join("\n")}function h(t){return o[t]||(o[t]={name:"texture-batch-bit",vertex:{header:"\n in vec2 aTextureIdAndRound;\n out float vTextureId;\n\n ",main:"\n vTextureId = aTextureIdAndRound.y;\n ",end:"\n if(aTextureIdAndRound.x == 1.)\n {\n gl_Position.xy = roundPixels(gl_Position.xy, uResolution);\n }\n "},fragment:{header:`\n in float vTextureId;\n\n uniform sampler2D uTextures[${t}];\n\n `,main:`\n\n ${l(t)}\n `}}),o[t]}},1579:(t,e,s)=>{"use strict";s.d(e,{h:()=>a});var r=s(4872),i=s(9375),n=s(9798);class a extends r.A{constructor(t){let{data:e,size:s}=t;const{usage:r,label:n,shrinkToFit:a}=t;super(),this.uid=(0,i.L)("buffer"),this._resourceType="buffer",this._resourceId=(0,i.L)("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,e instanceof Array&&(e=new Float32Array(e)),this._data=e,s??(s=e?.byteLength);const o=!!e;this.descriptor={size:s,usage:r,mappedAtCreation:o,label:n},this.shrinkToFit=a??!0}get data(){return this._data}set data(t){this.setDataWithSize(t,t.length,!0)}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return!!(this.descriptor.usage&n.S.STATIC)}set static(t){t?this.descriptor.usage|=n.S.STATIC:this.descriptor.usage&=~n.S.STATIC}setDataWithSize(t,e,s){if(this._updateID++,this._updateSize=e*t.BYTES_PER_ELEMENT,this._data===t)return void(s&&this.emit("update",this));const r=this._data;this._data=t,this._dataInt32=null,r&&r.length===t.length||!this.shrinkToFit&&r&&t.byteLength<r.byteLength?s&&this.emit("update",this):(this.descriptor.size=t.byteLength,this._resourceId=(0,i.L)("resource"),this.emit("change",this))}update(t){this._updateSize=t??this._updateSize,this._updateID++,this.emit("update",this)}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners()}}},1657:(t,e,s)=>{"use strict";s.d(e,{M:()=>c});var r=s(4872),i=s(9375),n=s(5007),a=s(3655),o=s(1790),l=s(5153),h=s(4449);class c extends r.A{constructor(t){super(),this.uid=(0,i.L)("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[];let{gpuProgram:e,glProgram:s,groups:r,resources:n,compatibleRenderers:o,groupMap:c}=t;this.gpuProgram=e,this.glProgram=s,void 0===o&&(o=0,e&&(o|=l.W.WEBGPU),s&&(o|=l.W.WEBGL)),this.compatibleRenderers=o;const u={};if(n||r||(n={}),n&&r)throw new Error("[Shader] Cannot have both resources and groups");if(!e&&r&&!c)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!e&&r&&c)for(const t in c)for(const e in c[t]){const s=c[t][e];u[s]={group:t,binding:e,name:s}}else if(e&&r&&!c){const t=e.structsAndGroups.groups;c={},t.forEach(t=>{c[t.group]=c[t.group]||{},c[t.group][t.binding]=t.name,u[t.name]=t})}else if(n){r={},c={},e&&e.structsAndGroups.groups.forEach(t=>{c[t.group]=c[t.group]||{},c[t.group][t.binding]=t.name,u[t.name]=t});let t=0;for(const e in n)u[e]||(r[99]||(r[99]=new a.T,this._ownedBindGroups.push(r[99])),u[e]={group:99,binding:t,name:e},c[99]=c[99]||{},c[99][t]=e,t++);for(const t in n){const e=t;let s=n[t];s.source||s._resourceType||(s=new h.k(s));const i=u[e];i&&(r[i.group]||(r[i.group]=new a.T,this._ownedBindGroups.push(r[i.group])),r[i.group].setResource(s,i.binding))}}this.groups=r,this._uniformBindMap=c,this.resources=this._buildResourceAccessor(r,u)}addResource(t,e,s){var r,i;(r=this._uniformBindMap)[e]||(r[e]={}),(i=this._uniformBindMap[e])[s]||(i[s]=t),this.groups[e]||(this.groups[e]=new a.T,this._ownedBindGroups.push(this.groups[e]))}_buildResourceAccessor(t,e){const s={};for(const r in e){const i=e[r];Object.defineProperty(s,i.name,{get:()=>t[i.group].getResource(i.binding),set(e){t[i.group].setResource(e,i.binding)}})}return s}destroy(t=!1){this.emit("destroy",this),t&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(t=>{t.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null}static from(t){const{gpu:e,gl:s,...r}=t;let i,a;return e&&(i=o.B.from(e)),s&&(a=n.M.from(s)),new c({gpuProgram:i,glProgram:a,...r})}}},1673:(t,e,s)=>{"use strict";s.d(e,{f:()=>Ut,i:()=>Gt});var r=s(1065);class i{constructor(t){this._renderer=t}updateRenderable(){}destroyRenderable(){}validateRenderable(){return!1}addRenderable(t,e){this._renderer.renderPipes.batch.break(e),e.add(t)}execute(t){t.isRenderable&&t.render(this._renderer)}destroy(){this._renderer=null}}i.extension={type:[r.Ag.WebGLPipes,r.Ag.WebGPUPipes,r.Ag.CanvasPipes],name:"customRender"};var n=s(5199),a=s(761),o=s(3412);function l(t,e){const s=t.instructionSet,r=s.instructions;for(let t=0;t<s.instructionSize;t++){const s=r[t];e[s.renderPipeId].execute(s)}}const h=new n.u;class c{constructor(t){this._renderer=t}addRenderGroup(t,e){t.isCachedAsTexture?this._addRenderableCacheAsTexture(t,e):this._addRenderableDirect(t,e)}execute(t){t.isRenderable&&(t.isCachedAsTexture?this._executeCacheAsTexture(t):this._executeDirect(t))}destroy(){this._renderer=null}_addRenderableDirect(t,e){this._renderer.renderPipes.batch.break(e),t._batchableRenderGroup&&(a.Z.return(t._batchableRenderGroup),t._batchableRenderGroup=null),e.add(t)}_addRenderableCacheAsTexture(t,e){const s=t._batchableRenderGroup??(t._batchableRenderGroup=a.Z.get(o.K));s.renderable=t.root,s.transform=t.root.relativeGroupTransform,s.texture=t.texture,s.bounds=t._textureBounds,e.add(t),this._renderer.renderPipes.blendMode.pushBlendMode(t,t.root.groupBlendMode,e),this._renderer.renderPipes.batch.addToBatch(s,e),this._renderer.renderPipes.blendMode.popBlendMode(e)}_executeCacheAsTexture(t){if(t.textureNeedsUpdate){t.textureNeedsUpdate=!1;const e=h.identity().translate(-t._textureBounds.x,-t._textureBounds.y);this._renderer.renderTarget.push(t.texture,!0,null,t.texture.frame),this._renderer.globalUniforms.push({worldTransformMatrix:e,worldColor:4294967295,offset:{x:0,y:0}}),l(t,this._renderer.renderPipes),this._renderer.renderTarget.finishRenderPass(),this._renderer.renderTarget.pop(),this._renderer.globalUniforms.pop()}t._batchableRenderGroup._batcher.updateElement(t._batchableRenderGroup),t._batchableRenderGroup._batcher.geometry.buffers[0].update()}_executeDirect(t){this._renderer.globalUniforms.push({worldTransformMatrix:t.inverseParentTextureTransform,worldColor:t.worldColorAlpha}),l(t,this._renderer.renderPipes),this._renderer.globalUniforms.pop()}}c.extension={type:[r.Ag.WebGLPipes,r.Ag.WebGPUPipes,r.Ag.CanvasPipes],name:"renderGroup"};var u=s(8851),d=s(8896),p=s(6170);function f(t,e){e||(e=0);for(let s=e;s<t.length&&t[s];s++)t[s]=null}var m=s(4687),g=s(6851);const x=new m.mc,y=m.fR|m.ig|m.u;function v(t,e=!1){!function(t){const e=t.root;let s;if(t.renderGroupParent){const r=t.renderGroupParent;t.worldTransform.appendFrom(e.relativeGroupTransform,r.worldTransform),t.worldColor=(0,g.j)(e.groupColor,r.worldColor),s=e.groupAlpha*r.worldAlpha}else t.worldTransform.copyFrom(e.localTransform),t.worldColor=e.localColor,s=e.localAlpha;s=s<0?0:s>1?1:s,t.worldAlpha=s,t.worldColorAlpha=t.worldColor+(255*s<<24)}(t);const s=t.childrenToUpdate,r=t.updateTick++;for(const e in s){const i=Number(e),n=s[e],a=n.list,o=n.index;for(let e=0;e<o;e++){const s=a[e];s.parentRenderGroup===t&&s.relativeRenderGroupDepth===i&&_(s,r,0)}f(a,o),n.index=0}if(e)for(let s=0;s<t.renderGroupChildren.length;s++)v(t.renderGroupChildren[s],e)}function _(t,e,s){if(e===t.updateTick)return;t.updateTick=e,t.didChange=!1;const r=t.localTransform;t.updateLocalTransform();const i=t.parent;if(i&&!i.renderGroup?(s|=t._updateFlags,t.relativeGroupTransform.appendFrom(r,i.relativeGroupTransform),s&y&&b(t,i,s)):(s=t._updateFlags,t.relativeGroupTransform.copyFrom(r),s&y&&b(t,x,s)),!t.renderGroup){const r=t.children,i=r.length;for(let t=0;t<i;t++)_(r[t],e,s);const n=t.parentRenderGroup,a=t;a.renderPipeId&&!n.structureDidChange&&n.updateRenderable(a)}}function b(t,e,s){if(s&m.ig){t.groupColor=(0,g.j)(t.localColor,e.groupColor);let s=t.localAlpha*e.groupAlpha;s=s<0?0:s>1?1:s,t.groupAlpha=s,t.groupColorAlpha=t.groupColor+(255*s<<24)}s&m.u&&(t.groupBlendMode="inherit"===t.localBlendMode?e.groupBlendMode:t.localBlendMode),s&m.fR&&(t.globalDisplayStatus=t.localDisplayStatus&e.globalDisplayStatus),t._updateFlags=0}const w=new n.u;class T{constructor(t){this._renderer=t}render({container:t,transform:e}){const s=t.parent,r=t.renderGroup.renderGroupParent;t.parent=null,t.renderGroup.renderGroupParent=null;const i=this._renderer,n=w;e&&(n.copyFrom(t.renderGroup.localTransform),t.renderGroup.localTransform.copyFrom(e));const a=i.renderPipes;this._updateCachedRenderGroups(t.renderGroup,null),this._updateRenderGroups(t.renderGroup),i.globalUniforms.start({worldTransformMatrix:e?t.renderGroup.localTransform:t.renderGroup.worldTransform,worldColor:t.renderGroup.worldColorAlpha}),l(t.renderGroup,a),a.uniformBatch&&a.uniformBatch.renderEnd(),e&&t.renderGroup.localTransform.copyFrom(n),t.parent=s,t.renderGroup.renderGroupParent=r}destroy(){this._renderer=null}_updateCachedRenderGroups(t,e){if(t._parentCacheAsTextureRenderGroup=e,t.isCachedAsTexture){if(!t.textureNeedsUpdate)return;e=t}for(let s=t.renderGroupChildren.length-1;s>=0;s--)this._updateCachedRenderGroups(t.renderGroupChildren[s],e);if(t.invalidateMatrices(),t.isCachedAsTexture){if(t.textureNeedsUpdate){const e=t.root.getLocalBounds();e.ceil();const s=t.texture;t.texture&&u.W.returnTexture(t.texture,!0);const r=this._renderer,i=t.textureOptions.resolution||r.view.resolution,n=t.textureOptions.antialias??r.view.antialias,a=t.textureOptions.scaleMode??"linear",o=u.W.getOptimalTexture(e.width,e.height,i,n);o._source.style=new d.n({scaleMode:a}),t.texture=o,t._textureBounds||(t._textureBounds=new p.c),t._textureBounds.copyFrom(e),s!==t.texture&&t.renderGroupParent&&(t.renderGroupParent.structureDidChange=!0)}}else t.texture&&(u.W.returnTexture(t.texture,!0),t.texture=null)}_updateRenderGroups(t){const e=this._renderer,s=e.renderPipes;if(t.runOnRender(e),t.instructionSet.renderPipes=s,t.structureDidChange?f(t.childrenRenderablesToUpdate.list,0):function(t,e){const{list:s,index:r}=t.childrenRenderablesToUpdate;let i=!1;for(let t=0;t<r;t++){const r=s[t];if(i=e[r.renderPipeId].validateRenderable(r),i)break}t.structureDidChange=i}(t,s),v(t),t.structureDidChange?(t.structureDidChange=!1,this._buildInstructions(t,e)):this._updateRenderables(t),t.childrenRenderablesToUpdate.index=0,e.renderPipes.batch.upload(t.instructionSet),!t.isCachedAsTexture||t.textureNeedsUpdate)for(let e=0;e<t.renderGroupChildren.length;e++)this._updateRenderGroups(t.renderGroupChildren[e])}_updateRenderables(t){const{list:e,index:s}=t.childrenRenderablesToUpdate;for(let r=0;r<s;r++){const s=e[r];s.didViewUpdate&&t.updateRenderable(s)}f(e,s)}_buildInstructions(t,e){const s=t.root,r=t.instructionSet;r.reset();const i=e.renderPipes?e:e.batch.renderer,n=i.renderPipes;n.batch.buildStart(r),n.blendMode.buildStart(),n.colorMask.buildStart(),s.sortableChildren&&s.sortChildren(),s.collectRenderablesWithEffects(r,i,null),n.batch.buildEnd(r),n.blendMode.buildEnd(r)}}T.extension={type:[r.Ag.WebGLSystem,r.Ag.WebGPUSystem,r.Ag.CanvasSystem],name:"renderGroup"};class S{constructor(t){this._renderer=t}addRenderable(t,e){const s=this._getGpuSprite(t);t.didViewUpdate&&this._updateBatchableSprite(t,s),this._renderer.renderPipes.batch.addToBatch(s,e)}updateRenderable(t){const e=this._getGpuSprite(t);t.didViewUpdate&&this._updateBatchableSprite(t,e),e._batcher.updateElement(e)}validateRenderable(t){const e=this._getGpuSprite(t);return!e._batcher.checkAndUpdateTexture(e,t._texture)}_updateBatchableSprite(t,e){e.bounds=t.visualBounds,e.texture=t._texture}_getGpuSprite(t){return t._gpuData[this._renderer.uid]||this._initGPUSprite(t)}_initGPUSprite(t){const e=new o.K;return e.renderable=t,e.transform=t.groupTransform,e.texture=t._texture,e.bounds=t.visualBounds,e.roundPixels=this._renderer._roundPixels|t._roundPixels,t._gpuData[this._renderer.uid]=e,e}destroy(){this._renderer=null}}S.extension={type:[r.Ag.WebGLPipes,r.Ag.WebGPUPipes,r.Ag.CanvasPipes],name:"sprite"},s(4872);const A="8.13.1";r.Ag.Application;class C{constructor(t){this._renderer=t}init(){globalThis.__PIXI_RENDERER_INIT__?.(this._renderer,A)}destroy(){this._renderer=null}}C.extension={type:[r.Ag.WebGLSystem,r.Ag.WebGPUSystem],name:"initHook",priority:-10};var P=s(7433),E=s(4404);const M=class t{constructor(t,e){this.state=P.U.for2d(),this._batchersByInstructionSet=Object.create(null),this._activeBatches=Object.create(null),this.renderer=t,this._adaptor=e,this._adaptor.init?.(this)}static getBatcher(t){return new this._availableBatchers[t]}buildStart(t){let e=this._batchersByInstructionSet[t.uid];e||(e=this._batchersByInstructionSet[t.uid]=Object.create(null),e.default||(e.default=new E.J({maxTextures:this.renderer.limits.maxBatchableTextures}))),this._activeBatches=e,this._activeBatch=this._activeBatches.default;for(const t in this._activeBatches)this._activeBatches[t].begin()}addToBatch(e,s){if(this._activeBatch.name!==e.batcherName){this._activeBatch.break(s);let r=this._activeBatches[e.batcherName];r||(r=this._activeBatches[e.batcherName]=t.getBatcher(e.batcherName),r.begin()),this._activeBatch=r}this._activeBatch.add(e)}break(t){this._activeBatch.break(t)}buildEnd(t){this._activeBatch.break(t);const e=this._activeBatches;for(const t in e){const s=e[t],r=s.geometry;r.indexBuffer.setDataWithSize(s.indexBuffer,s.indexSize,!0),r.buffers[0].setDataWithSize(s.attributeBuffer.float32View,s.attributeSize,!1)}}upload(t){const e=this._batchersByInstructionSet[t.uid];for(const t in e){const s=e[t],r=s.geometry;s.dirty&&(s.dirty=!1,r.buffers[0].update(4*s.attributeSize))}}execute(t){if("startBatch"===t.action){const e=t.batcher,s=e.geometry,r=e.shader;this._adaptor.start(this,s,r)}this._adaptor.execute(this,t)}destroy(){this.state=null,this.renderer=null,this._adaptor=null;for(const t in this._activeBatches)this._activeBatches[t].destroy();this._activeBatches=null}};M.extension={type:[r.Ag.WebGLPipes,r.Ag.WebGPUPipes,r.Ag.CanvasPipes],name:"batch"},M._availableBatchers=Object.create(null);let k=M;r.XO.handleByMap(r.Ag.Batcher,k._availableBatchers),r.XO.add(E.J);var R=s(4403),B=s(5007),I=s(1790),F=s(4449),D=s(1734),O=s(1657);const G=class t extends O.M{constructor(e){super(e={...t.defaultOptions,...e}),this.enabled=!0,this._state=P.U.for2d(),this.blendMode=e.blendMode,this.padding=e.padding,"boolean"==typeof e.antialias?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.clipToViewport=e.clipToViewport,this.addResource("uTexture",0,1)}apply(t,e,s,r){t.applyFilter(this,e,s,r)}get blendMode(){return this._state.blendMode}set blendMode(t){this._state.blendMode=t}static from(e){const{gpu:s,gl:r,...i}=e;let n,a;return s&&(n=I.B.from(s)),r&&(a=B.M.from(r)),new t({gpuProgram:n,glProgram:a,...i})}};G.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};let U=G;var L="struct GlobalFilterUniforms {\n uInputSize:vec4<f32>,\n uInputPixel:vec4<f32>,\n uInputClamp:vec4<f32>,\n uOutputFrame:vec4<f32>,\n uGlobalFrame:vec4<f32>,\n uOutputTexture:vec4<f32>,\n};\n\nstruct MaskUniforms {\n uFilterMatrix:mat3x3<f32>,\n uMaskClamp:vec4<f32>,\n uAlpha:f32,\n uInverse:f32,\n};\n\n@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms;\n@group(0) @binding(1) var uTexture: texture_2d<f32>;\n@group(0) @binding(2) var uSampler : sampler;\n\n@group(1) @binding(0) var<uniform> filterUniforms : MaskUniforms;\n@group(1) @binding(1) var uMaskTexture: texture_2d<f32>;\n\nstruct VSOutput {\n @builtin(position) position: vec4<f32>,\n @location(0) uv : vec2<f32>,\n @location(1) filterUv : vec2<f32>,\n};\n\nfn filterVertexPosition(aPosition:vec2<f32>) -> vec4<f32>\n{\n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;\n\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nfn filterTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);\n}\n\nfn globalTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw);\n}\n\nfn getFilterCoord(aPosition:vec2<f32> ) -> vec2<f32>\n{\n return ( filterUniforms.uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy;\n}\n\nfn getSize() -> vec2<f32>\n{\n return gfu.uGlobalFrame.zw;\n}\n\n@vertex\nfn mainVertex(\n @location(0) aPosition : vec2<f32>,\n) -> VSOutput {\n return VSOutput(\n filterVertexPosition(aPosition),\n filterTextureCoord(aPosition),\n getFilterCoord(aPosition)\n );\n}\n\n@fragment\nfn mainFragment(\n @location(0) uv: vec2<f32>,\n @location(1) filterUv: vec2<f32>,\n @builtin(position) position: vec4<f32>\n) -> @location(0) vec4<f32> {\n\n var maskClamp = filterUniforms.uMaskClamp;\n var uAlpha = filterUniforms.uAlpha;\n\n var clip = step(3.5,\n step(maskClamp.x, filterUv.x) +\n step(maskClamp.y, filterUv.y) +\n step(filterUv.x, maskClamp.z) +\n step(filterUv.y, maskClamp.w));\n\n var mask = textureSample(uMaskTexture, uSampler, filterUv);\n var source = textureSample(uTexture, uSampler, uv);\n var alphaMul = 1.0 - uAlpha * (1.0 - mask.a);\n\n var a: f32 = alphaMul * mask.r * uAlpha * clip;\n\n if (filterUniforms.uInverse == 1.0) {\n a = 1.0 - a;\n }\n\n return source * a;\n}\n";class N extends U{constructor(t){const{sprite:e,...s}=t,r=new D.N(e.texture),i=new F.k({uFilterMatrix:{value:new n.u,type:"mat3x3<f32>"},uMaskClamp:{value:r.uClampFrame,type:"vec4<f32>"},uAlpha:{value:1,type:"f32"},uInverse:{value:t.inverse?1:0,type:"f32"}});super({...s,gpuProgram:I.B.from({vertex:{source:L,entryPoint:"mainVertex"},fragment:{source:L,entryPoint:"mainFragment"}}),glProgram:B.M.from({vertex:"in vec2 aPosition;\n\nout vec2 vTextureCoord;\nout vec2 vMaskCoord;\n\n\nuniform vec4 uInputSize;\nuniform vec4 uOutputFrame;\nuniform vec4 uOutputTexture;\nuniform mat3 uFilterMatrix;\n\nvec4 filterVertexPosition( vec2 aPosition )\n{\n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;\n \n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;\n position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;\n\n return vec4(position, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( vec2 aPosition )\n{\n return aPosition * (uOutputFrame.zw * uInputSize.zw);\n}\n\nvec2 getFilterCoord( vec2 aPosition )\n{\n return ( uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy;\n} \n\nvoid main(void)\n{\n gl_Position = filterVertexPosition(aPosition);\n vTextureCoord = filterTextureCoord(aPosition);\n vMaskCoord = getFilterCoord(aPosition);\n}\n",fragment:"in vec2 vMaskCoord;\nin vec2 vTextureCoord;\n\nuniform sampler2D uTexture;\nuniform sampler2D uMaskTexture;\n\nuniform float uAlpha;\nuniform vec4 uMaskClamp;\nuniform float uInverse;\n\nout vec4 finalColor;\n\nvoid main(void)\n{\n float clip = step(3.5,\n step(uMaskClamp.x, vMaskCoord.x) +\n step(uMaskClamp.y, vMaskCoord.y) +\n step(vMaskCoord.x, uMaskClamp.z) +\n step(vMaskCoord.y, uMaskClamp.w));\n\n // TODO look into why this is needed\n float npmAlpha = uAlpha;\n vec4 original = texture(uTexture, vTextureCoord);\n vec4 masky = texture(uMaskTexture, vMaskCoord);\n float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\n\n float a = alphaMul * masky.r * npmAlpha * clip;\n\n if (uInverse == 1.0) {\n a = 1.0 - a;\n }\n\n finalColor = original * a;\n}\n",name:"mask-filter"}),clipToViewport:!1,resources:{filterUniforms:i,uMaskTexture:e.texture.source}}),this.sprite=e,this._textureMatrix=r}set inverse(t){this.resources.filterUniforms.uniforms.uInverse=t?1:0}get inverse(){return 1===this.resources.filterUniforms.uniforms.uInverse}apply(t,e,s,r){this._textureMatrix.texture=this.sprite.texture,t.calculateSpriteMatrix(this.resources.filterUniforms.uniforms.uFilterMatrix,this.sprite).prepend(this._textureMatrix.mapCoord),this.resources.uMaskTexture=this.sprite.texture.source,t.applyFilter(this,e,s,r)}}var X=s(9565),Y=s(4242),V=s(9739),z=s(5153);const W=new p.c;class H extends R.a{constructor(){super(),this.filters=[new N({sprite:new Y.k(V.g.EMPTY),inverse:!1,resolution:"inherit",antialias:"inherit"})]}get sprite(){return this.filters[0].sprite}set sprite(t){this.filters[0].sprite=t}get inverse(){return this.filters[0].inverse}set inverse(t){this.filters[0].inverse=t}}class j{constructor(t){this._activeMaskStage=[],this._renderer=t}push(t,e,s){const r=this._renderer;if(r.renderPipes.batch.break(s),s.add({renderPipeId:"alphaMask",action:"pushMaskBegin",mask:t,inverse:e._maskOptions.inverse,canBundle:!1,maskedContainer:e}),t.inverse=e._maskOptions.inverse,t.renderMaskToTexture){const e=t.mask;e.includeInBuild=!0,e.collectRenderables(s,r,null),e.includeInBuild=!1}r.renderPipes.batch.break(s),s.add({renderPipeId:"alphaMask",action:"pushMaskEnd",mask:t,maskedContainer:e,inverse:e._maskOptions.inverse,canBundle:!1})}pop(t,e,s){this._renderer.renderPipes.batch.break(s),s.add({renderPipeId:"alphaMask",action:"popMaskEnd",mask:t,inverse:e._maskOptions.inverse,canBundle:!1})}execute(t){const e=this._renderer,s=t.mask.renderMaskToTexture;if("pushMaskBegin"===t.action){const r=a.Z.get(H);if(r.inverse=t.inverse,s){t.mask.mask.measurable=!0;const s=(0,X.f)(t.mask.mask,!0,W);t.mask.mask.measurable=!1,s.ceil();const i=e.renderTarget.renderTarget.colorTexture.source,n=u.W.getOptimalTexture(s.width,s.height,i._resolution,i.antialias);e.renderTarget.push(n,!0),e.globalUniforms.push({offset:s,worldColor:4294967295});const a=r.sprite;a.texture=n,a.worldTransform.tx=s.minX,a.worldTransform.ty=s.minY,this._activeMaskStage.push({filterEffect:r,maskedContainer:t.maskedContainer,filterTexture:n})}else r.sprite=t.mask.mask,this._activeMaskStage.push({filterEffect:r,maskedContainer:t.maskedContainer})}else if("pushMaskEnd"===t.action){const t=this._activeMaskStage[this._activeMaskStage.length-1];s&&(e.type===z.W.WEBGL&&e.renderTarget.finishRenderPass(),e.renderTarget.pop(),e.globalUniforms.pop()),e.filter.push({renderPipeId:"filter",action:"pushFilter",container:t.maskedContainer,filterEffect:t.filterEffect,canBundle:!1})}else if("popMaskEnd"===t.action){e.filter.pop();const t=this._activeMaskStage.pop();s&&u.W.returnTexture(t.filterTexture),a.Z.return(t.filterEffect)}}destroy(){this._renderer=null,this._activeMaskStage=null}}j.extension={type:[r.Ag.WebGLPipes,r.Ag.WebGPUPipes,r.Ag.CanvasPipes],name:"alphaMask"};class q{constructor(t){this._colorStack=[],this._colorStackIndex=0,this._currentColor=0,this._renderer=t}buildStart(){this._colorStack[0]=15,this._colorStackIndex=1,this._currentColor=15}push(t,e,s){this._renderer.renderPipes.batch.break(s);const r=this._colorStack;r[this._colorStackIndex]=r[this._colorStackIndex-1]&t.mask;const i=this._colorStack[this._colorStackIndex];i!==this._currentColor&&(this._currentColor=i,s.add({renderPipeId:"colorMask",colorMask:i,canBundle:!1})),this._colorStackIndex++}pop(t,e,s){this._renderer.renderPipes.batch.break(s);const r=this._colorStack;this._colorStackIndex--;const i=r[this._colorStackIndex-1];i!==this._currentColor&&(this._currentColor=i,s.add({renderPipeId:"colorMask",colorMask:i,canBundle:!1}))}execute(t){this._renderer.colorMask.setMask(t.colorMask)}destroy(){this._renderer=null,this._colorStack=null}}q.extension={type:[r.Ag.WebGLPipes,r.Ag.WebGPUPipes,r.Ag.CanvasPipes],name:"colorMask"};var $=s(1711),K=s(8271);class Q{constructor(t){this._maskStackHash={},this._maskHash=new WeakMap,this._renderer=t}push(t,e,s){var r;const i=t,n=this._renderer;n.renderPipes.batch.break(s),n.renderPipes.blendMode.setBlendMode(i.mask,"none",s),s.add({renderPipeId:"stencilMask",action:"pushMaskBegin",mask:t,inverse:e._maskOptions.inverse,canBundle:!1});const a=i.mask;a.includeInBuild=!0,this._maskHash.has(i)||this._maskHash.set(i,{instructionsStart:0,instructionsLength:0});const o=this._maskHash.get(i);o.instructionsStart=s.instructionSize,a.collectRenderables(s,n,null),a.includeInBuild=!1,n.renderPipes.batch.break(s),s.add({renderPipeId:"stencilMask",action:"pushMaskEnd",mask:t,inverse:e._maskOptions.inverse,canBundle:!1});const l=s.instructionSize-o.instructionsStart-1;o.instructionsLength=l;const h=n.renderTarget.renderTarget.uid;(r=this._maskStackHash)[h]??(r[h]=0)}pop(t,e,s){const r=t,i=this._renderer;i.renderPipes.batch.break(s),i.renderPipes.blendMode.setBlendMode(r.mask,"none",s),s.add({renderPipeId:"stencilMask",action:"popMaskBegin",inverse:e._maskOptions.inverse,canBundle:!1});const n=this._maskHash.get(t);for(let t=0;t<n.instructionsLength;t++)s.instructions[s.instructionSize++]=s.instructions[n.instructionsStart++];s.add({renderPipeId:"stencilMask",action:"popMaskEnd",canBundle:!1})}execute(t){var e;const s=this._renderer,r=s.renderTarget.renderTarget.uid;let i=(e=this._maskStackHash)[r]??(e[r]=0);"pushMaskBegin"===t.action?(s.renderTarget.ensureDepthStencil(),s.stencil.setStencilMode(K.K.RENDERING_MASK_ADD,i),i++,s.colorMask.setMask(0)):"pushMaskEnd"===t.action?(t.inverse?s.stencil.setStencilMode(K.K.INVERSE_MASK_ACTIVE,i):s.stencil.setStencilMode(K.K.MASK_ACTIVE,i),s.colorMask.setMask(15)):"popMaskBegin"===t.action?(s.colorMask.setMask(0),0!==i?s.stencil.setStencilMode(K.K.RENDERING_MASK_REMOVE,i):(s.renderTarget.clear(null,$.u.STENCIL),s.stencil.setStencilMode(K.K.DISABLED,i)),i--):"popMaskEnd"===t.action&&(t.inverse?s.stencil.setStencilMode(K.K.INVERSE_MASK_ACTIVE,i):s.stencil.setStencilMode(K.K.MASK_ACTIVE,i),s.colorMask.setMask(15)),this._maskStackHash[r]=i}destroy(){this._renderer=null,this._maskStackHash=null,this._maskHash=null}}Q.extension={type:[r.Ag.WebGLPipes,r.Ag.WebGPUPipes,r.Ag.CanvasPipes],name:"stencilMask"};var Z=s(6675),J=s(7694);const tt=class t{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new Z.Q(0),this.color=this._backgroundColor,this.alpha=1}init(e){e={...t.defaultOptions,...e},this.clearBeforeRender=e.clearBeforeRender,this.color=e.background||e.backgroundColor||this._backgroundColor,this.alpha=e.backgroundAlpha,this._backgroundColor.setAlpha(e.backgroundAlpha)}get color(){return this._backgroundColor}set color(t){Z.Q.shared.setValue(t).alpha<1&&1===this._backgroundColor.alpha&&(0,J.R)("Cannot set a transparent background on an opaque canvas. To enable transparency, set backgroundAlpha < 1 when initializing your Application."),this._backgroundColor.setValue(t)}get alpha(){return this._backgroundColor.alpha}set alpha(t){this._backgroundColor.setAlpha(t)}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};tt.extension={type:[r.Ag.WebGLSystem,r.Ag.WebGPUSystem,r.Ag.CanvasSystem],name:"background",priority:0},tt.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0};let et=tt;var st=s(1422);const rt={};r.XO.handle(r.Ag.BlendMode,t=>{if(!t.name)throw new Error("BlendMode extension must have a name property");rt[t.name]=t.ref},t=>{delete rt[t.name]});class it{constructor(t){this._blendModeStack=[],this._isAdvanced=!1,this._filterHash=Object.create(null),this._renderer=t,this._renderer.runners.prerender.add(this)}prerender(){this._activeBlendMode="normal",this._isAdvanced=!1}pushBlendMode(t,e,s){this._blendModeStack.push(e),this.setBlendMode(t,e,s)}popBlendMode(t){this._blendModeStack.pop();const e=this._blendModeStack[this._activeBlendMode.length-1]??"normal";this.setBlendMode(null,e,t)}setBlendMode(t,e,s){const r=t instanceof st.m;this._activeBlendMode!==e?(this._isAdvanced&&this._endAdvancedBlendMode(s),this._activeBlendMode=e,t&&(this._isAdvanced=!!rt[e],this._isAdvanced&&this._beginAdvancedBlendMode(t,s))):this._isAdvanced&&t&&!r&&this._renderableList?.push(t)}_beginAdvancedBlendMode(t,e){this._renderer.renderPipes.batch.break(e);const s=this._activeBlendMode;if(!rt[s])return void(0,J.R)(`Unable to assign BlendMode: '${s}'. You may want to include: import 'pixi.js/advanced-blend-modes'`);const r=this._ensureFilterEffect(s),i=t instanceof st.m,n={renderPipeId:"filter",action:"pushFilter",filterEffect:r,renderables:i?null:[t],container:i?t.root:null,canBundle:!1};this._renderableList=n.renderables,e.add(n)}_ensureFilterEffect(t){let e=this._filterHash[t];return e||(e=this._filterHash[t]=new R.a,e.filters=[new rt[t]]),e}_endAdvancedBlendMode(t){this._isAdvanced=!1,this._renderableList=null,this._renderer.renderPipes.batch.break(t),t.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}buildStart(){this._isAdvanced=!1}buildEnd(t){this._isAdvanced&&this._endAdvancedBlendMode(t)}destroy(){this._renderer=null,this._renderableList=null;for(const t in this._filterHash)this._filterHash[t].destroy();this._filterHash=null}}it.extension={type:[r.Ag.WebGLPipes,r.Ag.WebGPUPipes,r.Ag.CanvasPipes],name:"blendMode"};var nt=s(5423);const at={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},ot=class t{constructor(t){this._renderer=t}_normalizeOptions(t,e={}){return t instanceof m.mc||t instanceof V.g?{target:t,...e}:{...e,...t}}async image(t){const e=nt.e.get().createImage();return e.src=await this.base64(t),e}async base64(e){e=this._normalizeOptions(e,t.defaultImageOptions);const{format:s,quality:r}=e,i=this.canvas(e);if(void 0!==i.toBlob)return new Promise((t,e)=>{i.toBlob(s=>{if(!s)return void e(new Error("ICanvas.toBlob failed!"));const r=new FileReader;r.onload=()=>t(r.result),r.onerror=e,r.readAsDataURL(s)},at[s],r)});if(void 0!==i.toDataURL)return i.toDataURL(at[s],r);if(void 0!==i.convertToBlob){const t=await i.convertToBlob({type:at[s],quality:r});return new Promise((e,s)=>{const r=new FileReader;r.onload=()=>e(r.result),r.onerror=s,r.readAsDataURL(t)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(t){const e=(t=this._normalizeOptions(t)).target,s=this._renderer;if(e instanceof V.g)return s.texture.generateCanvas(e);const r=s.textureGenerator.generateTexture(t),i=s.texture.generateCanvas(r);return r.destroy(!0),i}pixels(t){const e=(t=this._normalizeOptions(t)).target,s=this._renderer,r=e instanceof V.g?e:s.textureGenerator.generateTexture(t),i=s.texture.getPixels(r);return e instanceof m.mc&&r.destroy(!0),i}texture(t){return(t=this._normalizeOptions(t)).target instanceof V.g?t.target:this._renderer.textureGenerator.generateTexture(t)}download(t){t=this._normalizeOptions(t);const e=this.canvas(t),s=document.createElement("a");s.download=t.filename??"image.png",s.href=e.toDataURL("image/png"),document.body.appendChild(s),s.click(),document.body.removeChild(s)}log(t){const e=t.width??200;t=this._normalizeOptions(t);const s=this.canvas(t),r=s.toDataURL();console.log(`[Pixi Texture] ${s.width}px ${s.height}px`);const i=["font-size: 1px;",`padding: ${e}px 300px;`,`background: url(${r}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",i)}destroy(){this._renderer=null}};ot.extension={type:[r.Ag.WebGLSystem,r.Ag.WebGPUSystem],name:"extract"},ot.defaultImageOptions={format:"png",quality:1};let lt=ot;var ht=s(9390),ct=s(2071),ut=s(4269);class dt extends V.g{static create(t){return new dt({source:new ut.v(t)})}resize(t,e,s){return this.source.resize(t,e,s),this}}const pt=new ht.M,ft=new p.c,mt=[0,0,0,0];class gt{constructor(t){this._renderer=t}generateTexture(t){t instanceof m.mc&&(t={target:t,frame:void 0,textureSourceOptions:{},resolution:void 0});const e=t.resolution||this._renderer.resolution,s=t.antialias||this._renderer.view.antialias,r=t.target;let i=t.clearColor;i=i?Array.isArray(i)&&4===i.length?i:Z.Q.shared.setValue(i).toArray():mt;const a=t.frame?.copyTo(pt)||(0,ct.n)(r,ft).rectangle;a.width=0|Math.max(a.width,1/e),a.height=0|Math.max(a.height,1/e);const o=dt.create({...t.textureSourceOptions,width:a.width,height:a.height,resolution:e,antialias:s}),l=n.u.shared.translate(-a.x,-a.y);return this._renderer.render({container:r,transform:l,target:o,clearColor:i}),o.source.updateMipmaps(),o}destroy(){this._renderer=null}}gt.extension={type:[r.Ag.WebGLSystem,r.Ag.WebGPUSystem],name:"textureGenerator"};var xt=s(59),yt=s(9482),vt=s(3655);class _t{constructor(t){this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=t}reset(){this._stackIndex=0;for(let t=0;t<this._activeUniforms.length;t++)this._uniformsPool.push(this._activeUniforms[t]);for(let t=0;t<this._activeBindGroups.length;t++)this._bindGroupPool.push(this._activeBindGroups[t]);this._activeUniforms.length=0,this._activeBindGroups.length=0}start(t){this.reset(),this.push(t)}bind({size:t,projectionMatrix:e,worldTransformMatrix:s,worldColor:r,offset:i}){const a=this._renderer.renderTarget.renderTarget,o=this._stackIndex?this._globalUniformDataStack[this._stackIndex-1]:{projectionData:a,worldTransformMatrix:new n.u,worldColor:4294967295,offset:new xt.b},l={projectionMatrix:e||this._renderer.renderTarget.projectionMatrix,resolution:t||a.size,worldTransformMatrix:s||o.worldTransformMatrix,worldColor:r||o.worldColor,offset:i||o.offset,bindGroup:null},h=this._uniformsPool.pop()||this._createUniforms();this._activeUniforms.push(h);const c=h.uniforms;let u;c.uProjectionMatrix=l.projectionMatrix,c.uResolution=l.resolution,c.uWorldTransformMatrix.copyFrom(l.worldTransformMatrix),c.uWorldTransformMatrix.tx-=l.offset.x,c.uWorldTransformMatrix.ty-=l.offset.y,(0,yt.V)(l.worldColor,c.uWorldColorAlpha,0),h.update(),this._renderer.renderPipes.uniformBatch?u=this._renderer.renderPipes.uniformBatch.getUniformBindGroup(h,!1):(u=this._bindGroupPool.pop()||new vt.T,this._activeBindGroups.push(u),u.setResource(h,0)),l.bindGroup=u,this._currentGlobalUniformData=l}push(t){this.bind(t),this._globalUniformDataStack[this._stackIndex++]=this._currentGlobalUniformData}pop(){this._currentGlobalUniformData=this._globalUniformDataStack[--this._stackIndex-1],this._renderer.type===z.W.WEBGL&&this._currentGlobalUniformData.bindGroup.resources[0].update()}get bindGroup(){return this._currentGlobalUniformData.bindGroup}get globalUniformData(){return this._currentGlobalUniformData}get uniformGroup(){return this._currentGlobalUniformData.bindGroup.resources[0]}_createUniforms(){return new F.k({uProjectionMatrix:{value:new n.u,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new n.u,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:!0})}destroy(){this._renderer=null,this._globalUniformDataStack.length=0,this._uniformsPool.length=0,this._activeUniforms.length=0,this._bindGroupPool.length=0,this._activeBindGroups.length=0,this._currentGlobalUniformData=null}}_t.extension={type:[r.Ag.WebGLSystem,r.Ag.WebGPUSystem,r.Ag.CanvasSystem],name:"globalUniforms"};var bt=s(3651);let wt=1;class Tt{constructor(){this._tasks=[],this._offset=0}init(){bt.R.system.add(this._update,this)}repeat(t,e,s=!0){const r=wt++;let i=0;return s&&(this._offset+=1e3,i=this._offset),this._tasks.push({func:t,duration:e,start:performance.now(),offset:i,last:performance.now(),repeat:!0,id:r}),r}cancel(t){for(let e=0;e<this._tasks.length;e++)if(this._tasks[e].id===t)return void this._tasks.splice(e,1)}_update(){const t=performance.now();for(let e=0;e<this._tasks.length;e++){const s=this._tasks[e];if(t-s.offset-s.last>=s.duration){const e=t-s.start;s.func(e),s.last=t}}}destroy(){bt.R.system.remove(this._update,this),this._tasks.length=0}}Tt.extension={type:[r.Ag.WebGLSystem,r.Ag.WebGPUSystem,r.Ag.CanvasSystem],name:"scheduler",priority:0};let St=!1;class At{constructor(t){this._renderer=t}init(t){if(t.hello){let t=this._renderer.name;this._renderer.type===z.W.WEBGL&&(t+=` ${this._renderer.context.webGLVersion}`),function(t){if(!St){if(nt.e.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){const e=[`%c %c %c %c %c PixiJS %c v${A} (${t}) http://www.pixijs.com/\n\n`,"background: #E72264; padding:5px 0;","background: #6CA2EA; padding:5px 0;","background: #B5D33D; padding:5px 0;","background: #FED23F; padding:5px 0;","color: #FFFFFF; background: #E72264; padding:5px 0;","color: #E72264; background: #FFFFFF; padding:5px 0;"];globalThis.console.log(...e)}else globalThis.console&&globalThis.console.log(`PixiJS ${A} - ${t} - http://www.pixijs.com/`);St=!0}}(t)}}}function Ct(t){let e=!1;for(const s in t)if(null==t[s]){e=!0;break}if(!e)return t;const s=Object.create(null);for(const e in t){const r=t[e];r&&(s[e]=r)}return s}function Pt(t){let e=0;for(let s=0;s<t.length;s++)null==t[s]?e++:t[s-e]=t[s];return t.length-=e,t}At.extension={type:[r.Ag.WebGLSystem,r.Ag.WebGPUSystem,r.Ag.CanvasSystem],name:"hello",priority:-2},At.defaultOptions={hello:!1};let Et=0;const Mt=class t{constructor(t){this._managedRenderables=[],this._managedHashes=[],this._managedArrays=[],this._renderer=t}init(e){e={...t.defaultOptions,...e},this.maxUnusedTime=e.renderableGCMaxUnusedTime,this._frequency=e.renderableGCFrequency,this.enabled=e.renderableGCActive}get enabled(){return!!this._handler}set enabled(t){this.enabled!==t&&(t?(this._handler=this._renderer.scheduler.repeat(()=>this.run(),this._frequency,!1),this._hashHandler=this._renderer.scheduler.repeat(()=>{for(const t of this._managedHashes)t.context[t.hash]=Ct(t.context[t.hash])},this._frequency),this._arrayHandler=this._renderer.scheduler.repeat(()=>{for(const t of this._managedArrays)Pt(t.context[t.hash])},this._frequency)):(this._renderer.scheduler.cancel(this._handler),this._renderer.scheduler.cancel(this._hashHandler),this._renderer.scheduler.cancel(this._arrayHandler)))}addManagedHash(t,e){this._managedHashes.push({context:t,hash:e})}addManagedArray(t,e){this._managedArrays.push({context:t,hash:e})}prerender({container:t}){this._now=performance.now(),t.renderGroup.gcTick=Et++,this._updateInstructionGCTick(t.renderGroup,t.renderGroup.gcTick)}addRenderable(t){this.enabled&&(-1===t._lastUsed&&(this._managedRenderables.push(t),t.once("destroyed",this._removeRenderable,this)),t._lastUsed=this._now)}run(){const t=this._now,e=this._managedRenderables,s=this._renderer.renderPipes;let r=0;for(let i=0;i<e.length;i++){const n=e[i];if(null===n){r++;continue}const a=n.renderGroup??n.parentRenderGroup,o=a?.instructionSet?.gcTick??-1;if((a?.gcTick??0)===o&&(n._lastUsed=t),t-n._lastUsed>this.maxUnusedTime){if(!n.destroyed){const t=s;a&&(a.structureDidChange=!0),t[n.renderPipeId].destroyRenderable(n)}n._lastUsed=-1,r++,n.off("destroyed",this._removeRenderable,this)}else e[i-r]=n}e.length-=r}destroy(){this.enabled=!1,this._renderer=null,this._managedRenderables.length=0,this._managedHashes.length=0,this._managedArrays.length=0}_removeRenderable(t){const e=this._managedRenderables.indexOf(t);e>=0&&(t.off("destroyed",this._removeRenderable,this),this._managedRenderables[e]=null)}_updateInstructionGCTick(t,e){t.instructionSet.gcTick=e;for(const s of t.renderGroupChildren)this._updateInstructionGCTick(s,e)}};Mt.extension={type:[r.Ag.WebGLSystem,r.Ag.WebGPUSystem],name:"renderableGC",priority:0},Mt.defaultOptions={renderableGCActive:!0,renderableGCMaxUnusedTime:6e4,renderableGCFrequency:3e4};let kt=Mt;const Rt=class t{constructor(t){this._renderer=t,this.count=0,this.checkCount=0}init(e){e={...t.defaultOptions,...e},this.checkCountMax=e.textureGCCheckCountMax,this.maxIdle=e.textureGCAMaxIdle??e.textureGCMaxIdle,this.active=e.textureGCActive}postrender(){this._renderer.renderingToScreen&&(this.count++,this.active&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const t=this._renderer.texture.managedTextures;for(let e=0;e<t.length;e++){const s=t[e];s.autoGarbageCollect&&s.resource&&s._touched>-1&&this.count-s._touched>this.maxIdle&&(s._touched=-1,s.unload())}}destroy(){this._renderer=null}};Rt.extension={type:[r.Ag.WebGLSystem,r.Ag.WebGPUSystem],name:"textureGC"},Rt.defaultOptions={textureGCActive:!0,textureGCAMaxIdle:null,textureGCMaxIdle:3600,textureGCCheckCountMax:600};let Bt=Rt;var It=s(4696),Ft=s(2277),Dt=s(8955);const Ot=class t{get autoDensity(){return this.texture.source.autoDensity}set autoDensity(t){this.texture.source.autoDensity=t}get resolution(){return this.texture.source._resolution}set resolution(t){this.texture.source.resize(this.texture.source.width,this.texture.source.height,t)}init(e){(e={...t.defaultOptions,...e}).view&&((0,It.t6)(It.lj,"ViewSystem.view has been renamed to ViewSystem.canvas"),e.canvas=e.view),this.screen=new ht.M(0,0,e.width,e.height),this.canvas=e.canvas||nt.e.get().createCanvas(),this.antialias=!!e.antialias,this.texture=(0,Dt.c)(this.canvas,e),this.renderTarget=new Ft.O({colorTextures:[this.texture],depth:!!e.depth,isRoot:!0}),this.texture.source.transparent=e.backgroundAlpha<1,this.resolution=e.resolution}resize(t,e,s){this.texture.source.resize(t,e,s),this.screen.width=this.texture.frame.width,this.screen.height=this.texture.frame.height}destroy(t=!1){("boolean"==typeof t?t:!!t?.removeView)&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.texture.destroy()}};Ot.extension={type:[r.Ag.WebGLSystem,r.Ag.WebGPUSystem,r.Ag.CanvasSystem],name:"view",priority:0},Ot.defaultOptions={width:800,height:600,autoDensity:!1,antialias:!1};const Gt=[et,_t,At,Ot,T,Bt,gt,lt,C,kt,Tt],Ut=[it,k,S,c,j,Q,q,i]},1711:(t,e,s)=>{"use strict";s.d(e,{u:()=>r});var r=(t=>(t[t.NONE=0]="NONE",t[t.COLOR=16384]="COLOR",t[t.STENCIL=1024]="STENCIL",t[t.DEPTH=256]="DEPTH",t[t.COLOR_DEPTH=16640]="COLOR_DEPTH",t[t.COLOR_STENCIL=17408]="COLOR_STENCIL",t[t.DEPTH_STENCIL=1280]="DEPTH_STENCIL",t[t.ALL=17664]="ALL",t))(r||{})},1734:(t,e,s)=>{"use strict";s.d(e,{N:()=>n});var r=s(5199);const i=new r.u;class n{constructor(t,e){this.mapCoord=new r.u,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===e?t.width<10?0:.5:e,this.isSimple=!1,this.texture=t}get texture(){return this._texture}set texture(t){this.texture!==t&&(this._texture?.removeListener("update",this.update,this),this._texture=t,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(t,e){void 0===e&&(e=t);const s=this.mapCoord;for(let r=0;r<t.length;r+=2){const i=t[r],n=t[r+1];e[r]=i*s.a+n*s.c+s.tx,e[r+1]=i*s.b+n*s.d+s.ty}return e}update(){const t=this._texture;this._updateID++;const e=t.uvs;this.mapCoord.set(e.x1-e.x0,e.y1-e.y0,e.x3-e.x0,e.y3-e.y0,e.x0,e.y0);const s=t.orig,r=t.trim;r&&(i.set(s.width/r.width,0,0,s.height/r.height,-r.x/r.width,-r.y/r.height),this.mapCoord.append(i));const n=t.source,a=this.uClampFrame,o=this.clampMargin/n._resolution,l=this.clampOffset/n._resolution;return a[0]=(t.frame.x+o+l)/n.width,a[1]=(t.frame.y+o+l)/n.height,a[2]=(t.frame.x+t.frame.width-o+l)/n.width,a[3]=(t.frame.y+t.frame.height-o+l)/n.height,this.uClampOffset[0]=this.clampOffset/n.pixelWidth,this.uClampOffset[1]=this.clampOffset/n.pixelHeight,this.isSimple=t.frame.width===n.width&&t.frame.height===n.height&&0===t.rotate,!0}}},1753:(t,e,s)=>{"use strict";s.d(e,{L:()=>r});const r={_registeredResources:new Set,register(t){this._registeredResources.add(t)},unregister(t){this._registeredResources.delete(t)},release(){this._registeredResources.forEach(t=>t.clear())},get registeredCount(){return this._registeredResources.size},isRegistered(t){return this._registeredResources.has(t)},reset(){this._registeredResources.clear()}}},1790:(t,e,s)=>{"use strict";s.d(e,{B:()=>h});var r=s(8642),i=s(4988);const n={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"};function a(t){const e=/@group\((\d+)\)/,s=/@binding\((\d+)\)/,r=/var(<[^>]+>)? (\w+)/,i=/:\s*(\w+)/,n=/(\w+)\s*:\s*([\w\<\>]+)/g,a=/struct\s+(\w+)/,o=t.match(/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g)?.map(t=>({group:parseInt(t.match(e)[1],10),binding:parseInt(t.match(s)[1],10),name:t.match(r)[2],isUniform:"<uniform>"===t.match(r)[1],type:t.match(i)[1]}));if(!o)return{groups:[],structs:[]};const l=t.match(/struct\s+(\w+)\s*{([^}]+)}/g)?.map(t=>{const e=t.match(a)[1],s=t.match(n).reduce((t,e)=>{const[s,r]=e.split(":");return t[s.trim()]=r.trim(),t},{});return s?{name:e,members:s}:null}).filter(({name:t})=>o.some(e=>e.type===t))??[];return{groups:o,structs:l}}var o=(t=>(t[t.VERTEX=1]="VERTEX",t[t.FRAGMENT=2]="FRAGMENT",t[t.COMPUTE=4]="COMPUTE",t))(o||{});const l=Object.create(null);class h{constructor(t){this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:e,vertex:s,layout:r,gpuLayout:i,name:n}=t;if(this.name=n,this.fragment=e,this.vertex=s,e.source===s.source){const t=a(e.source);this.structsAndGroups=t}else{const t=a(s.source),r=a(e.source);this.structsAndGroups=function(t,e){const s=new Set,r=new Set;return{structs:[...t.structs,...e.structs].filter(t=>!s.has(t.name)&&(s.add(t.name),!0)),groups:[...t.groups,...e.groups].filter(t=>{const e=`${t.name}-${t.binding}`;return!r.has(e)&&(r.add(e),!0)})}}(t,r)}this.layout=r??function({groups:t}){const e=[];for(let s=0;s<t.length;s++){const r=t[s];e[r.group]||(e[r.group]={}),e[r.group][r.name]=r.binding}return e}(this.structsAndGroups),this.gpuLayout=i??function({groups:t}){const e=[];for(let s=0;s<t.length;s++){const r=t[s];e[r.group]||(e[r.group]=[]),r.isUniform?e[r.group].push({binding:r.binding,visibility:o.VERTEX|o.FRAGMENT,buffer:{type:"uniform"}}):"sampler"===r.type?e[r.group].push({binding:r.binding,visibility:o.FRAGMENT,sampler:{type:"filtering"}}):"texture_2d"===r.type&&e[r.group].push({binding:r.binding,visibility:o.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}})}return e}(this.structsAndGroups),this.autoAssignGlobalUniforms=!(void 0===this.layout[0]?.globalUniforms),this.autoAssignLocalUniforms=!(void 0===this.layout[1]?.localUniforms),this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:e}=this,s=t.source+e.source+t.entryPoint+e.entryPoint;this._layoutKey=(0,r.X)(s,"program")}get attributeData(){return this._attributeData??(this._attributeData=function({source:t,entryPoint:e}){const s={},r=t.indexOf(`fn ${e}`);if(-1!==r){const e=t.indexOf("->",r);if(-1!==e){const a=t.substring(r,e),o=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|$)/g;let l;for(;null!==(l=o.exec(a));){const t=n[l[3]]??"float32";s[l[2]]={location:parseInt(l[1],10),format:t,stride:(0,i.m)(t).stride,offset:0,instance:!1,start:0}}}}return s}(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,l[this._cacheKey]=null}static from(t){const e=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return l[e]||(l[e]=new h(t),l[e]._cacheKey=e),l[e]}}},1886:(t,e,s)=>{"use strict";s.d(e,{K:()=>a});var r=s(7761),i=s(6793);class n extends i.a{async doLoad(t){const e=(async()=>{const e=await fetch(t);if(!e.ok)return void console.error(`Failed to load audio data: ${t}`);const s=await e.arrayBuffer();try{const e=await r.es.decodeAudioData(s);if(this.loadingPromises.delete(t),this.hasActiveRef(t)){if(!this.cachedAssets.has(t))return this.cachedAssets.set(t,e),e;console.error(`Audio buffer already exists: ${t}`)}}catch(e){console.error(`Failed to decode audio data: ${t}`,e),this.loadingPromises.delete(t)}})();return this.loadingPromises.set(t,e),await e}}const a=new n},1984:(t,e,s)=>{"use strict";s.d(e,{$4:()=>X,$l:()=>b,Di:()=>C,EP:()=>A,Ev:()=>E,GU:()=>g,I6:()=>U,Kf:()=>c,Kn:()=>I,Ms:()=>V,NQ:()=>f,So:()=>v,Sr:()=>m,To:()=>D,UJ:()=>z,X5:()=>l,_Y:()=>P,eP:()=>T,fT:()=>M,g:()=>W,hd:()=>S,i9:()=>y,jQ:()=>R,jx:()=>w,lJ:()=>j,lP:()=>q,mj:()=>i,nS:()=>x,oc:()=>N,pA:()=>F,pR:()=>_,qU:()=>r,qs:()=>B,vl:()=>G,vz:()=>O,yJ:()=>H,yz:()=>Y,zK:()=>k});var r,i,n=s(4382),a=s(1347),o=s(646);class l{name;timelines=[];timelineIds=new a.eE;duration;constructor(t,e,s){if(!t)throw new Error("name cannot be null.");this.name=t,this.setTimelines(e),this.duration=s}setTimelines(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e<t.length;e++)this.timelineIds.addAll(t[e].getPropertyIds())}hasTimeline(t){for(let e=0;e<t.length;e++)if(this.timelineIds.contains(t[e]))return!0;return!1}apply(t,e,s,r,i,n,a,o){if(!t)throw new Error("skeleton cannot be null.");r&&0!=this.duration&&(s%=this.duration,e>0&&(e%=this.duration));let l=this.timelines;for(let r=0,h=l.length;r<h;r++)l[r].apply(t,e,s,i,n,a,o)}}!function(t){t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add"}(r||(r={})),function(t){t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut"}(i||(i={}));const h={rotate:0,x:1,y:2,scaleX:3,scaleY:4,shearX:5,shearY:6,inherit:7,rgb:8,alpha:9,rgb2:10,attachment:11,deform:12,event:13,drawOrder:14,ikConstraint:15,transformConstraint:16,pathConstraintPosition:17,pathConstraintSpacing:18,pathConstraintMix:19,physicsConstraintInertia:20,physicsConstraintStrength:21,physicsConstraintDamping:22,physicsConstraintMass:23,physicsConstraintWind:24,physicsConstraintGravity:25,physicsConstraintMix:26,physicsConstraintReset:27,sequence:28};class c{propertyIds;frames;constructor(t,e){this.propertyIds=e,this.frames=a.Aq.newFloatArray(t*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(t,e){let s=t.length;for(let r=1;r<s;r++)if(t[r]>e)return r-1;return s-1}static search(t,e,s){let r=t.length;for(let i=s;i<r;i+=s)if(t[i]>e)return i-s;return r-s}}class u extends c{curves;constructor(t,e,s){super(t,s),this.curves=a.Aq.newFloatArray(t+18*e),this.curves[t-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(t){let e=this.getFrameCount()+18*t;if(this.curves.length>e){let t=a.Aq.newFloatArray(e);a.Aq.arrayCopy(this.curves,0,t,0,e),this.curves=t}}setBezier(t,e,s,r,i,n,a,o,l,h,c){let u=this.curves,d=this.getFrameCount()+18*t;0==s&&(u[e]=2+d);let p=.03*(r-2*n+o),f=.03*(i-2*a+l),m=.006*(3*(n-o)-r+h),g=.006*(3*(a-l)-i+c),x=2*p+m,y=2*f+g,v=.3*(n-r)+p+.16666667*m,_=.3*(a-i)+f+.16666667*g,b=r+v,w=i+_;for(let t=d+18;d<t;d+=2)u[d]=b,u[d+1]=w,v+=x,_+=y,x+=m,y+=g,b+=v,w+=_}getBezierValue(t,e,s,r){let i=this.curves;if(i[r]>t){let n=this.frames[e],a=this.frames[e+s];return a+(t-n)/(i[r]-n)*(i[r+1]-a)}let n=r+18;for(r+=2;r<n;r+=2)if(i[r]>=t){let e=i[r-2],s=i[r-1];return s+(t-e)/(i[r]-e)*(i[r+1]-s)}e+=this.getFrameEntries();let a=i[n-2],o=i[n-1];return o+(t-a)/(this.frames[e]-a)*(this.frames[e+s]-o)}}class d extends u{constructor(t,e,s){super(t,e,[s])}getFrameEntries(){return 2}setFrame(t,e,s){t<<=1,this.frames[t]=e,this.frames[t+1]=s}getCurveValue(t){let e=this.frames,s=e.length-2;for(let r=2;r<=s;r+=2)if(e[r]>t){s=r-2;break}let r=this.curves[s>>1];switch(r){case 0:let r=e[s],i=e[s+1];return i+(t-r)/(e[s+2]-r)*(e[s+2+1]-i);case 1:return e[s+1]}return this.getBezierValue(t,s,1,r-2)}getRelativeValue(t,e,s,i,n){if(t<this.frames[0]){switch(s){case r.setup:return n;case r.first:return i+(n-i)*e}return i}let a=this.getCurveValue(t);switch(s){case r.setup:return n+a*e;case r.first:case r.replace:a+=n-i}return i+a*e}getAbsoluteValue(t,e,s,i,n){if(t<this.frames[0]){switch(s){case r.setup:return n;case r.first:return i+(n-i)*e}return i}let a=this.getCurveValue(t);return s==r.setup?n+(a-n)*e:i+(a-i)*e}getAbsoluteValue2(t,e,s,i,n,a){if(t<this.frames[0]){switch(s){case r.setup:return n;case r.first:return i+(n-i)*e}return i}return s==r.setup?n+(a-n)*e:i+(a-i)*e}getScaleValue(t,e,s,n,o,l){if(t<this.frames[0]){switch(s){case r.setup:return l;case r.first:return o+(l-o)*e}return o}let h=this.getCurveValue(t)*l;if(1==e)return s==r.add?o+h-l:h;if(n==i.mixOut)switch(s){case r.setup:return l+(Math.abs(h)*a.cj.signum(l)-l)*e;case r.first:case r.replace:return o+(Math.abs(h)*a.cj.signum(o)-o)*e}else{let t=0;switch(s){case r.setup:return t=Math.abs(l)*a.cj.signum(h),t+(h-t)*e;case r.first:case r.replace:return t=Math.abs(o)*a.cj.signum(h),t+(h-t)*e}}return o+(h-l)*e}}class p extends u{constructor(t,e,s,r){super(t,e,[s,r])}getFrameEntries(){return 3}setFrame(t,e,s,r){t*=3,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=r}}class f extends d{boneIndex=0;constructor(t,e,s){super(t,e,h.rotate+"|"+s),this.boneIndex=s}apply(t,e,s,r,i,n,a){let o=t.bones[this.boneIndex];o.active&&(o.rotation=this.getRelativeValue(s,i,n,o.rotation,o.data.rotation))}}class m extends p{boneIndex=0;constructor(t,e,s){super(t,e,h.x+"|"+s,h.y+"|"+s),this.boneIndex=s}apply(t,e,s,i,n,a,o){let l=t.bones[this.boneIndex];if(!l.active)return;let h=this.frames;if(s<h[0]){switch(a){case r.setup:return l.x=l.data.x,void(l.y=l.data.y);case r.first:l.x+=(l.data.x-l.x)*n,l.y+=(l.data.y-l.y)*n}return}let u=0,d=0,p=c.search(h,s,3),f=this.curves[p/3];switch(f){case 0:let t=h[p];u=h[p+1],d=h[p+2];let e=(s-t)/(h[p+3]-t);u+=(h[p+3+1]-u)*e,d+=(h[p+3+2]-d)*e;break;case 1:u=h[p+1],d=h[p+2];break;default:u=this.getBezierValue(s,p,1,f-2),d=this.getBezierValue(s,p,2,f+18-2)}switch(a){case r.setup:l.x=l.data.x+u*n,l.y=l.data.y+d*n;break;case r.first:case r.replace:l.x+=(l.data.x+u-l.x)*n,l.y+=(l.data.y+d-l.y)*n;break;case r.add:l.x+=u*n,l.y+=d*n}}}class g extends d{boneIndex=0;constructor(t,e,s){super(t,e,h.x+"|"+s),this.boneIndex=s}apply(t,e,s,r,i,n,a){let o=t.bones[this.boneIndex];o.active&&(o.x=this.getRelativeValue(s,i,n,o.x,o.data.x))}}class x extends d{boneIndex=0;constructor(t,e,s){super(t,e,h.y+"|"+s),this.boneIndex=s}apply(t,e,s,r,i,n,a){let o=t.bones[this.boneIndex];o.active&&(o.y=this.getRelativeValue(s,i,n,o.y,o.data.y))}}class y extends p{boneIndex=0;constructor(t,e,s){super(t,e,h.scaleX+"|"+s,h.scaleY+"|"+s),this.boneIndex=s}apply(t,e,s,n,o,l,h){let u=t.bones[this.boneIndex];if(!u.active)return;let d,p,f=this.frames;if(s<f[0]){switch(l){case r.setup:return u.scaleX=u.data.scaleX,void(u.scaleY=u.data.scaleY);case r.first:u.scaleX+=(u.data.scaleX-u.scaleX)*o,u.scaleY+=(u.data.scaleY-u.scaleY)*o}return}let m=c.search(f,s,3),g=this.curves[m/3];switch(g){case 0:let t=f[m];d=f[m+1],p=f[m+2];let e=(s-t)/(f[m+3]-t);d+=(f[m+3+1]-d)*e,p+=(f[m+3+2]-p)*e;break;case 1:d=f[m+1],p=f[m+2];break;default:d=this.getBezierValue(s,m,1,g-2),p=this.getBezierValue(s,m,2,g+18-2)}if(d*=u.data.scaleX,p*=u.data.scaleY,1==o)l==r.add?(u.scaleX+=d-u.data.scaleX,u.scaleY+=p-u.data.scaleY):(u.scaleX=d,u.scaleY=p);else{let t=0,e=0;if(h==i.mixOut)switch(l){case r.setup:t=u.data.scaleX,e=u.data.scaleY,u.scaleX=t+(Math.abs(d)*a.cj.signum(t)-t)*o,u.scaleY=e+(Math.abs(p)*a.cj.signum(e)-e)*o;break;case r.first:case r.replace:t=u.scaleX,e=u.scaleY,u.scaleX=t+(Math.abs(d)*a.cj.signum(t)-t)*o,u.scaleY=e+(Math.abs(p)*a.cj.signum(e)-e)*o;break;case r.add:u.scaleX+=(d-u.data.scaleX)*o,u.scaleY+=(p-u.data.scaleY)*o}else switch(l){case r.setup:t=Math.abs(u.data.scaleX)*a.cj.signum(d),e=Math.abs(u.data.scaleY)*a.cj.signum(p),u.scaleX=t+(d-t)*o,u.scaleY=e+(p-e)*o;break;case r.first:case r.replace:t=Math.abs(u.scaleX)*a.cj.signum(d),e=Math.abs(u.scaleY)*a.cj.signum(p),u.scaleX=t+(d-t)*o,u.scaleY=e+(p-e)*o;break;case r.add:u.scaleX+=(d-u.data.scaleX)*o,u.scaleY+=(p-u.data.scaleY)*o}}}}class v extends d{boneIndex=0;constructor(t,e,s){super(t,e,h.scaleX+"|"+s),this.boneIndex=s}apply(t,e,s,r,i,n,a){let o=t.bones[this.boneIndex];o.active&&(o.scaleX=this.getScaleValue(s,i,n,a,o.scaleX,o.data.scaleX))}}class _ extends d{boneIndex=0;constructor(t,e,s){super(t,e,h.scaleY+"|"+s),this.boneIndex=s}apply(t,e,s,r,i,n,a){let o=t.bones[this.boneIndex];o.active&&(o.scaleY=this.getScaleValue(s,i,n,a,o.scaleY,o.data.scaleY))}}class b extends p{boneIndex=0;constructor(t,e,s){super(t,e,h.shearX+"|"+s,h.shearY+"|"+s),this.boneIndex=s}apply(t,e,s,i,n,a,o){let l=t.bones[this.boneIndex];if(!l.active)return;let h=this.frames;if(s<h[0]){switch(a){case r.setup:return l.shearX=l.data.shearX,void(l.shearY=l.data.shearY);case r.first:l.shearX+=(l.data.shearX-l.shearX)*n,l.shearY+=(l.data.shearY-l.shearY)*n}return}let u=0,d=0,p=c.search(h,s,3),f=this.curves[p/3];switch(f){case 0:let t=h[p];u=h[p+1],d=h[p+2];let e=(s-t)/(h[p+3]-t);u+=(h[p+3+1]-u)*e,d+=(h[p+3+2]-d)*e;break;case 1:u=h[p+1],d=h[p+2];break;default:u=this.getBezierValue(s,p,1,f-2),d=this.getBezierValue(s,p,2,f+18-2)}switch(a){case r.setup:l.shearX=l.data.shearX+u*n,l.shearY=l.data.shearY+d*n;break;case r.first:case r.replace:l.shearX+=(l.data.shearX+u-l.shearX)*n,l.shearY+=(l.data.shearY+d-l.shearY)*n;break;case r.add:l.shearX+=u*n,l.shearY+=d*n}}}class w extends d{boneIndex=0;constructor(t,e,s){super(t,e,h.shearX+"|"+s),this.boneIndex=s}apply(t,e,s,r,i,n,a){let o=t.bones[this.boneIndex];o.active&&(o.shearX=this.getRelativeValue(s,i,n,o.shearX,o.data.shearX))}}class T extends d{boneIndex=0;constructor(t,e,s){super(t,e,h.shearY+"|"+s),this.boneIndex=s}apply(t,e,s,r,i,n,a){let o=t.bones[this.boneIndex];o.active&&(o.shearY=this.getRelativeValue(s,i,n,o.shearY,o.data.shearY))}}class S extends c{boneIndex=0;constructor(t,e){super(t,[h.inherit+"|"+e]),this.boneIndex=e}getFrameEntries(){return 2}setFrame(t,e,s){t*=2,this.frames[t]=e,this.frames[t+1]=s}apply(t,e,s,n,a,o,l){let h=t.bones[this.boneIndex];if(!h.active)return;if(l==i.mixOut)return void(o==r.setup&&(h.inherit=h.data.inherit));let u=this.frames;s<u[0]?o!=r.setup&&o!=r.first||(h.inherit=h.data.inherit):h.inherit=this.frames[c.search(u,s,2)+1]}}class A extends u{slotIndex=0;constructor(t,e,s){super(t,e,[h.rgb+"|"+s,h.alpha+"|"+s]),this.slotIndex=s}getFrameEntries(){return 5}setFrame(t,e,s,r,i,n){t*=5,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=r,this.frames[t+3]=i,this.frames[t+4]=n}apply(t,e,s,i,n,a,o){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=this.frames,u=l.color;if(s<h[0]){let t=l.data.color;switch(a){case r.setup:return void u.setFromColor(t);case r.first:u.add((t.r-u.r)*n,(t.g-u.g)*n,(t.b-u.b)*n,(t.a-u.a)*n)}return}let d=0,p=0,f=0,m=0,g=c.search(h,s,5),x=this.curves[g/5];switch(x){case 0:let t=h[g];d=h[g+1],p=h[g+2],f=h[g+3],m=h[g+4];let e=(s-t)/(h[g+5]-t);d+=(h[g+5+1]-d)*e,p+=(h[g+5+2]-p)*e,f+=(h[g+5+3]-f)*e,m+=(h[g+5+4]-m)*e;break;case 1:d=h[g+1],p=h[g+2],f=h[g+3],m=h[g+4];break;default:d=this.getBezierValue(s,g,1,x-2),p=this.getBezierValue(s,g,2,x+18-2),f=this.getBezierValue(s,g,3,x+36-2),m=this.getBezierValue(s,g,4,x+54-2)}1==n?u.set(d,p,f,m):(a==r.setup&&u.setFromColor(l.data.color),u.add((d-u.r)*n,(p-u.g)*n,(f-u.b)*n,(m-u.a)*n))}}class C extends u{slotIndex=0;constructor(t,e,s){super(t,e,[h.rgb+"|"+s]),this.slotIndex=s}getFrameEntries(){return 4}setFrame(t,e,s,r,i){t<<=2,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=r,this.frames[t+3]=i}apply(t,e,s,i,n,a,o){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=this.frames,u=l.color;if(s<h[0]){let t=l.data.color;switch(a){case r.setup:return u.r=t.r,u.g=t.g,void(u.b=t.b);case r.first:u.r+=(t.r-u.r)*n,u.g+=(t.g-u.g)*n,u.b+=(t.b-u.b)*n}return}let d=0,p=0,f=0,m=c.search(h,s,4),g=this.curves[m>>2];switch(g){case 0:let t=h[m];d=h[m+1],p=h[m+2],f=h[m+3];let e=(s-t)/(h[m+4]-t);d+=(h[m+4+1]-d)*e,p+=(h[m+4+2]-p)*e,f+=(h[m+4+3]-f)*e;break;case 1:d=h[m+1],p=h[m+2],f=h[m+3];break;default:d=this.getBezierValue(s,m,1,g-2),p=this.getBezierValue(s,m,2,g+18-2),f=this.getBezierValue(s,m,3,g+36-2)}if(1==n)u.r=d,u.g=p,u.b=f;else{if(a==r.setup){let t=l.data.color;u.r=t.r,u.g=t.g,u.b=t.b}u.r+=(d-u.r)*n,u.g+=(p-u.g)*n,u.b+=(f-u.b)*n}}}class P extends d{slotIndex=0;constructor(t,e,s){super(t,e,h.alpha+"|"+s),this.slotIndex=s}apply(t,e,s,i,n,a,o){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=l.color;if(s<this.frames[0]){let t=l.data.color;switch(a){case r.setup:return void(h.a=t.a);case r.first:h.a+=(t.a-h.a)*n}return}let c=this.getCurveValue(s);1==n?h.a=c:(a==r.setup&&(h.a=l.data.color.a),h.a+=(c-h.a)*n)}}class E extends u{slotIndex=0;constructor(t,e,s){super(t,e,[h.rgb+"|"+s,h.alpha+"|"+s,h.rgb2+"|"+s]),this.slotIndex=s}getFrameEntries(){return 8}setFrame(t,e,s,r,i,n,a,o,l){t<<=3,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=r,this.frames[t+3]=i,this.frames[t+4]=n,this.frames[t+5]=a,this.frames[t+6]=o,this.frames[t+7]=l}apply(t,e,s,i,n,a,o){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=this.frames,u=l.color,d=l.darkColor;if(s<h[0]){let t=l.data.color,e=l.data.darkColor;switch(a){case r.setup:return u.setFromColor(t),d.r=e.r,d.g=e.g,void(d.b=e.b);case r.first:u.add((t.r-u.r)*n,(t.g-u.g)*n,(t.b-u.b)*n,(t.a-u.a)*n),d.r+=(e.r-d.r)*n,d.g+=(e.g-d.g)*n,d.b+=(e.b-d.b)*n}return}let p=0,f=0,m=0,g=0,x=0,y=0,v=0,_=c.search(h,s,8),b=this.curves[_>>3];switch(b){case 0:let t=h[_];p=h[_+1],f=h[_+2],m=h[_+3],g=h[_+4],x=h[_+5],y=h[_+6],v=h[_+7];let e=(s-t)/(h[_+8]-t);p+=(h[_+8+1]-p)*e,f+=(h[_+8+2]-f)*e,m+=(h[_+8+3]-m)*e,g+=(h[_+8+4]-g)*e,x+=(h[_+8+5]-x)*e,y+=(h[_+8+6]-y)*e,v+=(h[_+8+7]-v)*e;break;case 1:p=h[_+1],f=h[_+2],m=h[_+3],g=h[_+4],x=h[_+5],y=h[_+6],v=h[_+7];break;default:p=this.getBezierValue(s,_,1,b-2),f=this.getBezierValue(s,_,2,b+18-2),m=this.getBezierValue(s,_,3,b+36-2),g=this.getBezierValue(s,_,4,b+54-2),x=this.getBezierValue(s,_,5,b+72-2),y=this.getBezierValue(s,_,6,b+90-2),v=this.getBezierValue(s,_,7,b+108-2)}if(1==n)u.set(p,f,m,g),d.r=x,d.g=y,d.b=v;else{if(a==r.setup){u.setFromColor(l.data.color);let t=l.data.darkColor;d.r=t.r,d.g=t.g,d.b=t.b}u.add((p-u.r)*n,(f-u.g)*n,(m-u.b)*n,(g-u.a)*n),d.r+=(x-d.r)*n,d.g+=(y-d.g)*n,d.b+=(v-d.b)*n}}}class M extends u{slotIndex=0;constructor(t,e,s){super(t,e,[h.rgb+"|"+s,h.rgb2+"|"+s]),this.slotIndex=s}getFrameEntries(){return 7}setFrame(t,e,s,r,i,n,a,o){t*=7,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=r,this.frames[t+3]=i,this.frames[t+4]=n,this.frames[t+5]=a,this.frames[t+6]=o}apply(t,e,s,i,n,a,o){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=this.frames,u=l.color,d=l.darkColor;if(s<h[0]){let t=l.data.color,e=l.data.darkColor;switch(a){case r.setup:return u.r=t.r,u.g=t.g,u.b=t.b,d.r=e.r,d.g=e.g,void(d.b=e.b);case r.first:u.r+=(t.r-u.r)*n,u.g+=(t.g-u.g)*n,u.b+=(t.b-u.b)*n,d.r+=(e.r-d.r)*n,d.g+=(e.g-d.g)*n,d.b+=(e.b-d.b)*n}return}let p=0,f=0,m=0,g=0,x=0,y=0,v=c.search(h,s,7),_=this.curves[v/7];switch(_){case 0:let t=h[v];p=h[v+1],f=h[v+2],m=h[v+3],g=h[v+4],x=h[v+5],y=h[v+6];let e=(s-t)/(h[v+7]-t);p+=(h[v+7+1]-p)*e,f+=(h[v+7+2]-f)*e,m+=(h[v+7+3]-m)*e,g+=(h[v+7+4]-g)*e,x+=(h[v+7+5]-x)*e,y+=(h[v+7+6]-y)*e;break;case 1:p=h[v+1],f=h[v+2],m=h[v+3],g=h[v+4],x=h[v+5],y=h[v+6];break;default:p=this.getBezierValue(s,v,1,_-2),f=this.getBezierValue(s,v,2,_+18-2),m=this.getBezierValue(s,v,3,_+36-2),g=this.getBezierValue(s,v,4,_+54-2),x=this.getBezierValue(s,v,5,_+72-2),y=this.getBezierValue(s,v,6,_+90-2)}if(1==n)u.r=p,u.g=f,u.b=m,d.r=g,d.g=x,d.b=y;else{if(a==r.setup){let t=l.data.color,e=l.data.darkColor;u.r=t.r,u.g=t.g,u.b=t.b,d.r=e.r,d.g=e.g,d.b=e.b}u.r+=(p-u.r)*n,u.g+=(f-u.g)*n,u.b+=(m-u.b)*n,d.r+=(g-d.r)*n,d.g+=(x-d.g)*n,d.b+=(y-d.b)*n}}}class k extends c{slotIndex=0;attachmentNames;constructor(t,e){super(t,[h.attachment+"|"+e]),this.slotIndex=e,this.attachmentNames=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,s){this.frames[t]=e,this.attachmentNames[t]=s}apply(t,e,s,n,a,o,l){let h=t.slots[this.slotIndex];h.bone.active&&(l!=i.mixOut?s<this.frames[0]?o!=r.setup&&o!=r.first||this.setAttachment(t,h,h.data.attachmentName):this.setAttachment(t,h,this.attachmentNames[c.search1(this.frames,s)]):o==r.setup&&this.setAttachment(t,h,h.data.attachmentName))}setAttachment(t,e,s){e.setAttachment(s?t.getAttachment(this.slotIndex,s):null)}}class R extends u{slotIndex=0;attachment;vertices;constructor(t,e,s,r){super(t,e,[h.deform+"|"+s+"|"+r.id]),this.slotIndex=s,this.attachment=r,this.vertices=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,s){this.frames[t]=e,this.vertices[t]=s}setBezier(t,e,s,r,i,n,a,o,l,h,c){let u=this.curves,d=this.getFrameCount()+18*t;0==s&&(u[e]=2+d);let p=.03*(r-2*n+o),f=.03*l-.06*a,m=.006*(3*(n-o)-r+h),g=.018*(a-l+.33333333),x=2*p+m,y=2*f+g,v=.3*(n-r)+p+.16666667*m,_=.3*a+f+.16666667*g,b=r+v,w=_;for(let t=d+18;d<t;d+=2)u[d]=b,u[d+1]=w,v+=x,_+=y,x+=m,y+=g,b+=v,w+=_}getCurvePercent(t,e){let s=this.curves,r=s[e];switch(r){case 0:let s=this.frames[e];return(t-s)/(this.frames[e+this.getFrameEntries()]-s);case 1:return 0}if(r-=2,s[r]>t){let i=this.frames[e];return s[r+1]*(t-i)/(s[r]-i)}let i=r+18;for(r+=2;r<i;r+=2)if(s[r]>=t){let e=s[r-2],i=s[r-1];return i+(t-e)/(s[r]-e)*(s[r+1]-i)}let n=s[i-2],a=s[i-1];return a+(1-a)*(t-n)/(this.frames[e+this.getFrameEntries()]-n)}apply(t,e,s,i,o,l,h){let u=t.slots[this.slotIndex];if(!u.bone.active)return;let d=u.getAttachment();if(!d)return;if(!(d instanceof n.e)||d.timelineAttachment!=this.attachment)return;let p=u.deform;0==p.length&&(l=r.setup);let f=this.vertices,m=f[0].length,g=this.frames;if(s<g[0]){switch(l){case r.setup:return void(p.length=0);case r.first:if(1==o)return void(p.length=0);p.length=m;let t=d;if(t.bones)for(o=1-o,x=0;x<m;x++)p[x]*=o;else{let e=t.vertices;for(var x=0;x<m;x++)p[x]+=(e[x]-p[x])*o}}return}if(p.length=m,s>=g[g.length-1]){let t=f[g.length-1];if(1==o)if(l==r.add){let e=d;if(e.bones)for(let e=0;e<m;e++)p[e]+=t[e];else{let s=e.vertices;for(let e=0;e<m;e++)p[e]+=t[e]-s[e]}}else a.Aq.arrayCopy(t,0,p,0,m);else switch(l){case r.setup:{let e=d;if(e.bones)for(let e=0;e<m;e++)p[e]=t[e]*o;else{let s=e.vertices;for(let e=0;e<m;e++){let r=s[e];p[e]=r+(t[e]-r)*o}}break}case r.first:case r.replace:for(let e=0;e<m;e++)p[e]+=(t[e]-p[e])*o;break;case r.add:let e=d;if(e.bones)for(let e=0;e<m;e++)p[e]+=t[e]*o;else{let s=e.vertices;for(let e=0;e<m;e++)p[e]+=(t[e]-s[e])*o}}return}let y=c.search1(g,s),v=this.getCurvePercent(s,y),_=f[y],b=f[y+1];if(1==o)if(l==r.add){let t=d;if(t.bones)for(let t=0;t<m;t++){let e=_[t];p[t]+=e+(b[t]-e)*v}else{let e=t.vertices;for(let t=0;t<m;t++){let s=_[t];p[t]+=s+(b[t]-s)*v-e[t]}}}else for(let t=0;t<m;t++){let e=_[t];p[t]=e+(b[t]-e)*v}else switch(l){case r.setup:{let t=d;if(t.bones)for(let t=0;t<m;t++){let e=_[t];p[t]=(e+(b[t]-e)*v)*o}else{let e=t.vertices;for(let t=0;t<m;t++){let s=_[t],r=e[t];p[t]=r+(s+(b[t]-s)*v-r)*o}}break}case r.first:case r.replace:for(let t=0;t<m;t++){let e=_[t];p[t]+=(e+(b[t]-e)*v-p[t])*o}break;case r.add:let t=d;if(t.bones)for(let t=0;t<m;t++){let e=_[t];p[t]+=(e+(b[t]-e)*v)*o}else{let e=t.vertices;for(let t=0;t<m;t++){let s=_[t];p[t]+=(s+(b[t]-s)*v-e[t])*o}}}}}class B extends c{static propertyIds=[""+h.event];events;constructor(t){super(t,B.propertyIds),this.events=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e){this.frames[t]=e.time,this.events[t]=e}apply(t,e,s,r,i,n,a){if(!r)return;let o=this.frames,l=this.frames.length;if(e>s)this.apply(t,e,Number.MAX_VALUE,r,i,n,a),e=-1;else if(e>=o[l-1])return;if(s<o[0])return;let h=0;if(e<o[0])h=0;else{h=c.search1(o,e)+1;let t=o[h];for(;h>0&&o[h-1]==t;)h--}for(;h<l&&s>=o[h];h++)r.push(this.events[h])}}class I extends c{static propertyIds=[""+h.drawOrder];drawOrders;constructor(t){super(t,I.propertyIds),this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,s){this.frames[t]=e,this.drawOrders[t]=s}apply(t,e,s,n,o,l,h){if(h==i.mixOut)return void(l==r.setup&&a.Aq.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length));if(s<this.frames[0])return void(l!=r.setup&&l!=r.first||a.Aq.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length));let u=c.search1(this.frames,s),d=this.drawOrders[u];if(d){let e=t.drawOrder,s=t.slots;for(let t=0,r=d.length;t<r;t++)e[t]=s[d[t]]}else a.Aq.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length)}}class F extends u{constraintIndex=0;constructor(t,e,s){super(t,e,[h.ikConstraint+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 6}setFrame(t,e,s,r,i,n,a){t*=6,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=r,this.frames[t+3]=i,this.frames[t+4]=n?1:0,this.frames[t+5]=a?1:0}apply(t,e,s,n,a,o,l){let h=t.ikConstraints[this.constraintIndex];if(!h.active)return;let u=this.frames;if(s<u[0]){switch(o){case r.setup:return h.mix=h.data.mix,h.softness=h.data.softness,h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,void(h.stretch=h.data.stretch);case r.first:h.mix+=(h.data.mix-h.mix)*a,h.softness+=(h.data.softness-h.softness)*a,h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch}return}let d=0,p=0,f=c.search(u,s,6),m=this.curves[f/6];switch(m){case 0:let t=u[f];d=u[f+1],p=u[f+2];let e=(s-t)/(u[f+6]-t);d+=(u[f+6+1]-d)*e,p+=(u[f+6+2]-p)*e;break;case 1:d=u[f+1],p=u[f+2];break;default:d=this.getBezierValue(s,f,1,m-2),p=this.getBezierValue(s,f,2,m+18-2)}o==r.setup?(h.mix=h.data.mix+(d-h.data.mix)*a,h.softness=h.data.softness+(p-h.data.softness)*a,l==i.mixOut?(h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch):(h.bendDirection=u[f+3],h.compress=0!=u[f+4],h.stretch=0!=u[f+5])):(h.mix+=(d-h.mix)*a,h.softness+=(p-h.softness)*a,l==i.mixIn&&(h.bendDirection=u[f+3],h.compress=0!=u[f+4],h.stretch=0!=u[f+5]))}}class D extends u{constraintIndex=0;constructor(t,e,s){super(t,e,[h.transformConstraint+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 7}setFrame(t,e,s,r,i,n,a,o){let l=this.frames;l[t*=7]=e,l[t+1]=s,l[t+2]=r,l[t+3]=i,l[t+4]=n,l[t+5]=a,l[t+6]=o}apply(t,e,s,i,n,a,o){let l=t.transformConstraints[this.constraintIndex];if(!l.active)return;let h,u,d,p,f,m,g=this.frames;if(s<g[0]){let t=l.data;switch(a){case r.setup:return l.mixRotate=t.mixRotate,l.mixX=t.mixX,l.mixY=t.mixY,l.mixScaleX=t.mixScaleX,l.mixScaleY=t.mixScaleY,void(l.mixShearY=t.mixShearY);case r.first:l.mixRotate+=(t.mixRotate-l.mixRotate)*n,l.mixX+=(t.mixX-l.mixX)*n,l.mixY+=(t.mixY-l.mixY)*n,l.mixScaleX+=(t.mixScaleX-l.mixScaleX)*n,l.mixScaleY+=(t.mixScaleY-l.mixScaleY)*n,l.mixShearY+=(t.mixShearY-l.mixShearY)*n}return}let x=c.search(g,s,7),y=this.curves[x/7];switch(y){case 0:let t=g[x];h=g[x+1],u=g[x+2],d=g[x+3],p=g[x+4],f=g[x+5],m=g[x+6];let e=(s-t)/(g[x+7]-t);h+=(g[x+7+1]-h)*e,u+=(g[x+7+2]-u)*e,d+=(g[x+7+3]-d)*e,p+=(g[x+7+4]-p)*e,f+=(g[x+7+5]-f)*e,m+=(g[x+7+6]-m)*e;break;case 1:h=g[x+1],u=g[x+2],d=g[x+3],p=g[x+4],f=g[x+5],m=g[x+6];break;default:h=this.getBezierValue(s,x,1,y-2),u=this.getBezierValue(s,x,2,y+18-2),d=this.getBezierValue(s,x,3,y+36-2),p=this.getBezierValue(s,x,4,y+54-2),f=this.getBezierValue(s,x,5,y+72-2),m=this.getBezierValue(s,x,6,y+90-2)}if(a==r.setup){let t=l.data;l.mixRotate=t.mixRotate+(h-t.mixRotate)*n,l.mixX=t.mixX+(u-t.mixX)*n,l.mixY=t.mixY+(d-t.mixY)*n,l.mixScaleX=t.mixScaleX+(p-t.mixScaleX)*n,l.mixScaleY=t.mixScaleY+(f-t.mixScaleY)*n,l.mixShearY=t.mixShearY+(m-t.mixShearY)*n}else l.mixRotate+=(h-l.mixRotate)*n,l.mixX+=(u-l.mixX)*n,l.mixY+=(d-l.mixY)*n,l.mixScaleX+=(p-l.mixScaleX)*n,l.mixScaleY+=(f-l.mixScaleY)*n,l.mixShearY+=(m-l.mixShearY)*n}}class O extends d{constraintIndex=0;constructor(t,e,s){super(t,e,h.pathConstraintPosition+"|"+s),this.constraintIndex=s}apply(t,e,s,r,i,n,a){let o=t.pathConstraints[this.constraintIndex];o.active&&(o.position=this.getAbsoluteValue(s,i,n,o.position,o.data.position))}}class G extends d{constraintIndex=0;constructor(t,e,s){super(t,e,h.pathConstraintSpacing+"|"+s),this.constraintIndex=s}apply(t,e,s,r,i,n,a){let o=t.pathConstraints[this.constraintIndex];o.active&&(o.spacing=this.getAbsoluteValue(s,i,n,o.spacing,o.data.spacing))}}class U extends u{constraintIndex=0;constructor(t,e,s){super(t,e,[h.pathConstraintMix+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 4}setFrame(t,e,s,r,i){let n=this.frames;n[t<<=2]=e,n[t+1]=s,n[t+2]=r,n[t+3]=i}apply(t,e,s,i,n,a,o){let l=t.pathConstraints[this.constraintIndex];if(!l.active)return;let h,u,d,p=this.frames;if(s<p[0]){switch(a){case r.setup:return l.mixRotate=l.data.mixRotate,l.mixX=l.data.mixX,void(l.mixY=l.data.mixY);case r.first:l.mixRotate+=(l.data.mixRotate-l.mixRotate)*n,l.mixX+=(l.data.mixX-l.mixX)*n,l.mixY+=(l.data.mixY-l.mixY)*n}return}let f=c.search(p,s,4),m=this.curves[f>>2];switch(m){case 0:let t=p[f];h=p[f+1],u=p[f+2],d=p[f+3];let e=(s-t)/(p[f+4]-t);h+=(p[f+4+1]-h)*e,u+=(p[f+4+2]-u)*e,d+=(p[f+4+3]-d)*e;break;case 1:h=p[f+1],u=p[f+2],d=p[f+3];break;default:h=this.getBezierValue(s,f,1,m-2),u=this.getBezierValue(s,f,2,m+18-2),d=this.getBezierValue(s,f,3,m+36-2)}if(a==r.setup){let t=l.data;l.mixRotate=t.mixRotate+(h-t.mixRotate)*n,l.mixX=t.mixX+(u-t.mixX)*n,l.mixY=t.mixY+(d-t.mixY)*n}else l.mixRotate+=(h-l.mixRotate)*n,l.mixX+=(u-l.mixX)*n,l.mixY+=(d-l.mixY)*n}}class L extends d{constraintIndex=0;constructor(t,e,s,r){super(t,e,r+"|"+s),this.constraintIndex=s}apply(t,e,s,r,i,n,a){let o;if(-1==this.constraintIndex){const e=s>=this.frames[0]?this.getCurveValue(s):0;for(const r of t.physicsConstraints)r.active&&this.global(r.data)&&this.set(r,this.getAbsoluteValue2(s,i,n,this.get(r),this.setup(r),e))}else o=t.physicsConstraints[this.constraintIndex],o.active&&this.set(o,this.getAbsoluteValue(s,i,n,this.get(o),this.setup(o)))}}class N extends L{constructor(t,e,s){super(t,e,s,h.physicsConstraintInertia)}setup(t){return t.data.inertia}get(t){return t.inertia}set(t,e){t.inertia=e}global(t){return t.inertiaGlobal}}class X extends L{constructor(t,e,s){super(t,e,s,h.physicsConstraintStrength)}setup(t){return t.data.strength}get(t){return t.strength}set(t,e){t.strength=e}global(t){return t.strengthGlobal}}class Y extends L{constructor(t,e,s){super(t,e,s,h.physicsConstraintDamping)}setup(t){return t.data.damping}get(t){return t.damping}set(t,e){t.damping=e}global(t){return t.dampingGlobal}}class V extends L{constructor(t,e,s){super(t,e,s,h.physicsConstraintMass)}setup(t){return 1/t.data.massInverse}get(t){return 1/t.massInverse}set(t,e){t.massInverse=1/e}global(t){return t.massGlobal}}class z extends L{constructor(t,e,s){super(t,e,s,h.physicsConstraintWind)}setup(t){return t.data.wind}get(t){return t.wind}set(t,e){t.wind=e}global(t){return t.windGlobal}}class W extends L{constructor(t,e,s){super(t,e,s,h.physicsConstraintGravity)}setup(t){return t.data.gravity}get(t){return t.gravity}set(t,e){t.gravity=e}global(t){return t.gravityGlobal}}class H extends L{constructor(t,e,s){super(t,e,s,h.physicsConstraintMix)}setup(t){return t.data.mix}get(t){return t.mix}set(t,e){t.mix=e}global(t){return t.mixGlobal}}class j extends c{static propertyIds=[h.physicsConstraintReset.toString()];constraintIndex;constructor(t,e){super(t,j.propertyIds),this.constraintIndex=e}getFrameCount(){return this.frames.length}setFrame(t,e){this.frames[t]=e}apply(t,e,s,r,i,n,a){let o;if(-1!=this.constraintIndex&&(o=t.physicsConstraints[this.constraintIndex],!o.active))return;const l=this.frames;if(e>s)this.apply(t,e,Number.MAX_VALUE,[],i,n,a),e=-1;else if(e>=l[l.length-1])return;if(!(s<l[0])&&(e<l[0]||s>=l[c.search1(l,e)+1]))if(null!=o)o.reset();else for(const e of t.physicsConstraints)e.active&&e.reset()}}class q extends c{static ENTRIES=3;static MODE=1;static DELAY=2;slotIndex;attachment;constructor(t,e,s){super(t,[h.sequence+"|"+e+"|"+s.sequence.id]),this.slotIndex=e,this.attachment=s}getFrameEntries(){return q.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,e,s,r,i){let n=this.frames;n[t*=q.ENTRIES]=e,n[t+q.MODE]=s|r<<4,n[t+q.DELAY]=i}apply(t,e,s,a,l,h,u){let d=t.slots[this.slotIndex];if(!d.bone.active)return;let p=d.attachment,f=this.attachment;if(!(p==f||p instanceof n.e&&p.timelineAttachment==f))return;if(u==i.mixOut)return void(h==r.setup&&(d.sequenceIndex=-1));let m=this.frames;if(s<m[0])return void(h!=r.setup&&h!=r.first||(d.sequenceIndex=-1));let g=c.search(m,s,q.ENTRIES),x=m[g],y=m[g+q.MODE],v=m[g+q.DELAY];if(!this.attachment.sequence)return;let _=y>>4,b=this.attachment.sequence.regions.length,w=o.l8[15&y];if(w!=o.zu.hold)switch(_+=(s-x)/v+1e-5|0,w){case o.zu.once:_=Math.min(b-1,_);break;case o.zu.loop:_%=b;break;case o.zu.pingpong:{let t=(b<<1)-2;_=0==t?0:_%t,_>=b&&(_=t-_);break}case o.zu.onceReverse:_=Math.max(b-1-_,0);break;case o.zu.loopReverse:_=b-1-_%b;break;case o.zu.pingpongReverse:{let t=(b<<1)-2;_=0==t?0:(_+b-1)%t,_>=b&&(_=t-_)}}d.sequenceIndex=_}}},1990:(t,e,s)=>{"use strict";s.d(e,{r:()=>c});var r=s(6675),i=s(5199),n=s(9739),a=s(7694),o=s(6406),l=s(9776);const h=1e5;function c(t,e,s,c=0){if(t.texture===n.g.WHITE&&!t.fill)return r.Q.shared.setValue(t.color).setAlpha(t.alpha??1).toHexa();if(!t.fill){const s=e.createPattern(t.texture.source.resource,"repeat"),r=t.matrix.copyTo(i.u.shared);return r.scale(t.texture.frame.width,t.texture.frame.height),s.setTransform(r),s}if(t.fill instanceof l.m){const s=t.fill,r=e.createPattern(s.texture.source.resource,"repeat"),n=s.transform.copyTo(i.u.shared);return n.scale(s.texture.frame.width,s.texture.frame.height),r.setTransform(n),r}if(t.fill instanceof o._){const i=t.fill,n="linear"===i.type,a="local"===i.textureSpace;let o,l=1,u=1;a&&s&&(l=s.width+c,u=s.height+c);let d=!1;if(n){const{start:t,end:s}=i;o=e.createLinearGradient(t.x*l,t.y*u,s.x*l,s.y*u),d=Math.abs(s.x-t.x)<Math.abs(.1*(s.y-t.y))}else{const{center:t,innerRadius:s,outerCenter:r,outerRadius:n}=i;o=e.createRadialGradient(t.x*l,t.y*u,s*l,r.x*l,r.y*u,n*l)}if(d&&a&&s){const t=s.lineHeight/u;for(let e=0;e<s.lines.length;e++){const n=(e*s.lineHeight+c/2)/u;i.colorStops.forEach(e=>{const s=n+e.offset*t;o.addColorStop(Math.floor(s*h)/h,r.Q.shared.setValue(e.color).toHex())})}}else i.colorStops.forEach(t=>{o.addColorStop(t.offset,r.Q.shared.setValue(t.color).toHex())});return o}return(0,a.R)("FillStyle not recognised",t),"red"}},2015:(t,e,s)=>{"use strict";s.d(e,{d:()=>n});var r=s(4872),i=s(9375);class n extends r.A{constructor({buffer:t,offset:e,size:s}){super(),this.uid=(0,i.L)("buffer"),this._resourceType="bufferResource",this._touched=0,this._resourceId=(0,i.L)("resource"),this._bufferResource=!0,this.destroyed=!1,this.buffer=t,this.offset=0|e,this.size=s,this.buffer.on("change",this.onBufferChange,this)}onBufferChange(){this._resourceId=(0,i.L)("resource"),this.emit("change",this)}destroy(t=!1){this.destroyed=!0,t&&this.buffer.destroy(),this.emit("change",this),this.buffer=null}}},2027:(t,e,s)=>{"use strict";s.d(e,{x:()=>h});var r=s(7694),i=s(8869),n=s(8064);function a(t,e,s,r,i){const n=e[s];for(let o=0;o<n.length;o++){const l=n[o];s<e.length-1?a(t.replace(r[s],l),e,s+1,r,i):i.push(t.replace(r[s],l))}}function o(t){const e=t.match(/\{(.*?)\}/g),s=[];if(e){const r=[];e.forEach(t=>{const e=t.substring(1,t.length-1).split(",");r.push(e)}),a(t,r,0,e,s)}else s.push(t);return s}var l=s(2843);class h{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,"bar"!==this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar")))throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach(t=>{this._preferredOrder.push(t),t.priority||(t.priority=Object.keys(t.params))}),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if("string"==typeof t)this._defaultSearchParams=t;else{const e=t;this._defaultSearchParams=Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}}getAlias(t){const{alias:e,src:s}=t;return(0,n.z)(e||s,t=>"string"==typeof t?t:Array.isArray(t)?t.map(t=>t?.src??t):t?.src?t.src:t,!0)}addManifest(t){this._manifest&&(0,r.R)("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(t=>{this.addBundle(t.name,t.assets)})}addBundle(t,e){const s=[];let r=e;Array.isArray(e)||(r=Object.entries(e).map(([t,e])=>"string"==typeof e||Array.isArray(e)?{alias:t,src:e}:{alias:t,...e})),r.forEach(e=>{const r=e.src,i=e.alias;let n;if("string"==typeof i){const e=this._createBundleAssetId(t,i);s.push(e),n=[i,e]}else{const e=i.map(e=>this._createBundleAssetId(t,e));s.push(...e),n=[...i,...e]}this.add({...e,alias:n,src:r})}),this._bundles[t]=s}add(t){const e=[];let s;Array.isArray(t)?e.push(...t):e.push(t),s=t=>{this.hasKey(t)&&(0,r.R)(`[Resolver] already has key: ${t} overwriting`)},(0,n.z)(e).forEach(t=>{const{src:e}=t;let{data:r,format:i,loadParser:a,parser:l}=t;const h=(0,n.z)(e).map(t=>"string"==typeof t?o(t):Array.isArray(t)?t:[t]),c=this.getAlias(t);Array.isArray(c)?c.forEach(s):s(c);const u=[];h.forEach(t=>{t.forEach(t=>{let e={};if("object"!=typeof t){e.src=t;for(let s=0;s<this._parsers.length;s++){const r=this._parsers[s];if(r.test(t)){e=r.parse(t);break}}}else r=t.data??r,i=t.format??i,(t.loadParser||t.parser)&&(a=t.loadParser??a,l=t.parser??l),e={...e,...t};if(!c)throw new Error(`[Resolver] alias is undefined for this asset: ${e.src}`);e=this._buildResolvedAsset(e,{aliases:c,data:r,format:i,loadParser:a,parser:l}),u.push(e)})}),c.forEach(t=>{this._assetMap[t]=u})})}resolveBundle(t){const e=(0,l.a)(t);t=(0,n.z)(t);const s={};return t.forEach(t=>{const e=this._bundles[t];if(e){const r=this.resolve(e),i={};for(const e in r){const s=r[e];i[this._extractAssetIdFromBundle(t,e)]=s}s[t]=i}}),e?s[t[0]]:s}resolveUrl(t){const e=this.resolve(t);if("string"!=typeof t){const t={};for(const s in e)t[s]=e[s].src;return t}return e.src}resolve(t){const e=(0,l.a)(t);t=(0,n.z)(t);const s={};return t.forEach(t=>{if(!this._resolverHash[t])if(this._assetMap[t]){let e=this._assetMap[t];const s=this._getPreferredOrder(e);s?.priority.forEach(t=>{s.params[t].forEach(s=>{const r=e.filter(e=>!!e[t]&&e[t]===s);r.length&&(e=r)})}),this._resolverHash[t]=e[0]}else this._resolverHash[t]=this._buildResolvedAsset({alias:[t],src:t},{});s[t]=this._resolverHash[t]}),e?s[t[0]]:s}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;e<t.length;e++){const s=t[e],r=this._preferredOrder.find(t=>t.params.format.includes(s.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(t){return this._defaultSearchParams?`${t}${/\?/.test(t)?"&":"?"}${this._defaultSearchParams}`:t}_buildResolvedAsset(t,e){const{aliases:s,data:r,loadParser:n,parser:a,format:o}=e;return(this._basePath||this._rootPath)&&(t.src=i.A.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=s??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...r||{},...t.data},t.loadParser=n??t.loadParser,t.parser=a??t.parser,t.format=o??t.format??t.src.split(".").pop().split("?").shift().split("#").shift(),t}}h.RETINA_PREFIX=/@([0-9\.]+)x/},2043:(t,e,s)=>{"use strict";s.d(e,{z:()=>o});var r=s(9390),i=s(4269),n=s(9739);const a=class t{constructor(t,e){this.linkedSheets=[];let s=t;t?.source instanceof i.v&&(s={texture:t,data:e});const{texture:r,data:a,cachePrefix:o=""}=s;this.cachePrefix=o,this._texture=r instanceof n.g?r:null,this.textureSource=r.source,this.textures={},this.animations={},this.data=a;const l=parseFloat(a.meta.scale);l?(this.resolution=l,r.source.resolution=this.resolution):this.resolution=r.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=t.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(e){let s=e;const i=t.BATCH_SIZE;for(;s-e<i&&s<this._frameKeys.length;){const t=this._frameKeys[s],e=this._frames[t],i=e.frame;if(i){let s=null,a=null;const o=!1!==e.trimmed&&e.sourceSize?e.sourceSize:e.frame,l=new r.M(0,0,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution);s=e.rotated?new r.M(Math.floor(i.x)/this.resolution,Math.floor(i.y)/this.resolution,Math.floor(i.h)/this.resolution,Math.floor(i.w)/this.resolution):new r.M(Math.floor(i.x)/this.resolution,Math.floor(i.y)/this.resolution,Math.floor(i.w)/this.resolution,Math.floor(i.h)/this.resolution),!1!==e.trimmed&&e.spriteSourceSize&&(a=new r.M(Math.floor(e.spriteSourceSize.x)/this.resolution,Math.floor(e.spriteSourceSize.y)/this.resolution,Math.floor(i.w)/this.resolution,Math.floor(i.h)/this.resolution)),this.textures[t]=new n.g({source:this.textureSource,frame:s,orig:l,trim:a,rotate:e.rotated?2:0,defaultAnchor:e.anchor,defaultBorders:e.borders,label:t.toString()})}s++}}_processAnimations(){const t=this.data.animations||{};for(const e in t){this.animations[e]=[];for(let s=0;s<t[e].length;s++){const r=t[e][s];this.animations[e].push(this.textures[r])}}}_parseComplete(){const t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*t.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*t.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(t=!1){for(const t in this.textures)this.textures[t].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&(this._texture?.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};a.BATCH_SIZE=1e3;let o=a},2071:(t,e,s)=>{"use strict";s.d(e,{n:()=>n});var r=s(5199),i=s(7882);function n(t,e,s){return e.clear(),s||(s=r.u.IDENTITY),a(t,e,s,t,!0),e.isValid||e.set(0,0,0,0),e}function a(t,e,s,n,o){let l;if(o)l=i.u.get(),l=s.copyTo(l);else{if(!t.visible||!t.measurable)return;t.updateLocalTransform();const e=t.localTransform;l=i.u.get(),l.appendFrom(e,s)}const h=e,c=!!t.effects.length;if(c&&(e=i.o.get().clear()),t.boundsArea)e.addRect(t.boundsArea,l);else{t.renderPipeId&&(e.matrix=l,e.addBounds(t.bounds));const s=t.children;for(let t=0;t<s.length;t++)a(s[t],e,l,n,!1)}if(c){for(let s=0;s<t.effects.length;s++)t.effects[s].addLocalBounds?.(e,n);h.addBounds(e,r.u.IDENTITY),i.o.return(e)}i.u.return(l)}},2101:(t,e,s)=>{"use strict";s.d(e,{O$:()=>i,QL:()=>a,gP:()=>r,w3:()=>n});class r{_image;constructor(t){this._image=t}getImage(){return this._image}}var i,n;!function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"}(i||(i={})),function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"}(n||(n={}));class a{texture;u=0;v=0;u2=0;v2=0;width=0;height=0;degrees=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0}},2155:(t,e,s)=>{"use strict";s.d(e,{Q:()=>i});var r=s(159);class i extends r.q{bones=new Array;_target=null;set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}bendDirection=0;compress=!1;stretch=!1;uniform=!1;mix=0;softness=0;constructor(t){super(t,0,!1)}}},2255:(t,e,s)=>{"use strict";s.d(e,{C:()=>r});class r{constructor(t){this.items=[],this._name=t}emit(t,e,s,r,i,n,a,o){const{name:l,items:h}=this;for(let c=0,u=h.length;c<u;c++)h[c][l](t,e,s,r,i,n,a,o);return this}add(t){return t[this._name]&&(this.remove(t),this.items.push(t)),this}remove(t){const e=this.items.indexOf(t);return-1!==e&&this.items.splice(e,1),this}contains(t){return-1!==this.items.indexOf(t)}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return 0===this.items.length}get name(){return this._name}}},2276:(t,e,s)=>{"use strict";s.d(e,{$:()=>r});const r=[{type:"mat3x3<f32>",test:t=>void 0!==t.value.a,ubo:"\n var matrix = uv[name].toArray(true);\n data[offset] = matrix[0];\n data[offset + 1] = matrix[1];\n data[offset + 2] = matrix[2];\n data[offset + 4] = matrix[3];\n data[offset + 5] = matrix[4];\n data[offset + 6] = matrix[5];\n data[offset + 8] = matrix[6];\n data[offset + 9] = matrix[7];\n data[offset + 10] = matrix[8];\n ",uniform:"\n gl.uniformMatrix3fv(ud[name].location, false, uv[name].toArray(true));\n "},{type:"vec4<f32>",test:t=>"vec4<f32>"===t.type&&1===t.size&&void 0!==t.value.width,ubo:"\n v = uv[name];\n data[offset] = v.x;\n data[offset + 1] = v.y;\n data[offset + 2] = v.width;\n data[offset + 3] = v.height;\n ",uniform:"\n cv = ud[name].value;\n v = uv[name];\n if (cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) {\n cv[0] = v.x;\n cv[1] = v.y;\n cv[2] = v.width;\n cv[3] = v.height;\n gl.uniform4f(ud[name].location, v.x, v.y, v.width, v.height);\n }\n "},{type:"vec2<f32>",test:t=>"vec2<f32>"===t.type&&1===t.size&&void 0!==t.value.x,ubo:"\n v = uv[name];\n data[offset] = v.x;\n data[offset + 1] = v.y;\n ",uniform:"\n cv = ud[name].value;\n v = uv[name];\n if (cv[0] !== v.x || cv[1] !== v.y) {\n cv[0] = v.x;\n cv[1] = v.y;\n gl.uniform2f(ud[name].location, v.x, v.y);\n }\n "},{type:"vec4<f32>",test:t=>"vec4<f32>"===t.type&&1===t.size&&void 0!==t.value.red,ubo:"\n v = uv[name];\n data[offset] = v.red;\n data[offset + 1] = v.green;\n data[offset + 2] = v.blue;\n data[offset + 3] = v.alpha;\n ",uniform:"\n cv = ud[name].value;\n v = uv[name];\n if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) {\n cv[0] = v.red;\n cv[1] = v.green;\n cv[2] = v.blue;\n cv[3] = v.alpha;\n gl.uniform4f(ud[name].location, v.red, v.green, v.blue, v.alpha);\n }\n "},{type:"vec3<f32>",test:t=>"vec3<f32>"===t.type&&1===t.size&&void 0!==t.value.red,ubo:"\n v = uv[name];\n data[offset] = v.red;\n data[offset + 1] = v.green;\n data[offset + 2] = v.blue;\n ",uniform:"\n cv = ud[name].value;\n v = uv[name];\n if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue) {\n cv[0] = v.red;\n cv[1] = v.green;\n cv[2] = v.blue;\n gl.uniform3f(ud[name].location, v.red, v.green, v.blue);\n }\n "}]},2277:(t,e,s)=>{"use strict";s.d(e,{O:()=>o});var r=s(9375),i=s(4269),n=s(9739);const a=class t{constructor(e={}){if(this.uid=(0,r.L)("renderTarget"),this.colorTextures=[],this.dirtyId=0,this.isRoot=!1,this._size=new Float32Array(2),this._managedColorTextures=!1,e={...t.defaultOptions,...e},this.stencil=e.stencil,this.depth=e.depth,this.isRoot=e.isRoot,"number"==typeof e.colorTextures){this._managedColorTextures=!0;for(let t=0;t<e.colorTextures;t++)this.colorTextures.push(new i.v({width:e.width,height:e.height,resolution:e.resolution,antialias:e.antialias}))}else{this.colorTextures=[...e.colorTextures.map(t=>t.source)];const t=this.colorTexture.source;this.resize(t.width,t.height,t._resolution)}this.colorTexture.source.on("resize",this.onSourceResize,this),(e.depthStencilTexture||this.stencil)&&(e.depthStencilTexture instanceof n.g||e.depthStencilTexture instanceof i.v?this.depthStencilTexture=e.depthStencilTexture.source:this.ensureDepthStencilTexture())}get size(){const t=this._size;return t[0]=this.pixelWidth,t[1]=this.pixelHeight,t}get width(){return this.colorTexture.source.width}get height(){return this.colorTexture.source.height}get pixelWidth(){return this.colorTexture.source.pixelWidth}get pixelHeight(){return this.colorTexture.source.pixelHeight}get resolution(){return this.colorTexture.source._resolution}get colorTexture(){return this.colorTextures[0]}onSourceResize(t){this.resize(t.width,t.height,t._resolution,!0)}ensureDepthStencilTexture(){this.depthStencilTexture||(this.depthStencilTexture=new i.v({width:this.width,height:this.height,resolution:this.resolution,format:"depth24plus-stencil8",autoGenerateMipmaps:!1,antialias:!1,mipLevelCount:1}))}resize(t,e,s=this.resolution,r=!1){this.dirtyId++,this.colorTextures.forEach((i,n)=>{r&&0===n||i.source.resize(t,e,s)}),this.depthStencilTexture&&this.depthStencilTexture.source.resize(t,e,s)}destroy(){this.colorTexture.source.off("resize",this.onSourceResize,this),this._managedColorTextures&&this.colorTextures.forEach(t=>{t.destroy()}),this.depthStencilTexture&&(this.depthStencilTexture.destroy(),delete this.depthStencilTexture)}};a.defaultOptions={width:0,height:0,resolution:1,colorTextures:1,stencil:!1,depth:!1,antialias:!1,isRoot:!1};let o=a},2288:(t,e,s)=>{"use strict";s.d(e,{Z:()=>i});const r=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function i(t){const e="number"==typeof t.fontSize?`${t.fontSize}px`:t.fontSize;let s=t.fontFamily;Array.isArray(t.fontFamily)||(s=t.fontFamily.split(","));for(let t=s.length-1;t>=0;t--){let e=s[t].trim();/([\"\'])[^\'\"]+\1/.test(e)||r.includes(e)||(e=`"${e}"`),s[t]=e}return`${t.fontStyle} ${t.fontVariant} ${t.fontWeight} ${e} ${s.join(",")}`}},2305:(t,e,s)=>{"use strict";s.d(e,{F:()=>r,a:()=>i});const r={name:"color-bit",vertex:{header:"\n @in aColor: vec4<f32>;\n ",main:"\n vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);\n "}},i={name:"color-bit",vertex:{header:"\n in vec4 aColor;\n ",main:"\n vColor *= vec4(aColor.rgb * aColor.a, aColor.a);\n "}}},2337:(t,e,s)=>{"use strict";s.d(e,{E:()=>i});var r=s(2276);function i(t,e,s,i){const n=["\n var v = null;\n var v2 = null;\n var t = 0;\n var index = 0;\n var name = null;\n var arrayOffset = null;\n "];let a=0;for(let o=0;o<t.length;o++){const l=t[o],h=l.data.name;let c=!1,u=0;for(let t=0;t<r.$.length;t++)if(r.$[t].test(l.data)){u=l.offset/4,n.push(`name = "${h}";`,`offset += ${u-a};`,r.$[t][e]||r.$[t].ubo),c=!0;break}if(!c)if(l.data.size>1)u=l.offset/4,n.push(s(l,u-a));else{const t=i[l.data.type];u=l.offset/4,n.push(`\n v = uv.${h};\n offset += ${u-a};\n ${t};\n `)}a=u}const o=n.join("\n");return new Function("uv","data","dataInt32","offset",o)}},2414:(t,e,s)=>{"use strict";s.d(e,{R:()=>i});var r=s(1347);class i{convexPolygons=new Array;convexPolygonsIndices=new Array;indicesArray=new Array;isConcaveArray=new Array;triangles=new Array;polygonPool=new r.bC(()=>new Array);polygonIndicesPool=new r.bC(()=>new Array);triangulate(t){let e=t,s=t.length>>1,r=this.indicesArray;r.length=0;for(let t=0;t<s;t++)r[t]=t;let n=this.isConcaveArray;n.length=0;for(let t=0,a=s;t<a;++t)n[t]=i.isConcave(t,s,e,r);let a=this.triangles;for(a.length=0;s>3;){let t=s-1,o=0,l=1;for(;;){t:if(!n[o]){let a=r[t]<<1,h=r[o]<<1,c=r[l]<<1,u=e[a],d=e[a+1],p=e[h],f=e[h+1],m=e[c],g=e[c+1];for(let a=(l+1)%s;a!=t;a=(a+1)%s){if(!n[a])continue;let t=r[a]<<1,s=e[t],o=e[t+1];if(i.positiveArea(m,g,u,d,s,o)&&i.positiveArea(u,d,p,f,s,o)&&i.positiveArea(p,f,m,g,s,o))break t}break}if(0==l){do{if(!n[o])break;o--}while(o>0);break}t=o,o=l,l=(l+1)%s}a.push(r[(s+o-1)%s]),a.push(r[o]),a.push(r[(o+1)%s]),r.splice(o,1),n.splice(o,1),s--;let h=(s+o-1)%s,c=o==s?0:o;n[h]=i.isConcave(h,s,e,r),n[c]=i.isConcave(c,s,e,r)}return 3==s&&(a.push(r[2]),a.push(r[0]),a.push(r[1])),a}decompose(t,e){let s=t,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;let n=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(n),n.length=0;let a=this.polygonIndicesPool.obtain();a.length=0;let o=this.polygonPool.obtain();o.length=0;let l=-1,h=0;for(let t=0,c=e.length;t<c;t+=3){let c=e[t]<<1,u=e[t+1]<<1,d=e[t+2]<<1,p=s[c],f=s[c+1],m=s[u],g=s[u+1],x=s[d],y=s[d+1],v=!1;if(l==c){let t=o.length-4,e=i.winding(o[t],o[t+1],o[t+2],o[t+3],x,y),s=i.winding(x,y,o[0],o[1],o[2],o[3]);e==h&&s==h&&(o.push(x),o.push(y),a.push(d),v=!0)}v||(o.length>0?(r.push(o),n.push(a)):(this.polygonPool.free(o),this.polygonIndicesPool.free(a)),o=this.polygonPool.obtain(),o.length=0,o.push(p),o.push(f),o.push(m),o.push(g),o.push(x),o.push(y),a=this.polygonIndicesPool.obtain(),a.length=0,a.push(c),a.push(u),a.push(d),h=i.winding(p,f,m,g,x,y),l=c)}o.length>0&&(r.push(o),n.push(a));for(let t=0,e=r.length;t<e;t++){if(a=n[t],0==a.length)continue;let s=a[0],l=a[a.length-1];o=r[t];let h=o.length-4,c=o[h],u=o[h+1],d=o[h+2],p=o[h+3],f=o[0],m=o[1],g=o[2],x=o[3],y=i.winding(c,u,d,p,f,m);for(let h=0;h<e;h++){if(h==t)continue;let e=n[h];if(3!=e.length)continue;let v=e[0],_=e[1],b=e[2],w=r[h],T=w[w.length-2],S=w[w.length-1];if(v!=s||_!=l)continue;let A=i.winding(c,u,d,p,T,S),C=i.winding(T,S,f,m,g,x);A==y&&C==y&&(w.length=0,e.length=0,o.push(T),o.push(S),a.push(b),c=d,u=p,d=T,p=S,h=0)}}for(let t=r.length-1;t>=0;t--)o=r[t],0==o.length&&(r.splice(t,1),this.polygonPool.free(o),a=n[t],n.splice(t,1),this.polygonIndicesPool.free(a));return r}static isConcave(t,e,s,r){let i=r[(e+t-1)%e]<<1,n=r[t]<<1,a=r[(t+1)%e]<<1;return!this.positiveArea(s[i],s[i+1],s[n],s[n+1],s[a],s[a+1])}static positiveArea(t,e,s,r,i,n){return t*(n-r)+s*(e-n)+i*(r-e)>=0}static winding(t,e,s,r,i,n){let a=s-t,o=r-e;return i*o-n*a+a*e-t*o>=0?1:-1}}},2432:(t,e,s)=>{"use strict";s.d(e,{b:()=>r});class r{#h={};on(t,e){return this.#h[t]||(this.#h[t]=[]),this.#h[t].push({listener:e}),this}once(t,e){return this.#h[t]||(this.#h[t]=[]),this.#h[t].push({listener:e,once:!0}),this}off(t,e){const s=this.#h[t];return s?(this.#h[t]=s.filter(t=>t.listener!==e),0===this.#h[t].length&&delete this.#h[t],this):this}async emit(t,...e){const s=this.#h[t];if(!s)return[];const r=[],i=[];for(const n of s){const s=n.listener(...e);n.once&&this.off(t,n.listener),s instanceof Promise?i.push(s):r.push(s)}return r.concat(await Promise.all(i))}#c=[];bindTo(t,e,s){this.on(e,s);const r=()=>{this.off(e,s);const r=this.#c.findIndex(r=>r.target===t&&r.key===e&&r.listener===s);-1!==r&&this.#c.splice(r,1)};return t.on("remove",r),this.#c.push({key:e,target:t,listener:s,removeHandler:r}),this}remove(){this.emit("remove");for(const t of this.#c)t.target.off("remove",t.removeHandler);this.#c.length=0}}},2437:(t,e,s)=>{"use strict";s.d(e,{N:()=>o,l:()=>a});var r=s(8147),i=s(192),n=s(6121);function a(t){return void 0!==t.worldTransform}class o extends i.R{#u;_pixiContainer;worldTransform=new n.Z;worldAlpha=new r.w(1);constructor(t){super(),this._pixiContainer=t}set renderer(t){this.#u=t;for(const e of this.children)a(e)&&(e.renderer=t)}get renderer(){return this.#u}add(...t){super.add(...t);for(const e of t)a(e)&&(this._pixiContainer.addChild(e._pixiContainer),this.#u&&(e.renderer=this.#u))}remove(){this._pixiContainer.destroy({children:!0}),super.remove()}_updateWorldTransform(){for(const t of this.children)a(t)&&t._updateWorldTransform();this.worldTransform.resetDirty()}set tint(t){this._pixiContainer.tint=t}get tint(){return this._pixiContainer.tint}}},2445:(t,e,s)=>{"use strict";s.d(e,{l:()=>n});var r=s(7694),i=s(8064);const n=new class{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const e=this._cache.get(t);return e||(0,r.R)(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){const s=(0,i.z)(t);let n;for(let t=0;t<this.parsers.length;t++){const r=this.parsers[t];if(r.test(e)){n=r.getCacheableAssets(s,e);break}}const a=new Map(Object.entries(n||{}));n||s.forEach(t=>{a.set(t,e)});const o=[...a.keys()],l={cacheKeys:o,keys:s};s.forEach(t=>{this._cacheMap.set(t,l)}),o.forEach(t=>{const s=n?n[t]:e;this._cache.has(t)&&this._cache.get(t)!==s&&(0,r.R)("[Cache] already has key:",t),this._cache.set(t,a.get(t))})}remove(t){if(!this._cacheMap.has(t))return void(0,r.R)(`[Assets] Asset id ${t} was not found in the Cache`);const e=this._cacheMap.get(t);e.cacheKeys.forEach(t=>{this._cache.delete(t)}),e.keys.forEach(t=>{this._cacheMap.delete(t)})}get parsers(){return this._parsers}}},2454:(t,e,s)=>{"use strict";s.d(e,{F:()=>r});const r=/Android|iPhone|iPad|iPod/i.test(navigator.userAgent)},2478:(t,e,s)=>{"use strict";s.d(e,{n:()=>n});var r=s(4449);const i={};function n(t){let e=i[t];if(e)return e;const s=new Int32Array(t);for(let e=0;e<t;e++)s[e]=e;return e=i[t]=new r.k({uTextures:{value:s,type:"i32",size:t}},{isStatic:!0}),e}},2517:(t,e,s)=>{"use strict";var r=s(1065),i=s(3463),n=s(2027),a=s(9279),o=s(9739),l=s(8869),h=s(2043);const c=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function u(t,e,s){const r={};if(t.forEach(t=>{r[t]=e}),Object.keys(e.textures).forEach(t=>{r[`${e.cachePrefix}${t}`]=e.textures[t]}),!s){const s=l.A.dirname(t[0]);e.linkedSheets.forEach((t,i)=>{const n=u([`${s}/${e.data.meta.related_multi_packs[i]}`],t,!0);Object.assign(r,n)})}return r}const d={extension:r.Ag.Asset,cache:{test:t=>t instanceof h.z,getCacheableAssets:(t,e)=>u(t,e,!1)},resolver:{extension:{type:r.Ag.ResolveParser,name:"resolveSpritesheet"},test:t=>{const e=t.split("?")[0].split("."),s=e.pop(),r=e.pop();return"json"===s&&c.includes(r)},parse:t=>{const e=t.split(".");return{resolution:parseFloat(n.x.RETINA_PREFIX.exec(t)?.[1]??"1"),format:e[e.length-2],src:t}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:r.Ag.LoadParser,priority:i.T.Normal,name:"spritesheetLoader"},testParse:async(t,e)=>".json"===l.A.extname(e.src).toLowerCase()&&!!t.frames,async parse(t,e,s){const{texture:r,imageFilename:i,textureOptions:n,cachePrefix:c}=e?.data??{};let u,d=l.A.dirname(e.src);if(d&&d.lastIndexOf("/")!==d.length-1&&(d+="/"),r instanceof o.g)u=r;else{const r=(0,a.Y)(d+(i??t.meta.image),e.src);u=(await s.load([{src:r,data:n}]))[r]}const p=new h.z({texture:u.source,data:t,cachePrefix:c});await p.parse();const f=t?.meta?.related_multi_packs;if(Array.isArray(f)){const t=[];for(const r of f){if("string"!=typeof r)continue;let i=d+r;e.data?.ignoreMultiPack||(i=(0,a.Y)(i,e.src),t.push(s.load({src:i,data:{textureOptions:n,ignoreMultiPack:!0}})))}const r=await Promise.all(t);p.linkedSheets=r,r.forEach(t=>{t.linkedSheets=[p].concat(p.linkedSheets.filter(e=>e!==t))})}return p},async unload(t,e,s){await s.unload(t.textureSource._sourceOrigin),t.destroy(!1)}}};r.XO.add(d)},2542:(t,e,s)=>{"use strict";var r=s(1065),i=s(4242),n=s(6170),a=s(9565);const o=new n.c;function l(t,e,s){const r=o;t.measurable=!0,(0,a.f)(t,s,r),e.addBoundsMask(r),t.measurable=!1}var h=s(2071),c=s(7882),u=s(7694);function d(t,e,s){const r=c.o.get();t.measurable=!0;const i=c.u.get().identity(),n=p(t,s,i);(0,h.n)(t,r,n),t.measurable=!1,e.addBoundsMask(r),c.u.return(i),c.o.return(r)}function p(t,e,s){return t?(t!==e&&(p(t.parent,e,s),t.updateLocalTransform(),s.append(t.localTransform)),s):((0,u.R)("Mask bounds, renderable is not inside the root container"),s)}class f{constructor(t){this.priority=0,this.inverse=!1,this.pipe="alphaMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.renderMaskToTexture=!(t instanceof i.k),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask.measurable=!0,this.mask=null}addBounds(t,e){this.inverse||l(this.mask,t,e)}addLocalBounds(t,e){d(this.mask,t,e)}containsPoint(t,e){return e(this.mask,t)}destroy(){this.reset()}static test(t){return t instanceof i.k}}f.extension=r.Ag.MaskEffect;class m{constructor(t){this.priority=0,this.pipe="colorMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t}destroy(){}static test(t){return"number"==typeof t}}m.extension=r.Ag.MaskEffect;var g=s(4687);class x{constructor(t){this.priority=0,this.pipe="stencilMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null}addBounds(t,e){l(this.mask,t,e)}addLocalBounds(t,e){d(this.mask,t,e)}containsPoint(t,e){return e(this.mask,t)}destroy(){this.reset()}static test(t){return t instanceof g.mc}}x.extension=r.Ag.MaskEffect;var y=s(6185),v=s(1386),_=s(5947),b=s(5749);s(7935),r.XO.add(f,m,x,b.$,_.b,v.q,y.P)},2577:(t,e,s)=>{"use strict";s.d(e,{R:()=>r,m:()=>i});const r={name:"texture-bit",vertex:{header:"\n\n struct TextureUniforms {\n uTextureMatrix:mat3x3<f32>,\n }\n\n @group(2) @binding(2) var<uniform> textureUniforms : TextureUniforms;\n ",main:"\n uv = (textureUniforms.uTextureMatrix * vec3(uv, 1.0)).xy;\n "},fragment:{header:"\n @group(2) @binding(0) var uTexture: texture_2d<f32>;\n @group(2) @binding(1) var uSampler: sampler;\n\n\n ",main:"\n outColor = textureSample(uTexture, uSampler, vUV);\n "}},i={name:"texture-bit",vertex:{header:"\n uniform mat3 uTextureMatrix;\n ",main:"\n uv = (uTextureMatrix * vec3(uv, 1.0)).xy;\n "},fragment:{header:"\n uniform sampler2D uTexture;\n\n\n ",main:"\n outColor = texture(uTexture, vUV);\n "}}},2585:(t,e,s)=>{"use strict";s.d(e,{a:()=>r});class r{indexOffset=0;attributeOffset=0;indexSize;attributeSize;batcherName="darkTint";topology="triangle-list";packAsQuad=!1;renderable;positions;indices;uvs;roundPixels;data;blendMode;darkTint;texture;transform;_textureId;_attributeStart;_indexStart;_batcher;_batch;get color(){const t=this.data.color,e=this.renderable.groupColor,s=this.renderable.groupAlpha;let r;const i=t.a*s*255;if(16777215!==e){const s=e>>16&255,n=e>>8&255,a=255&e,o=t.r*a,l=t.g*n;r=i<<24|t.b*s<<16|l<<8|o}else r=i<<24|255*t.b<<16|255*t.g<<8|255*t.r;return r}get darkColor(){const t=this.data.darkColor;return 255*t.b<<16|255*t.g<<8|255*t.r}get groupTransform(){return this.renderable.groupTransform}setData(t,e,s,r){if(this.renderable=t,this.transform=t.groupTransform,this.data=e,e.clipped){const t=e.clippedData;this.indexSize=t.indicesCount,this.attributeSize=t.vertexCount,this.positions=t.vertices,this.indices=t.indices,this.uvs=t.uvs}else this.indexSize=e.indices.length,this.attributeSize=e.vertices.length/2,this.positions=e.vertices,this.indices=e.indices,this.uvs=e.uvs;this.texture=e.texture,this.roundPixels=r,this.blendMode=s,this.batcherName=e.darkTint?"darkTint":"default"}}},2619:(t,e,s)=>{"use strict";s.d(e,{n:()=>n});var r=s(6793);class i extends r.a{async doLoad(t){const e=(async()=>{if("fonts"in document)try{return await document.fonts.load(`1em ${t}`),await document.fonts.ready,this.loadingPromises.delete(t),!0}catch(e){console.error(`Failed to load font: ${t}`,e),this.loadingPromises.delete(t)}else console.warn("This browser does not support the Font Loading API"),this.loadingPromises.delete(t)})();return this.loadingPromises.set(t,e),await e}}const n=new i},2777:(t,e,s)=>{"use strict";s.a(t,async(t,e)=>{try{var r=s(4968),i=s(112),n=s(8730),a=s(6907),o=s(6869);await(0,r.uv)([{src:"assets/spritesheets/hero.png",atlas:i},{src:"assets/spritesheets/orc.png",atlas:n},{src:"assets/spritesheets/potion.png",atlas:a},{fnt:"assets/bitmap-fonts/white-peaberry.fnt",src:"assets/bitmap-fonts/white-peaberry.png"},"assets/bgm/battle.mp3","assets/sfx/hero/hit/hit1.wav","assets/sfx/hero/hit/hit2.wav","assets/sfx/hero/hit/hit3.wav","assets/sfx/hero/miss/miss1.wav","assets/sfx/hero/miss/miss2.wav","assets/sfx/hero/miss/miss3.wav","assets/sfx/hero/heal/heal.wav","assets/sfx/hero/die/die.wav","assets/sfx/orc/hit/hit1.wav","assets/sfx/orc/hit/hit2.wav","assets/sfx/orc/hit/hit3.wav","assets/sfx/orc/miss/miss1.wav","assets/sfx/orc/miss/miss2.wav","assets/sfx/orc/miss/miss3.wav","assets/sfx/orc/die/die.wav"]),new r.A4(document.body,{backgroundColor:"#304C79",layers:[{name:"hud",drawOrder:1}]}).add(new o.B),e()}catch(t){e(t)}},1)},2791:(t,e,s)=>{"use strict";s.d(e,{w:()=>a});var r=s(3655),i=s(9739);const n={};function a(t,e,s){let a=2166136261;for(let s=0;s<e;s++)a^=t[s].uid,a=Math.imul(a,16777619),a>>>=0;return n[a]||function(t,e,s,a){const o={};let l=0;for(let s=0;s<a;s++){const r=s<e?t[s]:i.g.EMPTY.source;o[l++]=r.source,o[l++]=r.style}const h=new r.T(o);return n[s]=h,h}(t,e,a,s)}},2806:()=>{"use strict";var t;void 0===Math.fround&&(Math.fround=(t=new Float32Array(1),function(e){return t[0]=e,t[0]}))},2839:(t,e,s)=>{"use strict";s.d(e,{_:()=>n});var r=s(166),i=s(7249);class n extends i.X{constructor(t){super(new r.mcf({sortableChildren:!0}),t??{})}}},2843:(t,e,s)=>{"use strict";s.d(e,{a:()=>r});const r=t=>!Array.isArray(t)},2866:(t,e,s)=>{"use strict";s.d(e,{$:()=>n});var r=s(946),i=s(1347);class n{data;skeleton;parent=null;children=new Array;x=0;y=0;rotation=0;scaleX=0;scaleY=0;shearX=0;shearY=0;ax=0;ay=0;arotation=0;ascaleX=0;ascaleY=0;ashearX=0;ashearY=0;a=0;b=0;c=0;d=0;worldY=0;worldX=0;inherit=r.u.Normal;sorted=!1;active=!1;constructor(t,e,s){if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=s,this.setToSetupPose()}isActive(){return this.active}update(t){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,e,s,n,a,o,l){this.ax=t,this.ay=e,this.arotation=s,this.ascaleX=n,this.ascaleY=a,this.ashearX=o,this.ashearY=l;let h=this.parent;if(!h){let r=this.skeleton;const h=r.scaleX,c=r.scaleY,u=(s+o)*i.cj.degRad,d=(s+90+l)*i.cj.degRad;return this.a=Math.cos(u)*n*h,this.b=Math.cos(d)*a*h,this.c=Math.sin(u)*n*c,this.d=Math.sin(d)*a*c,this.worldX=t*h+r.x,void(this.worldY=e*c+r.y)}let c=h.a,u=h.b,d=h.c,p=h.d;switch(this.worldX=c*t+u*e+h.worldX,this.worldY=d*t+p*e+h.worldY,this.inherit){case r.u.Normal:{const t=(s+o)*i.cj.degRad,e=(s+90+l)*i.cj.degRad,r=Math.cos(t)*n,h=Math.cos(e)*a,f=Math.sin(t)*n,m=Math.sin(e)*a;return this.a=c*r+u*f,this.b=c*h+u*m,this.c=d*r+p*f,void(this.d=d*h+p*m)}case r.u.OnlyTranslation:{const t=(s+o)*i.cj.degRad,e=(s+90+l)*i.cj.degRad;this.a=Math.cos(t)*n,this.b=Math.cos(e)*a,this.c=Math.sin(t)*n,this.d=Math.sin(e)*a;break}case r.u.NoRotationOrReflection:{let t=1/this.skeleton.scaleX,e=1/this.skeleton.scaleY;c*=t,d*=e;let r=c*c+d*d,h=0;r>1e-4?(r=Math.abs(c*p*e-u*t*d)/r,u=d*r,p=c*r,h=Math.atan2(d,c)*i.cj.radDeg):(c=0,d=0,h=90-Math.atan2(p,u)*i.cj.radDeg);const f=(s+o-h)*i.cj.degRad,m=(s+l-h+90)*i.cj.degRad,g=Math.cos(f)*n,x=Math.cos(m)*a,y=Math.sin(f)*n,v=Math.sin(m)*a;this.a=c*g-u*y,this.b=c*x-u*v,this.c=d*g+p*y,this.d=d*x+p*v;break}case r.u.NoScale:case r.u.NoScaleOrReflection:{s*=i.cj.degRad;const t=Math.cos(s),e=Math.sin(s);let h=(c*t+u*e)/this.skeleton.scaleX,f=(d*t+p*e)/this.skeleton.scaleY,m=Math.sqrt(h*h+f*f);m>1e-5&&(m=1/m),h*=m,f*=m,m=Math.sqrt(h*h+f*f),this.inherit==r.u.NoScale&&c*p-u*d<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(m=-m),s=Math.PI/2+Math.atan2(f,h);const g=Math.cos(s)*m,x=Math.sin(s)*m;o*=i.cj.degRad,l=(90+l)*i.cj.degRad;const y=Math.cos(o)*n,v=Math.cos(l)*a,_=Math.sin(o)*n,b=Math.sin(l)*a;this.a=h*y+g*_,this.b=h*v+g*b,this.c=f*y+x*_,this.d=f*v+x*b;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY,this.inherit=t.inherit}updateAppliedTransform(){let t=this.parent;if(!t)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*i.cj.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*i.cj.radDeg);let e,s,n,a,o=t.a,l=t.b,h=t.c,c=t.d,u=1/(o*c-l*h),d=c*u,p=l*u,f=h*u,m=o*u,g=this.worldX-t.worldX,x=this.worldY-t.worldY;if(this.ax=g*d-x*p,this.ay=x*m-g*f,this.inherit==r.u.OnlyTranslation)e=this.a,s=this.b,n=this.c,a=this.d;else{switch(this.inherit){case r.u.NoRotationOrReflection:{let t=Math.abs(o*c-l*h)/(o*o+h*h);l=-h*this.skeleton.scaleX*t/this.skeleton.scaleY,c=o*this.skeleton.scaleY*t/this.skeleton.scaleX,u=1/(o*c-l*h),d=c*u,p=l*u;break}case r.u.NoScale:case r.u.NoScaleOrReflection:let t=i.cj.cosDeg(this.rotation),e=i.cj.sinDeg(this.rotation);o=(o*t+l*e)/this.skeleton.scaleX,h=(h*t+c*e)/this.skeleton.scaleY;let s=Math.sqrt(o*o+h*h);s>1e-5&&(s=1/s),o*=s,h*=s,s=Math.sqrt(o*o+h*h),this.inherit==r.u.NoScale&&u<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(s=-s);let n=i.cj.PI/2+Math.atan2(h,o);l=Math.cos(n)*s,c=Math.sin(n)*s,u=1/(o*c-l*h),d=c*u,p=l*u,f=h*u,m=o*u}e=d*this.a-p*this.c,s=d*this.b-p*this.d,n=m*this.c-f*this.a,a=m*this.d-f*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(e*e+n*n),this.ascaleX>1e-4){let t=e*a-s*n;this.ascaleY=t/this.ascaleX,this.ashearY=-Math.atan2(e*s+n*a,t)*i.cj.radDeg,this.arotation=Math.atan2(n,e)*i.cj.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(s*s+a*a),this.ashearY=0,this.arotation=90-Math.atan2(a,s)*i.cj.radDeg}getWorldRotationX(){return Math.atan2(this.c,this.a)*i.cj.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*i.cj.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}worldToLocal(t){let e=1/(this.a*this.d-this.b*this.c),s=t.x-this.worldX,r=t.y-this.worldY;return t.x=s*this.d*e-r*this.b*e,t.y=r*this.a*e-s*this.c*e,t}localToWorld(t){let e=t.x,s=t.y;return t.x=e*this.a+s*this.b+this.worldX,t.y=e*this.c+s*this.d+this.worldY,t}worldToParent(t){if(null==t)throw new Error("world cannot be null.");return null==this.parent?t:this.parent.worldToLocal(t)}parentToWorld(t){if(null==t)throw new Error("world cannot be null.");return null==this.parent?t:this.parent.localToWorld(t)}worldToLocalRotation(t){let e=i.cj.sinDeg(t),s=i.cj.cosDeg(t);return Math.atan2(this.a*e-this.c*s,this.d*s-this.b*e)*i.cj.radDeg+this.rotation-this.shearX}localToWorldRotation(t){t-=this.rotation-this.shearX;let e=i.cj.sinDeg(t),s=i.cj.cosDeg(t);return Math.atan2(s*this.c+e*this.d,s*this.a+e*this.b)*i.cj.radDeg}rotateWorld(t){t*=i.cj.degRad;const e=Math.sin(t),s=Math.cos(t),r=this.a,n=this.b;this.a=s*r-e*this.c,this.b=s*n-e*this.d,this.c=e*r+s*this.c,this.d=e*n+s*this.d}}},2885:(t,e,s)=>{"use strict";s.d(e,{v:()=>i});var r=s(2027);function i(t,e=1){const s=r.x.RETINA_PREFIX?.exec(t);return s?parseFloat(s[1]):e}},3046:(t,e,s)=>{"use strict";var r=s(1065);class i{static init(t){Object.defineProperty(this,"resizeTo",{set(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;let t,e;if(this._cancelResize(),this._resizeTo===globalThis.window)t=globalThis.innerWidth,e=globalThis.innerHeight;else{const{clientWidth:s,clientHeight:r}=this._resizeTo;t=s,e=r}this.renderer.resize(t,e),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}i.extension=r.Ag.Application;var n=s(3880),a=s(3651);class o{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,n.d.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?a.R.shared:new a.R,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}o.extension=r.Ag.Application,r.XO.add(i),r.XO.add(o)},3050:(t,e,s)=>{"use strict";var r=s(1065),i=s(6364),n=s(7433),a=s(761),o=s(9482),l=s(5008);class h{constructor(){this.batches=[],this.batched=!1}destroy(){this.batches.forEach(t=>{a.Z.return(t)}),this.batches.length=0}}class c{constructor(t,e){this.state=n.U.for2d(),this.renderer=t,this._adaptor=e,this.renderer.runners.contextChange.add(this)}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(t){const e=t.context,s=!!t._gpuData,r=this.renderer.graphicsContext.updateGpuContext(e);return!(!r.isBatchable&&s===r.isBatchable)}addRenderable(t,e){const s=this.renderer.graphicsContext.updateGpuContext(t.context);t.didViewUpdate&&this._rebuild(t),s.isBatchable?this._addToBatcher(t,e):(this.renderer.renderPipes.batch.break(e),e.add(t))}updateRenderable(t){const e=this._getGpuDataForRenderable(t).batches;for(let t=0;t<e.length;t++){const s=e[t];s._batcher.updateElement(s)}}execute(t){if(!t.isRenderable)return;const e=this.renderer,s=t.context;if(!e.graphicsContext.getGpuContext(s).batches.length)return;const r=s.customShader||this._adaptor.shader;this.state.blendMode=t.groupBlendMode;const i=r.resources.localUniforms.uniforms;i.uTransformMatrix=t.groupTransform,i.uRound=e._roundPixels|t._roundPixels,(0,o.V)(t.groupColorAlpha,i.uColor,0),this._adaptor.execute(this,t)}_rebuild(t){const e=this._getGpuDataForRenderable(t),s=this.renderer.graphicsContext.updateGpuContext(t.context);e.destroy(),s.isBatchable&&this._updateBatchesForRenderable(t,e)}_addToBatcher(t,e){const s=this.renderer.renderPipes.batch,r=this._getGpuDataForRenderable(t).batches;for(let t=0;t<r.length;t++){const i=r[t];s.addToBatch(i,e)}}_getGpuDataForRenderable(t){return t._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(t)}_initGpuDataForRenderable(t){const e=new h;return t._gpuData[this.renderer.uid]=e,e}_updateBatchesForRenderable(t,e){const s=t.context,r=this.renderer.graphicsContext.getGpuContext(s),i=this.renderer._roundPixels|t._roundPixels;e.batches=r.batches.map(e=>{const s=a.Z.get(l.G);return e.copyTo(s),s.renderable=t,s.roundPixels=i,s})}destroy(){this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null}}c.extension={type:[r.Ag.WebGLPipes,r.Ag.WebGPUPipes,r.Ag.CanvasPipes],name:"graphics"},r.XO.add(c),r.XO.add(i.GH)},3051:(t,e,s)=>{"use strict";s.d(e,{Y:()=>n});var r=s(1065),i=s(6257);const n={extension:{type:r.Ag.DetectionParser,priority:0},test:async()=>(0,i.P)("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async t=>[...t,"webp"],remove:async t=>t.filter(t=>"webp"!==t)}},3198:(t,e,s)=>{"use strict";s.d(e,{u:()=>p});var r=s(1886),i=s(8847),n=s(791),a=s(2619),o=s(4132),l=s(3645),h=s(7635);const c=[{check:t=>t.endsWith(".json")||t.endsWith(".atlas"),loader:l.R},{check:t=>t.endsWith(".skel"),loader:i.j},{check:t=>/\.(png|jpe?g|gif|webp)$/.test(t),loader:h.V},{check:t=>/\.(mp3|wav|ogg)$/.test(t),loader:r.K},{check:t=>!t.includes("."),loader:a.n}];function u(t){return c.find(({check:e})=>e(t))?.loader}function d(t){if("string"==typeof t){const e=u(t);if(!e)return void console.warn(`No loader found for asset: ${t}`);e.release(t)}else if("atlas"in t){const e=(0,o.t)(t.src,t.atlas);o.i.release(e)}else"fnt"in t?n.S.release(t.fnt):console.warn(`Unknown asset type: ${t}`)}async function p(t,e){let s=0;const r=t.length;return await Promise.all(t.map(async t=>{try{await async function(t){if("string"==typeof t){const e=u(t);if(!e)return void console.warn(`No loader found for asset: ${t}`);await e.load(t)}else if("atlas"in t){const e=(0,o.t)(t.src,t.atlas);await o.i.load(e,t.src,t.atlas)}else"fnt"in t?await n.S.load(t.fnt,t.src):console.warn(`Unknown asset type: ${t}`)}(t),s++,e?.(s/r)}catch(e){console.error("Failed to load asset:",t,e)}})),()=>t.forEach(d)}},3212:(t,e,s)=>{"use strict";s.d(e,{f:()=>r});const r={test(t){const e=t;return"string"!=typeof e&&"getElementsByTagName"in e&&e.getElementsByTagName("page").length&&null!==e.getElementsByTagName("info")[0].getAttribute("face")},parse(t){const e={chars:{},pages:[],lineHeight:0,fontSize:0,fontFamily:"",distanceField:null,baseLineOffset:0},s=t.getElementsByTagName("info")[0],r=t.getElementsByTagName("common")[0],i=t.getElementsByTagName("distanceField")[0];i&&(e.distanceField={type:i.getAttribute("fieldType"),range:parseInt(i.getAttribute("distanceRange"),10)});const n=t.getElementsByTagName("page"),a=t.getElementsByTagName("char"),o=t.getElementsByTagName("kerning");e.fontSize=parseInt(s.getAttribute("size"),10),e.fontFamily=s.getAttribute("face"),e.lineHeight=parseInt(r.getAttribute("lineHeight"),10);for(let t=0;t<n.length;t++)e.pages.push({id:parseInt(n[t].getAttribute("id"),10)||0,file:n[t].getAttribute("file")});const l={};e.baseLineOffset=e.lineHeight-parseInt(r.getAttribute("base"),10);for(let t=0;t<a.length;t++){const s=a[t],r=parseInt(s.getAttribute("id"),10);let i=s.getAttribute("letter")??s.getAttribute("char")??String.fromCharCode(r);"space"===i&&(i=" "),l[r]=i,e.chars[i]={id:r,page:parseInt(s.getAttribute("page"),10)||0,x:parseInt(s.getAttribute("x"),10),y:parseInt(s.getAttribute("y"),10),width:parseInt(s.getAttribute("width"),10),height:parseInt(s.getAttribute("height"),10),xOffset:parseInt(s.getAttribute("xoffset"),10),yOffset:parseInt(s.getAttribute("yoffset"),10),xAdvance:parseInt(s.getAttribute("xadvance"),10),kerning:{}}}for(let t=0;t<o.length;t++){const s=parseInt(o[t].getAttribute("first"),10),r=parseInt(o[t].getAttribute("second"),10),i=parseInt(o[t].getAttribute("amount"),10);e.chars[l[r]].kerning[l[s]]=i}return e}}},3289:(t,e,s)=>{"use strict";s.d(e,{f:()=>l});var r=s(5423),i=s(1065),n=s(3761),a=s(4173),o=s(3463);const l={name:"loadTxt",id:"text",extension:{type:i.Ag.LoadParser,priority:o.T.Low,name:"loadTxt"},test:t=>(0,n.s)(t,"text/plain")||(0,a.W)(t,".txt"),async load(t){const e=await r.e.get().fetch(t);return await e.text()}}},3385:(t,e,s)=>{"use strict";s.d(e,{a:()=>o});var r=s(7694),i=s(8869),n=s(8064),a=s(2843);class o{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(t,e,s)=>(this._parsersValidated=!1,t[e]=s,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(t,e){const s={promise:null,parser:null};return s.promise=(async()=>{let i=null,n=null;if((e.parser||e.loadParser)&&(n=this._parserHash[e.parser||e.loadParser],e.loadParser&&(0,r.R)(`[Assets] "loadParser" is deprecated, use "parser" instead for ${t}`),n||(0,r.R)(`[Assets] specified load parser "${e.parser||e.loadParser}" not found while loading ${t}`)),!n){for(let s=0;s<this.parsers.length;s++){const r=this.parsers[s];if(r.load&&r.test?.(t,e,this)){n=r;break}}if(!n)return(0,r.R)(`[Assets] ${t} could not be loaded as we don't know how to parse it, ensure the correct parser has been added`),null}i=await n.load(t,e,this),s.parser=n;for(let t=0;t<this.parsers.length;t++){const r=this.parsers[t];r.parse&&r.parse&&await(r.testParse?.(i,e,this))&&(i=await r.parse(i,e,this)||i,s.parser=r)}return i})(),s}async load(t,e){this._parsersValidated||this._validateParsers();let s=0;const r={},o=(0,a.a)(t),l=(0,n.z)(t,t=>({alias:[t],src:t,data:{}})),h=l.length,c=l.map(async t=>{const n=i.A.toAbsolute(t.src);if(!r[t.src])try{this.promiseCache[n]||(this.promiseCache[n]=this._getLoadPromiseAndParser(n,t)),r[t.src]=await this.promiseCache[n].promise,e&&e(++s/h)}catch(e){throw delete this.promiseCache[n],delete r[t.src],new Error(`[Loader.load] Failed to load ${n}.\n${e}`)}});return await Promise.all(c),o?r[l[0].src]:r}async unload(t){const e=(0,n.z)(t,t=>({alias:[t],src:t})).map(async t=>{const e=i.A.toAbsolute(t.src),s=this.promiseCache[e];if(s){const r=await s.promise;delete this.promiseCache[e],await(s.parser?.unload?.(r,t,this))}});await Promise.all(e)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter(t=>t.name||t.id).reduce((t,e)=>(e.name||e.id?(t[e.name]||t[e.id])&&(0,r.R)(`[Assets] parser id conflict "${e.id}"`):(0,r.R)("[Assets] parser should have an id"),t[e.name]=e,e.id&&(t[e.id]=e),t),{})}}},3394:(t,e,s)=>{"use strict";var r=s(166);const i="spineSkeletonLoader",n={extension:r.AgS.Asset,loader:{id:i,name:i,extension:{type:r.AgS.LoadParser,priority:r.T9C.Normal,name:i},test:t=>(0,r.WOU)(t,".skel"),async load(t){const e=await r.eBH.get().fetch(t);return new Uint8Array(await e.arrayBuffer())},testParse(t,e){const s=(0,r.WOU)(e.src,".json")&&(n=t,Object.prototype.hasOwnProperty.call(n,"bones"));var n;const a=(0,r.WOU)(e.src,".skel")&&function(t){return t instanceof Uint8Array}(t),o=e.parser===i||e.loadParser===i;return Promise.resolve(s||a||o)}}};r.XOh.add(n)},3412:(t,e,s)=>{"use strict";s.d(e,{K:()=>r});class r{constructor(){this.batcherName="default",this.topology="triangle-list",this.attributeSize=4,this.indexSize=6,this.packAsQuad=!0,this.roundPixels=0,this._attributeStart=0,this._batcher=null,this._batch=null}get blendMode(){return this.renderable.groupBlendMode}get color(){return this.renderable.groupColorAlpha}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.bounds=null}destroy(){}}},3450:(t,e,s)=>{"use strict";s.d(e,{J:()=>r});class r{data;intValue=0;floatValue=0;stringValue=null;time=0;volume=0;balance=0;constructor(t,e){if(!e)throw new Error("data cannot be null.");this.time=t,this.data=e}}},3463:(t,e,s)=>{"use strict";s.d(e,{T:()=>r});var r=(t=>(t[t.Low=0]="Low",t[t.Normal=1]="Normal",t[t.High=2]="High",t))(r||{})},3472:(t,e,s)=>{"use strict";s.d(e,{I:()=>r});const r={extension:{type:s(1065).Ag.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await Promise.resolve().then(s.bind(s,8675))}}},3590:(t,e,s)=>{"use strict";function r(t,e,s){const{width:r,height:i}=s.orig,n=s.trim;if(n){const s=n.width,a=n.height;t.minX=n.x-e._x*r,t.maxX=t.minX+s,t.minY=n.y-e._y*i,t.maxY=t.minY+a}else t.minX=-e._x*r,t.maxX=t.minX+r,t.minY=-e._y*i,t.maxY=t.minY+i}s.d(e,{y:()=>r})},3643:(t,e,s)=>{"use strict";s.d(e,{Q:()=>r});class r{skeletonData;animationToMixTime={};defaultMix=0;constructor(t){if(!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,s){let r=this.skeletonData.findAnimation(t);if(!r)throw new Error("Animation not found: "+t);let i=this.skeletonData.findAnimation(e);if(!i)throw new Error("Animation not found: "+e);this.setMixWith(r,i,s)}setMixWith(t,e,s){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");let r=t.name+"."+e.name;this.animationToMixTime[r]=s}getMix(t,e){let s=t.name+"."+e.name,r=this.animationToMixTime[s];return void 0===r?this.defaultMix:r}}},3645:(t,e,s)=>{"use strict";s.d(e,{R:()=>n});var r=s(6793);class i extends r.a{async doLoad(t){const e=(async()=>{const e=await fetch(t);if(!e.ok)return void console.error(`Failed to load text: ${t}`);const s=await e.text();if(this.loadingPromises.delete(t),this.hasActiveRef(t)){if(!this.cachedAssets.has(t))return this.cachedAssets.set(t,s),s;console.error(`Text already exists: ${t}`)}})();return this.loadingPromises.set(t,e),await e}}const n=new i},3648:(t,e,s)=>{"use strict";s.d(e,{Dr:()=>n,pw:()=>r,r9:()=>i,rX:()=>o});var r,i,n,a=s(159);class o extends a.q{bones=new Array;_target=null;set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}positionMode=r.Fixed;spacingMode=i.Fixed;rotateMode=n.Chain;offsetRotation=0;position=0;spacing=0;mixRotate=0;mixX=0;mixY=0;constructor(t){super(t,0,!1)}}!function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(r||(r={})),function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional"}(i||(i={})),function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(n||(n={}))},3651:(t,e,s)=>{"use strict";s.d(e,{R:()=>a});var r=s(3880);class i{constructor(t,e=null,s=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=t,this._context=e,this.priority=s,this._once=r}match(t,e=null){return this._fn===t&&this._context===e}emit(t){this._fn&&(this._context?this._fn.call(this._context,t):this._fn(t));const e=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),e}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const e=this.next;return this.next=t?null:e,this.previous=null,e}}const n=class t{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new i(null,null,1/0),this.deltaMS=1/t.targetFPMS,this.elapsedMS=1/t.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&null===this._requestId&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,s=r.d.NORMAL){return this._addListener(new i(t,e,s))}addOnce(t,e,s=r.d.NORMAL){return this._addListener(new i(t,e,s,!0))}_addListener(t){let e=this._head.next,s=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(s);break}s=e,e=e.next}t.previous||t.connect(s)}else t.connect(s);return this._startIfPossible(),this}remove(t,e){let s=this._head.next;for(;s;)s=s.match(t,e)?s.destroy():s.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let s;if(e>this.lastTime){if(s=this.elapsedMS=e-this.lastTime,s>this._maxElapsedMS&&(s=this._maxElapsedMS),s*=this.speed,this._minElapsedMS){const t=e-this._lastFrame|0;if(t<this._minElapsedMS)return;this._lastFrame=e-t%this._minElapsedMS}this.deltaMS=s,this.deltaTime=this.deltaMS*t.targetFPMS;const r=this._head;let i=r.next;for(;i;)i=i.emit(this);r.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(e){const s=Math.min(this.maxFPS,e),r=Math.min(Math.max(0,s)/1e3,t.targetFPMS);this._maxElapsedMS=1/r}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){if(0===t)this._minElapsedMS=0;else{const e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}}static get shared(){if(!t._shared){const e=t._shared=new t;e.autoStart=!0,e._protected=!0}return t._shared}static get system(){if(!t._system){const e=t._system=new t;e.autoStart=!0,e._protected=!0}return t._system}};n.targetFPMS=.06;let a=n},3655:(t,e,s)=>{"use strict";s.d(e,{T:()=>r});class r{constructor(t){this.resources=Object.create(null),this._dirty=!0;let e=0;for(const s in t){const r=t[s];this.setResource(r,e++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let e=0;for(const s in this.resources)t[e++]=this.resources[s]._resourceId;this._key=t.join("|")}setResource(t,e){const s=this.resources[e];t!==s&&(s&&t.off?.("change",this.onResourceChange,this),t.on?.("change",this.onResourceChange,this),this.resources[e]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t){const e=this.resources;for(const s in e)e[s]._touched=t}destroy(){const t=this.resources;for(const e in t){const s=t[e];s.off?.("change",this.onResourceChange,this)}this.resources=null}onResourceChange(t){if(this._dirty=!0,t.destroyed){const e=this.resources;for(const s in e)e[s]===t&&(e[s]=null)}else this._updateKey()}}},3761:(t,e,s)=>{"use strict";function r(t,e){if(Array.isArray(e)){for(const s of e)if(t.startsWith(`data:${s}`))return!0;return!1}return t.startsWith(`data:${e}`)}s.d(e,{s:()=>r})},3762:(t,e,s)=>{"use strict";s.d(e,{p:()=>J});var r=s(8630);const i=t=>t<0?-t:t;function n(t,e,s,r,i,n,a,o){const l=t*s+e*r,h=t*i+e*n;return a*(l<0?-l:l)+o*(h<0?-h:h)}function a(t,e,s,r,i,a,o,l,h,c,u,d,p,f,m,g){const x=s*t+r*e;return(x<0?-x:x)>n(t,e,i,a,o,l,h,c)+n(t,e,u,d,p,f,m,g)}let o=0,l=0;function h(t,e){const s=e.scaleX.v,r=e.scaleY.v,i=e.rotation.cos,n=e.rotation.sin,a=i,h=n,c=-n,u=i,d=(t.x||0)*s,p=(t.y||0)*r;o=e.x.v+a*d+c*p,l=e.y.v+h*d+u*p}function c(t,e){const s=i(e.scaleX.v),r=i(e.scaleY.v);return t.radius*(s>r?s:r)}function u(t,e,s,r){const n=e.scaleX.v,a=e.scaleY.v,u=.5*i(t.width*n),d=.5*i(t.height*a),p=e.rotation.cos,f=e.rotation.sin,m=p,g=f,x=-f,y=p,v=(t.x||0)*n,_=(t.y||0)*a,b=e.x.v+m*v+x*_,w=e.y.v+g*v+y*_;h(s,r);const T=c(s,r),S=o-b,A=l-w,C=S*m+A*g,P=S*x+A*y,E=C-(C<-u?-u:C>u?u:C),M=P-(P<-d?-d:P>d?d:P);return E*E+M*M<=T*T}function d(t,e,s,r){const i=t.vertices,n=i.length;if(0===n)return!1;const a=e.scaleX.v,u=e.scaleY.v,d=e.rotation.cos,p=e.rotation.sin,f=d,m=p,g=-p,x=d,y=(t.x||0)*a,v=(t.y||0)*u,_=e.x.v+f*y+g*v,b=e.y.v+m*y+x*v;h(s,r);const w=o,T=l,S=c(s,r);let A=0,C=0,P=0;for(A=0;A<n;A++){C=(A+1)%n;const t=i[C].x-i[A].x,e=i[C].y-i[A].y,s=-(m*(a*t)+x*(u*e)),r=f*(a*t)+g*(u*e),o=(s*f+r*m)*a,l=(s*g+r*x)*u,h=s*_+r*b;let c=1/0,d=-1/0;for(P=0;P<n;P++){const t=h+o*i[P].x+l*i[P].y;t<c&&(c=t),t>d&&(d=t)}const p=Math.hypot(s,r),y=s*w+r*T;if(d<y-S*p||y+S*p<c)return!1}let E=0,M=0,k=1/0;for(A=0;A<n;A++){const t=w-(_+f*(a*i[A].x)+g*(u*i[A].y)),e=T-(b+m*(a*i[A].x)+x*(u*i[A].y)),s=t*t+e*e;s<k&&(k=s,E=t,M=e)}if(0===k)return!0;{const t=E,e=M,s=(t*f+e*m)*a,r=(t*g+e*x)*u,o=t*_+e*b;let l=1/0,h=-1/0;for(A=0;A<n;A++){const t=o+s*i[A].x+r*i[A].y;t<l&&(l=t),t>h&&(h=t)}const c=Math.hypot(t,e),d=t*w+e*T;if(h<d-S*c||d+S*c<l)return!1}return!0}function p(t,e,s,r){const n=t.vertices,a=n.length;if(0===a)return!1;const o=e.scaleX.v,l=e.scaleY.v,h=e.rotation.cos,c=e.rotation.sin,u=h,d=c,p=-c,f=h,m=(t.x||0)*o,g=(t.y||0)*l,x=e.x.v+u*m+p*g,y=e.y.v+d*m+f*g,v=r.scaleX.v,_=r.scaleY.v,b=.5*i(s.width*v),w=.5*i(s.height*_),T=r.rotation.cos,S=r.rotation.sin,A=T,C=S,P=-S,E=T,M=(s.x||0)*v,k=(s.y||0)*_,R=r.x.v+A*M+P*k,B=r.y.v+C*M+E*k;let I=0,F=0,D=0;for(I=0;I<a;I++){F=(I+1)%a;const t=n[F].x-n[I].x,e=n[F].y-n[I].y,s=-(d*(o*t)+f*(l*e)),r=u*(o*t)+p*(l*e),i=(s*u+r*d)*o,h=(s*p+r*f)*l,c=s*x+r*y;let m=1/0,g=-1/0;for(D=0;D<a;D++){const t=c+i*n[D].x+h*n[D].y;t<m&&(m=t),t>g&&(g=t)}const v=s*A+r*C,_=s*P+r*E,T=b*(v<0?-v:v)+w*(_<0?-_:_),S=s*R+r*B;if(g<S-T||S+T<m)return!1}{const t=A,e=C,s=(t*u+e*d)*o,r=(t*p+e*f)*l,i=t*x+e*y;let h=1/0,c=-1/0;for(I=0;I<a;I++){const t=i+s*n[I].x+r*n[I].y;t<h&&(h=t),t>c&&(c=t)}const m=t*R+e*B;if(c<m-b||m+b<h)return!1}{const t=P,e=E,s=(t*u+e*d)*o,r=(t*p+e*f)*l,i=t*x+e*y;let h=1/0,c=-1/0;for(I=0;I<a;I++){const t=i+s*n[I].x+r*n[I].y;t<h&&(h=t),t>c&&(c=t)}const m=t*R+e*B;if(c<m-w||m+w<h)return!1}return!0}let f=0,m=0;var g;!function(t){t[t.None=0]="None",t[t.Ellipse=1]="Ellipse",t[t.OBB=2]="OBB",t[t.Circle=3]="Circle",t[t.Poly=4]="Poly",t[t.PolyLocal=5]="PolyLocal"}(g||(g={}));let x=0,y=0,v=0,_=0,b=0,w=0,T=0,S=0,A=0,C=0,P=0,E=0,M=0,k=null,R=0,B=0,I=0,F=0,D=0,O=0,G=0,U=0,L=0,N=0,X=0,Y=null;function V(t,e,s,r,i){const n=Math.hypot(t,e);if(0===n)return f=s,void(m=r);const a=1/n;f=s+t*a*i,m=r+e*a*i}function z(t,e,s,r,i,n,a,o,l,h){const c=t*i+e*n>=0?1:-1,u=t*a+e*o>=0?1:-1;f=s+i*l*c+a*h*u,m=r+n*l*c+o*h*u}function W(t,e){return t*e}function H(t,e,s,r,i,n,a,o,l,h){const c=t*i+W(e,n),u=t*a+W(e,o),d=Math.hypot(l*c,h*u);if(0===d)return f=s,void(m=r);const p=l*l*c/d,g=h*h*u/d;f=s+p*i+g*a,m=r+p*n+g*o}function j(t,e,s){let r=0,i=-1/0;for(let n=0,a=s.length;n<a;n++){const a=t*s[n].x+e*s[n].y;a>i&&(i=a,r=n)}f=s[r].x,m=s[r].y}function q(t,e,s,r,i,n,a,o,l,h,c){const u=(t*n+e*a)*h,d=(t*o+e*l)*c;let p=0,g=-1/0;for(let t=0,e=s.length;t<e;t++){const e=u*s[t].x+d*s[t].y;e>g&&(g=e,p=t)}const x=s[p].x,y=s[p].y;f=r+n*(h*x)+o*(c*y),m=i+a*(h*x)+l*(c*y)}function $(){const t=1e-18;let e=0,s=0,r=0,i=0,n=0,a=0,o=0,l=1,h=0;function c(){!function(t,e){1===x?H(t,e,v,_,b,w,T,S,A,C):2===x?z(t,e,v,_,b,w,T,S,P,E):3===x?V(t,e,v,_,M):4===x?j(t,e,k):5===x?q(t,e,k,v,_,b,w,T,S,A,C):(f=0,m=0)}(l,h);const t=f,c=m;!function(t,e){1===y?H(t,e,R,B,I,F,D,O,G,U):2===y?z(t,e,R,B,I,F,D,O,L,N):3===y?V(t,e,R,B,X):4===y?j(t,e,Y):5===y?q(t,e,Y,R,B,I,F,D,O,G,U):(f=0,m=0)}(-l,-h),n=r,a=i,r=e,i=s,e=t-f,s=c-m,o<3&&o++}if(c(),e*e+s*s<=t)return!0;l=-e,h=-s;for(let u=0;u<32;u++){if(l*l+h*h<=t)return!0;if(c(),e*l+s*h<=0)return!1;if(e*e+s*s<=t)return!0;if(2===o){const t=r-e,n=i-s,a=-e,o=-s,c=t*t+n*n,u=a*t+o*n;l=a*c-t*u,h=o*c-n*u;continue}const u=r-e,d=i-s,p=n-e,f=a-s,m=-e,g=-s,x=p*u+f*d,y=m*u+g*d;let v=m*x-p*y,_=g*x-f*y;if(v*m+_*g>0){n=r,a=i,o=2,l=v,h=_;continue}const b=u*p+d*f,w=m*p+g*f;let T=m*b-u*w,S=g*b-d*w;if(!(T*m+S*g>0))return!0;r=n,i=a,o=2,l=T,h=S}return!1}function K(t,e,s,r){const n=e.scaleX.v,a=e.scaleY.v;A=.5*i(t.width*n),C=.5*i(t.height*a);const o=e.rotation.cos,l=e.rotation.sin;b=o,w=l,T=-l,S=o;const h=(t.x||0)*n,c=(t.y||0)*a;v=e.x.v+b*h+T*c,_=e.y.v+w*h+S*c,x=1,k=null;const u=r.scaleX.v,d=r.scaleY.v;L=.5*i(s.width*u),N=.5*i(s.height*d);const p=r.rotation.cos,f=r.rotation.sin;I=p,F=f,D=-f,O=p;const m=(s.x||0)*u,g=(s.y||0)*d;return R=r.x.v+I*m+D*g,B=r.y.v+F*m+O*g,y=2,Y=null,$()}function Q(t,e,s,r){const n=e.scaleX.v,a=e.scaleY.v;A=.5*i(t.width*n),C=.5*i(t.height*a);const u=e.rotation.cos,d=e.rotation.sin;b=u,w=d,T=-d,S=u;const p=(t.x||0)*n,f=(t.y||0)*a;return v=e.x.v+b*p+T*f,_=e.y.v+w*p+S*f,x=1,k=null,h(s,r),R=o,B=l,X=c(s,r),y=3,Y=null,$()}function Z(t,e,s,r){const n=e.scaleX.v,a=e.scaleY.v,o=e.rotation.cos,l=e.rotation.sin,h=o,c=l,u=-l,d=o,p=(t.x||0)*n,f=(t.y||0)*a;v=e.x.v+h*p+u*f,_=e.y.v+c*p+d*f,b=h,w=c,T=u,S=d,A=n,C=a,k=t.vertices,x=5;const m=r.scaleX.v,g=r.scaleY.v;G=.5*i(s.width*m),U=.5*i(s.height*g);const P=r.rotation.cos,E=r.rotation.sin;I=P,F=E,D=-E,O=P;const M=(s.x||0)*m,L=(s.y||0)*g;return R=r.x.v+I*M+D*L,B=r.y.v+F*M+O*L,Y=null,y=1,$()}function J(t,e,s,n){return t.type===r.H.Rectangle&&s.type===r.H.Rectangle?function(t,e,s,r){const n=e.scaleX.v,o=e.scaleY.v,l=.5*i(t.width*n),h=.5*i(t.height*o),c=e.rotation.cos,u=e.rotation.sin,d=c,p=u,f=-u,m=c,g=(t.x||0)*n,x=(t.y||0)*o,y=e.x.v+d*g+f*x,v=e.y.v+p*g+m*x,_=r.scaleX.v,b=r.scaleY.v,w=.5*i(s.width*_),T=.5*i(s.height*b),S=r.rotation.cos,A=r.rotation.sin,C=S,P=A,E=-A,M=S,k=(s.x||0)*_,R=(s.y||0)*b,B=r.x.v+C*k+E*R,I=r.y.v+P*k+M*R,F=e.rotation.v,D=r.rotation.v;if(!(0!==F&&0!==F||0!==D&&0!==D)){const t=B-y,e=I-v;return(t<0?-t:t)<=l+w&&(e<0?-e:e)<=h+T}const O=B-y,G=I-v;return!(a(d,p,O,G,d,p,f,m,l,h,C,P,E,M,w,T)||a(f,m,O,G,d,p,f,m,l,h,C,P,E,M,w,T)||a(C,P,O,G,d,p,f,m,l,h,C,P,E,M,w,T)||a(E,M,O,G,d,p,f,m,l,h,C,P,E,M,w,T))}(t,e,s,n):t.type===r.H.Circle&&s.type===r.H.Circle?function(t,e,s,r){h(t,e);const i=o,n=l;h(s,r);const a=o-i,u=l-n,d=c(t,e)+c(s,r);return a*a+u*u<=d*d}(t,e,s,n):t.type===r.H.Rectangle&&s.type===r.H.Circle?u(t,e,s,n):t.type===r.H.Circle&&s.type===r.H.Rectangle?u(s,n,t,e):t.type===r.H.Polygon&&s.type===r.H.Polygon?function(t,e,s,r){const i=t.vertices,n=s.vertices,a=i.length,o=n.length;if(0===a||0===o)return!1;const l=e.scaleX.v,h=e.scaleY.v,c=e.rotation.cos,u=e.rotation.sin,d=c,p=u,f=-u,m=c,g=(t.x||0)*l,x=(t.y||0)*h,y=e.x.v+d*g+f*x,v=e.y.v+p*g+m*x,_=r.scaleX.v,b=r.scaleY.v,w=r.rotation.cos,T=r.rotation.sin,S=w,A=T,C=-T,P=w,E=(s.x||0)*_,M=(s.y||0)*b,k=r.x.v+S*E+C*M,R=r.y.v+A*E+P*M;let B=0,I=0,F=0;for(B=0;B<a;B++){I=(B+1)%a;const t=i[I].x-i[B].x,e=i[I].y-i[B].y,s=-(p*(l*t)+m*(h*e)),r=d*(l*t)+f*(h*e),c=(s*d+r*p)*l,u=(s*f+r*m)*h,g=s*y+r*v;let x=1/0,w=-1/0;for(F=0;F<a;F++){const t=g+c*i[F].x+u*i[F].y;t<x&&(x=t),t>w&&(w=t)}const T=(s*S+r*A)*_,E=(s*C+r*P)*b,M=s*k+r*R;let D=1/0,O=-1/0;for(F=0;F<o;F++){const t=M+T*n[F].x+E*n[F].y;t<D&&(D=t),t>O&&(O=t)}if(w<D||O<x)return!1}for(B=0;B<o;B++){I=(B+1)%o;const t=n[I].x-n[B].x,e=n[I].y-n[B].y,s=-(A*(_*t)+P*(b*e)),r=S*(_*t)+C*(b*e),c=(s*d+r*p)*l,u=(s*f+r*m)*h,g=s*y+r*v;let x=1/0,w=-1/0;for(F=0;F<a;F++){const t=g+c*i[F].x+u*i[F].y;t<x&&(x=t),t>w&&(w=t)}const T=(s*S+r*A)*_,E=(s*C+r*P)*b,M=s*k+r*R;let D=1/0,O=-1/0;for(F=0;F<o;F++){const t=M+T*n[F].x+E*n[F].y;t<D&&(D=t),t>O&&(O=t)}if(w<D||O<x)return!1}return!0}(t,e,s,n):t.type===r.H.Polygon&&s.type===r.H.Circle?d(t,e,s,n):t.type===r.H.Circle&&s.type===r.H.Polygon?d(s,n,t,e):t.type===r.H.Polygon&&s.type===r.H.Rectangle?p(t,e,s,n):t.type===r.H.Rectangle&&s.type===r.H.Polygon?p(s,n,t,e):t.type===r.H.Ellipse&&s.type===r.H.Rectangle?K(t,e,s,n):t.type===r.H.Rectangle&&s.type===r.H.Ellipse?K(s,n,t,e):t.type===r.H.Ellipse&&s.type===r.H.Circle?Q(t,e,s,n):t.type===r.H.Circle&&s.type===r.H.Ellipse?Q(s,n,t,e):t.type===r.H.Ellipse&&s.type===r.H.Ellipse?function(t,e,s,r){const n=e.scaleX.v,a=e.scaleY.v;A=.5*i(t.width*n),C=.5*i(t.height*a);const o=e.rotation.cos,l=e.rotation.sin;b=o,w=l,T=-l,S=o;const h=(t.x||0)*n,c=(t.y||0)*a;v=e.x.v+b*h+T*c,_=e.y.v+w*h+S*c,x=1,k=null;const u=r.scaleX.v,d=r.scaleY.v;G=.5*i(s.width*u),U=.5*i(s.height*d);const p=r.rotation.cos,f=r.rotation.sin;I=p,F=f,D=-f,O=p;const m=(s.x||0)*u,g=(s.y||0)*d;return R=r.x.v+I*m+D*g,B=r.y.v+F*m+O*g,y=1,Y=null,$()}(t,e,s,n):t.type===r.H.Polygon&&s.type===r.H.Ellipse?Z(t,e,s,n):t.type===r.H.Ellipse&&s.type===r.H.Polygon&&Z(s,n,t,e)}},3769:(t,e,s)=>{"use strict";s.d(e,{i:()=>i});var r=s(8271);function i(t,e){return"no-premultiply-alpha"===e.alphaMode&&r.Q[t]||t}},3798:(t,e,s)=>{"use strict";s.d(e,{j:()=>a});var r=s(1065),i=s(9586),n=s(2027);const a={extension:{type:r.Ag.ResolveParser,name:"resolveTexture"},test:i.P.test,parse:t=>({resolution:parseFloat(n.x.RETINA_PREFIX.exec(t)?.[1]??"1"),format:t.split(".").pop(),src:t})}},3809:(t,e,s)=>{"use strict";s.d(e,{B:()=>l});var r=s(769),i=s(9390),n=s(9739),a=s(9359),o=s(8598);class l extends a.v{constructor(t,e){super();const{textures:s,data:a}=t;Object.keys(a.pages).forEach(t=>{const e=a.pages[parseInt(t,10)],r=s[e.id];this.pages.push({texture:r})}),Object.keys(a.chars).forEach(t=>{const e=a.chars[t],{frame:o,source:l,rotate:h}=s[e.page],c=r.E.transformRectCoords(e,o,h,new i.M),u=new n.g({frame:c,orig:new i.M(0,0,e.width,e.height),source:l,rotate:h});this.chars[t]={id:t.codePointAt(0),xOffset:e.xOffset,yOffset:e.yOffset,xAdvance:e.xAdvance,kerning:e.kerning??{},texture:u}}),this.baseRenderedFontSize=a.fontSize,this.baseMeasurementFontSize=a.fontSize,this.fontMetrics={ascent:0,descent:0,fontSize:a.fontSize},this.baseLineOffset=a.baseLineOffset,this.lineHeight=a.lineHeight,this.fontFamily=a.fontFamily,this.distanceField=a.distanceField??{type:"none",range:0},this.url=e}destroy(){super.destroy();for(let t=0;t<this.pages.length;t++){const{texture:e}=this.pages[t];e.destroy(!0)}this.pages=null}static install(t){o.c.install(t)}static uninstall(t){o.c.uninstall(t)}}},3880:(t,e,s)=>{"use strict";s.d(e,{d:()=>r});var r=(t=>(t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY",t))(r||{})},3916:(t,e,s)=>{"use strict";var r=s(8034),i=s(166),n=s(6836);const a="spineTextureAtlasLoader",o={extension:i.AgS.Asset,resolver:{test:t=>(0,i.WOU)(t,".atlas"),parse:t=>{const e=t.split(".");return{resolution:parseFloat(i.xR6.RETINA_PREFIX?.exec(t)?.[1]??"1"),format:e[e.length-2],src:t}}},loader:{id:a,name:a,extension:{type:i.AgS.LoadParser,priority:i.T9C.Normal,name:a},test:t=>(0,i.WOU)(t,".atlas"),async load(t){const e=await i.eBH.get().fetch(t);return await e.text()},testParse(t,e){const s=(0,i.WOU)(e.src,".atlas"),r="string"==typeof t,n=e.parser===a||e.loadParser===a;return Promise.resolve((s||n)&&r)},unload(t){t.dispose()},async parse(t,e,s){const a=e.data||{};let o=i.AeT.dirname(e.src);o&&o.lastIndexOf("/")!==o.length-1&&(o+="/");const l=new r.Lw(t);if(a.images instanceof i.v9C||"string"==typeof a.images){const t=a.images;a.images={},a.images[l.pages[0].name]=t}const h=[];for(const t of l.pages){const r=t.name,l=a?.images?a.images[r]:void 0;if(l instanceof i.v9C)t.setTexture(n.R.from(l));else{const c=l??i.AeT.normalize([...o.split(i.AeT.sep),r].join(i.AeT.sep)),u={src:(0,i.Y8S)(c,e.src),data:{...a.imageMetadata,alphaMode:t.pma?"premultiplied-alpha":"premultiply-alpha-on-upload"}},d=s.load(u).then(e=>{t.setTexture(n.R.from(e.source))});h.push(d)}}return await Promise.all(h),l}}};i.XOh.add(o)},4025:(t,e,s)=>{"use strict";function r(t,e,s){const r=t.length;let i;if(e>=r||0===s)return;const n=r-(s=e+s>r?r-e:s);for(i=e;i<n;++i)t[i]=t[i+s];t.length=n}s.d(e,{d:()=>r})},4102:(t,e,s)=>{"use strict";s.d(e,{p:()=>n});var r=s(1065),i=s(5031);const n={extension:{type:r.Ag.DetectionParser,priority:0},test:async()=>(0,i.b)("video/mp4"),add:async t=>[...t,"mp4","m4v"],remove:async t=>t.filter(t=>"mp4"!==t&&"m4v"!==t)}},4132:(t,e,s)=>{"use strict";s.d(e,{i:()=>c,t:()=>l});var r=s(166),i=s(6793),n=s(7635);const a=new WeakMap;let o=0;function l(t,e){let s=a.get(e);return s||(s=new Map,a.set(e,s)),s.has(t)||s.set(t,`${t}#${o++}`),s.get(t)}class h extends i.a{#d=new Map;async doLoad(t,e,s){this.#d.set(t,e);const i=(async()=>{const i=await n.V.load(e);if(!i)return void console.error(`Failed to load texture: ${e}`);const a=new r.zo6(i,s);if(await a.parse(),this.loadingPromises.delete(t),this.hasActiveRef(t)){if(!this.cachedAssets.has(t))return this.cachedAssets.set(t,a),a;n.V.release(e),console.error(`Spritesheet already exists: ${e}`)}else n.V.release(e)})();return this.loadingPromises.set(t,i),await i}cleanup(t,e){e.destroy();const s=this.#d.get(t);s&&n.V.release(s)}}const c=new h},4142:(t,e,s)=>{"use strict";s.d(e,{u:()=>r});class r{constructor(t){"number"==typeof t?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}get float64View(){return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array}get bigUint64View(){return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this.uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}},4173:(t,e,s)=>{"use strict";s.d(e,{W:()=>i});var r=s(8869);function i(t,e){const s=t.split("?")[0],i=r.A.extname(s).toLowerCase();return Array.isArray(e)?e.includes(i):i===e}},4219:(t,e,s)=>{"use strict";s.d(e,{Qj:()=>f});var r=s(1065),i=s(5749),n=s(5180),a=s(2885),o=s(5031),l=s(3761),h=s(4173),c=s(9521);const u=[".mp4",".m4v",".webm",".ogg",".ogv",".h264",".avi",".mov"];let d,p;const f={name:"loadVideo",id:"video",extension:{type:r.Ag.LoadParser,name:"loadVideo"},test(t){if(!d||!p){const{validVideoExtensions:t,validVideoMime:e}=function(){const t=[],e=[];for(const s of u){const r=i.$.MIME_TYPES[s.substring(1)]||`video/${s.substring(1)}`;(0,o.b)(r)&&(t.push(s),e.includes(r)||e.push(r))}return{validVideoExtensions:t,validVideoMime:e}}();d=t,p=e}const e=(0,l.s)(t,p),s=(0,h.W)(t,d);return e||s},async load(t,e,s){const r={...i.$.defaultOptions,resolution:e.data?.resolution||(0,a.v)(t),alphaMode:e.data?.alphaMode||await(0,n.C)(),...e.data},o=document.createElement("video"),l={preload:!1!==r.autoLoad?"auto":void 0,"webkit-playsinline":!1!==r.playsinline?"":void 0,playsinline:!1!==r.playsinline?"":void 0,muted:!0===r.muted?"":void 0,loop:!0===r.loop?"":void 0,autoplay:!1!==r.autoPlay?"":void 0};Object.keys(l).forEach(t=>{const e=l[t];void 0!==e&&o.setAttribute(t,e)}),!0===r.muted&&(o.muted=!0),function(t,e,s){void 0!==s||e.startsWith("data:")?!1!==s&&(t.crossOrigin="string"==typeof s?s:"anonymous"):t.crossOrigin=function(t,e=globalThis.location){if(t.startsWith("data:"))return"";e||(e=globalThis.location);const s=new URL(t,document.baseURI);return s.hostname!==e.hostname||s.port!==e.port||s.protocol!==e.protocol?"anonymous":""}(e)}(o,t,r.crossorigin);const h=document.createElement("source");let u;if(r.mime)u=r.mime;else if(t.startsWith("data:"))u=t.slice(5,t.indexOf(";"));else if(!t.startsWith("blob:")){const e=t.split("?")[0].slice(t.lastIndexOf(".")+1).toLowerCase();u=i.$.MIME_TYPES[e]||`video/${e}`}return h.src=t,u&&(h.type=u),new Promise(n=>{const a=async()=>{const l=new i.$({...r,resource:o});var h;o.removeEventListener("canplay",a),e.data.preload&&await(h=o,new Promise((t,e)=>{function s(){i(),t()}function r(t){i(),e(t)}function i(){h.removeEventListener("canplaythrough",s),h.removeEventListener("error",r)}h.addEventListener("canplaythrough",s),h.addEventListener("error",r),h.load()})),n((0,c.s)(l,s,t))};r.preload&&!r.autoPlay&&o.load(),o.addEventListener("canplay",a),o.appendChild(h)})},unload(t){t.destroy(!0)}}},4242:(t,e,s)=>{"use strict";s.d(e,{k:()=>l});var r=s(7898),i=s(9739),n=s(3590),a=s(4696),o=s(4543);class l extends o.l{constructor(t=i.g.EMPTY){t instanceof i.g&&(t={texture:t});const{texture:e=i.g.EMPTY,anchor:s,roundPixels:n,width:a,height:o,...l}=t;super({label:"Sprite",...l}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new r.o({_onUpdate:()=>{this.onViewUpdate()}}),s?this.anchor=s:e.defaultAnchor&&(this.anchor=e.defaultAnchor),this.texture=e,this.allowChildren=!1,this.roundPixels=n??!1,void 0!==a&&(this.width=a),void 0!==o&&(this.height=o)}static from(t,e=!1){return t instanceof i.g?new l(t):new l(i.g.from(t,e))}set texture(t){t||(t=i.g.EMPTY);const e=this._texture;e!==t&&(e&&e.dynamic&&e.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get visualBounds(){return(0,n.y)(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return(0,a.t6)("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const t=this._anchor,e=this._texture,s=this._bounds,{width:r,height:i}=e.orig;s.minX=-t._x*r,s.maxX=s.minX+r,s.minY=-t._y*i,s.maxY=s.minY+i}destroy(t=!1){if(super.destroy(t),"boolean"==typeof t?t:t?.texture){const e="boolean"==typeof t?t:t?.textureSource;this._texture.destroy(e)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null,this._gpuData=null}get anchor(){return this._anchor}set anchor(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this._setWidth(t,this._texture.orig.width),this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this._setHeight(t,this._texture.orig.height),this._height=t}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this._texture.orig.width,t.height=Math.abs(this.scale.y)*this._texture.orig.height,t}setSize(t,e){"object"==typeof t?(e=t.height??t.width,t=t.width):e??(e=t),void 0!==t&&this._setWidth(t,this._texture.orig.width),void 0!==e&&this._setHeight(e,this._texture.orig.height)}}},4269:(t,e,s)=>{"use strict";s.d(e,{v:()=>h});var r=s(4872),i=s(9437),n=s(7604),a=s(9375),o=s(8896);const l=class t extends r.A{constructor(e={}){super(),this.options=e,this.uid=(0,a.L)("textureSource"),this._resourceType="textureSource",this._resourceId=(0,a.L)("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,e={...t.defaultOptions,...e},this.label=e.label??"",this.resource=e.resource,this.autoGarbageCollect=e.autoGarbageCollect,this._resolution=e.resolution,e.width?this.pixelWidth=e.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,e.height?this.pixelHeight=e.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=e.format,this.dimension=e.dimensions,this.mipLevelCount=e.mipLevelCount,this.autoGenerateMipmaps=e.autoGenerateMipmaps,this.sampleCount=e.sampleCount,this.antialias=e.antialias,this.alphaMode=e.alphaMode,this.style=new o.n((0,n.S)(e)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(t){this.style!==t&&(this._style?.off("change",this._onStyleChange,this),this._style=t,this._style?.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(t){this._style.maxAnisotropy=t}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(t){this._style.addressMode=t}get repeatMode(){return this._style.addressMode}set repeatMode(t){this._style.addressMode=t}get magFilter(){return this._style.magFilter}set magFilter(t){this._style.magFilter=t}get minFilter(){return this._style.minFilter}set minFilter(t){this._style.minFilter=t}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(t){this._style.mipmapFilter=t}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(t){this._style.lodMinClamp=t}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(t){this._style.lodMaxClamp=t}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const t=this._resolution;if(this.resize(this.resourceWidth/t,this.resourceHeight/t))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=(0,a.L)("resource"),this.emit("change",this),this.emit("unload",this)}get resourceWidth(){const{resource:t}=this;return t.naturalWidth||t.videoWidth||t.displayWidth||t.width}get resourceHeight(){const{resource:t}=this;return t.naturalHeight||t.videoHeight||t.displayHeight||t.height}get resolution(){return this._resolution}set resolution(t){this._resolution!==t&&(this._resolution=t,this.width=this.pixelWidth/t,this.height=this.pixelHeight/t)}resize(t,e,s){s||(s=this._resolution),t||(t=this.width),e||(e=this.height);const r=Math.round(t*s),i=Math.round(e*s);return this.width=r/s,this.height=i/s,this._resolution=s,(this.pixelWidth!==r||this.pixelHeight!==i)&&(this._refreshPOT(),this.pixelWidth=r,this.pixelHeight=i,this.emit("resize",this),this._resourceId=(0,a.L)("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(t){this._style.wrapMode=t}get wrapMode(){return this._style.wrapMode}set scaleMode(t){this._style.scaleMode=t}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=(0,i.f3)(this.pixelWidth)&&(0,i.f3)(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};l.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let h=l},4336:(t,e,s)=>{"use strict";s.d(e,{Z:()=>d});var r=s(5423),i=s(1065),n=s(5947),a=s(4386),o=s(2885),l=s(3761),h=s(4173),c=s(3463),u=s(9521);const d={extension:{type:i.Ag.LoadParser,priority:c.T.Low,name:"loadSVG"},name:"loadSVG",id:"svg",config:{crossOrigin:"anonymous",parseAsGraphicsContext:!1},test:t=>(0,l.s)(t,"image/svg+xml")||(0,h.W)(t,".svg"),async load(t,e,s){return e.data?.parseAsGraphicsContext??this.config.parseAsGraphicsContext?async function(t){const e=await r.e.get().fetch(t),s=await e.text(),i=new a.T;return i.svg(s),i}(t):async function(t,e,s,i){const a=await r.e.get().fetch(t),l=r.e.get().createImage();l.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(await a.text())}`,l.crossOrigin=i,await l.decode();const h=e.data?.width??l.width,c=e.data?.height??l.height,d=e.data?.resolution||(0,o.v)(t),p=Math.ceil(h*d),f=Math.ceil(c*d),m=r.e.get().createCanvas(p,f),g=m.getContext("2d");g.imageSmoothingEnabled=!0,g.imageSmoothingQuality="high",g.drawImage(l,0,0,h*d,c*d);const{parseAsGraphicsContext:x,...y}=e.data??{},v=new n.b({resource:m,alphaMode:"premultiply-alpha-on-upload",resolution:d,...y});return(0,u.s)(v,s,t)}(t,e,s,this.config.crossOrigin)},unload(t){t.destroy(!0)}}},4364:(t,e,s)=>{"use strict";function r(t,e){return`\n for (let i = 0; i < ${t*e}; i++) {\n data[offset + (((i / ${t})|0) * 4) + (i % ${t})] = v[i];\n }\n `}s.d(e,{_:()=>n,g:()=>i});const i={f32:"\n data[offset] = v;",i32:"\n dataInt32[offset] = v;","vec2<f32>":"\n data[offset] = v[0];\n data[offset + 1] = v[1];","vec3<f32>":"\n data[offset] = v[0];\n data[offset + 1] = v[1];\n data[offset + 2] = v[2];","vec4<f32>":"\n data[offset] = v[0];\n data[offset + 1] = v[1];\n data[offset + 2] = v[2];\n data[offset + 3] = v[3];","vec2<i32>":"\n dataInt32[offset] = v[0];\n dataInt32[offset + 1] = v[1];","vec3<i32>":"\n dataInt32[offset] = v[0];\n dataInt32[offset + 1] = v[1];\n dataInt32[offset + 2] = v[2];","vec4<i32>":"\n dataInt32[offset] = v[0];\n dataInt32[offset + 1] = v[1];\n dataInt32[offset + 2] = v[2];\n dataInt32[offset + 3] = v[3];","mat2x2<f32>":"\n data[offset] = v[0];\n data[offset + 1] = v[1];\n data[offset + 4] = v[2];\n data[offset + 5] = v[3];","mat3x3<f32>":"\n data[offset] = v[0];\n data[offset + 1] = v[1];\n data[offset + 2] = v[2];\n data[offset + 4] = v[3];\n data[offset + 5] = v[4];\n data[offset + 6] = v[5];\n data[offset + 8] = v[6];\n data[offset + 9] = v[7];\n data[offset + 10] = v[8];","mat4x4<f32>":"\n for (let i = 0; i < 16; i++) {\n data[offset + i] = v[i];\n }","mat3x2<f32>":r(3,2),"mat4x2<f32>":r(4,2),"mat2x3<f32>":r(2,3),"mat4x3<f32>":r(4,3),"mat2x4<f32>":r(2,4),"mat3x4<f32>":r(3,4)},n={...i,"mat2x2<f32>":"\n data[offset] = v[0];\n data[offset + 1] = v[1];\n data[offset + 2] = v[2];\n data[offset + 3] = v[3];\n "}},4382:(t,e,s)=>{"use strict";s.d(e,{e:()=>n,o:()=>i});var r=s(1347);class i{name;constructor(t){if(!t)throw new Error("name cannot be null.");this.name=t}}class n extends i{static nextID=0;id=n.nextID++;bones=null;vertices=[];worldVerticesLength=0;timelineAttachment=this;constructor(t){super(t)}computeWorldVertices(t,e,s,r,i,n){s=i+(s>>1)*n;let a=t.bone.skeleton,o=t.deform,l=this.vertices,h=this.bones;if(!h){o.length>0&&(l=o);let a=t.bone,h=a.worldX,c=a.worldY,u=a.a,d=a.b,p=a.c,f=a.d;for(let t=e,a=i;a<s;t+=2,a+=n){let e=l[t],s=l[t+1];r[a]=e*u+s*d+h,r[a+1]=e*p+s*f+c}return}let c=0,u=0;for(let t=0;t<e;t+=2){let t=h[c];c+=t+1,u+=t}let d=a.bones;if(0==o.length)for(let t=i,e=3*u;t<s;t+=n){let s=0,i=0,n=h[c++];for(n+=c;c<n;c++,e+=3){let t=d[h[c]],r=l[e],n=l[e+1],a=l[e+2];s+=(r*t.a+n*t.b+t.worldX)*a,i+=(r*t.c+n*t.d+t.worldY)*a}r[t]=s,r[t+1]=i}else{let t=o;for(let e=i,a=3*u,o=u<<1;e<s;e+=n){let s=0,i=0,n=h[c++];for(n+=c;c<n;c++,a+=3,o+=2){let e=d[h[c]],r=l[a]+t[o],n=l[a+1]+t[o+1],u=l[a+2];s+=(r*e.a+n*e.b+e.worldX)*u,i+=(r*e.c+n*e.d+e.worldY)*u}r[e]=s,r[e+1]=i}}}copyTo(t){this.bones?(t.bones=new Array(this.bones.length),r.Aq.arrayCopy(this.bones,0,t.bones,0,this.bones.length)):t.bones=null,this.vertices&&(t.vertices=r.Aq.newFloatArray(this.vertices.length),r.Aq.arrayCopy(this.vertices,0,t.vertices,0,this.vertices.length)),t.worldVerticesLength=this.worldVerticesLength,t.timelineAttachment=this.timelineAttachment}}},4386:(t,e,s)=>{"use strict";s.d(e,{T:()=>Q});var r=s(4872),i=s(6675),n=s(5199),a=s(59),o=s(9739),l=s(9375),h=s(4696),c=s(6170),u=s(7694),d=s(6929),p=s(9390);class f{constructor(t=0,e=0,s=0){this.type="circle",this.x=t,this.y=e,this.radius=s}clone(){return new f(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const s=this.radius*this.radius;let r=this.x-t,i=this.y-e;return r*=r,i*=i,r+i<=s}strokeContains(t,e,s,r=.5){if(0===this.radius)return!1;const i=this.x-t,n=this.y-e,a=this.radius,o=(1-r)*s,l=Math.sqrt(i*i+n*n);return l<=a+o&&l>a-(s-o)}getBounds(t){return t||(t=new p.M),t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=2*this.radius,t.height=2*this.radius,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class m{constructor(t=0,e=0,s=0,r=0){this.type="ellipse",this.x=t,this.y=e,this.halfWidth=s,this.halfHeight=r}clone(){return new m(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,e){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let s=(t-this.x)/this.halfWidth,r=(e-this.y)/this.halfHeight;return s*=s,r*=r,s+r<=1}strokeContains(t,e,s,r=.5){const{halfWidth:i,halfHeight:n}=this;if(i<=0||n<=0)return!1;const a=s*(1-r),o=s-a,l=i-o,h=n-o,c=i+a,u=n+a,d=t-this.x,p=e-this.y;return d*d/(l*l)+p*p/(h*h)>1&&d*d/(c*c)+p*p/(u*u)<=1}getBounds(t){return t||(t=new p.M),t.x=this.x-this.halfWidth,t.y=this.y-this.halfHeight,t.width=2*this.halfWidth,t.height=2*this.halfHeight,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function g(t,e,s,r,i,n){const a=i-s,o=n-r,l=a*a+o*o;let h,c,u=-1;0!==l&&(u=((t-s)*a+(e-r)*o)/l),u<0?(h=s,c=r):u>1?(h=i,c=n):(h=s+u*a,c=r+u*o);const d=t-h,p=e-c;return d*d+p*p}class x{constructor(...t){this.type="polygon";let e=Array.isArray(t[0])?t[0]:t;if("number"!=typeof e[0]){const t=[];for(let s=0,r=e.length;s<r;s++)t.push(e[s].x,e[s].y);e=t}this.points=e,this.closePath=!0}isClockwise(){let t=0;const e=this.points,s=e.length;for(let r=0;r<s;r+=2){const i=e[r],n=e[r+1];t+=(e[(r+2)%s]-i)*(e[(r+3)%s]+n)}return t<0}containsPolygon(t){const e=this.getBounds(void 0),s=t.getBounds(void 0);if(!e.containsRect(s))return!1;const r=t.points;for(let t=0;t<r.length;t+=2){const e=r[t],s=r[t+1];if(!this.contains(e,s))return!1}return!0}clone(){const t=this.points.slice(),e=new x(t);return e.closePath=this.closePath,e}contains(t,e){let s=!1;const r=this.points.length/2;for(let i=0,n=r-1;i<r;n=i++){const r=this.points[2*i],a=this.points[2*i+1],o=this.points[2*n],l=this.points[2*n+1];a>e!=l>e&&t<(e-a)/(l-a)*(o-r)+r&&(s=!s)}return s}strokeContains(t,e,s,r=.5){const i=s*s,n=i*(1-r),a=i-n,{points:o}=this,l=o.length-(this.closePath?0:2);for(let s=0;s<l;s+=2){const r=o[s],i=o[s+1],l=o[(s+2)%o.length],h=o[(s+3)%o.length];if(g(t,e,r,i,l,h)<=(Math.sign((l-r)*(e-i)-(h-i)*(t-r))<0?a:n))return!0}return!1}getBounds(t){t||(t=new p.M);const e=this.points;let s=1/0,r=-1/0,i=1/0,n=-1/0;for(let t=0,a=e.length;t<a;t+=2){const a=e[t],o=e[t+1];s=a<s?a:s,r=a>r?a:r,i=o<i?o:i,n=o>n?o:n}return t.x=s,t.width=r-s,t.y=i,t.height=n-i,t}copyFrom(t){return this.points=t.points.slice(),this.closePath=t.closePath,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((t,e)=>`${t}, ${e}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return(0,h.t6)("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return(0,h.t6)("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}}const y=(t,e,s,r,i,n,a)=>{const o=t-s,l=e-r,h=Math.sqrt(o*o+l*l);return h>=i-n&&h<=i+a};class v{constructor(t=0,e=0,s=0,r=0,i=20){this.type="roundedRectangle",this.x=t,this.y=e,this.width=s,this.height=r,this.radius=i}getBounds(t){return t||(t=new p.M),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new v(this.x,this.y,this.width,this.height,this.radius)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){const s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+s&&e<=this.y+this.height-s||t>=this.x+s&&t<=this.x+this.width-s)return!0;let r=t-(this.x+s),i=e-(this.y+s);const n=s*s;if(r*r+i*i<=n)return!0;if(r=t-(this.x+this.width-s),r*r+i*i<=n)return!0;if(i=e-(this.y+this.height-s),r*r+i*i<=n)return!0;if(r=t-(this.x+s),r*r+i*i<=n)return!0}return!1}strokeContains(t,e,s,r=.5){const{x:i,y:n,width:a,height:o,radius:l}=this,h=s*(1-r),c=s-h,u=i+l,d=n+l,p=i+a,f=n+o;return(t>=i-h&&t<=i+c||t>=p-c&&t<=p+h)&&e>=d&&e<=d+(o-2*l)||(e>=n-h&&e<=n+c||e>=f-c&&e<=f+h)&&t>=u&&t<=u+(a-2*l)||t<u&&e<d&&y(t,e,u,d,l,c,h)||t>p-l&&e<d&&y(t,e,p-l,d,l,c,h)||t>p-l&&e>f-l&&y(t,e,p-l,f-l,l,c,h)||t<u&&e>f-l&&y(t,e,u,f-l,l,c,h)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}var _=s(6364);const b=1.1920929e-7;function w(t,e,s,r,i,n,a,o,l,h){let c=(1-Math.min(.99,Math.max(0,h??_.GH.defaultOptions.bezierSmoothness)))/1;return c*=c,function(t,e,s,r,i,n,a,o,l,h){T(t,e,s,r,i,n,a,o,l,h,0),l.push(a,o)}(e,s,r,i,n,a,o,l,t,c),t}function T(t,e,s,r,i,n,a,o,l,h,c){if(c>8)return;Math.PI;const u=(t+s)/2,d=(e+r)/2,p=(s+i)/2,f=(r+n)/2,m=(i+a)/2,g=(n+o)/2,x=(u+p)/2,y=(d+f)/2,v=(p+m)/2,_=(f+g)/2,w=(x+v)/2,S=(y+_)/2;if(c>0){let c=a-t,u=o-e;const d=Math.abs((s-a)*u-(r-o)*c),p=Math.abs((i-a)*u-(n-o)*c);if(d>b&&p>b){if((d+p)*(d+p)<=h*(c*c+u*u))return void l.push(w,S)}else if(d>b){if(d*d<=h*(c*c+u*u))return void l.push(w,S)}else if(p>b){if(p*p<=h*(c*c+u*u))return void l.push(w,S)}else if(c=w-(t+a)/2,u=S-(e+o)/2,c*c+u*u<=h)return void l.push(w,S)}T(t,e,u,d,x,y,w,S,l,h,c+1),T(w,S,v,_,m,g,a,o,l,h,c+1)}function S(t,e,s,r,i,n,a,o){let l=(1-Math.min(.99,Math.max(0,o??_.GH.defaultOptions.bezierSmoothness)))/1;return l*=l,function(t,e,s,r,i,n,a,o){A(a,t,e,s,r,i,n,o,0),a.push(i,n)}(e,s,r,i,n,a,t,l),t}function A(t,e,s,r,i,n,a,o,l){if(l>8)return;Math.PI;const h=(e+r)/2,c=(s+i)/2,u=(r+n)/2,d=(i+a)/2,p=(h+u)/2,f=(c+d)/2;let m=n-e,g=a-s;const x=Math.abs((r-n)*g-(i-a)*m);if(x>1.1920929e-7){if(x*x<=o*(m*m+g*g))return void t.push(p,f)}else if(m=p-(e+n)/2,g=f-(s+a)/2,m*m+g*g<=o)return void t.push(p,f);A(t,e,s,h,c,p,f,o,l+1),A(t,p,f,u,d,n,a,o,l+1)}function C(t,e,s,r,i,n,a,o){let l=Math.abs(i-n);(!a&&i>n||a&&n>i)&&(l=2*Math.PI-l),o||(o=Math.max(6,Math.floor(6*Math.pow(r,1/3)*(l/Math.PI))));let h=l/(o=Math.max(o,3)),c=i;h*=a?-1:1;for(let i=0;i<o+1;i++){const i=e+Math.cos(c)*r,n=s+Math.sin(c)*r;t.push(i,n),c+=h}}const P=2*Math.PI,E={centerX:0,centerY:0,ang1:0,ang2:0},M=({x:t,y:e},s,r,i,n,a,o,l)=>{const h=i*(t*=s)-n*(e*=r),c=n*t+i*e;return l.x=h+a,l.y=c+o,l};function k(t,e){const s=-1.5707963267948966===e?-.551915024494:4/3*Math.tan(e/4),r=1.5707963267948966===e?.551915024494:s,i=Math.cos(t),n=Math.sin(t),a=Math.cos(t+e),o=Math.sin(t+e);return[{x:i-n*r,y:n+i*r},{x:a+o*r,y:o-a*r},{x:a,y:o}]}const R=(t,e,s,r)=>{let i=t*s+e*r;return i>1&&(i=1),i<-1&&(i=-1),(t*r-e*s<0?-1:1)*Math.acos(i)};const B=new p.M;class I{constructor(t){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new c.c,this._graphicsPath2D=t,this.signed=t.checkForHoles}moveTo(t,e){return this.startPoly(t,e),this}lineTo(t,e){this._ensurePoly();const s=this._currentPoly.points,r=s[s.length-2],i=s[s.length-1];return r===t&&i===e||s.push(t,e),this}arc(t,e,s,r,i,n){return this._ensurePoly(!1),C(this._currentPoly.points,t,e,s,r,i,n),this}arcTo(t,e,s,r,i){return this._ensurePoly(),function(t,e,s,r,i,n){const a=t[t.length-2],o=t[t.length-1]-s,l=a-e,h=i-s,c=r-e,u=Math.abs(o*c-l*h);if(u<1e-8||0===n)return void(t[t.length-2]===e&&t[t.length-1]===s||t.push(e,s));const d=o*o+l*l,p=h*h+c*c,f=o*h+l*c,m=n*Math.sqrt(d)/u,g=n*Math.sqrt(p)/u,x=m*f/d,y=g*f/p,v=m*c+g*l,_=m*h+g*o,b=l*(g+x),w=o*(g+x),T=c*(m+y),S=h*(m+y);C(t,v+e,_+s,n,Math.atan2(w-_,b-v),Math.atan2(S-_,T-v),l*h>c*o)}(this._currentPoly.points,t,e,s,r,i),this}arcToSvg(t,e,s,r,i,n,a){return function(t,e,s,r,i,n,a,o=0,l=0,h=0){if(0===n||0===a)return;const c=Math.sin(o*P/360),u=Math.cos(o*P/360),d=u*(e-r)/2+c*(s-i)/2,p=-c*(e-r)/2+u*(s-i)/2;if(0===d&&0===p)return;n=Math.abs(n),a=Math.abs(a);const f=Math.pow(d,2)/Math.pow(n,2)+Math.pow(p,2)/Math.pow(a,2);f>1&&(n*=Math.sqrt(f),a*=Math.sqrt(f)),((t,e,s,r,i,n,a,o,l,h,c,u,d)=>{const p=Math.pow(i,2),f=Math.pow(n,2),m=Math.pow(c,2),g=Math.pow(u,2);let x=p*f-p*g-f*m;x<0&&(x=0),x/=p*g+f*m,x=Math.sqrt(x)*(a===o?-1:1);const y=x*i/n*u,v=x*-n/i*c,_=h*y-l*v+(t+s)/2,b=l*y+h*v+(e+r)/2,w=(c-y)/i,T=(u-v)/n,S=(-c-y)/i,A=(-u-v)/n,C=R(1,0,w,T);let E=R(w,T,S,A);0===o&&E>0&&(E-=P),1===o&&E<0&&(E+=P),d.centerX=_,d.centerY=b,d.ang1=C,d.ang2=E})(e,s,r,i,n,a,l,h,c,u,d,p,E);let{ang1:m,ang2:g}=E;const{centerX:x,centerY:y}=E;let v=Math.abs(g)/(P/4);Math.abs(1-v)<1e-7&&(v=1);const _=Math.max(Math.ceil(v),1);g/=_;let b=t[t.length-2],T=t[t.length-1];const S={x:0,y:0};for(let e=0;e<_;e++){const e=k(m,g),{x:s,y:r}=M(e[0],n,a,u,c,x,y,S),{x:i,y:o}=M(e[1],n,a,u,c,x,y,S),{x:l,y:h}=M(e[2],n,a,u,c,x,y,S);w(t,b,T,s,r,i,o,l,h),b=l,T=h,m+=g}}(this._currentPoly.points,this._currentPoly.lastX,this._currentPoly.lastY,n,a,t,e,s,r,i),this}bezierCurveTo(t,e,s,r,i,n,a){this._ensurePoly();const o=this._currentPoly;return w(this._currentPoly.points,o.lastX,o.lastY,t,e,s,r,i,n,a),this}quadraticCurveTo(t,e,s,r,i){this._ensurePoly();const n=this._currentPoly;return S(this._currentPoly.points,n.lastX,n.lastY,t,e,s,r,i),this}closePath(){return this.endPoly(!0),this}addPath(t,e){this.endPoly(),e&&!e.isIdentity()&&(t=t.clone(!0)).transform(e);const s=this.shapePrimitives,r=s.length;for(let e=0;e<t.instructions.length;e++){const s=t.instructions[e];this[s.action](...s.data)}if(t.checkForHoles&&s.length-r>1){let t=null;for(let e=r;e<s.length;e++){const r=s[e];if("polygon"===r.shape.type){const i=r.shape,n=t?.shape;n&&n.containsPolygon(i)?(t.holes||(t.holes=[]),t.holes.push(r),s.copyWithin(e,e+1),s.length--,e--):t=r}}}return this}finish(t=!1){this.endPoly(t)}rect(t,e,s,r,i){return this.drawShape(new p.M(t,e,s,r),i),this}circle(t,e,s,r){return this.drawShape(new f(t,e,s),r),this}poly(t,e,s){const r=new x(t);return r.closePath=e,this.drawShape(r,s),this}regularPoly(t,e,s,r,i=0,n){r=Math.max(0|r,3);const a=-1*Math.PI/2+i,o=2*Math.PI/r,l=[];for(let i=0;i<r;i++){const r=a-i*o;l.push(t+s*Math.cos(r),e+s*Math.sin(r))}return this.poly(l,!0,n),this}roundPoly(t,e,s,r,i,n=0,a){if(r=Math.max(0|r,3),i<=0)return this.regularPoly(t,e,s,r,n);const o=s*Math.sin(Math.PI/r)-.001;i=Math.min(i,o);const l=-1*Math.PI/2+n,h=2*Math.PI/r,c=(r-2)*Math.PI/r/2;for(let n=0;n<r;n++){const r=n*h+l,o=t+s*Math.cos(r),u=e+s*Math.sin(r),d=r+Math.PI+c,p=r-Math.PI-c,f=o+i*Math.cos(d),m=u+i*Math.sin(d),g=o+i*Math.cos(p),x=u+i*Math.sin(p);0===n?this.moveTo(f,m):this.lineTo(f,m),this.quadraticCurveTo(o,u,g,x,a)}return this.closePath()}roundShape(t,e,s=!1,r){return t.length<3?this:(s?function(t,e,s,r){const i=(t,e)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),n=(t,e,s)=>({x:t.x+(e.x-t.x)*s,y:t.y+(e.y-t.y)*s}),a=e.length;for(let o=0;o<a;o++){const l=e[(o+1)%a],h=l.radius??s;if(h<=0){0===o?t.moveTo(l.x,l.y):t.lineTo(l.x,l.y);continue}const c=e[o],u=e[(o+2)%a],d=i(c,l);let p;p=d<1e-4?l:n(l,c,Math.min(d/2,h)/d);const f=i(u,l);let m;m=f<1e-4?l:n(l,u,Math.min(f/2,h)/f),0===o?t.moveTo(p.x,p.y):t.lineTo(p.x,p.y),t.quadraticCurveTo(l.x,l.y,m.x,m.y,r)}}(this,t,e,r):function(t,e,s){const r=(t,e)=>{const s=e.x-t.x,r=e.y-t.y,i=Math.sqrt(s*s+r*r);return{len:i,nx:s/i,ny:r/i}},i=(e,s)=>{0===e?t.moveTo(s.x,s.y):t.lineTo(s.x,s.y)};let n=e[e.length-1];for(let a=0;a<e.length;a++){const o=e[a%e.length],l=o.radius??s;if(l<=0){i(a,o),n=o;continue}const h=e[(a+1)%e.length],c=r(o,n),u=r(o,h);if(c.len<1e-4||u.len<1e-4){i(a,o),n=o;continue}let d=Math.asin(c.nx*u.ny-c.ny*u.nx),p=1,f=!1;c.nx*u.nx-c.ny*-u.ny<0?d<0?d=Math.PI+d:(d=Math.PI-d,p=-1,f=!0):d>0&&(p=-1,f=!0);const m=d/2;let g,x=Math.abs(Math.cos(m)*l/Math.sin(m));x>Math.min(c.len/2,u.len/2)?(x=Math.min(c.len/2,u.len/2),g=Math.abs(x*Math.sin(m)/Math.cos(m))):g=l;const y=o.x+u.nx*x+-u.ny*g*p,v=o.y+u.ny*x+u.nx*g*p,_=Math.atan2(c.ny,c.nx)+Math.PI/2*p,b=Math.atan2(u.ny,u.nx)-Math.PI/2*p;0===a&&t.moveTo(y+Math.cos(_)*g,v+Math.sin(_)*g),t.arc(y,v,g,_,b,f),n=o}}(this,t,e),this.closePath())}filletRect(t,e,s,r,i){if(0===i)return this.rect(t,e,s,r);const n=Math.min(s,r)/2,a=Math.min(n,Math.max(-n,i)),o=t+s,l=e+r,h=a<0?-a:0,c=Math.abs(a);return this.moveTo(t,e+c).arcTo(t+h,e+h,t+c,e,c).lineTo(o-c,e).arcTo(o-h,e+h,o,e+c,c).lineTo(o,l-c).arcTo(o-h,l-h,t+s-c,l,c).lineTo(t+c,l).arcTo(t+h,l-h,t,l-c,c).closePath()}chamferRect(t,e,s,r,i,n){if(i<=0)return this.rect(t,e,s,r);const a=Math.min(i,Math.min(s,r)/2),o=t+s,l=e+r,h=[t+a,e,o-a,e,o,e+a,o,l-a,o-a,l,t+a,l,t,l-a,t,e+a];for(let t=h.length-1;t>=2;t-=2)h[t]===h[t-2]&&h[t-1]===h[t-3]&&h.splice(t-1,2);return this.poly(h,!0,n)}ellipse(t,e,s,r,i){return this.drawShape(new m(t,e,s,r),i),this}roundRect(t,e,s,r,i,n){return this.drawShape(new v(t,e,s,r,i),n),this}drawShape(t,e){return this.endPoly(),this.shapePrimitives.push({shape:t,transform:e}),this}startPoly(t,e){let s=this._currentPoly;return s&&this.endPoly(),s=new x,s.points.push(t,e),this._currentPoly=s,this}endPoly(t=!1){const e=this._currentPoly;return e&&e.points.length>2&&(e.closePath=t,this.shapePrimitives.push({shape:e})),this._currentPoly=null,this}_ensurePoly(t=!0){if(!this._currentPoly&&(this._currentPoly=new x,t)){const t=this.shapePrimitives[this.shapePrimitives.length-1];if(t){let e=t.shape.x,s=t.shape.y;if(t.transform&&!t.transform.isIdentity()){const r=t.transform,i=e;e=r.a*e+r.c*s+r.tx,s=r.b*i+r.d*s+r.ty}this._currentPoly.points.push(e,s)}else this._currentPoly.points.push(0,0)}}buildPath(){const t=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let e=0;e<t.instructions.length;e++){const s=t.instructions[e];this[s.action](...s.data)}this.finish()}get bounds(){const t=this._bounds;t.clear();const e=this.shapePrimitives;for(let s=0;s<e.length;s++){const r=e[s],i=r.shape.getBounds(B);r.transform?t.addRect(i,r.transform):t.addRect(i)}return t}}class F{constructor(t,e=!1){this.instructions=[],this.uid=(0,l.L)("graphicsPath"),this._dirty=!0,this.checkForHoles=e,"string"==typeof t?function(t,e){const s=d(t),r=[];let i=null,n=0,a=0;for(let t=0;t<s.length;t++){const o=s[t],l=o[0],h=o;switch(l){case"M":n=h[1],a=h[2],e.moveTo(n,a);break;case"m":n+=h[1],a+=h[2],e.moveTo(n,a);break;case"H":n=h[1],e.lineTo(n,a);break;case"h":n+=h[1],e.lineTo(n,a);break;case"V":a=h[1],e.lineTo(n,a);break;case"v":a+=h[1],e.lineTo(n,a);break;case"L":n=h[1],a=h[2],e.lineTo(n,a);break;case"l":n+=h[1],a+=h[2],e.lineTo(n,a);break;case"C":n=h[5],a=h[6],e.bezierCurveTo(h[1],h[2],h[3],h[4],n,a);break;case"c":e.bezierCurveTo(n+h[1],a+h[2],n+h[3],a+h[4],n+h[5],a+h[6]),n+=h[5],a+=h[6];break;case"S":n=h[3],a=h[4],e.bezierCurveToShort(h[1],h[2],n,a);break;case"s":e.bezierCurveToShort(n+h[1],a+h[2],n+h[3],a+h[4]),n+=h[3],a+=h[4];break;case"Q":n=h[3],a=h[4],e.quadraticCurveTo(h[1],h[2],n,a);break;case"q":e.quadraticCurveTo(n+h[1],a+h[2],n+h[3],a+h[4]),n+=h[3],a+=h[4];break;case"T":n=h[1],a=h[2],e.quadraticCurveToShort(n,a);break;case"t":n+=h[1],a+=h[2],e.quadraticCurveToShort(n,a);break;case"A":n=h[6],a=h[7],e.arcToSvg(h[1],h[2],h[3],h[4],h[5],n,a);break;case"a":n+=h[6],a+=h[7],e.arcToSvg(h[1],h[2],h[3],h[4],h[5],n,a);break;case"Z":case"z":e.closePath(),r.length>0&&(i=r.pop(),i?(n=i.startX,a=i.startY):(n=0,a=0)),i=null;break;default:(0,u.R)(`Unknown SVG path command: ${l}`)}"Z"!==l&&"z"!==l&&null===i&&(i={startX:n,startY:a},r.push(i))}}(t,this):this.instructions=t?.slice()??[]}get shapePath(){return this._shapePath||(this._shapePath=new I(this)),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(t,e){return t=t.clone(),this.instructions.push({action:"addPath",data:[t,e]}),this._dirty=!0,this}arc(...t){return this.instructions.push({action:"arc",data:t}),this._dirty=!0,this}arcTo(...t){return this.instructions.push({action:"arcTo",data:t}),this._dirty=!0,this}arcToSvg(...t){return this.instructions.push({action:"arcToSvg",data:t}),this._dirty=!0,this}bezierCurveTo(...t){return this.instructions.push({action:"bezierCurveTo",data:t}),this._dirty=!0,this}bezierCurveToShort(t,e,s,r,i){const n=this.instructions[this.instructions.length-1],o=this.getLastPoint(a.b.shared);let l=0,h=0;if(n&&"bezierCurveTo"===n.action){l=n.data[2],h=n.data[3];const t=o.x,e=o.y;l=t+(t-l),h=e+(e-h)}else l=o.x,h=o.y;return this.instructions.push({action:"bezierCurveTo",data:[l,h,t,e,s,r,i]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=!0,this}ellipse(...t){return this.instructions.push({action:"ellipse",data:t}),this._dirty=!0,this}lineTo(...t){return this.instructions.push({action:"lineTo",data:t}),this._dirty=!0,this}moveTo(...t){return this.instructions.push({action:"moveTo",data:t}),this}quadraticCurveTo(...t){return this.instructions.push({action:"quadraticCurveTo",data:t}),this._dirty=!0,this}quadraticCurveToShort(t,e,s){const r=this.instructions[this.instructions.length-1],i=this.getLastPoint(a.b.shared);let n=0,o=0;if(r&&"quadraticCurveTo"===r.action){n=r.data[0],o=r.data[1];const t=i.x,e=i.y;n=t+(t-n),o=e+(e-o)}else n=i.x,o=i.y;return this.instructions.push({action:"quadraticCurveTo",data:[n,o,t,e,s]}),this._dirty=!0,this}rect(t,e,s,r,i){return this.instructions.push({action:"rect",data:[t,e,s,r,i]}),this._dirty=!0,this}circle(t,e,s,r){return this.instructions.push({action:"circle",data:[t,e,s,r]}),this._dirty=!0,this}roundRect(...t){return this.instructions.push({action:"roundRect",data:t}),this._dirty=!0,this}poly(...t){return this.instructions.push({action:"poly",data:t}),this._dirty=!0,this}regularPoly(...t){return this.instructions.push({action:"regularPoly",data:t}),this._dirty=!0,this}roundPoly(...t){return this.instructions.push({action:"roundPoly",data:t}),this._dirty=!0,this}roundShape(...t){return this.instructions.push({action:"roundShape",data:t}),this._dirty=!0,this}filletRect(...t){return this.instructions.push({action:"filletRect",data:t}),this._dirty=!0,this}chamferRect(...t){return this.instructions.push({action:"chamferRect",data:t}),this._dirty=!0,this}star(t,e,s,r,i,n,a){i||(i=r/2);const o=-1*Math.PI/2+n,l=2*s,h=2*Math.PI/l,c=[];for(let s=0;s<l;s++){const n=s%2?i:r,a=s*h+o;c.push(t+n*Math.cos(a),e+n*Math.sin(a))}return this.poly(c,!0,a),this}clone(t=!1){const e=new F;if(e.checkForHoles=this.checkForHoles,t)for(let t=0;t<this.instructions.length;t++){const s=this.instructions[t];e.instructions.push({action:s.action,data:s.data.slice()})}else e.instructions=this.instructions.slice();return e}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(t){if(t.isIdentity())return this;const e=t.a,s=t.b,r=t.c,i=t.d,n=t.tx,a=t.ty;let o=0,l=0,h=0,c=0,d=0,p=0,f=0,m=0;for(let g=0;g<this.instructions.length;g++){const x=this.instructions[g],y=x.data;switch(x.action){case"moveTo":case"lineTo":o=y[0],l=y[1],y[0]=e*o+r*l+n,y[1]=s*o+i*l+a;break;case"bezierCurveTo":h=y[0],c=y[1],d=y[2],p=y[3],o=y[4],l=y[5],y[0]=e*h+r*c+n,y[1]=s*h+i*c+a,y[2]=e*d+r*p+n,y[3]=s*d+i*p+a,y[4]=e*o+r*l+n,y[5]=s*o+i*l+a;break;case"quadraticCurveTo":h=y[0],c=y[1],o=y[2],l=y[3],y[0]=e*h+r*c+n,y[1]=s*h+i*c+a,y[2]=e*o+r*l+n,y[3]=s*o+i*l+a;break;case"arcToSvg":o=y[5],l=y[6],f=y[0],m=y[1],y[0]=e*f+r*m,y[1]=s*f+i*m,y[5]=e*o+r*l+n,y[6]=s*o+i*l+a;break;case"circle":y[4]=D(y[3],t);break;case"rect":y[4]=D(y[4],t);break;case"ellipse":y[8]=D(y[8],t);break;case"roundRect":y[5]=D(y[5],t);break;case"addPath":y[0].transform(t);break;case"poly":y[2]=D(y[2],t);break;default:(0,u.R)("unknown transform action",x.action)}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(t){let e=this.instructions.length-1,s=this.instructions[e];if(!s)return t.x=0,t.y=0,t;for(;"closePath"===s.action;){if(e--,e<0)return t.x=0,t.y=0,t;s=this.instructions[e]}switch(s.action){case"moveTo":case"lineTo":t.x=s.data[0],t.y=s.data[1];break;case"quadraticCurveTo":t.x=s.data[2],t.y=s.data[3];break;case"bezierCurveTo":t.x=s.data[4],t.y=s.data[5];break;case"arc":case"arcToSvg":t.x=s.data[5],t.y=s.data[6];break;case"addPath":s.data[0].getLastPoint(t)}return t}}function D(t,e){return t?t.prepend(e):e.clone()}var O=s(6406);function G(t,e,s){const r=t.getAttribute(e);return r?Number(r):s}function U(t){const e=G(t,"x1",0),s=G(t,"y1",0),r=G(t,"x2",1),n=G(t,"y2",0),a=t.getAttribute("gradientUnits")||"objectBoundingBox",o=new O._(e,s,r,n,"objectBoundingBox"===a?"local":"global");for(let e=0;e<t.children.length;e++){const s=t.children[e],r=G(s,"offset",0),n=i.Q.shared.setValue(s.getAttribute("stop-color")).toNumber();o.addColorStop(r,n)}return o}function L(t){return(0,u.R)("[SVG Parser] Radial gradients are not yet supported"),new O._(0,0,1,0)}function N(t){const e=t.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return e?e[1]:""}const X={fill:{type:"paint",default:0},"fill-opacity":{type:"number",default:1},stroke:{type:"paint",default:0},"stroke-width":{type:"number",default:1},"stroke-opacity":{type:"number",default:1},"stroke-linecap":{type:"string",default:"butt"},"stroke-linejoin":{type:"string",default:"miter"},"stroke-miterlimit":{type:"number",default:10},"stroke-dasharray":{type:"string",default:"none"},"stroke-dashoffset":{type:"number",default:0},opacity:{type:"number",default:1}};function Y(t,e){const s=t.getAttribute("style"),r={},i={},n={strokeStyle:r,fillStyle:i,useFill:!1,useStroke:!1};for(const s in X){const r=t.getAttribute(s);r&&V(e,n,s,r.trim())}if(s){const t=s.split(";");for(let s=0;s<t.length;s++){const r=t[s].trim(),[i,a]=r.split(":");X[i]&&V(e,n,i,a.trim())}}return{strokeStyle:n.useStroke?r:null,fillStyle:n.useFill?i:null,useFill:n.useFill,useStroke:n.useStroke}}function V(t,e,s,r){switch(s){case"stroke":if("none"!==r){if(r.startsWith("url(")){const s=N(r);e.strokeStyle.fill=t.defs[s]}else e.strokeStyle.color=i.Q.shared.setValue(r).toNumber();e.useStroke=!0}break;case"stroke-width":e.strokeStyle.width=Number(r);break;case"fill":if("none"!==r){if(r.startsWith("url(")){const s=N(r);e.fillStyle.fill=t.defs[s]}else e.fillStyle.color=i.Q.shared.setValue(r).toNumber();e.useFill=!0}break;case"fill-opacity":e.fillStyle.alpha=Number(r);break;case"stroke-opacity":e.strokeStyle.alpha=Number(r);break;case"opacity":e.fillStyle.alpha=Number(r),e.strokeStyle.alpha=Number(r)}}function z(t){const e=t.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!e||e.length<4)return 0;const s=e.map(Number),r=[],i=[];for(let t=0;t<s.length;t+=2)t+1<s.length&&(r.push(s[t]),i.push(s[t+1]));if(0===r.length||0===i.length)return 0;const n=Math.min(...r),a=Math.max(...r),o=Math.min(...i);return(a-n)*(Math.max(...i)-o)}function W(t,e){const s=new F(t,!1);for(const t of s.instructions)e.instructions.push(t)}function H(t,e,s,r){const i=t.children,{fillStyle:n,strokeStyle:a}=Y(t,e);n&&s?s={...s,...n}:n&&(s=n),a&&r?r={...r,...a}:a&&(r=a);const o=!s&&!r;let l,h,c,d,p,f,m,g,x,y,v,_,b,w,T,S,A;switch(o&&(s={color:0}),t.nodeName.toLowerCase()){case"path":{w=t.getAttribute("d");const i=t.getAttribute("fill-rule"),n=w.split(/(?=[Mm])/).filter(t=>t.trim().length>0),a="evenodd"===i,o=n.length>1;if(a&&o){const t=n.map(t=>({path:t,area:z(t)}));t.sort((t,e)=>e.area-t.area);const i=n.length>3||!function(t){if(t.length<=2)return!0;const e=t.map(t=>t.area).sort((t,e)=>e-t),[s,r]=e,i=e[e.length-1];return!(s/r>3&&r/i<2)}(t);if(i)for(let i=0;i<t.length;i++){const n=t[i],a=0===i;e.context.beginPath();const o=new F(void 0,!0);W(n.path,o),e.context.path(o),a?(s&&e.context.fill(s),r&&e.context.stroke(r)):e.context.cut()}else for(let i=0;i<t.length;i++){const n=t[i],a=i%2==1;e.context.beginPath();const o=new F(void 0,!0);W(n.path,o),e.context.path(o),a?e.context.cut():(s&&e.context.fill(s),r&&e.context.stroke(r))}}else T=new F(w,!i||"evenodd"===i),e.context.path(T),s&&e.context.fill(s),r&&e.context.stroke(r);break}case"circle":m=G(t,"cx",0),g=G(t,"cy",0),x=G(t,"r",0),e.context.ellipse(m,g,x,x),s&&e.context.fill(s),r&&e.context.stroke(r);break;case"rect":l=G(t,"x",0),h=G(t,"y",0),S=G(t,"width",0),A=G(t,"height",0),y=G(t,"rx",0),v=G(t,"ry",0),y||v?e.context.roundRect(l,h,S,A,y||v):e.context.rect(l,h,S,A),s&&e.context.fill(s),r&&e.context.stroke(r);break;case"ellipse":m=G(t,"cx",0),g=G(t,"cy",0),y=G(t,"rx",0),v=G(t,"ry",0),e.context.beginPath(),e.context.ellipse(m,g,y,v),s&&e.context.fill(s),r&&e.context.stroke(r);break;case"line":c=G(t,"x1",0),d=G(t,"y1",0),p=G(t,"x2",0),f=G(t,"y2",0),e.context.beginPath(),e.context.moveTo(c,d),e.context.lineTo(p,f),r&&e.context.stroke(r);break;case"polygon":b=t.getAttribute("points"),_=b.match(/\d+/g).map(t=>parseInt(t,10)),e.context.poly(_,!0),s&&e.context.fill(s),r&&e.context.stroke(r);break;case"polyline":b=t.getAttribute("points"),_=b.match(/\d+/g).map(t=>parseInt(t,10)),e.context.poly(_,!1),r&&e.context.stroke(r);break;case"g":case"svg":break;default:(0,u.R)(`[SVG parser] <${t.nodeName}> elements unsupported`)}o&&(s=null);for(let t=0;t<i.length;t++)H(i[t],e,s,r)}var j=s(5024);const q=new a.b,$=new n.u,K=class t extends r.A{constructor(){super(...arguments),this.uid=(0,l.L)("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this._activePath=new F,this._transform=new n.u,this._fillStyle={...t.defaultFillStyle},this._strokeStyle={...t.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new c.c,this._boundsDirty=!0}clone(){const e=new t;return e.batchMode=this.batchMode,e.instructions=this.instructions.slice(),e._activePath=this._activePath.clone(),e._transform=this._transform.clone(),e._fillStyle={...this._fillStyle},e._strokeStyle={...this._strokeStyle},e._stateStack=this._stateStack.slice(),e._bounds=this._bounds.clone(),e._boundsDirty=!0,e}get fillStyle(){return this._fillStyle}set fillStyle(e){this._fillStyle=(0,j.w)(e,t.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(e){this._strokeStyle=(0,j.T)(e,t.defaultStrokeStyle)}setFillStyle(e){return this._fillStyle=(0,j.w)(e,t.defaultFillStyle),this}setStrokeStyle(e){return this._strokeStyle=(0,j.w)(e,t.defaultStrokeStyle),this}texture(t,e,s,r,n,a){return this.instructions.push({action:"texture",data:{image:t,dx:s||0,dy:r||0,dw:n||t.frame.width,dh:a||t.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:e?i.Q.shared.setValue(e).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new F,this}fill(e,s){let r;const i=this.instructions[this.instructions.length-1];return r=0===this._tick&&i&&"stroke"===i.action?i.data.path:this._activePath.clone(),r?(null!=e&&(void 0!==s&&"number"==typeof e&&((0,h.t6)(h.lj,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),e={color:e,alpha:s}),this._fillStyle=(0,j.w)(e,t.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:r}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){const{x:t,y:e}=this._activePath.getLastPoint(a.b.shared);this._activePath.clear(),this._activePath.moveTo(t,e)}stroke(e){let s;const r=this.instructions[this.instructions.length-1];return s=0===this._tick&&r&&"fill"===r.action?r.data.path:this._activePath.clone(),s?(null!=e&&(this._strokeStyle=(0,j.T)(e,t.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:s}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let t=0;t<2;t++){const e=this.instructions[this.instructions.length-1-t],s=this._activePath.clone();if(e&&("stroke"===e.action||"fill"===e.action)){if(!e.data.hole){e.data.hole=s;break}e.data.hole.addPath(s)}}return this._initNextPathLocation(),this}arc(t,e,s,r,i,n){this._tick++;const a=this._transform;return this._activePath.arc(a.a*t+a.c*e+a.tx,a.b*t+a.d*e+a.ty,s,r,i,n),this}arcTo(t,e,s,r,i){this._tick++;const n=this._transform;return this._activePath.arcTo(n.a*t+n.c*e+n.tx,n.b*t+n.d*e+n.ty,n.a*s+n.c*r+n.tx,n.b*s+n.d*r+n.ty,i),this}arcToSvg(t,e,s,r,i,n,a){this._tick++;const o=this._transform;return this._activePath.arcToSvg(t,e,s,r,i,o.a*n+o.c*a+o.tx,o.b*n+o.d*a+o.ty),this}bezierCurveTo(t,e,s,r,i,n,a){this._tick++;const o=this._transform;return this._activePath.bezierCurveTo(o.a*t+o.c*e+o.tx,o.b*t+o.d*e+o.ty,o.a*s+o.c*r+o.tx,o.b*s+o.d*r+o.ty,o.a*i+o.c*n+o.tx,o.b*i+o.d*n+o.ty,a),this}closePath(){return this._tick++,this._activePath?.closePath(),this}ellipse(t,e,s,r){return this._tick++,this._activePath.ellipse(t,e,s,r,this._transform.clone()),this}circle(t,e,s){return this._tick++,this._activePath.circle(t,e,s,this._transform.clone()),this}path(t){return this._tick++,this._activePath.addPath(t,this._transform.clone()),this}lineTo(t,e){this._tick++;const s=this._transform;return this._activePath.lineTo(s.a*t+s.c*e+s.tx,s.b*t+s.d*e+s.ty),this}moveTo(t,e){this._tick++;const s=this._transform,r=this._activePath.instructions,i=s.a*t+s.c*e+s.tx,n=s.b*t+s.d*e+s.ty;return 1===r.length&&"moveTo"===r[0].action?(r[0].data[0]=i,r[0].data[1]=n,this):(this._activePath.moveTo(i,n),this)}quadraticCurveTo(t,e,s,r,i){this._tick++;const n=this._transform;return this._activePath.quadraticCurveTo(n.a*t+n.c*e+n.tx,n.b*t+n.d*e+n.ty,n.a*s+n.c*r+n.tx,n.b*s+n.d*r+n.ty,i),this}rect(t,e,s,r){return this._tick++,this._activePath.rect(t,e,s,r,this._transform.clone()),this}roundRect(t,e,s,r,i){return this._tick++,this._activePath.roundRect(t,e,s,r,i,this._transform.clone()),this}poly(t,e){return this._tick++,this._activePath.poly(t,e,this._transform.clone()),this}regularPoly(t,e,s,r,i=0,n){return this._tick++,this._activePath.regularPoly(t,e,s,r,i,n),this}roundPoly(t,e,s,r,i,n){return this._tick++,this._activePath.roundPoly(t,e,s,r,i,n),this}roundShape(t,e,s,r){return this._tick++,this._activePath.roundShape(t,e,s,r),this}filletRect(t,e,s,r,i){return this._tick++,this._activePath.filletRect(t,e,s,r,i),this}chamferRect(t,e,s,r,i,n){return this._tick++,this._activePath.chamferRect(t,e,s,r,i,n),this}star(t,e,s,r,i=0,n=0){return this._tick++,this._activePath.star(t,e,s,r,i,n,this._transform.clone()),this}svg(t){return this._tick++,function(t,e){if("string"==typeof t){const e=document.createElement("div");e.innerHTML=t.trim(),t=e.querySelector("svg")}const s={context:e,defs:{},path:new F};!function(t,e){const s=t.querySelectorAll("defs");for(let t=0;t<s.length;t++){const r=s[t];for(let t=0;t<r.children.length;t++){const s=r.children[t];switch(s.nodeName.toLowerCase()){case"lineargradient":e.defs[s.id]=U(s);break;case"radialgradient":e.defs[s.id]=L()}}}}(t,s);const r=t.children,{fillStyle:i,strokeStyle:n}=Y(t,s);for(let t=0;t<r.length;t++){const e=r[t];"defs"!==e.nodeName.toLowerCase()&&H(e,s,i,n)}}(t,this),this}restore(){const t=this._stateStack.pop();return t&&(this._transform=t.transform,this._fillStyle=t.fillStyle,this._strokeStyle=t.strokeStyle),this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(t){return this._transform.rotate(t),this}scale(t,e=t){return this._transform.scale(t,e),this}setTransform(t,e,s,r,i,a){return t instanceof n.u?(this._transform.set(t.a,t.b,t.c,t.d,t.tx,t.ty),this):(this._transform.set(t,e,s,r,i,a),this)}transform(t,e,s,r,i,a){return t instanceof n.u?(this._transform.append(t),this):($.set(t,e,s,r,i,a),this._transform.append($),this)}translate(t,e=t){return this._transform.translate(t,e),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this.dirty||(this.emit("update",this,16),this.dirty=!0,this._boundsDirty=!0)}get bounds(){if(!this._boundsDirty)return this._bounds;this._boundsDirty=!1;const t=this._bounds;t.clear();for(let e=0;e<this.instructions.length;e++){const s=this.instructions[e],r=s.action;if("fill"===r){const e=s.data;t.addBounds(e.path.bounds)}else if("texture"===r){const e=s.data;t.addFrame(e.dx,e.dy,e.dx+e.dw,e.dy+e.dh,e.transform)}if("stroke"===r){const e=s.data,r=e.style.alignment,i=e.style.width*(1-r),n=e.path.bounds;t.addFrame(n.minX-i,n.minY-i,n.maxX+i,n.maxY+i)}}return t}containsPoint(t){if(!this.bounds.containsPoint(t.x,t.y))return!1;const e=this.instructions;let s=!1;for(let r=0;r<e.length;r++){const i=e[r],n=i.data,a=n.path;if(!i.action||!a)continue;const o=n.style,l=a.shapePath.shapePrimitives;for(let e=0;e<l.length;e++){const r=l[e].shape;if(!o||!r)continue;const a=l[e].transform,h=a?a.applyInverse(t,q):t;if("fill"===i.action)s=r.contains(h.x,h.y);else{const t=o;s=r.strokeContains(h.x,h.y,t.width,t.alignment)}const c=n.hole;if(c){const t=c.shapePath?.shapePrimitives;if(t)for(let e=0;e<t.length;e++)t[e].shape.contains(h.x,h.y)&&(s=!1)}if(s)return!0}}return s}destroy(t=!1){if(this._stateStack.length=0,this._transform=null,this.emit("destroy",this),this.removeAllListeners(),"boolean"==typeof t?t:t?.texture){const e="boolean"==typeof t?t:t?.textureSource;this._fillStyle.texture&&(this._fillStyle.fill&&"uid"in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(e)),this._strokeStyle.texture&&(this._strokeStyle.fill&&"uid"in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(e))}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}};K.defaultFillStyle={color:16777215,alpha:1,texture:o.g.WHITE,matrix:null,fill:null,textureSpace:"local"},K.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:o.g.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:!1};let Q=K},4403:(t,e,s)=>{"use strict";s.d(e,{a:()=>r});class r{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let t=0;t<this.filters.length;t++)this.filters[t].destroy();this.filters=null,this.filterArea=null}}},4404:(t,e,s)=>{"use strict";s.d(e,{J:()=>_});var r=s(1065),i=s(656),n=s(1579),a=s(9798),o=s(8337);const l=new Float32Array(1),h=new Uint32Array(1);class c extends o.V{constructor(){const t=new n.h({data:l,label:"attribute-batch-buffer",usage:a.S.VERTEX|a.S.COPY_DST,shrinkToFit:!1});super({attributes:{aPosition:{buffer:t,format:"float32x2",stride:24,offset:0},aUV:{buffer:t,format:"float32x2",stride:24,offset:8},aColor:{buffer:t,format:"unorm8x4",stride:24,offset:16},aTextureIdAndRound:{buffer:t,format:"uint16x2",stride:24,offset:20}},indexBuffer:new n.h({data:h,label:"index-batch-buffer",usage:a.S.INDEX|a.S.COPY_DST,shrinkToFit:!1})})}}var u=s(9677),d=s(2305),p=s(1570),f=s(7335),m=s(2478),g=s(1657);class x extends g.M{constructor(t){super({glProgram:(0,u.I)({name:"batch",bits:[d.a,(0,p.P)(t),f.m]}),gpuProgram:(0,u.v)({name:"batch",bits:[d.F,(0,p._)(t),f.b]}),resources:{batchSamplers:(0,m.n)(t)}})}}let y=null;const v=class t extends i.i{constructor(e){super(e),this.geometry=new c,this.name=t.extension.name,this.vertexSize=6,y??(y=new x(e.maxTextures)),this.shader=y}packAttributes(t,e,s,r,i){const n=i<<16|65535&t.roundPixels,a=t.transform,o=a.a,l=a.b,h=a.c,c=a.d,u=a.tx,d=a.ty,{positions:p,uvs:f}=t,m=t.color,g=t.attributeOffset,x=g+t.attributeSize;for(let t=g;t<x;t++){const i=2*t,a=p[i],g=p[i+1];e[r++]=o*a+h*g+u,e[r++]=c*g+l*a+d,e[r++]=f[i],e[r++]=f[i+1],s[r++]=m,s[r++]=n}}packQuadAttributes(t,e,s,r,i){const n=t.texture,a=t.transform,o=a.a,l=a.b,h=a.c,c=a.d,u=a.tx,d=a.ty,p=t.bounds,f=p.maxX,m=p.minX,g=p.maxY,x=p.minY,y=n.uvs,v=t.color,_=i<<16|65535&t.roundPixels;e[r+0]=o*m+h*x+u,e[r+1]=c*x+l*m+d,e[r+2]=y.x0,e[r+3]=y.y0,s[r+4]=v,s[r+5]=_,e[r+6]=o*f+h*x+u,e[r+7]=c*x+l*f+d,e[r+8]=y.x1,e[r+9]=y.y1,s[r+10]=v,s[r+11]=_,e[r+12]=o*f+h*g+u,e[r+13]=c*g+l*f+d,e[r+14]=y.x2,e[r+15]=y.y2,s[r+16]=v,s[r+17]=_,e[r+18]=o*m+h*g+u,e[r+19]=c*g+l*m+d,e[r+20]=y.x3,e[r+21]=y.y3,s[r+22]=v,s[r+23]=_}};v.extension={type:[r.Ag.Batcher],name:"default"};let _=v},4405:(t,e,s)=>{"use strict";s.d(e,{Ls:()=>r,_Q:()=>i,mA:()=>n});const r={name:"local-uniform-bit",vertex:{header:"\n\n struct LocalUniforms {\n uTransformMatrix:mat3x3<f32>,\n uColor:vec4<f32>,\n uRound:f32,\n }\n\n @group(1) @binding(0) var<uniform> localUniforms : LocalUniforms;\n ",main:"\n vColor *= localUniforms.uColor;\n modelMatrix *= localUniforms.uTransformMatrix;\n ",end:"\n if(localUniforms.uRound == 1)\n {\n vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);\n }\n "}},i={...r,vertex:{...r.vertex,header:r.vertex.header.replace("group(1)","group(2)")}},n={name:"local-uniform-bit",vertex:{header:"\n\n uniform mat3 uTransformMatrix;\n uniform vec4 uColor;\n uniform float uRound;\n ",main:"\n vColor *= uColor;\n modelMatrix = uTransformMatrix;\n ",end:"\n if(uRound == 1.)\n {\n gl_Position.xy = roundPixels(gl_Position.xy, uResolution);\n }\n "}}},4419:(t,e,s)=>{"use strict";s.d(e,{oA:()=>a});var r,i=s(1984),n=s(1347);class a{static _emptyAnimation=new i.X5("<empty>",[],0);static emptyAnimation(){return a._emptyAnimation}data;tracks=new Array;timeScale=1;unkeyedState=0;events=new Array;listeners=new Array;queue=new l(this);propertyIDs=new n.eE;animationsChanged=!1;trackEntryPool=new n.bC(()=>new o);constructor(t){this.data=t}update(t){t*=this.timeScale;let e=this.tracks;for(let s=0,r=e.length;s<r;s++){let r=e[s];if(!r)continue;r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast;let i=t*r.timeScale;if(r.delay>0){if(r.delay-=i,r.delay>0)continue;i=-r.delay,r.delay=0}let n=r.next;if(n){let e=r.trackLast-n.delay;if(e>=0){for(n.delay=0,n.trackTime+=0==r.timeScale?0:(e/r.timeScale+t)*n.timeScale,r.trackTime+=i,this.setCurrent(s,n,!0);n.mixingFrom;)n.mixTime+=t,n=n.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){e[s]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,t)){let t=r.mixingFrom;for(r.mixingFrom=null,t&&(t.mixingTo=null);t;)this.queue.end(t),t=t.mixingFrom}r.trackTime+=i}this.queue.drain()}updateMixingFrom(t,e){let s=t.mixingFrom;if(!s)return!0;let r=this.updateMixingFrom(s,e);return s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast,-1!=t.nextTrackLast&&t.mixTime>=t.mixDuration?(0!=s.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=s.mixingFrom,null!=s.mixingFrom&&(s.mixingFrom.mixingTo=t),t.interruptAlpha=s.interruptAlpha,this.queue.end(s)),r):(s.trackTime+=e*s.timeScale,t.mixTime+=e,!1)}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let e=this.events,s=this.tracks,r=!1;for(let o=0,l=s.length;o<l;o++){let l=s[o];if(!l||l.delay>0)continue;r=!0;let c=0==o?i.qU.first:l.mixBlend,u=l.alpha;l.mixingFrom?u*=this.applyMixingFrom(l,t,c):l.trackTime>=l.trackEnd&&!l.next&&(u=0);let d=u>=l.alphaAttachmentThreshold,p=l.animationLast,f=l.getAnimationTime(),m=f,g=e;l.reverse&&(m=l.animation.duration-m,g=null);let x=l.animation.timelines,y=x.length;if(0==o&&1==u||c==i.qU.add){0==o&&(d=!0);for(let e=0;e<y;e++){n.Aq.webkit602BugfixHelper(u,c);var a=x[e];a instanceof i.zK?this.applyAttachmentTimeline(a,t,m,c,d):a.apply(t,p,m,g,u,c,i.mj.mixIn)}}else{let e=l.timelineMode,s=l.shortestRotation,r=!s&&l.timelinesRotation.length!=y<<1;r&&(l.timelinesRotation.length=y<<1);for(let a=0;a<y;a++){let o=x[a],f=e[a]==h?c:i.qU.setup;!s&&o instanceof i.NQ?this.applyRotateTimeline(o,t,m,u,f,l.timelinesRotation,a<<1,r):o instanceof i.zK?this.applyAttachmentTimeline(o,t,m,c,d):(n.Aq.webkit602BugfixHelper(u,c),o.apply(t,p,m,g,u,f,i.mj.mixIn))}}this.queueEvents(l,f),e.length=0,l.nextAnimationLast=f,l.nextTrackLast=l.trackTime}for(var o=this.unkeyedState+f,l=t.slots,c=0,u=t.slots.length;c<u;c++){var d=l[c];if(d.attachmentState==o){var p=d.data.attachmentName;d.setAttachment(p?t.getAttachment(d.data.index,p):null)}}return this.unkeyedState+=2,this.queue.drain(),r}applyMixingFrom(t,e,s){let r=t.mixingFrom;r.mixingFrom&&this.applyMixingFrom(r,e,s);let a=0;0==t.mixDuration?(a=1,s==i.qU.first&&(s=i.qU.setup)):(a=t.mixTime/t.mixDuration,a>1&&(a=1),s!=i.qU.first&&(s=r.mixBlend));let o=a<r.mixAttachmentThreshold,l=a<r.mixDrawOrderThreshold,p=r.animation.timelines,f=p.length,m=r.alpha*t.interruptAlpha,g=m*(1-a),x=r.animationLast,y=r.getAnimationTime(),v=y,_=null;if(r.reverse?v=r.animation.duration-v:a<r.eventThreshold&&(_=this.events),s==i.qU.add)for(let t=0;t<f;t++)p[t].apply(e,x,v,_,g,s,i.mj.mixOut);else{let t=r.timelineMode,a=r.timelineHoldMix,y=r.shortestRotation,b=!y&&r.timelinesRotation.length!=f<<1;b&&(r.timelinesRotation.length=f<<1),r.totalAlpha=0;for(let w=0;w<f;w++){let f,T=p[w],S=i.mj.mixOut,A=0;switch(t[w]){case h:if(!l&&T instanceof i.Kn)continue;f=s,A=g;break;case c:f=i.qU.setup,A=g;break;case u:f=s,A=m;break;case d:f=i.qU.setup,A=m;break;default:f=i.qU.setup;let t=a[w];A=m*Math.max(0,1-t.mixTime/t.mixDuration)}r.totalAlpha+=A,!y&&T instanceof i.NQ?this.applyRotateTimeline(T,e,v,A,f,r.timelinesRotation,w<<1,b):T instanceof i.zK?this.applyAttachmentTimeline(T,e,v,f,o&&A>=r.alphaAttachmentThreshold):(n.Aq.webkit602BugfixHelper(A,s),l&&T instanceof i.Kn&&f==i.qU.setup&&(S=i.mj.mixIn),T.apply(e,x,v,_,A,f,S))}}return t.mixDuration>0&&this.queueEvents(r,y),this.events.length=0,r.nextAnimationLast=y,r.nextTrackLast=r.trackTime,a}applyAttachmentTimeline(t,e,s,r,n){var a=e.slots[t.slotIndex];a.bone.active&&(s<t.frames[0]?r!=i.qU.setup&&r!=i.qU.first||this.setAttachment(e,a,a.data.attachmentName,n):this.setAttachment(e,a,t.attachmentNames[i.Kf.search1(t.frames,s)],n),a.attachmentState<=this.unkeyedState&&(a.attachmentState=this.unkeyedState+f))}setAttachment(t,e,s,r){e.setAttachment(s?t.getAttachment(e.data.index,s):null),r&&(e.attachmentState=this.unkeyedState+m)}applyRotateTimeline(t,e,s,r,a,o,l,h){if(h&&(o[l]=0),1==r)return void t.apply(e,0,s,null,1,a,i.mj.mixIn);let c=e.bones[t.boneIndex];if(!c.active)return;let u=0,d=0;if(s<t.frames[0])switch(a){case i.qU.setup:c.rotation=c.data.rotation;default:return;case i.qU.first:u=c.rotation,d=c.data.rotation}else u=a==i.qU.setup?c.data.rotation:c.rotation,d=c.data.rotation+t.getCurveValue(s);let p=0,f=d-u;if(f-=360*Math.ceil(f/360-.5),0==f)p=o[l];else{let t=0,e=0;h?(t=0,e=f):(t=o[l],e=o[l+1]);let s=t-t%360;p=f+s;let r=f>=0,i=t>=0;Math.abs(e)<=90&&n.cj.signum(e)!=n.cj.signum(f)&&(Math.abs(t-s)>180?(p+=360*n.cj.signum(t),i=r):0!=s?p-=360*n.cj.signum(t):i=r),i!=r&&(p+=360*n.cj.signum(t)),o[l]=p}o[l+1]=f,c.rotation=u+p*r}queueEvents(t,e){let s=t.animationStart,r=t.animationEnd,i=r-s,n=t.trackLast%i,a=this.events,o=0,l=a.length;for(;o<l;o++){let e=a[o];if(e.time<n)break;e.time>r||this.queue.event(t,e)}let h=!1;if(t.loop)if(0==i)h=!0;else{const e=Math.floor(t.trackTime/i);h=e>0&&e>Math.floor(t.trackLast/i)}else h=e>=r&&t.animationLast<r;for(h&&this.queue.complete(t);o<l;o++){let e=a[o];e.time<s||this.queue.event(t,e)}}clearTracks(){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let t=0,e=this.tracks.length;t<e;t++)this.clearTrack(t);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()}clearTrack(t){if(t>=this.tracks.length)return;let e=this.tracks[t];if(!e)return;this.queue.end(e),this.clearNext(e);let s=e;for(;;){let t=s.mixingFrom;if(!t)break;this.queue.end(t),s.mixingFrom=null,s.mixingTo=null,s=t}this.tracks[e.trackIndex]=null,this.queue.drain()}setCurrent(t,e,s){let r=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,r&&(s&&this.queue.interrupt(r),e.mixingFrom=r,r.mixingTo=e,e.mixTime=0,r.mixingFrom&&r.mixDuration>0&&(e.interruptAlpha*=Math.min(1,r.mixTime/r.mixDuration)),r.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,s=!1){let r=this.data.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,r,s)}setAnimationWith(t,e,s=!1){if(!e)throw new Error("animation cannot be null.");let r=!0,i=this.expandToIndex(t);i&&(-1==i.nextTrackLast?(this.tracks[t]=i.mixingFrom,this.queue.interrupt(i),this.queue.end(i),this.clearNext(i),i=i.mixingFrom,r=!1):this.clearNext(i));let n=this.trackEntry(t,e,s,i);return this.setCurrent(t,n,r),this.queue.drain(),n}addAnimation(t,e,s=!1,r=0){let i=this.data.skeletonData.findAnimation(e);if(!i)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,i,s,r)}addAnimationWith(t,e,s=!1,r=0){if(!e)throw new Error("animation cannot be null.");let i=this.expandToIndex(t);if(i)for(;i.next;)i=i.next;let n=this.trackEntry(t,e,s,i);return i?(i.next=n,n.previous=i,r<=0&&(r=Math.max(r+i.getTrackComplete()-n.mixDuration,0))):(this.setCurrent(t,n,!0),this.queue.drain(),r<0&&(r=0)),n.delay=r,n}setEmptyAnimation(t,e=0){let s=this.setAnimationWith(t,a.emptyAnimation(),!1);return s.mixDuration=e,s.trackEnd=e,s}addEmptyAnimation(t,e=0,s=0){let r=this.addAnimationWith(t,a.emptyAnimation(),!1,s);return s<=0&&(r.delay=Math.max(r.delay+r.mixDuration-e,0)),r.mixDuration=e,r.trackEnd=e,r}setEmptyAnimations(t=0){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,s=this.tracks.length;e<s;e++){let s=this.tracks[e];s&&this.setEmptyAnimation(s.trackIndex,t)}this.queue.drainDisabled=e,this.queue.drain()}expandToIndex(t){return t<this.tracks.length?this.tracks[t]:(n.Aq.ensureArrayCapacity(this.tracks,t+1,null),this.tracks.length=t+1,null)}trackEntry(t,e,s,r){let n=this.trackEntryPool.obtain();return n.reset(),n.trackIndex=t,n.animation=e,n.loop=s,n.holdPrevious=!1,n.reverse=!1,n.shortestRotation=!1,n.eventThreshold=0,n.alphaAttachmentThreshold=0,n.mixAttachmentThreshold=0,n.mixDrawOrderThreshold=0,n.animationStart=0,n.animationEnd=e.duration,n.animationLast=-1,n.nextAnimationLast=-1,n.delay=0,n.trackTime=0,n.trackLast=-1,n.nextTrackLast=-1,n.trackEnd=Number.MAX_VALUE,n.timeScale=1,n.alpha=1,n.mixTime=0,n.mixDuration=r?this.data.getMix(r.animation,e):0,n.interruptAlpha=1,n.totalAlpha=0,n.mixBlend=i.qU.replace,n}clearNext(t){let e=t.next;for(;e;)this.queue.dispose(e),e=e.next;t.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();let t=this.tracks;for(let e=0,s=t.length;e<s;e++){let s=t[e];if(s){for(;s.mixingFrom;)s=s.mixingFrom;do{s.mixingTo&&s.mixBlend==i.qU.add||this.computeHold(s),s=s.mixingTo}while(s)}}}computeHold(t){let e=t.mixingTo,s=t.animation.timelines,r=t.animation.timelines.length,n=t.timelineMode;n.length=r;let a=t.timelineHoldMix;a.length=0;let o=this.propertyIDs;if(e&&e.holdPrevious)for(let t=0;t<r;t++)n[t]=o.addAll(s[t].getPropertyIds())?d:u;else t:for(let l=0;l<r;l++){let r=s[l],u=r.getPropertyIds();if(o.addAll(u))if(!e||r instanceof i.zK||r instanceof i.Kn||r instanceof i.qs||!e.animation.hasTimeline(u))n[l]=c;else{for(let s=e.mixingTo;s;s=s.mixingTo)if(!s.animation.hasTimeline(u)){if(t.mixDuration>0){n[l]=p,a[l]=s;continue t}break}n[l]=d}else n[l]=h}}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}}class o{animation=null;previous=null;next=null;mixingFrom=null;mixingTo=null;listener=null;trackIndex=0;loop=!1;holdPrevious=!1;reverse=!1;shortestRotation=!1;eventThreshold=0;mixAttachmentThreshold=0;alphaAttachmentThreshold=0;mixDrawOrderThreshold=0;animationStart=0;animationEnd=0;animationLast=0;nextAnimationLast=0;delay=0;trackTime=0;trackLast=0;nextTrackLast=0;trackEnd=0;timeScale=0;alpha=0;mixTime=0;_mixDuration=0;interruptAlpha=0;totalAlpha=0;get mixDuration(){return this._mixDuration}set mixDuration(t){this._mixDuration=t}setMixDurationWithDelay(t,e){this._mixDuration=t,e<=0&&(e=null!=this.previous?Math.max(e+this.previous.getTrackComplete()-t,0):0),this.delay=e}mixBlend=i.qU.replace;timelineMode=new Array;timelineHoldMix=new Array;timelinesRotation=new Array;reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime<t)return t}return this.trackTime}wasApplied(){return-1!=this.nextTrackLast}isNextReady(){return null!=this.next&&this.nextTrackLast-this.next.delay>=0}}class l{objects=[];drainDisabled=!1;animState;constructor(t){this.animState=t}start(t){this.objects.push(r.start),this.objects.push(t),this.animState.animationsChanged=!0}interrupt(t){this.objects.push(r.interrupt),this.objects.push(t)}end(t){this.objects.push(r.end),this.objects.push(t),this.animState.animationsChanged=!0}dispose(t){this.objects.push(r.dispose),this.objects.push(t)}complete(t){this.objects.push(r.complete),this.objects.push(t)}event(t,e){this.objects.push(r.event),this.objects.push(t),this.objects.push(e)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let t=this.objects,e=this.animState.listeners;for(let s=0;s<t.length;s+=2){let i=t[s],n=t[s+1];switch(i){case r.start:n.listener&&n.listener.start&&n.listener.start(n);for(let t=0;t<e.length;t++){let s=e[t];s.start&&s.start(n)}break;case r.interrupt:n.listener&&n.listener.interrupt&&n.listener.interrupt(n);for(let t=0;t<e.length;t++){let s=e[t];s.interrupt&&s.interrupt(n)}break;case r.end:n.listener&&n.listener.end&&n.listener.end(n);for(let t=0;t<e.length;t++){let s=e[t];s.end&&s.end(n)}case r.dispose:n.listener&&n.listener.dispose&&n.listener.dispose(n);for(let t=0;t<e.length;t++){let s=e[t];s.dispose&&s.dispose(n)}this.animState.trackEntryPool.free(n);break;case r.complete:n.listener&&n.listener.complete&&n.listener.complete(n);for(let t=0;t<e.length;t++){let s=e[t];s.complete&&s.complete(n)}break;case r.event:let i=t[2+s++];n.listener&&n.listener.event&&n.listener.event(n,i);for(let t=0;t<e.length;t++){let s=e[t];s.event&&s.event(n,i)}}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}}!function(t){t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]="dispose",t[t.complete=4]="complete",t[t.event=5]="event"}(r||(r={}));const h=0,c=1,u=2,d=3,p=4,f=1,m=2},4449:(t,e,s)=>{"use strict";s.d(e,{k:()=>h});var r=s(9375),i=s(8642);const n=["f32","i32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>"],a=n.reduce((t,e)=>(t[e]=!0,t),{});function o(t,e){switch(t){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*e);case"vec3<f32>":return new Float32Array(3*e);case"vec4<f32>":return new Float32Array(4*e);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const l=class t{constructor(e,s){this._touched=0,this.uid=(0,r.L)("uniform"),this._resourceType="uniformGroup",this._resourceId=(0,r.L)("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,s={...t.defaultOptions,...s},this.uniformStructures=e;const l={};for(const t in e){const s=e[t];if(s.name=t,s.size=s.size??1,!a[s.type]){const t=s.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(t){const[,e,r]=t;throw new Error(`Uniform type ${s.type} is not supported. Use type: '${e}', size: ${r} instead.`)}throw new Error(`Uniform type ${s.type} is not supported. Supported uniform types are: ${n.join(", ")}`)}s.value??(s.value=o(s.type,s.size)),l[t]=s.value}this.uniforms=l,this._dirtyId=1,this.ubo=s.ubo,this.isStatic=s.isStatic,this._signature=(0,i.X)(Object.keys(l).map(t=>`${t}-${e[t].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};l.defaultOptions={ubo:!1,isStatic:!1};let h=l},4454:(t,e,s)=>{"use strict";s.d(e,{A:()=>a});var r=s(4696),i=s(4543),n=s(4386);class a extends i.l{constructor(t){t instanceof n.T&&(t={context:t});const{context:e,roundPixels:s,...r}=t||{};super({label:"Graphics",...r}),this.renderPipeId="graphics",this._context=e||(this._ownedContext=new n.T),this._context.on("update",this.onViewUpdate,this),this.didViewUpdate=!0,this.allowChildren=!1,this.roundPixels=s??!1}set context(t){t!==this._context&&(this._context.off("update",this.onViewUpdate,this),this._context=t,this._context.on("update",this.onViewUpdate,this),this.onViewUpdate())}get context(){return this._context}get bounds(){return this._context.bounds}updateBounds(){}containsPoint(t){return this._context.containsPoint(t)}destroy(t){this._ownedContext&&!t?this._ownedContext.destroy(t):!0!==t&&!0!==t?.context||this._context.destroy(t),this._ownedContext=null,this._context=null,super.destroy(t)}_callContextMethod(t,e){return this.context[t](...e),this}setFillStyle(...t){return this._callContextMethod("setFillStyle",t)}setStrokeStyle(...t){return this._callContextMethod("setStrokeStyle",t)}fill(...t){return this._callContextMethod("fill",t)}stroke(...t){return this._callContextMethod("stroke",t)}texture(...t){return this._callContextMethod("texture",t)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...t){return this._callContextMethod("arc",t)}arcTo(...t){return this._callContextMethod("arcTo",t)}arcToSvg(...t){return this._callContextMethod("arcToSvg",t)}bezierCurveTo(...t){return this._callContextMethod("bezierCurveTo",t)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...t){return this._callContextMethod("ellipse",t)}circle(...t){return this._callContextMethod("circle",t)}path(...t){return this._callContextMethod("path",t)}lineTo(...t){return this._callContextMethod("lineTo",t)}moveTo(...t){return this._callContextMethod("moveTo",t)}quadraticCurveTo(...t){return this._callContextMethod("quadraticCurveTo",t)}rect(...t){return this._callContextMethod("rect",t)}roundRect(...t){return this._callContextMethod("roundRect",t)}poly(...t){return this._callContextMethod("poly",t)}regularPoly(...t){return this._callContextMethod("regularPoly",t)}roundPoly(...t){return this._callContextMethod("roundPoly",t)}roundShape(...t){return this._callContextMethod("roundShape",t)}filletRect(...t){return this._callContextMethod("filletRect",t)}chamferRect(...t){return this._callContextMethod("chamferRect",t)}star(...t){return this._callContextMethod("star",t)}svg(...t){return this._callContextMethod("svg",t)}restore(...t){return this._callContextMethod("restore",t)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...t){return this._callContextMethod("rotate",t)}scaleTransform(...t){return this._callContextMethod("scale",t)}setTransform(...t){return this._callContextMethod("setTransform",t)}transform(...t){return this._callContextMethod("transform",t)}translateTransform(...t){return this._callContextMethod("translate",t)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(t){this._context.fillStyle=t}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(t){this._context.strokeStyle=t}clone(t=!1){return t?new a(this._context.clone()):(this._ownedContext=null,new a(this._context))}lineStyle(t,e,s){(0,r.t6)(r.lj,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");const i={};return t&&(i.width=t),e&&(i.color=e),s&&(i.alpha=s),this.context.strokeStyle=i,this}beginFill(t,e){(0,r.t6)(r.lj,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");const s={};return void 0!==t&&(s.color=t),void 0!==e&&(s.alpha=e),this.context.fillStyle=s,this}endFill(){(0,r.t6)(r.lj,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();const t=this.context.strokeStyle;return t.width===n.T.defaultStrokeStyle.width&&t.color===n.T.defaultStrokeStyle.color&&t.alpha===n.T.defaultStrokeStyle.alpha||this.context.stroke(),this}drawCircle(...t){return(0,r.t6)(r.lj,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",t)}drawEllipse(...t){return(0,r.t6)(r.lj,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",t)}drawPolygon(...t){return(0,r.t6)(r.lj,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",t)}drawRect(...t){return(0,r.t6)(r.lj,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",t)}drawRoundedRect(...t){return(0,r.t6)(r.lj,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",t)}drawStar(...t){return(0,r.t6)(r.lj,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",t)}}},4543:(t,e,s)=>{"use strict";s.d(e,{l:()=>n});var r=s(6170),i=s(4687);class n extends i.mc{constructor(t){super(t),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this._bounds=new r.c(0,1,0,0),this._boundsDirty=!0}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=!1,this._bounds):this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(t){this._roundPixels=t?1:0}containsPoint(t){const e=this.bounds,{x:s,y:r}=t;return s>=e.minX&&s<=e.maxX&&r>=e.minY&&r<=e.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this)}destroy(t){super.destroy(t),this._bounds=null;for(const t in this._gpuData)this._gpuData[t].destroy?.();this._gpuData=null}collectRenderablesSimple(t,e,s){const{renderPipes:r}=e;r.blendMode.pushBlendMode(this,this.groupBlendMode,t),r[this.renderPipeId].addRenderable(this,t),this.didViewUpdate=!1;const i=this.children,n=i.length;for(let r=0;r<n;r++)i[r].collectRenderables(t,e,s);r.blendMode.popBlendMode(t)}}},4550:(t,e,s)=>{"use strict";var r=s(1065),i=s(1228),n=s(4696),a=s(1174);const o=class t extends a.u{constructor(...t){super({});let e=t[0]??{};"number"==typeof e&&((0,n.t6)(n.lj,"PlaneGeometry constructor changed please use { width, height, verticesX, verticesY } instead"),e={width:e,height:t[1],verticesX:t[2],verticesY:t[3]}),this.build(e)}build(e){e={...t.defaultOptions,...e},this.verticesX=this.verticesX??e.verticesX,this.verticesY=this.verticesY??e.verticesY,this.width=this.width??e.width,this.height=this.height??e.height;const s=this.verticesX*this.verticesY,r=[],i=[],n=[],a=this.verticesX-1,o=this.verticesY-1,l=this.width/a,h=this.height/o;for(let t=0;t<s;t++){const e=t%this.verticesX,s=t/this.verticesX|0;r.push(e*l,s*h),i.push(e/a,s/o)}const c=a*o;for(let t=0;t<c;t++){const e=t%a,s=t/a|0,r=s*this.verticesX+e,i=s*this.verticesX+e+1,o=(s+1)*this.verticesX+e,l=(s+1)*this.verticesX+e+1;n.push(r,i,o,i,l,o)}this.buffers[0].data=new Float32Array(r),this.buffers[1].data=new Float32Array(i),this.indexBuffer.data=new Uint32Array(n),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()}};o.defaultOptions={width:100,height:100,verticesX:10,verticesY:10};let l=o;const h=class t extends l{constructor(e={}){super({width:(e={...t.defaultOptions,...e}).width,height:e.height,verticesX:4,verticesY:4}),this.update(e)}update(t){this.width=t.width??this.width,this.height=t.height??this.height,this._originalWidth=t.originalWidth??this._originalWidth,this._originalHeight=t.originalHeight??this._originalHeight,this._leftWidth=t.leftWidth??this._leftWidth,this._rightWidth=t.rightWidth??this._rightWidth,this._topHeight=t.topHeight??this._topHeight,this._bottomHeight=t.bottomHeight??this._bottomHeight,this._anchorX=t.anchor?.x,this._anchorY=t.anchor?.y,this.updateUvs(),this.updatePositions()}updatePositions(){const t=this.positions,{width:e,height:s,_leftWidth:r,_rightWidth:i,_topHeight:n,_bottomHeight:a,_anchorX:o,_anchorY:l}=this,h=r+i,c=e>h?1:e/h,u=n+a,d=s>u?1:s/u,p=Math.min(c,d),f=o*e,m=l*s;t[0]=t[8]=t[16]=t[24]=-f,t[2]=t[10]=t[18]=t[26]=r*p-f,t[4]=t[12]=t[20]=t[28]=e-i*p-f,t[6]=t[14]=t[22]=t[30]=e-f,t[1]=t[3]=t[5]=t[7]=-m,t[9]=t[11]=t[13]=t[15]=n*p-m,t[17]=t[19]=t[21]=t[23]=s-a*p-m,t[25]=t[27]=t[29]=t[31]=s-m,this.getBuffer("aPosition").update()}updateUvs(){const t=this.uvs;t[0]=t[8]=t[16]=t[24]=0,t[1]=t[3]=t[5]=t[7]=0,t[6]=t[14]=t[22]=t[30]=1,t[25]=t[27]=t[29]=t[31]=1;const e=1/this._originalWidth,s=1/this._originalHeight;t[2]=t[10]=t[18]=t[26]=e*this._leftWidth,t[9]=t[11]=t[13]=t[15]=s*this._topHeight,t[4]=t[12]=t[20]=t[28]=1-e*this._rightWidth,t[17]=t[19]=t[21]=t[23]=1-s*this._bottomHeight,this.getBuffer("aUV").update()}};h.defaultOptions={width:100,height:100,leftWidth:10,topHeight:10,rightWidth:10,bottomHeight:10,originalWidth:100,originalHeight:100};let c=h;class u extends i.U{constructor(){super(),this.geometry=new c}destroy(){this.geometry.destroy()}}class d{constructor(t){this._renderer=t}addRenderable(t,e){const s=this._getGpuSprite(t);t.didViewUpdate&&this._updateBatchableSprite(t,s),this._renderer.renderPipes.batch.addToBatch(s,e)}updateRenderable(t){const e=this._getGpuSprite(t);t.didViewUpdate&&this._updateBatchableSprite(t,e),e._batcher.updateElement(e)}validateRenderable(t){const e=this._getGpuSprite(t);return!e._batcher.checkAndUpdateTexture(e,t._texture)}_updateBatchableSprite(t,e){e.geometry.update(t),e.setTexture(t._texture)}_getGpuSprite(t){return t._gpuData[this._renderer.uid]||this._initGPUSprite(t)}_initGPUSprite(t){const e=t._gpuData[this._renderer.uid]=new u,s=e;return s.renderable=t,s.transform=t.groupTransform,s.texture=t._texture,s.roundPixels=this._renderer._roundPixels|t._roundPixels,t.didViewUpdate||this._updateBatchableSprite(t,s),e}destroy(){this._renderer=null}}d.extension={type:[r.Ag.WebGLPipes,r.Ag.WebGPUPipes,r.Ag.CanvasPipes],name:"nineSliceSprite"},r.XO.add(d)},4566:(t,e,s)=>{"use strict";s.d(e,{D:()=>r});const r={test:t=>"string"==typeof t&&t.startsWith("info face="),parse(t){const e=t.match(/^[a-z]+\s+.+$/gm),s={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const t in e){const r=e[t].match(/^[a-z]+/gm)[0],i=e[t].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),n={};for(const t in i){const e=i[t].split("="),s=e[0],r=e[1].replace(/"/gm,""),a=parseFloat(r),o=isNaN(a)?r:a;n[s]=o}s[r].push(n)}const r={chars:{},pages:[],lineHeight:0,fontSize:0,fontFamily:"",distanceField:null,baseLineOffset:0},[i]=s.info,[n]=s.common,[a]=s.distanceField??[];a&&(r.distanceField={range:parseInt(a.distanceRange,10),type:a.fieldType}),r.fontSize=parseInt(i.size,10),r.fontFamily=i.face,r.lineHeight=parseInt(n.lineHeight,10);const o=s.page;for(let t=0;t<o.length;t++)r.pages.push({id:parseInt(o[t].id,10)||0,file:o[t].file});const l={};r.baseLineOffset=r.lineHeight-parseInt(n.base,10);const h=s.char;for(let t=0;t<h.length;t++){const e=h[t],s=parseInt(e.id,10);let i=e.letter??e.char??String.fromCharCode(s);"space"===i&&(i=" "),l[s]=i,r.chars[i]={id:s,page:parseInt(e.page,10)||0,x:parseInt(e.x,10),y:parseInt(e.y,10),width:parseInt(e.width,10),height:parseInt(e.height,10),xOffset:parseInt(e.xoffset,10),yOffset:parseInt(e.yoffset,10),xAdvance:parseInt(e.xadvance,10),kerning:{}}}const c=s.kerning||[];for(let t=0;t<c.length;t++){const e=parseInt(c[t].first,10),s=parseInt(c[t].second,10),i=parseInt(c[t].amount,10);r.chars[l[s]].kerning[l[e]]=i}return r}}},4582:(t,e,s)=>{"use strict";s.d(e,{L:()=>i});var r=s(9375);class i{constructor(){this.uid=(0,r.L)("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0}reset(){this.instructionSize=0}destroy(){this.instructions.length=0,this.renderables.length=0,this.renderPipes=null,this.gcTick=0}add(t){this.instructions[this.instructionSize++]=t}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}},4614:(t,e,s)=>{"use strict";s.d(e,{TO:()=>r,Td:()=>n,bO:()=>i});const r=2*Math.PI,i=180/Math.PI,n=Math.PI/180},4687:(t,e,s)=>{"use strict";s.d(e,{mc:()=>H,u:()=>z,ig:()=>V,fR:()=>W});var r=s(4872),i=s(6675),n=s(1065),a=s(5199),o=s(4614),l=s(7898),h=s(9375),c=s(4696),u=s(7694),d=s(761);const p={get isCachedAsTexture(){return!!this.renderGroup?.isCachedAsTexture},cacheAsTexture(t){"boolean"==typeof t&&!1===t?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(!0===t?{}:t))},updateCacheTexture(){this.renderGroup?.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(t){(0,c.t6)("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(t)}};var f=s(4025);const m={allowChildren:!0,removeChildren(t=0,e){const s=e??this.children.length,r=s-t,i=[];if(r>0&&r<=s){for(let e=s-1;e>=t;e--){const t=this.children[e];t&&(i.push(t),t.parent=null)}(0,f.d)(this.children,t,s);const e=this.renderGroup||this.parentRenderGroup;e&&e.removeChildren(i);for(let t=0;t<i.length;++t){const e=i[t];e.parentRenderLayer?.detach(e),this.emit("childRemoved",e,this,t),i[t].emit("removed",this)}return i.length>0&&this._didViewChangeTick++,i}if(0===r&&0===this.children.length)return i;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(t){const e=this.getChildAt(t);return this.removeChild(e)},getChildAt(t){if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${t}) does not exist.`);return this.children[t]},setChildIndex(t,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);this.getChildIndex(t),this.addChildAt(t,e)},getChildIndex(t){const e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied Container must be a child of the caller");return e},addChildAt(t,e){this.allowChildren||(0,c.t6)(c.lj,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:s}=this;if(e<0||e>s.length)throw new Error(`${t}addChildAt: The index ${e} supplied is out of bounds ${s.length}`);if(t.parent){const s=t.parent.children.indexOf(t);if(t.parent===this&&s===e)return t;-1!==s&&t.parent.children.splice(s,1)}e===s.length?s.push(t):s.splice(e,0,t),t.parent=this,t.didChange=!0,t._updateFlags=15;const r=this.renderGroup||this.parentRenderGroup;return r&&r.addChild(t),this.sortableChildren&&(this.sortDirty=!0),this.emit("childAdded",t,this,e),t.emit("added",this),t},swapChildren(t,e){if(t===e)return;const s=this.getChildIndex(t),r=this.getChildIndex(e);this.children[s]=e,this.children[r]=t;const i=this.renderGroup||this.parentRenderGroup;i&&(i.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){this.parent?.removeChild(this)},reparentChild(...t){return 1===t.length?this.reparentChildAt(t[0],this.children.length):(t.forEach(t=>this.reparentChildAt(t,this.children.length)),t[0])},reparentChildAt(t,e){if(t.parent===this)return this.setChildIndex(t,e),t;const s=t.worldTransform.clone();t.removeFromParent(),this.addChildAt(t,e);const r=this.worldTransform.clone();return r.invert(),s.prepend(r),t.setFromMatrix(s),t},replaceChild(t,e){t.updateLocalTransform(),this.addChildAt(e,this.getChildIndex(t)),e.setFromMatrix(t.localTransform),e.updateLocalTransform(),this.removeChild(t)}},g={collectRenderables(t,e,s){this.parentRenderLayer&&this.parentRenderLayer!==s||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(t,e,s):this.renderGroup?e.renderPipes.renderGroup.addRenderGroup(this.renderGroup,t):this.collectRenderablesWithEffects(t,e,s))},collectRenderablesSimple(t,e,s){const r=this.children,i=r.length;for(let n=0;n<i;n++)r[n].collectRenderables(t,e,s)},collectRenderablesWithEffects(t,e,s){const{renderPipes:r}=e;for(let e=0;e<this.effects.length;e++){const s=this.effects[e];r[s.pipe].push(s,this,t)}this.collectRenderablesSimple(t,e,s);for(let e=this.effects.length-1;e>=0;e--){const s=this.effects[e];r[s.pipe].pop(s,this,t)}}};var x=s(4403);const y=new class{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(t=>{this.add({test:t.test,maskClass:t})}))}add(t){this._tests.push(t)}getMaskEffect(t){this._initialized||this.init();for(let e=0;e<this._tests.length;e++){const s=this._tests[e];if(s.test(t))return d.Z.get(s.maskClass,t)}return t}returnMaskEffect(t){d.Z.return(t)}};n.XO.handleByList(n.Ag.MaskEffect,y._effectClasses);const v={_maskEffect:null,_maskOptions:{inverse:!1},_filterEffect:null,effects:[],_markStructureAsChanged(){const t=this.renderGroup||this.parentRenderGroup;t&&(t.structureDidChange=!0)},addEffect(t){-1===this.effects.indexOf(t)&&(this.effects.push(t),this.effects.sort((t,e)=>t.priority-e.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(t){const e=this.effects.indexOf(t);-1!==e&&(this.effects.splice(e,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(t){const e=this._maskEffect;e?.mask!==t&&(e&&(this.removeEffect(e),y.returnMaskEffect(e),this._maskEffect=null),null!=t&&(this._maskEffect=y.getMaskEffect(t),this.addEffect(this._maskEffect)))},get mask(){return this._maskEffect?.mask},setMask(t){this._maskOptions={...this._maskOptions,...t},t.mask&&(this.mask=t.mask),this._markStructureAsChanged()},set filters(t){!Array.isArray(t)&&t&&(t=[t]);const e=this._filterEffect||(this._filterEffect=new x.a),s=t?.length>0,r=s!==e.filters?.length>0;t=Array.isArray(t)?t.slice(0):t,e.filters=Object.freeze(t),r&&(s?this.addEffect(e):(this.removeEffect(e),e.filters=t??null))},get filters(){return this._filterEffect?.filters},set filterArea(t){this._filterEffect||(this._filterEffect=new x.a),this._filterEffect.filterArea=t},get filterArea(){return this._filterEffect?.filterArea}},_={label:null,get name(){return(0,c.t6)(c.lj,"Container.name property has been removed, use Container.label instead"),this.label},set name(t){(0,c.t6)(c.lj,"Container.name property has been removed, use Container.label instead"),this.label=t},getChildByName(t,e=!1){return this.getChildByLabel(t,e)},getChildByLabel(t,e=!1){const s=this.children;for(let e=0;e<s.length;e++){const r=s[e];if(r.label===t||t instanceof RegExp&&t.test(r.label))return r}if(e)for(let e=0;e<s.length;e++){const r=s[e].getChildByLabel(t,!0);if(r)return r}return null},getChildrenByLabel(t,e=!1,s=[]){const r=this.children;for(let e=0;e<r.length;e++){const i=r[e];(i.label===t||t instanceof RegExp&&t.test(i.label))&&s.push(i)}if(e)for(let e=0;e<r.length;e++)r[e].getChildrenByLabel(t,!0,s);return s}};var b=s(6170),w=s(7882);const T=new a.u,S={getFastGlobalBounds(t,e){e||(e=new b.c),e.clear(),this._getGlobalBoundsRecursive(!!t,e,this.parentRenderLayer),e.isValid||e.set(0,0,0,0);const s=this.renderGroup||this.parentRenderGroup;return e.applyMatrix(s.worldTransform),e},_getGlobalBoundsRecursive(t,e,s){let r=e;if(t&&this.parentRenderLayer&&this.parentRenderLayer!==s)return;if(7!==this.localDisplayStatus||!this.measurable)return;const i=!!this.effects.length;if((this.renderGroup||i)&&(r=w.o.get().clear()),this.boundsArea)e.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){const t=this.bounds;r.addFrame(t.minX,t.minY,t.maxX,t.maxY,this.groupTransform)}const e=this.children;for(let i=0;i<e.length;i++)e[i]._getGlobalBoundsRecursive(t,r,s)}if(i){let t=!1;const s=this.renderGroup||this.parentRenderGroup;for(let e=0;e<this.effects.length;e++)this.effects[e].addBounds&&(t||(t=!0,r.applyMatrix(s.worldTransform)),this.effects[e].addBounds(r,!0));t&&r.applyMatrix(s.worldTransform.copyTo(T).invert()),e.addBounds(r),w.o.return(r)}else this.renderGroup&&(e.addBounds(r,this.relativeGroupTransform),w.o.return(r))}};var A=s(9565),C=s(6851);function P(t){return((255&t)<<16)+(65280&t)+(t>>16&255)}const E={getGlobalAlpha(t){if(t)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let e=this.alpha,s=this.parent;for(;s;)e*=s.alpha,s=s.parent;return e},getGlobalTransform(t=new a.u,e){if(e)return t.copyFrom(this.worldTransform);this.updateLocalTransform();const s=(0,A.E)(this,w.u.get().identity());return t.appendFrom(this.localTransform,s),w.u.return(s),t},getGlobalTint(t){if(t)return this.renderGroup?P(this.renderGroup.worldColor):this.parentRenderGroup?P((0,C.j)(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let e=this.localColor,s=this.parent;for(;s;)e=(0,C.j)(e,s.localColor),s=s.parent;return P(e)}};var M=s(2071);function k(t,e){const s=t.children;for(let t=0;t<s.length;t++){const r=s[t],i=r.uid,n=(65535&r._didViewChangeTick)<<16|65535&r._didContainerChangeTick,a=e.index;e.data[a]===i&&e.data[a+1]===n||(e.data[e.index]=i,e.data[e.index+1]=n,e.didChange=!0),e.index=a+2,r.children.length&&k(r,e)}return e.didChange}const R=new a.u,B={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(t,e){const s=Math.sign(this.scale.x)||1;this.scale.x=0!==e?t/e*s:s},_setHeight(t,e){const s=Math.sign(this.scale.y)||1;this.scale.y=0!==e?t/e*s:s},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new b.c});const t=this._localBoundsCacheData;return t.index=1,t.didChange=!1,t.data[0]!==this._didViewChangeTick&&(t.didChange=!0,t.data[0]=this._didViewChangeTick),k(this,t),t.didChange&&(0,M.n)(this,t.localBounds,R),t.localBounds},getBounds(t,e){return(0,A.f)(this,t,e||new b.c)}},I={_onRender:null,set onRender(t){const e=this.renderGroup||this.parentRenderGroup;if(!t)return this._onRender&&e?.removeOnRender(this),void(this._onRender=null);this._onRender||e?.addOnRender(this),this._onRender=t},get onRender(){return this._onRender}},F={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(t){this._zIndex!==t&&(this._zIndex=t,this.depthOfChildModified())},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort(D))}};function D(t,e){return t._zIndex-e._zIndex}var O=s(59);const G={getGlobalPosition(t=new O.b,e=!1){return this.parent?this.parent.toGlobal(this._position,t,e):(t.x=this._position.x,t.y=this._position.y),t},toGlobal(t,e,s=!1){const r=this.getGlobalTransform(w.u.get(),s);return e=r.apply(t,e),w.u.return(r),e},toLocal(t,e,s,r){e&&(t=e.toGlobal(t,s,r));const i=this.getGlobalTransform(w.u.get(),r);return s=i.applyInverse(t,s),w.u.return(i),s}};var U=s(1422);const L=new l.o(null),N=new l.o(null),X=new l.o(null,1,1),Y=new l.o(null),V=1,z=2,W=4;class H extends r.A{constructor(t={}){super(),this.uid=(0,h.L)("renderable"),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=!1,this.didViewUpdate=!1,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=!0,this.measurable=!0,this.isSimple=!0,this.updateTick=-1,this.localTransform=new a.u,this.relativeGroupTransform=new a.u,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new l.o(this,0,0),this._scale=X,this._pivot=N,this._origin=Y,this._skew=L,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=16777215,this.localAlpha=1,this.groupAlpha=1,this.groupColor=16777215,this.groupColorAlpha=4294967295,this.localBlendMode="inherit",this.groupBlendMode="normal",this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],function(t,e,s={}){for(const r in e)s[r]||void 0===e[r]||(t[r]=e[r])}(this,t,{children:!0,parent:!0,effects:!0}),t.children?.forEach(t=>this.addChild(t)),t.parent?.addChild(this)}static mixin(t){(0,c.t6)("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),n.XO.mixin(H,t)}set _didChangeId(t){this._didViewChangeTick=t>>12&4095,this._didContainerChangeTick=4095&t}get _didChangeId(){return 4095&this._didContainerChangeTick|(4095&this._didViewChangeTick)<<12}addChild(...t){if(this.allowChildren||(0,c.t6)(c.lj,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){for(let e=0;e<t.length;e++)this.addChild(t[e]);return t[0]}const e=t[0],s=this.renderGroup||this.parentRenderGroup;return e.parent===this?(this.children.splice(this.children.indexOf(e),1),this.children.push(e),s&&(s.structureDidChange=!0),e):(e.parent&&e.parent.removeChild(e),this.children.push(e),this.sortableChildren&&(this.sortDirty=!0),e.parent=this,e.didChange=!0,e._updateFlags=15,s&&s.addChild(e),this.emit("childAdded",e,this,this.children.length-1),e.emit("added",this),this._didViewChangeTick++,0!==e._zIndex&&e.depthOfChildModified(),e)}removeChild(...t){if(t.length>1){for(let e=0;e<t.length;e++)this.removeChild(t[e]);return t[0]}const e=t[0],s=this.children.indexOf(e);return s>-1&&(this._didViewChangeTick++,this.children.splice(s,1),this.renderGroup?this.renderGroup.removeChild(e):this.parentRenderGroup&&this.parentRenderGroup.removeChild(e),e.parentRenderLayer&&e.parentRenderLayer.detach(e),e.parent=null,this.emit("childRemoved",e,this,s),e.emit("removed",this)),e}_onUpdate(t){t&&t===this._skew&&this._updateSkew(),this._didContainerChangeTick++,this.didChange||(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(t){!!this.renderGroup!==t&&(t?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const t=this.parentRenderGroup;t?.removeChild(this),this.renderGroup=d.Z.get(U.m,this),this.groupTransform=a.u.IDENTITY,t?.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const t=this.parentRenderGroup;t?.removeChild(this),d.Z.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,t?.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&0===this.effects.length}get worldTransform(){return this._worldTransform||(this._worldTransform=new a.u),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(t){this._position.x=t}get y(){return this._position.y}set y(t){this._position.y=t}get position(){return this._position}set position(t){this._position.copyFrom(t)}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this._onUpdate(this._skew))}get angle(){return this.rotation*o.bO}set angle(t){this.rotation=t*o.Td}get pivot(){return this._pivot===N&&(this._pivot=new l.o(this,0,0)),this._pivot}set pivot(t){this._pivot===N&&(this._pivot=new l.o(this,0,0),this._origin!==Y&&(0,u.R)("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),"number"==typeof t?this._pivot.set(t):this._pivot.copyFrom(t)}get skew(){return this._skew===L&&(this._skew=new l.o(this,0,0)),this._skew}set skew(t){this._skew===L&&(this._skew=new l.o(this,0,0)),this._skew.copyFrom(t)}get scale(){return this._scale===X&&(this._scale=new l.o(this,1,1)),this._scale}set scale(t){this._scale===X&&(this._scale=new l.o(this,0,0)),"string"==typeof t&&(t=parseFloat(t)),"number"==typeof t?this._scale.set(t):this._scale.copyFrom(t)}get origin(){return this._origin===Y&&(this._origin=new l.o(this,0,0)),this._origin}set origin(t){this._origin===Y&&(this._origin=new l.o(this,0,0),this._pivot!==N&&(0,u.R)("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),"number"==typeof t?this._origin.set(t):this._origin.copyFrom(t)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(t){const e=this.getLocalBounds().width;this._setWidth(t,e)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(t){const e=this.getLocalBounds().height;this._setHeight(t,e)}getSize(t){t||(t={});const e=this.getLocalBounds();return t.width=Math.abs(this.scale.x*e.width),t.height=Math.abs(this.scale.y*e.height),t}setSize(t,e){const s=this.getLocalBounds();"object"==typeof t?(e=t.height??t.width,t=t.width):e??(e=t),void 0!==t&&this._setWidth(t,s.width),void 0!==e&&this._setHeight(e,s.height)}_updateSkew(){const t=this._rotation,e=this._skew;this._cx=Math.cos(t+e._y),this._sx=Math.sin(t+e._y),this._cy=-Math.sin(t-e._x),this._sy=Math.cos(t-e._x)}updateTransform(t){return this.position.set("number"==typeof t.x?t.x:this.position.x,"number"==typeof t.y?t.y:this.position.y),this.scale.set("number"==typeof t.scaleX?t.scaleX||1:this.scale.x,"number"==typeof t.scaleY?t.scaleY||1:this.scale.y),this.rotation="number"==typeof t.rotation?t.rotation:this.rotation,this.skew.set("number"==typeof t.skewX?t.skewX:this.skew.x,"number"==typeof t.skewY?t.skewY:this.skew.y),this.pivot.set("number"==typeof t.pivotX?t.pivotX:this.pivot.x,"number"==typeof t.pivotY?t.pivotY:this.pivot.y),this.origin.set("number"==typeof t.originX?t.originX:this.origin.x,"number"==typeof t.originY?t.originY:this.origin.y),this}setFromMatrix(t){t.decompose(this)}updateLocalTransform(){const t=this._didContainerChangeTick;if(this._didLocalTransformChangeId===t)return;this._didLocalTransformChangeId=t;const e=this.localTransform,s=this._scale,r=this._pivot,i=this._origin,n=this._position,a=s._x,o=s._y,l=r._x,h=r._y,c=-i._x,u=-i._y;e.a=this._cx*a,e.b=this._sx*a,e.c=this._cy*o,e.d=this._sy*o,e.tx=n._x-(l*e.a+h*e.c)+(c*e.a+u*e.c)-c,e.ty=n._y-(l*e.b+h*e.d)+(c*e.b+u*e.d)-u}set alpha(t){t!==this.localAlpha&&(this.localAlpha=t,this._updateFlags|=V,this._onUpdate())}get alpha(){return this.localAlpha}set tint(t){const e=i.Q.shared.setValue(t??16777215).toBgrNumber();e!==this.localColor&&(this.localColor=e,this._updateFlags|=V,this._onUpdate())}get tint(){return P(this.localColor)}set blendMode(t){this.localBlendMode!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=z,this.localBlendMode=t,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(2&this.localDisplayStatus)}set visible(t){const e=t?2:0;(2&this.localDisplayStatus)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=W,this.localDisplayStatus^=2,this._onUpdate())}get culled(){return!(4&this.localDisplayStatus)}set culled(t){const e=t?0:4;(4&this.localDisplayStatus)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=W,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(1&this.localDisplayStatus)}set renderable(t){const e=t?1:0;(1&this.localDisplayStatus)!==e&&(this._updateFlags|=W,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return 7===this.localDisplayStatus&&this.groupAlpha>0}destroy(t=!1){if(this.destroyed)return;let e;if(this.destroyed=!0,this.children.length&&(e=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),("boolean"==typeof t?t:t?.children)&&e)for(let s=0;s<e.length;++s)e[s].destroy(t);this.renderGroup?.destroy(),this.renderGroup=null}}n.XO.mixin(H,m,S,G,I,B,v,_,F,{cullArea:null,cullable:!1,cullableChildren:!0},p,E,g)},4696:(t,e,s)=>{"use strict";s.d(e,{Ek:()=>n,lj:()=>i,t6:()=>o});const r=new Set,i="8.0.0",n="8.3.4",a={quiet:!1,noColor:!1},o=(t,e,s=3)=>{if(a.quiet||r.has(e))return;let i=(new Error).stack;const n=`${e}\nDeprecated since v${t}`,o="function"==typeof console.groupCollapsed&&!a.noColor;void 0===i?console.warn("PixiJS Deprecation Warning: ",n):(i=i.split("\n").splice(s).join("\n"),o?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",n),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",n),console.warn(i))),r.add(e)};Object.defineProperties(o,{quiet:{get:()=>a.quiet,set:t=>{a.quiet=t},enumerable:!0,configurable:!1},noColor:{get:()=>a.noColor,set:t=>{a.noColor=t},enumerable:!0,configurable:!1}})},4872:(t,e,s)=>{"use strict";s.d(e,{A:()=>r});const r=s(792)},4889:(t,e,s)=>{"use strict";var r=s(592);s(9317),s(275),r.U},4968:(t,e,s)=>{"use strict";s.d(e,{A4:()=>i.A,CW:()=>p.C,Fr:()=>y.F,H9:()=>l.H,L5:()=>m.L,Mb:()=>d.M,NO:()=>c.N,ZN:()=>x.Z,ZU:()=>h.Z,_m:()=>r._,dy:()=>n.dy,g0:()=>f.g,hI:()=>u.h,p6:()=>o.p,rF:()=>n.rF,uv:()=>a.u,yR:()=>g.y});var r=s(2839),i=s(5259),n=s(7761),a=s(3198),o=s(3762),l=s(8630),h=s(4980),c=s(5896),u=s(605),d=s(8016),p=(s(9935),s(8840)),f=(s(5611),s(5892)),m=(s(8742),s(7448),s(5604)),g=s(6763),x=(s(7879),s(6042),s(8099),s(4889),s(8533)),y=s(2454)},4980:(t,e,s)=>{"use strict";s.d(e,{Z:()=>a});var r=s(166),i=s(4132),n=s(2839);class a extends n._{#p;#f;#m;#g;#x;#y;#v;#_;constructor(t){super(t),this.#p=t.src,this.#f=t.atlas,this.#m=t.animation,this.#g=t.fps,this.#x=t.loop??!0,this.#b()}async#b(){this.#y=(0,i.t)(this.#p,this.#f),i.i.checkCached(this.#y)?this.#v=i.i.getCached(this.#y):(console.info(`Spritesheet not preloaded. Loading now: ${this.#y}`),this.#v=await i.i.load(this.#y,this.#p,this.#f)),this.#w()}#w(){if(this.#_?.destroy(),this.#_=void 0,this.#v){if(!this.#v.animations[this.#m])return void console.error(`Animation not found: ${this.#m}`);const t=new r.Dl5(this.#v.animations[this.#m]);t.anchor.set(.5,.5),t.loop=this.#x,t.animationSpeed=(this.#g??0)/60,t.play(),t.onLoop=()=>this.emit("animationend",this.#m),t.onComplete=()=>this.emit("animationend",this.#m),this._pixiContainer.addChild(t),this.#_=t}}set src(t){this.#p!==t&&(i.i.release(this.#y),this.#p=t,this.#b())}get src(){return this.#p}set atlas(t){this.#f!==t&&(i.i.release(this.#y),this.#f=t,this.#b())}get atlas(){return this.#f}set animation(t){this.#m!==t&&(this.#m=t,this.#w())}get animation(){return this.#m}set fps(t){this.#g!==t&&(this.#g=t,this.#_&&(this.#_.animationSpeed=(t??0)/60))}get fps(){return this.#g}set loop(t){this.#x!==t&&(this.#x=t,this.#_&&(this.#_.loop=t))}get loop(){return this.#x}remove(){i.i.release(this.#y),super.remove()}}},4988:(t,e,s)=>{"use strict";s.d(e,{m:()=>i});const r={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function i(t){return r[t]??r.float32}},5007:(t,e,s)=>{"use strict";s.d(e,{M:()=>d});var r=s(8642),i=s(8574);let n;function a(){if(!n){n="mediump";const t=(0,i.W)();if(t&&t.getShaderPrecisionFormat){const e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);n=e.precision?"highp":"mediump"}}return n}const o={},l={},h={stripVersion:function(t,e){return e?t.replace("#version 300 es",""):t},ensurePrecision:function(t,e,s){const r=s?e.maxSupportedFragmentPrecision:e.maxSupportedVertexPrecision;if("precision"!==t.substring(0,9)){let i=s?e.requestedFragmentPrecision:e.requestedVertexPrecision;return"highp"===i&&"highp"!==r&&(i="mediump"),`precision ${i} float;\n${t}`}return"highp"!==r&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t},addProgramDefines:function(t,e,s){return e?t:s?`\n\n #ifdef GL_ES // This checks if it is WebGL1\n #define in varying\n #define finalColor gl_FragColor\n #define texture texture2D\n #endif\n ${t=t.replace("out vec4 finalColor;","")}\n `:`\n\n #ifdef GL_ES // This checks if it is WebGL1\n #define in attribute\n #define out varying\n #endif\n ${t}\n `},setProgramName:function(t,{name:e="pixi-program"},s=!0){e=e.replace(/\s+/g,"-");const r=s?o:l;return r[e+=s?"-fragment":"-vertex"]?(r[e]++,e+=`-${r[e]}`):r[e]=1,-1!==t.indexOf("#define SHADER_NAME")?t:`#define SHADER_NAME ${e}\n${t}`},insertVersion:function(t,e){return e?`#version 300 es\n${t}`:t}},c=Object.create(null),u=class t{constructor(e){const s=-1!==(e={...t.defaultOptions,...e}).fragment.indexOf("#version 300 es"),i={stripVersion:s,ensurePrecision:{requestedFragmentPrecision:e.preferredFragmentPrecision,requestedVertexPrecision:e.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:a()},setProgramName:{name:e.name},addProgramDefines:s,insertVersion:s};let n=e.fragment,o=e.vertex;Object.keys(h).forEach(t=>{const e=i[t];n=h[t](n,e,!0),o=h[t](o,e,!1)}),this.fragment=n,this.vertex=o,this.transformFeedbackVaryings=e.transformFeedbackVaryings,this._key=(0,r.X)(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,c[this._cacheKey]=null}static from(e){const s=`${e.vertex}:${e.fragment}`;return c[s]||(c[s]=new t(e),c[s]._cacheKey=s),c[s]}};u.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let d=u},5008:(t,e,s)=>{"use strict";s.d(e,{G:()=>a});var r=s(5199),i=s(5946);const n=new r.u;class a{constructor(){this.packAsQuad=!1,this.batcherName="default",this.topology="triangle-list",this.applyTransform=!0,this.roundPixels=0,this._batcher=null,this._batch=null}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){return this.renderable&&this.applyTransform?this.renderable.groupBlendMode:"normal"}get color(){const t=this.baseColor,e=t>>16|65280&t|(255&t)<<16,s=this.renderable;return s?(0,i.u)(e,s.groupColor)+(this.alpha*s.groupAlpha*255<<24):e+(255*this.alpha<<24)}get transform(){return this.renderable?.groupTransform||n}copyTo(t){t.indexOffset=this.indexOffset,t.indexSize=this.indexSize,t.attributeOffset=this.attributeOffset,t.attributeSize=this.attributeSize,t.baseColor=this.baseColor,t.alpha=this.alpha,t.texture=this.texture,t.geometryData=this.geometryData,t.topology=this.topology}reset(){this.applyTransform=!0,this.renderable=null,this.topology="triangle-list"}destroy(){this.renderable=null,this.texture=null,this.geometryData=null,this._batcher.destroy(),this._batcher=null,this._batch.destroy(),this._batch=null}}},5024:(t,e,s)=>{"use strict";s.d(e,{T:()=>d,w:()=>u});var r=s(6675),i=s(9739),n=s(6406),a=s(9776);function o(t){return t instanceof a.m}function l(t){return t instanceof n._}function h(t,e,s){return t.fill=e,t.color=16777215,t.texture=e.texture,t.matrix=e.transform,{...s,...t}}function c(t,e,s){return e.buildGradient(),t.fill=e,t.color=16777215,t.texture=e.texture,t.matrix=e.transform,t.textureSpace=e.textureSpace,{...s,...t}}function u(t,e){if(null==t)return null;const s={},n=t;return function(t){return r.Q.isColorLike(t)}(t)?function(t,e,s){const n=r.Q.shared.setValue(e??0);return t.color=n.toNumber(),t.alpha=1===n.alpha?s.alpha:n.alpha,t.texture=i.g.WHITE,{...s,...t}}(s,t,e):function(t){return t instanceof i.g}(t)?function(t,e,s){return t.texture=e,{...s,...t}}(s,t,e):o(t)?h(s,t,e):l(t)?c(s,t,e):n.fill&&o(n.fill)?h(n,n.fill,e):n.fill&&l(n.fill)?c(n,n.fill,e):function(t,e){const s={...e,...t},i=r.Q.shared.setValue(s.color);return s.alpha*=i.alpha,s.color=i.toNumber(),s}(n,e)}function d(t,e){const{width:s,alignment:r,miterLimit:i,cap:n,join:a,pixelLine:o,...l}=e,h=u(t,l);return h?{width:s,alignment:r,miterLimit:i,cap:n,join:a,pixelLine:o,...h}:null}},5031:(t,e,s)=>{"use strict";s.d(e,{b:()=>i});const r="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function i(t){return!r&&""!==document.createElement("video").canPlayType(t)}},5105:(t,e,s)=>{"use strict";s.d(e,{x:()=>p});var r=s(4872),i=s(6675),n=s(9375),a=s(4696),o=s(7694),l=s(6406),h=s(9776),c=s(4386),u=s(5024);const d=class t extends r.A{constructor(e={}){super(),this.uid=(0,n.L)("textStyle"),this._tick=0,function(t){const e=t;if("boolean"==typeof e.dropShadow&&e.dropShadow){const s=p.defaultDropShadow;t.dropShadow={alpha:e.dropShadowAlpha??s.alpha,angle:e.dropShadowAngle??s.angle,blur:e.dropShadowBlur??s.blur,color:e.dropShadowColor??s.color,distance:e.dropShadowDistance??s.distance}}if(void 0!==e.strokeThickness){(0,a.t6)(a.lj,"strokeThickness is now a part of stroke");const s=e.stroke;let r={};if(i.Q.isColorLike(s))r.color=s;else if(s instanceof l._||s instanceof h.m)r.fill=s;else{if(!Object.hasOwnProperty.call(s,"color")&&!Object.hasOwnProperty.call(s,"fill"))throw new Error("Invalid stroke value.");r=s}t.stroke={...r,width:e.strokeThickness}}if(Array.isArray(e.fillGradientStops)){if((0,a.t6)(a.lj,"gradient fill is now a fill pattern: `new FillGradient(...)`"),!Array.isArray(e.fill)||0===e.fill.length)throw new Error("Invalid fill value. Expected an array of colors for gradient fill.");e.fill.length!==e.fillGradientStops.length&&(0,o.R)("The number of fill colors must match the number of fill gradient stops.");const s=new l._({start:{x:0,y:0},end:{x:0,y:1},textureSpace:"local"}),r=e.fillGradientStops.slice(),n=e.fill.map(t=>i.Q.shared.setValue(t).toNumber());r.forEach((t,e)=>{s.addColorStop(t,n[e])}),t.fill={fill:s}}}(e);const s={...t.defaultTextStyle,...e};for(const t in s)this[t]=s[t];this.update(),this._tick=0}get align(){return this._align}set align(t){this._align=t,this.update()}get breakWords(){return this._breakWords}set breakWords(t){this._breakWords=t,this.update()}get dropShadow(){return this._dropShadow}set dropShadow(e){this._dropShadow=null!==e&&"object"==typeof e?this._createProxy({...t.defaultDropShadow,...e}):e?this._createProxy({...t.defaultDropShadow}):null,this.update()}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily=t,this.update()}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize="string"==typeof t?parseInt(t,10):t,this.update()}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle=t.toLowerCase(),this.update()}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant=t,this.update()}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight=t,this.update()}get leading(){return this._leading}set leading(t){this._leading=t,this.update()}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing=t,this.update()}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight=t,this.update()}get padding(){return this._padding}set padding(t){this._padding=t,this.update()}get filters(){return this._filters}set filters(t){this._filters=Object.freeze(t),this.update()}get trim(){return this._trim}set trim(t){this._trim=t,this.update()}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline=t,this.update()}get whiteSpace(){return this._whiteSpace}set whiteSpace(t){this._whiteSpace=t,this.update()}get wordWrap(){return this._wordWrap}set wordWrap(t){this._wordWrap=t,this.update()}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(t){this._wordWrapWidth=t,this.update()}get fill(){return this._originalFill}set fill(t){t!==this._originalFill&&(this._originalFill=t,this._isFillStyle(t)&&(this._originalFill=this._createProxy({...c.T.defaultFillStyle,...t},()=>{this._fill=(0,u.w)({...this._originalFill},c.T.defaultFillStyle)})),this._fill=(0,u.w)(0===t?"black":t,c.T.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(t){t!==this._originalStroke&&(this._originalStroke=t,this._isFillStyle(t)&&(this._originalStroke=this._createProxy({...c.T.defaultStrokeStyle,...t},()=>{this._stroke=(0,u.T)({...this._originalStroke},c.T.defaultStrokeStyle)})),this._stroke=(0,u.T)(t,c.T.defaultStrokeStyle),this.update())}update(){this._tick++,this.emit("update",this)}reset(){const e=t.defaultTextStyle;for(const t in e)this[t]=e[t]}get styleKey(){return`${this.uid}-${this._tick}`}clone(){return new t({align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,textBaseline:this.textBaseline,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,filters:this._filters?[...this._filters]:void 0})}_getFinalPadding(){let t=0;if(this._filters)for(let e=0;e<this._filters.length;e++)t+=this._filters[e].padding;return Math.max(this._padding,t)}destroy(t=!1){if(this.removeAllListeners(),"boolean"==typeof t?t:t?.texture){const e="boolean"==typeof t?t:t?.textureSource;this._fill?.texture&&this._fill.texture.destroy(e),this._originalFill?.texture&&this._originalFill.texture.destroy(e),this._stroke?.texture&&this._stroke.texture.destroy(e),this._originalStroke?.texture&&this._originalStroke.texture.destroy(e)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(t,e){return new Proxy(t,{set:(t,s,r)=>(t[s]=r,e?.(s,r),this.update(),!0)})}_isFillStyle(t){return null!==(t??null)&&!(i.Q.isColorLike(t)||t instanceof l._||t instanceof h.m)}};d.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5},d.defaultTextStyle={align:"left",breakWords:!1,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let p=d},5153:(t,e,s)=>{"use strict";s.d(e,{W:()=>r});var r=(t=>(t[t.WEBGL=1]="WEBGL",t[t.WEBGPU=2]="WEBGPU",t[t.BOTH=3]="BOTH",t))(r||{})},5180:(t,e,s)=>{"use strict";s.d(e,{C:()=>n});var r=s(5423);let i;async function n(){return i??(i=(async()=>{const t=r.e.get().createCanvas(1,1).getContext("webgl");if(!t)return"premultiply-alpha-on-upload";const e=await new Promise(t=>{const e=document.createElement("video");e.onloadeddata=()=>t(e),e.onerror=()=>t(null),e.autoplay=!1,e.crossOrigin="anonymous",e.preload="auto",e.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",e.load()});if(!e)return"premultiply-alpha-on-upload";const s=t.createTexture();t.bindTexture(t.TEXTURE_2D,s);const i=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,i),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,s,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e);const n=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,n),t.deleteFramebuffer(i),t.deleteTexture(s),t.getExtension("WEBGL_lose_context")?.loseContext(),n[0]<=n[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),i}},5199:(t,e,s)=>{"use strict";s.d(e,{u:()=>n});var r=s(4614),i=s(59);class n{constructor(t=1,e=0,s=0,r=1,i=0,n=0){this.array=null,this.a=t,this.b=e,this.c=s,this.d=r,this.tx=i,this.ty=n}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,e,s,r,i,n){return this.a=t,this.b=e,this.c=s,this.d=r,this.tx=i,this.ty=n,this}toArray(t,e){this.array||(this.array=new Float32Array(9));const s=e||this.array;return t?(s[0]=this.a,s[1]=this.b,s[2]=0,s[3]=this.c,s[4]=this.d,s[5]=0,s[6]=this.tx,s[7]=this.ty,s[8]=1):(s[0]=this.a,s[1]=this.c,s[2]=this.tx,s[3]=this.b,s[4]=this.d,s[5]=this.ty,s[6]=0,s[7]=0,s[8]=1),s}apply(t,e){e=e||new i.b;const s=t.x,r=t.y;return e.x=this.a*s+this.c*r+this.tx,e.y=this.b*s+this.d*r+this.ty,e}applyInverse(t,e){e=e||new i.b;const s=this.a,r=this.b,n=this.c,a=this.d,o=this.tx,l=this.ty,h=1/(s*a+n*-r),c=t.x,u=t.y;return e.x=a*h*c+-n*h*u+(l*n-o*a)*h,e.y=s*h*u+-r*h*c+(-l*s+o*r)*h,e}translate(t,e){return this.tx+=t,this.ty+=e,this}scale(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this}rotate(t){const e=Math.cos(t),s=Math.sin(t),r=this.a,i=this.c,n=this.tx;return this.a=r*e-this.b*s,this.b=r*s+this.b*e,this.c=i*e-this.d*s,this.d=i*s+this.d*e,this.tx=n*e-this.ty*s,this.ty=n*s+this.ty*e,this}append(t){const e=this.a,s=this.b,r=this.c,i=this.d;return this.a=t.a*e+t.b*r,this.b=t.a*s+t.b*i,this.c=t.c*e+t.d*r,this.d=t.c*s+t.d*i,this.tx=t.tx*e+t.ty*r+this.tx,this.ty=t.tx*s+t.ty*i+this.ty,this}appendFrom(t,e){const s=t.a,r=t.b,i=t.c,n=t.d,a=t.tx,o=t.ty,l=e.a,h=e.b,c=e.c,u=e.d;return this.a=s*l+r*c,this.b=s*h+r*u,this.c=i*l+n*c,this.d=i*h+n*u,this.tx=a*l+o*c+e.tx,this.ty=a*h+o*u+e.ty,this}setTransform(t,e,s,r,i,n,a,o,l){return this.a=Math.cos(a+l)*i,this.b=Math.sin(a+l)*i,this.c=-Math.sin(a-o)*n,this.d=Math.cos(a-o)*n,this.tx=t-(s*this.a+r*this.c),this.ty=e-(s*this.b+r*this.d),this}prepend(t){const e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){const e=this.a,s=this.c;this.a=e*t.a+this.b*t.c,this.b=e*t.b+this.b*t.d,this.c=s*t.a+this.d*t.c,this.d=s*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this}decompose(t){const e=this.a,s=this.b,i=this.c,n=this.d,a=t.pivot,o=-Math.atan2(-i,n),l=Math.atan2(s,e),h=Math.abs(o+l);return h<1e-5||Math.abs(r.TO-h)<1e-5?(t.rotation=l,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=o,t.skew.y=l),t.scale.x=Math.sqrt(e*e+s*s),t.scale.y=Math.sqrt(i*i+n*n),t.position.x=this.tx+(a.x*e+a.y*i),t.position.y=this.ty+(a.x*s+a.y*n),t}invert(){const t=this.a,e=this.b,s=this.c,r=this.d,i=this.tx,n=t*r-e*s;return this.a=r/n,this.b=-e/n,this.c=-s/n,this.d=t/n,this.tx=(s*this.ty-r*i)/n,this.ty=-(t*this.ty-e*i)/n,this}isIdentity(){return 1===this.a&&0===this.b&&0===this.c&&1===this.d&&0===this.tx&&0===this.ty}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new n;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}equals(t){return t.a===this.a&&t.b===this.b&&t.c===this.c&&t.d===this.d&&t.tx===this.tx&&t.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return o.identity()}static get shared(){return a.identity()}}const a=new n,o=new n},5229:(t,e,s)=>{"use strict";s.d(e,{M:()=>a});var r=s(7399),i=s(1347);class n{slotIndex;name;attachment;constructor(t=0,e,s){this.slotIndex=t,this.name=e,this.attachment=s}}class a{name;attachments=new Array;bones=Array();constraints=new Array;color=new i.Q1(.99607843,.61960787,.30980393,1);constructor(t){if(!t)throw new Error("name cannot be null.");this.name=t}setAttachment(t,e,s){if(!s)throw new Error("attachment cannot be null.");let r=this.attachments;t>=r.length&&(r.length=t+1),r[t]||(r[t]={}),r[t][e]=s}addSkin(t){for(let e=0;e<t.bones.length;e++){let s=t.bones[e],r=!1;for(let t=0;t<this.bones.length;t++)if(this.bones[t]==s){r=!0;break}r||this.bones.push(s)}for(let e=0;e<t.constraints.length;e++){let s=t.constraints[e],r=!1;for(let t=0;t<this.constraints.length;t++)if(this.constraints[t]==s){r=!0;break}r||this.constraints.push(s)}let e=t.getAttachments();for(let t=0;t<e.length;t++){var s=e[t];this.setAttachment(s.slotIndex,s.name,s.attachment)}}copySkin(t){for(let e=0;e<t.bones.length;e++){let s=t.bones[e],r=!1;for(let t=0;t<this.bones.length;t++)if(this.bones[t]==s){r=!0;break}r||this.bones.push(s)}for(let e=0;e<t.constraints.length;e++){let s=t.constraints[e],r=!1;for(let t=0;t<this.constraints.length;t++)if(this.constraints[t]==s){r=!0;break}r||this.constraints.push(s)}let e=t.getAttachments();for(let t=0;t<e.length;t++){var s=e[t];s.attachment&&(s.attachment instanceof r.f?(s.attachment=s.attachment.newLinkedMesh(),this.setAttachment(s.slotIndex,s.name,s.attachment)):(s.attachment=s.attachment.copy(),this.setAttachment(s.slotIndex,s.name,s.attachment)))}}getAttachment(t,e){let s=this.attachments[t];return s?s[e]:null}removeAttachment(t,e){let s=this.attachments[t];s&&delete s[e]}getAttachments(){let t=new Array;for(var e=0;e<this.attachments.length;e++){let s=this.attachments[e];if(s)for(let r in s){let i=s[r];i&&t.push(new n(e,r,i))}}return t}getAttachmentsForSlot(t,e){let s=this.attachments[t];if(s)for(let r in s){let i=s[r];i&&e.push(new n(t,r,i))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(t,e){let s=0;for(let r=0;r<t.slots.length;r++){let i=t.slots[r],n=i.getAttachment();if(n&&s<e.attachments.length){let t=e.attachments[s];for(let e in t)if(n==t[e]){let t=this.getAttachment(s,e);t&&i.setAttachment(t);break}}s++}}}},5242:(t,e,s)=>{"use strict";s.d(e,{Lw:()=>n,TE:()=>l});var r=s(2101),i=s(1347);class n{pages=new Array;regions=new Array;constructor(t){let e=new a(t),s=new Array(4),n={size:t=>{t.width=parseInt(s[1]),t.height=parseInt(s[2])},format:()=>{},filter:t=>{t.minFilter=i.Aq.enumValue(r.O$,s[1]),t.magFilter=i.Aq.enumValue(r.O$,s[2])},repeat:t=>{-1!=s[1].indexOf("x")&&(t.uWrap=r.w3.Repeat),-1!=s[1].indexOf("y")&&(t.vWrap=r.w3.Repeat)},pma:t=>{t.pma="true"==s[1]}};var h={xy:t=>{t.x=parseInt(s[1]),t.y=parseInt(s[2])},size:t=>{t.width=parseInt(s[1]),t.height=parseInt(s[2])},bounds:t=>{t.x=parseInt(s[1]),t.y=parseInt(s[2]),t.width=parseInt(s[3]),t.height=parseInt(s[4])},offset:t=>{t.offsetX=parseInt(s[1]),t.offsetY=parseInt(s[2])},orig:t=>{t.originalWidth=parseInt(s[1]),t.originalHeight=parseInt(s[2])},offsets:t=>{t.offsetX=parseInt(s[1]),t.offsetY=parseInt(s[2]),t.originalWidth=parseInt(s[3]),t.originalHeight=parseInt(s[4])},rotate:t=>{let e=s[1];"true"==e?t.degrees=90:"false"!=e&&(t.degrees=parseInt(e))},index:t=>{t.index=parseInt(s[1])}};let c=e.readLine();for(;c&&0==c.trim().length;)c=e.readLine();for(;c&&0!=c.trim().length&&0!=e.readEntry(s,c);)c=e.readLine();let u=null,d=null,p=null;for(;null!==c;)if(0==c.trim().length)u=null,c=e.readLine();else if(u){let t=new l(u,c);for(;;){let r=e.readEntry(s,c=e.readLine());if(0==r)break;let i=h[s[0]];if(i)i(t);else{d||(d=[]),p||(p=[]),d.push(s[0]);let t=[];for(let e=0;e<r;e++)t.push(parseInt(s[e+1]));p.push(t)}}0==t.originalWidth&&0==t.originalHeight&&(t.originalWidth=t.width,t.originalHeight=t.height),d&&d.length>0&&p&&p.length>0&&(t.names=d,t.values=p,d=null,p=null),t.u=t.x/u.width,t.v=t.y/u.height,90==t.degrees?(t.u2=(t.x+t.height)/u.width,t.v2=(t.y+t.width)/u.height):(t.u2=(t.x+t.width)/u.width,t.v2=(t.y+t.height)/u.height),this.regions.push(t)}else{for(u=new o(c.trim());0!=e.readEntry(s,c=e.readLine());){let t=n[s[0]];t&&t(u)}this.pages.push(u)}}findRegion(t){for(let e=0;e<this.regions.length;e++)if(this.regions[e].name==t)return this.regions[e];return null}setTextures(t,e=""){for(let s of this.pages)s.setTexture(t.get(e+s.name))}dispose(){for(let t=0;t<this.pages.length;t++)this.pages[t].texture?.dispose()}}class a{lines;index=0;constructor(t){this.lines=t.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;let s=e.indexOf(":");if(-1==s)return 0;t[0]=e.substr(0,s).trim();for(let r=1,i=s+1;;r++){let s=e.indexOf(",",i);if(-1==s)return t[r]=e.substr(i).trim(),r;if(t[r]=e.substr(i,s-i).trim(),i=s+1,4==r)return 4}}}class o{name;minFilter=r.O$.Nearest;magFilter=r.O$.Nearest;uWrap=r.w3.ClampToEdge;vWrap=r.w3.ClampToEdge;texture=null;width=0;height=0;pma=!1;regions=new Array;constructor(t){this.name=t}setTexture(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap);for(let e of this.regions)e.texture=t}}class l extends r.QL{page;name;x=0;y=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0;index=0;degrees=0;names=null;values=null;constructor(t,e){super(),this.page=t,this.name=e,t.regions.push(this)}}},5254:(t,e,s)=>{"use strict";s.d(e,{R:()=>i});var r=s(9067);class i{#T;#S=0;constructor(t){let e=0,s=0;const i=r=>{const n=(r-e)/1e3;if(n>0){const i=this.#T;if(void 0!==i&&i>0){s+=n;const e=1/i;s>=e&&(t(e),s>=2*e?(t(n),s=0):s-=e)}else t(n);e=r}this.#S=requestAnimationFrame(i)};this.#S=requestAnimationFrame(i),r.p&&(document.hasFocus()||(this.#T=6),window.addEventListener("blur",this.#A),window.addEventListener("focus",this.#C),window.addEventListener("pageshow",this.#P))}#A=()=>{this.#T=6};#C=()=>{this.#T=void 0};#P=t=>{t.persisted&&(this.#T=void 0)};remove(){cancelAnimationFrame(this.#S),window.removeEventListener("blur",this.#A),window.removeEventListener("focus",this.#C),window.removeEventListener("pageshow",this.#P)}}},5259:(t,e,s)=>{"use strict";s.d(e,{A:()=>d});var r=s(166),i=s(9067),n=s(275),a=s(2437),o=s(7955),l=s(6499),h=s(1298),c=s(499),u=s(5254);class d extends a.N{container;#E;#M=new u.R(t=>this.#k(t));camera=new o.i;fpsDisplay;#R;#B;#I;#F;#D={};_isSizeDirty=!1;canvasWidth=0;canvasHeight=0;canvasLeft=0;canvasTop=0;viewportScale=1;centerX=0;centerY=0;constructor(t,e){if(super(new r.mcf({sortableChildren:!0})),this.container=t,this.renderer=this,this.worldTransform.x.v=0,this.worldTransform.y.v=0,this.worldTransform.resetDirty(),this.#E=new l.W(t),this.#E.on("resize",(t,e)=>this.#O(t,e)),this.camera.on("positionChanged",()=>this.#G()),this.camera.on("scaleChanged",()=>this.#G()),e&&(void 0!==e.logicalWidth&&(this.#R=e.logicalWidth),void 0!==e.logicalHeight&&(this.#B=e.logicalHeight),void 0!==e.backgroundColor&&(this.#I=e.backgroundColor),e.layers))for(const t of e.layers){const e=new c.W(t.drawOrder);this._pixiContainer.addChild(e._pixiContainer),this.#D[t.name]=e}i.p&&(this.fpsDisplay=new h.K(t));const s=this.container.getBoundingClientRect();this.#O(s.width,s.height),this.init()}async init(){const t=await(0,r.q5F)({width:this.#R,height:this.#B,backgroundColor:this.#I,eventMode:"none",resolution:window.devicePixelRatio});(0,n.e)(t.canvas,{position:"absolute",touchAction:"auto"}),this.container.appendChild(t.canvas),this.#F=t}#G(){const t=this.camera.scale;this._pixiContainer.scale=t,this._pixiContainer.position.set(this.centerX-this.camera.x*t,this.centerY-this.camera.y*t)}#O(t,e){const s=this.#R??t,r=this.#B??e;this.canvasWidth=s,this.canvasHeight=r,this.centerX=s/2,this.centerY=r/2,this.#G();const i=Math.min(t/s,e/r);this.viewportScale=i;const a=s*i,o=r*i,l=(t-a)/2,h=(e-o)/2;this.canvasLeft=l,this.canvasTop=h,this.#F&&(this.#F.resize(s,r),(0,n.e)(this.#F.canvas,{width:`${a}px`,height:`${o}px`,left:`${l}px`,top:`${h}px`}),this.emit("resize",s,r)),this._isSizeDirty=!0}#k(t){this._isSizeDirty=!1,this.update(t),this._updateWorldTransform(),this.#F?.render(this._pixiContainer),this.fpsDisplay?.update()}_addToLayer(t,e){const s=this.#D[e];if(!s)throw new Error(`Layer ${e} does not exist.`);s._pixiContainer.addChild(t._pixiContainer)}remove(){this.#E.remove(),this.#M.remove(),this.#F?.destroy(),this.fpsDisplay?.remove(),super.remove()}screenToWorld(t,e){return{x:(t-this.canvasLeft)/this.viewportScale-this.canvasWidth/2,y:(e-this.canvasTop)/this.viewportScale-this.canvasHeight/2}}}},5331:(t,e,s)=>{"use strict";s.d(e,{b:()=>n});var r=s(1347),i=s(4382);class n extends i.e{color=new r.Q1(1,1,1,1);constructor(t){super(t)}copy(){let t=new n(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}}},5353:(t,e,s)=>{"use strict";function r(t,e,s,r){const i={width:0,height:0,offsetY:0,scale:e.fontSize/s.baseMeasurementFontSize,lines:[{width:0,charPositions:[],spaceWidth:0,spacesIndex:[],chars:[]}]};i.offsetY=s.baseLineOffset;let n=i.lines[0],a=null,o=!0;const l={spaceWord:!1,width:0,start:0,index:0,positions:[],chars:[]},h=s.baseMeasurementFontSize/e.fontSize,c=e.letterSpacing*h,u=e.wordWrapWidth*h,d=e.lineHeight?e.lineHeight*h:s.lineHeight,p=e.wordWrap&&e.breakWords,f=t=>{const e=n.width;for(let s=0;s<l.index;s++){const r=t.positions[s];n.chars.push(t.chars[s]),n.charPositions.push(r+e)}n.width+=t.width,o=!1,l.width=0,l.index=0,l.chars.length=0},m=()=>{let t=n.chars.length-1;if(r){let e=n.chars[t];for(;" "===e;)n.width-=s.chars[e].xAdvance,e=n.chars[--t]}i.width=Math.max(i.width,n.width),n={width:0,charPositions:[],chars:[],spaceWidth:0,spacesIndex:[]},o=!0,i.lines.push(n),i.height+=d},g=t=>t-c>u;for(let r=0;r<t.length+1;r++){let i;const h=r===t.length;h||(i=t[r]);const u=s.chars[i]||s.chars[" "];if(/(?:\s)/.test(i)||"\r"===i||"\n"===i||h){if(!o&&e.wordWrap&&g(n.width+l.width)?(m(),f(l),h||n.charPositions.push(0)):(l.start=n.width,f(l),h||n.charPositions.push(0)),"\r"===i||"\n"===i)m();else if(!h){const t=u.xAdvance+(u.kerning[a]||0)+c;n.width+=t,n.spaceWidth=t,n.spacesIndex.push(n.charPositions.length),n.chars.push(i)}}else{const t=u.kerning[a]||0,e=u.xAdvance+t+c;p&&g(n.width+l.width+e)&&(f(l),m()),l.positions[l.index++]=l.width+t,l.chars.push(i),l.width+=e}a=i}return m(),"center"===e.align?function(t){for(let e=0;e<t.lines.length;e++){const s=t.lines[e],r=t.width/2-s.width/2;for(let t=0;t<s.charPositions.length;t++)s.charPositions[t]+=r}}(i):"right"===e.align?function(t){for(let e=0;e<t.lines.length;e++){const s=t.lines[e],r=t.width-s.width;for(let t=0;t<s.charPositions.length;t++)s.charPositions[t]+=r}}(i):"justify"===e.align&&function(t){const e=t.width;for(let s=0;s<t.lines.length;s++){const r=t.lines[s];let i=0,n=r.spacesIndex[i++],a=0;const o=r.spacesIndex.length,l=(e-r.width)/o;for(let t=0;t<r.charPositions.length;t++)t===n&&(n=r.spacesIndex[i++],a+=l),r.charPositions[t]+=a}}(i),i}s.d(e,{Z:()=>r})},5423:(t,e,s)=>{"use strict";s.d(e,{e:()=>i});let r={createCanvas:(t,e)=>{const s=document.createElement("canvas");return s.width=t,s.height=e,s},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>(new DOMParser).parseFromString(t,"text/xml")};const i={get:()=>r,set(t){r=t}}},5556:(t,e,s)=>{"use strict";s.d(e,{P:()=>i});var r=s(159);class i extends r.q{_bone=null;set bone(t){this._bone=t}get bone(){if(this._bone)return this._bone;throw new Error("BoneData not set.")}x=0;y=0;rotate=0;scaleX=0;shearX=0;limit=0;step=0;inertia=0;strength=0;damping=0;massInverse=0;wind=0;gravity=0;mix=0;inertiaGlobal=!1;strengthGlobal=!1;dampingGlobal=!1;massGlobal=!1;windGlobal=!1;gravityGlobal=!1;mixGlobal=!1;constructor(t){super(t,0,!1)}}},5604:(t,e,s)=>{"use strict";s.d(e,{L:()=>c});var r=s(8714),i=s.n(r),n=s(166),a=s(8630),o=s(2437),l=s(6121),h=s(6763);class c extends o.N{#e=new l.U;#U;#s=!1;constructor(t){super(new n.mcf({sortableChildren:!0}));const e=t.collider,s=t.x??0,r=t.y??0,o={angle:t.rotation??0,velocity:{x:t.velocityX??0,y:t.velocityY??0},isStatic:t.isStatic??!1};if(t.fixedRotation&&(o.inertia=1/0,o.angularVelocity=0),e.type===a.H.Rectangle)this.#U=i().Bodies.rectangle(s,r,e.width,e.height,o);else if(e.type===a.H.Circle)this.#U=i().Bodies.circle(s,r,e.radius,o);else if(e.type===a.H.Ellipse)this.#U=function(t,e,s,r,n={},a=6){const o=s/2,l=r/2,h=Math.PI*(o+l),c=Math.max(12,Math.ceil(h/a)),u=Array.from({length:c},(t,e)=>{const s=e/c*Math.PI*2;return{x:Math.cos(s)*o,y:Math.sin(s)*l}});return i().Bodies.fromVertices(t,e,[u],n)}(s,r,e.width,e.height,o,6);else{if(e.type!==a.H.Polygon)throw new Error("Invalid collider type");this.#U=i().Bodies.fromVertices(s,r,[e.vertices],o)}this.#s=t.useYSort??!1}set parent(t){if(!(t instanceof h.y)){const e=void 0===t?"undefined":t.constructor?.name??typeof t;throw new Error(`PhysicsObject parent must be PhysicsWorld, but got ${e}`)}t.addBody(this.#U),super.parent=t}get parent(){return super.parent}_updateWorldTransform(){const t=this.#U,e=this._pixiContainer;e.position.set(t.position.x,t.position.y),this.#s&&(e.zIndex=t.position.y),e.rotation=t.angle;const s=this.#e;s.x=t.position.x,s.y=t.position.y,s.rotation=t.angle;const r=this.parent;r&&(0,o.l)(r)&&this.worldTransform.update(r.worldTransform,this.#e),super._updateWorldTransform()}#L(){this.parent?.removeBody(this.#U)}remove(){this.#L(),super.remove()}set x(t){i().Body.setPosition(this.#U,{x:t,y:this.#U.position.y})}get x(){return this.#U.position.x}set y(t){i().Body.setPosition(this.#U,{x:this.#U.position.x,y:t})}get y(){return this.#U.position.y}set rotation(t){i().Body.setAngle(this.#U,t)}get rotation(){return this.#U.angle}set velocityX(t){i().Body.setVelocity(this.#U,{x:t,y:this.#U.velocity.y})}get velocityX(){return this.#U.velocity.x}set velocityY(t){i().Body.setVelocity(this.#U,{x:this.#U.velocity.x,y:t})}get velocityY(){return this.#U.velocity.y}set isStatic(t){i().Body.setStatic(this.#U,t)}get isStatic(){return this.#U.isStatic}disableCollisions(){this.#L()}}},5611:(t,e,s)=>{"use strict";s(166),s(7635),s(2839)._},5671:(t,e,s)=>{"use strict";s.d(e,{G:()=>n});var r=s(1065),i=s(5031);const n={extension:{type:r.Ag.DetectionParser,priority:0},test:async()=>(0,i.b)("video/ogg"),add:async t=>[...t,"ogv"],remove:async t=>t.filter(t=>"ogv"!==t)}},5749:(t,e,s)=>{"use strict";s.d(e,{$:()=>l});var r=s(1065),i=s(3651),n=s(5180),a=s(4269);const o=class t extends a.v{constructor(e){super(e),this.isReady=!1,this.uploadMethodId="video",e={...t.defaultOptions,...e},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=e.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=!1!==e.autoPlay,this.alphaMode=e.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),!1!==e.autoLoad&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const t=i.R.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;const t=this.resource,e=this.options;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(e.preload||t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlayThrough),t.addEventListener("error",this._onError,!0)),this.alphaMode=await(0,n.C)(),this._load=new Promise((s,r)=>{this.isValid?s(this):(this._resolve=s,this._reject=r,void 0!==e.preloadTimeoutMs&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${e.preloadTimeoutMs}ms`))})),t.load())}),this._load}_onError(t){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.resource;return!t.paused&&!t.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady()}_mediaReady(){const t=this.resource;this.isValid&&(this.isReady=!0,this.resize(t.videoWidth,t.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();const t=this.resource;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlayThrough),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(i.R.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),null===this._videoFrameRequestCallbackHandle&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(null!==this._videoFrameRequestCallbackHandle&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(i.R.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(null!==this._videoFrameRequestCallbackHandle&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(i.R.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement}};o.extension=r.Ag.TextureSource,o.defaultOptions={...a.v.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1},o.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let l=o},5809:(t,e,s)=>{"use strict";s.d(e,{Q:()=>n});var r=s(1065),i=s(6257);const n={extension:{type:r.Ag.DetectionParser,priority:1},test:async()=>(0,i.P)("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async t=>[...t,"avif"],remove:async t=>t.filter(t=>"avif"!==t)}},5851:(t,e,s)=>{"use strict";s(166),s(8034)},5892:(t,e,s)=>{"use strict";s.d(e,{g:()=>n});var r=s(166),i=s(7249);class n extends i.X{#N;#X;#i;#n;constructor(t){super(new r.A1g({sortableChildren:!0}),t),this.#N=t.width,this.#X=t.height,this.#i=t.fill,this.#n=t.stroke,this.#a()}#a(){this._pixiContainer.clear().rect(-this.#N/2,-this.#X/2,this.#N,this.#X),this.#i&&this._pixiContainer.fill(this.#i),this.#n&&this._pixiContainer.stroke(this.#n)}get width(){return this.#N}set width(t){this.#N=t,this.#a()}get height(){return this.#X}set height(t){this.#X=t,this.#a()}get fill(){return this.#i}set fill(t){this.#i=t,this.#a()}get stroke(){return this.#n}set stroke(t){this.#n=t,this.#a()}}},5896:(t,e,s)=>{"use strict";s.d(e,{N:()=>a});var r=s(166),i=s(791),n=s(2839);class a extends n._{#Y;#p;#V;constructor(t){super(t),this.#Y=t.fnt,this.#p=t.src,this.#V=t.text,this.#b()}async#b(){let t;if(i.S.checkCached(this.#Y)?t=i.S.getCached(this.#Y):(console.info(`Bitmap font not preloaded. Loading now: ${this.#Y}`),t=await i.S.load(this.#Y,this.#p)),!t)return;const e=[];let s=0,n=0,a=1/0,o=1/0,l=-1/0,h=-1/0;for(let i=0;i<this.#V.length;i++){const c=this.#V.charCodeAt(i);if(10===c){s=0,n+=t.lineHeight;continue}const u=t.chars[c];if(!u)continue;const d=new r.M_G(u.x,u.y,u.width,u.height),p=new r.gPd({source:t.texture.source,frame:d}),f=new r.kxk(p),m=s+u.xoffset,g=n+u.yoffset;f.x=m,f.y=g,e.push(f);const x=m+u.width,y=g+u.height;m<a&&(a=m),g<o&&(o=g),x>l&&(l=x),y>h&&(h=y),s+=u.xadvance}a===1/0&&(a=0,o=0),l===-1/0&&(l=0,h=0);const c=l-a,u=h-o;for(const t of e)t.x-=c/2,t.y-=u/2,this._pixiContainer.addChild(t)}changeFont(t,e){this.#Y===t&&this.#p===e||(i.S.release(this.#Y),this.#Y=t,this.#p=e,this.#b())}remove(){i.S.release(this.#Y),super.remove()}}},5946:(t,e,s)=>{"use strict";function r(t,e){return 16777215!==t&&e?16777215!==e&&t?((t>>16&255)*(e>>16&255)/255<<16)+((t>>8&255)*(e>>8&255)/255<<8)+((255&t)*(255&e)/255|0):t:e}s.d(e,{u:()=>r})},5947:(t,e,s)=>{"use strict";s.d(e,{b:()=>n});var r=s(1065),i=s(4269);class n extends i.v{constructor(t){super(t),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(t){return globalThis.HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||globalThis.VideoFrame&&t instanceof VideoFrame}}n.extension=r.Ag.TextureSource},6042:(t,e,s)=>{"use strict";var r=s(592);s(9317),s(275),r.U},6068:(t,e,s)=>{"use strict";s.d(e,{D:()=>n});var r=s(4382),i=s(1347);class n{data;bone;color;darkColor=null;attachment=null;attachmentState=0;sequenceIndex=-1;deform=new Array;constructor(t,e){if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new i.Q1,this.darkColor=t.darkColor?new i.Q1:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&(t instanceof r.e&&this.attachment instanceof r.e&&t.timelineAttachment==this.attachment.timelineAttachment||(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}}},6093:()=>{"use strict";if("undefined"!=typeof window&&window.PIXI){const t=window.require;window.require=e=>t?t(e):e.startsWith("@pixi/")||e.startsWith("pixi.js")?window.PIXI:void 0}},6108:(t,e,s)=>{"use strict";s.d(e,{N:()=>n});var r=s(9107),i=s(1347);class n{data;_bone=null;set bone(t){this._bone=t}get bone(){if(this._bone)return this._bone;throw new Error("Bone not set.")}inertia=0;strength=0;damping=0;massInverse=0;wind=0;gravity=0;mix=0;_reset=!0;ux=0;uy=0;cx=0;cy=0;tx=0;ty=0;xOffset=0;xVelocity=0;yOffset=0;yVelocity=0;rotateOffset=0;rotateVelocity=0;scaleOffset=0;scaleVelocity=0;active=!1;skeleton;remaining=0;lastTime=0;constructor(t,e){this.data=t,this.skeleton=e,this.bone=e.bones[t.bone.index],this.inertia=t.inertia,this.strength=t.strength,this.damping=t.damping,this.massInverse=t.massInverse,this.wind=t.wind,this.gravity=t.gravity,this.mix=t.mix}reset(){this.remaining=0,this.lastTime=this.skeleton.time,this._reset=!0,this.xOffset=0,this.xVelocity=0,this.yOffset=0,this.yVelocity=0,this.rotateOffset=0,this.rotateVelocity=0,this.scaleOffset=0,this.scaleVelocity=0}setToSetupPose(){const t=this.data;this.inertia=t.inertia,this.strength=t.strength,this.damping=t.damping,this.massInverse=t.massInverse,this.wind=t.wind,this.gravity=t.gravity,this.mix=t.mix}isActive(){return this.active}update(t){const e=this.mix;if(0==e)return;const s=this.data.x>0,n=this.data.y>0,a=this.data.rotate>0||this.data.shearX>0,o=this.data.scaleX>0,l=this.bone,h=l.data.length;switch(t){case r.A.none:return;case r.A.reset:this.reset();case r.A.update:const t=this.skeleton,c=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=c,this.lastTime=t.time;const u=l.worldX,d=l.worldY;if(this._reset)this._reset=!1,this.ux=u,this.uy=d;else{let p=this.remaining,f=this.inertia,m=this.data.step,g=this.skeleton.data.referenceScale,x=-1,y=this.data.limit*c,v=y*Math.abs(t.scaleY);if(y*=Math.abs(t.scaleX),s||n){if(s){const t=(this.ux-u)*f;this.xOffset+=t>y?y:t<-y?-y:t,this.ux=u}if(n){const t=(this.uy-d)*f;this.yOffset+=t>v?v:t<-v?-v:t,this.uy=d}if(p>=m){x=Math.pow(this.damping,60*m);const e=this.massInverse*m,r=this.strength,i=this.wind*g*t.scaleX,a=this.gravity*g*t.scaleY;do{s&&(this.xVelocity+=(i-this.xOffset*r)*e,this.xOffset+=this.xVelocity*m,this.xVelocity*=x),n&&(this.yVelocity-=(a+this.yOffset*r)*e,this.yOffset+=this.yVelocity*m,this.yVelocity*=x),p-=m}while(p>=m)}s&&(l.worldX+=this.xOffset*e*this.data.x),n&&(l.worldY+=this.yOffset*e*this.data.y)}if(a||o){let t=Math.atan2(l.c,l.a),s=0,n=0,c=0,u=this.cx-l.worldX,d=this.cy-l.worldY;if(u>y?u=y:u<-y&&(u=-y),d>v?d=v:d<-v&&(d=-v),a){c=(this.data.rotate+this.data.shearX)*e;let r=Math.atan2(d+this.ty,u+this.tx)-t-this.rotateOffset*c;this.rotateOffset+=(r-Math.ceil(r*i.cj.invPI2-.5)*i.cj.PI2)*f,r=this.rotateOffset*c+t,s=Math.cos(r),n=Math.sin(r),o&&(r=h*l.getWorldScaleX(),r>0&&(this.scaleOffset+=(u*s+d*n)*f/r))}else{s=Math.cos(t),n=Math.sin(t);const e=h*l.getWorldScaleX();e>0&&(this.scaleOffset+=(u*s+d*n)*f/e)}if(p=this.remaining,p>=m){-1==x&&(x=Math.pow(this.damping,60*m));const e=this.massInverse*m,i=this.strength,l=this.wind,u=r.E.yDown?-this.gravity:this.gravity,d=h/g;for(;;)if(p-=m,o&&(this.scaleVelocity+=(l*s-u*n-this.scaleOffset*i)*e,this.scaleOffset+=this.scaleVelocity*m,this.scaleVelocity*=x),a){if(this.rotateVelocity-=((l*n+u*s)*d+this.rotateOffset*i)*e,this.rotateOffset+=this.rotateVelocity*m,this.rotateVelocity*=x,p<m)break;const r=this.rotateOffset*c+t;s=Math.cos(r),n=Math.sin(r)}else if(p<m)break}}this.remaining=p}this.cx=l.worldX,this.cy=l.worldY;break;case r.A.pose:s&&(l.worldX+=this.xOffset*e*this.data.x),n&&(l.worldY+=this.yOffset*e*this.data.y)}if(a){let t=this.rotateOffset*e,s=0,r=0,i=0;if(this.data.shearX>0){let e=0;this.data.rotate>0&&(e=t*this.data.rotate,s=Math.sin(e),r=Math.cos(e),i=l.b,l.b=r*i-s*l.d,l.d=s*i+r*l.d),e+=t*this.data.shearX,s=Math.sin(e),r=Math.cos(e),i=l.a,l.a=r*i-s*l.c,l.c=s*i+r*l.c}else t*=this.data.rotate,s=Math.sin(t),r=Math.cos(t),i=l.a,l.a=r*i-s*l.c,l.c=s*i+r*l.c,i=l.b,l.b=r*i-s*l.d,l.d=s*i+r*l.d}if(o){const t=1+this.scaleOffset*e*this.data.scaleX;l.a*=t,l.c*=t}t!=r.A.pose&&(this.tx=h*l.a,this.ty=h*l.c),l.updateAppliedTransform()}translate(t,e){this.ux-=t,this.uy-=e,this.cx-=t,this.cy-=e}rotate(t,e,s){const r=s*i.cj.degRad,n=Math.cos(r),a=Math.sin(r),o=this.cx-t,l=this.cy-e;this.translate(o*n-l*a-o,o*a+l*n-l)}}},6114:(t,e,s)=>{"use strict";s.d(e,{k:()=>g});var r=s(6675),i=s(1065);const n=[];i.XO.handleByNamedList(i.Ag.Environment,n);var a=s(4687),o=s(8883),l=s(9375),h=s(4696),c=s(1753),u=s(1711),d=s(2255),p=s(4872);const f=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],m=class t extends p.A{constructor(t){super(),this.uid=(0,l.L)("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=t.type,this.name=t.name,this.config=t;const e=[...f,...this.config.runners??[]];this._addRunners(...e),this._unsafeEvalCheck()}async init(e={}){const s=!0===e.skipExtensionImports||!1===e.manageImports;await async function(t){if(!t)for(let t=0;t<n.length;t++){const e=n[t];if(e.value.test())return void await e.value.load()}}(s),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const t in this._systemsHash)e={...this._systemsHash[t].constructor.defaultOptions,...e};e={...t.defaultOptions,...e},this._roundPixels=e.roundPixels?1:0;for(let t=0;t<this.runners.init.items.length;t++)await this.runners.init.items[t].init(e);this._initOptions=e}render(t,e){let s=t;if(s instanceof a.mc&&(s={container:s},e&&((0,h.t6)(h.lj,"passing a second argument is deprecated, please use render options instead"),s.target=e.renderTexture)),s.target||(s.target=this.view.renderTarget),s.target===this.view.renderTarget&&(this._lastObjectRendered=s.container,s.clearColor??(s.clearColor=this.background.colorRgba),s.clear??(s.clear=this.background.clearBeforeRender)),s.clearColor){const t=Array.isArray(s.clearColor)&&4===s.clearColor.length;s.clearColor=t?s.clearColor:r.Q.shared.setValue(s.clearColor).toArray()}s.transform||(s.container.updateLocalTransform(),s.transform=s.container.localTransform),s.container.visible&&(s.container.enableRenderGroup(),this.runners.prerender.emit(s),this.runners.renderStart.emit(s),this.runners.render.emit(s),this.runners.renderEnd.emit(s),this.runners.postrender.emit(s))}resize(t,e,s){const r=this.view.resolution;this.view.resize(t,e,s),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),void 0!==s&&s!==r&&this.runners.resolutionChange.emit(s)}clear(t={}){t.target||(t.target=this.renderTarget.renderTarget),t.clearColor||(t.clearColor=this.background.colorRgba),t.clear??(t.clear=u.u.ALL);const{clear:e,clearColor:s,target:i}=t;r.Q.shared.setValue(s??this.background.colorRgba),this.renderTarget.clear(i,e,r.Q.shared.toArray())}get resolution(){return this.view.resolution}set resolution(t){this.view.resolution=t,this.runners.resolutionChange.emit(t)}get width(){return this.view.texture.frame.width}get height(){return this.view.texture.frame.height}get canvas(){return this.view.canvas}get lastObjectRendered(){return this._lastObjectRendered}get renderingToScreen(){return this.renderTarget.renderingToScreen}get screen(){return this.view.screen}_addRunners(...t){t.forEach(t=>{this.runners[t]=new d.C(t)})}_addSystems(t){let e;for(e in t){const s=t[e];this._addSystem(s.value,s.name)}}_addSystem(t,e){const s=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=s,this._systemsHash[e]=s;for(const t in this.runners)this.runners[t].add(s);return this}_addPipes(t,e){const s=e.reduce((t,e)=>(t[e.name]=e.value,t),{});t.forEach(t=>{const e=t.value,r=t.name,i=s[r];this.renderPipes[r]=new e(this,i?new i:null),this.runners.destroy.add(this.renderPipes[r])})}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),Object.values(this.runners).forEach(t=>{t.destroy()}),(!0===t||"object"==typeof t&&t.releaseGlobalResources)&&c.L.release(),this._systemsHash=null,this.renderPipes=null}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!(0,o.f)())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}resetState(){this.runners.resetState.emit()}};m.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let g=m},6121:(t,e,s)=>{"use strict";s.d(e,{U:()=>i,Z:()=>n});var r=s(8147);class i{x=0;y=0;scaleX=1;scaleY=1;pivotX=0;pivotY=0;#z=0;#W=1;#H=0;get cos(){return this.#W}get sin(){return this.#H}get rotation(){return this.#z}set rotation(t){this.#z!==t&&(this.#z=t,this.#W=Math.cos(t),this.#H=Math.sin(t))}}class n{x=new r.w(Number.NEGATIVE_INFINITY);y=new r.w(Number.NEGATIVE_INFINITY);scaleX=new r.w(1);scaleY=new r.w(1);rotation=new r.m(0);update(t,e){const s=e.x*t.scaleX.v,r=e.y*t.scaleY.v,i=t.rotation.cos,n=t.rotation.sin;this.scaleX.v=t.scaleX.v*e.scaleX,this.scaleY.v=t.scaleY.v*e.scaleY;const a=e.pivotX*this.scaleX.v,o=e.pivotY*this.scaleY.v,l=e.cos,h=e.sin;this.x.v=t.x.v+(s*i-r*n)-(a*l-o*h),this.y.v=t.y.v+(s*n+r*i)-(a*h+o*l),this.rotation.v=t.rotation.v+e.rotation}get dirty(){return this.x.dirty||this.y.dirty||this.scaleX.dirty||this.scaleY.dirty||this.rotation.dirty}resetDirty(){this.x.resetDirty(),this.y.resetDirty(),this.scaleX.resetDirty(),this.scaleY.resetDirty(),this.rotation.resetDirty()}}},6131:(t,e,s)=>{"use strict";var r=s(1065);class i{execute(t,e){const s=t.state,r=t.renderer,i=e.shader||t.defaultShader;i.resources.uTexture=e.texture._source,i.resources.uniforms=t.localUniforms;const n=r.gl,a=t.getBuffers(e);r.shader.bind(i),r.state.set(s),r.geometry.bind(a.geometry,i.glProgram);const o=2===a.geometry.indexBuffer.data.BYTES_PER_ELEMENT?n.UNSIGNED_SHORT:n.UNSIGNED_INT;n.drawElements(n.TRIANGLES,6*e.particleChildren.length,o,0)}}var n=s(5199),a=s(4449),o=s(3769),l=s(7433),h=s(9482),c=s(1579),u=s(9798),d=s(8337),p=s(4988),f=s(4142);function m(t,e=null){const s=6*t;if(s>65535?e||(e=new Uint32Array(s)):e||(e=new Uint16Array(s)),e.length!==s)throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${s}`);for(let t=0,r=0;t<s;t+=6,r+=4)e[t+0]=r+0,e[t+1]=r+1,e[t+2]=r+2,e[t+3]=r+0,e[t+4]=r+2,e[t+5]=r+3;return e}function g(t,e){const s=[];s.push("\n\n var index = 0;\n\n for (let i = 0; i < ps.length; ++i)\n {\n const p = ps[i];\n\n ");let r=0;for(const i in t){const n=t[i];e===n.dynamic&&(s.push(`offset = index + ${r}`),s.push(n.code),r+=(0,p.m)(n.format).stride/4)}s.push("\n index += stride * 4;\n }\n "),s.unshift(`\n var stride = ${r};\n `);const i=s.join("\n");return new Function("ps","f32v","u32v",i)}class x{constructor(t){this._size=0,this._generateParticleUpdateCache={};const e=this._size=t.size??1e3,s=t.properties;let r=0,i=0;for(const t in s){const e=s[t],n=(0,p.m)(e.format);e.dynamic?i+=n.stride:r+=n.stride}this._dynamicStride=i/4,this._staticStride=r/4,this.staticAttributeBuffer=new f.u(4*e*r),this.dynamicAttributeBuffer=new f.u(4*e*i),this.indexBuffer=m(e);const n=new d.V;let a=0,o=0;this._staticBuffer=new c.h({data:new Float32Array(1),label:"static-particle-buffer",shrinkToFit:!1,usage:u.S.VERTEX|u.S.COPY_DST}),this._dynamicBuffer=new c.h({data:new Float32Array(1),label:"dynamic-particle-buffer",shrinkToFit:!1,usage:u.S.VERTEX|u.S.COPY_DST});for(const t in s){const e=s[t],r=(0,p.m)(e.format);e.dynamic?(n.addAttribute(e.attributeName,{buffer:this._dynamicBuffer,stride:4*this._dynamicStride,offset:4*a,format:e.format}),a+=r.size):(n.addAttribute(e.attributeName,{buffer:this._staticBuffer,stride:4*this._staticStride,offset:4*o,format:e.format}),o+=r.size)}n.addIndex(this.indexBuffer);const l=this.getParticleUpdate(s);this._dynamicUpload=l.dynamicUpdate,this._staticUpload=l.staticUpdate,this.geometry=n}getParticleUpdate(t){const e=function(t){const e=[];for(const s in t){const r=t[s];e.push(s,r.code,r.dynamic?"d":"s")}return e.join("_")}(t);return this._generateParticleUpdateCache[e]||(this._generateParticleUpdateCache[e]=this.generateParticleUpdate(t)),this._generateParticleUpdateCache[e]}generateParticleUpdate(t){return function(t){return{dynamicUpdate:g(t,!0),staticUpdate:g(t,!1)}}(t)}update(t,e){t.length>this._size&&(e=!0,this._size=Math.max(t.length,1.5*this._size|0),this.staticAttributeBuffer=new f.u(this._size*this._staticStride*4*4),this.dynamicAttributeBuffer=new f.u(this._size*this._dynamicStride*4*4),this.indexBuffer=m(this._size),this.geometry.indexBuffer.setDataWithSize(this.indexBuffer,this.indexBuffer.byteLength,!0));const s=this.dynamicAttributeBuffer;if(this._dynamicUpload(t,s.float32View,s.uint32View),this._dynamicBuffer.setDataWithSize(this.dynamicAttributeBuffer.float32View,t.length*this._dynamicStride*4,!0),e){const e=this.staticAttributeBuffer;this._staticUpload(t,e.float32View,e.uint32View),this._staticBuffer.setDataWithSize(e.float32View,t.length*this._staticStride*4,!0)}}destroy(){this._staticBuffer.destroy(),this._dynamicBuffer.destroy(),this.geometry.destroy()}}var y=s(6675),v=s(5007),_=s(1790),b=s(1657),w=s(9739),T=s(8896),S="\nstruct ParticleUniforms {\n uTranslationMatrix:mat3x3<f32>,\n uColor:vec4<f32>,\n uRound:f32,\n uResolution:vec2<f32>,\n};\n\nfn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>\n{\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n}\n\n@group(0) @binding(0) var<uniform> uniforms: ParticleUniforms;\n\n@group(1) @binding(0) var uTexture: texture_2d<f32>;\n@group(1) @binding(1) var uSampler : sampler;\n\nstruct VSOutput {\n @builtin(position) position: vec4<f32>,\n @location(0) uv : vec2<f32>,\n @location(1) color : vec4<f32>,\n };\n@vertex\nfn mainVertex(\n @location(0) aVertex: vec2<f32>,\n @location(1) aPosition: vec2<f32>,\n @location(2) aUV: vec2<f32>,\n @location(3) aColor: vec4<f32>,\n @location(4) aRotation: f32,\n) -> VSOutput {\n \n let v = vec2(\n aVertex.x * cos(aRotation) - aVertex.y * sin(aRotation),\n aVertex.x * sin(aRotation) + aVertex.y * cos(aRotation)\n ) + aPosition;\n\n var position = vec4((uniforms.uTranslationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n if(uniforms.uRound == 1.0) {\n position = vec4(roundPixels(position.xy, uniforms.uResolution), position.zw);\n }\n\n let vColor = vec4(aColor.rgb * aColor.a, aColor.a) * uniforms.uColor;\n\n return VSOutput(\n position,\n aUV,\n vColor,\n );\n}\n\n@fragment\nfn mainFragment(\n @location(0) uv: vec2<f32>,\n @location(1) color: vec4<f32>,\n @builtin(position) position: vec4<f32>,\n) -> @location(0) vec4<f32> {\n\n var sample = textureSample(uTexture, uSampler, uv) * color;\n \n return sample;\n}";class A extends b.M{constructor(){super({glProgram:v.M.from({vertex:"attribute vec2 aVertex;\nattribute vec2 aUV;\nattribute vec4 aColor;\n\nattribute vec2 aPosition;\nattribute float aRotation;\n\nuniform mat3 uTranslationMatrix;\nuniform float uRound;\nuniform vec2 uResolution;\nuniform vec4 uColor;\n\nvarying vec2 vUV;\nvarying vec4 vColor;\n\nvec2 roundPixels(vec2 position, vec2 targetSize)\n{ \n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n}\n\nvoid main(void){\n float cosRotation = cos(aRotation);\n float sinRotation = sin(aRotation);\n float x = aVertex.x * cosRotation - aVertex.y * sinRotation;\n float y = aVertex.x * sinRotation + aVertex.y * cosRotation;\n\n vec2 v = vec2(x, y);\n v = v + aPosition;\n\n gl_Position = vec4((uTranslationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n if(uRound == 1.0)\n {\n gl_Position.xy = roundPixels(gl_Position.xy, uResolution);\n }\n\n vUV = aUV;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a) * uColor;\n}\n",fragment:"varying vec2 vUV;\nvarying vec4 vColor;\n\nuniform sampler2D uTexture;\n\nvoid main(void){\n vec4 color = texture2D(uTexture, vUV) * vColor;\n gl_FragColor = color;\n}"}),gpuProgram:_.B.from({fragment:{source:S,entryPoint:"mainFragment"},vertex:{source:S,entryPoint:"mainVertex"}}),resources:{uTexture:w.g.WHITE.source,uSampler:new T.n({}),uniforms:{uTranslationMatrix:{value:new n.u,type:"mat3x3<f32>"},uColor:{value:new y.Q(16777215),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}}})}}class C{constructor(t,e){this.state=l.U.for2d(),this.localUniforms=new a.k({uTranslationMatrix:{value:new n.u,type:"mat3x3<f32>"},uColor:{value:new Float32Array(4),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}),this.renderer=t,this.adaptor=e,this.defaultShader=new A,this.state=l.U.for2d()}validateRenderable(t){return!1}addRenderable(t,e){this.renderer.renderPipes.batch.break(e),e.add(t)}getBuffers(t){return t._gpuData[this.renderer.uid]||this._initBuffer(t)}_initBuffer(t){return t._gpuData[this.renderer.uid]=new x({size:t.particleChildren.length,properties:t._properties}),t._gpuData[this.renderer.uid]}updateRenderable(t){}execute(t){const e=t.particleChildren;if(0===e.length)return;const s=this.renderer,r=this.getBuffers(t);t.texture||(t.texture=e[0].texture);const i=this.state;r.update(e,t._childrenDirty),t._childrenDirty=!1,i.blendMode=(0,o.i)(t.blendMode,t.texture._source);const n=this.localUniforms.uniforms,a=n.uTranslationMatrix;t.worldTransform.copyTo(a),a.prepend(s.globalUniforms.globalUniformData.projectionMatrix),n.uResolution=s.globalUniforms.globalUniformData.resolution,n.uRound=s._roundPixels|t._roundPixels,(0,h.V)(t.groupColorAlpha,n.uColor,0),this.adaptor.execute(this,t)}destroy(){this.renderer=null,this.defaultShader&&(this.defaultShader.destroy(),this.defaultShader=null)}}class P extends C{constructor(t){super(t,new i)}}P.extension={type:[r.Ag.WebGLPipes],name:"particle"};class E{execute(t,e){const s=t.renderer,r=e.shader||t.defaultShader;r.groups[0]=s.renderPipes.uniformBatch.getUniformBindGroup(t.localUniforms,!0),r.groups[1]=s.texture.getTextureBindGroup(e.texture);const i=t.state,n=t.getBuffers(e);s.encoder.draw({geometry:n.geometry,shader:e.shader||t.defaultShader,state:i,size:6*e.particleChildren.length})}}class M extends C{constructor(t){super(t,new E)}}M.extension={type:[r.Ag.WebGPUPipes],name:"particle"},r.XO.add(P),r.XO.add(M)},6147:(t,e,s)=>{"use strict";s.d(e,{q:()=>h});var r=s(5331),i=s(6552),n=s(7399),a=s(6861),o=s(9064),l=s(7786);class h{atlas;constructor(t){this.atlas=t}loadSequence(t,e,s){let r=s.regions;for(let i=0,n=r.length;i<n;i++){let n=s.getPath(e,i),a=this.atlas.findRegion(n);if(null==a)throw new Error("Region not found in atlas: "+n+" (sequence: "+t+")");r[i]=a}}newRegionAttachment(t,e,s,r){let i=new l.Q(e,s);if(null!=r)this.loadSequence(e,s,r);else{let t=this.atlas.findRegion(s);if(!t)throw new Error("Region not found in atlas: "+s+" (region attachment: "+e+")");i.region=t}return i}newMeshAttachment(t,e,s,r){let i=new n.f(e,s);if(null!=r)this.loadSequence(e,s,r);else{let t=this.atlas.findRegion(s);if(!t)throw new Error("Region not found in atlas: "+s+" (mesh attachment: "+e+")");i.region=t}return i}newBoundingBoxAttachment(t,e){return new r.b(e)}newPathAttachment(t,e){return new a.H(e)}newPointAttachment(t,e){return new o.Y(e)}newClippingAttachment(t,e){return new i.K(e)}}},6170:(t,e,s)=>{"use strict";s.d(e,{c:()=>a});var r=s(5199),i=s(9390);const n=new r.u;class a{constructor(t=1/0,e=1/0,s=-1/0,r=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=n,this.minX=t,this.minY=e,this.maxX=s,this.maxY=r}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new i.M);const t=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(t.x=0,t.y=0,t.width=0,t.height=0):t.copyFromBounds(this),t}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=n,this}set(t,e,s,r){this.minX=t,this.minY=e,this.maxX=s,this.maxY=r}addFrame(t,e,s,r,i){i||(i=this.matrix);const n=i.a,a=i.b,o=i.c,l=i.d,h=i.tx,c=i.ty;let u=this.minX,d=this.minY,p=this.maxX,f=this.maxY,m=n*t+o*e+h,g=a*t+l*e+c;m<u&&(u=m),g<d&&(d=g),m>p&&(p=m),g>f&&(f=g),m=n*s+o*e+h,g=a*s+l*e+c,m<u&&(u=m),g<d&&(d=g),m>p&&(p=m),g>f&&(f=g),m=n*t+o*r+h,g=a*t+l*r+c,m<u&&(u=m),g<d&&(d=g),m>p&&(p=m),g>f&&(f=g),m=n*s+o*r+h,g=a*s+l*r+c,m<u&&(u=m),g<d&&(d=g),m>p&&(p=m),g>f&&(f=g),this.minX=u,this.minY=d,this.maxX=p,this.maxY=f}addRect(t,e){this.addFrame(t.x,t.y,t.x+t.width,t.y+t.height,e)}addBounds(t,e){this.addFrame(t.minX,t.minY,t.maxX,t.maxY,e)}addBoundsMask(t){this.minX=this.minX>t.minX?this.minX:t.minX,this.minY=this.minY>t.minY?this.minY:t.minY,this.maxX=this.maxX<t.maxX?this.maxX:t.maxX,this.maxY=this.maxY<t.maxY?this.maxY:t.maxY}applyMatrix(t){const e=this.minX,s=this.minY,r=this.maxX,i=this.maxY,{a:n,b:a,c:o,d:l,tx:h,ty:c}=t;let u=n*e+o*s+h,d=a*e+l*s+c;this.minX=u,this.minY=d,this.maxX=u,this.maxY=d,u=n*r+o*s+h,d=a*r+l*s+c,this.minX=u<this.minX?u:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=u>this.maxX?u:this.maxX,this.maxY=d>this.maxY?d:this.maxY,u=n*e+o*i+h,d=a*e+l*i+c,this.minX=u<this.minX?u:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=u>this.maxX?u:this.maxX,this.maxY=d>this.maxY?d:this.maxY,u=n*r+o*i+h,d=a*r+l*i+c,this.minX=u<this.minX?u:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=u>this.maxX?u:this.maxX,this.maxY=d>this.maxY?d:this.maxY}fit(t){return this.minX<t.left&&(this.minX=t.left),this.maxX>t.right&&(this.maxX=t.right),this.minY<t.top&&(this.minY=t.top),this.maxY>t.bottom&&(this.maxY=t.bottom),this}fitBounds(t,e,s,r){return this.minX<t&&(this.minX=t),this.maxX>e&&(this.maxX=e),this.minY<s&&(this.minY=s),this.maxY>r&&(this.maxY=r),this}pad(t,e=t){return this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new a(this.minX,this.minY,this.maxX,this.maxY)}scale(t,e=t){return this.minX*=t,this.minY*=e,this.maxX*=t,this.maxY*=e,this}get x(){return this.minX}set x(t){const e=this.maxX-this.minX;this.minX=t,this.maxX=t+e}get y(){return this.minY}set y(t){const e=this.maxY-this.minY;this.minY=t,this.maxY=t+e}get width(){return this.maxX-this.minX}set width(t){this.maxX=this.minX+t}get height(){return this.maxY-this.minY}set height(t){this.maxY=this.minY+t}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(t,e,s,r){let i=this.minX,n=this.minY,a=this.maxX,o=this.maxY;r||(r=this.matrix);const l=r.a,h=r.b,c=r.c,u=r.d,d=r.tx,p=r.ty;for(let r=e;r<s;r+=2){const e=t[r],s=t[r+1],f=l*e+c*s+d,m=h*e+u*s+p;i=f<i?f:i,n=m<n?m:n,a=f>a?f:a,o=m>o?m:o}this.minX=i,this.minY=n,this.maxX=a,this.maxY=o}containsPoint(t,e){return this.minX<=t&&this.minY<=e&&this.maxX>=t&&this.maxY>=e}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(t){return this.minX=t.minX,this.minY=t.minY,this.maxX=t.maxX,this.maxY=t.maxY,this}}},6184:(t,e,s)=>{"use strict";s.d(e,{v:()=>a});var r=s(6861),i=s(3648),n=s(1347);class a{static NONE=-1;static BEFORE=-2;static AFTER=-3;static epsilon=1e-5;data;bones;target;position=0;spacing=0;mixRotate=0;mixX=0;mixY=0;spaces=new Array;positions=new Array;world=new Array;curves=new Array;lengths=new Array;segments=new Array;active=!1;constructor(t,e){if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let s=0,r=t.bones.length;s<r;s++){let r=e.findBone(t.bones[s].name);if(!r)throw new Error(`Couldn't find bone ${t.bones[s].name}.`);this.bones.push(r)}let s=e.findSlot(t.target.name);if(!s)throw new Error(`Couldn't find target bone ${t.target.name}`);this.target=s,this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}isActive(){return this.active}setToSetupPose(){const t=this.data;this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}update(t){let e=this.target.getAttachment();if(!(e instanceof r.H))return;let s=this.mixRotate,o=this.mixX,l=this.mixY;if(0==s&&0==o&&0==l)return;let h=this.data,c=h.rotateMode==i.Dr.Tangent,u=h.rotateMode==i.Dr.ChainScale,d=this.bones,p=d.length,f=c?p:p+1,m=n.Aq.setArraySize(this.spaces,f),g=u?this.lengths=n.Aq.setArraySize(this.lengths,p):[],x=this.spacing;switch(h.spacingMode){case i.r9.Percent:if(u)for(let t=0,e=f-1;t<e;t++){let e=d[t],s=e.data.length,r=s*e.a,i=s*e.c;g[t]=Math.sqrt(r*r+i*i)}n.Aq.arrayFill(m,1,f,x);break;case i.r9.Proportional:let t=0;for(let e=0,s=f-1;e<s;){let s=d[e],r=s.data.length;if(r<a.epsilon)u&&(g[e]=0),m[++e]=x;else{let i=r*s.a,n=r*s.c,a=Math.sqrt(i*i+n*n);u&&(g[e]=a),m[++e]=a,t+=a}}if(t>0){t=f/t*x;for(let e=1;e<f;e++)m[e]*=t}break;default:let e=h.spacingMode==i.r9.Length;for(let t=0,s=f-1;t<s;){let s=d[t],r=s.data.length;if(r<a.epsilon)u&&(g[t]=0),m[++t]=x;else{let i=r*s.a,n=r*s.c,a=Math.sqrt(i*i+n*n);u&&(g[t]=a),m[++t]=(e?r+x:x)*a/r}}}let y=this.computeWorldPositions(e,f,c),v=y[0],_=y[1],b=h.offsetRotation,w=!1;if(0==b)w=h.rotateMode==i.Dr.Chain;else{w=!1;let t=this.target.bone;b*=t.a*t.d-t.b*t.c>0?n.cj.degRad:-n.cj.degRad}for(let t=0,e=3;t<p;t++,e+=3){let r=d[t];r.worldX+=(v-r.worldX)*o,r.worldY+=(_-r.worldY)*l;let i=y[e],a=y[e+1],h=i-v,p=a-_;if(u){let e=g[t];if(0!=e){let t=(Math.sqrt(h*h+p*p)/e-1)*s+1;r.a*=t,r.c*=t}}if(v=i,_=a,s>0){let i=r.a,a=r.b,o=r.c,l=r.d,u=0,d=0,f=0;if(u=c?y[e-1]:0==m[t+1]?y[e+2]:Math.atan2(p,h),u-=Math.atan2(o,i),w){d=Math.cos(u),f=Math.sin(u);let t=r.data.length;v+=(t*(d*i-f*o)-h)*s,_+=(t*(f*i+d*o)-p)*s}else u+=b;u>n.cj.PI?u-=n.cj.PI2:u<-n.cj.PI&&(u+=n.cj.PI2),u*=s,d=Math.cos(u),f=Math.sin(u),r.a=d*i-f*o,r.b=d*a-f*l,r.c=f*i+d*o,r.d=f*a+d*l}r.updateAppliedTransform()}}computeWorldPositions(t,e,s){let r=this.target,o=this.position,l=this.spaces,h=n.Aq.setArraySize(this.positions,3*e+2),c=this.world,u=t.closed,d=t.worldVerticesLength,p=d/6,f=a.NONE;if(!t.constantSpeed){let m=t.lengths;p-=u?1:2;let g,x=m[p];switch(this.data.positionMode==i.pw.Percent&&(o*=x),this.data.spacingMode){case i.r9.Percent:g=x;break;case i.r9.Proportional:g=x/e;break;default:g=1}c=n.Aq.setArraySize(this.world,8);for(let i=0,n=0,y=0;i<e;i++,n+=3){let e=l[i]*g;o+=e;let v=o;if(u)v%=x,v<0&&(v+=x),y=0;else{if(v<0){f!=a.BEFORE&&(f=a.BEFORE,t.computeWorldVertices(r,2,4,c,0,2)),this.addBeforePosition(v,c,0,h,n);continue}if(v>x){f!=a.AFTER&&(f=a.AFTER,t.computeWorldVertices(r,d-6,4,c,0,2)),this.addAfterPosition(v-x,c,0,h,n);continue}}for(;;y++){let t=m[y];if(!(v>t)){if(0==y)v/=t;else{let e=m[y-1];v=(v-e)/(t-e)}break}}y!=f&&(f=y,u&&y==p?(t.computeWorldVertices(r,d-4,4,c,0,2),t.computeWorldVertices(r,0,4,c,4,2)):t.computeWorldVertices(r,6*y+2,8,c,0,2)),this.addCurvePosition(v,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],h,n,s||i>0&&0==e)}return h}u?(d+=2,c=n.Aq.setArraySize(this.world,d),t.computeWorldVertices(r,2,d-4,c,0,2),t.computeWorldVertices(r,0,2,c,d-4,2),c[d-2]=c[0],c[d-1]=c[1]):(p--,d-=4,c=n.Aq.setArraySize(this.world,d),t.computeWorldVertices(r,2,d,c,0,2));let m,g=n.Aq.setArraySize(this.curves,p),x=0,y=c[0],v=c[1],_=0,b=0,w=0,T=0,S=0,A=0,C=0,P=0,E=0,M=0,k=0,R=0,B=0,I=0;for(let t=0,e=2;t<p;t++,e+=6)_=c[e],b=c[e+1],w=c[e+2],T=c[e+3],S=c[e+4],A=c[e+5],C=.1875*(y-2*_+w),P=.1875*(v-2*b+T),E=.09375*(3*(_-w)-y+S),M=.09375*(3*(b-T)-v+A),k=2*C+E,R=2*P+M,B=.75*(_-y)+C+.16666667*E,I=.75*(b-v)+P+.16666667*M,x+=Math.sqrt(B*B+I*I),B+=k,I+=R,k+=E,R+=M,x+=Math.sqrt(B*B+I*I),B+=k,I+=R,x+=Math.sqrt(B*B+I*I),B+=k+E,I+=R+M,x+=Math.sqrt(B*B+I*I),g[t]=x,y=S,v=A;switch(this.data.positionMode==i.pw.Percent&&(o*=x),this.data.spacingMode){case i.r9.Percent:m=x;break;case i.r9.Proportional:m=x/e;break;default:m=1}let F=this.segments,D=0;for(let t=0,r=0,i=0,n=0;t<e;t++,r+=3){let e=l[t]*m;o+=e;let a=o;if(u)a%=x,a<0&&(a+=x),i=0;else{if(a<0){this.addBeforePosition(a,c,0,h,r);continue}if(a>x){this.addAfterPosition(a-x,c,d-4,h,r);continue}}for(;;i++){let t=g[i];if(!(a>t)){if(0==i)a/=t;else{let e=g[i-1];a=(a-e)/(t-e)}break}}if(i!=f){f=i;let t=6*i;for(y=c[t],v=c[t+1],_=c[t+2],b=c[t+3],w=c[t+4],T=c[t+5],S=c[t+6],A=c[t+7],C=.03*(y-2*_+w),P=.03*(v-2*b+T),E=.006*(3*(_-w)-y+S),M=.006*(3*(b-T)-v+A),k=2*C+E,R=2*P+M,B=.3*(_-y)+C+.16666667*E,I=.3*(b-v)+P+.16666667*M,D=Math.sqrt(B*B+I*I),F[0]=D,t=1;t<8;t++)B+=k,I+=R,k+=E,R+=M,D+=Math.sqrt(B*B+I*I),F[t]=D;B+=k,I+=R,D+=Math.sqrt(B*B+I*I),F[8]=D,B+=k+E,I+=R+M,D+=Math.sqrt(B*B+I*I),F[9]=D,n=0}for(a*=D;;n++){let t=F[n];if(!(a>t)){if(0==n)a/=t;else{let e=F[n-1];a=n+(a-e)/(t-e)}break}}this.addCurvePosition(.1*a,y,v,_,b,w,T,S,A,h,r,s||t>0&&0==e)}return h}addBeforePosition(t,e,s,r,i){let n=e[s],a=e[s+1],o=e[s+2]-n,l=e[s+3]-a,h=Math.atan2(l,o);r[i]=n+t*Math.cos(h),r[i+1]=a+t*Math.sin(h),r[i+2]=h}addAfterPosition(t,e,s,r,i){let n=e[s+2],a=e[s+3],o=n-e[s],l=a-e[s+1],h=Math.atan2(l,o);r[i]=n+t*Math.cos(h),r[i+1]=a+t*Math.sin(h),r[i+2]=h}addCurvePosition(t,e,s,r,i,n,a,o,l,h,c,u){if(0==t||isNaN(t))return h[c]=e,h[c+1]=s,void(h[c+2]=Math.atan2(i-s,r-e));let d=t*t,p=d*t,f=1-t,m=f*f,g=m*f,x=f*t,y=3*x,v=f*y,_=y*t,b=e*g+r*v+n*_+o*p,w=s*g+i*v+a*_+l*p;h[c]=b,h[c+1]=w,u&&(h[c+2]=t<.001?Math.atan2(i-s,r-e):Math.atan2(w-(s*m+i*x*2+a*d),b-(e*m+r*x*2+n*d)))}}},6185:(t,e,s)=>{"use strict";s.d(e,{P:()=>n});var r=s(1065),i=s(4269);class n extends i.v{constructor(t){const e=t.resource||new Float32Array(t.width*t.height*4);let s=t.format;s||(s=e instanceof Float32Array?"rgba32float":e instanceof Int32Array||e instanceof Uint32Array?"rgba32uint":e instanceof Int16Array||e instanceof Uint16Array?"rgba16uint":(Int8Array,"bgra8unorm")),super({...t,resource:e,format:s}),this.uploadMethodId="buffer"}static test(t){return t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}n.extension=r.Ag.TextureSource},6212:(t,e,s)=>{"use strict";s.d(e,{P:()=>n});var r=s(1065),i=s(9739);const n={extension:{type:r.Ag.CacheParser,name:"cacheTextureArray"},test:t=>Array.isArray(t)&&t.every(t=>t instanceof i.g),getCacheableAssets:(t,e)=>{const s={};return t.forEach(t=>{e.forEach((e,r)=>{s[t+(0===r?"":r+1)]=e})}),s}}},6257:(t,e,s)=>{"use strict";async function r(t){if("Image"in globalThis)return new Promise(e=>{const s=new Image;s.onload=()=>{e(!0)},s.onerror=()=>{e(!1)},s.src=t});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{const e=await(await fetch(t)).blob();await createImageBitmap(e)}catch(t){return!1}return!0}return!1}s.d(e,{P:()=>r})},6297:(t,e,s)=>{"use strict";s.d(e,{m:()=>g});var r=s(1984),i=s(946),n=s(826),a=s(3450),o=s(2155),l=s(3648),h=s(6571),c=s(5229),u=s(9212),d=s(7285),p=s(1347),f=s(646),m=s(5556);class g{attachmentLoader;scale=1;linkedMeshes=new Array;constructor(t){this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,s=new h.Y,r="string"==typeof t?JSON.parse(t):t,a=r.skeleton;if(a&&(s.hash=a.hash,s.version=a.spine,s.x=a.x,s.y=a.y,s.width=a.width,s.height=a.height,s.referenceScale=b(a,"referenceScale",100)*e,s.fps=a.fps,s.imagesPath=a.images??null,s.audioPath=a.audio??null),r.bones)for(let t=0;t<r.bones.length;t++){let n=r.bones[t],a=null,o=b(n,"parent",null);o&&(a=s.findBone(o));let l=new i.h(s.bones.length,n.name,a);l.length=b(n,"length",0)*e,l.x=b(n,"x",0)*e,l.y=b(n,"y",0)*e,l.rotation=b(n,"rotation",0),l.scaleX=b(n,"scaleX",1),l.scaleY=b(n,"scaleY",1),l.shearX=b(n,"shearX",0),l.shearY=b(n,"shearY",0),l.inherit=p.Aq.enumValue(i.u,b(n,"inherit","Normal")),l.skinRequired=b(n,"skin",!1);let h=b(n,"color",null);h&&l.color.setFromString(h),s.bones.push(l)}if(r.slots)for(let t=0;t<r.slots.length;t++){let e=r.slots[t],i=e.name,n=s.findBone(e.bone);if(!n)throw new Error(`Couldn't find bone ${e.bone} for slot ${i}`);let a=new u.P(s.slots.length,i,n),o=b(e,"color",null);o&&a.color.setFromString(o);let l=b(e,"dark",null);l&&(a.darkColor=p.Q1.fromString(l)),a.attachmentName=b(e,"attachment",null),a.blendMode=p.Aq.enumValue(u.N,b(e,"blend","normal")),a.visible=b(e,"visible",!0),s.slots.push(a)}if(r.ik)for(let t=0;t<r.ik.length;t++){let i=r.ik[t],n=new o.Q(i.name);n.order=b(i,"order",0),n.skinRequired=b(i,"skin",!1);for(let t=0;t<i.bones.length;t++){let e=s.findBone(i.bones[t]);if(!e)throw new Error(`Couldn't find bone ${i.bones[t]} for IK constraint ${i.name}.`);n.bones.push(e)}let a=s.findBone(i.target);if(!a)throw new Error(`Couldn't find target bone ${i.target} for IK constraint ${i.name}.`);n.target=a,n.mix=b(i,"mix",1),n.softness=b(i,"softness",0)*e,n.bendDirection=b(i,"bendPositive",!0)?1:-1,n.compress=b(i,"compress",!1),n.stretch=b(i,"stretch",!1),n.uniform=b(i,"uniform",!1),s.ikConstraints.push(n)}if(r.transform)for(let t=0;t<r.transform.length;t++){let i=r.transform[t],n=new d._(i.name);n.order=b(i,"order",0),n.skinRequired=b(i,"skin",!1);for(let t=0;t<i.bones.length;t++){let e=i.bones[t],r=s.findBone(e);if(!r)throw new Error(`Couldn't find bone ${e} for transform constraint ${i.name}.`);n.bones.push(r)}let a=i.target,o=s.findBone(a);if(!o)throw new Error(`Couldn't find target bone ${a} for transform constraint ${i.name}.`);n.target=o,n.local=b(i,"local",!1),n.relative=b(i,"relative",!1),n.offsetRotation=b(i,"rotation",0),n.offsetX=b(i,"x",0)*e,n.offsetY=b(i,"y",0)*e,n.offsetScaleX=b(i,"scaleX",0),n.offsetScaleY=b(i,"scaleY",0),n.offsetShearY=b(i,"shearY",0),n.mixRotate=b(i,"mixRotate",1),n.mixX=b(i,"mixX",1),n.mixY=b(i,"mixY",n.mixX),n.mixScaleX=b(i,"mixScaleX",1),n.mixScaleY=b(i,"mixScaleY",n.mixScaleX),n.mixShearY=b(i,"mixShearY",1),s.transformConstraints.push(n)}if(r.path)for(let t=0;t<r.path.length;t++){let i=r.path[t],n=new l.rX(i.name);n.order=b(i,"order",0),n.skinRequired=b(i,"skin",!1);for(let t=0;t<i.bones.length;t++){let e=i.bones[t],r=s.findBone(e);if(!r)throw new Error(`Couldn't find bone ${e} for path constraint ${i.name}.`);n.bones.push(r)}let a=i.target,o=s.findSlot(a);if(!o)throw new Error(`Couldn't find target slot ${a} for path constraint ${i.name}.`);n.target=o,n.positionMode=p.Aq.enumValue(l.pw,b(i,"positionMode","Percent")),n.spacingMode=p.Aq.enumValue(l.r9,b(i,"spacingMode","Length")),n.rotateMode=p.Aq.enumValue(l.Dr,b(i,"rotateMode","Tangent")),n.offsetRotation=b(i,"rotation",0),n.position=b(i,"position",0),n.positionMode==l.pw.Fixed&&(n.position*=e),n.spacing=b(i,"spacing",0),n.spacingMode!=l.r9.Length&&n.spacingMode!=l.r9.Fixed||(n.spacing*=e),n.mixRotate=b(i,"mixRotate",1),n.mixX=b(i,"mixX",1),n.mixY=b(i,"mixY",n.mixX),s.pathConstraints.push(n)}if(r.physics)for(let t=0;t<r.physics.length;t++){const i=r.physics[t],n=new m.P(i.name);n.order=b(i,"order",0),n.skinRequired=b(i,"skin",!1);const a=i.bone,o=s.findBone(a);if(null==o)throw new Error("Physics bone not found: "+a);n.bone=o,n.x=b(i,"x",0),n.y=b(i,"y",0),n.rotate=b(i,"rotate",0),n.scaleX=b(i,"scaleX",0),n.shearX=b(i,"shearX",0),n.limit=b(i,"limit",5e3)*e,n.step=1/b(i,"fps",60),n.inertia=b(i,"inertia",1),n.strength=b(i,"strength",100),n.damping=b(i,"damping",1),n.massInverse=1/b(i,"mass",1),n.wind=b(i,"wind",0),n.gravity=b(i,"gravity",0),n.mix=b(i,"mix",1),n.inertiaGlobal=b(i,"inertiaGlobal",!1),n.strengthGlobal=b(i,"strengthGlobal",!1),n.dampingGlobal=b(i,"dampingGlobal",!1),n.massGlobal=b(i,"massGlobal",!1),n.windGlobal=b(i,"windGlobal",!1),n.gravityGlobal=b(i,"gravityGlobal",!1),n.mixGlobal=b(i,"mixGlobal",!1),s.physicsConstraints.push(n)}if(r.skins)for(let t=0;t<r.skins.length;t++){let e=r.skins[t],i=new c.M(e.name);if(e.bones)for(let t=0;t<e.bones.length;t++){let r=e.bones[t],n=s.findBone(r);if(!n)throw new Error(`Couldn't find bone ${r} for skin ${e.name}.`);i.bones.push(n)}if(e.ik)for(let t=0;t<e.ik.length;t++){let r=e.ik[t],n=s.findIkConstraint(r);if(!n)throw new Error(`Couldn't find IK constraint ${r} for skin ${e.name}.`);i.constraints.push(n)}if(e.transform)for(let t=0;t<e.transform.length;t++){let r=e.transform[t],n=s.findTransformConstraint(r);if(!n)throw new Error(`Couldn't find transform constraint ${r} for skin ${e.name}.`);i.constraints.push(n)}if(e.path)for(let t=0;t<e.path.length;t++){let r=e.path[t],n=s.findPathConstraint(r);if(!n)throw new Error(`Couldn't find path constraint ${r} for skin ${e.name}.`);i.constraints.push(n)}if(e.physics)for(let t=0;t<e.physics.length;t++){let r=e.physics[t],n=s.findPhysicsConstraint(r);if(!n)throw new Error(`Couldn't find physics constraint ${r} for skin ${e.name}.`);i.constraints.push(n)}for(let t in e.attachments){let r=s.findSlot(t);if(!r)throw new Error(`Couldn't find slot ${t} for skin ${e.name}.`);let n=e.attachments[t];for(let t in n){let e=this.readAttachment(n[t],i,r.index,t,s);e&&i.setAttachment(r.index,t,e)}}s.skins.push(i),"default"==i.name&&(s.defaultSkin=i)}for(let t=0,e=this.linkedMeshes.length;t<e;t++){let e=this.linkedMeshes[t],r=e.skin?s.findSkin(e.skin):s.defaultSkin;if(!r)throw new Error(`Skin not found: ${e.skin}`);let i=r.getAttachment(e.slotIndex,e.parent);if(!i)throw new Error(`Parent mesh not found: ${e.parent}`);e.mesh.timelineAttachment=e.inheritTimeline?i:e.mesh,e.mesh.setParentMesh(i),null!=e.mesh.region&&e.mesh.updateRegion()}if(this.linkedMeshes.length=0,r.events)for(let t in r.events){let e=r.events[t],i=new n.R(t);i.intValue=b(e,"int",0),i.floatValue=b(e,"float",0),i.stringValue=b(e,"string",""),i.audioPath=b(e,"audio",null),i.audioPath&&(i.volume=b(e,"volume",1),i.balance=b(e,"balance",0)),s.events.push(i)}if(r.animations)for(let t in r.animations){let e=r.animations[t];this.readAnimation(e,t,s)}return s}readAttachment(t,e,s,r,i){let n=this.scale;switch(r=b(t,"name",r),b(t,"type","region")){case"region":{let s=b(t,"path",r),i=this.readSequence(b(t,"sequence",null)),a=this.attachmentLoader.newRegionAttachment(e,r,s,i);if(!a)return null;a.path=s,a.x=b(t,"x",0)*n,a.y=b(t,"y",0)*n,a.scaleX=b(t,"scaleX",1),a.scaleY=b(t,"scaleY",1),a.rotation=b(t,"rotation",0),a.width=t.width*n,a.height=t.height*n,a.sequence=i;let o=b(t,"color",null);return o&&a.color.setFromString(o),null!=a.region&&a.updateRegion(),a}case"boundingbox":{let s=this.attachmentLoader.newBoundingBoxAttachment(e,r);if(!s)return null;this.readVertices(t,s,t.vertexCount<<1);let i=b(t,"color",null);return i&&s.color.setFromString(i),s}case"mesh":case"linkedmesh":{let i=b(t,"path",r),a=this.readSequence(b(t,"sequence",null)),o=this.attachmentLoader.newMeshAttachment(e,r,i,a);if(!o)return null;o.path=i;let l=b(t,"color",null);l&&o.color.setFromString(l),o.width=b(t,"width",0)*n,o.height=b(t,"height",0)*n,o.sequence=a;let h=b(t,"parent",null);if(h)return this.linkedMeshes.push(new x(o,b(t,"skin",null),s,h,b(t,"timelines",!0))),o;let c=t.uvs;return this.readVertices(t,o,c.length),o.triangles=t.triangles,o.regionUVs=c,null!=o.region&&o.updateRegion(),o.edges=b(t,"edges",null),o.hullLength=2*b(t,"hull",0),o}case"path":{let s=this.attachmentLoader.newPathAttachment(e,r);if(!s)return null;s.closed=b(t,"closed",!1),s.constantSpeed=b(t,"constantSpeed",!0);let i=t.vertexCount;this.readVertices(t,s,i<<1);let a=p.Aq.newArray(i/3,0);for(let e=0;e<t.lengths.length;e++)a[e]=t.lengths[e]*n;s.lengths=a;let o=b(t,"color",null);return o&&s.color.setFromString(o),s}case"point":{let s=this.attachmentLoader.newPointAttachment(e,r);if(!s)return null;s.x=b(t,"x",0)*n,s.y=b(t,"y",0)*n,s.rotation=b(t,"rotation",0);let i=b(t,"color",null);return i&&s.color.setFromString(i),s}case"clipping":{let s=this.attachmentLoader.newClippingAttachment(e,r);if(!s)return null;let n=b(t,"end",null);n&&(s.endSlot=i.findSlot(n));let a=t.vertexCount;this.readVertices(t,s,a<<1);let o=b(t,"color",null);return o&&s.color.setFromString(o),s}}return null}readSequence(t){if(null==t)return null;let e=new f.gd(b(t,"count",0));return e.start=b(t,"start",1),e.digits=b(t,"digits",0),e.setupIndex=b(t,"setup",0),e}readVertices(t,e,s){let r=this.scale;e.worldVerticesLength=s;let i=t.vertices;if(s==i.length){let t=p.Aq.toFloatArray(i);if(1!=r)for(let e=0,s=i.length;e<s;e++)t[e]*=r;return void(e.vertices=t)}let n=new Array,a=new Array;for(let t=0,e=i.length;t<e;){let e=i[t++];a.push(e);for(let s=t+4*e;t<s;t+=4)a.push(i[t]),n.push(i[t+1]*r),n.push(i[t+2]*r),n.push(i[t+3])}e.bones=a,e.vertices=p.Aq.toFloatArray(n)}readAnimation(t,e,s){let n=this.scale,o=new Array;if(t.slots)for(let e in t.slots){let i=t.slots[e],n=s.findSlot(e);if(!n)throw new Error("Slot not found: "+e);let a=n.index;for(let t in i){let e=i[t];if(!e)continue;let s=e.length;if("attachment"==t){let t=new r.zK(s,a);for(let r=0;r<s;r++){let s=e[r];t.setFrame(r,b(s,"time",0),b(s,"name",null))}o.push(t)}else if("rgba"==t){let t=new r.EP(s,s<<2,a),i=e[0],n=b(i,"time",0),l=p.Q1.fromString(i.color);for(let s=0,r=0;;s++){t.setFrame(s,n,l.r,l.g,l.b,l.a);let a=e[s+1];if(!a){t.shrink(r);break}let o=b(a,"time",0),h=p.Q1.fromString(a.color),c=i.curve;c&&(r=_(c,t,r,s,0,n,o,l.r,h.r,1),r=_(c,t,r,s,1,n,o,l.g,h.g,1),r=_(c,t,r,s,2,n,o,l.b,h.b,1),r=_(c,t,r,s,3,n,o,l.a,h.a,1)),n=o,l=h,i=a}o.push(t)}else if("rgb"==t){let t=new r.Di(s,3*s,a),i=e[0],n=b(i,"time",0),l=p.Q1.fromString(i.color);for(let s=0,r=0;;s++){t.setFrame(s,n,l.r,l.g,l.b);let a=e[s+1];if(!a){t.shrink(r);break}let o=b(a,"time",0),h=p.Q1.fromString(a.color),c=i.curve;c&&(r=_(c,t,r,s,0,n,o,l.r,h.r,1),r=_(c,t,r,s,1,n,o,l.g,h.g,1),r=_(c,t,r,s,2,n,o,l.b,h.b,1)),n=o,l=h,i=a}o.push(t)}else if("alpha"==t)o.push(y(e,new r._Y(s,s,a),0,1));else if("rgba2"==t){let t=new r.Ev(s,7*s,a),i=e[0],n=b(i,"time",0),l=p.Q1.fromString(i.light),h=p.Q1.fromString(i.dark);for(let s=0,r=0;;s++){t.setFrame(s,n,l.r,l.g,l.b,l.a,h.r,h.g,h.b);let a=e[s+1];if(!a){t.shrink(r);break}let o=b(a,"time",0),c=p.Q1.fromString(a.light),u=p.Q1.fromString(a.dark),d=i.curve;d&&(r=_(d,t,r,s,0,n,o,l.r,c.r,1),r=_(d,t,r,s,1,n,o,l.g,c.g,1),r=_(d,t,r,s,2,n,o,l.b,c.b,1),r=_(d,t,r,s,3,n,o,l.a,c.a,1),r=_(d,t,r,s,4,n,o,h.r,u.r,1),r=_(d,t,r,s,5,n,o,h.g,u.g,1),r=_(d,t,r,s,6,n,o,h.b,u.b,1)),n=o,l=c,h=u,i=a}o.push(t)}else if("rgb2"==t){let t=new r.fT(s,6*s,a),i=e[0],n=b(i,"time",0),l=p.Q1.fromString(i.light),h=p.Q1.fromString(i.dark);for(let s=0,r=0;;s++){t.setFrame(s,n,l.r,l.g,l.b,h.r,h.g,h.b);let a=e[s+1];if(!a){t.shrink(r);break}let o=b(a,"time",0),c=p.Q1.fromString(a.light),u=p.Q1.fromString(a.dark),d=i.curve;d&&(r=_(d,t,r,s,0,n,o,l.r,c.r,1),r=_(d,t,r,s,1,n,o,l.g,c.g,1),r=_(d,t,r,s,2,n,o,l.b,c.b,1),r=_(d,t,r,s,3,n,o,h.r,u.r,1),r=_(d,t,r,s,4,n,o,h.g,u.g,1),r=_(d,t,r,s,5,n,o,h.b,u.b,1)),n=o,l=c,h=u,i=a}o.push(t)}}}if(t.bones)for(let e in t.bones){let a=t.bones[e],l=s.findBone(e);if(!l)throw new Error("Bone not found: "+e);let h=l.index;for(let t in a){let e=a[t],s=e.length;if(0!=s)if("rotate"===t)o.push(y(e,new r.NQ(s,s,h),0,1));else if("translate"===t){let t=new r.Sr(s,s<<1,h);o.push(v(e,t,"x","y",0,n))}else if("translatex"===t){let t=new r.GU(s,s,h);o.push(y(e,t,0,n))}else if("translatey"===t){let t=new r.nS(s,s,h);o.push(y(e,t,0,n))}else if("scale"===t){let t=new r.i9(s,s<<1,h);o.push(v(e,t,"x","y",1,1))}else if("scalex"===t){let t=new r.So(s,s,h);o.push(y(e,t,1,1))}else if("scaley"===t){let t=new r.pR(s,s,h);o.push(y(e,t,1,1))}else if("shear"===t){let t=new r.$l(s,s<<1,h);o.push(v(e,t,"x","y",0,1))}else if("shearx"===t){let t=new r.jx(s,s,h);o.push(y(e,t,0,1))}else if("sheary"===t){let t=new r.eP(s,s,h);o.push(y(e,t,0,1))}else if("inherit"===t){let t=new r.hd(s,l.index);for(let s=0;s<e.length;s++){let r=e[s];t.setFrame(s,b(r,"time",0),p.Aq.enumValue(i.u,b(r,"inherit","Normal")))}o.push(t)}}}if(t.ik)for(let e in t.ik){let i=t.ik[e],a=i[0];if(!a)continue;let l=s.findIkConstraint(e);if(!l)throw new Error("IK Constraint not found: "+e);let h=s.ikConstraints.indexOf(l),c=new r.pA(i.length,i.length<<1,h),u=b(a,"time",0),d=b(a,"mix",1),p=b(a,"softness",0)*n;for(let t=0,e=0;;t++){c.setFrame(t,u,d,p,b(a,"bendPositive",!0)?1:-1,b(a,"compress",!1),b(a,"stretch",!1));let s=i[t+1];if(!s){c.shrink(e);break}let r=b(s,"time",0),o=b(s,"mix",1),l=b(s,"softness",0)*n,h=a.curve;h&&(e=_(h,c,e,t,0,u,r,d,o,1),e=_(h,c,e,t,1,u,r,p,l,n)),u=r,d=o,p=l,a=s}o.push(c)}if(t.transform)for(let e in t.transform){let i=t.transform[e],n=i[0];if(!n)continue;let a=s.findTransformConstraint(e);if(!a)throw new Error("Transform constraint not found: "+e);let l=s.transformConstraints.indexOf(a),h=new r.To(i.length,6*i.length,l),c=b(n,"time",0),u=b(n,"mixRotate",1),d=b(n,"mixX",1),p=b(n,"mixY",d),f=b(n,"mixScaleX",1),m=b(n,"mixScaleY",f),g=b(n,"mixShearY",1);for(let t=0,e=0;;t++){h.setFrame(t,c,u,d,p,f,m,g);let s=i[t+1];if(!s){h.shrink(e);break}let r=b(s,"time",0),a=b(s,"mixRotate",1),o=b(s,"mixX",1),l=b(s,"mixY",o),x=b(s,"mixScaleX",1),y=b(s,"mixScaleY",x),v=b(s,"mixShearY",1),w=n.curve;w&&(e=_(w,h,e,t,0,c,r,u,a,1),e=_(w,h,e,t,1,c,r,d,o,1),e=_(w,h,e,t,2,c,r,p,l,1),e=_(w,h,e,t,3,c,r,f,x,1),e=_(w,h,e,t,4,c,r,m,y,1),e=_(w,h,e,t,5,c,r,g,v,1)),c=r,u=a,d=o,p=l,f=x,m=y,f=x,n=s}o.push(h)}if(t.path)for(let e in t.path){let i=t.path[e],a=s.findPathConstraint(e);if(!a)throw new Error("Path constraint not found: "+e);let h=s.pathConstraints.indexOf(a);for(let t in i){let e=i[t],s=e[0];if(!s)continue;let c=e.length;if("position"===t){let t=new r.vz(c,c,h);o.push(y(e,t,0,a.positionMode==l.pw.Fixed?n:1))}else if("spacing"===t){let t=new r.vl(c,c,h);o.push(y(e,t,0,a.spacingMode==l.r9.Length||a.spacingMode==l.r9.Fixed?n:1))}else if("mix"===t){let t=new r.I6(c,3*c,h),i=b(s,"time",0),n=b(s,"mixRotate",1),a=b(s,"mixX",1),l=b(s,"mixY",a);for(let r=0,o=0;;r++){t.setFrame(r,i,n,a,l);let h=e[r+1];if(!h){t.shrink(o);break}let c=b(h,"time",0),u=b(h,"mixRotate",1),d=b(h,"mixX",1),p=b(h,"mixY",d),f=s.curve;f&&(o=_(f,t,o,r,0,i,c,n,u,1),o=_(f,t,o,r,1,i,c,a,d,1),o=_(f,t,o,r,2,i,c,l,p,1)),i=c,n=u,a=d,l=p,s=h}o.push(t)}}}if(t.physics)for(let e in t.physics){let i=t.physics[e],n=-1;if(e.length>0){let t=s.findPhysicsConstraint(e);if(!t)throw new Error("Physics constraint not found: "+e);n=s.physicsConstraints.indexOf(t)}for(let t in i){let e=i[t],s=e[0];if(!s)continue;let a,l=e.length;if("reset"==t){const t=new r.lJ(l,n);for(let r=0;null!=s;s=e[r+1],r++)t.setFrame(r,b(s,"time",0));o.push(t);continue}if("inertia"==t)a=new r.oc(l,l,n);else if("strength"==t)a=new r.$4(l,l,n);else if("damping"==t)a=new r.yz(l,l,n);else if("mass"==t)a=new r.Ms(l,l,n);else if("wind"==t)a=new r.UJ(l,l,n);else if("gravity"==t)a=new r.g(l,l,n);else{if("mix"!=t)continue;a=new r.yJ(l,l,n)}o.push(y(e,a,0,1))}}if(t.attachments)for(let e in t.attachments){let i=t.attachments[e],a=s.findSkin(e);if(!a)throw new Error("Skin not found: "+e);for(let t in i){let e=i[t],l=s.findSlot(t);if(!l)throw new Error("Slot not found: "+t);let h=l.index;for(let t in e){let s=e[t],i=a.getAttachment(h,t);for(let t in s){let e=s[t],a=e[0];if(a)if("deform"==t){let t=i.bones,s=i.vertices,l=t?s.length/3*2:s.length,c=new r.jQ(e.length,e.length,h,i),u=b(a,"time",0);for(let r=0,i=0;;r++){let o,h=b(a,"vertices",null);if(h){o=p.Aq.newFloatArray(l);let e=b(a,"offset",0);if(p.Aq.arrayCopy(h,0,o,e,h.length),1!=n)for(let t=e,s=t+h.length;t<s;t++)o[t]*=n;if(!t)for(let t=0;t<l;t++)o[t]+=s[t]}else o=t?p.Aq.newFloatArray(l):s;c.setFrame(r,u,o);let d=e[r+1];if(!d){c.shrink(i);break}let f=b(d,"time",0),m=a.curve;m&&(i=_(m,c,i,r,0,u,f,0,1,1)),u=f,a=d}o.push(c)}else if("sequence"==t){let t=new r.lP(e.length,h,i),s=0;for(let r=0;r<e.length;r++){let i=b(a,"delay",s),n=b(a,"time",0),o=f.zu[b(a,"mode","hold")],l=b(a,"index",0);t.setFrame(r,n,o,l,i),s=i,a=e[r+1]}o.push(t)}}}}}if(t.drawOrder){let e=new r.Kn(t.drawOrder.length),i=s.slots.length,n=0;for(let r=0;r<t.drawOrder.length;r++,n++){let a=t.drawOrder[r],o=null,l=b(a,"offsets",null);if(l){o=p.Aq.newArray(i,-1);let t=p.Aq.newArray(i-l.length,0),e=0,r=0;for(let i=0;i<l.length;i++){let n=l[i],a=s.findSlot(n.slot);if(!a)throw new Error("Slot not found: "+a);let h=a.index;for(;e!=h;)t[r++]=e++;o[e+n.offset]=e++}for(;e<i;)t[r++]=e++;for(let e=i-1;e>=0;e--)-1==o[e]&&(o[e]=t[--r])}e.setFrame(n,b(a,"time",0),o)}o.push(e)}if(t.events){let e=new r.qs(t.events.length),i=0;for(let r=0;r<t.events.length;r++,i++){let n=t.events[r],o=s.findEvent(n.name);if(!o)throw new Error("Event not found: "+n.name);let l=new a.J(p.Aq.toSinglePrecision(b(n,"time",0)),o);l.intValue=b(n,"int",o.intValue),l.floatValue=b(n,"float",o.floatValue),l.stringValue=b(n,"string",o.stringValue),l.data.audioPath&&(l.volume=b(n,"volume",1),l.balance=b(n,"balance",0)),e.setFrame(i,l)}o.push(e)}let h=0;for(let t=0,e=o.length;t<e;t++)h=Math.max(h,o[t].getDuration());s.animations.push(new r.X5(e,o,h))}}class x{parent;skin;slotIndex;mesh;inheritTimeline;constructor(t,e,s,r,i){this.mesh=t,this.skin=e,this.slotIndex=s,this.parent=r,this.inheritTimeline=i}}function y(t,e,s,r){let i=t[0],n=b(i,"time",0),a=b(i,"value",s)*r,o=0;for(let l=0;;l++){e.setFrame(l,n,a);let h=t[l+1];if(!h)return e.shrink(o),e;let c=b(h,"time",0),u=b(h,"value",s)*r;i.curve&&(o=_(i.curve,e,o,l,0,n,c,a,u,r)),n=c,a=u,i=h}}function v(t,e,s,r,i,n){let a=t[0],o=b(a,"time",0),l=b(a,s,i)*n,h=b(a,r,i)*n,c=0;for(let u=0;;u++){e.setFrame(u,o,l,h);let d=t[u+1];if(!d)return e.shrink(c),e;let p=b(d,"time",0),f=b(d,s,i)*n,m=b(d,r,i)*n,g=a.curve;g&&(c=_(g,e,c,u,0,o,p,l,f,n),c=_(g,e,c,u,1,o,p,h,m,n)),o=p,l=f,h=m,a=d}}function _(t,e,s,r,i,n,a,o,l,h){if("stepped"==t)return e.setStepped(r),s;let c=i<<2,u=t[c],d=t[c+1]*h,p=t[c+2],f=t[c+3]*h;return e.setBezier(s,r,i,n,o,u,d,p,f,a,l),s+1}function b(t,e,s){return void 0!==t[e]?t[e]:s}},6307:(t,e,s)=>{"use strict";s.d(e,{u:()=>a});var r=s(1065),i=s(2027),n=s(3798);const a={extension:{type:r.Ag.ResolveParser,priority:-2,name:"resolveJson"},test:t=>i.x.RETINA_PREFIX.test(t)&&t.endsWith(".json"),parse:n.j.parse}},6364:(t,e,s)=>{"use strict";s.d(e,{GH:()=>ct});var r=s(1065),i=s(2791),n=s(4404),a=s(4582),o=s(4696),l=s(761),h=s(5199),c=s(9390);function u(t,e,s,r,i){const n=e.a,a=e.b,o=e.c,l=e.d,h=e.tx,c=e.ty;s||(s=0),r||(r=2),i||(i=t.length/r-s);let u=s*r;for(let e=0;e<i;e++){const e=t[u],s=t[u+1];t[u]=n*e+o*s+h,t[u+1]=a*e+l*s+c,u+=r}}var d=s(9739),p=s(5008);const f={extension:{type:r.Ag.ShapeBuilder,name:"circle"},build(t,e){let s,r,i,n,a,o;if("circle"===t.type){const e=t;if(a=o=e.radius,a<=0)return!1;s=e.x,r=e.y,i=n=0}else if("ellipse"===t.type){const e=t;if(a=e.halfWidth,o=e.halfHeight,a<=0||o<=0)return!1;s=e.x,r=e.y,i=n=0}else{const e=t,l=e.width/2,h=e.height/2;s=e.x+l,r=e.y+h,a=o=Math.max(0,Math.min(e.radius,Math.min(l,h))),i=l-a,n=h-o}if(i<0||n<0)return!1;const l=Math.ceil(2.3*Math.sqrt(a+o)),h=8*l+(i?4:0)+(n?4:0);if(0===h)return!1;if(0===l)return e[0]=e[6]=s+i,e[1]=e[3]=r+n,e[2]=e[4]=s-i,e[5]=e[7]=r-n,!0;let c=0,u=4*l+(i?2:0)+2,d=u,p=h,f=i+a,m=n,g=s+f,x=s-f,y=r+m;if(e[c++]=g,e[c++]=y,e[--u]=y,e[--u]=x,n){const t=r-m;e[d++]=x,e[d++]=t,e[--p]=t,e[--p]=g}for(let t=1;t<l;t++){const h=Math.PI/2*(t/l),f=i+Math.cos(h)*a,m=n+Math.sin(h)*o,g=s+f,x=s-f,y=r+m,v=r-m;e[c++]=g,e[c++]=y,e[--u]=y,e[--u]=x,e[d++]=x,e[d++]=v,e[--p]=v,e[--p]=g}f=i,m=n+o,g=s+f,x=s-f,y=r+m;const v=r-m;return e[c++]=g,e[c++]=y,e[--p]=v,e[--p]=g,i&&(e[c++]=x,e[c++]=y,e[--p]=v,e[--p]=x),!0},triangulate(t,e,s,r,i,n){if(0===t.length)return;let a=0,o=0;for(let e=0;e<t.length;e+=2)a+=t[e],o+=t[e+1];a/=t.length/2,o/=t.length/2;let l=r;e[l*s]=a,e[l*s+1]=o;const h=l++;for(let r=0;r<t.length;r+=2)e[l*s]=t[r],e[l*s+1]=t[r+1],r>0&&(i[n++]=l,i[n++]=h,i[n++]=l-1),l++;i[n++]=h+1,i[n++]=h,i[n++]=l-1}},m={...f,extension:{...f.extension,name:"ellipse"}},g={...f,extension:{...f.extension,name:"roundedRectangle"}};var x=s(59);const y=1e-4;function v(t,e,s,r,i,n,a,o){let l,h;a?(l=r,h=-s):(l=-r,h=s);const c=t-s*i+l,u=e-r*i+h,d=t+s*n+l,p=e+r*n+h;return o.push(c,u),o.push(d,p),2}function _(t,e,s,r,i,n,a,o){const l=s-t,h=r-e;let c=Math.atan2(l,h),u=Math.atan2(i-t,n-e);o&&c<u?c+=2*Math.PI:!o&&c>u&&(u+=2*Math.PI);let d=c;const p=u-c,f=Math.abs(p),m=Math.sqrt(l*l+h*h),g=1+(15*f*Math.sqrt(m)/Math.PI|0),x=p/g;if(d+=x,o){a.push(t,e),a.push(s,r);for(let s=1,r=d;s<g;s++,r+=x)a.push(t,e),a.push(t+Math.sin(r)*m,e+Math.cos(r)*m);a.push(t,e),a.push(i,n)}else{a.push(s,r),a.push(t,e);for(let s=1,r=d;s<g;s++,r+=x)a.push(t+Math.sin(r)*m,e+Math.cos(r)*m),a.push(t,e);a.push(i,n),a.push(t,e)}return 2*g}function b(t,e,s=2){const r=e&&e.length,i=r?e[0]*s:t.length;let n=w(t,0,i,s,!0);const a=[];if(!n||n.next===n.prev)return a;let o,l,h;if(r&&(n=function(t,e,s,r){const i=[];for(let s=0,n=e.length;s<n;s++){const a=w(t,e[s]*r,s<n-1?e[s+1]*r:t.length,r,!1);a===a.next&&(a.steiner=!0),i.push(I(a))}i.sort(M);for(let t=0;t<i.length;t++)s=k(i[t],s);return s}(t,e,n,s)),t.length>80*s){o=t[0],l=t[1];let e=o,r=l;for(let n=s;n<i;n+=s){const s=t[n],i=t[n+1];s<o&&(o=s),i<l&&(l=i),s>e&&(e=s),i>r&&(r=i)}h=Math.max(e-o,r-l),h=0!==h?32767/h:0}return S(n,a,s,o,l,h,0),a}function w(t,e,s,r,i){let n;if(i===function(t,e,s,r){let i=0;for(let n=e,a=s-r;n<s;n+=r)i+=(t[a]-t[n])*(t[n+1]+t[a+1]),a=n;return i}(t,e,s,r)>0)for(let i=e;i<s;i+=r)n=z(i/r|0,t[i],t[i+1],n);else for(let i=s-r;i>=e;i-=r)n=z(i/r|0,t[i],t[i+1],n);return n&&U(n,n.next)&&(W(n),n=n.next),n}function T(t,e){if(!t)return t;e||(e=t);let s,r=t;do{if(s=!1,r.steiner||!U(r,r.next)&&0!==G(r.prev,r,r.next))r=r.next;else{if(W(r),r=e=r.prev,r===r.next)break;s=!0}}while(s||r!==e);return e}function S(t,e,s,r,i,n,a){if(!t)return;!a&&n&&function(t,e,s,r){let i=t;do{0===i.z&&(i.z=B(i.x,i.y,e,s,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){let e,s=1;do{let r,i=t;t=null;let n=null;for(e=0;i;){e++;let a=i,o=0;for(let t=0;t<s&&(o++,a=a.nextZ,a);t++);let l=s;for(;o>0||l>0&&a;)0!==o&&(0===l||!a||i.z<=a.z)?(r=i,i=i.nextZ,o--):(r=a,a=a.nextZ,l--),n?n.nextZ=r:t=r,r.prevZ=n,n=r;i=a}n.nextZ=null,s*=2}while(e>1)}(i)}(t,r,i,n);let o=t;for(;t.prev!==t.next;){const l=t.prev,h=t.next;if(n?C(t,r,i,n):A(t))e.push(l.i,t.i,h.i),W(t),t=h.next,o=h.next;else if((t=h)===o){a?1===a?S(t=P(T(t),e),e,s,r,i,n,2):2===a&&E(t,e,s,r,i,n):S(T(t),e,s,r,i,n,1);break}}}function A(t){const e=t.prev,s=t,r=t.next;if(G(e,s,r)>=0)return!1;const i=e.x,n=s.x,a=r.x,o=e.y,l=s.y,h=r.y,c=Math.min(i,n,a),u=Math.min(o,l,h),d=Math.max(i,n,a),p=Math.max(o,l,h);let f=r.next;for(;f!==e;){if(f.x>=c&&f.x<=d&&f.y>=u&&f.y<=p&&D(i,o,n,l,a,h,f.x,f.y)&&G(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function C(t,e,s,r){const i=t.prev,n=t,a=t.next;if(G(i,n,a)>=0)return!1;const o=i.x,l=n.x,h=a.x,c=i.y,u=n.y,d=a.y,p=Math.min(o,l,h),f=Math.min(c,u,d),m=Math.max(o,l,h),g=Math.max(c,u,d),x=B(p,f,e,s,r),y=B(m,g,e,s,r);let v=t.prevZ,_=t.nextZ;for(;v&&v.z>=x&&_&&_.z<=y;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==i&&v!==a&&D(o,c,l,u,h,d,v.x,v.y)&&G(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,_.x>=p&&_.x<=m&&_.y>=f&&_.y<=g&&_!==i&&_!==a&&D(o,c,l,u,h,d,_.x,_.y)&&G(_.prev,_,_.next)>=0)return!1;_=_.nextZ}for(;v&&v.z>=x;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==i&&v!==a&&D(o,c,l,u,h,d,v.x,v.y)&&G(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;_&&_.z<=y;){if(_.x>=p&&_.x<=m&&_.y>=f&&_.y<=g&&_!==i&&_!==a&&D(o,c,l,u,h,d,_.x,_.y)&&G(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function P(t,e){let s=t;do{const r=s.prev,i=s.next.next;!U(r,i)&&L(r,s,s.next,i)&&Y(r,i)&&Y(i,r)&&(e.push(r.i,s.i,i.i),W(s),W(s.next),s=t=i),s=s.next}while(s!==t);return T(s)}function E(t,e,s,r,i,n){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&O(a,t)){let o=V(a,t);return a=T(a,a.next),o=T(o,o.next),S(a,e,s,r,i,n,0),void S(o,e,s,r,i,n,0)}t=t.next}a=a.next}while(a!==t)}function M(t,e){let s=t.x-e.x;return 0===s&&(s=t.y-e.y,0===s)&&(s=(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)),s}function k(t,e){const s=function(t,e){let s=e;const r=t.x,i=t.y;let n,a=-1/0;if(U(t,s))return s;do{if(U(t,s.next))return s.next;if(i<=s.y&&i>=s.next.y&&s.next.y!==s.y){const t=s.x+(i-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(t<=r&&t>a&&(a=t,n=s.x<s.next.x?s:s.next,t===r))return n}s=s.next}while(s!==e);if(!n)return null;const o=n,l=n.x,h=n.y;let c=1/0;s=n;do{if(r>=s.x&&s.x>=l&&r!==s.x&&F(i<h?r:a,i,l,h,i<h?a:r,i,s.x,s.y)){const e=Math.abs(i-s.y)/(r-s.x);Y(s,t)&&(e<c||e===c&&(s.x>n.x||s.x===n.x&&R(n,s)))&&(n=s,c=e)}s=s.next}while(s!==o);return n}(t,e);if(!s)return e;const r=V(s,t);return T(r,r.next),T(s,s.next)}function R(t,e){return G(t.prev,t,e.prev)<0&&G(e.next,t,t.next)<0}function B(t,e,s,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-s)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function I(t){let e=t,s=t;do{(e.x<s.x||e.x===s.x&&e.y<s.y)&&(s=e),e=e.next}while(e!==t);return s}function F(t,e,s,r,i,n,a,o){return(i-a)*(e-o)>=(t-a)*(n-o)&&(t-a)*(r-o)>=(s-a)*(e-o)&&(s-a)*(n-o)>=(i-a)*(r-o)}function D(t,e,s,r,i,n,a,o){return!(t===a&&e===o)&&F(t,e,s,r,i,n,a,o)}function O(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let s=t;do{if(s.i!==t.i&&s.next.i!==t.i&&s.i!==e.i&&s.next.i!==e.i&&L(s,s.next,t,e))return!0;s=s.next}while(s!==t);return!1}(t,e)&&(Y(t,e)&&Y(e,t)&&function(t,e){let s=t,r=!1;const i=(t.x+e.x)/2,n=(t.y+e.y)/2;do{s.y>n!=s.next.y>n&&s.next.y!==s.y&&i<(s.next.x-s.x)*(n-s.y)/(s.next.y-s.y)+s.x&&(r=!r),s=s.next}while(s!==t);return r}(t,e)&&(G(t.prev,t,e.prev)||G(t,e.prev,e))||U(t,e)&&G(t.prev,t,t.next)>0&&G(e.prev,e,e.next)>0)}function G(t,e,s){return(e.y-t.y)*(s.x-e.x)-(e.x-t.x)*(s.y-e.y)}function U(t,e){return t.x===e.x&&t.y===e.y}function L(t,e,s,r){const i=X(G(t,e,s)),n=X(G(t,e,r)),a=X(G(s,r,t)),o=X(G(s,r,e));return i!==n&&a!==o||!(0!==i||!N(t,s,e))||!(0!==n||!N(t,r,e))||!(0!==a||!N(s,t,r))||!(0!==o||!N(s,e,r))}function N(t,e,s){return e.x<=Math.max(t.x,s.x)&&e.x>=Math.min(t.x,s.x)&&e.y<=Math.max(t.y,s.y)&&e.y>=Math.min(t.y,s.y)}function X(t){return t>0?1:t<0?-1:0}function Y(t,e){return G(t.prev,t,t.next)<0?G(t,e,t.next)>=0&&G(t,t.prev,e)>=0:G(t,e,t.prev)<0||G(t,t.next,e)<0}function V(t,e){const s=H(t.i,t.x,t.y),r=H(e.i,e.x,e.y),i=t.next,n=e.prev;return t.next=e,e.prev=t,s.next=i,i.prev=s,r.next=s,s.prev=r,n.next=r,r.prev=n,r}function z(t,e,s,r){const i=H(t,e,s);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function W(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function H(t,e,s){return{i:t,x:e,y:s,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}s(4872);const j=b.default||b;function q(t,e,s,r,i,n,a){const o=j(t,e,2);if(!o)return;for(let t=0;t<o.length;t+=3)n[a++]=o[t]+i,n[a++]=o[t+1]+i,n[a++]=o[t+2]+i;let l=i*r;for(let e=0;e<t.length;e+=2)s[l]=t[e],s[l+1]=t[e+1],l+=r}const $=[],K={extension:{type:r.Ag.ShapeBuilder,name:"polygon"},build(t,e){for(let s=0;s<t.points.length;s++)e[s]=t.points[s];return!0},triangulate(t,e,s,r,i,n){q(t,$,e,s,r,i,n)}},Q={extension:{type:r.Ag.ShapeBuilder,name:"rectangle"},build(t,e){const s=t,r=s.x,i=s.y,n=s.width,a=s.height;return n>0&&a>0&&(e[0]=r,e[1]=i,e[2]=r+n,e[3]=i,e[4]=r+n,e[5]=i+a,e[6]=r,e[7]=i+a,!0)},triangulate(t,e,s,r,i,n){let a=0;e[(r*=s)+a]=t[0],e[r+a+1]=t[1],a+=s,e[r+a]=t[2],e[r+a+1]=t[3],a+=s,e[r+a]=t[6],e[r+a+1]=t[7],a+=s,e[r+a]=t[4],e[r+a+1]=t[5],a+=s;const o=r/s;i[n++]=o,i[n++]=o+1,i[n++]=o+2,i[n++]=o+1,i[n++]=o+3,i[n++]=o+2}},Z={extension:{type:r.Ag.ShapeBuilder,name:"triangle"},build:(t,e)=>(e[0]=t.x,e[1]=t.y,e[2]=t.x2,e[3]=t.y2,e[4]=t.x3,e[5]=t.y3,!0),triangulate(t,e,s,r,i,n){let a=0;e[(r*=s)+a]=t[0],e[r+a+1]=t[1],a+=s,e[r+a]=t[2],e[r+a+1]=t[3],a+=s,e[r+a]=t[4],e[r+a+1]=t[5];const o=r/s;i[n++]=o,i[n++]=o+1,i[n++]=o+2}};var J=s(6406);const tt=new h.u,et=new c.M,st={};r.XO.handleByMap(r.Ag.ShapeBuilder,st),r.XO.add(Q,K,Z,f,m,g);const rt=new c.M,it=new h.u;function nt(t,e,s){const r=[],i=st.rectangle,n=rt;n.x=t.dx,n.y=t.dy,n.width=t.dw,n.height=t.dh;const a=t.transform;if(!i.build(n,r))return;const{vertices:o,uvs:h,indices:c}=s,d=c.length,f=o.length/2;a&&u(r,a),i.triangulate(r,o,2,f,c,d);const m=t.image,g=m.uvs;h.push(g.x0,g.y0,g.x1,g.y1,g.x3,g.y3,g.x2,g.y2);const x=l.Z.get(p.G);x.indexOffset=d,x.indexSize=c.length-d,x.attributeOffset=f,x.attributeSize=o.length/2-f,x.baseColor=t.style,x.alpha=t.alpha,x.texture=m,x.geometryData=s,e.push(x)}function at(t,e,s,r,i){const{vertices:n,uvs:a,indices:o}=i;t.shapePrimitives.forEach(({shape:t,transform:h,holes:c})=>{const f=[],m=st[t.type];if(!m.build(t,f))return;const g=o.length,b=n.length/2;let w="triangle-list";if(h&&u(f,h),s){const s=t.closePath??!0,r=e;r.pixelLine?(function(t,e,s,r){const i=y;if(0===t.length)return;const n=t[0],a=t[1],o=t[t.length-2],l=t[t.length-1],h=e||Math.abs(n-o)<i&&Math.abs(a-l)<i,c=s,u=t.length/2,d=c.length/2;for(let e=0;e<u;e++)c.push(t[2*e]),c.push(t[2*e+1]);for(let t=0;t<u-1;t++)r.push(d+t,d+t+1);h&&r.push(d+u-1,d)}(f,s,n,o),w="line-list"):function(t,e,s,r,i,n){const a=y;if(0===t.length)return;const o=e;let l=o.alignment;if(.5!==e.alignment){let e=function(t){const e=t.length;if(e<6)return 1;let s=0;for(let r=0,i=t[e-2],n=t[e-1];r<e;r+=2){const e=t[r],a=t[r+1];s+=(e-i)*(a+n),i=e,n=a}return s<0?-1:1}(t);l=(l-.5)*e+.5}const h=new x.b(t[0],t[1]),c=new x.b(t[t.length-2],t[t.length-1]),u=r,d=Math.abs(h.x-c.x)<a&&Math.abs(h.y-c.y)<a;if(u){t=t.slice(),d&&(t.pop(),t.pop(),c.set(t[t.length-2],t[t.length-1]));const e=.5*(h.x+c.x),s=.5*(c.y+h.y);t.unshift(e,s),t.push(e,s)}const p=i,f=t.length/2;let m=t.length;const g=p.length/2,b=o.width/2,w=b*b,T=o.miterLimit*o.miterLimit;let S=t[0],A=t[1],C=t[2],P=t[3],E=0,M=0,k=-(A-P),R=S-C,B=0,I=0,F=Math.sqrt(k*k+R*R);k/=F,R/=F,k*=b,R*=b;const D=2*(1-l),O=2*l;u||("round"===o.cap?m+=_(S-k*(D-O)*.5,A-R*(D-O)*.5,S-k*D,A-R*D,S+k*O,A+R*O,p,!0)+2:"square"===o.cap&&(m+=v(S,A,k,R,D,O,!0,p))),p.push(S-k*D,A-R*D),p.push(S+k*O,A+R*O);for(let e=1;e<f-1;++e){S=t[2*(e-1)],A=t[2*(e-1)+1],C=t[2*e],P=t[2*e+1],E=t[2*(e+1)],M=t[2*(e+1)+1],k=-(A-P),R=S-C,F=Math.sqrt(k*k+R*R),k/=F,R/=F,k*=b,R*=b,B=-(P-M),I=C-E,F=Math.sqrt(B*B+I*I),B/=F,I/=F,B*=b,I*=b;const s=C-S,r=A-P,i=C-E,n=M-P,a=s*i+r*n,l=r*i-n*s,h=l<0;if(Math.abs(l)<.001*Math.abs(a)){p.push(C-k*D,P-R*D),p.push(C+k*O,P+R*O),a>=0&&("round"===o.join?m+=_(C,P,C-k*D,P-R*D,C-B*D,P-I*D,p,!1)+4:m+=2,p.push(C-B*O,P-I*O),p.push(C+B*D,P+I*D));continue}const c=(-k+S)*(-R+P)-(-k+C)*(-R+A),u=(-B+E)*(-I+P)-(-B+C)*(-I+M),d=(s*u-i*c)/l,f=(n*c-r*u)/l,g=(d-C)*(d-C)+(f-P)*(f-P),x=C+(d-C)*D,y=P+(f-P)*D,v=C-(d-C)*O,G=P-(f-P)*O,U=h?D:O;g<=Math.min(s*s+r*r,i*i+n*n)+U*U*w?"bevel"===o.join||g/w>T?(h?(p.push(x,y),p.push(C+k*O,P+R*O),p.push(x,y),p.push(C+B*O,P+I*O)):(p.push(C-k*D,P-R*D),p.push(v,G),p.push(C-B*D,P-I*D),p.push(v,G)),m+=2):"round"===o.join?h?(p.push(x,y),p.push(C+k*O,P+R*O),m+=_(C,P,C+k*O,P+R*O,C+B*O,P+I*O,p,!0)+4,p.push(x,y),p.push(C+B*O,P+I*O)):(p.push(C-k*D,P-R*D),p.push(v,G),m+=_(C,P,C-k*D,P-R*D,C-B*D,P-I*D,p,!1)+4,p.push(C-B*D,P-I*D),p.push(v,G)):(p.push(x,y),p.push(v,G)):(p.push(C-k*D,P-R*D),p.push(C+k*O,P+R*O),"round"===o.join?m+=h?_(C,P,C+k*O,P+R*O,C+B*O,P+I*O,p,!0)+2:_(C,P,C-k*D,P-R*D,C-B*D,P-I*D,p,!1)+2:"miter"===o.join&&g/w<=T&&(h?(p.push(v,G),p.push(v,G)):(p.push(x,y),p.push(x,y)),m+=2),p.push(C-B*D,P-I*D),p.push(C+B*O,P+I*O),m+=2)}S=t[2*(f-2)],A=t[2*(f-2)+1],C=t[2*(f-1)],P=t[2*(f-1)+1],k=-(A-P),R=S-C,F=Math.sqrt(k*k+R*R),k/=F,R/=F,k*=b,R*=b,p.push(C-k*D,P-R*D),p.push(C+k*O,P+R*O),u||("round"===o.cap?m+=_(C-k*(D-O)*.5,P-R*(D-O)*.5,C-k*D,P-R*D,C+k*O,P+R*O,p,!1)+2:"square"===o.cap&&(m+=v(C,P,k,R,D,O,!1,p)));for(let t=g;t<m+g-2;++t)S=p[2*t],A=p[2*t+1],C=p[2*(t+1)],P=p[2*(t+1)+1],E=p[2*(t+2)],M=p[2*(t+2)+1],Math.abs(S*(P-M)+C*(M-A)+E*(A-P))<1e-8||n.push(t,t+1,t+2)}(f,r,0,s,n,o)}else if(c){const t=[],e=f.slice();(function(t){const e=[];for(let s=0;s<t.length;s++){const r=t[s].shape,i=[];st[r.type].build(r,i)&&e.push(i)}return e})(c).forEach(s=>{t.push(e.length/2),e.push(...s)}),q(e,t,n,2,b,o,g)}else m.triangulate(f,n,2,b,o,g);const T=a.length/2,S=e.texture;if(S!==d.g.WHITE){const s=function(t,e,s,r){const i=e.matrix?t.copyFrom(e.matrix).invert():t.identity();if("local"===e.textureSpace){const t=s.getBounds(et);e.width&&t.pad(e.width);const{x:r,y:n}=t,a=1/t.width,o=1/t.height,l=-r*a,h=-n*o,c=i.a,u=i.b,d=i.c,p=i.d;i.a*=a,i.b*=a,i.c*=o,i.d*=o,i.tx=l*c+h*d+i.tx,i.ty=l*u+h*p+i.ty}else i.translate(e.texture.frame.x,e.texture.frame.y),i.scale(1/e.texture.source.width,1/e.texture.source.height);const n=e.texture.source.style;return e.fill instanceof J._||"clamp-to-edge"!==n.addressMode||(n.addressMode="repeat",n.update()),r&&i.append(tt.copyFrom(r).invert()),i}(it,e,t,h);!function(t,e,s,r,i,n,a,o=null){let l=0;s*=e,i*=n;const h=o.a,c=o.b,u=o.c,d=o.d,p=o.tx,f=o.ty;for(;l<a;){const a=t[s],o=t[s+1];r[i]=h*a+u*o+p,r[i+1]=c*a+d*o+f,i+=n,s+=e,l++}}(n,2,b,a,T,2,n.length/2-b,s)}else!function(t,e,s,r){let i=0;for(e*=2;i<r;)t[e]=0,t[e+1]=0,e+=2,i++}(a,T,0,n.length/2-b);const A=l.Z.get(p.G);A.indexOffset=g,A.indexSize=o.length-g,A.attributeOffset=b,A.attributeSize=n.length/2-b,A.baseColor=e.color,A.alpha=e.alpha,A.texture=S,A.geometryData=i,A.topology=w,r.push(A)})}class ot{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}}class lt{constructor(){this.instructions=new a.L}init(t){this.batcher=new n.J({maxTextures:t}),this.instructions.reset()}get geometry(){return(0,o.t6)(o.Ek,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry}destroy(){this.batcher.destroy(),this.instructions.destroy(),this.batcher=null,this.instructions=null}}const ht=class t{constructor(t){this._gpuContextHash={},this._graphicsDataContextHash=Object.create(null),this._renderer=t,t.renderableGC.addManagedHash(this,"_gpuContextHash"),t.renderableGC.addManagedHash(this,"_graphicsDataContextHash")}init(e){t.defaultOptions.bezierSmoothness=e?.bezierSmoothness??t.defaultOptions.bezierSmoothness}getContextRenderData(t){return this._graphicsDataContextHash[t.uid]||this._initContextRenderData(t)}updateGpuContext(t){let e=this._gpuContextHash[t.uid]||this._initContext(t);if(t.dirty){e?this._cleanGraphicsContextData(t):e=this._initContext(t),function(t,e){const{geometryData:s,batches:r}=e;r.length=0,s.indices.length=0,s.vertices.length=0,s.uvs.length=0;for(let e=0;e<t.instructions.length;e++){const i=t.instructions[e];if("texture"===i.action)nt(i.data,r,s);else if("fill"===i.action||"stroke"===i.action){const t="stroke"===i.action,e=i.data.path.shapePath,n=i.data.style,a=i.data.hole;t&&a&&at(a.shapePath,n,!0,r,s),a&&(e.shapePrimitives[e.shapePrimitives.length-1].holes=a.shapePath.shapePrimitives),at(e,n,t,r,s)}}}(t,e);const s=t.batchMode;t.customShader||"no-batch"===s?e.isBatchable=!1:e.isBatchable="auto"!==s||e.geometryData.vertices.length<400,t.dirty=!1}return e}getGpuContext(t){return this._gpuContextHash[t.uid]||this._initContext(t)}_initContextRenderData(t){const e=l.Z.get(lt,{maxTextures:this._renderer.limits.maxBatchableTextures}),{batches:s,geometryData:r}=this._gpuContextHash[t.uid],n=r.vertices.length,a=r.indices.length;for(let t=0;t<s.length;t++)s[t].applyTransform=!1;const o=e.batcher;o.ensureAttributeBuffer(n),o.ensureIndexBuffer(a),o.begin();for(let t=0;t<s.length;t++){const e=s[t];o.add(e)}o.finish(e.instructions);const h=o.geometry;h.indexBuffer.setDataWithSize(o.indexBuffer,o.indexSize,!0),h.buffers[0].setDataWithSize(o.attributeBuffer.float32View,o.attributeSize,!0);const c=o.batches;for(let t=0;t<c.length;t++){const e=c[t];e.bindGroup=(0,i.w)(e.textures.textures,e.textures.count,this._renderer.limits.maxBatchableTextures)}return this._graphicsDataContextHash[t.uid]=e,e}_initContext(t){const e=new ot;return e.context=t,this._gpuContextHash[t.uid]=e,t.on("destroy",this.onGraphicsContextDestroy,this),this._gpuContextHash[t.uid]}onGraphicsContextDestroy(t){this._cleanGraphicsContextData(t),t.off("destroy",this.onGraphicsContextDestroy,this),this._gpuContextHash[t.uid]=null}_cleanGraphicsContextData(t){const e=this._gpuContextHash[t.uid];e.isBatchable||this._graphicsDataContextHash[t.uid]&&(l.Z.return(this.getContextRenderData(t)),this._graphicsDataContextHash[t.uid]=null),e.batches&&e.batches.forEach(t=>{l.Z.return(t)})}destroy(){for(const t in this._gpuContextHash)this._gpuContextHash[t]&&this.onGraphicsContextDestroy(this._gpuContextHash[t].context)}};ht.extension={type:[r.Ag.WebGLSystem,r.Ag.WebGPUSystem,r.Ag.CanvasSystem],name:"graphicsContext"},ht.defaultOptions={bezierSmoothness:.5};let ct=ht},6406:(t,e,s)=>{"use strict";s.d(e,{_:()=>p});var r=s(6675),i=s(5423),n=s(5199),a=s(5947),o=s(9739),l=s(9375),h=s(4696),c=s(7604);const u=[{offset:0,color:"white"},{offset:1,color:"black"}],d=class t{constructor(...e){this.uid=(0,l.L)("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[];let s=function(t){let e=t[0]??{};return("number"==typeof e||t[1])&&((0,h.t6)("8.5.2","use options object instead"),e={type:"linear",start:{x:t[0],y:t[1]},end:{x:t[2],y:t[3]},textureSpace:t[4],textureSize:t[5]??p.defaultLinearOptions.textureSize}),e}(e);s={..."radial"===s.type?t.defaultRadialOptions:t.defaultLinearOptions,...(0,c.S)(s)},this._textureSize=s.textureSize,this._wrapMode=s.wrapMode,"radial"===s.type?(this.center=s.center,this.outerCenter=s.outerCenter??this.center,this.innerRadius=s.innerRadius,this.outerRadius=s.outerRadius,this.scale=s.scale,this.rotation=s.rotation):(this.start=s.start,this.end=s.end),this.textureSpace=s.textureSpace,this.type=s.type,s.colorStops.forEach(t=>{this.addColorStop(t.offset,t.color)})}addColorStop(t,e){return this.colorStops.push({offset:t,color:r.Q.shared.setValue(e).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:t,y:e}=this.start,{x:s,y:r}=this.end,i=s-t,l=r-e;const h=i<0||l<0;if("clamp-to-edge"===this._wrapMode){if(i<0){const e=t;t=s,s=e,i*=-1}if(l<0){const t=e;e=r,r=t,l*=-1}}const c=this.colorStops.length?this.colorStops:u,d=this._textureSize,{canvas:p,context:g}=m(d,1),x=h?g.createLinearGradient(this._textureSize,0,0,0):g.createLinearGradient(0,0,this._textureSize,0);f(x,c),g.fillStyle=x,g.fillRect(0,0,d,1),this.texture=new o.g({source:new a.b({resource:p,addressMode:this._wrapMode})});const y=Math.sqrt(i*i+l*l),v=Math.atan2(l,i),_=new n.u;_.scale(y/d,1),_.rotate(v),_.translate(t,e),"local"===this.textureSpace&&_.scale(d,d),this.transform=_}buildGradient(){this.texture||this._tick++,"linear"===this.type?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;const t=this.colorStops.length?this.colorStops:u,e=this._textureSize,{canvas:s,context:r}=m(e,e),{x:i,y:l}=this.center,{x:h,y:c}=this.outerCenter,d=this.innerRadius,p=this.outerRadius,g=h-p,x=c-p,y=e/(2*p),v=(i-g)*y,_=(l-x)*y,b=r.createRadialGradient(v,_,d*y,(h-g)*y,(c-x)*y,p*y);f(b,t),r.fillStyle=t[t.length-1].color,r.fillRect(0,0,e,e),r.fillStyle=b,r.translate(v,_),r.rotate(this.rotation),r.scale(1,this.scale),r.translate(-v,-_),r.fillRect(0,0,e,e),this.texture=new o.g({source:new a.b({resource:s,addressMode:this._wrapMode})});const w=new n.u;w.scale(1/y,1/y),w.translate(g,x),"local"===this.textureSpace&&w.scale(e,e),this.transform=w}destroy(){this.texture?.destroy(!0),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null}get styleKey(){return`fill-gradient-${this.uid}-${this._tick}`}};d.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"},d.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};let p=d;function f(t,e){for(let s=0;s<e.length;s++){const r=e[s];t.addColorStop(r.offset,r.color)}}function m(t,e){const s=i.e.get().createCanvas(t,e),r=s.getContext("2d");return{canvas:s,context:r}}},6499:(t,e,s)=>{"use strict";s.d(e,{W:()=>n});var r=s(2432),i=s(8147);class n extends r.b{#j;#q;#$=new i.w(0);#K=new i.w(0);constructor(t){super(),this.#j=t,this.#q=new ResizeObserver(this.#Q.bind(this)),this.#q.observe(t)}#Q(){const t=this.#j.getBoundingClientRect();this.#$.v=t.width,this.#K.v=t.height,(this.#$.dirty||this.#K.dirty)&&(this.emit("resize",this.#$.v,this.#K.v),this.#$.resetDirty(),this.#K.resetDirty())}remove(){this.#q.disconnect(),super.remove()}}},6516:(t,e,s)=>{"use strict";s.r(e),s(3046),s(2517),s(2542),s(3050),s(8427),s(6131),s(6934),s(966),s(6841),s(9797),s(4550),s(8122)},6552:(t,e,s)=>{"use strict";s.d(e,{K:()=>n});var r=s(1347),i=s(4382);class n extends i.e{endSlot=null;color=new r.Q1(.2275,.2275,.8078,1);constructor(t){super(t)}copy(){let t=new n(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}}},6571:(t,e,s)=>{"use strict";s.d(e,{Y:()=>r});class r{name=null;bones=new Array;slots=new Array;skins=new Array;defaultSkin=null;events=new Array;animations=new Array;ikConstraints=new Array;transformConstraints=new Array;pathConstraints=new Array;physicsConstraints=new Array;x=0;y=0;width=0;height=0;referenceScale=100;version=null;hash=null;fps=0;imagesPath=null;audioPath=null;findBone(t){if(!t)throw new Error("boneName cannot be null.");let e=this.bones;for(let s=0,r=e.length;s<r;s++){let r=e[s];if(r.name==t)return r}return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let e=this.slots;for(let s=0,r=e.length;s<r;s++){let r=e[s];if(r.name==t)return r}return null}findSkin(t){if(!t)throw new Error("skinName cannot be null.");let e=this.skins;for(let s=0,r=e.length;s<r;s++){let r=e[s];if(r.name==t)return r}return null}findEvent(t){if(!t)throw new Error("eventDataName cannot be null.");let e=this.events;for(let s=0,r=e.length;s<r;s++){let r=e[s];if(r.name==t)return r}return null}findAnimation(t){if(!t)throw new Error("animationName cannot be null.");let e=this.animations;for(let s=0,r=e.length;s<r;s++){let r=e[s];if(r.name==t)return r}return null}findIkConstraint(t){if(!t)throw new Error("constraintName cannot be null.");const e=this.ikConstraints;for(let s=0,r=e.length;s<r;s++){const r=e[s];if(r.name==t)return r}return null}findTransformConstraint(t){if(!t)throw new Error("constraintName cannot be null.");const e=this.transformConstraints;for(let s=0,r=e.length;s<r;s++){const r=e[s];if(r.name==t)return r}return null}findPathConstraint(t){if(!t)throw new Error("constraintName cannot be null.");const e=this.pathConstraints;for(let s=0,r=e.length;s<r;s++){const r=e[s];if(r.name==t)return r}return null}findPhysicsConstraint(t){if(!t)throw new Error("constraintName cannot be null.");const e=this.physicsConstraints;for(let s=0,r=e.length;s<r;s++){const r=e[s];if(r.name==t)return r}return null}}},6643:(t,e,s)=>{"use strict";s.d(e,{g:()=>i});class r{constructor(t=0,e=0,s=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=t,this.resetTtl=s,this.size=0,this.ttl=e}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(t){if(this.has(t)){const e=this.items[t];delete this.items[t],this.size--,null!==e.prev&&(e.prev.next=e.next),null!==e.next&&(e.next.prev=e.prev),this.first===e&&(this.first=e.next),this.last===e&&(this.last=e.prev)}return this}entries(t=this.keys()){return t.map(t=>[t,this.get(t)])}evict(t=!1){if(t||this.size>0){const t=this.first;delete this.items[t.key],0===--this.size?(this.first=null,this.last=null):(this.first=t.next,this.first.prev=null)}return this}expiresAt(t){let e;return this.has(t)&&(e=this.items[t].expiry),e}get(t){const e=this.items[t];if(void 0!==e)return this.ttl>0&&e.expiry<=Date.now()?void this.delete(t):(this.moveToEnd(e),e.value)}has(t){return t in this.items}moveToEnd(t){this.last!==t&&(null!==t.prev&&(t.prev.next=t.next),null!==t.next&&(t.next.prev=t.prev),this.first===t&&(this.first=t.next),t.prev=this.last,t.next=null,null!==this.last&&(this.last.next=t),this.last=t,null===this.first&&(this.first=t))}keys(){const t=[];let e=this.first;for(;null!==e;)t.push(e.key),e=e.next;return t}setWithEvicted(t,e,s=this.resetTtl){let r=null;if(this.has(t))this.set(t,e,!0,s);else{this.max>0&&this.size===this.max&&(r={...this.first},this.evict(!0));let s=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:e};1===++this.size?this.first=s:this.last.next=s,this.last=s}return r}set(t,e,s=!1,r=this.resetTtl){let i=this.items[t];return s||void 0!==i?(i.value=e,!1===s&&r&&(i.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),this.moveToEnd(i)):(this.max>0&&this.size===this.max&&this.evict(!0),i=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:e},1===++this.size?this.first=i:this.last.next=i,this.last=i),this}values(t=this.keys()){return t.map(t=>this.get(t))}}function i(t=1e3,e=0,s=!1){if(isNaN(t)||t<0)throw new TypeError("Invalid max value");if(isNaN(e)||e<0)throw new TypeError("Invalid ttl value");if("boolean"!=typeof s)throw new TypeError("Invalid resetTtl value");return new r(t,e,s)}},6675:(t,e,s)=>{"use strict";s.d(e,{Q:()=>R});var r={grad:.9,turn:360,rad:360/(2*Math.PI)},i=function(t){return"string"==typeof t?t.length>0:"number"==typeof t},n=function(t,e,s){return void 0===e&&(e=0),void 0===s&&(s=Math.pow(10,e)),Math.round(s*t)/s+0},a=function(t,e,s){return void 0===e&&(e=0),void 0===s&&(s=1),t>s?s:t>e?t:e},o=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},l=function(t){return{r:a(t.r,0,255),g:a(t.g,0,255),b:a(t.b,0,255),a:a(t.a)}},h=function(t){return{r:n(t.r),g:n(t.g),b:n(t.b),a:n(t.a,3)}},c=/^#([0-9a-f]{3,8})$/i,u=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},d=function(t){var e=t.r,s=t.g,r=t.b,i=t.a,n=Math.max(e,s,r),a=n-Math.min(e,s,r),o=a?n===e?(s-r)/a:n===s?2+(r-e)/a:4+(e-s)/a:0;return{h:60*(o<0?o+6:o),s:n?a/n*100:0,v:n/255*100,a:i}},p=function(t){var e=t.h,s=t.s,r=t.v,i=t.a;e=e/360*6,s/=100,r/=100;var n=Math.floor(e),a=r*(1-s),o=r*(1-(e-n)*s),l=r*(1-(1-e+n)*s),h=n%6;return{r:255*[r,o,a,a,l,r][h],g:255*[l,r,r,o,a,a][h],b:255*[a,a,l,r,r,o][h],a:i}},f=function(t){return{h:o(t.h),s:a(t.s,0,100),l:a(t.l,0,100),a:a(t.a)}},m=function(t){return{h:n(t.h),s:n(t.s),l:n(t.l),a:n(t.a,3)}},g=function(t){return p((s=(e=t).s,{h:e.h,s:(s*=((r=e.l)<50?r:100-r)/100)>0?2*s/(r+s)*100:0,v:r+s,a:e.a}));var e,s,r},x=function(t){return{h:(e=d(t)).h,s:(i=(200-(s=e.s))*(r=e.v)/100)>0&&i<200?s*r/100/(i<=100?i:200-i)*100:0,l:i/2,a:e.a};var e,s,r,i},y=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,_=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,b=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,w={string:[[function(t){var e=c.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:4===t.length?n(parseInt(t[3]+t[3],16)/255,2):1}:6===t.length||8===t.length?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:8===t.length?n(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=_.exec(t)||b.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:l({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:void 0===e[7]?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=y.exec(t)||v.exec(t);if(!e)return null;var s,i,n=f({h:(s=e[1],i=e[2],void 0===i&&(i="deg"),Number(s)*(r[i]||1)),s:Number(e[3]),l:Number(e[4]),a:void 0===e[5]?1:Number(e[5])/(e[6]?100:1)});return g(n)},"hsl"]],object:[[function(t){var e=t.r,s=t.g,r=t.b,n=t.a,a=void 0===n?1:n;return i(e)&&i(s)&&i(r)?l({r:Number(e),g:Number(s),b:Number(r),a:Number(a)}):null},"rgb"],[function(t){var e=t.h,s=t.s,r=t.l,n=t.a,a=void 0===n?1:n;if(!i(e)||!i(s)||!i(r))return null;var o=f({h:Number(e),s:Number(s),l:Number(r),a:Number(a)});return g(o)},"hsl"],[function(t){var e=t.h,s=t.s,r=t.v,n=t.a,l=void 0===n?1:n;if(!i(e)||!i(s)||!i(r))return null;var h=function(t){return{h:o(t.h),s:a(t.s,0,100),v:a(t.v,0,100),a:a(t.a)}}({h:Number(e),s:Number(s),v:Number(r),a:Number(l)});return p(h)},"hsv"]]},T=function(t,e){for(var s=0;s<e.length;s++){var r=e[s][0](t);if(r)return[r,e[s][1]]}return[null,void 0]},S=function(t,e){var s=x(t);return{h:s.h,s:a(s.s+100*e,0,100),l:s.l,a:s.a}},A=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},C=function(t,e){var s=x(t);return{h:s.h,s:s.s,l:a(s.l+100*e,0,100),a:s.a}},P=function(){function t(t){this.parsed=function(t){return"string"==typeof t?T(t.trim(),w.string):"object"==typeof t&&null!==t?T(t,w.object):[null,void 0]}(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return null!==this.parsed},t.prototype.brightness=function(){return n(A(this.rgba),2)},t.prototype.isDark=function(){return A(this.rgba)<.5},t.prototype.isLight=function(){return A(this.rgba)>=.5},t.prototype.toHex=function(){return e=(t=h(this.rgba)).r,s=t.g,r=t.b,a=(i=t.a)<1?u(n(255*i)):"","#"+u(e)+u(s)+u(r)+a;var t,e,s,r,i,a},t.prototype.toRgb=function(){return h(this.rgba)},t.prototype.toRgbString=function(){return e=(t=h(this.rgba)).r,s=t.g,r=t.b,(i=t.a)<1?"rgba("+e+", "+s+", "+r+", "+i+")":"rgb("+e+", "+s+", "+r+")";var t,e,s,r,i},t.prototype.toHsl=function(){return m(x(this.rgba))},t.prototype.toHslString=function(){return e=(t=m(x(this.rgba))).h,s=t.s,r=t.l,(i=t.a)<1?"hsla("+e+", "+s+"%, "+r+"%, "+i+")":"hsl("+e+", "+s+"%, "+r+"%)";var t,e,s,r,i},t.prototype.toHsv=function(){return t=d(this.rgba),{h:n(t.h),s:n(t.s),v:n(t.v),a:n(t.a,3)};var t},t.prototype.invert=function(){return E({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},t.prototype.saturate=function(t){return void 0===t&&(t=.1),E(S(this.rgba,t))},t.prototype.desaturate=function(t){return void 0===t&&(t=.1),E(S(this.rgba,-t))},t.prototype.grayscale=function(){return E(S(this.rgba,-1))},t.prototype.lighten=function(t){return void 0===t&&(t=.1),E(C(this.rgba,t))},t.prototype.darken=function(t){return void 0===t&&(t=.1),E(C(this.rgba,-t))},t.prototype.rotate=function(t){return void 0===t&&(t=15),this.hue(this.hue()+t)},t.prototype.alpha=function(t){return"number"==typeof t?E({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):n(this.rgba.a,3);var e},t.prototype.hue=function(t){var e=x(this.rgba);return"number"==typeof t?E({h:t,s:e.s,l:e.l,a:e.a}):n(e.h)},t.prototype.isEqual=function(t){return this.toHex()===E(t).toHex()},t}(),E=function(t){return t instanceof P?t:new P(t)},M=[];!function(t){t.forEach(function(t){M.indexOf(t)<0&&(t(P,w),M.push(t))})}([function(t,e){var s={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var i in s)r[s[i]]=i;var n={};t.prototype.toName=function(e){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var i,a,o=r[this.toHex()];if(o)return o;if(null==e?void 0:e.closest){var l=this.toRgb(),h=1/0,c="black";if(!n.length)for(var u in s)n[u]=new t(s[u]).toRgb();for(var d in s){var p=(i=l,a=n[d],Math.pow(i.r-a.r,2)+Math.pow(i.g-a.g,2)+Math.pow(i.b-a.b,2));p<h&&(h=p,c=d)}return c}},e.string.push([function(e){var r=e.toLowerCase(),i="transparent"===r?"#0000":s[r];return i?new t(i).toRgb():null},"name"])}]);const k=class t{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(t){return this.value=t,this}set value(e){if(e instanceof t)this._value=this._cloneSource(e._value),this._int=e._int,this._components.set(e._components);else{if(null===e)throw new Error("Cannot set Color#value to null");null!==this._value&&this._isSourceEqual(this._value,e)||(this._value=this._cloneSource(e),this._normalize(this._value))}}get value(){return this._value}_cloneSource(t){return"string"==typeof t||"number"==typeof t||t instanceof Number||null===t?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):"object"==typeof t&&null!==t?{...t}:t}_isSourceEqual(t,e){const s=typeof t;if(s!==typeof e)return!1;if("number"===s||"string"===s||t instanceof Number)return t===e;if(Array.isArray(t)&&Array.isArray(e)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return t.length===e.length&&t.every((t,s)=>t===e[s]);if(null!==t&&null!==e){const s=Object.keys(t),r=Object.keys(e);return s.length===r.length&&s.every(s=>t[s]===e[s])}return t===e}toRgba(){const[t,e,s,r]=this._components;return{r:t,g:e,b:s,a:r}}toRgb(){const[t,e,s]=this._components;return{r:t,g:e,b:s}}toRgbaString(){const[t,e,s]=this.toUint8RgbArray();return`rgba(${t},${e},${s},${this.alpha})`}toUint8RgbArray(t){const[e,s,r]=this._components;return this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb),t[0]=Math.round(255*e),t[1]=Math.round(255*s),t[2]=Math.round(255*r),t}toArray(t){this._arrayRgba||(this._arrayRgba=[]),t||(t=this._arrayRgba);const[e,s,r,i]=this._components;return t[0]=e,t[1]=s,t[2]=r,t[3]=i,t}toRgbArray(t){this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb);const[e,s,r]=this._components;return t[0]=e,t[1]=s,t[2]=r,t}toNumber(){return this._int}toBgrNumber(){const[t,e,s]=this.toUint8RgbArray();return(s<<16)+(e<<8)+t}toLittleEndianNumber(){const t=this._int;return(t>>16)+(65280&t)+((255&t)<<16)}multiply(e){const[s,r,i,n]=t._temp.setValue(e)._components;return this._components[0]*=s,this._components[1]*=r,this._components[2]*=i,this._components[3]*=n,this._refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this._refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(1===t)return(255<<24)+this._int;if(0===t)return e?0:this._int;let s=this._int>>16&255,r=this._int>>8&255,i=255&this._int;return e&&(s=s*t+.5|0,r=r*t+.5|0,i=i*t+.5|0),(255*t<<24)+(s<<16)+(r<<8)+i}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const t=Math.round(255*this._components[3]).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(t){return this._components[3]=this._clamp(t),this}_normalize(e){let s,r,i,n;if(("number"==typeof e||e instanceof Number)&&e>=0&&e<=16777215)s=(e>>16&255)/255,r=(e>>8&255)/255,i=(255&e)/255,n=1;else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[s,r,i,n=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[s,r,i,n=255]=e,s/=255,r/=255,i/=255,n/=255;else if("string"==typeof e||"object"==typeof e){if("string"==typeof e){const s=t.HEX_PATTERN.exec(e);s&&(e=`#${s[2]}`)}const a=E(e);a.isValid()&&(({r:s,g:r,b:i,a:n}=a.rgba),s/=255,r/=255,i/=255)}if(void 0===s)throw new Error(`Unable to convert color ${e}`);this._components[0]=s,this._components[1]=r,this._components[2]=i,this._components[3]=n,this._refreshInt()}_refreshInt(){this._clamp(this._components);const[t,e,s]=this._components;this._int=(255*t<<16)+(255*e<<8)+(255*s|0)}_clamp(t,e=0,s=1){return"number"==typeof t?Math.min(Math.max(t,e),s):(t.forEach((r,i)=>{t[i]=Math.min(Math.max(r,e),s)}),t)}static isColorLike(e){return"number"==typeof e||"string"==typeof e||e instanceof Number||e instanceof t||Array.isArray(e)||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Float32Array||void 0!==e.r&&void 0!==e.g&&void 0!==e.b||void 0!==e.r&&void 0!==e.g&&void 0!==e.b&&void 0!==e.a||void 0!==e.h&&void 0!==e.s&&void 0!==e.l||void 0!==e.h&&void 0!==e.s&&void 0!==e.l&&void 0!==e.a||void 0!==e.h&&void 0!==e.s&&void 0!==e.v||void 0!==e.h&&void 0!==e.s&&void 0!==e.v&&void 0!==e.a}};k.shared=new k,k._temp=new k,k.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let R=k},6679:(t,e,s)=>{"use strict";s.d(e,{A:()=>a});var r=s(166);const i=new Float32Array(1),n=new Uint32Array(1);class a extends r.V23{constructor(){const t=new r.hpe({data:i,label:"attribute-batch-buffer",usage:r.Sdw.VERTEX|r.Sdw.COPY_DST,shrinkToFit:!1});super({attributes:{aPosition:{buffer:t,format:"float32x2",stride:28,offset:0},aUV:{buffer:t,format:"float32x2",stride:28,offset:8},aColor:{buffer:t,format:"unorm8x4",stride:28,offset:16},aDarkColor:{buffer:t,format:"unorm8x4",stride:28,offset:20},aTextureIdAndRound:{buffer:t,format:"uint16x2",stride:28,offset:24}},indexBuffer:new r.hpe({data:n,label:"index-batch-buffer",usage:r.Sdw.INDEX|r.Sdw.COPY_DST,shrinkToFit:!1})})}}},6694:(t,e,s)=>{"use strict";s.d(e,{d:()=>n});var r=s(1065),i=s(5031);const n={extension:{type:r.Ag.DetectionParser,priority:0},test:async()=>(0,i.b)("video/webm"),add:async t=>[...t,"webm"],remove:async t=>t.filter(t=>"webm"!==t)}},6763:(t,e,s)=>{"use strict";s.d(e,{y:()=>o});var r=s(8714),i=s.n(r),n=s(166),a=s(2437);class o extends a.N{#Z=i().Engine.create();constructor(t){super(new n.mcf({sortableChildren:!0})),this.worldTransform.x.v=0,this.worldTransform.y.v=0,this.worldTransform.resetDirty(),this.gravity=t?.gravity??0}set gravity(t){this.#Z.gravity.y=t}get gravity(){return this.#Z.gravity.y}addBody(t){i().World.add(this.#Z.world,t)}removeBody(t){i().World.remove(this.#Z.world,t)}update(t){super.update(t);const e=1e3*t;i().Engine.update(this.#Z,e>16.666?16.666:e)}remove(){i().Engine.clear(this.#Z),super.remove()}}},6793:(t,e,s)=>{"use strict";s.d(e,{a:()=>r});class r{cachedAssets=new Map;loadingPromises=new Map;#J=new Map;#tt(t){this.#J.set(t,(this.#J.get(t)||0)+1)}hasActiveRef(t){return this.#J.get(t)>0}cleanup(t,e){}checkCached(t){return this.cachedAssets.has(t)}getCached(t){if(!this.checkCached(t))throw new Error(`Asset not found: ${t}`);return this.#tt(t),this.cachedAssets.get(t)}async load(t,...e){return this.#tt(t),this.checkCached(t)?this.cachedAssets.get(t):this.loadingPromises.has(t)?await this.loadingPromises.get(t):await this.doLoad(t,...e)}release(t){const e=this.#J.get(t);if(void 0===e)throw new Error(`Asset not found: ${t}`);if(1===e){this.#J.delete(t);const e=this.cachedAssets.get(t);e&&(this.cleanup(t,e),this.cachedAssets.delete(t))}else this.#J.set(t,e-1)}}},6836:(t,e,s)=>{"use strict";s.d(e,{R:()=>n});var r=s(166),i=s(8034);class n extends i.gP{static textureMap=new Map;static from(t){return n.textureMap.has(t)?n.textureMap.get(t):new n(t)}texture;constructor(t){super(t.resource),this.texture=r.gPd.from(t)}setFilters(t,e){const s=this.texture.source.style;s.minFilter=n.toPixiTextureFilter(t),s.magFilter=n.toPixiTextureFilter(e),this.texture.source.autoGenerateMipmaps=n.toPixiMipMap(t),this.texture.source.updateMipmaps()}setWraps(t,e){const s=this.texture.source.style;s.addressModeU=n.toPixiTextureWrap(t),s.addressModeV=n.toPixiTextureWrap(e)}dispose(){this.texture.destroy()}static toPixiMipMap(t){switch(t){case i.O$.Nearest:case i.O$.Linear:return!1;case i.O$.MipMapNearestLinear:case i.O$.MipMapNearestNearest:case i.O$.MipMapLinearLinear:case i.O$.MipMapLinearNearest:return!0;default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiTextureFilter(t){switch(t){case i.O$.Nearest:case i.O$.MipMapNearestLinear:case i.O$.MipMapNearestNearest:return"nearest";case i.O$.Linear:case i.O$.MipMapLinearLinear:case i.O$.MipMapLinearNearest:return"linear";default:throw new Error(`Unknown texture filter: ${String(t)}`)}}static toPixiTextureWrap(t){switch(t){case i.w3.ClampToEdge:return"clamp-to-edge";case i.w3.MirroredRepeat:return"mirror-repeat";case i.w3.Repeat:return"repeat";default:throw new Error(`Unknown texture wrap: ${String(t)}`)}}static toPixiBlending(t){switch(t){case i.Nx.Normal:return"normal";case i.Nx.Additive:return"add";case i.Nx.Multiply:return"multiply";case i.Nx.Screen:return"screen";default:throw new Error(`Unknown blendMode: ${String(t)}`)}}}},6841:(t,e,s)=>{"use strict";var r=s(1065),i=s(9739),n=s(8956),a=s(3412);class o extends a.K{constructor(t){super(),this.generatingTexture=!1,this.currentKey="--",this._renderer=t,t.runners.resolutionChange.add(this)}resolutionChange(){const t=this.renderable;t._autoResolution&&t.onViewUpdate()}destroy(){const{htmlText:t}=this._renderer;null===t.getReferenceCount(this.currentKey)?t.returnTexturePromise(this.texturePromise):t.decreaseReferenceCount(this.currentKey),this._renderer.runners.resolutionChange.remove(this),this.texturePromise=null,this._renderer=null}}class l{constructor(t){this._renderer=t}validateRenderable(t){const e=this._getGpuText(t),s=t.styleKey;return e.currentKey!==s}addRenderable(t,e){const s=this._getGpuText(t);if(t._didTextUpdate){const e=t._autoResolution?this._renderer.resolution:t.resolution;s.currentKey===t.styleKey&&t.resolution===e||this._updateGpuText(t).catch(t=>{console.error(t)}),t._didTextUpdate=!1,(0,n.s)(s,t)}this._renderer.renderPipes.batch.addToBatch(s,e)}updateRenderable(t){const e=this._getGpuText(t);e._batcher.updateElement(e)}async _updateGpuText(t){t._didTextUpdate=!1;const e=this._getGpuText(t);if(e.generatingTexture)return;const s=e.texturePromise;e.texturePromise=null,e.generatingTexture=!0,t._resolution=t._autoResolution?this._renderer.resolution:t.resolution;let r=this._renderer.htmlText.getTexturePromise(t);s&&(r=r.finally(()=>{this._renderer.htmlText.decreaseReferenceCount(e.currentKey),this._renderer.htmlText.returnTexturePromise(s)})),e.texturePromise=r,e.currentKey=t.styleKey,e.texture=await r;const i=t.renderGroup||t.parentRenderGroup;i&&(i.structureDidChange=!0),e.generatingTexture=!1,(0,n.s)(e,t)}_getGpuText(t){return t._gpuData[this._renderer.uid]||this.initGpuText(t)}initGpuText(t){const e=new o(this._renderer);return e.renderable=t,e.transform=t.groupTransform,e.texture=i.g.EMPTY,e.bounds={minX:0,maxX:1,minY:0,maxY:0},e.roundPixels=this._renderer._roundPixels|t._roundPixels,t._resolution=t._autoResolution?this._renderer.resolution:t.resolution,t._gpuData[this._renderer.uid]=e,e}destroy(){this._renderer=null}}l.extension={type:[r.Ag.WebGLPipes,r.Ag.WebGPUPipes,r.Ag.CanvasPipes],name:"htmlText"};var h=s(1566),c=s(8851),u=s(5153),d=s(5423),p=s(7694),f=s(761),m=s(1268);const g="http://www.w3.org/2000/svg",x="http://www.w3.org/1999/xhtml";class y{constructor(){this.svgRoot=document.createElementNS(g,"svg"),this.foreignObject=document.createElementNS(g,"foreignObject"),this.domElement=document.createElementNS(x,"div"),this.styleElement=document.createElementNS(x,"style");const{foreignObject:t,svgRoot:e,styleElement:s,domElement:r}=this;t.setAttribute("width","10000"),t.setAttribute("height","10000"),t.style.overflow="hidden",e.appendChild(t),t.appendChild(s),t.appendChild(r),this.image=d.e.get().createImage()}destroy(){this.svgRoot.remove(),this.foreignObject.remove(),this.styleElement.remove(),this.domElement.remove(),this.image.src="",this.image.remove(),this.svgRoot=null,this.foreignObject=null,this.styleElement=null,this.domElement=null,this.image=null,this.canvasAndContext=null}}var v=s(2445);const _=new Map;let b;class w{constructor(t){this._activeTextures={},this._renderer=t,this._createCanvas=t.type===u.W.WEBGPU}getTexture(t){return this.getTexturePromise(t)}getManagedTexture(t){const e=t.styleKey;if(this._activeTextures[e])return this._increaseReferenceCount(e),this._activeTextures[e].promise;const s=this._buildTexturePromise(t).then(t=>(this._activeTextures[e].texture=t,t));return this._activeTextures[e]={texture:null,promise:s,usageCount:1},s}getReferenceCount(t){return this._activeTextures[t]?.usageCount??null}_increaseReferenceCount(t){this._activeTextures[t].usageCount++}decreaseReferenceCount(t){const e=this._activeTextures[t];e&&(e.usageCount--,0===e.usageCount&&(e.texture?this._cleanUp(e.texture):e.promise.then(t=>{e.texture=t,this._cleanUp(e.texture)}).catch(()=>{(0,p.R)("HTMLTextSystem: Failed to clean texture")}),this._activeTextures[t]=null))}getTexturePromise(t){return this._buildTexturePromise(t)}async _buildTexturePromise(t){const{text:e,style:s,resolution:r,textureStyle:i}=t,n=f.Z.get(y),a=function(t,e){const s=e.fontFamily,r=[],i={},n=t.match(/font-family:([^;"\s]+)/g);function a(t){i[t]||(r.push(t),i[t]=!0)}if(Array.isArray(s))for(let t=0;t<s.length;t++)a(s[t]);else a(s);n&&n.forEach(t=>{a(t.split(":")[1].trim())});for(const t in e.tagStyles)a(e.tagStyles[t].fontFamily);return r}(e,s),o=await async function(t){const e=t.filter(t=>v.l.has(`${t}-and-url`)).map(t=>{if(!_.has(t)){const{entries:e}=v.l.get(`${t}-and-url`),s=[];e.forEach(e=>{const r=e.url,i=e.faces.map(t=>({weight:t.weight,style:t.style}));s.push(...i.map(e=>async function(t,e){const s=await async function(t){const e=await d.e.get().fetch(t),s=await e.blob(),r=new FileReader;return await new Promise((t,e)=>{r.onloadend=()=>t(r.result),r.onerror=e,r.readAsDataURL(s)})}(e);return`@font-face {\n font-family: "${t.fontFamily}";\n font-weight: ${t.fontWeight};\n font-style: ${t.fontStyle};\n src: url('${s}');\n }`}({fontWeight:e.weight,fontStyle:e.style,fontFamily:t},r)))}),_.set(t,Promise.all(s).then(t=>t.join("\n")))}return _.get(t)});return(await Promise.all(e)).join("\n")}(a),l=function(t,e,s,r){r||(r=b||(b=new y));const{domElement:i,styleElement:n,svgRoot:a}=r;i.innerHTML=`<style>${e.cssStyle};</style><div style='padding:0'>${t}</div>`,i.setAttribute("style","transform-origin: top left; display: inline-block"),s&&(n.textContent=s),document.body.appendChild(a);const o=i.getBoundingClientRect();a.remove();const l=2*e.padding;return{width:o.width-l,height:o.height-l}}(e,s,o,n),c=Math.ceil(Math.ceil(Math.max(1,l.width)+2*s.padding)*r),u=Math.ceil(Math.ceil(Math.max(1,l.height)+2*s.padding)*r),p=n.image;p.width=2+(0|c),p.height=2+(0|u);const g=function(t,e,s,r,i){const{domElement:n,styleElement:a,svgRoot:o}=i;n.innerHTML=`<style>${e.cssStyle}</style><div style='padding:0;'>${t}</div>`,n.setAttribute("style",`transform: scale(${s});transform-origin: top left; display: inline-block`),a.textContent=r;const{width:l,height:h}=i.image;return o.setAttribute("width",l.toString()),o.setAttribute("height",h.toString()),(new XMLSerializer).serializeToString(o)}(e,s,r,o,n);await function(t,e,s){return new Promise(async r=>{s&&await new Promise(t=>setTimeout(t,100)),t.onload=()=>{r()},t.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(e)}`,t.crossOrigin="anonymous"})}(p,g,function(){const{userAgent:t}=d.e.get().getNavigator();return/^((?!chrome|android).)*safari/i.test(t)}()&&a.length>0);const x=p;let w;this._createCanvas&&(w=function(t,e){const s=h.N.getOptimalCanvasAndContext(t.width,t.height,e),{context:r}=s;return r.clearRect(0,0,t.width,t.height),r.drawImage(t,0,0),s}(p,r));const T=(0,m.M)(w?w.canvas:x,p.width-2,p.height-2,r);return i&&(T.source.style=i),this._createCanvas&&(this._renderer.texture.initSource(T.source),h.N.returnCanvasAndContext(w)),f.Z.return(n),T}returnTexturePromise(t){t.then(t=>{this._cleanUp(t)}).catch(()=>{(0,p.R)("HTMLTextSystem: Failed to clean texture")})}_cleanUp(t){c.W.returnTexture(t,!0),t.source.resource=null,t.source.uploadMethodId="unknown"}destroy(){this._renderer=null;for(const t in this._activeTextures)this._activeTextures[t]&&this.returnTexturePromise(this._activeTextures[t].promise);this._activeTextures=null}}w.extension={type:[r.Ag.WebGLSystem,r.Ag.WebGPUSystem,r.Ag.CanvasSystem],name:"htmlText"},r.XO.add(w),r.XO.add(l)},6851:(t,e,s)=>{"use strict";s.d(e,{j:()=>n});var r=s(5946);const i=16777215;function n(t,e){return t===i?e:e===i?t:(0,r.u)(t,e)}},6861:(t,e,s)=>{"use strict";s.d(e,{H:()=>n});var r=s(1347),i=s(4382);class n extends i.e{lengths=[];closed=!1;constantSpeed=!1;color=new r.Q1(1,1,1,1);constructor(t){super(t)}copy(){let t=new n(this.name);return this.copyTo(t),t.lengths=new Array(this.lengths.length),r.Aq.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t}}},6863:(t,e,s)=>{"use strict";s.d(e,{q:()=>o});var r=s(6976),i=s(903),n=s(6114);const a=["webgl","webgpu","canvas"];async function o(t){let e,o=[];t.preference?(o.push(t.preference),a.forEach(e=>{e!==t.preference&&o.push(e)})):o=a.slice();let l={};for(let a=0;a<o.length;a++){const h=o[a];if("webgpu"===h&&await(0,i.V)()){const{WebGPURenderer:r}=await Promise.resolve().then(s.bind(s,8628));e=r,l={...t,...t.webgpu};break}if("webgl"===h&&(0,r.M)(t.failIfMajorPerformanceCaveat??n.k.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:r}=await Promise.resolve().then(s.bind(s,7722));e=r,l={...t,...t.webgl};break}if("canvas"===h)throw l={...t},new Error("CanvasRenderer is not yet implemented")}if(delete l.webgpu,delete l.webgl,!e)throw new Error("No available renderer for the current environment");const h=new e;return await h.init(l),h}},6869:(t,e,s)=>{"use strict";s.d(e,{B:()=>x});var r=s(4968),i=s(112),n=s(9067);class a extends r.NO{#et=-50;#st=100;#rt=1;#it=0;#nt=.5;#at=1;#ot=1.2;constructor(t){super({...t,text:`-${t.damage}`,fnt:"assets/bitmap-fonts/white-peaberry.fnt",src:"assets/bitmap-fonts/white-peaberry.png"})}update(t){super.update(t),this.#it+=t,this.#et+=this.#st*t,this.y+=this.#et*t;const e=Math.min(this.#it/this.#rt,1),s=this.#at+(this.#ot-this.#at)*e;if(this.scale=s,this.#it>this.#nt){const t=(this.#it-this.#nt)/(this.#rt-this.#nt);this.alpha=Math.max(1-t,0)}this.#it>=this.#rt&&this.remove()}}class o extends r.NO{#et=-50;#st=100;#rt=1;#it=0;#nt=.5;#at=1;#ot=1.2;constructor(t){super({...t,text:`+${t.hp}`,fnt:"assets/bitmap-fonts/white-peaberry.fnt",src:"assets/bitmap-fonts/white-peaberry.png"})}update(t){super.update(t),this.#it+=t,this.#et+=this.#st*t,this.y+=this.#et*t;const e=Math.min(this.#it/this.#rt,1),s=this.#at+(this.#ot-this.#at)*e;if(this.scale=s,this.#it>this.#nt){const t=(this.#it-this.#nt)/(this.#rt-this.#nt);this.alpha=Math.max(1-t,0)}this.#it>=this.#rt&&this.remove()}}class l extends r._m{#lt=new r.g0({width:26,height:4,fill:"#000000",alpha:.4});#ht=new r.g0({width:26,height:4,fill:"#ff3b30"});#ct;#ut;constructor(t){super(t),this.#ct=t.maxHp,this.#ut=t.hp,this.add(this.#lt,this.#ht),this.#dt()}#dt(){const t=26*Math.max(0,Math.min(1,this.#ut/this.#ct));this.#ht.width=t,this.#ht.x=-(26-t)/2}set hp(t){this.#ut=t,this.#dt()}get hp(){return this.#ut}}class h extends r.L5{maxHp;hp;dead=!1;hitbox;hurtbox;#pt;_sprite;#ft;#mt;constructor(t){super({...t,fixedRotation:!0,useYSort:!0}),this.maxHp=t.maxHp,this.hp=t.hp,this.hitbox=t.hitbox,this.hurtbox=t.hurtbox,this.#pt=new l({y:-30,maxHp:t.maxHp,hp:t.hp,layer:"hud"}),this.add(this.#pt),n.p&&(this.add(new r.g0({...t.collider,stroke:"yellow",alpha:.5,layer:"hud"})),this.#ft=new r.g0({...this.hitbox,stroke:"red",alpha:.5,layer:"hud"}),this.add(this.#ft),this.add(new r.g0({...this.hurtbox,stroke:"green",alpha:.5,layer:"hud"})))}set hitboxX(t){this.hitbox.x=t,this.#ft&&(this.#ft.x=t)}takeDamage(t){this.dead||(this.hp-=t,this.#pt.hp=this.hp,this._sprite&&(this._sprite.tint=16711680,this.#mt?.remove(),this.#mt=new r.Mb(.1,()=>this._sprite.tint=16777215),this.add(this.#mt)),this.emit("changeHp",t),this.add(new a({y:-20,damage:t,layer:"hud"})),this.hp<=0&&(this.dead=!0,this.onDie(),this.emit("dead")))}heal(t){this.dead||(this.hp=Math.min(this.maxHp,this.hp+t),this.#pt.hp=this.hp,this._sprite&&(this._sprite.tint=65280,this.#mt?.remove(),this.#mt=new r.Mb(.1,()=>this._sprite.tint=16777215),this.add(this.#mt)),this.emit("changeHp",t),this.add(new o({y:-20,hp:t,layer:"hud"})))}}class c extends h{_sprite;#gt=0;#xt=0;#yt=this.x;#vt=!1;constructor(t){super({...t,maxHp:1e3,hp:1e3,collider:{type:r.H9.Rectangle,width:30,height:30,y:12},hitbox:{type:r.H9.Rectangle,width:32,height:52,x:24,y:-8},hurtbox:{type:r.H9.Rectangle,width:24,height:40,x:0,y:-4},isStatic:!0}),this._sprite=new r.ZU({src:"assets/spritesheets/hero.png",atlas:i,animation:"idle",fps:10,loop:!0,scale:2}),this._sprite.on("animationend",t=>{t.startsWith("attack")?(this.#vt=!1,this._sprite.animation="idle"):"die"===t&&this.emit("dead")}),this.add(this._sprite)}move(t,e){this.dead||(this.#gt=Math.cos(t)*e*200,this.#xt=Math.sin(t)*e*200)}stop(){this.#gt=0,this.#xt=0}attack(){this.dead||this.#vt||(this.#vt=!0,this._sprite.animation=Math.floor(2*Math.random())?"attack1":"attack2",this.add(new r.Mb(.3,()=>this.emit("hit",60))),r.dy.playRandom("assets/sfx/hero/miss/miss1.wav","assets/sfx/hero/miss/miss2.wav","assets/sfx/hero/miss/miss3.wav"))}update(t){if(super.update(t),this.x+=this.#gt*t,this.y+=this.#xt*t,this._sprite&&this.x!==this.#yt){const t=Math.abs(this._sprite.scaleX);this._sprite.scaleX=this.x>this.#yt?t:-t,this.hitboxX=this.x>this.#yt?24:-24}this.#yt=this.x}takeDamage(t){super.takeDamage(t),r.dy.playRandom("assets/sfx/hero/hit/hit1.wav","assets/sfx/hero/hit/hit2.wav","assets/sfx/hero/hit/hit3.wav")}heal(t){super.heal(t),r.dy.play("assets/sfx/hero/heal/heal.wav")}onDie(){this._sprite.animation="die",this._sprite.loop=!1,this.#gt=0,this.#xt=0,this.disableCollisions(),r.dy.play("assets/sfx/hero/die/die.wav")}}var u=s(8730);class d extends h{_sprite;#gt=0;#xt=0;#vt=!1;constructor(t){super({...t,maxHp:100,hp:100,collider:{type:r.H9.Rectangle,width:30,height:30,y:12},hitbox:{type:r.H9.Rectangle,width:32,height:52,x:24,y:-8},hurtbox:{type:r.H9.Rectangle,width:24,height:32,x:0,y:0}}),this._sprite=new r.ZU({src:"assets/spritesheets/orc.png",atlas:u,animation:"idle",fps:10,loop:!0,scale:2}),this._sprite.on("animationend",t=>{t.startsWith("attack")?(this.#vt=!1,this._sprite.animation="idle"):"die"===t&&this.emit("dead")}),this.add(this._sprite)}moveTo(t,e){if(this.dead)return;const s=t-this.x,r=e-this.y,i=Math.atan2(r,s);this.#gt=3*Math.cos(i),this.#xt=3*Math.sin(i);const n=Math.abs(this._sprite.scaleX);this._sprite.scaleX=s>0?n:-n,this.hitboxX=s>0?24:-24}stop(){this.#gt=0,this.#xt=0}attack(){this.dead||this.#vt||(this.#vt=!0,this.#gt=0,this.#xt=0,this._sprite.animation=Math.floor(2*Math.random())?"attack1":"attack2",this.add(new r.Mb(.3,()=>this.emit("hit",15))),r.dy.playRandom("assets/sfx/orc/miss/miss1.wav","assets/sfx/orc/miss/miss2.wav","assets/sfx/orc/miss/miss3.wav"))}update(t){super.update(t),this.velocityX=this.#gt,this.velocityY=this.#xt}takeDamage(t){super.takeDamage(t),r.dy.playRandom("assets/sfx/orc/hit/hit1.wav","assets/sfx/orc/hit/hit2.wav","assets/sfx/orc/hit/hit3.wav")}onDie(){this._sprite.animation="die",this._sprite.loop=!1,this.#gt=0,this.#xt=0,this.disableCollisions(),r.dy.play("assets/sfx/orc/die/die.wav")}}var p=s(2839),f=s(6907);class m extends p._{triggerCollider={type:r.H9.Circle,radius:16};healAmount;constructor(t){super({...t,useYSort:!0}),this.healAmount=t?.healAmount??100,this.add(new r.ZU({src:"assets/spritesheets/potion.png",atlas:f,animation:"animation",fps:10,loop:!0,scale:2})),n.p&&this.add(new r.hI({...this.triggerCollider,stroke:"green",alpha:.5,layer:"hud"}))}}function g(){const t=document.createElement("div");return t.style.color="white",t.style.position="absolute",t.style.top="10px",t.style.zIndex="1",t}class x extends r.yR{#_t=new c;#bt=new Set;#wt=new Set;#Tt=0;#St=0;#At=!1;#Ct;#Pt;#Et;#Mt;#kt;constructor(){super(),r.rF.play("assets/bgm/battle.mp3"),this.add(this.#_t),this.add(this.#Mt=new r.CW(1,()=>this.#Rt())),this.add(this.#kt=new r.CW(3,()=>this.#Bt()));const t=new Image;t.src="assets/joystick/joystick.png";const e=new Image;e.src="assets/joystick/knob.png",this.add(new r.ZN({onMove:(t,e)=>this.#_t.move(t,e),onRelease:()=>this.#_t.stop(),onKeyDown:t=>{"KeyA"===t&&this.#_t.attack()},joystickImage:t,knobImage:e,maxKnobDistance:70})),this.#Ct=g(),this.#Pt=g(),this.#Et=g(),this.#Ct.textContent=`Time: ${this.#Tt}`,this.#Pt.textContent=`HP: ${this.#_t.hp}`,this.#Et.textContent=`Score: ${this.#St}`,this.#Ct.style.left="10px",this.#Pt.style.left="50%",this.#Pt.style.transform="translate(-50%, 0)",this.#Et.style.right="10px",this.#_t.on("hit",t=>{for(const e of this.#bt)(0,r.p6)(this.#_t.hitbox,this.#_t.worldTransform,e.hurtbox,e.worldTransform)&&e.takeDamage(t)}),this.#_t.on("changeHp",()=>{this.#Pt.textContent=`HP: ${this.#_t.hp}`}),this.#_t.on("dead",()=>{this.#It()})}#It(){this.#At=!0,this.#Mt.remove(),this.#kt.remove();for(const t of this.#bt)t.stop();const t=g();t.textContent="Game Over",t.style.left="50%",t.style.top="50%",t.style.transform="translate(-50%, -50%)",this.renderer?.container.append(t)}set renderer(t){super.renderer=t,t&&t.container.append(this.#Ct,this.#Pt,this.#Et)}get renderer(){return super.renderer}#Rt(){const t=new d;t.x=800*Math.random()-400,t.y=600*Math.random()-300,t.on("hit",e=>{(0,r.p6)(this.#_t.hurtbox,this.#_t.worldTransform,t.hitbox,t.worldTransform)&&this.#_t.takeDamage(e)}),this.add(t),this.#bt.add(t),t.on("dead",()=>{this.#bt.delete(t),this.#St+=100,this.#Et.textContent=`Score: ${this.#St}`})}#Bt(){const t=new m;t.x=800*Math.random()-400,t.y=600*Math.random()-300,this.add(t),this.#wt.add(t),t.on("remove",()=>this.#wt.delete(t))}update(t){if(super.update(t),this.#At)return;const e=this.#_t;if(!e.dead){for(const t of this.#bt)(0,r.p6)(e.hurtbox,e.worldTransform,t.hitbox,t.worldTransform)?t.attack():t.moveTo(this.#_t.x,this.#_t.y),r.Fr&&(0,r.p6)(e.hitbox,e.worldTransform,t.hurtbox,t.worldTransform)&&e.attack();for(const t of this.#wt)(0,r.p6)(e.hitbox,e.worldTransform,t.triggerCollider,t.worldTransform)&&(e.heal(t.healAmount),t.remove())}}}},6890:(t,e,s)=>{"use strict";s.d(e,{u:()=>n});const r=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function i(t){let e="";for(let s=0;s<t;++s)s>0&&(e+="\nelse "),s<t-1&&(e+=`if(test == ${s}.0){}`);return e}function n(t,e){if(0===t)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const s=e.createShader(e.FRAGMENT_SHADER);try{for(;;){const n=r.replace(/%forloop%/gi,i(t));if(e.shaderSource(s,n),e.compileShader(s),e.getShaderParameter(s,e.COMPILE_STATUS))break;t=t/2|0}}finally{e.deleteShader(s)}return t}},6907:t=>{"use strict";t.exports=JSON.parse('{"frames":{"frame-1":{"frame":{"x":0,"y":0,"w":16,"h":16}},"frame-2":{"frame":{"x":16,"y":0,"w":16,"h":16}},"frame-3":{"frame":{"x":32,"y":0,"w":16,"h":16}},"frame-4":{"frame":{"x":0,"y":16,"w":16,"h":16}},"frame-5":{"frame":{"x":16,"y":16,"w":16,"h":16}},"frame-6":{"frame":{"x":32,"y":16,"w":16,"h":16}},"frame-7":{"frame":{"x":0,"y":32,"w":16,"h":16}},"frame-8":{"frame":{"x":16,"y":32,"w":16,"h":16}}},"meta":{"scale":1},"animations":{"animation":["frame-1","frame-2","frame-3","frame-4","frame-5","frame-6","frame-7","frame-8"]}}')},6929:t=>{t.exports=function(t){var i=[];return t.replace(s,function(t,s,n){var a=s.toLowerCase();for(n=function(t){var e=t.match(r);return e?e.map(Number):[]}(n),"m"==a&&n.length>2&&(i.push([s].concat(n.splice(0,2))),a="l",s="m"==s?"l":"L");;){if(n.length==e[a])return n.unshift(s),i.push(n);if(n.length<e[a])throw new Error("malformed path data");i.push([s].concat(n.splice(0,e[a])))}}),i};var e={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},s=/([astvzqmhlc])([^astvzqmhlc]*)/gi,r=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi},6934:(t,e,s)=>{"use strict";var r=s(1065),i=s(8956),n=s(3412);class a extends n.K{constructor(t){super(),this._renderer=t,t.runners.resolutionChange.add(this)}resolutionChange(){const t=this.renderable;t._autoResolution&&t.onViewUpdate()}destroy(){const{canvasText:t}=this._renderer;null===t.getReferenceCount(this.currentKey)?t.returnTexture(this.texture):t.decreaseReferenceCount(this.currentKey),this._renderer.runners.resolutionChange.remove(this),this._renderer=null}}class o{constructor(t){this._renderer=t}validateRenderable(t){const e=this._getGpuText(t),s=t.styleKey;return e.currentKey!==s||t._didTextUpdate}addRenderable(t,e){const s=this._getGpuText(t);if(t._didTextUpdate){const e=t._autoResolution?this._renderer.resolution:t.resolution;s.currentKey===t.styleKey&&t.resolution===e||this._updateGpuText(t),t._didTextUpdate=!1}this._renderer.renderPipes.batch.addToBatch(s,e)}updateRenderable(t){const e=this._getGpuText(t);e._batcher.updateElement(e)}_updateGpuText(t){const e=this._getGpuText(t);e.texture&&this._renderer.canvasText.decreaseReferenceCount(e.currentKey),t._resolution=t._autoResolution?this._renderer.resolution:t.resolution,e.texture=this._renderer.canvasText.getManagedTexture(t),e.currentKey=t.styleKey,(0,i.s)(e,t)}_getGpuText(t){return t._gpuData[this._renderer.uid]||this.initGpuText(t)}initGpuText(t){const e=new a(this._renderer);return e.currentKey="--",e.renderable=t,e.transform=t.groupTransform,e.bounds={minX:0,maxX:1,minY:0,maxY:0},e.roundPixels=this._renderer._roundPixels|t._roundPixels,t._gpuData[this._renderer.uid]=e,e}destroy(){this._renderer=null}}o.extension={type:[r.Ag.WebGLPipes,r.Ag.WebGPUPipes,r.Ag.CanvasPipes],name:"text"};var l=s(8851),h=s(8896),c=s(4696),u=s(5105),d=s(1268),p=s(6675),f=s(9390),m=s(1566),g=s(5423),x=s(9437);let y=null,v=null;function _(t,e,s){for(let r=0,i=4*s*e;r<e;++r,i+=4)if(0!==t[i+3])return!1;return!0}function b(t,e,s,r,i){const n=4*e;for(let e=r,a=r*n+4*s;e<=i;++e,a+=n)if(0!==t[a+3])return!1;return!0}function w(...t){let e=t[0];e.canvas||(e={canvas:t[0],resolution:t[1]});const{canvas:s}=e,r=Math.min(e.resolution??1,1),i=e.width??s.width,n=e.height??s.height;let a=e.output;if(function(t,e){y||(y=g.e.get().createCanvas(256,128),v=y.getContext("2d",{willReadFrequently:!0}),v.globalCompositeOperation="copy",v.globalAlpha=1),(y.width<t||y.height<e)&&(y.width=(0,x.U5)(t),y.height=(0,x.U5)(e))}(i,n),!v)throw new TypeError("Failed to get canvas 2D context");v.drawImage(s,0,0,i,n,0,0,i*r,n*r);const o=v.getImageData(0,0,i,n).data;let l=0,h=0,c=i-1,u=n-1;for(;h<n&&_(o,i,h);)++h;if(h===n)return f.M.EMPTY;for(;_(o,i,u);)--u;for(;b(o,i,l,h,u);)++l;for(;b(o,i,c,h,u);)--c;return++c,++u,v.globalCompositeOperation="source-over",v.strokeRect(l,h,c-l,u-h),v.globalCompositeOperation="copy",a??(a=new f.M),a.set(l/r,h/r,(c-l)/r,(u-h)/r),a}var T=s(7926),S=s(2288),A=s(1990);const C=new f.M,P=new class{getCanvasAndContext(t){const{text:e,style:s,resolution:r=1}=t,i=s._getFinalPadding(),n=T.P.measureText(e||" ",s),a=Math.ceil(Math.ceil(Math.max(1,n.width)+2*i)*r),o=Math.ceil(Math.ceil(Math.max(1,n.height)+2*i)*r),l=m.N.getOptimalCanvasAndContext(a,o);return this._renderTextToCanvas(e,s,i,r,l),{canvasAndContext:l,frame:s.trim?w({canvas:l.canvas,width:a,height:o,resolution:1,output:C}):C.set(0,0,a,o)}}returnCanvasAndContext(t){m.N.returnCanvasAndContext(t)}_renderTextToCanvas(t,e,s,r,i){const{canvas:n,context:a}=i,o=(0,S.Z)(e),l=T.P.measureText(t||" ",e),h=l.lines,c=l.lineHeight,u=l.lineWidths,d=l.maxLineWidth,f=l.fontProperties,m=n.height;if(a.resetTransform(),a.scale(r,r),a.textBaseline=e.textBaseline,e._stroke?.width){const t=e._stroke;a.lineWidth=t.width,a.miterLimit=t.miterLimit,a.lineJoin=t.join,a.lineCap=t.cap}let g,x;a.font=o;const y=e.dropShadow?2:1;for(let t=0;t<y;++t){const n=e.dropShadow&&0===t,o=n?Math.ceil(Math.max(1,m)+2*s):0,y=o*r;if(n){a.fillStyle="black",a.strokeStyle="black";const t=e.dropShadow,s=t.color,i=t.alpha;a.shadowColor=p.Q.shared.setValue(s).setAlpha(i).toRgbaString();const n=t.blur*r,o=t.distance*r;a.shadowBlur=n,a.shadowOffsetX=Math.cos(t.angle)*o,a.shadowOffsetY=Math.sin(t.angle)*o+y}else{if(a.fillStyle=e._fill?(0,A.r)(e._fill,a,l,2*s):null,e._stroke?.width){const t=.5*e._stroke.width+2*s;a.strokeStyle=(0,A.r)(e._stroke,a,l,t)}a.shadowColor="black"}let v=(c-f.fontSize)/2;c-f.fontSize<0&&(v=0);const _=e._stroke?.width??0;for(let t=0;t<h.length;t++)g=_/2,x=_/2+t*c+f.ascent+v,"right"===e.align?g+=d-u[t]:"center"===e.align&&(g+=(d-u[t])/2),e._stroke?.width&&this._drawLetterSpacing(h[t],e,i,g+s,x+s-o,!0),void 0!==e._fill&&this._drawLetterSpacing(h[t],e,i,g+s,x+s-o)}}_drawLetterSpacing(t,e,s,r,i,n=!1){const{context:a}=s,o=e.letterSpacing;let l=!1;if(T.P.experimentalLetterSpacingSupported&&(T.P.experimentalLetterSpacing?(a.letterSpacing=`${o}px`,a.textLetterSpacing=`${o}px`,l=!0):(a.letterSpacing="0px",a.textLetterSpacing="0px")),0===o||l)return void(n?a.strokeText(t,r,i):a.fillText(t,r,i));let h=r;const c=T.P.graphemeSegmenter(t);let u=a.measureText(t).width,d=0;for(let t=0;t<c.length;++t){const e=c[t];n?a.strokeText(e,h,i):a.fillText(e,h,i);let s="";for(let e=t+1;e<c.length;++e)s+=c[e];d=a.measureText(s).width,h+=u-d+o,u=d}}};class E{constructor(t){this._activeTextures={},this._renderer=t}getTexture(t,e,s,r){"string"==typeof t&&((0,c.t6)("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),t={text:t,style:s,resolution:e}),t.style instanceof u.x||(t.style=new u.x(t.style)),t.textureStyle instanceof h.n||(t.textureStyle=new h.n(t.textureStyle)),"string"!=typeof t.text&&(t.text=t.text.toString());const{text:i,style:n,textureStyle:a}=t,o=t.resolution??this._renderer.resolution,{frame:l,canvasAndContext:p}=P.getCanvasAndContext({text:i,style:n,resolution:o}),f=(0,d.M)(p.canvas,l.width,l.height,o);if(a&&(f.source.style=a),n.trim&&(l.pad(n.padding),f.frame.copyFrom(l),f.frame.scale(1/o),f.updateUvs()),n.filters){const t=this._applyFilters(f,n.filters);return this.returnTexture(f),P.returnCanvasAndContext(p),t}return this._renderer.texture.initSource(f._source),P.returnCanvasAndContext(p),f}returnTexture(t){const e=t.source;e.resource=null,e.uploadMethodId="unknown",e.alphaMode="no-premultiply-alpha",l.W.returnTexture(t,!0)}renderTextToCanvas(){(0,c.t6)("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead")}getManagedTexture(t){t._resolution=t._autoResolution?this._renderer.resolution:t.resolution;const e=t.styleKey;if(this._activeTextures[e])return this._increaseReferenceCount(e),this._activeTextures[e].texture;const s=this.getTexture({text:t.text,style:t.style,resolution:t._resolution,textureStyle:t.textureStyle});return this._activeTextures[e]={texture:s,usageCount:1},s}decreaseReferenceCount(t){const e=this._activeTextures[t];e.usageCount--,0===e.usageCount&&(this.returnTexture(e.texture),this._activeTextures[t]=null)}getReferenceCount(t){return this._activeTextures[t]?.usageCount??null}_increaseReferenceCount(t){this._activeTextures[t].usageCount++}_applyFilters(t,e){const s=this._renderer.renderTarget.renderTarget,r=this._renderer.filter.generateFilteredTexture({texture:t,filters:e});return this._renderer.renderTarget.bind(s,!1),r}destroy(){this._renderer=null;for(const t in this._activeTextures)this._activeTextures[t]&&this.returnTexture(this._activeTextures[t].texture);this._activeTextures=null}}E.extension={type:[r.Ag.WebGLSystem,r.Ag.WebGPUSystem,r.Ag.CanvasSystem],name:"canvasText"},r.XO.add(E),r.XO.add(o)},6976:(t,e,s)=>{"use strict";s.d(e,{M:()=>a});var r=s(5423),i=s(6114);let n;function a(t){return void 0!==n||(n=(()=>{const e={stencil:!0,failIfMajorPerformanceCaveat:t??i.k.defaultOptions.failIfMajorPerformanceCaveat};try{if(!r.e.get().getWebGLRenderingContext())return!1;let t=r.e.get().createCanvas().getContext("webgl",e);const s=!!t?.getContextAttributes()?.stencil;if(t){const e=t.getExtension("WEBGL_lose_context");e&&e.loseContext()}return t=null,s}catch(t){return!1}})()),n}},7249:(t,e,s)=>{"use strict";s.d(e,{X:()=>n});var r=s(2437),i=s(6121);class n extends r.N{localTransform=new i.U;alpha=1;#Ft;#s=!1;constructor(t,e){super(t),void 0!==e.x&&(this.x=e.x),void 0!==e.y&&(this.y=e.y),void 0!==e.scale&&(this.scale=e.scale),void 0!==e.scaleX&&(this.scaleX=e.scaleX),void 0!==e.scaleY&&(this.scaleY=e.scaleY),void 0!==e.pivotX&&(this.pivotX=e.pivotX),void 0!==e.pivotY&&(this.pivotY=e.pivotY),void 0!==e.rotation&&(this.rotation=e.rotation),void 0!==e.alpha&&(this.alpha=e.alpha),this.#Ft=e.layer,this.#s=e.useYSort??!1}set renderer(t){super.renderer=t,this.#Ft&&t&&t._addToLayer(this,this.#Ft)}get renderer(){return super.renderer}_updateWorldTransform(){const t=this.parent;t&&(0,r.l)(t)&&(this.worldTransform.update(t.worldTransform,this.localTransform),this.worldAlpha.v=t.worldAlpha.v*this.alpha);const e=this._pixiContainer,s=this.renderer;if(this.#Ft&&s){const t=this.worldTransform;e.position.set(t.x.v,t.y.v),e.scale.set(t.scaleX.v,t.scaleY.v),e.rotation=t.rotation.v,e.alpha=this.worldAlpha.v}else{const t=this.localTransform;e.position.set(t.x,t.y),this.#s&&(e.zIndex=t.y),e.pivot.set(t.pivotX,t.pivotY),e.scale.set(t.scaleX,t.scaleY),e.rotation=t.rotation,e.alpha=this.alpha}super._updateWorldTransform()}set x(t){this.localTransform.x=t}get x(){return this.localTransform.x}set y(t){this.localTransform.y=t}get y(){return this.localTransform.y}set scale(t){this.localTransform.scaleX=t,this.localTransform.scaleY=t}get scale(){return this.localTransform.scaleX}set scaleX(t){this.localTransform.scaleX=t}get scaleX(){return this.localTransform.scaleX}set scaleY(t){this.localTransform.scaleY=t}get scaleY(){return this.localTransform.scaleY}set pivotX(t){this.localTransform.pivotX=t}get pivotX(){return this.localTransform.pivotX}set pivotY(t){this.localTransform.pivotY=t}get pivotY(){return this.localTransform.pivotY}set rotation(t){this.localTransform.rotation=t}get rotation(){return this.localTransform.rotation}}},7285:(t,e,s)=>{"use strict";s.d(e,{_:()=>i});var r=s(159);class i extends r.q{bones=new Array;_target=null;set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}mixRotate=0;mixX=0;mixY=0;mixScaleX=0;mixScaleY=0;mixShearY=0;offsetRotation=0;offsetX=0;offsetY=0;offsetScaleX=0;offsetScaleY=0;offsetShearY=0;relative=!1;local=!1;constructor(t){super(t,0,!1)}}},7335:(t,e,s)=>{"use strict";s.d(e,{b:()=>r,m:()=>i});const r={name:"round-pixels-bit",vertex:{header:"\n fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>\n {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n }\n "}},i={name:"round-pixels-bit",vertex:{header:"\n vec2 roundPixels(vec2 position, vec2 targetSize)\n {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n }\n "}}},7399:(t,e,s)=>{"use strict";s.d(e,{f:()=>a});var r=s(5242),i=s(1347),n=s(4382);class a extends n.e{region=null;path;regionUVs=[];uvs=[];triangles=[];color=new i.Q1(1,1,1,1);width=0;height=0;hullLength=0;edges=[];parentMesh=null;sequence=null;tempColor=new i.Q1(0,0,0,0);constructor(t,e){super(t),this.path=e}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=i.Aq.newFloatArray(t.length));let e=this.uvs,s=this.uvs.length,n=this.region.u,a=this.region.v,o=0,l=0;if(this.region instanceof r.TE){let r=this.region,i=r.page,h=i.width,c=i.height;switch(r.degrees){case 90:n-=(r.originalHeight-r.offsetY-r.height)/h,a-=(r.originalWidth-r.offsetX-r.width)/c,o=r.originalHeight/h,l=r.originalWidth/c;for(let r=0;r<s;r+=2)e[r]=n+t[r+1]*o,e[r+1]=a+(1-t[r])*l;return;case 180:n-=(r.originalWidth-r.offsetX-r.width)/h,a-=r.offsetY/c,o=r.originalWidth/h,l=r.originalHeight/c;for(let r=0;r<s;r+=2)e[r]=n+(1-t[r])*o,e[r+1]=a+(1-t[r+1])*l;return;case 270:n-=r.offsetY/h,a-=r.offsetX/c,o=r.originalHeight/h,l=r.originalWidth/c;for(let r=0;r<s;r+=2)e[r]=n+(1-t[r+1])*o,e[r+1]=a+t[r]*l;return}n-=r.offsetX/h,a-=(r.originalHeight-r.offsetY-r.height)/c,o=r.originalWidth/h,l=r.originalHeight/c}else this.region?(o=this.region.u2-n,l=this.region.v2-a):(n=a=0,o=l=1);for(let r=0;r<s;r+=2)e[r]=n+t[r]*o,e[r+1]=a+t[r+1]*l}getParentMesh(){return this.parentMesh}setParentMesh(t){this.parentMesh=t,t&&(this.bones=t.bones,this.vertices=t.vertices,this.worldVerticesLength=t.worldVerticesLength,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength,this.worldVerticesLength=t.worldVerticesLength)}copy(){if(this.parentMesh)return this.newLinkedMesh();let t=new a(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=new Array(this.regionUVs.length),i.Aq.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.uvs=this.uvs instanceof Float32Array?i.Aq.newFloatArray(this.uvs.length):new Array(this.uvs.length),i.Aq.arrayCopy(this.uvs,0,t.uvs,0,this.uvs.length),t.triangles=new Array(this.triangles.length),i.Aq.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,t.sequence=null!=this.sequence?this.sequence.copy():null,this.edges&&(t.edges=new Array(this.edges.length),i.Aq.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t}computeWorldVertices(t,e,s,r,i,n){null!=this.sequence&&this.sequence.apply(t,this),super.computeWorldVertices(t,e,s,r,i,n)}newLinkedMesh(){let t=new a(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),t.timelineAttachment=this.timelineAttachment,t.setParentMesh(this.parentMesh?this.parentMesh:this),null!=t.region&&t.updateRegion(),t}}},7433:(t,e,s)=>{"use strict";s.d(e,{U:()=>n});const r={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},i=class t{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(1&this.data)}set blend(t){!!(1&this.data)!==t&&(this.data^=1)}get offsets(){return!!(2&this.data)}set offsets(t){!!(2&this.data)!==t&&(this.data^=2)}set cullMode(t){"none"!==t?(this.culling=!0,this.clockwiseFrontFace="front"===t):this.culling=!1}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(4&this.data)}set culling(t){!!(4&this.data)!==t&&(this.data^=4)}get depthTest(){return!!(8&this.data)}set depthTest(t){!!(8&this.data)!==t&&(this.data^=8)}get depthMask(){return!!(32&this.data)}set depthMask(t){!!(32&this.data)!==t&&(this.data^=32)}get clockwiseFrontFace(){return!!(16&this.data)}set clockwiseFrontFace(t){!!(16&this.data)!==t&&(this.data^=16)}get blendMode(){return this._blendMode}set blendMode(t){this.blend="none"!==t,this._blendMode=t,this._blendModeId=r[t]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const e=new t;return e.depthTest=!1,e.blend=!0,e}};i.default2d=i.for2d();let n=i},7448:(t,e,s)=>{"use strict";s(166),s(7635),s(2839)._},7455:(t,e,s)=>{"use strict";s.d(e,{s:()=>P});var r=s(1065),i=s(7630),n=s(7694),a=s(7717),o=s(2445),l=s(6212),h=s(5809),c=s(1351),u=s(4102),d=s(5671),p=s(6694),f=s(3051),m=s(3385),g=s(9097),x=s(3289),y=s(796),v=s(4336),_=s(9586),b=s(4219),w=s(6307),T=s(3798),S=s(2027),A=s(8064),C=s(2843);const P=new class{constructor(){this._detections=[],this._initialized=!1,this.resolver=new S.x,this.loader=new m.a,this.cache=o.l,this._backgroundLoader=new a.o(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(t={}){if(this._initialized)return void(0,n.R)("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");if(this._initialized=!0,t.defaultSearchParams&&this.resolver.setDefaultSearchParams(t.defaultSearchParams),t.basePath&&(this.resolver.basePath=t.basePath),t.bundleIdentifier&&this.resolver.setBundleIdentifier(t.bundleIdentifier),t.manifest){let e=t.manifest;"string"==typeof e&&(e=await this.load(e)),this.resolver.addManifest(e)}const e=t.texturePreference?.resolution??1,s="number"==typeof e?[e]:e,r=await this._detectFormats({preferredFormats:t.texturePreference?.format,skipDetections:t.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:r,resolution:s}}),t.preferences&&this.setPreferences(t.preferences)}add(t){this.resolver.add(t)}async load(t,e){this._initialized||await this.init();const s=(0,C.a)(t),r=(0,A.z)(t).map(t=>{if("string"!=typeof t){const e=this.resolver.getAlias(t);return e.some(t=>!this.resolver.hasKey(t))&&this.add(t),Array.isArray(e)?e[0]:e}return this.resolver.hasKey(t)||this.add({alias:t,src:t}),t}),i=this.resolver.resolve(r),n=await this._mapLoadToResolve(i,e);return s?n[r[0]]:n}addBundle(t,e){this.resolver.addBundle(t,e)}async loadBundle(t,e){this._initialized||await this.init();let s=!1;"string"==typeof t&&(s=!0,t=[t]);const r=this.resolver.resolveBundle(t),i={},n=Object.keys(r);let a=0,o=0;const l=()=>{e?.(++a/o)},h=n.map(t=>{const e=r[t],s=Object.values(e),n=[...new Set(s.flat())];return o+=n.length,this._mapLoadToResolve(e,l).then(e=>{i[t]=e})});return await Promise.all(h),s?i[t[0]]:i}async backgroundLoad(t){this._initialized||await this.init(),"string"==typeof t&&(t=[t]);const e=this.resolver.resolve(t);this._backgroundLoader.add(Object.values(e))}async backgroundLoadBundle(t){this._initialized||await this.init(),"string"==typeof t&&(t=[t]);const e=this.resolver.resolveBundle(t);Object.values(e).forEach(t=>{this._backgroundLoader.add(Object.values(t))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(t){if("string"==typeof t)return o.l.get(t);const e={};for(let s=0;s<t.length;s++)e[s]=o.l.get(t[s]);return e}async _mapLoadToResolve(t,e){const s=[...new Set(Object.values(t))];this._backgroundLoader.active=!1;const r=await this.loader.load(s,e);this._backgroundLoader.active=!0;const i={};return s.forEach(t=>{const e=r[t.src],s=[t.src];t.alias&&s.push(...t.alias),s.forEach(t=>{i[t]=e}),o.l.set(s,e)}),i}async unload(t){this._initialized||await this.init();const e=(0,A.z)(t).map(t=>"string"!=typeof t?t.src:t),s=this.resolver.resolve(e);await this._unloadFromResolved(s)}async unloadBundle(t){this._initialized||await this.init(),t=(0,A.z)(t);const e=this.resolver.resolveBundle(t),s=Object.keys(e).map(t=>this._unloadFromResolved(e[t]));await Promise.all(s)}async _unloadFromResolved(t){const e=Object.values(t);e.forEach(t=>{o.l.remove(t.src)}),await this.loader.unload(e)}async _detectFormats(t){let e=[];t.preferredFormats&&(e=Array.isArray(t.preferredFormats)?t.preferredFormats:[t.preferredFormats]);for(const s of t.detections)t.skipDetections||await s.test()?e=await s.add(e):t.skipDetections||(e=await s.remove(e));return e=e.filter((t,s)=>e.indexOf(t)===s),e}get detections(){return this._detections}setPreferences(t){this.loader.parsers.forEach(e=>{e.config&&Object.keys(e.config).filter(e=>e in t).forEach(s=>{e.config[s]=t[s]})})}};r.XO.handleByList(r.Ag.LoadParser,P.loader.parsers).handleByList(r.Ag.ResolveParser,P.resolver.parsers).handleByList(r.Ag.CacheParser,P.cache.parsers).handleByList(r.Ag.DetectionParser,P.detections),r.XO.add(l.P,c.M,h.Q,f.Y,u.p,d.G,p.d,g.F,x.f,y.e,v.Z,_.P,b.Qj,i.R,i.w,T.j,w.u);const E={loader:r.Ag.LoadParser,resolver:r.Ag.ResolveParser,cache:r.Ag.CacheParser,detection:r.Ag.DetectionParser};r.XO.handle(r.Ag.Asset,t=>{const e=t.ref;Object.entries(E).filter(([t])=>!!e[t]).forEach(([t,s])=>r.XO.add(Object.assign(e[t],{extension:e[t].extension??s})))},t=>{const e=t.ref;Object.keys(E).filter(t=>!!e[t]).forEach(t=>r.XO.remove(e[t]))})},7604:(t,e,s)=>{"use strict";function r(t){const e={};for(const s in t)void 0!==t[s]&&(e[s]=t[s]);return e}s.d(e,{S:()=>r})},7630:(t,e,s)=>{"use strict";s.d(e,{R:()=>p,w:()=>d});var r=s(3463),i=s(9279),n=s(5423),a=s(1065),o=s(8869),l=s(3809),h=s(4566),c=s(1143);const u=[".xml",".fnt"],d={extension:{type:a.Ag.CacheParser,name:"cacheBitmapFont"},test:t=>t instanceof l.B,getCacheableAssets(t,e){const s={};return t.forEach(t=>{s[t]=e,s[`${t}-bitmap`]=e}),s[`${e.fontFamily}-bitmap`]=e,s}},p={extension:{type:a.Ag.LoadParser,priority:r.T.Normal},name:"loadBitmapFont",id:"bitmap-font",test:t=>u.includes(o.A.extname(t).toLowerCase()),testParse:async t=>h.D.test(t)||c.s.test(t),async parse(t,e,s){const r=h.D.test(t)?h.D.parse(t):c.s.parse(t),{src:n}=e,{pages:a}=r,u=[],d=r.distanceField?{scaleMode:"linear",alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:!1,resolution:1}:{};for(let t=0;t<a.length;++t){const e=a[t].file;let s=o.A.join(o.A.dirname(n),e);s=(0,i.Y)(s,n),u.push({src:s,data:d})}const p=await s.load(u),f=u.map(t=>p[t.src]);return new l.B({data:r,textures:f},n)},async load(t,e){const s=await n.e.get().fetch(t);return await s.text()},async unload(t,e,s){await Promise.all(t.pages.map(t=>s.unload(t.texture.source._sourceOrigin))),t.destroy()}}},7635:(t,e,s)=>{"use strict";s.d(e,{V:()=>a});var r=s(166),i=s(6793);class n extends i.a{async doLoad(t){const e=new Promise(e=>{const s=new Image;s.crossOrigin="anonymous",s.src=t,s.onload=()=>{if(this.loadingPromises.delete(t),!this.hasActiveRef(t))return void e(void 0);if(this.cachedAssets.has(t))return console.error(`Texture already loaded: ${t}`),void e(void 0);const i=r.gPd.from(s);i.source.scaleMode="nearest",this.cachedAssets.set(t,i),e(i)},s.onerror=s=>{this.loadingPromises.delete(t),console.error(`Failed to load texture: ${t}`,s),e(void 0)}});return this.loadingPromises.set(t,e),await e}cleanup(t,e){e.destroy(!0)}}const a=new n},7694:(t,e,s)=>{"use strict";s.d(e,{R:()=>n});let r=0;const i=500;function n(...t){r!==i&&(r++,r===i?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...t))}},7717:(t,e,s)=>{"use strict";s.d(e,{o:()=>r});class r{constructor(t,e=!1){this._loader=t,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=e}add(t){t.forEach(t=>{this._assetList.push(t)}),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=!0;const t=[],e=Math.min(this._assetList.length,this._maxConcurrent);for(let s=0;s<e;s++)t.push(this._assetList.pop());await this._loader.load(t),this._isLoading=!1,this._next()}}get active(){return this._isActive}set active(t){this._isActive!==t&&(this._isActive=t,t&&!this._isLoading&&this._next())}}},7722:(t,e,s)=>{"use strict";s.d(e,{WebGLRenderer:()=>Kt});var r=s(1065),i=s(5199),n=s(9677),a=s(2305),o=s(1570),l=s(4405),h=s(7335),c=s(2478),u=s(1657),d=s(4449);class p{contextChange(t){const e=new d.k({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new i.u,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),s=t.limits.maxBatchableTextures,r=(0,n.I)({name:"graphics",bits:[a.a,(0,o.P)(s),l.mA,h.m]});this.shader=new u.M({glProgram:r,resources:{localUniforms:e,batchSamplers:(0,c.n)(s)}})}execute(t,e){const s=e.context,r=s.customShader||this.shader,i=t.renderer,n=i.graphicsContext,{batcher:a,instructions:o}=n.getContextRenderData(s);r.groups[0]=i.globalUniforms.bindGroup,i.state.set(t.state),i.shader.bind(r),i.geometry.bind(a.geometry,r.glProgram);const l=o.instructions;for(let t=0;t<o.instructionSize;t++){const e=l[t];if(e.size){for(let t=0;t<e.textures.count;t++)i.texture.bind(e.textures.textures[t],t);i.geometry.draw(e.topology,e.size,e.start)}}}destroy(){this.shader.destroy(!0),this.shader=null}}p.extension={type:[r.Ag.WebGLPipesAdaptor],name:"graphics"};var f=s(2577),m=s(9739),g=s(7694);class x{init(){const t=(0,n.I)({name:"mesh",bits:[l.mA,f.m,h.m]});this._shader=new u.M({glProgram:t,resources:{uTexture:m.g.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new i.u}}}})}execute(t,e){const s=t.renderer;let r=e._shader;if(r){if(!r.glProgram)return void(0,g.R)("Mesh shader has no glProgram",e.shader)}else{r=this._shader;const t=e.texture,s=t.source;r.resources.uTexture=s,r.resources.uSampler=s.style,r.resources.textureUniforms.uniforms.uTextureMatrix=t.textureMatrix.mapCoord}r.groups[100]=s.globalUniforms.bindGroup,r.groups[101]=t.localUniformsBindGroup,s.encoder.draw({geometry:e._geometry,shader:r,state:e.state})}destroy(){this._shader.destroy(!0),this._shader=null}}x.extension={type:[r.Ag.WebGLPipesAdaptor],name:"mesh"};var y=s(7433);class v{constructor(){this._tempState=y.U.for2d(),this._didUploadHash={}}init(t){t.renderer.runners.contextChange.add(this)}contextChange(){this._didUploadHash={}}start(t,e,s){const r=t.renderer,i=this._didUploadHash[s.uid];r.shader.bind(s,i),i||(this._didUploadHash[s.uid]=!0),r.shader.updateUniformGroup(r.globalUniforms.uniformGroup),r.geometry.bind(e,s.glProgram)}execute(t,e){const s=t.renderer;this._tempState.blendMode=e.blendMode,s.state.set(this._tempState);const r=e.textures.textures;for(let t=0;t<e.textures.count;t++)s.texture.bind(r[t],t);s.geometry.draw(e.topology,e.size,e.start)}}v.extension={type:[r.Ag.WebGLPipesAdaptor],name:"batch"};var _=s(6114),b=s(1673),w=s(5153),T=s(9798),S=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(S||{});class A{constructor(t,e){this._lastBindBaseLocation=-1,this._lastBindCallId=-1,this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.type=e}}class C{constructor(t){this._gpuBuffers=Object.create(null),this._boundBufferBases=Object.create(null),this._minBaseLocation=0,this._nextBindBaseIndex=this._minBaseLocation,this._bindCallId=0,this._renderer=t,this._renderer.renderableGC.addManagedHash(this,"_gpuBuffers")}destroy(){this._renderer=null,this._gl=null,this._gpuBuffers=null,this._boundBufferBases=null}contextChange(){this._gl=this._renderer.gl,this._gpuBuffers=Object.create(null),this._maxBindings=this._renderer.limits.maxUniformBindings}getGlBuffer(t){return this._gpuBuffers[t.uid]||this.createGLBuffer(t)}bind(t){const{_gl:e}=this,s=this.getGlBuffer(t);e.bindBuffer(s.type,s.buffer)}bindBufferBase(t,e){const{_gl:s}=this;this._boundBufferBases[e]!==t&&(this._boundBufferBases[e]=t,t._lastBindBaseLocation=e,s.bindBufferBase(s.UNIFORM_BUFFER,e,t.buffer))}nextBindBase(t){this._bindCallId++,this._minBaseLocation=0,t&&(this._boundBufferBases[0]=null,this._minBaseLocation=1,this._nextBindBaseIndex<1&&(this._nextBindBaseIndex=1))}freeLocationForBufferBase(t){let e=this.getLastBindBaseLocation(t);if(e>=this._minBaseLocation)return t._lastBindCallId=this._bindCallId,e;let s=0,r=this._nextBindBaseIndex;for(;s<2;){r>=this._maxBindings&&(r=this._minBaseLocation,s++);const t=this._boundBufferBases[r];if(!t||t._lastBindCallId!==this._bindCallId)break;r++}return e=r,this._nextBindBaseIndex=r+1,s>=2?-1:(t._lastBindCallId=this._bindCallId,this._boundBufferBases[e]=null,e)}getLastBindBaseLocation(t){const e=t._lastBindBaseLocation;return this._boundBufferBases[e]===t?e:-1}bindBufferRange(t,e,s,r){const{_gl:i}=this;s||(s=0),e||(e=0),this._boundBufferBases[e]=null,i.bindBufferRange(i.UNIFORM_BUFFER,e||0,t.buffer,256*s,r||256)}updateBuffer(t){const{_gl:e}=this,s=this.getGlBuffer(t);if(t._updateID===s.updateID)return s;s.updateID=t._updateID,e.bindBuffer(s.type,s.buffer);const r=t.data,i=t.descriptor.usage&T.S.STATIC?e.STATIC_DRAW:e.DYNAMIC_DRAW;return r?s.byteLength>=r.byteLength?e.bufferSubData(s.type,0,r,0,t._updateSize/r.BYTES_PER_ELEMENT):(s.byteLength=r.byteLength,e.bufferData(s.type,r,i)):(s.byteLength=t.descriptor.size,e.bufferData(s.type,s.byteLength,i)),s}destroyAll(){const t=this._gl;for(const e in this._gpuBuffers)t.deleteBuffer(this._gpuBuffers[e].buffer);this._gpuBuffers=Object.create(null)}onBufferDestroy(t,e){const s=this._gpuBuffers[t.uid],r=this._gl;e||r.deleteBuffer(s.buffer),this._gpuBuffers[t.uid]=null}createGLBuffer(t){const{_gl:e}=this;let s=S.ARRAY_BUFFER;t.descriptor.usage&T.S.INDEX?s=S.ELEMENT_ARRAY_BUFFER:t.descriptor.usage&T.S.UNIFORM&&(s=S.UNIFORM_BUFFER);const r=new A(e.createBuffer(),s);return this._gpuBuffers[t.uid]=r,t.on("destroy",this.onBufferDestroy,this),r}resetState(){this._boundBufferBases=Object.create(null)}}C.extension={type:[r.Ag.WebGLSystem],name:"buffer"};var P=s(5423);const E=class t{constructor(t){this.supports={uint32Indices:!0,uniformBufferObject:!0,vertexArrayObject:!0,srgbTextures:!0,nonPowOf2wrapping:!0,msaa:!0,nonPowOf2mipmaps:!0},this._renderer=t,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(t){this.gl=t,this._renderer.gl=t}init(e){e={...t.defaultOptions,...e};let s=this.multiView=e.multiView;if(e.context&&s&&((0,g.R)("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),s=!1),this.canvas=s?P.e.get().createCanvas(this._renderer.canvas.width,this._renderer.canvas.height):this._renderer.view.canvas,e.context)this.initFromContext(e.context);else{const t=this._renderer.background.alpha<1,s=e.premultipliedAlpha??!0,r=e.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(e.preferWebGLVersion,{alpha:t,premultipliedAlpha:s,antialias:r,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference??"default"})}}ensureCanvasSize(t){if(!this.multiView)return void(t!==this.canvas&&(0,g.R)("multiView is disabled, but targetCanvas is not the main canvas"));const{canvas:e}=this;(e.width<t.width||e.height<t.height)&&(e.width=Math.max(t.width,t.width),e.height=Math.max(t.height,t.height))}initFromContext(t){this.gl=t,this.webGLVersion=t instanceof P.e.get().getWebGLRenderingContext()?1:2,this.getExtensions(),this.validateContext(t),this._renderer.runners.contextChange.emit(t);const e=this._renderer.view.canvas;e.addEventListener("webglcontextlost",this.handleContextLost,!1),e.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}createContext(t,e){let s;const r=this.canvas;if(2===t&&(s=r.getContext("webgl2",e)),!s&&(s=r.getContext("webgl",e),!s))throw new Error("This browser does not support WebGL. Try using the canvas renderer");this.gl=s,this.initFromContext(this.gl)}getExtensions(){const{gl:t}=this,e={anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc"),bptc:t.getExtension("EXT_texture_compression_bptc"),rgtc:t.getExtension("EXT_texture_compression_rgtc"),loseContext:t.getExtension("WEBGL_lose_context")};if(1===this.webGLVersion)this.extensions={...e,drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear"),vertexAttribDivisorANGLE:t.getExtension("ANGLE_instanced_arrays"),srgb:t.getExtension("EXT_sRGB")};else{this.extensions={...e,colorBufferFloat:t.getExtension("EXT_color_buffer_float")};const s=t.getExtension("WEBGL_provoking_vertex");s&&s.provokingVertexWEBGL(s.FIRST_VERTEX_CONVENTION_WEBGL)}}handleContextLost(t){t.preventDefault(),this._contextLossForced&&(this._contextLossForced=!1,setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext?.restoreContext()},0))}handleContextRestored(){this.getExtensions(),this._renderer.runners.contextChange.emit(this.gl)}destroy(){const t=this._renderer.view.canvas;this._renderer=null,t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext?.loseContext()}forceContextLoss(){this.extensions.loseContext?.loseContext(),this._contextLossForced=!0}validateContext(t){const e=t.getContextAttributes();e&&!e.stencil&&(0,g.R)("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const s=this.supports,r=2===this.webGLVersion,i=this.extensions;s.uint32Indices=r||!!i.uint32ElementIndex,s.uniformBufferObject=r,s.vertexArrayObject=r||!!i.vertexArrayObject,s.srgbTextures=r||!!i.srgb,s.nonPowOf2wrapping=r,s.nonPowOf2mipmaps=r,s.msaa=r,s.uint32Indices||(0,g.R)("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly")}};E.extension={type:[r.Ag.WebGLSystem],name:"context"},E.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2,multiView:!1};let M=E;var k=s(4988),R=s(498),B=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(B||{}),I=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(I||{}),F=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(F||{});const D={uint8x2:F.UNSIGNED_BYTE,uint8x4:F.UNSIGNED_BYTE,sint8x2:F.BYTE,sint8x4:F.BYTE,unorm8x2:F.UNSIGNED_BYTE,unorm8x4:F.UNSIGNED_BYTE,snorm8x2:F.BYTE,snorm8x4:F.BYTE,uint16x2:F.UNSIGNED_SHORT,uint16x4:F.UNSIGNED_SHORT,sint16x2:F.SHORT,sint16x4:F.SHORT,unorm16x2:F.UNSIGNED_SHORT,unorm16x4:F.UNSIGNED_SHORT,snorm16x2:F.SHORT,snorm16x4:F.SHORT,float16x2:F.HALF_FLOAT,float16x4:F.HALF_FLOAT,float32:F.FLOAT,float32x2:F.FLOAT,float32x3:F.FLOAT,float32x4:F.FLOAT,uint32:F.UNSIGNED_INT,uint32x2:F.UNSIGNED_INT,uint32x3:F.UNSIGNED_INT,uint32x4:F.UNSIGNED_INT,sint32:F.INT,sint32x2:F.INT,sint32x3:F.INT,sint32x4:F.INT};function O(t){return D[t]??D.float32}const G={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5};class U{constructor(t){this._geometryVaoHash=Object.create(null),this._renderer=t,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this._renderer.renderableGC.addManagedHash(this,"_geometryVaoHash")}contextChange(){const t=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");const e=this._renderer.context.extensions.vertexArrayObject;e&&(t.createVertexArray=()=>e.createVertexArrayOES(),t.bindVertexArray=t=>e.bindVertexArrayOES(t),t.deleteVertexArray=t=>e.deleteVertexArrayOES(t));const s=this._renderer.context.extensions.vertexAttribDivisorANGLE;s&&(t.drawArraysInstanced=(t,e,r,i)=>{s.drawArraysInstancedANGLE(t,e,r,i)},t.drawElementsInstanced=(t,e,r,i,n)=>{s.drawElementsInstancedANGLE(t,e,r,i,n)},t.vertexAttribDivisor=(t,e)=>s.vertexAttribDivisorANGLE(t,e)),this._activeGeometry=null,this._activeVao=null,this._geometryVaoHash=Object.create(null)}bind(t,e){const s=this.gl;this._activeGeometry=t;const r=this.getVao(t,e);this._activeVao!==r&&(this._activeVao=r,s.bindVertexArray(r)),this.updateBuffers()}resetState(){this.unbind()}updateBuffers(){const t=this._activeGeometry,e=this._renderer.buffer;for(let s=0;s<t.buffers.length;s++){const r=t.buffers[s];e.updateBuffer(r)}}checkCompatibility(t,e){const s=t.attributes,r=e._attributeData;for(const t in r)if(!s[t])throw new Error(`shader and geometry incompatible, geometry missing the "${t}" attribute`)}getSignature(t,e){const s=t.attributes,r=e._attributeData,i=["g",t.uid];for(const t in s)r[t]&&i.push(t,r[t].location);return i.join("-")}getVao(t,e){return this._geometryVaoHash[t.uid]?.[e._key]||this.initGeometryVao(t,e)}initGeometryVao(t,e,s=!0){const r=this._renderer.gl,i=this._renderer.buffer;this._renderer.shader._getProgramData(e),this.checkCompatibility(t,e);const n=this.getSignature(t,e);this._geometryVaoHash[t.uid]||(this._geometryVaoHash[t.uid]=Object.create(null),t.on("destroy",this.onGeometryDestroy,this));const a=this._geometryVaoHash[t.uid];let o=a[n];if(o)return a[e._key]=o,o;(0,R.q)(t,e._attributeData);const l=t.buffers;o=r.createVertexArray(),r.bindVertexArray(o);for(let t=0;t<l.length;t++){const e=l[t];i.bind(e)}return this.activateVao(t,e),a[e._key]=o,a[n]=o,r.bindVertexArray(null),o}onGeometryDestroy(t,e){const s=this._geometryVaoHash[t.uid],r=this.gl;if(s){if(e)for(const t in s)this._activeVao!==s[t]&&this.unbind(),r.deleteVertexArray(s[t]);this._geometryVaoHash[t.uid]=null}}destroyAll(t=!1){const e=this.gl;for(const s in this._geometryVaoHash){if(t)for(const t in this._geometryVaoHash[s]){const r=this._geometryVaoHash[s];this._activeVao!==r&&this.unbind(),e.deleteVertexArray(r[t])}this._geometryVaoHash[s]=null}}activateVao(t,e){const s=this._renderer.gl,r=this._renderer.buffer,i=t.attributes;t.indexBuffer&&r.bind(t.indexBuffer);let n=null;for(const t in i){const a=i[t],o=a.buffer,l=r.getGlBuffer(o),h=e._attributeData[t];if(h){n!==l&&(r.bind(o),n=l);const t=h.location;s.enableVertexAttribArray(t);const e=(0,k.m)(a.format),i=O(a.format);if("int"===h.format?.substring(1,4)?s.vertexAttribIPointer(t,e.size,i,a.stride,a.offset):s.vertexAttribPointer(t,e.size,i,e.normalised,a.stride,a.offset),a.instance){if(!this.hasInstance)throw new Error("geometry error, GPU Instancing is not supported on this device");{const e=a.divisor??1;s.vertexAttribDivisor(t,e)}}}}}draw(t,e,s,r){const{gl:i}=this._renderer,n=this._activeGeometry,a=G[t||n.topology];if(r??(r=n.instanceCount),n.indexBuffer){const t=n.indexBuffer.data.BYTES_PER_ELEMENT,o=2===t?i.UNSIGNED_SHORT:i.UNSIGNED_INT;r>1?i.drawElementsInstanced(a,e||n.indexBuffer.data.length,o,(s||0)*t,r):i.drawElements(a,e||n.indexBuffer.data.length,o,(s||0)*t)}else r>1?i.drawArraysInstanced(a,s||0,e||n.getSize(),r):i.drawArrays(a,s||0,e||n.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null,this._geometryVaoHash=null}}U.extension={type:[r.Ag.WebGLSystem],name:"geometry"};var L=s(8337),N=s(4269),X=s(5007);const Y=new L.V({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),V=class t{constructor(t){this.useBackBuffer=!1,this._useBackBufferThisRender=!1,this._renderer=t}init(e={}){const{useBackBuffer:s,antialias:r}={...t.defaultOptions,...e};this.useBackBuffer=s,this._antialias=r,this._renderer.context.supports.msaa||((0,g.R)("antialiasing, is not supported on when using the back buffer"),this._antialias=!1),this._state=y.U.for2d();const i=new X.M({vertex:"\n attribute vec2 aPosition;\n out vec2 vUv;\n\n void main() {\n gl_Position = vec4(aPosition, 0.0, 1.0);\n\n vUv = (aPosition + 1.0) / 2.0;\n\n // flip dem UVs\n vUv.y = 1.0 - vUv.y;\n }",fragment:"\n in vec2 vUv;\n out vec4 finalColor;\n\n uniform sampler2D uTexture;\n\n void main() {\n finalColor = texture(uTexture, vUv);\n }",name:"big-triangle"});this._bigTriangleShader=new u.M({glProgram:i,resources:{uTexture:m.g.WHITE.source}})}renderStart(t){const e=this._renderer.renderTarget.getRenderTarget(t.target);if(this._useBackBufferThisRender=this.useBackBuffer&&!!e.isRoot,this._useBackBufferThisRender){const e=this._renderer.renderTarget.getRenderTarget(t.target);this._targetTexture=e.colorTexture,t.target=this._getBackBufferTexture(e.colorTexture)}}renderEnd(){this._presentBackBuffer()}_presentBackBuffer(){const t=this._renderer;t.renderTarget.finishRenderPass(),this._useBackBufferThisRender&&(t.renderTarget.bind(this._targetTexture,!1),this._bigTriangleShader.resources.uTexture=this._backBufferTexture.source,t.encoder.draw({geometry:Y,shader:this._bigTriangleShader,state:this._state}))}_getBackBufferTexture(t){return this._backBufferTexture=this._backBufferTexture||new m.g({source:new N.v({width:t.width,height:t.height,resolution:t._resolution,antialias:this._antialias})}),this._backBufferTexture.source.resize(t.width,t.height,t._resolution),this._backBufferTexture}destroy(){this._backBufferTexture&&(this._backBufferTexture.destroy(),this._backBufferTexture=null)}};V.extension={type:[r.Ag.WebGLSystem],name:"backBuffer",priority:1},V.defaultOptions={useBackBuffer:!1};let z=V;class W{constructor(t){this._colorMaskCache=15,this._renderer=t}setMask(t){this._colorMaskCache!==t&&(this._colorMaskCache=t,this._renderer.gl.colorMask(!!(8&t),!!(4&t),!!(2&t),!!(1&t)))}}W.extension={type:[r.Ag.WebGLSystem],name:"colorMask"};class H{constructor(t){this.commandFinished=Promise.resolve(),this._renderer=t}setGeometry(t,e){this._renderer.geometry.bind(t,e.glProgram)}finishRenderPass(){}draw(t){const e=this._renderer,{geometry:s,shader:r,state:i,skipSync:n,topology:a,size:o,start:l,instanceCount:h}=t;e.shader.bind(r,n),e.geometry.bind(s,e.shader._activeProgram),i&&e.state.set(i),e.geometry.draw(a,o,l,h??s.instanceCount)}destroy(){this._renderer=null}}H.extension={type:[r.Ag.WebGLSystem],name:"encoder"};var j=s(6890);class q{constructor(t){this._renderer=t}contextChange(){const t=this._renderer.gl;this.maxTextures=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),this.maxBatchableTextures=(0,j.u)(this.maxTextures,t);const e=2===this._renderer.context.webGLVersion;this.maxUniformBindings=e?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0}destroy(){}}q.extension={type:[r.Ag.WebGLSystem],name:"limits"};var $=s(9250),K=s(8271);class Q{constructor(t){this._stencilCache={enabled:!1,stencilReference:0,stencilMode:K.K.NONE},this._renderTargetStencilState=Object.create(null),t.renderTarget.onRenderTargetChange.add(this)}contextChange(t){this._gl=t,this._comparisonFuncMapping={always:t.ALWAYS,never:t.NEVER,equal:t.EQUAL,"not-equal":t.NOTEQUAL,less:t.LESS,"less-equal":t.LEQUAL,greater:t.GREATER,"greater-equal":t.GEQUAL},this._stencilOpsMapping={keep:t.KEEP,zero:t.ZERO,replace:t.REPLACE,invert:t.INVERT,"increment-clamp":t.INCR,"decrement-clamp":t.DECR,"increment-wrap":t.INCR_WRAP,"decrement-wrap":t.DECR_WRAP},this.resetState()}onRenderTargetChange(t){if(this._activeRenderTarget===t)return;this._activeRenderTarget=t;let e=this._renderTargetStencilState[t.uid];e||(e=this._renderTargetStencilState[t.uid]={stencilMode:K.K.DISABLED,stencilReference:0}),this.setStencilMode(e.stencilMode,e.stencilReference)}resetState(){this._stencilCache.enabled=!1,this._stencilCache.stencilMode=K.K.NONE,this._stencilCache.stencilReference=0}setStencilMode(t,e){const s=this._renderTargetStencilState[this._activeRenderTarget.uid],r=this._gl,i=$.g[t],n=this._stencilCache;s.stencilMode=t,s.stencilReference=e,t!==K.K.DISABLED?(this._stencilCache.enabled||(this._stencilCache.enabled=!0,r.enable(r.STENCIL_TEST)),t===n.stencilMode&&n.stencilReference===e||(n.stencilMode=t,n.stencilReference=e,r.stencilFunc(this._comparisonFuncMapping[i.stencilBack.compare],e,255),r.stencilOp(r.KEEP,r.KEEP,this._stencilOpsMapping[i.stencilBack.passOp]))):this._stencilCache.enabled&&(this._stencilCache.enabled=!1,r.disable(r.STENCIL_TEST))}}Q.extension={type:[r.Ag.WebGLSystem],name:"stencil"};var Z=s(1009);const J={f32:4,i32:4,"vec2<f32>":8,"vec3<f32>":12,"vec4<f32>":16,"vec2<i32>":8,"vec3<i32>":12,"vec4<i32>":16,"mat2x2<f32>":32,"mat3x3<f32>":48,"mat4x4<f32>":64};function tt(t){const e=t.map(t=>({data:t,offset:0,size:0}));let s=0,r=0;for(let t=0;t<e.length;t++){const i=e[t];if(s=J[i.data.type],!s)throw new Error(`Unknown type ${i.data.type}`);i.data.size>1&&(s=Math.max(s,16)*i.data.size);const n=12===s?16:s;i.size=s;const a=r%16;r+=a>0&&16-a<n?(16-a)%16:(s-a%s)%s,i.offset=r,r+=s}return r=16*Math.ceil(r/16),{uboElements:e,size:r}}var et=s(2337),st=s(4364);function rt(t,e){const s=Math.max(J[t.data.type]/16,1),r=t.data.value.length/t.data.size,i=(4-r%4)%4,n=t.data.type.indexOf("i32")>=0?"dataInt32":"data";return`\n v = uv.${t.data.name};\n offset += ${e};\n\n arrayOffset = offset;\n\n t = 0;\n\n for(var i=0; i < ${t.data.size*s}; i++)\n {\n for(var j = 0; j < ${r}; j++)\n {\n ${n}[arrayOffset++] = v[t++];\n }\n ${0!==i?`arrayOffset += ${i};`:""}\n }\n `}function it(t){return(0,et.E)(t,"uboStd40",rt,st.g)}class nt extends Z.W{constructor(){super({createUboElements:tt,generateUboSync:it})}}nt.extension={type:[r.Ag.WebGLSystem],name:"ubo"};var at=s(8900),ot=s(9390),lt=s(1386),ht=s(1711);class ct{constructor(){this.width=-1,this.height=-1,this.msaa=!1,this.msaaRenderBuffer=[]}}class ut{constructor(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new ot.M}init(t,e){this._renderer=t,this._renderTargetSystem=e,t.runners.contextChange.add(this)}contextChange(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new ot.M}copyToTexture(t,e,s,r,i){const n=this._renderTargetSystem,a=this._renderer,o=n.getGpuRenderTarget(t),l=a.gl;return this.finishRenderPass(t),l.bindFramebuffer(l.FRAMEBUFFER,o.resolveTargetFramebuffer),a.texture.bind(e,0),l.copyTexSubImage2D(l.TEXTURE_2D,0,i.x,i.y,s.x,s.y,r.width,r.height),e}startRenderPass(t,e=!0,s,r){const i=this._renderTargetSystem,n=t.colorTexture,a=i.getGpuRenderTarget(t);let o=r.y;t.isRoot&&(o=n.pixelHeight-r.height),t.colorTextures.forEach(t=>{this._renderer.texture.unbind(t)});const l=this._renderer.gl;l.bindFramebuffer(l.FRAMEBUFFER,a.framebuffer);const h=this._viewPortCache;h.x===r.x&&h.y===o&&h.width===r.width&&h.height===r.height||(h.x=r.x,h.y=o,h.width=r.width,h.height=r.height,l.viewport(r.x,o,r.width,r.height)),a.depthStencilRenderBuffer||!t.stencil&&!t.depth||this._initStencil(a),this.clear(t,e,s)}finishRenderPass(t){const e=this._renderTargetSystem.getGpuRenderTarget(t);if(!e.msaa)return;const s=this._renderer.gl;s.bindFramebuffer(s.FRAMEBUFFER,e.resolveTargetFramebuffer),s.bindFramebuffer(s.READ_FRAMEBUFFER,e.framebuffer),s.blitFramebuffer(0,0,e.width,e.height,0,0,e.width,e.height,s.COLOR_BUFFER_BIT,s.NEAREST),s.bindFramebuffer(s.FRAMEBUFFER,e.framebuffer)}initGpuRenderTarget(t){const e=this._renderer.gl,s=new ct;return t.colorTexture instanceof lt.q?(this._renderer.context.ensureCanvasSize(t.colorTexture.resource),s.framebuffer=null,s):(this._initColor(t,s),e.bindFramebuffer(e.FRAMEBUFFER,null),s)}destroyGpuRenderTarget(t){const e=this._renderer.gl;t.framebuffer&&(e.deleteFramebuffer(t.framebuffer),t.framebuffer=null),t.resolveTargetFramebuffer&&(e.deleteFramebuffer(t.resolveTargetFramebuffer),t.resolveTargetFramebuffer=null),t.depthStencilRenderBuffer&&(e.deleteRenderbuffer(t.depthStencilRenderBuffer),t.depthStencilRenderBuffer=null),t.msaaRenderBuffer.forEach(t=>{e.deleteRenderbuffer(t)}),t.msaaRenderBuffer=null}clear(t,e,s){if(!e)return;const r=this._renderTargetSystem;"boolean"==typeof e&&(e=e?ht.u.ALL:ht.u.NONE);const i=this._renderer.gl;if(e&ht.u.COLOR){s??(s=r.defaultClearColor);const t=this._clearColorCache,e=s;t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]||(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],i.clearColor(e[0],e[1],e[2],e[3]))}i.clear(e)}resizeGpuRenderTarget(t){if(t.isRoot)return;const e=this._renderTargetSystem.getGpuRenderTarget(t);this._resizeColor(t,e),(t.stencil||t.depth)&&this._resizeStencil(e)}_initColor(t,e){const s=this._renderer,r=s.gl,i=r.createFramebuffer();if(e.resolveTargetFramebuffer=i,r.bindFramebuffer(r.FRAMEBUFFER,i),e.width=t.colorTexture.source.pixelWidth,e.height=t.colorTexture.source.pixelHeight,t.colorTextures.forEach((t,i)=>{const n=t.source;n.antialias&&(s.context.supports.msaa?e.msaa=!0:(0,g.R)("[RenderTexture] Antialiasing on textures is not supported in WebGL1")),s.texture.bindSource(n,0);const a=s.texture.getGlSource(n).texture;r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+i,3553,a,0)}),e.msaa){const s=r.createFramebuffer();e.framebuffer=s,r.bindFramebuffer(r.FRAMEBUFFER,s),t.colorTextures.forEach((t,s)=>{const i=r.createRenderbuffer();e.msaaRenderBuffer[s]=i})}else e.framebuffer=i;this._resizeColor(t,e)}_resizeColor(t,e){const s=t.colorTexture.source;if(e.width=s.pixelWidth,e.height=s.pixelHeight,t.colorTextures.forEach((t,e)=>{0!==e&&t.source.resize(s.width,s.height,s._resolution)}),e.msaa){const s=this._renderer,r=s.gl,i=e.framebuffer;r.bindFramebuffer(r.FRAMEBUFFER,i),t.colorTextures.forEach((t,i)=>{const n=t.source;s.texture.bindSource(n,0);const a=s.texture.getGlSource(n).internalFormat,o=e.msaaRenderBuffer[i];r.bindRenderbuffer(r.RENDERBUFFER,o),r.renderbufferStorageMultisample(r.RENDERBUFFER,4,a,n.pixelWidth,n.pixelHeight),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+i,r.RENDERBUFFER,o)})}}_initStencil(t){if(null===t.framebuffer)return;const e=this._renderer.gl,s=e.createRenderbuffer();t.depthStencilRenderBuffer=s,e.bindRenderbuffer(e.RENDERBUFFER,s),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,s),this._resizeStencil(t)}_resizeStencil(t){const e=this._renderer.gl;e.bindRenderbuffer(e.RENDERBUFFER,t.depthStencilRenderBuffer),t.msaa?e.renderbufferStorageMultisample(e.RENDERBUFFER,4,e.DEPTH24_STENCIL8,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,2===this._renderer.context.webGLVersion?e.DEPTH24_STENCIL8:e.DEPTH_STENCIL,t.width,t.height)}prerender(t){const e=t.colorTexture.resource;this._renderer.context.multiView&&lt.q.test(e)&&this._renderer.context.ensureCanvasSize(e)}postrender(t){if(this._renderer.context.multiView&&lt.q.test(t.colorTexture.resource)){const e=this._renderer.context.canvas,s=t.colorTexture;s.context2D.drawImage(e,0,s.pixelHeight-e.height)}}}class dt extends at.l{constructor(t){super(t),this.adaptor=new ut,this.adaptor.init(t,this)}}dt.extension={type:[r.Ag.WebGLSystem],name:"renderTarget"};var pt=s(2015);class ft{constructor(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBlockBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBlockBindings=null,this.program=null}}function mt(t,e,s){const r=t.createShader(e);return t.shaderSource(r,s),t.compileShader(r),r}function gt(t){const e=new Array(t);for(let t=0;t<e.length;t++)e[t]=!1;return e}function xt(t,e){switch(t){case"float":case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return gt(2*e);case"bvec3":return gt(3*e);case"bvec4":return gt(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}let yt=null;const vt={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"},_t={float:"float32",vec2:"float32x2",vec3:"float32x3",vec4:"float32x4",int:"sint32",ivec2:"sint32x2",ivec3:"sint32x3",ivec4:"sint32x4",uint:"uint32",uvec2:"uint32x2",uvec3:"uint32x3",uvec4:"uint32x4",bool:"uint32",bvec2:"uint32x2",bvec3:"uint32x3",bvec4:"uint32x4"};function bt(t,e){if(!yt){const e=Object.keys(vt);yt={};for(let s=0;s<e.length;++s){const r=e[s];yt[t[r]]=vt[r]}}return yt[e]}function wt(t,e){const s=bt(t,e);return _t[s]||"float32"}function Tt(t,e){const s=t.getShaderSource(e).split("\n").map((t,e)=>`${e}: ${t}`),r=t.getShaderInfoLog(e),i=r.split("\n"),n={},a=i.map(t=>parseFloat(t.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(t=>!(!t||n[t]||(n[t]=!0,0))),o=[""];a.forEach(t=>{s[t-1]=`%c${s[t-1]}%c`,o.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const l=s.join("\n");o[0]=l,console.error(r),console.groupCollapsed("click to view full shader code"),console.warn(...o),console.groupEnd()}const St={textureCount:0,blockIndex:0};class At{constructor(t){this._activeProgram=null,this._programDataHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._renderer=t,this._renderer.renderableGC.addManagedHash(this,"_programDataHash")}contextChange(t){this._gl=t,this._programDataHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._activeProgram=null}bind(t,e){if(this._setProgram(t.glProgram),e)return;St.textureCount=0,St.blockIndex=0;let s=this._shaderSyncFunctions[t.glProgram._key];s||(s=this._shaderSyncFunctions[t.glProgram._key]=this._generateShaderSync(t,this)),this._renderer.buffer.nextBindBase(!!t.glProgram.transformFeedbackVaryings),s(this._renderer,t,St)}updateUniformGroup(t){this._renderer.uniformGroup.updateUniformGroup(t,this._activeProgram,St)}bindUniformBlock(t,e,s=0){const r=this._renderer.buffer,i=this._getProgramData(this._activeProgram),n=t._bufferResource;n||this._renderer.ubo.updateUniformGroup(t);const a=t.buffer,o=r.updateBuffer(a),l=r.freeLocationForBufferBase(o);if(n){const{offset:e,size:s}=t;0===e&&s===a.data.byteLength?r.bindBufferBase(o,l):r.bindBufferRange(o,l,e)}else r.getLastBindBaseLocation(o)!==l&&r.bindBufferBase(o,l);const h=this._activeProgram._uniformBlockData[e].index;i.uniformBlockBindings[s]!==l&&(i.uniformBlockBindings[s]=l,this._renderer.gl.uniformBlockBinding(i.program,h,l))}_setProgram(t){if(this._activeProgram===t)return;this._activeProgram=t;const e=this._getProgramData(t);this._gl.useProgram(e.program)}_getProgramData(t){return this._programDataHash[t._key]||this._createProgramData(t)}_createProgramData(t){const e=t._key;return this._programDataHash[e]=function(t,e){const s=mt(t,t.VERTEX_SHADER,e.vertex),r=mt(t,t.FRAGMENT_SHADER,e.fragment),i=t.createProgram();t.attachShader(i,s),t.attachShader(i,r);const n=e.transformFeedbackVaryings;n&&("function"!=typeof t.transformFeedbackVaryings?(0,g.R)("TransformFeedback is not supported but TransformFeedbackVaryings are given."):t.transformFeedbackVaryings(i,n.names,"separate"===n.bufferMode?t.SEPARATE_ATTRIBS:t.INTERLEAVED_ATTRIBS)),t.linkProgram(i),t.getProgramParameter(i,t.LINK_STATUS)||function(t,e,s,r){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(s,t.COMPILE_STATUS)||Tt(t,s),t.getShaderParameter(r,t.COMPILE_STATUS)||Tt(t,r),console.error("PixiJS Error: Could not initialize shader."),""!==t.getProgramInfoLog(e)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}(t,i,s,r),e._attributeData=function(t,e,s=!1){const r={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let s=0;s<i;s++){const i=e.getActiveAttrib(t,s);if(i.name.startsWith("gl_"))continue;const n=wt(e,i.type);r[i.name]={location:0,format:n,stride:(0,k.m)(n).stride,offset:0,instance:!1,start:0}}const n=Object.keys(r);if(s){n.sort((t,e)=>t>e?1:-1);for(let s=0;s<n.length;s++)r[n[s]].location=s,e.bindAttribLocation(t,s,n[s]);e.linkProgram(t)}else for(let s=0;s<n.length;s++)r[n[s]].location=e.getAttribLocation(t,n[s]);return r}(i,t,!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertex)),e._uniformData=function(t,e){const s={},r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<r;i++){const r=e.getActiveUniform(t,i),n=r.name.replace(/\[.*?\]$/,""),a=!!r.name.match(/\[.*?\]$/),o=bt(e,r.type);s[n]={name:n,index:i,type:o,size:r.size,isArray:a,value:xt(o,r.size)}}return s}(i,t),e._uniformBlockData=function(t,e){if(!e.ACTIVE_UNIFORM_BLOCKS)return{};const s={},r=e.getProgramParameter(t,e.ACTIVE_UNIFORM_BLOCKS);for(let i=0;i<r;i++){const r=e.getActiveUniformBlockName(t,i),n=e.getUniformBlockIndex(t,r),a=e.getActiveUniformBlockParameter(t,i,e.UNIFORM_BLOCK_DATA_SIZE);s[r]={name:r,index:n,size:a}}return s}(i,t),t.deleteShader(s),t.deleteShader(r);const a={};for(const s in e._uniformData){const r=e._uniformData[s];a[s]={location:t.getUniformLocation(i,s),value:xt(r.type,r.size)}}return new ft(i,a)}(this._gl,t),this._programDataHash[e]}destroy(){for(const t of Object.keys(this._programDataHash))this._programDataHash[t].destroy(),this._programDataHash[t]=null;this._programDataHash=null,this._shaderSyncFunctions=null,this._activeProgram=null,this._renderer=null,this._gl=null}_generateShaderSync(t,e){return function(t,e){const s=[],r=["\n var g = s.groups;\n var sS = r.shader;\n var p = s.glProgram;\n var ugS = r.uniformGroup;\n var resources;\n "];let i=!1,n=0;const a=e._getProgramData(t.glProgram);for(const o in t.groups){const l=t.groups[o];s.push(`\n resources = g[${o}].resources;\n `);for(const h in l.resources){const c=l.resources[h];if(c instanceof d.k)if(c.ubo){const e=t._uniformBindMap[o][Number(h)];s.push(`\n sS.bindUniformBlock(\n resources[${h}],\n '${e}',\n ${t.glProgram._uniformBlockData[e].index}\n );\n `)}else s.push(`\n ugS.updateUniformGroup(resources[${h}], p, sD);\n `);else if(c instanceof pt.d){const e=t._uniformBindMap[o][Number(h)];s.push(`\n sS.bindUniformBlock(\n resources[${h}],\n '${e}',\n ${t.glProgram._uniformBlockData[e].index}\n );\n `)}else if(c instanceof N.v){const l=t._uniformBindMap[o][h],c=a.uniformData[l];c&&(i||(i=!0,r.push("\n var tS = r.texture;\n ")),e._gl.uniform1i(c.location,n),s.push(`\n tS.bind(resources[${h}], ${n});\n `),n++)}}}const o=[...r,...s].join("\n");return new Function("r","s","sD",o)}(t,e)}resetState(){this._activeProgram=null}}At.extension={type:[r.Ag.WebGLSystem],name:"shader"};var Ct=s(2276);const Pt={f32:"if (cv !== v) {\n cu.value = v;\n gl.uniform1f(location, v);\n }","vec2<f32>":"if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2f(location, v[0], v[1]);\n }","vec3<f32>":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3f(location, v[0], v[1], v[2]);\n }","vec4<f32>":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4f(location, v[0], v[1], v[2], v[3]);\n }",i32:"if (cv !== v) {\n cu.value = v;\n gl.uniform1i(location, v);\n }","vec2<i32>":"if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2i(location, v[0], v[1]);\n }","vec3<i32>":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3i(location, v[0], v[1], v[2]);\n }","vec4<i32>":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }",u32:"if (cv !== v) {\n cu.value = v;\n gl.uniform1ui(location, v);\n }","vec2<u32>":"if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2ui(location, v[0], v[1]);\n }","vec3<u32>":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3ui(location, v[0], v[1], v[2]);\n }","vec4<u32>":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4ui(location, v[0], v[1], v[2], v[3]);\n }",bool:"if (cv !== v) {\n cu.value = v;\n gl.uniform1i(location, v);\n }","vec2<bool>":"if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2i(location, v[0], v[1]);\n }","vec3<bool>":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3i(location, v[0], v[1], v[2]);\n }","vec4<bool>":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }","mat2x2<f32>":"gl.uniformMatrix2fv(location, false, v);","mat3x3<f32>":"gl.uniformMatrix3fv(location, false, v);","mat4x4<f32>":"gl.uniformMatrix4fv(location, false, v);"},Et={f32:"gl.uniform1fv(location, v);","vec2<f32>":"gl.uniform2fv(location, v);","vec3<f32>":"gl.uniform3fv(location, v);","vec4<f32>":"gl.uniform4fv(location, v);","mat2x2<f32>":"gl.uniformMatrix2fv(location, false, v);","mat3x3<f32>":"gl.uniformMatrix3fv(location, false, v);","mat4x4<f32>":"gl.uniformMatrix4fv(location, false, v);",i32:"gl.uniform1iv(location, v);","vec2<i32>":"gl.uniform2iv(location, v);","vec3<i32>":"gl.uniform3iv(location, v);","vec4<i32>":"gl.uniform4iv(location, v);",u32:"gl.uniform1iv(location, v);","vec2<u32>":"gl.uniform2iv(location, v);","vec3<u32>":"gl.uniform3iv(location, v);","vec4<u32>":"gl.uniform4iv(location, v);",bool:"gl.uniform1iv(location, v);","vec2<bool>":"gl.uniform2iv(location, v);","vec3<bool>":"gl.uniform3iv(location, v);","vec4<bool>":"gl.uniform4iv(location, v);"};class Mt{constructor(t){this._cache={},this._uniformGroupSyncHash={},this._renderer=t,this.gl=null,this._cache={}}contextChange(t){this.gl=t}updateUniformGroup(t,e,s){const r=this._renderer.shader._getProgramData(e);t.isStatic&&t._dirtyId===r.uniformDirtyGroups[t.uid]||(r.uniformDirtyGroups[t.uid]=t._dirtyId,this._getUniformSyncFunction(t,e)(r.uniformData,t.uniforms,this._renderer,s))}_getUniformSyncFunction(t,e){return this._uniformGroupSyncHash[t._signature]?.[e._key]||this._createUniformSyncFunction(t,e)}_createUniformSyncFunction(t,e){const s=this._uniformGroupSyncHash[t._signature]||(this._uniformGroupSyncHash[t._signature]={}),r=this._getSignature(t,e._uniformData,"u");return this._cache[r]||(this._cache[r]=this._generateUniformsSync(t,e._uniformData)),s[e._key]=this._cache[r],s[e._key]}_generateUniformsSync(t,e){return function(t,e){const s=["\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n var name = null;\n "];for(const r in t.uniforms){if(!e[r]){t.uniforms[r]instanceof d.k?t.uniforms[r].ubo?s.push(`\n renderer.shader.bindUniformBlock(uv.${r}, "${r}");\n `):s.push(`\n renderer.shader.updateUniformGroup(uv.${r});\n `):t.uniforms[r]instanceof pt.d&&s.push(`\n renderer.shader.bindBufferResource(uv.${r}, "${r}");\n `);continue}const i=t.uniformStructures[r];let n=!1;for(let t=0;t<Ct.$.length;t++){const e=Ct.$[t];if(i.type===e.type&&e.test(i)){s.push(`name = "${r}";`,Ct.$[t].uniform),n=!0;break}}if(!n){const t=(1===i.size?Pt:Et)[i.type].replace("location",`ud["${r}"].location`);s.push(`\n cu = ud["${r}"];\n cv = cu.value;\n v = uv["${r}"];\n ${t};`)}}return new Function("ud","uv","renderer","syncData",s.join("\n"))}(t,e)}_getSignature(t,e,s){const r=t.uniforms,i=[`${s}-`];for(const t in r)i.push(t),e[t]&&i.push(e[t].type);return i.join("-")}destroy(){this._renderer=null,this._cache=null}}Mt.extension={type:[r.Ag.WebGLSystem],name:"uniformGroup"};const kt=class t{constructor(t){this._invertFrontFace=!1,this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=!1,this.map=[],this.map[0]=this.setBlend,this.map[1]=this.setOffset,this.map[2]=this.setCullFace,this.map[3]=this.setDepthTest,this.map[4]=this.setFrontFace,this.map[5]=this.setDepthMask,this.checks=[],this.defaultState=y.U.for2d(),t.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(t){this._invertFrontFace=!t.isRoot,this._cullFace?this.setFrontFace(this._frontFace):this._frontFaceDirty=!0}contextChange(t){this.gl=t,this.blendModesMap=function(t){const e={};if(e.normal=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e.add=[t.ONE,t.ONE],e.multiply=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e.screen=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e.none=[0,0],e["normal-npm"]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e["add-npm"]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e["screen-npm"]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e.erase=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],t instanceof P.e.get().getWebGLRenderingContext()){const s=t.getExtension("EXT_blend_minmax");s&&(e.min=[t.ONE,t.ONE,t.ONE,t.ONE,s.MIN_EXT,s.MIN_EXT],e.max=[t.ONE,t.ONE,t.ONE,t.ONE,s.MAX_EXT,s.MAX_EXT])}else e.min=[t.ONE,t.ONE,t.ONE,t.ONE,t.MIN,t.MIN],e.max=[t.ONE,t.ONE,t.ONE,t.ONE,t.MAX,t.MAX];return e}(t),this.resetState()}set(t){if(t||(t=this.defaultState),this.stateId!==t.data){let e=this.stateId^t.data,s=0;for(;e;)1&e&&this.map[s].call(this,!!(t.data&1<<s)),e>>=1,s++;this.stateId=t.data}for(let e=0;e<this.checks.length;e++)this.checks[e](this,t)}forceState(t){t||(t=this.defaultState);for(let e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(let e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data}setBlend(e){this._updateCheck(t._checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)}setOffset(e){this._updateCheck(t._checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(t){this.gl.depthMask(t)}setCullFace(t){this._cullFace=t,this.gl[t?"enable":"disable"](this.gl.CULL_FACE),this._cullFace&&this._frontFaceDirty&&this.setFrontFace(this._frontFace)}setFrontFace(t){this._frontFace=t,this._frontFaceDirty=!1;const e=this._invertFrontFace?!t:t;this._glFrontFace!==e&&(this._glFrontFace=e,this.gl.frontFace(this.gl[e?"CW":"CCW"]))}setBlendMode(t){if(this.blendModesMap[t]||(t="normal"),t===this.blendMode)return;this.blendMode=t;const e=this.blendModesMap[t],s=this.gl;2===e.length?s.blendFunc(e[0],e[1]):s.blendFuncSeparate(e[0],e[1],e[2],e[3]),6===e.length?(this._blendEq=!0,s.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,s.blendEquationSeparate(s.FUNC_ADD,s.FUNC_ADD))}setPolygonOffset(t,e){this.gl.polygonOffset(t,e)}resetState(){this._glFrontFace=!1,this._frontFace=!1,this._cullFace=!1,this._frontFaceDirty=!1,this._invertFrontFace=!1,this.gl.frontFace(this.gl.CCW),this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode="",this.setBlendMode("normal")}_updateCheck(t,e){const s=this.checks.indexOf(t);e&&-1===s?this.checks.push(t):e||-1===s||this.checks.splice(s,1)}static _checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static _checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null,this.checks.length=0}};kt.extension={type:[r.Ag.WebGLSystem],name:"state"};let Rt=kt;class Bt{constructor(t){this.target=I.TEXTURE_2D,this.texture=t,this.width=-1,this.height=-1,this.type=F.UNSIGNED_BYTE,this.internalFormat=B.RGBA,this.format=B.RGBA,this.samplerType=0}}const It={id:"buffer",upload(t,e,s){e.width===t.width||e.height===t.height?s.texSubImage2D(s.TEXTURE_2D,0,0,0,t.width,t.height,e.format,e.type,t.resource):s.texImage2D(e.target,0,e.internalFormat,t.width,t.height,0,e.format,e.type,t.resource),e.width=t.width,e.height=t.height}},Ft={"bc1-rgba-unorm":!0,"bc1-rgba-unorm-srgb":!0,"bc2-rgba-unorm":!0,"bc2-rgba-unorm-srgb":!0,"bc3-rgba-unorm":!0,"bc3-rgba-unorm-srgb":!0,"bc4-r-unorm":!0,"bc4-r-snorm":!0,"bc5-rg-unorm":!0,"bc5-rg-snorm":!0,"bc6h-rgb-ufloat":!0,"bc6h-rgb-float":!0,"bc7-rgba-unorm":!0,"bc7-rgba-unorm-srgb":!0,"etc2-rgb8unorm":!0,"etc2-rgb8unorm-srgb":!0,"etc2-rgb8a1unorm":!0,"etc2-rgb8a1unorm-srgb":!0,"etc2-rgba8unorm":!0,"etc2-rgba8unorm-srgb":!0,"eac-r11unorm":!0,"eac-r11snorm":!0,"eac-rg11unorm":!0,"eac-rg11snorm":!0,"astc-4x4-unorm":!0,"astc-4x4-unorm-srgb":!0,"astc-5x4-unorm":!0,"astc-5x4-unorm-srgb":!0,"astc-5x5-unorm":!0,"astc-5x5-unorm-srgb":!0,"astc-6x5-unorm":!0,"astc-6x5-unorm-srgb":!0,"astc-6x6-unorm":!0,"astc-6x6-unorm-srgb":!0,"astc-8x5-unorm":!0,"astc-8x5-unorm-srgb":!0,"astc-8x6-unorm":!0,"astc-8x6-unorm-srgb":!0,"astc-8x8-unorm":!0,"astc-8x8-unorm-srgb":!0,"astc-10x5-unorm":!0,"astc-10x5-unorm-srgb":!0,"astc-10x6-unorm":!0,"astc-10x6-unorm-srgb":!0,"astc-10x8-unorm":!0,"astc-10x8-unorm-srgb":!0,"astc-10x10-unorm":!0,"astc-10x10-unorm-srgb":!0,"astc-12x10-unorm":!0,"astc-12x10-unorm-srgb":!0,"astc-12x12-unorm":!0,"astc-12x12-unorm-srgb":!0},Dt={id:"compressed",upload(t,e,s){s.pixelStorei(s.UNPACK_ALIGNMENT,4);let r=t.pixelWidth,i=t.pixelHeight;const n=!!Ft[t.format];for(let a=0;a<t.resource.length;a++){const o=t.resource[a];n?s.compressedTexImage2D(s.TEXTURE_2D,a,e.internalFormat,r,i,0,o):s.texImage2D(s.TEXTURE_2D,a,e.internalFormat,r,i,0,e.format,e.type,o),r=Math.max(r>>1,1),i=Math.max(i>>1,1)}}},Ot={id:"image",upload(t,e,s,r){const i=e.width,n=e.height,a=t.pixelWidth,o=t.pixelHeight,l=t.resourceWidth,h=t.resourceHeight;l<a||h<o?(i===a&&n===o||s.texImage2D(e.target,0,e.internalFormat,a,o,0,e.format,e.type,null),2===r?s.texSubImage2D(s.TEXTURE_2D,0,0,0,l,h,e.format,e.type,t.resource):s.texSubImage2D(s.TEXTURE_2D,0,0,0,e.format,e.type,t.resource)):i===a&&n===o?s.texSubImage2D(s.TEXTURE_2D,0,0,0,e.format,e.type,t.resource):2===r?s.texImage2D(e.target,0,e.internalFormat,a,o,0,e.format,e.type,t.resource):s.texImage2D(e.target,0,e.internalFormat,e.format,e.type,t.resource),e.width=a,e.height=o}},Gt={id:"video",upload(t,e,s,r){t.isValid?Ot.upload(t,e,s,r):s.texImage2D(e.target,0,e.internalFormat,1,1,0,e.format,e.type,null)}},Ut={linear:9729,nearest:9728},Lt={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},Nt={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},Xt={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519};function Yt(t,e,s,r,i,n,a,o){const l=n;if(!o||"repeat"!==t.addressModeU||"repeat"!==t.addressModeV||"repeat"!==t.addressModeW){const s=Nt[a?"clamp-to-edge":t.addressModeU],r=Nt[a?"clamp-to-edge":t.addressModeV],n=Nt[a?"clamp-to-edge":t.addressModeW];e[i](l,e.TEXTURE_WRAP_S,s),e[i](l,e.TEXTURE_WRAP_T,r),e.TEXTURE_WRAP_R&&e[i](l,e.TEXTURE_WRAP_R,n)}if(o&&"linear"===t.magFilter||e[i](l,e.TEXTURE_MAG_FILTER,Ut[t.magFilter]),s){if(!o||"linear"!==t.mipmapFilter){const s=Lt[t.minFilter][t.mipmapFilter];e[i](l,e.TEXTURE_MIN_FILTER,s)}}else e[i](l,e.TEXTURE_MIN_FILTER,Ut[t.minFilter]);if(r&&t.maxAnisotropy>1){const s=Math.min(t.maxAnisotropy,e.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));e[i](l,r.TEXTURE_MAX_ANISOTROPY_EXT,s)}t.compare&&e[i](l,e.TEXTURE_COMPARE_FUNC,Xt[t.compare])}class Vt{constructor(t){this.managedTextures=[],this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._uploads={image:Ot,buffer:It,video:Gt,compressed:Dt},this._premultiplyAlpha=!1,this._useSeparateSamplers=!1,this._renderer=t,this._renderer.renderableGC.addManagedHash(this,"_glTextures"),this._renderer.renderableGC.addManagedHash(this,"_glSamplers")}contextChange(t){this._gl=t,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=function(t,e){let s={},r=t.RGBA;return t instanceof P.e.get().getWebGLRenderingContext()?e.srgb&&(s={"rgba8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT}):(s={"rgba8unorm-srgb":t.SRGB8_ALPHA8,"bgra8unorm-srgb":t.SRGB8_ALPHA8},r=t.RGBA8),{r8unorm:t.R8,r8snorm:t.R8_SNORM,r8uint:t.R8UI,r8sint:t.R8I,r16uint:t.R16UI,r16sint:t.R16I,r16float:t.R16F,rg8unorm:t.RG8,rg8snorm:t.RG8_SNORM,rg8uint:t.RG8UI,rg8sint:t.RG8I,r32uint:t.R32UI,r32sint:t.R32I,r32float:t.R32F,rg16uint:t.RG16UI,rg16sint:t.RG16I,rg16float:t.RG16F,rgba8unorm:t.RGBA,...s,rgba8snorm:t.RGBA8_SNORM,rgba8uint:t.RGBA8UI,rgba8sint:t.RGBA8I,bgra8unorm:r,rgb9e5ufloat:t.RGB9_E5,rgb10a2unorm:t.RGB10_A2,rg11b10ufloat:t.R11F_G11F_B10F,rg32uint:t.RG32UI,rg32sint:t.RG32I,rg32float:t.RG32F,rgba16uint:t.RGBA16UI,rgba16sint:t.RGBA16I,rgba16float:t.RGBA16F,rgba32uint:t.RGBA32UI,rgba32sint:t.RGBA32I,rgba32float:t.RGBA32F,stencil8:t.STENCIL_INDEX8,depth16unorm:t.DEPTH_COMPONENT16,depth24plus:t.DEPTH_COMPONENT24,"depth24plus-stencil8":t.DEPTH24_STENCIL8,depth32float:t.DEPTH_COMPONENT32F,"depth32float-stencil8":t.DEPTH32F_STENCIL8,...e.s3tc?{"bc1-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{},...e.s3tc_sRGB?{"bc1-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{},...e.rgtc?{"bc4-r-unorm":e.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":e.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":e.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":e.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{},...e.bptc?{"bc6h-rgb-float":e.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":e.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":e.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":e.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{},...e.etc?{"etc2-rgb8unorm":e.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":e.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":e.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":e.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":e.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":e.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":e.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":e.etc.COMPRESSED_SIGNED_RG11_EAC}:{},...e.astc?{"astc-4x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{}}}(t,this._renderer.context.extensions),this._mapFormatToType=function(t){return{r8unorm:t.UNSIGNED_BYTE,r8snorm:t.BYTE,r8uint:t.UNSIGNED_BYTE,r8sint:t.BYTE,r16uint:t.UNSIGNED_SHORT,r16sint:t.SHORT,r16float:t.HALF_FLOAT,rg8unorm:t.UNSIGNED_BYTE,rg8snorm:t.BYTE,rg8uint:t.UNSIGNED_BYTE,rg8sint:t.BYTE,r32uint:t.UNSIGNED_INT,r32sint:t.INT,r32float:t.FLOAT,rg16uint:t.UNSIGNED_SHORT,rg16sint:t.SHORT,rg16float:t.HALF_FLOAT,rgba8unorm:t.UNSIGNED_BYTE,"rgba8unorm-srgb":t.UNSIGNED_BYTE,rgba8snorm:t.BYTE,rgba8uint:t.UNSIGNED_BYTE,rgba8sint:t.BYTE,bgra8unorm:t.UNSIGNED_BYTE,"bgra8unorm-srgb":t.UNSIGNED_BYTE,rgb9e5ufloat:t.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:t.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:t.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:t.UNSIGNED_INT,rg32sint:t.INT,rg32float:t.FLOAT,rgba16uint:t.UNSIGNED_SHORT,rgba16sint:t.SHORT,rgba16float:t.HALF_FLOAT,rgba32uint:t.UNSIGNED_INT,rgba32sint:t.INT,rgba32float:t.FLOAT,stencil8:t.UNSIGNED_BYTE,depth16unorm:t.UNSIGNED_SHORT,depth24plus:t.UNSIGNED_INT,"depth24plus-stencil8":t.UNSIGNED_INT_24_8,depth32float:t.FLOAT,"depth32float-stencil8":t.FLOAT_32_UNSIGNED_INT_24_8_REV}}(t),this._mapFormatToFormat=function(t){return{r8unorm:t.RED,r8snorm:t.RED,r8uint:t.RED,r8sint:t.RED,r16uint:t.RED,r16sint:t.RED,r16float:t.RED,rg8unorm:t.RG,rg8snorm:t.RG,rg8uint:t.RG,rg8sint:t.RG,r32uint:t.RED,r32sint:t.RED,r32float:t.RED,rg16uint:t.RG,rg16sint:t.RG,rg16float:t.RG,rgba8unorm:t.RGBA,"rgba8unorm-srgb":t.RGBA,rgba8snorm:t.RGBA,rgba8uint:t.RGBA,rgba8sint:t.RGBA,bgra8unorm:t.RGBA,"bgra8unorm-srgb":t.RGBA,rgb9e5ufloat:t.RGB,rgb10a2unorm:t.RGBA,rg11b10ufloat:t.RGB,rg32uint:t.RG,rg32sint:t.RG,rg32float:t.RG,rgba16uint:t.RGBA,rgba16sint:t.RGBA,rgba16float:t.RGBA,rgba32uint:t.RGBA,rgba32sint:t.RGBA,rgba32float:t.RGBA,stencil8:t.STENCIL_INDEX8,depth16unorm:t.DEPTH_COMPONENT,depth24plus:t.DEPTH_COMPONENT,"depth24plus-stencil8":t.DEPTH_STENCIL,depth32float:t.DEPTH_COMPONENT,"depth32float-stencil8":t.DEPTH_STENCIL}}(t)),this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null),this._premultiplyAlpha=!1;for(let t=0;t<16;t++)this.bind(m.g.EMPTY,t)}initSource(t){this.bind(t)}bind(t,e=0){const s=t.source;t?(this.bindSource(s,e),this._useSeparateSamplers&&this._bindSampler(s.style,e)):(this.bindSource(null,e),this._useSeparateSamplers&&this._bindSampler(null,e))}bindSource(t,e=0){const s=this._gl;if(t._touched=this._renderer.textureGC.count,this._boundTextures[e]!==t){this._boundTextures[e]=t,this._activateLocation(e),t||(t=m.g.EMPTY.source);const r=this.getGlSource(t);s.bindTexture(r.target,r.texture)}}_bindSampler(t,e=0){const s=this._gl;if(!t)return this._boundSamplers[e]=null,void s.bindSampler(e,null);const r=this._getGlSampler(t);this._boundSamplers[e]!==r&&(this._boundSamplers[e]=r,s.bindSampler(e,r))}unbind(t){const e=t.source,s=this._boundTextures,r=this._gl;for(let t=0;t<s.length;t++)if(s[t]===e){this._activateLocation(t);const i=this.getGlSource(e);r.bindTexture(i.target,null),s[t]=null}}_activateLocation(t){this._activeTextureLocation!==t&&(this._activeTextureLocation=t,this._gl.activeTexture(this._gl.TEXTURE0+t))}_initSource(t){const e=this._gl,s=new Bt(e.createTexture());if(s.type=this._mapFormatToType[t.format],s.internalFormat=this._mapFormatToInternalFormat[t.format],s.format=this._mapFormatToFormat[t.format],t.autoGenerateMipmaps&&(this._renderer.context.supports.nonPowOf2mipmaps||t.isPowerOfTwo)){const e=Math.max(t.width,t.height);t.mipLevelCount=Math.floor(Math.log2(e))+1}return this._glTextures[t.uid]=s,this.managedTextures.includes(t)||(t.on("update",this.onSourceUpdate,this),t.on("resize",this.onSourceUpdate,this),t.on("styleChange",this.onStyleChange,this),t.on("destroy",this.onSourceDestroy,this),t.on("unload",this.onSourceUnload,this),t.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(t)),this.onSourceUpdate(t),this.updateStyle(t,!1),s}onStyleChange(t){this.updateStyle(t,!1)}updateStyle(t,e){const s=this._gl,r=this.getGlSource(t);s.bindTexture(s.TEXTURE_2D,r.texture),this._boundTextures[this._activeTextureLocation]=t,Yt(t.style,s,t.mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",s.TEXTURE_2D,!this._renderer.context.supports.nonPowOf2wrapping&&!t.isPowerOfTwo,e)}onSourceUnload(t){const e=this._glTextures[t.uid];e&&(this.unbind(t),this._glTextures[t.uid]=null,this._gl.deleteTexture(e.texture))}onSourceUpdate(t){const e=this._gl,s=this.getGlSource(t);e.bindTexture(e.TEXTURE_2D,s.texture),this._boundTextures[this._activeTextureLocation]=t;const r="premultiply-alpha-on-upload"===t.alphaMode;this._premultiplyAlpha!==r&&(this._premultiplyAlpha=r,e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r)),this._uploads[t.uploadMethodId]?this._uploads[t.uploadMethodId].upload(t,s,e,this._renderer.context.webGLVersion):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t.pixelWidth,t.pixelHeight,0,e.RGBA,e.UNSIGNED_BYTE,null),t.autoGenerateMipmaps&&t.mipLevelCount>1&&this.onUpdateMipmaps(t,!1)}onUpdateMipmaps(t,e=!0){e&&this.bindSource(t,0);const s=this.getGlSource(t);this._gl.generateMipmap(s.target)}onSourceDestroy(t){t.off("destroy",this.onSourceDestroy,this),t.off("update",this.onSourceUpdate,this),t.off("resize",this.onSourceUpdate,this),t.off("unload",this.onSourceUnload,this),t.off("styleChange",this.onStyleChange,this),t.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(t),1),this.onSourceUnload(t)}_initSampler(t){const e=this._gl,s=this._gl.createSampler();return this._glSamplers[t._resourceId]=s,Yt(t,e,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",s,!1,!0),this._glSamplers[t._resourceId]}_getGlSampler(t){return this._glSamplers[t._resourceId]||this._initSampler(t)}getGlSource(t){return this._glTextures[t.uid]||this._initSource(t)}generateCanvas(t){const{pixels:e,width:s,height:r}=this.getPixels(t),i=P.e.get().createCanvas();i.width=s,i.height=r;const n=i.getContext("2d");if(n){const t=n.createImageData(s,r);t.data.set(e),n.putImageData(t,0,0)}return i}getPixels(t){const e=t.source.resolution,s=t.frame,r=Math.max(Math.round(s.width*e),1),i=Math.max(Math.round(s.height*e),1),n=new Uint8Array(4*r*i),a=this._renderer,o=a.renderTarget.getRenderTarget(t),l=a.renderTarget.getGpuRenderTarget(o),h=a.gl;return h.bindFramebuffer(h.FRAMEBUFFER,l.resolveTargetFramebuffer),h.readPixels(Math.round(s.x*e),Math.round(s.y*e),r,i,h.RGBA,h.UNSIGNED_BYTE,n),{pixels:new Uint8ClampedArray(n.buffer),width:r,height:i}}destroy(){this.managedTextures.slice().forEach(t=>this.onSourceDestroy(t)),this.managedTextures=null,this._glTextures=null,this._glSamplers=null,this._boundTextures=null,this._boundSamplers=null,this._mapFormatToInternalFormat=null,this._mapFormatToType=null,this._mapFormatToFormat=null,this._uploads=null,this._renderer=null}resetState(){this._activeTextureLocation=-1,this._boundTextures.fill(m.g.EMPTY.source),this._boundSamplers=Object.create(null);const t=this._gl;this._premultiplyAlpha=!1,t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._premultiplyAlpha)}}Vt.extension={type:[r.Ag.WebGLSystem],name:"texture"};const zt=[...b.i,nt,z,M,q,C,Vt,dt,U,Mt,At,H,Rt,Q,W],Wt=[...b.f],Ht=[v,x,p],jt=[],qt=[],$t=[];r.XO.handleByNamedList(r.Ag.WebGLSystem,jt),r.XO.handleByNamedList(r.Ag.WebGLPipes,qt),r.XO.handleByNamedList(r.Ag.WebGLPipesAdaptor,$t),r.XO.add(...zt,...Wt,...Ht);class Kt extends _.k{constructor(){super({name:"webgl",type:w.W.WEBGL,systems:jt,renderPipes:qt,renderPipeAdaptors:$t})}}},7761:(t,e,s)=>{"use strict";s.d(e,{dy:()=>c,es:()=>n,rF:()=>h});var r=s(2454),i=s(1886);const n=new(window.AudioContext||window.webkitAudioContext);window.addEventListener("mousedown",()=>n.resume()),window.addEventListener("touchend",()=>n.resume());let a=!document.hidden;window.addEventListener("visibilitychange",()=>a=!document.hidden);const o=function(){const t=(()=>{const t=new Map;return{persistent:!1,getItem:e=>t.has(e)?t.get(e):null,setItem:(e,s)=>{t.set(e,String(s))},removeItem:e=>{t.delete(e)}}})();if("undefined"==typeof window)return t;try{const t=window.localStorage,e="__safe_ls_probe__"+Math.random().toString(36).slice(2);return t.setItem(e,"1"),t.removeItem(e),{persistent:!0,getItem:e=>t.getItem(e),setItem:(e,s)=>t.setItem(e,s),removeItem:e=>t.removeItem(e)}}catch{return t}}();class l{src;#Dt;#x;#Ot;#Gt;#Ut;#Lt;#Nt=!1;#Xt=!1;#Yt=0;#Vt=0;#zt=0;constructor(t,e,s){this.src=t,this.#Dt=e,this.#x=s,this.play()}get volume(){return this.#Dt}set volume(t){this.#Dt=t,this.#Ut&&(this.#Ut.gain.value=Math.max(0,Math.min(1,t)))}async play(){r.F&&!a||(this.#Ot||(i.K.checkCached(this.src)?this.#Ot=i.K.getCached(this.src):(console.info(`Audio not preloaded. Loading now: ${this.src}`),this.#Ot=await i.K.load(this.src))),this.#Ot&&(this.#Nt&&this.stop(),this.#Xt||(this.#zt=0),this.#Nt=!0,this.#Xt=!1,this.#Gt||(this.#Gt=await async function(){return"suspended"===n.state&&await n.resume(),n}()),this.#Nt&&(this.#Ut||(this.#Ut=this.#Gt.createGain(),this.#Ut.gain.value=this.#Dt,this.#Ut.connect(this.#Gt.destination)),this.#Lt=this.#Gt.createBufferSource(),this.#Lt.buffer=this.#Ot,this.#Lt.loop=this.#x,this.#Lt.connect(this.#Ut),this.#Lt.start(0,this.#zt),this.#Yt=this.#Gt.currentTime,this.#Lt.onended=()=>{this.#Xt||this.#x||this.stop()})))}#Wt(){this.#Lt&&(this.#Lt.stop(),this.#Lt.disconnect(),this.#Lt=void 0)}pause(){this.#Nt&&!this.#Xt&&(this.#Gt&&(this.#Vt=this.#Gt.currentTime,this.#zt+=this.#Vt-this.#Yt),this.#Xt=!0,this.#Nt=!1,this.#Wt())}stop(){this.#Nt=!1,this.#Xt=!1,this.#zt=0,this.#Wt()}}const h=new class{#Dt=.7;#Ht;constructor(){const t=parseFloat(o.getItem("musicVolume")||"");this.#Dt=Number.isNaN(t)?this.#Dt:t,r.F&&document.addEventListener("visibilitychange",()=>{document.hidden?this.pause():(a=!0,this.#Ht?.play())})}get volume(){return this.#Dt}set volume(t){this.#Dt=t,o.setItem("musicVolume",t.toString()),this.#Ht&&(this.#Ht.volume=t)}play(t){this.#Ht?.src!==t&&(this.#Ht?.stop(),this.#Ht=new l(t,this.#Dt,!0))}pause(){this.#Ht?.pause()}stop(){this.#Ht?.stop(),this.#Ht=void 0}},c=new class{#Dt=1;constructor(){const t=parseFloat(o.getItem("sfxVolume")||"");this.#Dt=Number.isNaN(t)?this.#Dt:t}get volume(){return this.#Dt}set volume(t){this.#Dt=t,o.setItem("sfxVolume",t.toString())}play(t){new l(t,this.#Dt,!1)}playRandom(...t){this.play(t[Math.floor(Math.random()*t.length)])}}},7786:(t,e,s)=>{"use strict";s.d(e,{Q:()=>n});var r=s(1347),i=s(4382);class n extends i.o{x=0;y=0;scaleX=1;scaleY=1;rotation=0;width=0;height=0;color=new r.Q1(1,1,1,1);path;region=null;sequence=null;offset=r.Aq.newFloatArray(8);uvs=r.Aq.newFloatArray(8);tempColor=new r.Q1(1,1,1,1);constructor(t,e){super(t),this.path=e}updateRegion(){if(!this.region)throw new Error("Region not set.");let t=this.region,e=this.uvs;if(null==t)return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=1,e[5]=1,e[6]=1,void(e[7]=0);let s=this.width/this.region.originalWidth*this.scaleX,i=this.height/this.region.originalHeight*this.scaleY,n=-this.width/2*this.scaleX+this.region.offsetX*s,a=-this.height/2*this.scaleY+this.region.offsetY*i,o=n+this.region.width*s,l=a+this.region.height*i,h=this.rotation*r.cj.degRad,c=Math.cos(h),u=Math.sin(h),d=this.x,p=this.y,f=n*c+d,m=n*u,g=a*c+p,x=a*u,y=o*c+d,v=o*u,_=l*c+p,b=l*u,w=this.offset;w[0]=f-x,w[1]=g+m,w[2]=f-b,w[3]=_+m,w[4]=y-b,w[5]=_+v,w[6]=y-x,w[7]=g+v,90==t.degrees?(e[0]=t.u2,e[1]=t.v2,e[2]=t.u,e[3]=t.v2,e[4]=t.u,e[5]=t.v,e[6]=t.u2,e[7]=t.v):(e[0]=t.u,e[1]=t.v2,e[2]=t.u,e[3]=t.v,e[4]=t.u2,e[5]=t.v,e[6]=t.u2,e[7]=t.v2)}computeWorldVertices(t,e,s,r){null!=this.sequence&&this.sequence.apply(t,this);let i=t.bone,n=this.offset,a=i.worldX,o=i.worldY,l=i.a,h=i.b,c=i.c,u=i.d,d=0,p=0;d=n[0],p=n[1],e[s]=d*l+p*h+a,e[s+1]=d*c+p*u+o,s+=r,d=n[2],p=n[3],e[s]=d*l+p*h+a,e[s+1]=d*c+p*u+o,s+=r,d=n[4],p=n[5],e[s]=d*l+p*h+a,e[s+1]=d*c+p*u+o,s+=r,d=n[6],p=n[7],e[s]=d*l+p*h+a,e[s+1]=d*c+p*u+o}copy(){let t=new n(this.name,this.path);return t.region=this.region,t.x=this.x,t.y=this.y,t.scaleX=this.scaleX,t.scaleY=this.scaleY,t.rotation=this.rotation,t.width=this.width,t.height=this.height,r.Aq.arrayCopy(this.uvs,0,t.uvs,0,8),r.Aq.arrayCopy(this.offset,0,t.offset,0,8),t.color.setFromColor(this.color),t.sequence=null!=this.sequence?this.sequence.copy():null,t}static X1=0;static Y1=1;static C1R=2;static C1G=3;static C1B=4;static C1A=5;static U1=6;static V1=7;static X2=8;static Y2=9;static C2R=10;static C2G=11;static C2B=12;static C2A=13;static U2=14;static V2=15;static X3=16;static Y3=17;static C3R=18;static C3G=19;static C3B=20;static C3A=21;static U3=22;static V3=23;static X4=24;static Y4=25;static C4R=26;static C4G=27;static C4B=28;static C4A=29;static U4=30;static V4=31}},7879:(t,e,s)=>{"use strict";var r=s(592);s(9317),s(275),r.U},7882:(t,e,s)=>{"use strict";s.d(e,{o:()=>o,u:()=>a});var r=s(5199),i=s(761),n=s(6170);const a=i.Z.getPool(r.u),o=i.Z.getPool(n.c)},7898:(t,e,s)=>{"use strict";s.d(e,{o:()=>r});class r{constructor(t,e,s){this._x=e||0,this._y=s||0,this._observer=t}clone(t){return new r(t??this._observer,this._x,this._y)}set(t=0,e=t){return this._x===t&&this._y===e||(this._x=t,this._y=e,this._observer._onUpdate(this)),this}copyFrom(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}}},7903:(t,e,s)=>{"use strict";s.d(e,{D:()=>o});var r=s(9739),i=s(3880),n=s(3651),a=s(4242);class o extends a.k{constructor(...t){let e=t[0];Array.isArray(t[0])&&(e={textures:t[0],autoUpdate:t[1]});const{animationSpeed:s=1,autoPlay:i=!1,autoUpdate:n=!0,loop:a=!0,onComplete:o=null,onFrameChange:l=null,onLoop:h=null,textures:c,updateAnchor:u=!1,...d}=e,[p]=c;super({...d,texture:p instanceof r.g?p:p.texture}),this._textures=null,this._durations=null,this._autoUpdate=n,this._isConnectedToTicker=!1,this.animationSpeed=s,this.loop=a,this.updateAnchor=u,this.onComplete=o,this.onFrameChange=l,this.onLoop=h,this._currentTime=0,this._playing=!1,this._previousFrame=null,this.textures=c,i&&this.play()}stop(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(n.R.shared.remove(this.update,this),this._isConnectedToTicker=!1))}play(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(n.R.shared.add(this.update,this,i.d.HIGH),this._isConnectedToTicker=!0))}gotoAndStop(t){this.stop(),this.currentFrame=t}gotoAndPlay(t){this.currentFrame=t,this.play()}update(t){if(!this._playing)return;const e=t.deltaTime,s=this.animationSpeed*e,r=this.currentFrame;if(null!==this._durations){let t=this._currentTime%1*this._durations[this.currentFrame];for(t+=s/60*1e3;t<0;)this._currentTime--,t+=this._durations[this.currentFrame];const r=Math.sign(this.animationSpeed*e);for(this._currentTime=Math.floor(this._currentTime);t>=this._durations[this.currentFrame];)t-=this._durations[this.currentFrame]*r,this._currentTime+=r;this._currentTime+=t/this._durations[this.currentFrame]}else this._currentTime+=s;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<r||this.animationSpeed<0&&this.currentFrame>r)&&this.onLoop(),this._updateTexture())}_updateTexture(){const t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this.texture=this._textures[t],this.updateAnchor&&this.texture.defaultAnchor&&this.anchor.copyFrom(this.texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))}destroy(t=!1){if("boolean"==typeof t?t:t?.texture){const e="boolean"==typeof t?t:t?.textureSource;this._textures.forEach(t=>{this.texture!==t&&t.destroy(e)})}this._textures=[],this._durations=null,this.stop(),super.destroy(t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null}static fromFrames(t){const e=[];for(let s=0;s<t.length;++s)e.push(r.g.from(t[s]));return new o(e)}static fromImages(t){const e=[];for(let s=0;s<t.length;++s)e.push(r.g.from(t[s]));return new o(e)}get totalFrames(){return this._textures.length}get textures(){return this._textures}set textures(t){if(t[0]instanceof r.g)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(let e=0;e<t.length;e++)this._textures.push(t[e].texture),this._durations.push(t[e].time)}this._previousFrame=null,this.gotoAndStop(0),this._updateTexture()}get currentFrame(){let t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t}set currentFrame(t){if(t<0||t>this.totalFrames-1)throw new Error(`[AnimatedSprite]: Invalid frame index value ${t}, expected to be between 0 and totalFrames ${this.totalFrames}.`);const e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this._updateTexture()}get playing(){return this._playing}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(n.R.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(n.R.shared.add(this.update,this),this._isConnectedToTicker=!0))}}},7926:(t,e,s)=>{"use strict";s.d(e,{P:()=>l});var r=s(6643),i=s(5423),n=s(2288);const a={willReadFrequently:!0},o=class t{static get experimentalLetterSpacingSupported(){let e=t._experimentalLetterSpacingSupported;if(void 0===e){const s=i.e.get().getCanvasRenderingContext2D().prototype;e=t._experimentalLetterSpacingSupported="letterSpacing"in s||"textLetterSpacing"in s}return e}constructor(t,e,s,r,i,n,a,o,l){this.text=t,this.style=e,this.width=s,this.height=r,this.lines=i,this.lineWidths=n,this.lineHeight=a,this.maxLineWidth=o,this.fontProperties=l}static measureText(e=" ",s,r=t._canvas,i=s.wordWrap){const a=`${e}-${s.styleKey}-wordWrap-${i}`;if(t._measurementCache.has(a))return t._measurementCache.get(a);const o=(0,n.Z)(s),l=t.measureFont(o);0===l.fontSize&&(l.fontSize=s.fontSize,l.ascent=s.fontSize);const h=t.__context;h.font=o;const c=(i?t._wordWrap(e,s,r):e).split(/(?:\r\n|\r|\n)/),u=new Array(c.length);let d=0;for(let e=0;e<c.length;e++){const r=t._measureText(c[e],s.letterSpacing,h);u[e]=r,d=Math.max(d,r)}const p=s._stroke?.width||0;let f=d+p;s.dropShadow&&(f+=s.dropShadow.distance);const m=s.lineHeight||l.fontSize;let g=Math.max(m,l.fontSize+p)+(c.length-1)*(m+s.leading);s.dropShadow&&(g+=s.dropShadow.distance);const x=new t(e,s,f,g,c,u,m+s.leading,d,l);return t._measurementCache.set(a,x),x}static _measureText(e,s,r){let i=!1;t.experimentalLetterSpacingSupported&&(t.experimentalLetterSpacing?(r.letterSpacing=`${s}px`,r.textLetterSpacing=`${s}px`,i=!0):(r.letterSpacing="0px",r.textLetterSpacing="0px"));const n=r.measureText(e);let a=n.width;const o=-n.actualBoundingBoxLeft;let l=n.actualBoundingBoxRight-o;if(a>0)if(i)a-=s,l-=s;else{const r=(t.graphemeSegmenter(e).length-1)*s;a+=r,l+=r}return Math.max(a,l)}static _wordWrap(e,s,r=t._canvas){const i=r.getContext("2d",a);let n=0,o="",l="";const h=Object.create(null),{letterSpacing:c,whiteSpace:u}=s,d=t._collapseSpaces(u),p=t._collapseNewlines(u);let f=!d;const m=s.wordWrapWidth+c,g=t._tokenize(e);for(let e=0;e<g.length;e++){let r=g[e];if(t._isNewline(r)){if(!p){l+=t._addLine(o),f=!d,o="",n=0;continue}r=" "}if(d){const e=t.isBreakingSpace(r),s=t.isBreakingSpace(o[o.length-1]);if(e&&s)continue}const a=t._getFromCache(r,c,h,i);if(a>m)if(""!==o&&(l+=t._addLine(o),o="",n=0),t.canBreakWords(r,s.breakWords)){const e=t.wordWrapSplit(r);for(let a=0;a<e.length;a++){let u=e[a],d=u,p=1;for(;e[a+p];){const i=e[a+p];if(t.canBreakChars(d,i,r,a,s.breakWords))break;u+=i,d=i,p++}a+=p-1;const g=t._getFromCache(u,c,h,i);g+n>m&&(l+=t._addLine(o),f=!1,o="",n=0),o+=u,n+=g}}else{o.length>0&&(l+=t._addLine(o),o="",n=0);const s=e===g.length-1;l+=t._addLine(r,!s),f=!1,o="",n=0}else a+n>m&&(f=!1,l+=t._addLine(o),o="",n=0),(o.length>0||!t.isBreakingSpace(r)||f)&&(o+=r,n+=a)}return l+=t._addLine(o,!1),l}static _addLine(e,s=!0){return e=t._trimRight(e),s?`${e}\n`:e}static _getFromCache(e,s,r,i){let n=r[e];return"number"!=typeof n&&(n=t._measureText(e,s,i)+s,r[e]=n),n}static _collapseSpaces(t){return"normal"===t||"pre-line"===t}static _collapseNewlines(t){return"normal"===t}static _trimRight(e){if("string"!=typeof e)return"";for(let s=e.length-1;s>=0;s--){const r=e[s];if(!t.isBreakingSpace(r))break;e=e.slice(0,-1)}return e}static _isNewline(e){return"string"==typeof e&&t._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,s){return"string"==typeof e&&t._breakingSpaces.includes(e.charCodeAt(0))}static _tokenize(e){const s=[];let r="";if("string"!=typeof e)return s;for(let i=0;i<e.length;i++){const n=e[i],a=e[i+1];t.isBreakingSpace(n,a)||t._isNewline(n)?(""!==r&&(s.push(r),r=""),"\r"===n&&"\n"===a?(s.push("\r\n"),i++):s.push(n)):r+=n}return""!==r&&s.push(r),s}static canBreakWords(t,e){return e}static canBreakChars(t,e,s,r,i){return!0}static wordWrapSplit(e){return t.graphemeSegmenter(e)}static measureFont(e){if(t._fonts[e])return t._fonts[e];const s=t._context;s.font=e;const r=s.measureText(t.METRICS_STRING+t.BASELINE_SYMBOL),i={ascent:r.actualBoundingBoxAscent,descent:r.actualBoundingBoxDescent,fontSize:r.actualBoundingBoxAscent+r.actualBoundingBoxDescent};return t._fonts[e]=i,i}static clearMetrics(e=""){e?delete t._fonts[e]:t._fonts={}}static get _canvas(){if(!t.__canvas){let e;try{const s=new OffscreenCanvas(0,0),r=s.getContext("2d",a);if(r?.measureText)return t.__canvas=s,s;e=i.e.get().createCanvas()}catch(t){e=i.e.get().createCanvas()}e.width=e.height=10,t.__canvas=e}return t.__canvas}static get _context(){return t.__context||(t.__context=t._canvas.getContext("2d",a)),t.__context}};o.METRICS_STRING="|ÉqÅ",o.BASELINE_SYMBOL="M",o.BASELINE_MULTIPLIER=1.4,o.HEIGHT_MULTIPLIER=2,o.graphemeSegmenter=(()=>{if("function"==typeof Intl?.Segmenter){const t=new Intl.Segmenter;return e=>{const s=t.segment(e),r=[];let i=0;for(const t of s)r[i++]=t.segment;return r}}return t=>[...t]})(),o.experimentalLetterSpacing=!1,o._fonts={},o._newlines=[10,13],o._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288],o._measurementCache=(0,r.g)(1e3);let l=o},7935:(t,e,s)=>{"use strict";var r=s(2445),i=s(1065),n=s(4269),a=s(9739);const o=[];function l(t={}){const e=t&&t.resource,s=e?t.resource:t,r=e?t:{resource:t};for(let t=0;t<o.length;t++){const e=o[t];if(e.test(s))return new e(r)}throw new Error(`Could not find a source type for resource: ${r.resource}`)}i.XO.handleByList(i.Ag.TextureSource,o),a.g.from=function(t,e=!1){return"string"==typeof t?r.l.get(t):t instanceof n.v?new a.g({source:t}):function(t={},e=!1){const s=t&&t.resource,i=s?t.resource:t,n=s?t:{resource:t};if(!e&&r.l.has(i))return r.l.get(i);const o=new a.g({source:l(n)});return o.on("destroy",()=>{r.l.has(i)&&r.l.remove(i)}),e||r.l.set(i,o),o}(t,e)},n.v.from=l},7955:(t,e,s)=>{"use strict";s.d(e,{i:()=>i});var r=s(2432);class i extends r.b{#jt=0;#qt=0;#$t=1;get x(){return this.#jt}get y(){return this.#qt}get scale(){return this.#$t}setPosition(t,e){this.#jt=t,this.#qt=e,this.emit("positionChanged")}setScale(t){this.#$t=t,this.emit("scaleChanged")}}},7957:(t,e,s)=>{"use strict";s.d(e,{U:()=>i});var r=s(1347);class i{data;bones;target;mixRotate=0;mixX=0;mixY=0;mixScaleX=0;mixScaleY=0;mixShearY=0;temp=new r.I9;active=!1;constructor(t,e){if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let s=0;s<t.bones.length;s++){let r=e.findBone(t.bones[s].name);if(!r)throw new Error(`Couldn't find bone ${t.bones[s].name}.`);this.bones.push(r)}let s=e.findBone(t.target.name);if(!s)throw new Error(`Couldn't find target bone ${t.target.name}.`);this.target=s,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY}isActive(){return this.active}setToSetupPose(){const t=this.data;this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY}update(t){0==this.mixRotate&&0==this.mixX&&0==this.mixY&&0==this.mixScaleX&&0==this.mixScaleY&&0==this.mixShearY||(this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld())}applyAbsoluteWorld(){let t=this.mixRotate,e=this.mixX,s=this.mixY,i=this.mixScaleX,n=this.mixScaleY,a=this.mixShearY,o=0!=e||0!=s,l=this.target,h=l.a,c=l.b,u=l.c,d=l.d,p=h*d-c*u>0?r.cj.degRad:-r.cj.degRad,f=this.data.offsetRotation*p,m=this.data.offsetShearY*p,g=this.bones;for(let p=0,x=g.length;p<x;p++){let x=g[p];if(0!=t){let e=x.a,s=x.b,i=x.c,n=x.d,a=Math.atan2(u,h)-Math.atan2(i,e)+f;a>r.cj.PI?a-=r.cj.PI2:a<-r.cj.PI&&(a+=r.cj.PI2),a*=t;let o=Math.cos(a),l=Math.sin(a);x.a=o*e-l*i,x.b=o*s-l*n,x.c=l*e+o*i,x.d=l*s+o*n}if(o){let t=this.temp;l.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=(t.x-x.worldX)*e,x.worldY+=(t.y-x.worldY)*s}if(0!=i){let t=Math.sqrt(x.a*x.a+x.c*x.c);0!=t&&(t=(t+(Math.sqrt(h*h+u*u)-t+this.data.offsetScaleX)*i)/t),x.a*=t,x.c*=t}if(0!=n){let t=Math.sqrt(x.b*x.b+x.d*x.d);0!=t&&(t=(t+(Math.sqrt(c*c+d*d)-t+this.data.offsetScaleY)*n)/t),x.b*=t,x.d*=t}if(a>0){let t=x.b,e=x.d,s=Math.atan2(e,t),i=Math.atan2(d,c)-Math.atan2(u,h)-(s-Math.atan2(x.c,x.a));i>r.cj.PI?i-=r.cj.PI2:i<-r.cj.PI&&(i+=r.cj.PI2),i=s+(i+m)*a;let n=Math.sqrt(t*t+e*e);x.b=Math.cos(i)*n,x.d=Math.sin(i)*n}x.updateAppliedTransform()}}applyRelativeWorld(){let t=this.mixRotate,e=this.mixX,s=this.mixY,i=this.mixScaleX,n=this.mixScaleY,a=this.mixShearY,o=0!=e||0!=s,l=this.target,h=l.a,c=l.b,u=l.c,d=l.d,p=h*d-c*u>0?r.cj.degRad:-r.cj.degRad,f=this.data.offsetRotation*p,m=this.data.offsetShearY*p,g=this.bones;for(let p=0,x=g.length;p<x;p++){let x=g[p];if(0!=t){let e=x.a,s=x.b,i=x.c,n=x.d,a=Math.atan2(u,h)+f;a>r.cj.PI?a-=r.cj.PI2:a<-r.cj.PI&&(a+=r.cj.PI2),a*=t;let o=Math.cos(a),l=Math.sin(a);x.a=o*e-l*i,x.b=o*s-l*n,x.c=l*e+o*i,x.d=l*s+o*n}if(o){let t=this.temp;l.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=t.x*e,x.worldY+=t.y*s}if(0!=i){let t=(Math.sqrt(h*h+u*u)-1+this.data.offsetScaleX)*i+1;x.a*=t,x.c*=t}if(0!=n){let t=(Math.sqrt(c*c+d*d)-1+this.data.offsetScaleY)*n+1;x.b*=t,x.d*=t}if(a>0){let t=Math.atan2(d,c)-Math.atan2(u,h);t>r.cj.PI?t-=r.cj.PI2:t<-r.cj.PI&&(t+=r.cj.PI2);let e=x.b,s=x.d;t=Math.atan2(s,e)+(t-r.cj.PI/2+m)*a;let i=Math.sqrt(e*e+s*s);x.b=Math.cos(t)*i,x.d=Math.sin(t)*i}x.updateAppliedTransform()}}applyAbsoluteLocal(){let t=this.mixRotate,e=this.mixX,s=this.mixY,r=this.mixScaleX,i=this.mixScaleY,n=this.mixShearY,a=this.target,o=this.bones;for(let l=0,h=o.length;l<h;l++){let h=o[l],c=h.arotation;0!=t&&(c+=(a.arotation-c+this.data.offsetRotation)*t);let u=h.ax,d=h.ay;u+=(a.ax-u+this.data.offsetX)*e,d+=(a.ay-d+this.data.offsetY)*s;let p=h.ascaleX,f=h.ascaleY;0!=r&&0!=p&&(p=(p+(a.ascaleX-p+this.data.offsetScaleX)*r)/p),0!=i&&0!=f&&(f=(f+(a.ascaleY-f+this.data.offsetScaleY)*i)/f);let m=h.ashearY;0!=n&&(m+=(a.ashearY-m+this.data.offsetShearY)*n),h.updateWorldTransformWith(u,d,c,p,f,h.ashearX,m)}}applyRelativeLocal(){let t=this.mixRotate,e=this.mixX,s=this.mixY,r=this.mixScaleX,i=this.mixScaleY,n=this.mixShearY,a=this.target,o=this.bones;for(let l=0,h=o.length;l<h;l++){let h=o[l],c=h.arotation+(a.arotation+this.data.offsetRotation)*t,u=h.ax+(a.ax+this.data.offsetX)*e,d=h.ay+(a.ay+this.data.offsetY)*s,p=h.ascaleX*((a.ascaleX-1+this.data.offsetScaleX)*r+1),f=h.ascaleY*((a.ascaleY-1+this.data.offsetScaleY)*i+1),m=h.ashearY+(a.ashearY+this.data.offsetShearY)*n;h.updateWorldTransformWith(u,d,c,p,f,h.ashearX,m)}}}},8016:(t,e,s)=>{"use strict";s.d(e,{M:()=>i});var r=s(192);class i extends r.R{#Kt;#Qt=0;#Zt;constructor(t,e){super(),this.#Kt=t,this.#Zt=e}update(t){super.update(t),this.#Qt+=t,this.#Qt>=this.#Kt&&(this.#Zt(),this.remove())}}},8034:(t,e,s)=>{"use strict";s.d(e,{AQ:()=>a.A,EA:()=>a.E,I9:()=>g.I9,K$:()=>x.K,Lw:()=>m.Lw,MR:()=>d.M,Nx:()=>p.N,O$:()=>f.O$,Q1:()=>g.Q1,Qb:()=>v.Q,Qq:()=>i.Q,VT:()=>l.V,Ym:()=>c.Y,bC:()=>g.bC,fj:()=>y.f,gP:()=>f.gP,mI:()=>u.m,oA:()=>r.oA,qd:()=>n.q,qy:()=>h.q,t7:()=>o.t,w3:()=>f.w3}),s(1984);var r=s(4419),i=s(3643),n=s(6147),a=(s(2866),s(946),s(1274),s(528),s(2155),s(6184),s(3648),s(9107)),o=s(8058),l=s(8894),h=s(9133),c=s(6571),u=s(6297),d=s(5229),p=(s(6068),s(9212)),f=s(2101),m=s(5242),g=(s(7957),s(7285),s(2414),s(1347)),x=(s(2806),s(4382),s(5331),s(6552)),y=s(7399),v=(s(6861),s(9064),s(7786))},8058:(t,e,s)=>{"use strict";s.d(e,{t:()=>x});var r,i=s(1984),n=s(646),a=s(946),o=s(3450),l=s(826),h=s(2155),c=s(3648),u=s(5556),d=s(6571),p=s(5229),f=s(9212),m=s(7285),g=s(1347);class x{scale=1;attachmentLoader;linkedMeshes=new Array;constructor(t){this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,s=new d.Y;s.name="";let r=new y(t),i=r.readInt32(),n=r.readInt32();s.hash=0==n&&0==i?null:n.toString(16)+i.toString(16),s.version=r.readString(),s.x=r.readFloat(),s.y=r.readFloat(),s.width=r.readFloat(),s.height=r.readFloat(),s.referenceScale=r.readFloat()*e;let o=r.readBoolean();o&&(s.fps=r.readFloat(),s.imagesPath=r.readString(),s.audioPath=r.readString());let p=0;p=r.readInt(!0);for(let t=0;t<p;t++){let t=r.readString();if(!t)throw new Error("String in string table must not be null.");r.strings.push(t)}p=r.readInt(!0);for(let t=0;t<p;t++){let i=r.readString();if(!i)throw new Error("Bone name must not be null.");let n=0==t?null:s.bones[r.readInt(!0)],l=new a.h(t,i,n);l.rotation=r.readFloat(),l.x=r.readFloat()*e,l.y=r.readFloat()*e,l.scaleX=r.readFloat(),l.scaleY=r.readFloat(),l.shearX=r.readFloat(),l.shearY=r.readFloat(),l.length=r.readFloat()*e,l.inherit=r.readByte(),l.skinRequired=r.readBoolean(),o&&(g.Q1.rgba8888ToColor(l.color,r.readInt32()),l.icon=r.readString()??void 0,l.visible=r.readBoolean()),s.bones.push(l)}p=r.readInt(!0);for(let t=0;t<p;t++){let e=r.readString();if(!e)throw new Error("Slot name must not be null.");let i=s.bones[r.readInt(!0)],n=new f.P(t,e,i);g.Q1.rgba8888ToColor(n.color,r.readInt32());let a=r.readInt32();-1!=a&&g.Q1.rgb888ToColor(n.darkColor=new g.Q1,a),n.attachmentName=r.readStringRef(),n.blendMode=r.readInt(!0),o&&(n.visible=r.readBoolean()),s.slots.push(n)}p=r.readInt(!0);for(let t,i=0;i<p;i++){let i=r.readString();if(!i)throw new Error("IK constraint data name must not be null.");let n=new h.Q(i);n.order=r.readInt(!0),t=r.readInt(!0);for(let e=0;e<t;e++)n.bones.push(s.bones[r.readInt(!0)]);n.target=s.bones[r.readInt(!0)];let a=r.readByte();n.skinRequired=!!(1&a),n.bendDirection=2&a?1:-1,n.compress=!!(4&a),n.stretch=!!(8&a),n.uniform=!!(16&a),32&a&&(n.mix=64&a?r.readFloat():1),128&a&&(n.softness=r.readFloat()*e),s.ikConstraints.push(n)}p=r.readInt(!0);for(let t,i=0;i<p;i++){let i=r.readString();if(!i)throw new Error("Transform constraint data name must not be null.");let n=new m._(i);n.order=r.readInt(!0),t=r.readInt(!0);for(let e=0;e<t;e++)n.bones.push(s.bones[r.readInt(!0)]);n.target=s.bones[r.readInt(!0)];let a=r.readByte();n.skinRequired=!!(1&a),n.local=!!(2&a),n.relative=!!(4&a),8&a&&(n.offsetRotation=r.readFloat()),16&a&&(n.offsetX=r.readFloat()*e),32&a&&(n.offsetY=r.readFloat()*e),64&a&&(n.offsetScaleX=r.readFloat()),128&a&&(n.offsetScaleY=r.readFloat()),a=r.readByte(),1&a&&(n.offsetShearY=r.readFloat()),2&a&&(n.mixRotate=r.readFloat()),4&a&&(n.mixX=r.readFloat()),8&a&&(n.mixY=r.readFloat()),16&a&&(n.mixScaleX=r.readFloat()),32&a&&(n.mixScaleY=r.readFloat()),64&a&&(n.mixShearY=r.readFloat()),s.transformConstraints.push(n)}p=r.readInt(!0);for(let t,i=0;i<p;i++){let i=r.readString();if(!i)throw new Error("Path constraint data name must not be null.");let n=new c.rX(i);n.order=r.readInt(!0),n.skinRequired=r.readBoolean(),t=r.readInt(!0);for(let e=0;e<t;e++)n.bones.push(s.bones[r.readInt(!0)]);n.target=s.slots[r.readInt(!0)];const a=r.readByte();n.positionMode=1&a,n.spacingMode=a>>1&3,n.rotateMode=a>>3&3,128&a&&(n.offsetRotation=r.readFloat()),n.position=r.readFloat(),n.positionMode==c.pw.Fixed&&(n.position*=e),n.spacing=r.readFloat(),n.spacingMode!=c.r9.Length&&n.spacingMode!=c.r9.Fixed||(n.spacing*=e),n.mixRotate=r.readFloat(),n.mixX=r.readFloat(),n.mixY=r.readFloat(),s.pathConstraints.push(n)}p=r.readInt(!0);for(let t=0;t<p;t++){const t=r.readString();if(!t)throw new Error("Physics constraint data name must not be null.");const i=new u.P(t);i.order=r.readInt(!0),i.bone=s.bones[r.readInt(!0)];let n=r.readByte();i.skinRequired=!!(1&n),2&n&&(i.x=r.readFloat()),4&n&&(i.y=r.readFloat()),8&n&&(i.rotate=r.readFloat()),16&n&&(i.scaleX=r.readFloat()),32&n&&(i.shearX=r.readFloat()),i.limit=(64&n?r.readFloat():5e3)*e,i.step=1/r.readUnsignedByte(),i.inertia=r.readFloat(),i.strength=r.readFloat(),i.damping=r.readFloat(),i.massInverse=128&n?r.readFloat():1,i.wind=r.readFloat(),i.gravity=r.readFloat(),n=r.readByte(),1&n&&(i.inertiaGlobal=!0),2&n&&(i.strengthGlobal=!0),4&n&&(i.dampingGlobal=!0),8&n&&(i.massGlobal=!0),16&n&&(i.windGlobal=!0),32&n&&(i.gravityGlobal=!0),64&n&&(i.mixGlobal=!0),i.mix=128&n?r.readFloat():1,s.physicsConstraints.push(i)}let x=this.readSkin(r,s,!0,o);x&&(s.defaultSkin=x,s.skins.push(x));{let t=s.skins.length;for(g.Aq.setArraySize(s.skins,p=t+r.readInt(!0));t<p;t++){let e=this.readSkin(r,s,!1,o);if(!e)throw new Error("readSkin() should not have returned null.");s.skins[t]=e}}p=this.linkedMeshes.length;for(let t=0;t<p;t++){let e=this.linkedMeshes[t];const r=s.skins[e.skinIndex];if(!e.parent)throw new Error("Linked mesh parent must not be null");let i=r.getAttachment(e.slotIndex,e.parent);if(!i)throw new Error(`Parent mesh not found: ${e.parent}`);e.mesh.timelineAttachment=e.inheritTimeline?i:e.mesh,e.mesh.setParentMesh(i),null!=e.mesh.region&&e.mesh.updateRegion()}this.linkedMeshes.length=0,p=r.readInt(!0);for(let t=0;t<p;t++){let t=r.readString();if(!t)throw new Error("Event data name must not be null");let e=new l.R(t);e.intValue=r.readInt(!1),e.floatValue=r.readFloat(),e.stringValue=r.readString(),e.audioPath=r.readString(),e.audioPath&&(e.volume=r.readFloat(),e.balance=r.readFloat()),s.events.push(e)}p=r.readInt(!0);for(let t=0;t<p;t++){let t=r.readString();if(!t)throw new Error("Animatio name must not be null.");s.animations.push(this.readAnimation(r,t,s))}return s}readSkin(t,e,s,r){let i=null,n=0;if(s){if(n=t.readInt(!0),0==n)return null;i=new p.M("default")}else{let s=t.readString();if(!s)throw new Error("Skin name must not be null.");i=new p.M(s),r&&g.Q1.rgba8888ToColor(i.color,t.readInt32()),i.bones.length=t.readInt(!0);for(let s=0,r=i.bones.length;s<r;s++)i.bones[s]=e.bones[t.readInt(!0)];for(let s=0,r=t.readInt(!0);s<r;s++)i.constraints.push(e.ikConstraints[t.readInt(!0)]);for(let s=0,r=t.readInt(!0);s<r;s++)i.constraints.push(e.transformConstraints[t.readInt(!0)]);for(let s=0,r=t.readInt(!0);s<r;s++)i.constraints.push(e.pathConstraints[t.readInt(!0)]);for(let s=0,r=t.readInt(!0);s<r;s++)i.constraints.push(e.physicsConstraints[t.readInt(!0)]);n=t.readInt(!0)}for(let s=0;s<n;s++){let s=t.readInt(!0);for(let n=0,a=t.readInt(!0);n<a;n++){let n=t.readStringRef();if(!n)throw new Error("Attachment name must not be null");let a=this.readAttachment(t,e,i,s,n,r);a&&i.setAttachment(s,n,a)}}return i}readAttachment(t,e,s,i,n,a){let o=this.scale,l=t.readByte();const h=8&l?t.readStringRef():n;if(!h)throw new Error("Attachment name must not be null");switch(7&l){case r.Region:{let e=16&l?t.readStringRef():null;const r=32&l?t.readInt32():4294967295,i=64&l?this.readSequence(t):null;let n=128&l?t.readFloat():0,a=t.readFloat(),c=t.readFloat(),u=t.readFloat(),d=t.readFloat(),p=t.readFloat(),f=t.readFloat();e||(e=h);let m=this.attachmentLoader.newRegionAttachment(s,h,e,i);return m?(m.path=e,m.x=a*o,m.y=c*o,m.scaleX=u,m.scaleY=d,m.rotation=n,m.width=p*o,m.height=f*o,g.Q1.rgba8888ToColor(m.color,r),m.sequence=i,null==i&&m.updateRegion(),m):null}case r.BoundingBox:{let e=this.readVertices(t,!!(16&l)),r=a?t.readInt32():0,i=this.attachmentLoader.newBoundingBoxAttachment(s,h);return i?(i.worldVerticesLength=e.length,i.vertices=e.vertices,i.bones=e.bones,a&&g.Q1.rgba8888ToColor(i.color,r),i):null}case r.Mesh:{let e=16&l?t.readStringRef():h;const r=32&l?t.readInt32():4294967295,i=64&l?this.readSequence(t):null,n=t.readInt(!0),c=this.readVertices(t,!!(128&l)),u=this.readFloatArray(t,c.length,1),d=this.readShortArray(t,3*(c.length-n-2));let p=[],f=0,m=0;a&&(p=this.readShortArray(t,t.readInt(!0)),f=t.readFloat(),m=t.readFloat()),e||(e=h);let x=this.attachmentLoader.newMeshAttachment(s,h,e,i);return x?(x.path=e,g.Q1.rgba8888ToColor(x.color,r),x.bones=c.bones,x.vertices=c.vertices,x.worldVerticesLength=c.length,x.triangles=d,x.regionUVs=u,null==i&&x.updateRegion(),x.hullLength=n<<1,x.sequence=i,a&&(x.edges=p,x.width=f*o,x.height=m*o),x):null}case r.LinkedMesh:{const e=16&l?t.readStringRef():h;if(null==e)throw new Error("Path of linked mesh must not be null");const r=32&l?t.readInt32():4294967295,n=64&l?this.readSequence(t):null,c=!!(128&l),u=t.readInt(!0),d=t.readStringRef();let p=0,f=0;a&&(p=t.readFloat(),f=t.readFloat());let m=this.attachmentLoader.newMeshAttachment(s,h,e,n);return m?(m.path=e,g.Q1.rgba8888ToColor(m.color,r),m.sequence=n,a&&(m.width=p*o,m.height=f*o),this.linkedMeshes.push(new v(m,u,i,d,c)),m):null}case r.Path:{const e=!!(16&l),r=!!(32&l),i=this.readVertices(t,!!(64&l)),n=g.Aq.newArray(i.length/6,0);for(let e=0,s=n.length;e<s;e++)n[e]=t.readFloat()*o;const c=a?t.readInt32():0,u=this.attachmentLoader.newPathAttachment(s,h);return u?(u.closed=e,u.constantSpeed=r,u.worldVerticesLength=i.length,u.vertices=i.vertices,u.bones=i.bones,u.lengths=n,a&&g.Q1.rgba8888ToColor(u.color,c),u):null}case r.Point:{const e=t.readFloat(),r=t.readFloat(),i=t.readFloat(),n=a?t.readInt32():0,l=this.attachmentLoader.newPointAttachment(s,h);return l?(l.x=r*o,l.y=i*o,l.rotation=e,a&&g.Q1.rgba8888ToColor(l.color,n),l):null}case r.Clipping:{const r=t.readInt(!0),i=this.readVertices(t,!!(16&l));let n=a?t.readInt32():0,o=this.attachmentLoader.newClippingAttachment(s,h);return o?(o.endSlot=e.slots[r],o.worldVerticesLength=i.length,o.vertices=i.vertices,o.bones=i.bones,a&&g.Q1.rgba8888ToColor(o.color,n),o):null}}return null}readSequence(t){let e=new n.gd(t.readInt(!0));return e.start=t.readInt(!0),e.digits=t.readInt(!0),e.setupIndex=t.readInt(!0),e}readVertices(t,e){const s=this.scale,r=t.readInt(!0),i=new _;if(i.length=r<<1,!e)return i.vertices=this.readFloatArray(t,i.length,s),i;let n=new Array,a=new Array;for(let e=0;e<r;e++){let e=t.readInt(!0);a.push(e);for(let r=0;r<e;r++)a.push(t.readInt(!0)),n.push(t.readFloat()*s),n.push(t.readFloat()*s),n.push(t.readFloat())}return i.vertices=g.Aq.toFloatArray(n),i.bones=a,i}readFloatArray(t,e,s){let r=new Array(e);if(1==s)for(let s=0;s<e;s++)r[s]=t.readFloat();else for(let i=0;i<e;i++)r[i]=t.readFloat()*s;return r}readShortArray(t,e){let s=new Array(e);for(let r=0;r<e;r++)s[r]=t.readInt(!0);return s}readAnimation(t,e,s){t.readInt(!0);let r=new Array,a=this.scale;for(let e=0,s=t.readInt(!0);e<s;e++){let e=t.readInt(!0);for(let s=0,n=t.readInt(!0);s<n;s++){let s=t.readByte(),n=t.readInt(!0),a=n-1;switch(s){case D:{let s=new i.zK(n,e);for(let e=0;e<n;e++)s.setFrame(e,t.readFloat(),t.readStringRef());r.push(s);break}case O:{let s=t.readInt(!0),o=new i.EP(n,s,e),l=t.readFloat(),h=t.readUnsignedByte()/255,c=t.readUnsignedByte()/255,u=t.readUnsignedByte()/255,d=t.readUnsignedByte()/255;for(let e=0,s=0;o.setFrame(e,l,h,c,u,d),e!=a;e++){let r=t.readFloat(),i=t.readUnsignedByte()/255,n=t.readUnsignedByte()/255,a=t.readUnsignedByte()/255,p=t.readUnsignedByte()/255;switch(t.readByte()){case tt:o.setStepped(e);break;case et:T(t,o,s++,e,0,l,r,h,i,1),T(t,o,s++,e,1,l,r,c,n,1),T(t,o,s++,e,2,l,r,u,a,1),T(t,o,s++,e,3,l,r,d,p,1)}l=r,h=i,c=n,u=a,d=p}r.push(o);break}case G:{let s=t.readInt(!0),o=new i.Di(n,s,e),l=t.readFloat(),h=t.readUnsignedByte()/255,c=t.readUnsignedByte()/255,u=t.readUnsignedByte()/255;for(let e=0,s=0;o.setFrame(e,l,h,c,u),e!=a;e++){let r=t.readFloat(),i=t.readUnsignedByte()/255,n=t.readUnsignedByte()/255,a=t.readUnsignedByte()/255;switch(t.readByte()){case tt:o.setStepped(e);break;case et:T(t,o,s++,e,0,l,r,h,i,1),T(t,o,s++,e,1,l,r,c,n,1),T(t,o,s++,e,2,l,r,u,a,1)}l=r,h=i,c=n,u=a}r.push(o);break}case U:{let s=t.readInt(!0),o=new i.Ev(n,s,e),l=t.readFloat(),h=t.readUnsignedByte()/255,c=t.readUnsignedByte()/255,u=t.readUnsignedByte()/255,d=t.readUnsignedByte()/255,p=t.readUnsignedByte()/255,f=t.readUnsignedByte()/255,m=t.readUnsignedByte()/255;for(let e=0,s=0;o.setFrame(e,l,h,c,u,d,p,f,m),e!=a;e++){let r=t.readFloat(),i=t.readUnsignedByte()/255,n=t.readUnsignedByte()/255,a=t.readUnsignedByte()/255,g=t.readUnsignedByte()/255,x=t.readUnsignedByte()/255,y=t.readUnsignedByte()/255,v=t.readUnsignedByte()/255;switch(t.readByte()){case tt:o.setStepped(e);break;case et:T(t,o,s++,e,0,l,r,h,i,1),T(t,o,s++,e,1,l,r,c,n,1),T(t,o,s++,e,2,l,r,u,a,1),T(t,o,s++,e,3,l,r,d,g,1),T(t,o,s++,e,4,l,r,p,x,1),T(t,o,s++,e,5,l,r,f,y,1),T(t,o,s++,e,6,l,r,m,v,1)}l=r,h=i,c=n,u=a,d=g,p=x,f=y,m=v}r.push(o);break}case L:{let s=t.readInt(!0),o=new i.fT(n,s,e),l=t.readFloat(),h=t.readUnsignedByte()/255,c=t.readUnsignedByte()/255,u=t.readUnsignedByte()/255,d=t.readUnsignedByte()/255,p=t.readUnsignedByte()/255,f=t.readUnsignedByte()/255;for(let e=0,s=0;o.setFrame(e,l,h,c,u,d,p,f),e!=a;e++){let r=t.readFloat(),i=t.readUnsignedByte()/255,n=t.readUnsignedByte()/255,a=t.readUnsignedByte()/255,m=t.readUnsignedByte()/255,g=t.readUnsignedByte()/255,x=t.readUnsignedByte()/255;switch(t.readByte()){case tt:o.setStepped(e);break;case et:T(t,o,s++,e,0,l,r,h,i,1),T(t,o,s++,e,1,l,r,c,n,1),T(t,o,s++,e,2,l,r,u,a,1),T(t,o,s++,e,3,l,r,d,m,1),T(t,o,s++,e,4,l,r,p,g,1),T(t,o,s++,e,5,l,r,f,x,1)}l=r,h=i,c=n,u=a,d=m,p=g,f=x}r.push(o);break}case N:{let s=new i._Y(n,t.readInt(!0),e),o=t.readFloat(),l=t.readUnsignedByte()/255;for(let e=0,r=0;s.setFrame(e,o,l),e!=a;e++){let i=t.readFloat(),n=t.readUnsignedByte()/255;switch(t.readByte()){case tt:s.setStepped(e);break;case et:T(t,s,r++,e,0,o,i,l,n,1)}o=i,l=n}r.push(s)}}}}for(let e=0,s=t.readInt(!0);e<s;e++){let e=t.readInt(!0);for(let s=0,n=t.readInt(!0);s<n;s++){let s=t.readByte(),n=t.readInt(!0);if(s==F){let s=new i.hd(n,e);for(let e=0;e<n;e++)s.setFrame(e,t.readFloat(),t.readByte());r.push(s);continue}let o=t.readInt(!0);switch(s){case S:r.push(b(t,new i.NQ(n,o,e),1));break;case A:r.push(w(t,new i.Sr(n,o,e),a));break;case C:r.push(b(t,new i.GU(n,o,e),a));break;case P:r.push(b(t,new i.nS(n,o,e),a));break;case E:r.push(w(t,new i.i9(n,o,e),1));break;case M:r.push(b(t,new i.So(n,o,e),1));break;case k:r.push(b(t,new i.pR(n,o,e),1));break;case R:r.push(w(t,new i.$l(n,o,e),1));break;case B:r.push(b(t,new i.jx(n,o,e),1));break;case I:r.push(b(t,new i.eP(n,o,e),1))}}}for(let e=0,s=t.readInt(!0);e<s;e++){let e=t.readInt(!0),s=t.readInt(!0),n=s-1,o=new i.pA(s,t.readInt(!0),e),l=t.readByte(),h=t.readFloat(),c=1&l?2&l?t.readFloat():1:0,u=4&l?t.readFloat()*a:0;for(let e=0,s=0;o.setFrame(e,h,c,u,8&l?1:-1,!!(16&l),!!(32&l)),e!=n;e++){l=t.readByte();const r=t.readFloat(),i=1&l?2&l?t.readFloat():1:0,n=4&l?t.readFloat()*a:0;64&l?o.setStepped(e):128&l&&(T(t,o,s++,e,0,h,r,c,i,1),T(t,o,s++,e,1,h,r,u,n,a)),h=r,c=i,u=n}r.push(o)}for(let e=0,s=t.readInt(!0);e<s;e++){let e=t.readInt(!0),s=t.readInt(!0),n=s-1,a=new i.To(s,t.readInt(!0),e),o=t.readFloat(),l=t.readFloat(),h=t.readFloat(),c=t.readFloat(),u=t.readFloat(),d=t.readFloat(),p=t.readFloat();for(let e=0,s=0;a.setFrame(e,o,l,h,c,u,d,p),e!=n;e++){let r=t.readFloat(),i=t.readFloat(),n=t.readFloat(),f=t.readFloat(),m=t.readFloat(),g=t.readFloat(),x=t.readFloat();switch(t.readByte()){case tt:a.setStepped(e);break;case et:T(t,a,s++,e,0,o,r,l,i,1),T(t,a,s++,e,1,o,r,h,n,1),T(t,a,s++,e,2,o,r,c,f,1),T(t,a,s++,e,3,o,r,u,m,1),T(t,a,s++,e,4,o,r,d,g,1),T(t,a,s++,e,5,o,r,p,x,1)}o=r,l=i,h=n,c=f,u=m,d=g,p=x}r.push(a)}for(let e=0,n=t.readInt(!0);e<n;e++){let e=t.readInt(!0),n=s.pathConstraints[e];for(let s=0,o=t.readInt(!0);s<o;s++){const s=t.readByte(),o=t.readInt(!0),l=t.readInt(!0);switch(s){case V:r.push(b(t,new i.vz(o,l,e),n.positionMode==c.pw.Fixed?a:1));break;case z:r.push(b(t,new i.vl(o,l,e),n.spacingMode==c.r9.Length||n.spacingMode==c.r9.Fixed?a:1));break;case W:let s=new i.I6(o,l,e),h=t.readFloat(),u=t.readFloat(),d=t.readFloat(),p=t.readFloat();for(let e=0,r=0,i=s.getFrameCount()-1;s.setFrame(e,h,u,d,p),e!=i;e++){let i=t.readFloat(),n=t.readFloat(),a=t.readFloat(),o=t.readFloat();switch(t.readByte()){case tt:s.setStepped(e);break;case et:T(t,s,r++,e,0,h,i,u,n,1),T(t,s,r++,e,1,h,i,d,a,1),T(t,s,r++,e,2,h,i,p,o,1)}h=i,u=n,d=a,p=o}r.push(s)}}}for(let e=0,s=t.readInt(!0);e<s;e++){const e=t.readInt(!0)-1;for(let s=0,n=t.readInt(!0);s<n;s++){const s=t.readByte(),n=t.readInt(!0);if(s==J){const s=new i.lJ(n,e);for(let e=0;e<n;e++)s.setFrame(e,t.readFloat());r.push(s);continue}const a=t.readInt(!0);switch(s){case H:r.push(b(t,new i.oc(n,a,e),1));break;case j:r.push(b(t,new i.$4(n,a,e),1));break;case q:r.push(b(t,new i.yz(n,a,e),1));break;case $:r.push(b(t,new i.Ms(n,a,e),1));break;case K:r.push(b(t,new i.UJ(n,a,e),1));break;case Q:r.push(b(t,new i.g(n,a,e),1));break;case Z:r.push(b(t,new i.yJ(n,a,e),1))}}}for(let e=0,o=t.readInt(!0);e<o;e++){let e=s.skins[t.readInt(!0)];for(let s=0,o=t.readInt(!0);s<o;s++){let s=t.readInt(!0);for(let o=0,l=t.readInt(!0);o<l;o++){let o=t.readStringRef();if(!o)throw new Error("attachmentName must not be null.");let l=e.getAttachment(s,o),h=t.readByte(),c=t.readInt(!0),u=c-1;switch(h){case X:{let e=l,n=e.bones,o=e.vertices,h=n?o.length/3*2:o.length,d=t.readInt(!0),p=new i.jQ(c,d,s,e),f=t.readFloat();for(let e=0,s=0;;e++){let r,i=t.readInt(!0);if(0==i)r=n?g.Aq.newFloatArray(h):o;else{r=g.Aq.newFloatArray(h);let e=t.readInt(!0);if(i+=e,1==a)for(let s=e;s<i;s++)r[s]=t.readFloat();else for(let s=e;s<i;s++)r[s]=t.readFloat()*a;if(!n)for(let t=0,e=r.length;t<e;t++)r[t]+=o[t]}if(p.setFrame(e,f,r),e==u)break;let l=t.readFloat();switch(t.readByte()){case tt:p.setStepped(e);break;case et:T(t,p,s++,e,0,f,l,0,1,1)}f=l}r.push(p);break}case Y:{let e=new i.lP(c,s,l);for(let s=0;s<c;s++){let r=t.readFloat(),i=t.readInt32();e.setFrame(s,r,n.l8[15&i],i>>4,t.readFloat())}r.push(e);break}}}}}let l=t.readInt(!0);if(l>0){let e=new i.Kn(l),n=s.slots.length;for(let s=0;s<l;s++){let r=t.readFloat(),i=t.readInt(!0),a=g.Aq.newArray(n,0);for(let t=n-1;t>=0;t--)a[t]=-1;let o=g.Aq.newArray(n-i,0),l=0,h=0;for(let e=0;e<i;e++){let e=t.readInt(!0);for(;l!=e;)o[h++]=l++;a[l+t.readInt(!0)]=l++}for(;l<n;)o[h++]=l++;for(let t=n-1;t>=0;t--)-1==a[t]&&(a[t]=o[--h]);e.setFrame(s,r,a)}r.push(e)}let h=t.readInt(!0);if(h>0){let e=new i.qs(h);for(let r=0;r<h;r++){let i=t.readFloat(),n=s.events[t.readInt(!0)],a=new o.J(i,n);a.intValue=t.readInt(!1),a.floatValue=t.readFloat(),a.stringValue=t.readString(),null==a.stringValue&&(a.stringValue=n.stringValue),a.data.audioPath&&(a.volume=t.readFloat(),a.balance=t.readFloat()),e.setFrame(r,a)}r.push(e)}let u=0;for(let t=0,e=r.length;t<e;t++)u=Math.max(u,r[t].getDuration());return new i.X5(e,r,u)}}class y{strings;index;buffer;constructor(t,e=new Array,s=0,r=new DataView(t instanceof ArrayBuffer?t:t.buffer)){this.strings=e,this.index=s,this.buffer=r}readByte(){return this.buffer.getInt8(this.index++)}readUnsignedByte(){return this.buffer.getUint8(this.index++)}readShort(){let t=this.buffer.getInt16(this.index);return this.index+=2,t}readInt32(){let t=this.buffer.getInt32(this.index);return this.index+=4,t}readInt(t){let e=this.readByte(),s=127&e;return 128&e&&(e=this.readByte(),s|=(127&e)<<7,128&e&&(e=this.readByte(),s|=(127&e)<<14,128&e&&(e=this.readByte(),s|=(127&e)<<21,128&e&&(e=this.readByte(),s|=(127&e)<<28)))),t?s:s>>>1^-(1&s)}readStringRef(){let t=this.readInt(!0);return 0==t?null:this.strings[t-1]}readString(){let t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;let e="";for(let s=0;s<t;){let t=this.readUnsignedByte();switch(t>>4){case 12:case 13:e+=String.fromCharCode((31&t)<<6|63&this.readByte()),s+=2;break;case 14:e+=String.fromCharCode((15&t)<<12|(63&this.readByte())<<6|63&this.readByte()),s+=3;break;default:e+=String.fromCharCode(t),s++}}return e}readFloat(){let t=this.buffer.getFloat32(this.index);return this.index+=4,t}readBoolean(){return 0!=this.readByte()}}class v{parent;skinIndex;slotIndex;mesh;inheritTimeline;constructor(t,e,s,r,i){this.mesh=t,this.skinIndex=e,this.slotIndex=s,this.parent=r,this.inheritTimeline=i}}class _{bones;vertices;length;constructor(t=null,e=null,s=0){this.bones=t,this.vertices=e,this.length=s}}function b(t,e,s){let r=t.readFloat(),i=t.readFloat()*s;for(let n=0,a=0,o=e.getFrameCount()-1;e.setFrame(n,r,i),n!=o;n++){let o=t.readFloat(),l=t.readFloat()*s;switch(t.readByte()){case tt:e.setStepped(n);break;case et:T(t,e,a++,n,0,r,o,i,l,s)}r=o,i=l}return e}function w(t,e,s){let r=t.readFloat(),i=t.readFloat()*s,n=t.readFloat()*s;for(let a=0,o=0,l=e.getFrameCount()-1;e.setFrame(a,r,i,n),a!=l;a++){let l=t.readFloat(),h=t.readFloat()*s,c=t.readFloat()*s;switch(t.readByte()){case tt:e.setStepped(a);break;case et:T(t,e,o++,a,0,r,l,i,h,s),T(t,e,o++,a,1,r,l,n,c,s)}r=l,i=h,n=c}return e}function T(t,e,s,r,i,n,a,o,l,h){e.setBezier(s,r,i,n,o,t.readFloat(),t.readFloat()*h,t.readFloat(),t.readFloat()*h,a,l)}!function(t){t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping"}(r||(r={}));const S=0,A=1,C=2,P=3,E=4,M=5,k=6,R=7,B=8,I=9,F=10,D=0,O=1,G=2,U=3,L=4,N=5,X=0,Y=1,V=0,z=1,W=2,H=0,j=1,q=2,$=4,K=5,Q=6,Z=7,J=8,tt=1,et=2},8064:(t,e,s)=>{"use strict";s.d(e,{z:()=>r});const r=(t,e,s=!1)=>(Array.isArray(t)||(t=[t]),e?t.map(t=>"string"==typeof t||s?e(t):t):t)},8099:(t,e,s)=>{"use strict";var r=s(1886),i=s(2619);s(9317).l,r.K,i.n},8122:(t,e,s)=>{"use strict";var r=s(1065);class i{constructor(t){this._renderer=t}push(t,e,s){this._renderer.renderPipes.batch.break(s),s.add({renderPipeId:"filter",canBundle:!1,action:"pushFilter",container:e,filterEffect:t})}pop(t,e,s){this._renderer.renderPipes.batch.break(s),s.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}execute(t){"pushFilter"===t.action?this._renderer.filter.push(t):"popFilter"===t.action&&this._renderer.filter.pop()}destroy(){this._renderer=null}}i.extension={type:[r.Ag.WebGLPipes,r.Ag.WebGPUPipes,r.Ag.CanvasPipes],name:"filter"};var n=s(5199),a=s(3655),o=s(8337),l=s(4449),h=s(9739),c=s(8851),u=s(5153),d=s(6170);const p=new n.u;var f=s(7694);const m=new o.V({attributes:{aPosition:{buffer:new Float32Array([0,0,1,0,1,1,0,1]),format:"float32x2",stride:8,offset:0}},indexBuffer:new Uint32Array([0,1,2,0,2,3])});class g{constructor(){this.skip=!1,this.inputTexture=null,this.backTexture=null,this.filters=null,this.bounds=new d.c,this.container=null,this.blendRequired=!1,this.outputRenderSurface=null,this.globalFrame={x:0,y:0,width:0,height:0}}}class x{constructor(t){this._filterStackIndex=0,this._filterStack=[],this._filterGlobalUniforms=new l.k({uInputSize:{value:new Float32Array(4),type:"vec4<f32>"},uInputPixel:{value:new Float32Array(4),type:"vec4<f32>"},uInputClamp:{value:new Float32Array(4),type:"vec4<f32>"},uOutputFrame:{value:new Float32Array(4),type:"vec4<f32>"},uGlobalFrame:{value:new Float32Array(4),type:"vec4<f32>"},uOutputTexture:{value:new Float32Array(4),type:"vec4<f32>"}}),this._globalFilterBindGroup=new a.T({}),this.renderer=t}get activeBackTexture(){return this._activeFilterData?.backTexture}push(t){const e=this.renderer,s=t.filterEffect.filters,r=this._pushFilterData();r.skip=!1,r.filters=s,r.container=t.container,r.outputRenderSurface=e.renderTarget.renderSurface;const i=e.renderTarget.renderTarget.colorTexture.source,n=i.resolution,a=i.antialias;if(0===s.length)return void(r.skip=!0);const o=r.bounds;if(this._calculateFilterArea(t,o),this._calculateFilterBounds(r,e.renderTarget.rootViewPort,a,n,1),r.skip)return;const l=this._getPreviousFilterData(),h=this._findFilterResolution(n);let c=0,u=0;l&&(c=l.bounds.minX,u=l.bounds.minY),this._calculateGlobalFrame(r,c,u,h,i.width,i.height),this._setupFilterTextures(r,o,e,l)}generateFilteredTexture({texture:t,filters:e}){const s=this._pushFilterData();this._activeFilterData=s,s.skip=!1,s.filters=e;const r=t.source,i=r.resolution,n=r.antialias;if(0===e.length)return s.skip=!0,t;const a=s.bounds;if(a.addRect(t.frame),this._calculateFilterBounds(s,a.rectangle,n,i,0),s.skip)return t;const o=i;this._calculateGlobalFrame(s,0,0,o,r.width,r.height),s.outputRenderSurface=c.W.getOptimalTexture(a.width,a.height,s.resolution,s.antialias),s.backTexture=h.g.EMPTY,s.inputTexture=t,this.renderer.renderTarget.finishRenderPass(),this._applyFiltersToTexture(s,!0);const l=s.outputRenderSurface;return l.source.alphaMode="premultiplied-alpha",l}pop(){const t=this.renderer,e=this._popFilterData();e.skip||(t.globalUniforms.pop(),t.renderTarget.finishRenderPass(),this._activeFilterData=e,this._applyFiltersToTexture(e,!1),e.blendRequired&&c.W.returnTexture(e.backTexture),c.W.returnTexture(e.inputTexture))}getBackTexture(t,e,s){const r=t.colorTexture.source._resolution,i=c.W.getOptimalTexture(e.width,e.height,r,!1);let n=e.minX,a=e.minY;s&&(n-=s.minX,a-=s.minY),n=Math.floor(n*r),a=Math.floor(a*r);const o=Math.ceil(e.width*r),l=Math.ceil(e.height*r);return this.renderer.renderTarget.copyToTexture(t,i,{x:n,y:a},{width:o,height:l},{x:0,y:0}),i}applyFilter(t,e,s,r){const i=this.renderer,n=this._activeFilterData,a=n.outputRenderSurface===s,o=i.renderTarget.rootRenderTarget.colorTexture.source._resolution,l=this._findFilterResolution(o);let h=0,c=0;if(a){const t=this._findPreviousFilterOffset();h=t.x,c=t.y}this._updateFilterUniforms(e,s,n,h,c,l,a,r),this._setupBindGroupsAndRender(t,e,i)}calculateSpriteMatrix(t,e){const s=this._activeFilterData,r=t.set(s.inputTexture._source.width,0,0,s.inputTexture._source.height,s.bounds.minX,s.bounds.minY),i=e.worldTransform.copyTo(n.u.shared),a=e.renderGroup||e.parentRenderGroup;return a&&a.cacheToLocalTransform&&i.prepend(a.cacheToLocalTransform),i.invert(),r.prepend(i),r.scale(1/e.texture.orig.width,1/e.texture.orig.height),r.translate(e.anchor.x,e.anchor.y),r}destroy(){}_setupBindGroupsAndRender(t,e,s){if(s.renderPipes.uniformBatch){const t=s.renderPipes.uniformBatch.getUboResource(this._filterGlobalUniforms);this._globalFilterBindGroup.setResource(t,0)}else this._globalFilterBindGroup.setResource(this._filterGlobalUniforms,0);this._globalFilterBindGroup.setResource(e.source,1),this._globalFilterBindGroup.setResource(e.source.style,2),t.groups[0]=this._globalFilterBindGroup,s.encoder.draw({geometry:m,shader:t,state:t._state,topology:"triangle-list"}),s.type===u.W.WEBGL&&s.renderTarget.finishRenderPass()}_setupFilterTextures(t,e,s,r){if(t.backTexture=h.g.EMPTY,t.inputTexture=c.W.getOptimalTexture(e.width,e.height,t.resolution,t.antialias),t.blendRequired){s.renderTarget.finishRenderPass();const i=s.renderTarget.getRenderTarget(t.outputRenderSurface);t.backTexture=this.getBackTexture(i,e,r?.bounds)}s.renderTarget.bind(t.inputTexture,!0),s.globalUniforms.push({offset:e})}_calculateGlobalFrame(t,e,s,r,i,n){const a=t.globalFrame;a.x=e*r,a.y=s*r,a.width=i*r,a.height=n*r}_updateFilterUniforms(t,e,s,r,i,n,a,o){const l=this._filterGlobalUniforms.uniforms,c=l.uOutputFrame,u=l.uInputSize,d=l.uInputPixel,p=l.uInputClamp,f=l.uGlobalFrame,m=l.uOutputTexture;a?(c[0]=s.bounds.minX-r,c[1]=s.bounds.minY-i):(c[0]=0,c[1]=0),c[2]=t.frame.width,c[3]=t.frame.height,u[0]=t.source.width,u[1]=t.source.height,u[2]=1/u[0],u[3]=1/u[1],d[0]=t.source.pixelWidth,d[1]=t.source.pixelHeight,d[2]=1/d[0],d[3]=1/d[1],p[0]=.5*d[2],p[1]=.5*d[3],p[2]=t.frame.width*u[2]-.5*d[2],p[3]=t.frame.height*u[3]-.5*d[3];const g=this.renderer.renderTarget.rootRenderTarget.colorTexture;f[0]=r*n,f[1]=i*n,f[2]=g.source.width*n,f[3]=g.source.height*n,e instanceof h.g&&(e.source.resource=null);const x=this.renderer.renderTarget.getRenderTarget(e);this.renderer.renderTarget.bind(e,!!o),e instanceof h.g?(m[0]=e.frame.width,m[1]=e.frame.height):(m[0]=x.width,m[1]=x.height),m[2]=x.isRoot?-1:1,this._filterGlobalUniforms.update()}_findFilterResolution(t){let e=this._filterStackIndex-1;for(;e>0&&this._filterStack[e].skip;)--e;return e>0&&this._filterStack[e].inputTexture?this._filterStack[e].inputTexture.source._resolution:t}_findPreviousFilterOffset(){let t=0,e=0,s=this._filterStackIndex;for(;s>0;){s--;const r=this._filterStack[s];if(!r.skip){t=r.bounds.minX,e=r.bounds.minY;break}}return{x:t,y:e}}_calculateFilterArea(t,e){if(t.renderables?function(t,e){e.clear();const s=e.matrix;for(let s=0;s<t.length;s++){const r=t[s];if(r.globalDisplayStatus<7)continue;const i=r.renderGroup??r.parentRenderGroup;e.matrix=i?.isCachedAsTexture?p.copyFrom(i.textureOffsetInverseTransform).append(r.worldTransform):i?._parentCacheAsTextureRenderGroup?p.copyFrom(i._parentCacheAsTextureRenderGroup.inverseWorldTransform).append(r.groupTransform):r.worldTransform,e.addBounds(r.bounds)}e.matrix=s}(t.renderables,e):t.filterEffect.filterArea?(e.clear(),e.addRect(t.filterEffect.filterArea),e.applyMatrix(t.container.worldTransform)):t.container.getFastGlobalBounds(!0,e),t.container){const s=(t.container.renderGroup||t.container.parentRenderGroup).cacheToLocalTransform;s&&e.applyMatrix(s)}}_applyFiltersToTexture(t,e){const s=t.inputTexture,r=t.bounds,i=t.filters;if(this._globalFilterBindGroup.setResource(s.source.style,2),this._globalFilterBindGroup.setResource(t.backTexture.source,3),1===i.length)i[0].apply(this,s,t.outputRenderSurface,e);else{let s=t.inputTexture;const n=c.W.getOptimalTexture(r.width,r.height,s.source._resolution,!1);let a=n,o=0;for(o=0;o<i.length-1;++o){i[o].apply(this,s,a,!0);const t=s;s=a,a=t}i[o].apply(this,s,t.outputRenderSurface,e),c.W.returnTexture(n)}}_calculateFilterBounds(t,e,s,r,i){const n=this.renderer,a=t.bounds,o=t.filters;let l=1/0,h=0,c=!0,u=!1,d=!1,p=!0;for(let t=0;t<o.length;t++){const e=o[t];if(l=Math.min(l,"inherit"===e.resolution?r:e.resolution),h+=e.padding,"off"===e.antialias?c=!1:"inherit"===e.antialias&&c&&(c=s),e.clipToViewport||(p=!1),!(e.compatibleRenderers&n.type)){d=!1;break}if(e.blendRequired&&!(n.backBuffer?.useBackBuffer??1)){(0,f.R)("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."),d=!1;break}d=e.enabled||d,u||(u=e.blendRequired)}d?(p&&a.fitBounds(0,e.width/r,0,e.height/r),a.scale(l).ceil().scale(1/l).pad((0|h)*i),a.isPositive?(t.antialias=c,t.resolution=l,t.blendRequired=u):t.skip=!0):t.skip=!0}_popFilterData(){return this._filterStackIndex--,this._filterStack[this._filterStackIndex]}_getPreviousFilterData(){let t,e=this._filterStackIndex-1;for(;e>0&&(e--,t=this._filterStack[e],t.skip););return t}_pushFilterData(){let t=this._filterStack[this._filterStackIndex];return t||(t=this._filterStack[this._filterStackIndex]=new g),this._filterStackIndex++,t}}x.extension={type:[r.Ag.WebGLSystem,r.Ag.WebGPUSystem],name:"filter"},r.XO.add(x),r.XO.add(i)},8147:(t,e,s)=>{"use strict";s.d(e,{m:()=>i,w:()=>r});class r{#Jt;#te;constructor(t){this.#Jt=t,this.#te=!1}get dirty(){return this.#te}get v(){return this.#Jt}set v(t){this.#Jt!==t&&(this.#te=!0),this.#Jt=t}resetDirty(){this.#te=!1}}class i extends r{#W;#H;constructor(t){super(t),this.#W=Math.cos(t),this.#H=Math.sin(t)}get cos(){return this.#W}get sin(){return this.#H}set v(t){super.v!==t&&(this.#W=Math.cos(t),this.#H=Math.sin(t)),super.v=t}get v(){return super.v}}},8271:(t,e,s)=>{"use strict";s.d(e,{K:()=>i,Q:()=>r});const r={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var i=(t=>(t[t.DISABLED=0]="DISABLED",t[t.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",t[t.MASK_ACTIVE=2]="MASK_ACTIVE",t[t.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",t[t.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",t[t.NONE=5]="NONE",t))(i||{})},8337:(t,e,s)=>{"use strict";s.d(e,{V:()=>h});var r=s(4872),i=s(6170),n=s(9375),a=s(1579),o=s(9798);function l(t,e){if(!(t instanceof a.h)){let s=e?o.S.INDEX:o.S.VERTEX;t instanceof Array&&(e?(t=new Uint32Array(t),s=o.S.INDEX|o.S.COPY_DST):(t=new Float32Array(t),s=o.S.VERTEX|o.S.COPY_DST)),t=new a.h({data:t,label:e?"index-mesh-buffer":"vertex-mesh-buffer",usage:s})}return t}class h extends r.A{constructor(t={}){super(),this.uid=(0,n.L)("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new i.c,this._boundsDirty=!0;const{attributes:e,indexBuffer:s,topology:r}=t;if(this.buffers=[],this.attributes={},e)for(const t in e)this.addAttribute(t,e[t]);this.instanceCount=t.instanceCount??1,s&&this.addIndex(s),this.topology=r||"triangle-list"}onBufferUpdate(){this._boundsDirty=!0,this.emit("update",this)}getAttribute(t){return this.attributes[t]}getIndex(){return this.indexBuffer}getBuffer(t){return this.getAttribute(t).buffer}getSize(){for(const t in this.attributes){const e=this.attributes[t];return e.buffer.data.length/(e.stride/4||e.size)}return 0}addAttribute(t,e){const s=function(t){return(t instanceof a.h||Array.isArray(t)||t.BYTES_PER_ELEMENT)&&(t={buffer:t}),t.buffer=l(t.buffer,!1),t}(e);-1===this.buffers.indexOf(s.buffer)&&(this.buffers.push(s.buffer),s.buffer.on("update",this.onBufferUpdate,this),s.buffer.on("change",this.onBufferUpdate,this)),this.attributes[t]=s}addIndex(t){this.indexBuffer=l(t,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,function(t,e,s){const r=t.getAttribute("aPosition");if(!r)return s.minX=0,s.minY=0,s.maxX=0,s.maxY=0,s;const i=r.buffer.data;let n=1/0,a=1/0,o=-1/0,l=-1/0;const h=i.BYTES_PER_ELEMENT,c=(r.offset||0)/h,u=(r.stride||8)/h;for(let t=c;t<i.length;t+=u){const e=i[t],s=i[t+1];e>o&&(o=e),s>l&&(l=s),e<n&&(n=e),s<a&&(a=s)}return s.minX=n,s.minY=a,s.maxX=o,s.maxY=l,s}(this,0,this._bounds)):this._bounds}destroy(t=!1){this.emit("destroy",this),this.removeAllListeners(),t&&this.buffers.forEach(t=>t.destroy()),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}},8427:(t,e,s)=>{"use strict";var r=s(1065),i=s(5199),n=s(3655),a=s(4449),o=s(3769),l=s(9482),h=s(1228);class c{destroy(){}}class u{constructor(t,e){this.localUniforms=new a.k({uTransformMatrix:{value:new i.u,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),this.localUniformsBindGroup=new n.T({0:this.localUniforms}),this.renderer=t,this._adaptor=e,this._adaptor.init()}validateRenderable(t){const e=this._getMeshData(t),s=e.batched,r=t.batched;if(e.batched=r,s!==r)return!0;if(r){const s=t._geometry;if(s.indices.length!==e.indexSize||s.positions.length!==e.vertexSize)return e.indexSize=s.indices.length,e.vertexSize=s.positions.length,!0;const r=this._getBatchableMesh(t);return r.texture.uid!==t._texture.uid&&(r._textureMatrixUpdateId=-1),!r._batcher.checkAndUpdateTexture(r,t._texture)}return!1}addRenderable(t,e){const s=this.renderer.renderPipes.batch,r=this._getMeshData(t);if(t.didViewUpdate&&(r.indexSize=t._geometry.indices?.length,r.vertexSize=t._geometry.positions?.length),r.batched){const r=this._getBatchableMesh(t);r.setTexture(t._texture),r.geometry=t._geometry,s.addToBatch(r,e)}else s.break(e),e.add(t)}updateRenderable(t){if(t.batched){const e=this._getBatchableMesh(t);e.setTexture(t._texture),e.geometry=t._geometry,e._batcher.updateElement(e)}}execute(t){if(!t.isRenderable)return;t.state.blendMode=(0,o.i)(t.groupBlendMode,t.texture._source);const e=this.localUniforms;e.uniforms.uTransformMatrix=t.groupTransform,e.uniforms.uRound=this.renderer._roundPixels|t._roundPixels,e.update(),(0,l.V)(t.groupColorAlpha,e.uniforms.uColor,0),this._adaptor.execute(this,t)}_getMeshData(t){var e,s;return(e=t._gpuData)[s=this.renderer.uid]||(e[s]=new c),t._gpuData[this.renderer.uid].meshData||this._initMeshData(t)}_initMeshData(t){return t._gpuData[this.renderer.uid].meshData={batched:t.batched,indexSize:0,vertexSize:0},t._gpuData[this.renderer.uid].meshData}_getBatchableMesh(t){var e,s;return(e=t._gpuData)[s=this.renderer.uid]||(e[s]=new c),t._gpuData[this.renderer.uid].batchableMesh||this._initBatchableMesh(t)}_initBatchableMesh(t){const e=new h.U;return e.renderable=t,e.setTexture(t._texture),e.transform=t.groupTransform,e.roundPixels=this.renderer._roundPixels|t._roundPixels,t._gpuData[this.renderer.uid].batchableMesh=e,e}destroy(){this.localUniforms=null,this.localUniformsBindGroup=null,this._adaptor.destroy(),this._adaptor=null,this.renderer=null}}u.extension={type:[r.Ag.WebGLPipes,r.Ag.WebGPUPipes,r.Ag.CanvasPipes],name:"mesh"},r.XO.add(u)},8533:(t,e,s)=>{"use strict";s.d(e,{Z:()=>h});var r=s(275),i=s(2839);const n=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"]);function a(t){return n.has(t)}function o(t,e,s){const r=Math.hypot(t,e);if(r<=s||0===r)return{x:t,y:e,dist:r};const i=s/r;return{x:t*i,y:e*i,dist:s}}function l(t,e,s){t&&(t.style.left=`${e}px`,t.style.top=`${s}px`)}class h extends i._{#ee=new Set;#se=new Set;#re;#ie=0;#ne=0;#ae=!1;#oe;#le;#he;#ce;#ue;#de;#pe;#fe;constructor(t){super(),this.#de=t.onMove,this.#pe=t.onRelease,this.#fe=t.onKeyDown,this.#oe=t.joystickImage,this.#le=t.knobImage,this.#he=t.maxKnobDistance??80,this.#ce=t.moveThreshold??0,this.#ue=t.idlePosition??{left:-999999,top:-999999},window.addEventListener("keydown",this.#me),window.addEventListener("keyup",this.#ge),window.addEventListener("blur",this.#xe)}set renderer(t){const e=super.renderer;if(e){const t=e.container;t.removeEventListener("touchstart",this.#ye),t.removeEventListener("touchmove",this.#ve),t.removeEventListener("touchend",this.#_e),t.removeEventListener("touchcancel",this.#_e)}if(super.renderer=t,t){const e=t.container;e.addEventListener("touchstart",this.#ye,{passive:!1}),e.addEventListener("touchmove",this.#ve,{passive:!1}),e.addEventListener("touchend",this.#_e),e.addEventListener("touchcancel",this.#_e),this.#oe&&((0,r.e)(this.#oe,{position:"absolute",left:`${this.#ue.left}px`,top:`${this.#ue.top}px`,zIndex:"999998",transform:"translate(-50%, -50%)",pointerEvents:"none"}),e.appendChild(this.#oe)),this.#le&&((0,r.e)(this.#le,{position:"absolute",left:`${this.#ue.left}px`,top:`${this.#ue.top}px`,zIndex:"999999",transform:"translate(-50%, -50%)",pointerEvents:"none"}),e.appendChild(this.#le))}}get renderer(){return super.renderer}#ye=t=>{if(this.paused)return;if(t.preventDefault(),void 0!==this.#re)return;const e=t.changedTouches[0];if(this.#re=e.identifier,this.#ie=e.clientX,this.#ne=e.clientY,this.#ae=!1,!this.renderer)return;const s=this.renderer.container.getBoundingClientRect(),r=this.#ie-s.left,i=this.#ne-s.top;l(this.#oe,r,i),l(this.#le,r,i)};#ve=t=>{if(!this.paused&&(t.preventDefault(),void 0!==this.#re))for(let e=0;e<t.changedTouches.length;e++){const s=t.changedTouches[e];if(s.identifier!==this.#re)continue;const r=s.clientX-this.#ie,i=s.clientY-this.#ne,{x:n,y:a,dist:h}=o(r,i,this.#he);if(this.renderer){const t=this.renderer.container.getBoundingClientRect(),e=this.#ie-t.left+n,s=this.#ne-t.top+a;l(this.#le,e,s)}if((this.#ae||h>=this.#ce)&&(this.#ae=!0,0!==n||0!==a)){const t=Math.atan2(a,n),e=0===this.#he?0:h/this.#he;this.#de(t,e)}break}};#_e=t=>{if(this.paused||void 0===this.#re)return;let e=!1;for(let s=0;s<t.changedTouches.length;s++)if(t.changedTouches[s].identifier===this.#re){e=!0;break}if(!e)return;this.#re=void 0;const{left:s,top:r}=this.#ue;l(this.#oe,s,r),l(this.#le,s,r),this.#ae&&(this.#ae=!1,this.#pe())};#be(){let t=0,e=0;if(this.#se.has("ArrowUp")&&(e-=1),this.#se.has("ArrowDown")&&(e+=1),this.#se.has("ArrowLeft")&&(t-=1),this.#se.has("ArrowRight")&&(t+=1),0!==t||0!==e){const s=Math.atan2(e,t);this.#de(s,1)}}#me=t=>{if(this.paused)return;const e=t.code;if(!this.#ee.has(e)&&(this.#ee.add(e),this.#fe?.(e),a(e))){const s=t.target;!!s?.closest('input, textarea, [contenteditable]:not([contenteditable="false"])')||t.preventDefault(),this.#se.add(e),this.#be()}};#ge=t=>{if(this.paused)return;const e=t.code;this.#ee.delete(e),a(e)&&(this.#se.delete(e),0===this.#se.size?this.#pe():this.#be())};#xe=()=>{if(this.paused)return;this.#ee.clear(),this.#se.clear(),this.#re=void 0,this.#ae=!1;const{left:t,top:e}=this.#ue;l(this.#oe,t,e),l(this.#le,t,e),this.#pe()};pause(){this.#xe(),super.pause()}setIdlePosition(t){this.#ue=t,void 0===this.#re&&(l(this.#oe,t.left,t.top),l(this.#le,t.left,t.top))}remove(){const t=this.renderer;if(t){const e=t.container;e.removeEventListener("touchstart",this.#ye),e.removeEventListener("touchmove",this.#ve),e.removeEventListener("touchend",this.#_e),e.removeEventListener("touchcancel",this.#_e)}window.removeEventListener("keydown",this.#me),window.removeEventListener("keyup",this.#ge),window.removeEventListener("blur",this.#xe),this.#oe?.remove(),this.#le?.remove(),super.remove()}}},8574:(t,e,s)=>{"use strict";s.d(e,{W:()=>n});var r=s(5423);let i;function n(){if(!i||i?.isContextLost()){const t=r.e.get().createCanvas();i=t.getContext("webgl",{})}return i}},8598:(t,e,s)=>{"use strict";s.d(e,{c:()=>w});var r=s(6643),i=s(2445),n=s(4696),a=s(7694),o=s(7926),l=s(5105),h=s(6675),c=s(9390),u=s(1566),d=s(5947),p=s(9739),f=s(8896),m=s(2288),g=s(1990),x=s(9359);const y=class t extends x.v{constructor(e){super(),this.resolution=1,this.pages=[],this._padding=0,this._measureCache=Object.create(null),this._currentChars=[],this._currentX=0,this._currentY=0,this._currentMaxCharHeight=0,this._currentPageIndex=-1,this._skipKerning=!1;const s={...t.defaultOptions,...e};this._textureSize=s.textureSize,this._mipmap=s.mipmap;const r=s.style.clone();s.overrideFill&&(r._fill.color=16777215,r._fill.alpha=1,r._fill.texture=p.g.WHITE,r._fill.fill=null),this.applyFillAsTint=s.overrideFill;const i=r.fontSize;r.fontSize=this.baseMeasurementFontSize;const n=(0,m.Z)(r);s.overrideSize?r._stroke&&(r._stroke.width*=this.baseRenderedFontSize/i):r.fontSize=this.baseRenderedFontSize=i,this._style=r,this._skipKerning=s.skipKerning??!1,this.resolution=s.resolution??1,this._padding=s.padding??4,s.textureStyle&&(this._textureStyle=s.textureStyle instanceof f.n?s.textureStyle:new f.n(s.textureStyle)),this.fontMetrics=o.P.measureFont(n),this.lineHeight=r.lineHeight||this.fontMetrics.fontSize||r.fontSize}ensureCharacters(t){const e=o.P.graphemeSegmenter(t).filter(t=>!this._currentChars.includes(t)).filter((t,e,s)=>s.indexOf(t)===e);if(!e.length)return;let s;this._currentChars=[...this._currentChars,...e],s=-1===this._currentPageIndex?this._nextPage():this.pages[this._currentPageIndex];let{canvas:r,context:i}=s.canvasAndContext,n=s.texture.source;const a=this._style;let l=this._currentX,h=this._currentY,u=this._currentMaxCharHeight;const d=this.baseRenderedFontSize/this.baseMeasurementFontSize,f=this._padding*d;let m=!1;const g=r.width/this.resolution,x=r.height/this.resolution;for(let t=0;t<e.length;t++){const s=e[t],y=o.P.measureText(s,a,r,!1);y.lineHeight=y.height;const v=y.width*d,_=Math.ceil(("italic"===a.fontStyle?2:1)*v)+2*f,b=y.height*d+2*f;if(m=!1,"\n"!==s&&"\r"!==s&&"\t"!==s&&" "!==s&&(m=!0,u=Math.ceil(Math.max(b,u))),l+_>g&&(h+=u,u=b,l=0,h+u>x)){n.update();const t=this._nextPage();r=t.canvasAndContext.canvas,i=t.canvasAndContext.context,n=t.texture.source,l=0,h=0,u=0}const w=v/d-(a.dropShadow?.distance??0)-(a._stroke?.width??0);if(this.chars[s]={id:s.codePointAt(0),xOffset:-this._padding,yOffset:-this._padding,xAdvance:w,kerning:{}},m){this._drawGlyph(i,y,l+f,h+f,d,a);const t=n.width*d,e=n.height*d,r=new c.M(l/t*n.width,h/e*n.height,_/t*n.width,b/e*n.height);this.chars[s].texture=new p.g({source:n,frame:r}),l+=Math.ceil(_)}}n.update(),this._currentX=l,this._currentY=h,this._currentMaxCharHeight=u,this._skipKerning&&this._applyKerning(e,i)}get pageTextures(){return(0,n.t6)(n.lj,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}_applyKerning(t,e){const s=this._measureCache;for(let r=0;r<t.length;r++){const i=t[r];for(let t=0;t<this._currentChars.length;t++){const r=this._currentChars[t];let n=s[i];n||(n=s[i]=e.measureText(i).width);let a=s[r];a||(a=s[r]=e.measureText(r).width);let o=e.measureText(i+r).width,l=o-(n+a);l&&(this.chars[i].kerning[r]=l),o=e.measureText(i+r).width,l=o-(n+a),l&&(this.chars[r].kerning[i]=l)}}}_nextPage(){this._currentPageIndex++;const t=this.resolution,e=u.N.getOptimalCanvasAndContext(this._textureSize,this._textureSize,t);this._setupContext(e.context,this._style,t);const s=t*(this.baseRenderedFontSize/this.baseMeasurementFontSize),r=new p.g({source:new d.b({resource:e.canvas,resolution:s,alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:this._mipmap})});this._textureStyle&&(r.source.style=this._textureStyle);const i={canvasAndContext:e,texture:r};return this.pages[this._currentPageIndex]=i,i}_setupContext(t,e,s){e.fontSize=this.baseRenderedFontSize,t.scale(s,s),t.font=(0,m.Z)(e),e.fontSize=this.baseMeasurementFontSize,t.textBaseline=e.textBaseline;const r=e._stroke,i=r?.width??0;if(r&&(t.lineWidth=i,t.lineJoin=r.join,t.miterLimit=r.miterLimit,t.strokeStyle=(0,g.r)(r,t)),e._fill&&(t.fillStyle=(0,g.r)(e._fill,t)),e.dropShadow){const r=e.dropShadow,i=h.Q.shared.setValue(r.color).toArray(),n=r.blur*s,a=r.distance*s;t.shadowColor=`rgba(${255*i[0]},${255*i[1]},${255*i[2]},${r.alpha})`,t.shadowBlur=n,t.shadowOffsetX=Math.cos(r.angle)*a,t.shadowOffsetY=Math.sin(r.angle)*a}else t.shadowColor="black",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0}_drawGlyph(t,e,s,r,i,n){const a=e.text,o=e.fontProperties,l=n._stroke,h=(l?.width??0)*i,c=s+h/2,u=r-h/2,d=o.descent*i,p=e.lineHeight*i;let f=!1;n.stroke&&h&&(f=!0,t.strokeText(a,c,u+p-d));const{shadowBlur:m,shadowOffsetX:g,shadowOffsetY:x}=t;n._fill&&(f&&(t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0),t.fillText(a,c,u+p-d)),f&&(t.shadowBlur=m,t.shadowOffsetX=g,t.shadowOffsetY=x)}destroy(){super.destroy();for(let t=0;t<this.pages.length;t++){const{canvasAndContext:e,texture:s}=this.pages[t];u.N.returnCanvasAndContext(e),s.destroy(!0)}this.pages=null}};y.defaultOptions={textureSize:512,style:new l.x,mipmap:!0};let v=y;var _=s(5353);let b=0;const w=new class{constructor(){this.ALPHA=[["a","z"],["A","Z"]," "],this.NUMERIC=[["0","9"]],this.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],this.ASCII=[[" ","~"]],this.defaultOptions={chars:this.ALPHANUMERIC,resolution:1,padding:4,skipKerning:!1,textureStyle:null},this.measureCache=(0,r.g)(1e3)}getFont(t,e){let s=`${e.fontFamily}-bitmap`,r=!0;if(e._fill.fill&&!e._stroke?(s+=e._fill.fill.styleKey,r=!1):(e._stroke||e.dropShadow)&&(s=`${e.styleKey}-bitmap`,r=!1),!i.l.has(s)){const t=Object.create(e);t.lineHeight=0;const n=new v({style:t,overrideFill:r,overrideSize:!0,...this.defaultOptions});b++,b>50&&(0,a.R)("BitmapText",`You have dynamically created ${b} bitmap fonts, this can be inefficient. Try pre installing your font styles using \`BitmapFont.install({name:"style1", style})\``),n.once("destroy",()=>{b--,i.l.remove(s)}),i.l.set(s,n)}const n=i.l.get(s);return n.ensureCharacters?.(t),n}getLayout(t,e,s=!0){const r=this.getFont(t,e),i=`${t}-${e.styleKey}-${s}`;if(this.measureCache.has(i))return this.measureCache.get(i);const n=o.P.graphemeSegmenter(t),a=(0,_.Z)(n,e,r,s);return this.measureCache.set(i,a),a}measureText(t,e,s=!0){return this.getLayout(t,e,s)}install(...t){let e=t[0];"string"==typeof e&&(e={name:e,style:t[1],chars:t[2]?.chars,resolution:t[2]?.resolution,padding:t[2]?.padding,skipKerning:t[2]?.skipKerning},(0,n.t6)(n.lj,"BitmapFontManager.install(name, style, options) is deprecated, use BitmapFontManager.install({name, style, ...options})"));const s=e?.name;if(!s)throw new Error("[BitmapFontManager] Property `name` is required.");e={...this.defaultOptions,...e};const r=e.style,a=r instanceof l.x?r:new l.x(r),o=e.dynamicFill??this._canUseTintForStyle(a),h=new v({style:a,overrideFill:o,skipKerning:e.skipKerning,padding:e.padding,resolution:e.resolution,overrideSize:!1,textureStyle:e.textureStyle}),c=function(t){if(""===t)return[];"string"==typeof t&&(t=[t]);const e=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];if(Array.isArray(r)){if(2!==r.length)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${r.length}.`);if(0===r[0].length||0===r[1].length)throw new Error("[BitmapFont]: Invalid character delimiter.");const t=r[0].charCodeAt(0),s=r[1].charCodeAt(0);if(s<t)throw new Error("[BitmapFont]: Invalid character range.");for(let r=t,i=s;r<=i;r++)e.push(String.fromCharCode(r))}else e.push(...Array.from(r))}if(0===e.length)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}(e.chars);return h.ensureCharacters(c.join("")),i.l.set(`${s}-bitmap`,h),h.once("destroy",()=>i.l.remove(`${s}-bitmap`)),h}uninstall(t){const e=`${t}-bitmap`,s=i.l.get(e);s&&s.destroy()}_canUseTintForStyle(t){return!(t._stroke||t.dropShadow&&0!==t.dropShadow.color||t._fill.fill||16777215!==t._fill.color)}}},8628:(t,e,s)=>{"use strict";s.d(e,{WebGPURenderer:()=>At});var r=s(1065),i=s(5199),n=s(2791),a=s(9677),o=s(2305),l=s(1570),h=s(4405),c=s(7335),u=s(1657),d=s(4449);class p{constructor(){this._maxTextures=0}contextChange(t){const e=new d.k({uTransformMatrix:{value:new i.u,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}});this._maxTextures=t.limits.maxBatchableTextures;const s=(0,a.v)({name:"graphics",bits:[o.F,(0,l._)(this._maxTextures),h._Q,c.b]});this.shader=new u.M({gpuProgram:s,resources:{localUniforms:e}})}execute(t,e){const s=e.context,r=s.customShader||this.shader,i=t.renderer,a=i.graphicsContext,{batcher:o,instructions:l}=a.getContextRenderData(s),h=i.encoder;h.setGeometry(o.geometry,r.gpuProgram);const c=i.globalUniforms.bindGroup;h.setBindGroup(0,c,r.gpuProgram);const u=i.renderPipes.uniformBatch.getUniformBindGroup(r.resources.localUniforms,!0);h.setBindGroup(2,u,r.gpuProgram);const d=l.instructions;let p=null;for(let e=0;e<l.instructionSize;e++){const s=d[e];if(s.topology!==p&&(p=s.topology,h.setPipelineFromGeometryProgramAndState(o.geometry,r.gpuProgram,t.state,s.topology)),r.groups[1]=s.bindGroup,!s.gpuBindGroup){const t=s.textures;s.bindGroup=(0,n.w)(t.textures,t.count,this._maxTextures),s.gpuBindGroup=i.bindGroup.getBindGroup(s.bindGroup,r.gpuProgram,1)}h.setBindGroup(1,s.bindGroup,r.gpuProgram),h.renderPassEncoder.drawIndexed(s.size,1,s.start)}}destroy(){this.shader.destroy(!0),this.shader=null}}p.extension={type:[r.Ag.WebGPUPipesAdaptor],name:"graphics"};var f=s(2577),m=s(9739),g=s(7694);class x{init(){const t=(0,a.v)({name:"mesh",bits:[h.Ls,f.R,c.b]});this._shader=new u.M({gpuProgram:t,resources:{uTexture:m.g.EMPTY._source,uSampler:m.g.EMPTY._source.style,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new i.u}}}})}execute(t,e){const s=t.renderer;let r=e._shader;if(r){if(!r.gpuProgram)return void(0,g.R)("Mesh shader has no gpuProgram",e.shader)}else r=this._shader,r.groups[2]=s.texture.getTextureBindGroup(e.texture);const i=r.gpuProgram;if(i.autoAssignGlobalUniforms&&(r.groups[0]=s.globalUniforms.bindGroup),i.autoAssignLocalUniforms){const e=t.localUniforms;r.groups[1]=s.renderPipes.uniformBatch.getUniformBindGroup(e,!0)}s.encoder.draw({geometry:e._geometry,shader:r,state:e.state})}destroy(){this._shader.destroy(!0),this._shader=null}}x.extension={type:[r.Ag.WebGPUPipesAdaptor],name:"mesh"};var y=s(7433);const v=y.U.for2d();class _{start(t,e,s){const r=t.renderer,i=r.encoder,n=s.gpuProgram;this._shader=s,this._geometry=e,i.setGeometry(e,n),v.blendMode="normal",r.pipeline.getPipeline(e,n,v);const a=r.globalUniforms.bindGroup;i.resetBindGroup(1),i.setBindGroup(0,a,n)}execute(t,e){const s=this._shader.gpuProgram,r=t.renderer,i=r.encoder;if(!e.bindGroup){const t=e.textures;e.bindGroup=(0,n.w)(t.textures,t.count,r.limits.maxBatchableTextures)}v.blendMode=e.blendMode;const a=r.bindGroup.getBindGroup(e.bindGroup,s,1),o=r.pipeline.getPipeline(this._geometry,s,v,e.topology);e.bindGroup._touch(r.textureGC.count),i.setPipeline(o),i.renderPassEncoder.setBindGroup(1,a),i.renderPassEncoder.drawIndexed(e.size,1,e.start)}}_.extension={type:[r.Ag.WebGPUPipesAdaptor],name:"batch"};var b=s(6114),w=s(1673),T=s(5153);class S{constructor(t){this._hash=Object.create(null),this._renderer=t,this._renderer.renderableGC.addManagedHash(this,"_hash")}contextChange(t){this._gpu=t}getBindGroup(t,e,s){return t._updateKey(),this._hash[t._key]||this._createBindGroup(t,e,s)}_createBindGroup(t,e,s){const r=this._gpu.device,i=e.layout[s],n=[],a=this._renderer;for(const e in i){const s=t.resources[e]??t.resources[i[e]];let r;if("uniformGroup"===s._resourceType){const t=s;a.ubo.updateUniformGroup(t);const e=t.buffer;r={buffer:a.buffer.getGPUBuffer(e),offset:0,size:e.descriptor.size}}else if("buffer"===s._resourceType){const t=s;r={buffer:a.buffer.getGPUBuffer(t),offset:0,size:t.descriptor.size}}else if("bufferResource"===s._resourceType){const t=s;r={buffer:a.buffer.getGPUBuffer(t.buffer),offset:t.offset,size:t.size}}else if("textureSampler"===s._resourceType){const t=s;r=a.texture.getGpuSampler(t)}else if("textureSource"===s._resourceType){const t=s;r=a.texture.getGpuSource(t).createView({})}n.push({binding:i[e],resource:r})}const o=a.shader.getProgramData(e).bindGroups[s],l=r.createBindGroup({layout:o,entries:n});return this._hash[t._key]=l,l}destroy(){for(const t of Object.keys(this._hash))this._hash[t]=null;this._hash=null,this._renderer=null}}S.extension={type:[r.Ag.WebGPUSystem],name:"bindGroup"};var A=s(9062);class C{constructor(t){this._gpuBuffers=Object.create(null),this._managedBuffers=[],t.renderableGC.addManagedHash(this,"_gpuBuffers")}contextChange(t){this._gpu=t}getGPUBuffer(t){return this._gpuBuffers[t.uid]||this.createGPUBuffer(t)}updateBuffer(t){const e=this._gpuBuffers[t.uid]||this.createGPUBuffer(t),s=t.data;return t._updateID&&s&&(t._updateID=0,this._gpu.device.queue.writeBuffer(e,0,s.buffer,0,(t._updateSize||s.byteLength)+3&-4)),e}destroyAll(){for(const t in this._gpuBuffers)this._gpuBuffers[t].destroy();this._gpuBuffers={}}createGPUBuffer(t){this._gpuBuffers[t.uid]||(t.on("update",this.updateBuffer,this),t.on("change",this.onBufferChange,this),t.on("destroy",this.onBufferDestroy,this),this._managedBuffers.push(t));const e=this._gpu.device.createBuffer(t.descriptor);return t._updateID=0,t.data&&((0,A.W)(t.data.buffer,e.getMappedRange()),e.unmap()),this._gpuBuffers[t.uid]=e,e}onBufferChange(t){this._gpuBuffers[t.uid].destroy(),t._updateID=0,this._gpuBuffers[t.uid]=this.createGPUBuffer(t)}onBufferDestroy(t){this._managedBuffers.splice(this._managedBuffers.indexOf(t),1),this._destroyBuffer(t)}destroy(){this._managedBuffers.forEach(t=>this._destroyBuffer(t)),this._managedBuffers=null,this._gpuBuffers=null}_destroyBuffer(t){this._gpuBuffers[t.uid].destroy(),t.off("update",this.updateBuffer,this),t.off("change",this.onBufferChange,this),t.off("destroy",this.onBufferDestroy,this),this._gpuBuffers[t.uid]=null}}C.extension={type:[r.Ag.WebGPUSystem],name:"buffer"};class P{constructor(t){this._colorMaskCache=15,this._renderer=t}setMask(t){this._colorMaskCache!==t&&(this._colorMaskCache=t,this._renderer.pipeline.setColorMask(t))}destroy(){this._renderer=null,this._colorMaskCache=null}}P.extension={type:[r.Ag.WebGPUSystem],name:"colorMask"};var E=s(5423);class M{constructor(t){this._renderer=t}async init(t){return this._initPromise||(this._initPromise=(t.gpu?Promise.resolve(t.gpu):this._createDeviceAndAdaptor(t)).then(t=>{this.gpu=t,this._renderer.runners.contextChange.emit(this.gpu)})),this._initPromise}contextChange(t){this._renderer.gpu=t}async _createDeviceAndAdaptor(t){const e=await E.e.get().getNavigator().gpu.requestAdapter({powerPreference:t.powerPreference,forceFallbackAdapter:t.forceFallbackAdapter}),s=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(t=>e.features.has(t)),r=await e.requestDevice({requiredFeatures:s});return{adapter:e,device:r}}destroy(){this.gpu=null,this._renderer=null}}M.extension={type:[r.Ag.WebGPUSystem],name:"device"},M.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};class k{constructor(t){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=t}renderStart(){this.commandFinished=new Promise(t=>{this._resolveCommandFinished=t}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(t){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(t.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(t){this.renderPassEncoder.setViewport(t.x,t.y,t.width,t.height,0,1)}setPipelineFromGeometryProgramAndState(t,e,s,r){const i=this._renderer.pipeline.getPipeline(t,e,s,r);this.setPipeline(i)}setPipeline(t){this._boundPipeline!==t&&(this._boundPipeline=t,this.renderPassEncoder.setPipeline(t))}_setVertexBuffer(t,e){this._boundVertexBuffer[t]!==e&&(this._boundVertexBuffer[t]=e,this.renderPassEncoder.setVertexBuffer(t,this._renderer.buffer.updateBuffer(e)))}_setIndexBuffer(t){if(this._boundIndexBuffer===t)return;this._boundIndexBuffer=t;const e=2===t.data.BYTES_PER_ELEMENT?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(t),e)}resetBindGroup(t){this._boundBindGroup[t]=null}setBindGroup(t,e,s){if(this._boundBindGroup[t]===e)return;this._boundBindGroup[t]=e,e._touch(this._renderer.textureGC.count);const r=this._renderer.bindGroup.getBindGroup(e,s,t);this.renderPassEncoder.setBindGroup(t,r)}setGeometry(t,e){const s=this._renderer.pipeline.getBufferNamesToBind(t,e);for(const e in s)this._setVertexBuffer(parseInt(e,10),t.attributes[s[e]].buffer);t.indexBuffer&&this._setIndexBuffer(t.indexBuffer)}_setShaderBindGroups(t,e){for(const s in t.groups){const r=t.groups[s];e||this._syncBindGroup(r),this.setBindGroup(s,r,t.gpuProgram)}}_syncBindGroup(t){for(const e in t.resources){const s=t.resources[e];s.isUniformGroup&&this._renderer.ubo.updateUniformGroup(s)}}draw(t){const{geometry:e,shader:s,state:r,topology:i,size:n,start:a,instanceCount:o,skipSync:l}=t;this.setPipelineFromGeometryProgramAndState(e,s.gpuProgram,r,i),this.setGeometry(e,s.gpuProgram),this._setShaderBindGroups(s,l),e.indexBuffer?this.renderPassEncoder.drawIndexed(n||e.indexBuffer.data.length,o??e.instanceCount,a||0):this.renderPassEncoder.draw(n||e.getSize(),o??e.instanceCount,a||0)}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null)}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null}restoreRenderPass(){const t=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1]);this.renderPassEncoder=this.commandEncoder.beginRenderPass(t);const e=this._boundPipeline,s={...this._boundVertexBuffer},r=this._boundIndexBuffer,i={...this._boundBindGroup};this._clearCache();const n=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(n.x,n.y,n.width,n.height,0,1),this.setPipeline(e);for(const t in s)this._setVertexBuffer(t,s[t]);for(const t in i)this.setBindGroup(t,i[t],null);this._setIndexBuffer(r)}_clearCache(){for(let t=0;t<16;t++)this._boundBindGroup[t]=null,this._boundVertexBuffer[t]=null;this._boundIndexBuffer=null,this._boundPipeline=null}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null}contextChange(t){this._gpu=t}}k.extension={type:[r.Ag.WebGPUSystem],name:"encoder",priority:1};class R{constructor(t){this._renderer=t}contextChange(){this.maxTextures=this._renderer.device.gpu.device.limits.maxSampledTexturesPerShaderStage,this.maxBatchableTextures=this.maxTextures}destroy(){}}R.extension={type:[r.Ag.WebGPUSystem],name:"limits"};var B=s(8271);class I{constructor(t){this._renderTargetStencilState=Object.create(null),this._renderer=t,t.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(t){let e=this._renderTargetStencilState[t.uid];e||(e=this._renderTargetStencilState[t.uid]={stencilMode:B.K.DISABLED,stencilReference:0}),this._activeRenderTarget=t,this.setStencilMode(e.stencilMode,e.stencilReference)}setStencilMode(t,e){const s=this._renderTargetStencilState[this._activeRenderTarget.uid];s.stencilMode=t,s.stencilReference=e;const r=this._renderer;r.pipeline.setStencilMode(t),r.encoder.renderPassEncoder.setStencilReference(e)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}}I.extension={type:[r.Ag.WebGPUSystem],name:"stencil"};var F=s(1009);const D={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2<i32>":{align:8,size:8},"vec2<u32>":{align:8,size:8},"vec2<f32>":{align:8,size:8},"vec2<f16>":{align:4,size:4},"vec3<i32>":{align:16,size:12},"vec3<u32>":{align:16,size:12},"vec3<f32>":{align:16,size:12},"vec3<f16>":{align:8,size:6},"vec4<i32>":{align:16,size:16},"vec4<u32>":{align:16,size:16},"vec4<f32>":{align:16,size:16},"vec4<f16>":{align:8,size:8},"mat2x2<f32>":{align:8,size:16},"mat2x2<f16>":{align:4,size:8},"mat3x2<f32>":{align:8,size:24},"mat3x2<f16>":{align:4,size:12},"mat4x2<f32>":{align:8,size:32},"mat4x2<f16>":{align:4,size:16},"mat2x3<f32>":{align:16,size:32},"mat2x3<f16>":{align:8,size:16},"mat3x3<f32>":{align:16,size:48},"mat3x3<f16>":{align:8,size:24},"mat4x3<f32>":{align:16,size:64},"mat4x3<f16>":{align:8,size:32},"mat2x4<f32>":{align:16,size:32},"mat2x4<f16>":{align:8,size:16},"mat3x4<f32>":{align:16,size:48},"mat3x4<f16>":{align:8,size:24},"mat4x4<f32>":{align:16,size:64},"mat4x4<f16>":{align:8,size:32}};function O(t){const e=t.map(t=>({data:t,offset:0,size:0}));let s=0;for(let t=0;t<e.length;t++){const r=e[t];let i=D[r.data.type].size;const n=D[r.data.type].align;if(!D[r.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${r.data.type}`);r.data.size>1&&(i=Math.max(i,n)*r.data.size),s=Math.ceil(s/n)*n,r.size=i,r.offset=s,s+=i}return s=16*Math.ceil(s/16),{uboElements:e,size:s}}var G=s(2337),U=s(4364);function L(t,e){const{size:s,align:r}=D[t.data.type],i=(r-s)/4,n=t.data.type.indexOf("i32")>=0?"dataInt32":"data";return`\n v = uv.${t.data.name};\n ${0!==e?`offset += ${e};`:""}\n\n arrayOffset = offset;\n\n t = 0;\n\n for(var i=0; i < ${t.data.size*(s/4)}; i++)\n {\n for(var j = 0; j < ${s/4}; j++)\n {\n ${n}[arrayOffset++] = v[t++];\n }\n ${0!==i?`arrayOffset += ${i};`:""}\n }\n `}function N(t){return(0,G.E)(t,"uboWgsl",L,U._)}class X extends F.W{constructor(){super({createUboElements:O,generateUboSync:N})}}X.extension={type:[r.Ag.WebGPUSystem],name:"ubo"};var Y=s(1579),V=s(2015),z=s(9798);class W{constructor({minUniformOffsetAlignment:t}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=t,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(t){if(t>this._minUniformOffsetAlignment/4)throw new Error("UniformBufferBatch: array is too large: "+4*t);const e=this.byteIndex;let s=e+4*t;if(s=Math.ceil(s/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,s>4*this.data.length)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=s,e}addGroup(t){const e=this.addEmptyGroup(t.length);for(let s=0;s<t.length;s++)this.data[e/4+s]=t[s];return e}destroy(){this.data=null}}var H=s(3655);const j=128;class q{constructor(t){this._bindGroupHash=Object.create(null),this._buffers=[],this._bindGroups=[],this._bufferResources=[],this._renderer=t,this._renderer.renderableGC.addManagedHash(this,"_bindGroupHash"),this._batchBuffer=new W({minUniformOffsetAlignment:j});for(let t=0;t<2;t++){let e=z.S.UNIFORM|z.S.COPY_DST;0===t&&(e|=z.S.COPY_SRC),this._buffers.push(new Y.h({data:this._batchBuffer.data,usage:e}))}}renderEnd(){this._uploadBindGroups(),this._resetBindGroups()}_resetBindGroups(){for(const t in this._bindGroupHash)this._bindGroupHash[t]=null;this._batchBuffer.clear()}getUniformBindGroup(t,e){if(!e&&this._bindGroupHash[t.uid])return this._bindGroupHash[t.uid];this._renderer.ubo.ensureUniformGroup(t);const s=t.buffer.data,r=this._batchBuffer.addEmptyGroup(s.length);return this._renderer.ubo.syncUniformGroup(t,this._batchBuffer.data,r/4),this._bindGroupHash[t.uid]=this._getBindGroup(r/j),this._bindGroupHash[t.uid]}getUboResource(t){this._renderer.ubo.updateUniformGroup(t);const e=t.buffer.data,s=this._batchBuffer.addGroup(e);return this._getBufferResource(s/j)}getArrayBindGroup(t){const e=this._batchBuffer.addGroup(t);return this._getBindGroup(e/j)}getArrayBufferResource(t){const e=this._batchBuffer.addGroup(t)/j;return this._getBufferResource(e)}_getBufferResource(t){if(!this._bufferResources[t]){const e=this._buffers[t%2];this._bufferResources[t]=new V.d({buffer:e,offset:256*(t/2|0),size:j})}return this._bufferResources[t]}_getBindGroup(t){if(!this._bindGroups[t]){const e=new H.T({0:this._getBufferResource(t)});this._bindGroups[t]=e}return this._bindGroups[t]}_uploadBindGroups(){const t=this._renderer.buffer,e=this._buffers[0];e.update(this._batchBuffer.byteIndex),t.updateBuffer(e);const s=this._renderer.gpu.device.createCommandEncoder();for(let r=1;r<this._buffers.length;r++){const i=this._buffers[r];s.copyBufferToBuffer(t.getGPUBuffer(e),j,t.getGPUBuffer(i),0,this._batchBuffer.byteIndex)}this._renderer.gpu.device.queue.submit([s.finish()])}destroy(){for(let t=0;t<this._bindGroups.length;t++)this._bindGroups[t]?.destroy();this._bindGroups=null,this._bindGroupHash=null;for(let t=0;t<this._buffers.length;t++)this._buffers[t].destroy();this._buffers=null;for(let t=0;t<this._bufferResources.length;t++)this._bufferResources[t].destroy();this._bufferResources=null,this._batchBuffer.destroy(),this._bindGroupHash=null,this._renderer=null}}q.extension={type:[r.Ag.WebGPUPipes],name:"uniformBatch"};var $=s(498),K=s(8642),Q=s(9250);const Z={"point-list":0,"line-list":1,"line-strip":2,"triangle-list":3,"triangle-strip":4};class J{constructor(t){this._moduleCache=Object.create(null),this._bufferLayoutsCache=Object.create(null),this._bindingNamesCache=Object.create(null),this._pipeCache=Object.create(null),this._pipeStateCaches=Object.create(null),this._colorMask=15,this._multisampleCount=1,this._renderer=t}contextChange(t){this._gpu=t,this.setStencilMode(B.K.DISABLED),this._updatePipeHash()}setMultisampleCount(t){this._multisampleCount!==t&&(this._multisampleCount=t,this._updatePipeHash())}setRenderTarget(t){this._multisampleCount=t.msaaSamples,this._depthStencilAttachment=t.descriptor.depthStencilAttachment?1:0,this._updatePipeHash()}setColorMask(t){this._colorMask!==t&&(this._colorMask=t,this._updatePipeHash())}setStencilMode(t){this._stencilMode!==t&&(this._stencilMode=t,this._stencilState=Q.g[t],this._updatePipeHash())}setPipeline(t,e,s,r){const i=this.getPipeline(t,e,s);r.setPipeline(i)}getPipeline(t,e,s,r){t._layoutKey||((0,$.q)(t,e.attributeData),this._generateBufferKey(t)),r||(r=t.topology);const i=function(t,e,s,r,i){return t<<24|e<<16|s<<10|r<<5|i}(t._layoutKey,e._layoutKey,s.data,s._blendModeId,Z[r]);return this._pipeCache[i]||(this._pipeCache[i]=this._createPipeline(t,e,s,r)),this._pipeCache[i]}_createPipeline(t,e,s,r){const i=this._gpu.device,n=this._createVertexBufferLayouts(t,e),a=this._renderer.state.getColorTargets(s);a[0].writeMask=this._stencilMode===B.K.RENDERING_MASK_ADD?0:this._colorMask;const o=this._renderer.shader.getProgramData(e).pipeline,l={vertex:{module:this._getModule(e.vertex.source),entryPoint:e.vertex.entryPoint,buffers:n},fragment:{module:this._getModule(e.fragment.source),entryPoint:e.fragment.entryPoint,targets:a},primitive:{topology:r,cullMode:s.cullMode},layout:o,multisample:{count:this._multisampleCount},label:"PIXI Pipeline"};return this._depthStencilAttachment&&(l.depthStencil={...this._stencilState,format:"depth24plus-stencil8",depthWriteEnabled:s.depthTest,depthCompare:s.depthTest?"less":"always"}),i.createRenderPipeline(l)}_getModule(t){return this._moduleCache[t]||this._createModule(t)}_createModule(t){const e=this._gpu.device;return this._moduleCache[t]=e.createShaderModule({code:t}),this._moduleCache[t]}_generateBufferKey(t){const e=[];let s=0;const r=Object.keys(t.attributes).sort();for(let i=0;i<r.length;i++){const n=t.attributes[r[i]];e[s++]=n.offset,e[s++]=n.format,e[s++]=n.stride,e[s++]=n.instance}const i=e.join("|");return t._layoutKey=(0,K.X)(i,"geometry"),t._layoutKey}_generateAttributeLocationsKey(t){const e=[];let s=0;const r=Object.keys(t.attributeData).sort();for(let i=0;i<r.length;i++){const n=t.attributeData[r[i]];e[s++]=n.location}const i=e.join("|");return t._attributeLocationsKey=(0,K.X)(i,"programAttributes"),t._attributeLocationsKey}getBufferNamesToBind(t,e){const s=t._layoutKey<<16|e._attributeLocationsKey;if(this._bindingNamesCache[s])return this._bindingNamesCache[s];const r=this._createVertexBufferLayouts(t,e),i=Object.create(null),n=e.attributeData;for(let t=0;t<r.length;t++){const e=Object.values(r[t].attributes)[0].shaderLocation;for(const s in n)if(n[s].location===e){i[t]=s;break}}return this._bindingNamesCache[s]=i,i}_createVertexBufferLayouts(t,e){e._attributeLocationsKey||this._generateAttributeLocationsKey(e);const s=t._layoutKey<<16|e._attributeLocationsKey;if(this._bufferLayoutsCache[s])return this._bufferLayoutsCache[s];const r=[];return t.buffers.forEach(s=>{const i={arrayStride:0,stepMode:"vertex",attributes:[]},n=i.attributes;for(const r in e.attributeData){const a=t.attributes[r];1!==(a.divisor??1)&&(0,g.R)(`Attribute ${r} has an invalid divisor value of '${a.divisor}'. WebGPU only supports a divisor value of 1`),a.buffer===s&&(i.arrayStride=a.stride,i.stepMode=a.instance?"instance":"vertex",n.push({shaderLocation:e.attributeData[r].location,offset:a.offset,format:a.format}))}n.length&&r.push(i)}),this._bufferLayoutsCache[s]=r,r}_updatePipeHash(){const t=(e=this._stencilMode,s=this._multisampleCount,this._colorMask<<6|e<<3|this._depthStencilAttachment<<1|s);var e,s;this._pipeStateCaches[t]||(this._pipeStateCaches[t]=Object.create(null)),this._pipeCache=this._pipeStateCaches[t]}destroy(){this._renderer=null,this._bufferLayoutsCache=null}}J.extension={type:[r.Ag.WebGPUSystem],name:"pipeline"};var tt=s(8900),et=s(1711),st=s(1386),rt=s(4269);class it{constructor(){this.contexts=[],this.msaaTextures=[],this.msaaSamples=1}}class nt{init(t,e){this._renderer=t,this._renderTargetSystem=e}copyToTexture(t,e,s,r,i){const n=this._renderer,a=this._getGpuColorTexture(t),o=n.texture.getGpuSource(e.source);return n.encoder.commandEncoder.copyTextureToTexture({texture:a,origin:s},{texture:o,origin:i},r),e}startRenderPass(t,e=!0,s,r){const i=this._renderTargetSystem.getGpuRenderTarget(t),n=this.getDescriptor(t,e,s);i.descriptor=n,this._renderer.pipeline.setRenderTarget(i),this._renderer.encoder.beginRenderPass(i),this._renderer.encoder.setViewport(r)}finishRenderPass(){this._renderer.encoder.endRenderPass()}_getGpuColorTexture(t){const e=this._renderTargetSystem.getGpuRenderTarget(t);return e.contexts[0]?e.contexts[0].getCurrentTexture():this._renderer.texture.getGpuSource(t.colorTextures[0].source)}getDescriptor(t,e,s){"boolean"==typeof e&&(e=e?et.u.ALL:et.u.NONE);const r=this._renderTargetSystem,i=r.getGpuRenderTarget(t),n=t.colorTextures.map((t,n)=>{const a=i.contexts[n];let o,l;o=a?a.getCurrentTexture().createView():this._renderer.texture.getGpuSource(t).createView({mipLevelCount:1}),i.msaaTextures[n]&&(l=o,o=this._renderer.texture.getTextureView(i.msaaTextures[n]));const h=e&et.u.COLOR?"clear":"load";return s??(s=r.defaultClearColor),{view:o,resolveTarget:l,clearValue:s,storeOp:"store",loadOp:h}});let a;if(!t.stencil&&!t.depth||t.depthStencilTexture||(t.ensureDepthStencilTexture(),t.depthStencilTexture.source.sampleCount=i.msaa?4:1),t.depthStencilTexture){const s=e&et.u.STENCIL?"clear":"load",r=e&et.u.DEPTH?"clear":"load";a={view:this._renderer.texture.getGpuSource(t.depthStencilTexture.source).createView(),stencilStoreOp:"store",stencilLoadOp:s,depthClearValue:1,depthLoadOp:r,depthStoreOp:"store"}}return{colorAttachments:n,depthStencilAttachment:a}}clear(t,e=!0,s,r){if(!e)return;const{gpu:i,encoder:n}=this._renderer,a=i.device;if(null===n.commandEncoder){const i=a.createCommandEncoder(),n=this.getDescriptor(t,e,s),o=i.beginRenderPass(n);o.setViewport(r.x,r.y,r.width,r.height,0,1),o.end();const l=i.finish();a.queue.submit([l])}else this.startRenderPass(t,e,s,r)}initGpuRenderTarget(t){t.isRoot=!0;const e=new it;return t.colorTextures.forEach((t,s)=>{if(t instanceof st.q){const r=t.resource.getContext("webgpu"),i=t.transparent?"premultiplied":"opaque";try{r.configure({device:this._renderer.gpu.device,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,format:"bgra8unorm",alphaMode:i})}catch(t){console.error(t)}e.contexts[s]=r}if(e.msaa=t.source.antialias,t.source.antialias){const t=new rt.v({width:0,height:0,sampleCount:4});e.msaaTextures[s]=t}}),e.msaa&&(e.msaaSamples=4,t.depthStencilTexture&&(t.depthStencilTexture.source.sampleCount=4)),e}destroyGpuRenderTarget(t){t.contexts.forEach(t=>{t.unconfigure()}),t.msaaTextures.forEach(t=>{t.destroy()}),t.msaaTextures.length=0,t.contexts.length=0}ensureDepthStencilTexture(t){const e=this._renderTargetSystem.getGpuRenderTarget(t);t.depthStencilTexture&&e.msaa&&(t.depthStencilTexture.source.sampleCount=4)}resizeGpuRenderTarget(t){const e=this._renderTargetSystem.getGpuRenderTarget(t);e.width=t.width,e.height=t.height,e.msaa&&t.colorTextures.forEach((t,s)=>{const r=e.msaaTextures[s];r?.resize(t.source.width,t.source.height,t.source._resolution)})}}class at extends tt.l{constructor(t){super(t),this.adaptor=new nt,this.adaptor.init(t,this)}}at.extension={type:[r.Ag.WebGPUSystem],name:"renderTarget"};class ot{constructor(){this._gpuProgramData=Object.create(null)}contextChange(t){this._gpu=t}getProgramData(t){return this._gpuProgramData[t._layoutKey]||this._createGPUProgramData(t)}_createGPUProgramData(t){const e=this._gpu.device,s=t.gpuLayout.map(t=>e.createBindGroupLayout({entries:t})),r={bindGroupLayouts:s};return this._gpuProgramData[t._layoutKey]={bindGroups:s,pipeline:e.createPipelineLayout(r)},this._gpuProgramData[t._layoutKey]}destroy(){this._gpu=null,this._gpuProgramData=null}}ot.extension={type:[r.Ag.WebGPUSystem],name:"shader"};const lt={normal:{alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"}},add:{alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one",operation:"add"}},multiply:{alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"dst",dstFactor:"one-minus-src-alpha",operation:"add"}},screen:{alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}},overlay:{alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}},none:{alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"zero",operation:"add"}},"normal-npm":{alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"}},"add-npm":{alpha:{srcFactor:"one",dstFactor:"one",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one",operation:"add"}},"screen-npm":{alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src",operation:"add"}},erase:{alpha:{srcFactor:"zero",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"one-minus-src",operation:"add"}},min:{alpha:{srcFactor:"one",dstFactor:"one",operation:"min"},color:{srcFactor:"one",dstFactor:"one",operation:"min"}},max:{alpha:{srcFactor:"one",dstFactor:"one",operation:"max"},color:{srcFactor:"one",dstFactor:"one",operation:"max"}}};class ht{constructor(){this.defaultState=new y.U,this.defaultState.blend=!0}contextChange(t){this.gpu=t}getColorTargets(t){return[{format:"bgra8unorm",writeMask:0,blend:lt[t.blendMode]||lt.normal}]}destroy(){this.gpu=null}}ht.extension={type:[r.Ag.WebGPUSystem],name:"state"};var ct=s(1566);const ut={type:"image",upload(t,e,s){const r=t.resource,i=(0|t.pixelWidth)*(0|t.pixelHeight),n=r.byteLength/i;s.device.queue.writeTexture({texture:e},r,{offset:0,rowsPerImage:t.pixelHeight,bytesPerRow:t.pixelHeight*n},{width:t.pixelWidth,height:t.pixelHeight,depthOrArrayLayers:1})}},dt={"bc1-rgba-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"bc2-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc3-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc7-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"etc1-rgb-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"etc2-rgba8unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"astc-4x4-unorm":{blockBytes:16,blockWidth:4,blockHeight:4}},pt={blockBytes:4,blockWidth:1,blockHeight:1},ft={type:"compressed",upload(t,e,s){let r=t.pixelWidth,i=t.pixelHeight;const n=dt[t.format]||pt;for(let a=0;a<t.resource.length;a++){const o=t.resource[a],l=Math.ceil(r/n.blockWidth)*n.blockBytes;s.device.queue.writeTexture({texture:e,mipLevel:a},o,{offset:0,bytesPerRow:l},{width:Math.ceil(r/n.blockWidth)*n.blockWidth,height:Math.ceil(i/n.blockHeight)*n.blockHeight,depthOrArrayLayers:1}),r=Math.max(r>>1,1),i=Math.max(i>>1,1)}}},mt={type:"image",upload(t,e,s){const r=t.resource;if(!r)return;if(globalThis.HTMLImageElement&&r instanceof HTMLImageElement){const e=E.e.get().createCanvas(r.width,r.height);e.getContext("2d").drawImage(r,0,0,r.width,r.height),t.resource=e,(0,g.R)("ImageSource: Image element passed, converting to canvas and replacing resource.")}const i=Math.min(e.width,t.resourceWidth||t.pixelWidth),n=Math.min(e.height,t.resourceHeight||t.pixelHeight),a="premultiply-alpha-on-upload"===t.alphaMode;s.device.queue.copyExternalImageToTexture({source:r},{texture:e,premultipliedAlpha:a},{width:i,height:n})}},gt={type:"video",upload(t,e,s){mt.upload(t,e,s)}};class xt{constructor(t){this.device=t,this.sampler=t.createSampler({minFilter:"linear"}),this.pipelines={}}_getMipmapPipeline(t){let e=this.pipelines[t];return e||(this.mipmapShaderModule||(this.mipmapShaderModule=this.device.createShaderModule({code:"\n var<private> pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(\n vec2<f32>(-1.0, -1.0), vec2<f32>(-1.0, 3.0), vec2<f32>(3.0, -1.0));\n\n struct VertexOutput {\n @builtin(position) position : vec4<f32>,\n @location(0) texCoord : vec2<f32>,\n };\n\n @vertex\n fn vertexMain(@builtin(vertex_index) vertexIndex : u32) -> VertexOutput {\n var output : VertexOutput;\n output.texCoord = pos[vertexIndex] * vec2<f32>(0.5, -0.5) + vec2<f32>(0.5);\n output.position = vec4<f32>(pos[vertexIndex], 0.0, 1.0);\n return output;\n }\n\n @group(0) @binding(0) var imgSampler : sampler;\n @group(0) @binding(1) var img : texture_2d<f32>;\n\n @fragment\n fn fragmentMain(@location(0) texCoord : vec2<f32>) -> @location(0) vec4<f32> {\n return textureSample(img, imgSampler, texCoord);\n }\n "})),e=this.device.createRenderPipeline({layout:"auto",vertex:{module:this.mipmapShaderModule,entryPoint:"vertexMain"},fragment:{module:this.mipmapShaderModule,entryPoint:"fragmentMain",targets:[{format:t}]}}),this.pipelines[t]=e),e}generateMipmap(t){const e=this._getMipmapPipeline(t.format);if("3d"===t.dimension||"1d"===t.dimension)throw new Error("Generating mipmaps for non-2d textures is currently unsupported!");let s=t;const r=t.depthOrArrayLayers||1,i=t.usage&GPUTextureUsage.RENDER_ATTACHMENT;if(!i){const e={size:{width:Math.ceil(t.width/2),height:Math.ceil(t.height/2),depthOrArrayLayers:r},format:t.format,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT,mipLevelCount:t.mipLevelCount-1};s=this.device.createTexture(e)}const n=this.device.createCommandEncoder({}),a=e.getBindGroupLayout(0);for(let o=0;o<r;++o){let r=t.createView({baseMipLevel:0,mipLevelCount:1,dimension:"2d",baseArrayLayer:o,arrayLayerCount:1}),l=i?1:0;for(let i=1;i<t.mipLevelCount;++i){const t=s.createView({baseMipLevel:l++,mipLevelCount:1,dimension:"2d",baseArrayLayer:o,arrayLayerCount:1}),i=n.beginRenderPass({colorAttachments:[{view:t,storeOp:"store",loadOp:"clear",clearValue:{r:0,g:0,b:0,a:0}}]}),h=this.device.createBindGroup({layout:a,entries:[{binding:0,resource:this.sampler},{binding:1,resource:r}]});i.setPipeline(e),i.setBindGroup(0,h),i.draw(3,1,0,0),i.end(),r=t}}if(!i){const e={width:Math.ceil(t.width/2),height:Math.ceil(t.height/2),depthOrArrayLayers:r};for(let r=1;r<t.mipLevelCount;++r)n.copyTextureToTexture({texture:s,mipLevel:r-1},{texture:t,mipLevel:r},e),e.width=Math.ceil(e.width/2),e.height=Math.ceil(e.height/2)}return this.device.queue.submit([n.finish()]),i||s.destroy(),t}}class yt{constructor(t){this.managedTextures=[],this._gpuSources=Object.create(null),this._gpuSamplers=Object.create(null),this._bindGroupHash=Object.create(null),this._textureViewHash=Object.create(null),this._uploads={image:mt,buffer:ut,video:gt,compressed:ft},this._renderer=t,t.renderableGC.addManagedHash(this,"_gpuSources"),t.renderableGC.addManagedHash(this,"_gpuSamplers"),t.renderableGC.addManagedHash(this,"_bindGroupHash"),t.renderableGC.addManagedHash(this,"_textureViewHash")}contextChange(t){this._gpu=t}initSource(t){return this._gpuSources[t.uid]?this._gpuSources[t.uid]:this._initSource(t)}_initSource(t){if(t.autoGenerateMipmaps){const e=Math.max(t.pixelWidth,t.pixelHeight);t.mipLevelCount=Math.floor(Math.log2(e))+1}let e=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST;"compressed"!==t.uploadMethodId&&(e|=GPUTextureUsage.RENDER_ATTACHMENT,e|=GPUTextureUsage.COPY_SRC);const s=dt[t.format]||{blockBytes:4,blockWidth:1,blockHeight:1},r=Math.ceil(t.pixelWidth/s.blockWidth)*s.blockWidth,i=Math.ceil(t.pixelHeight/s.blockHeight)*s.blockHeight,n={label:t.label,size:{width:r,height:i},format:t.format,sampleCount:t.sampleCount,mipLevelCount:t.mipLevelCount,dimension:t.dimension,usage:e},a=this._gpuSources[t.uid]=this._gpu.device.createTexture(n);return this.managedTextures.includes(t)||(t.on("update",this.onSourceUpdate,this),t.on("resize",this.onSourceResize,this),t.on("destroy",this.onSourceDestroy,this),t.on("unload",this.onSourceUnload,this),t.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(t)),this.onSourceUpdate(t),a}onSourceUpdate(t){const e=this.getGpuSource(t);e&&(this._uploads[t.uploadMethodId]&&this._uploads[t.uploadMethodId].upload(t,e,this._gpu),t.autoGenerateMipmaps&&t.mipLevelCount>1&&this.onUpdateMipmaps(t))}onSourceUnload(t){const e=this._gpuSources[t.uid];e&&(this._gpuSources[t.uid]=null,e.destroy())}onUpdateMipmaps(t){this._mipmapGenerator||(this._mipmapGenerator=new xt(this._gpu.device));const e=this.getGpuSource(t);this._mipmapGenerator.generateMipmap(e)}onSourceDestroy(t){t.off("update",this.onSourceUpdate,this),t.off("unload",this.onSourceUnload,this),t.off("destroy",this.onSourceDestroy,this),t.off("resize",this.onSourceResize,this),t.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(t),1),this.onSourceUnload(t)}onSourceResize(t){const e=this._gpuSources[t.uid];e?e.width===t.pixelWidth&&e.height===t.pixelHeight||(this._textureViewHash[t.uid]=null,this._bindGroupHash[t.uid]=null,this.onSourceUnload(t),this.initSource(t)):this.initSource(t)}_initSampler(t){return this._gpuSamplers[t._resourceId]=this._gpu.device.createSampler(t),this._gpuSamplers[t._resourceId]}getGpuSampler(t){return this._gpuSamplers[t._resourceId]||this._initSampler(t)}getGpuSource(t){return this._gpuSources[t.uid]||this.initSource(t)}getTextureBindGroup(t){return this._bindGroupHash[t.uid]??this._createTextureBindGroup(t)}_createTextureBindGroup(t){const e=t.source;return this._bindGroupHash[t.uid]=new H.T({0:e,1:e.style,2:new d.k({uTextureMatrix:{type:"mat3x3<f32>",value:t.textureMatrix.mapCoord}})}),this._bindGroupHash[t.uid]}getTextureView(t){const e=t.source;return this._textureViewHash[e.uid]??this._createTextureView(e)}_createTextureView(t){return this._textureViewHash[t.uid]=this.getGpuSource(t).createView(),this._textureViewHash[t.uid]}generateCanvas(t){const e=this._renderer,s=e.gpu.device.createCommandEncoder(),r=E.e.get().createCanvas();r.width=t.source.pixelWidth,r.height=t.source.pixelHeight;const i=r.getContext("webgpu");return i.configure({device:e.gpu.device,usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC,format:E.e.get().getNavigator().gpu.getPreferredCanvasFormat(),alphaMode:"premultiplied"}),s.copyTextureToTexture({texture:e.texture.getGpuSource(t.source),origin:{x:0,y:0}},{texture:i.getCurrentTexture()},{width:r.width,height:r.height}),e.gpu.device.queue.submit([s.finish()]),r}getPixels(t){const e=this.generateCanvas(t),s=ct.N.getOptimalCanvasAndContext(e.width,e.height),r=s.context;r.drawImage(e,0,0);const{width:i,height:n}=e,a=r.getImageData(0,0,i,n),o=new Uint8ClampedArray(a.data.buffer);return ct.N.returnCanvasAndContext(s),{pixels:o,width:i,height:n}}destroy(){this.managedTextures.slice().forEach(t=>this.onSourceDestroy(t)),this.managedTextures=null;for(const t of Object.keys(this._bindGroupHash)){const e=Number(t),s=this._bindGroupHash[e];s?.destroy(),this._bindGroupHash[e]=null}this._gpu=null,this._mipmapGenerator=null,this._gpuSources=null,this._bindGroupHash=null,this._textureViewHash=null,this._gpuSamplers=null}}yt.extension={type:[r.Ag.WebGPUSystem],name:"texture"};const vt=[...w.i,X,k,M,R,C,yt,at,ot,ht,J,P,I,S],_t=[...w.f,q],bt=[_,x,p],wt=[],Tt=[],St=[];r.XO.handleByNamedList(r.Ag.WebGPUSystem,wt),r.XO.handleByNamedList(r.Ag.WebGPUPipes,Tt),r.XO.handleByNamedList(r.Ag.WebGPUPipesAdaptor,St),r.XO.add(...vt,..._t,...bt);class At extends b.k{constructor(){super({name:"webgpu",type:T.W.WEBGPU,systems:wt,renderPipes:Tt,renderPipeAdaptors:St})}}},8630:(t,e,s)=>{"use strict";var r;s.d(e,{H:()=>r}),function(t){t[t.Rectangle=0]="Rectangle",t[t.Circle=1]="Circle",t[t.Ellipse=2]="Ellipse",t[t.Polygon=3]="Polygon"}(r||(r={}))},8642:(t,e,s)=>{"use strict";s.d(e,{X:()=>n});const r=Object.create(null),i=Object.create(null);function n(t,e){let s=i[t];return void 0===s&&(void 0===r[e]&&(r[e]=1),i[t]=s=r[e]++),s}},8675:(t,e,s)=>{"use strict";var r=s(1065),i=s(4687),n=s(3880),a=s(3651);class o{constructor(t){this._lastTransform="",this._observer=null,this._tickerAttached=!1,this.updateTranslation=()=>{if(!this._canvas)return;const t=this._canvas.getBoundingClientRect(),e=this._canvas.width,s=this._canvas.height,r=t.width/e*this._renderer.resolution,i=t.height/s*this._renderer.resolution,n=`translate(${t.left}px, ${t.top}px) scale(${r}, ${i})`;n!==this._lastTransform&&(this._domElement.style.transform=n,this._lastTransform=n)},this._domElement=t.domElement,this._renderer=t.renderer,globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas||(this._canvas=this._renderer.canvas,this._attachObserver())}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation())}_attachObserver(){"ResizeObserver"in globalThis?(this._observer&&(this._observer.disconnect(),this._observer=null),this._observer=new ResizeObserver(t=>{for(const e of t){if(e.target!==this._canvas)continue;const t=this.canvas.width,s=this.canvas.height,r=e.contentRect.width/t*this._renderer.resolution,i=e.contentRect.height/s*this._renderer.resolution;(this._lastScaleX!==r||this._lastScaleY!==i)&&(this.updateTranslation(),this._lastScaleX=r,this._lastScaleY=i)}}),this._observer.observe(this._canvas)):this._tickerAttached||a.R.shared.add(this.updateTranslation,this,n.d.HIGH)}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&a.R.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=!1,this._lastTransform="",this._lastScaleX=null,this._lastScaleY=null}}var l=s(59);class h{constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=h.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new l.b,this.page=new l.b,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(t,e,s){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(t,e,s,r,i){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}var c=/iPhone/i,u=/iPod/i,d=/iPad/i,p=/\biOS-universal(?:.+)Mac\b/i,f=/\bAndroid(?:.+)Mobile\b/i,m=/Android/i,g=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,x=/Silk/i,y=/Windows Phone/i,v=/\bWindows(?:.+)ARM\b/i,_=/BlackBerry/i,b=/BB10/i,w=/Opera Mini/i,T=/\b(CriOS|Chrome)(?:.+)Mobile/i,S=/Mobile(?:.+)Firefox\b/i,A=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream};function C(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"==typeof navigator?"string"==typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var s=e.userAgent,r=s.split("[FBAN");void 0!==r[1]&&(s=r[0]),void 0!==(r=s.split("Twitter"))[1]&&(s=r[0]);var i=function(t){return function(e){return e.test(t)}}(s),n={apple:{phone:i(c)&&!i(y),ipod:i(u),tablet:!i(c)&&(i(d)||A(e))&&!i(y),universal:i(p),device:(i(c)||i(u)||i(d)||i(p)||A(e))&&!i(y)},amazon:{phone:i(g),tablet:!i(g)&&i(x),device:i(g)||i(x)},android:{phone:!i(y)&&i(g)||!i(y)&&i(f),tablet:!i(y)&&!i(g)&&!i(f)&&(i(x)||i(m)),device:!i(y)&&(i(g)||i(x)||i(f)||i(m))||i(/\bokhttp\b/i)},windows:{phone:i(y),tablet:i(v),device:i(y)||i(v)},other:{blackberry:i(_),blackberry10:i(b),opera:i(w),firefox:i(S),chrome:i(T),device:i(_)||i(b)||i(w)||i(S)||i(T)},any:!1,phone:!1,tablet:!1};return n.any=n.apple.device||n.android.device||n.windows.device||n.other.device,n.phone=n.apple.phone||n.android.phone||n.windows.phone,n.tablet=n.apple.tablet||n.android.tablet||n.windows.tablet,n}const P=(C.default??C)(globalThis.navigator);var E=s(4025);const M=class t{constructor(t,e=P){this._mobileInfo=e,this.debug=!1,this._activateOnTab=!0,this._deactivateOnMouseMove=!0,this._isActive=!1,this._isMobileAccessibility=!1,this._div=null,this._pool=[],this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._hookDiv=null,(e.tablet||e.phone)&&this._createTouchHook(),this._renderer=t}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}_createTouchHook(){const t=document.createElement("button");t.style.width="1px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.left="-1000px",t.style.zIndex=2..toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(t),this._hookDiv=t}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){if(this._isActive)return;this._isActive=!0,this._div||(this._div=document.createElement("div"),this._div.style.position="absolute",this._div.style.top="0px",this._div.style.left="0px",this._div.style.pointerEvents="none",this._div.style.zIndex=2..toString(),this._canvasObserver=new o({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&(this._onKeyDown=this._onKeyDown.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)),this._deactivateOnMouseMove&&(this._onMouseMove=this._onMouseMove.bind(this),globalThis.document.addEventListener("mousemove",this._onMouseMove,!0));const t=this._renderer.view.canvas;if(t.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else{const e=new MutationObserver(()=>{t.parentNode&&(e.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup())});e.observe(document.body,{childList:!0,subtree:!0})}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered)}_deactivate(){if(this._isActive&&!this._isMobileAccessibility){this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),this._activateOnTab&&globalThis.addEventListener("keydown",this._onKeyDown,!1),this._renderer.runners.postrender.remove(this);for(const t of this._children)t._accessibleDiv&&t._accessibleDiv.parentNode&&(t._accessibleDiv.parentNode.removeChild(t._accessibleDiv),t._accessibleDiv=null),t._accessibleActive=!1;this._pool.forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)}),this._div&&this._div.parentNode&&this._div.parentNode.removeChild(this._div),this._pool=[],this._children=[]}}_updateAccessibleObjects(t){if(!t.visible||!t.accessibleChildren)return;t.accessible&&(t._accessibleActive||this._addChild(t),t._renderId=this._renderId);const e=t.children;if(e)for(let t=0;t<e.length;t++)this._updateAccessibleObjects(e[t])}init(e){const s={accessibilityOptions:{...t.defaultOptions,...e?.accessibilityOptions||{}}};this.debug=s.accessibilityOptions.debug,this._activateOnTab=s.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=s.accessibilityOptions.deactivateOnMouseMove,s.accessibilityOptions.enabledByDefault?this._activate():this._activateOnTab&&(this._onKeyDown=this._onKeyDown.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)),this._renderer.runners.postrender.remove(this)}postrender(){const t=performance.now();if(this._mobileInfo.android.device&&t<this._androidUpdateCount)return;if(this._androidUpdateCount=t+this._androidUpdateFrequency,!this._renderer.renderingToScreen||!this._renderer.view.canvas)return;const e=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(const t of this._children)t._renderId===this._renderId&&e.add(this._children.indexOf(t))}for(let t=this._children.length-1;t>=0;t--){const s=this._children[t];e.has(t)||(s._accessibleDiv&&s._accessibleDiv.parentNode&&(s._accessibleDiv.parentNode.removeChild(s._accessibleDiv),this._pool.push(s._accessibleDiv),s._accessibleDiv=null),s._accessibleActive=!1,(0,E.d)(this._children,t,1))}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();for(let t=0;t<this._children.length;t++){const e=this._children[t];if(!e._accessibleActive||!e._accessibleDiv)continue;const s=e._accessibleDiv,r=e.hitArea||e.getBounds().rectangle;if(e.hitArea){const t=e.worldTransform;s.style.left=`${t.tx+r.x*t.a}px`,s.style.top=`${t.ty+r.y*t.d}px`,s.style.width=r.width*t.a+"px",s.style.height=r.height*t.d+"px"}else this._capHitArea(r),s.style.left=`${r.x}px`,s.style.top=`${r.y}px`,s.style.width=`${r.width}px`,s.style.height=`${r.height}px`}this._renderId++}_updateDebugHTML(t){t.innerHTML=`type: ${t.type}</br> title : ${t.title}</br> tabIndex: ${t.tabIndex}`}_capHitArea(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);const{width:e,height:s}=this._renderer;t.x+t.width>e&&(t.width=e-t.x),t.y+t.height>s&&(t.height=s-t.y)}_addChild(t){let e=this._pool.pop();e||("button"===t.accessibleType?e=document.createElement("button"):(e=document.createElement(t.accessibleType),e.style.cssText="\n color: transparent;\n pointer-events: none;\n padding: 0;\n margin: 0;\n border: 0;\n outline: 0;\n background: transparent;\n box-sizing: border-box;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n ",t.accessibleText&&(e.innerText=t.accessibleText)),e.style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2..toString(),e.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.style.pointerEvents=t.accessiblePointerEvents,e.type=t.accessibleType,t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title=`container ${t.tabIndex}`),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t.interactive?e.tabIndex=t.tabIndex:e.tabIndex=0,this.debug&&this._updateDebugHTML(e),t._accessibleActive=!0,t._accessibleDiv=e,e.container=t,this._children.push(t),this._div.appendChild(t._accessibleDiv)}_dispatchEvent(t,e){const{container:s}=t.target,r=this._renderer.events.rootBoundary,i=Object.assign(new h(r),{target:s});r.rootTarget=this._renderer.lastObjectRendered,e.forEach(t=>r.dispatchEvent(i,t))}_onClick(t){this._dispatchEvent(t,["click","pointertap","tap"])}_onFocus(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive"),this._dispatchEvent(t,["mouseover"])}_onFocusOut(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite"),this._dispatchEvent(t,["mouseout"])}_onKeyDown(t){9===t.keyCode&&this._activateOnTab&&this._activate()}_onMouseMove(t){0===t.movementX&&0===t.movementY||this._deactivate()}destroy(){this._deactivate(),this._destroyTouchHook(),this._canvasObserver?.destroy(),this._canvasObserver=null,this._div=null,this._pool=null,this._children=null,this._renderer=null,this._activateOnTab&&globalThis.removeEventListener("keydown",this._onKeyDown)}setAccessibilityEnabled(t){t?this._activate():this._deactivate()}};M.extension={type:[r.Ag.WebGLSystem,r.Ag.WebGPUSystem],name:"accessibility"},M.defaultOptions={enabledByDefault:!1,debug:!1,activateOnTab:!0,deactivateOnMouseMove:!0};let k=M;r.XO.add(k),r.XO.mixin(i.mc,{accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,accessibleType:"button",accessibleText:null,accessiblePointerEvents:"auto",accessibleChildren:!0,_accessibleActive:!1,_accessibleDiv:null,_renderId:-1}),s(3046);var R=s(4872),B=s(7694);const I=new class{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}init(t){this.removeTickerListener(),this.events=t,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(t){this._pauseUpdate=t}addTickerListener(){!this._tickerAdded&&this.domElement&&(a.R.system.add(this._tickerUpdate,this,n.d.INTERACTION),this._tickerAdded=!0)}removeTickerListener(){this._tickerAdded&&(a.R.system.remove(this._tickerUpdate,this),this._tickerAdded=!1)}pointerMoved(){this._didMove=!0}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove)return void(this._didMove=!1);const t=this.events._rootPointerEvent;this.events.supportsTouchEvents&&"touch"===t.pointerType||globalThis.document.dispatchEvent(this.events.supportsPointerEvents?new PointerEvent("pointermove",{clientX:t.clientX,clientY:t.clientY,pointerType:t.pointerType,pointerId:t.pointerId}):new MouseEvent("mousemove",{clientX:t.clientX,clientY:t.clientY}))}_tickerUpdate(t){this._deltaTime+=t.deltaTime,this._deltaTime<this.interactionFrequency||(this._deltaTime=0,this._update())}destroy(){this.removeTickerListener(),this.events=null,this.domElement=null,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}};class F extends h{constructor(){super(...arguments),this.client=new l.b,this.movement=new l.b,this.offset=new l.b,this.global=new l.b,this.screen=new l.b}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(t,e,s){return t.worldTransform.applyInverse(s||this.global,e)}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,s,r,i,n,a,o,l,h,c,u,d,p,f){throw new Error("Method not implemented.")}}class D extends F{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class O extends F{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}O.DOM_DELTA_PIXEL=0,O.DOM_DELTA_LINE=1,O.DOM_DELTA_PAGE=2;const G=new l.b,U=new l.b;class L{constructor(t){this.dispatch=new R.A,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=t,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping("pointerdown",this.mapPointerDown),this.addEventMapping("pointermove",this.mapPointerMove),this.addEventMapping("pointerout",this.mapPointerOut),this.addEventMapping("pointerleave",this.mapPointerOut),this.addEventMapping("pointerover",this.mapPointerOver),this.addEventMapping("pointerup",this.mapPointerUp),this.addEventMapping("pointerupoutside",this.mapPointerUpOutside),this.addEventMapping("wheel",this.mapWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((t,e)=>t.priority-e.priority)}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){if(!this.rootTarget)return;const e=this.mappingTable[t.type];if(e)for(let s=0,r=e.length;s<r;s++)e[s].fn(t);else(0,B.R)(`[EventBoundary]: Event mapping not defined for ${t.type}`)}hitTest(t,e){I.pauseUpdate=!0;const s=this[this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive"](this.rootTarget,this.rootTarget.eventMode,G.set(t,e),this.hitTestFn,this.hitPruneFn);return s&&s[0]}propagate(t,e){if(!t.target)return;const s=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let r=0,i=s.length-1;r<i;r++)if(t.currentTarget=s[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(let r=s.length-2;r>=0;r--)if(t.currentTarget=s[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}all(t,e,s=this._allInteractiveElements){if(0===s.length)return;t.eventPhase=t.BUBBLING_PHASE;const r=Array.isArray(e)?e:[e];for(let e=s.length-1;e>=0;e--)r.forEach(r=>{t.currentTarget=s[e],this.notifyTarget(t,r)})}propagationPath(t){const e=[t];for(let s=0;s<2048&&t!==this.rootTarget&&t.parent;s++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}hitTestMoveRecursive(t,e,s,r,i,n=!1){let a=!1;if(this._interactivePrune(t))return null;if("dynamic"!==t.eventMode&&"dynamic"!==e||(I.pauseUpdate=!1),t.interactiveChildren&&t.children){const o=t.children;for(let l=o.length-1;l>=0;l--){const h=o[l],c=this.hitTestMoveRecursive(h,this._isInteractive(e)?e:h.eventMode,s,r,i,n||i(t,s));if(c){if(c.length>0&&!c[c.length-1].parent)continue;const e=t.isInteractive();(c.length>0||e)&&(e&&this._allInteractiveElements.push(t),c.push(t)),0===this._hitElements.length&&(this._hitElements=c),a=!0}}}const o=this._isInteractive(e),l=t.isInteractive();return l&&l&&this._allInteractiveElements.push(t),n||this._hitElements.length>0?null:a?this._hitElements:o&&!i(t,s)&&r(t,s)?l?[t]:[]:null}hitTestRecursive(t,e,s,r,i){if(this._interactivePrune(t)||i(t,s))return null;if("dynamic"!==t.eventMode&&"dynamic"!==e||(I.pauseUpdate=!1),t.interactiveChildren&&t.children){const n=t.children,a=s;for(let s=n.length-1;s>=0;s--){const o=n[s],l=this.hitTestRecursive(o,this._isInteractive(e)?e:o.eventMode,a,r,i);if(l){if(l.length>0&&!l[l.length-1].parent)continue;const e=t.isInteractive();return(l.length>0||e)&&l.push(t),l}}}const n=this._isInteractive(e),a=t.isInteractive();return n&&r(t,s)?a?[t]:[]:null}_isInteractive(t){return"static"===t||"dynamic"===t}_interactivePrune(t){return!(t&&t.visible&&t.renderable&&t.measurable)||"none"===t.eventMode||"passive"===t.eventMode&&!t.interactiveChildren}hitPruneFn(t,e){if(t.hitArea&&(t.worldTransform.applyInverse(e,U),!t.hitArea.contains(U.x,U.y)))return!0;if(t.effects&&t.effects.length)for(let s=0;s<t.effects.length;s++){const r=t.effects[s];if(r.containsPoint&&!r.containsPoint(e,this.hitTestFn))return!0}return!1}hitTestFn(t,e){return!!t.hitArea||!!t?.containsPoint&&(t.worldTransform.applyInverse(e,U),t.containsPoint(U))}notifyTarget(t,e){if(!t.currentTarget.isInteractive())return;e??(e=t.type);const s=`on${e}`;t.currentTarget[s]?.(t);const r=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this._notifyListeners(t,r),t.eventPhase===t.AT_TARGET&&this._notifyListeners(t,e)}mapPointerDown(t){if(!(t instanceof D))return void(0,B.R)("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.createPointerEvent(t);if(this.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)this.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){const t=2===e.button;this.dispatchEvent(e,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),this.freeEvent(e)}mapPointerMove(t){if(!(t instanceof D))return void(0,B.R)("EventBoundary cannot map a non-pointer event as a pointer event");this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const e=this.createPointerEvent(t);this._isPointerMoveEvent=!1;const s="mouse"===e.pointerType||"pen"===e.pointerType,r=this.trackingData(t.pointerId),i=this.findMountedTarget(r.overTargets);if(r.overTargets?.length>0&&i!==e.target){const r="mousemove"===t.type?"mouseout":"pointerout",n=this.createPointerEvent(t,r,i);if(this.dispatchEvent(n,"pointerout"),s&&this.dispatchEvent(n,"mouseout"),!e.composedPath().includes(i)){const r=this.createPointerEvent(t,"pointerleave",i);for(r.eventPhase=r.AT_TARGET;r.target&&!e.composedPath().includes(r.target);)r.currentTarget=r.target,this.notifyTarget(r),s&&this.notifyTarget(r,"mouseleave"),r.target=r.target.parent;this.freeEvent(r)}this.freeEvent(n)}if(i!==e.target){const r="mousemove"===t.type?"mouseover":"pointerover",n=this.clonePointerEvent(e,r);this.dispatchEvent(n,"pointerover"),s&&this.dispatchEvent(n,"mouseover");let a=i?.parent;for(;a&&a!==this.rootTarget.parent&&a!==e.target;)a=a.parent;if(!a||a===this.rootTarget.parent){const t=this.clonePointerEvent(e,"pointerenter");for(t.eventPhase=t.AT_TARGET;t.target&&t.target!==i&&t.target!==this.rootTarget.parent;)t.currentTarget=t.target,this.notifyTarget(t),s&&this.notifyTarget(t,"mouseenter"),t.target=t.target.parent;this.freeEvent(t)}this.freeEvent(n)}const n=[],a=this.enableGlobalMoveEvents??!0;this.moveOnAll?n.push("pointermove"):this.dispatchEvent(e,"pointermove"),a&&n.push("globalpointermove"),"touch"===e.pointerType&&(this.moveOnAll?n.splice(1,0,"touchmove"):this.dispatchEvent(e,"touchmove"),a&&n.push("globaltouchmove")),s&&(this.moveOnAll?n.splice(1,0,"mousemove"):this.dispatchEvent(e,"mousemove"),a&&n.push("globalmousemove"),this.cursor=e.target?.cursor),n.length>0&&this.all(e,n),this._allInteractiveElements.length=0,this._hitElements.length=0,r.overTargets=e.composedPath(),this.freeEvent(e)}mapPointerOver(t){if(!(t instanceof D))return void(0,B.R)("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.trackingData(t.pointerId),s=this.createPointerEvent(t),r="mouse"===s.pointerType||"pen"===s.pointerType;this.dispatchEvent(s,"pointerover"),r&&this.dispatchEvent(s,"mouseover"),"mouse"===s.pointerType&&(this.cursor=s.target?.cursor);const i=this.clonePointerEvent(s,"pointerenter");for(i.eventPhase=i.AT_TARGET;i.target&&i.target!==this.rootTarget.parent;)i.currentTarget=i.target,this.notifyTarget(i),r&&this.notifyTarget(i,"mouseenter"),i.target=i.target.parent;e.overTargets=s.composedPath(),this.freeEvent(s),this.freeEvent(i)}mapPointerOut(t){if(!(t instanceof D))return void(0,B.R)("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.trackingData(t.pointerId);if(e.overTargets){const s="mouse"===t.pointerType||"pen"===t.pointerType,r=this.findMountedTarget(e.overTargets),i=this.createPointerEvent(t,"pointerout",r);this.dispatchEvent(i),s&&this.dispatchEvent(i,"mouseout");const n=this.createPointerEvent(t,"pointerleave",r);for(n.eventPhase=n.AT_TARGET;n.target&&n.target!==this.rootTarget.parent;)n.currentTarget=n.target,this.notifyTarget(n),s&&this.notifyTarget(n,"mouseleave"),n.target=n.target.parent;e.overTargets=null,this.freeEvent(i),this.freeEvent(n)}this.cursor=null}mapPointerUp(t){if(!(t instanceof D))return void(0,B.R)("EventBoundary cannot map a non-pointer event as a pointer event");const e=performance.now(),s=this.createPointerEvent(t);if(this.dispatchEvent(s,"pointerup"),"touch"===s.pointerType)this.dispatchEvent(s,"touchend");else if("mouse"===s.pointerType||"pen"===s.pointerType){const t=2===s.button;this.dispatchEvent(s,t?"rightup":"mouseup")}const r=this.trackingData(t.pointerId),i=this.findMountedTarget(r.pressTargetsByButton[t.button]);let n=i;if(i&&!s.composedPath().includes(i)){let e=i;for(;e&&!s.composedPath().includes(e);){if(s.currentTarget=e,this.notifyTarget(s,"pointerupoutside"),"touch"===s.pointerType)this.notifyTarget(s,"touchendoutside");else if("mouse"===s.pointerType||"pen"===s.pointerType){const t=2===s.button;this.notifyTarget(s,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete r.pressTargetsByButton[t.button],n=e}if(n){const i=this.clonePointerEvent(s,"click");i.target=n,i.path=null,r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:i.target,timeStamp:e});const a=r.clicksByButton[t.button];if(a.target===i.target&&e-a.timeStamp<200?++a.clickCount:a.clickCount=1,a.target=i.target,a.timeStamp=e,i.detail=a.clickCount,"mouse"===i.pointerType){const t=2===i.button;this.dispatchEvent(i,t?"rightclick":"click")}else"touch"===i.pointerType&&this.dispatchEvent(i,"tap");this.dispatchEvent(i,"pointertap"),this.freeEvent(i)}this.freeEvent(s)}mapPointerUpOutside(t){if(!(t instanceof D))return void(0,B.R)("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.trackingData(t.pointerId),s=this.findMountedTarget(e.pressTargetsByButton[t.button]),r=this.createPointerEvent(t);if(s){let i=s;for(;i;)r.currentTarget=i,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType?this.notifyTarget(r,"touchendoutside"):"mouse"!==r.pointerType&&"pen"!==r.pointerType||this.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),i=i.parent;delete e.pressTargetsByButton[t.button]}this.freeEvent(r)}mapWheel(t){if(!(t instanceof O))return void(0,B.R)("EventBoundary cannot map a non-wheel event as a wheel event");const e=this.createWheelEvent(t);this.dispatchEvent(e),this.freeEvent(e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let s=1;s<t.length&&t[s].parent===e;s++)e=t[s];return e}createPointerEvent(t,e,s){const r=this.allocateEvent(D);return this.copyPointerData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.nativeEvent=t.nativeEvent,r.originalEvent=t,r.target=s??this.hitTest(r.global.x,r.global.y)??this._hitElements[0],"string"==typeof e&&(r.type=e),r}createWheelEvent(t){const e=this.allocateEvent(O);return this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t,e.target=this.hitTest(e.global.x,e.global.y),e}clonePointerEvent(t,e){const s=this.allocateEvent(D);return s.nativeEvent=t.nativeEvent,s.originalEvent=t.originalEvent,this.copyPointerData(t,s),this.copyMouseData(t,s),this.copyData(t,s),s.target=t.target,s.path=t.composedPath().slice(),s.type=e??s.type,s}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof D&&e instanceof D&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)}copyMouseData(t,e){t instanceof F&&e instanceof F&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.copyFrom(t.client),e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.copyFrom(t.movement),e.screen.copyFrom(t.screen),e.shiftKey=t.shiftKey,e.global.copyFrom(t.global))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.copyFrom(t.layer),e.page.copyFrom(t.page)}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){this.eventPool.has(t)||this.eventPool.set(t,[]);const e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.defaultPrevented=!1,e.path=null,e.target=null,e}freeEvent(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");const e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}_notifyListeners(t,e){const s=t.currentTarget._events[e];if(s)if("fn"in s)s.once&&t.currentTarget.removeListener(e,s.fn,void 0,!0),s.fn.call(s.context,t);else for(let r=0,i=s.length;r<i&&!t.propagationImmediatelyStopped;r++)s[r].once&&t.currentTarget.removeListener(e,s[r].fn,void 0,!0),s[r].fn.call(s[r].context,t)}}const N={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},X=class t{constructor(e){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=e,this.rootBoundary=new L(null),I.init(this),this.autoPreventDefault=!0,this._eventsAdded=!1,this._rootPointerEvent=new D(null),this._rootWheelEvent=new O(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...t.defaultEventFeatures},{set:(t,e,s)=>("globalMove"===e&&(this.rootBoundary.enableGlobalMoveEvents=s),t[e]=s,!0)}),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerOverOut=this._onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{canvas:s,resolution:r}=this.renderer;this.setTargetElement(s),this.resolution=r,t._defaultEventMode=e.eventMode??"passive",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(t){this.resolution=t}destroy(){I.destroy(),this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(t){t||(t="default");let e=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(e=!1),this._currentCursor===t)return;this._currentCursor=t;const s=this.cursorStyles[t];if(s)switch(typeof s){case"string":e&&(this.domElement.style.cursor=s);break;case"function":s(t);break;case"object":e&&Object.assign(this.domElement.style,s)}else e&&"string"==typeof t&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.domElement.style.cursor=t)}get pointer(){return this._rootPointerEvent}_onPointerDown(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this._normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(let t=0,s=e.length;t<s;t++){const s=e[t],r=this._bootstrapEvent(this._rootPointerEvent,s);this.rootBoundary.mapEvent(r)}this.setCursor(this.rootBoundary.cursor)}_onPointerMove(t){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,I.pointerMoved();const e=this._normalizeToPointerData(t);for(let t=0,s=e.length;t<s;t++){const s=this._bootstrapEvent(this._rootPointerEvent,e[t]);this.rootBoundary.mapEvent(s)}this.setCursor(this.rootBoundary.cursor)}_onPointerUp(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let e=t.target;t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]);const s=e!==this.domElement?"outside":"",r=this._normalizeToPointerData(t);for(let t=0,e=r.length;t<e;t++){const e=this._bootstrapEvent(this._rootPointerEvent,r[t]);e.type+=s,this.rootBoundary.mapEvent(e)}this.setCursor(this.rootBoundary.cursor)}_onPointerOverOut(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this._normalizeToPointerData(t);for(let t=0,s=e.length;t<s;t++){const s=this._bootstrapEvent(this._rootPointerEvent,e[t]);this.rootBoundary.mapEvent(s)}this.setCursor(this.rootBoundary.cursor)}onWheel(t){if(!this.features.wheel)return;const e=this.normalizeWheelEvent(t);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(e)}setTargetElement(t){this._removeEvents(),this.domElement=t,I.domElement=t,this._addEvents()}_addEvents(){if(this._eventsAdded||!this.domElement)return;I.addTickerListener();const t=this.domElement.style;t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this._onPointerMove,!0),this.domElement.addEventListener("pointerdown",this._onPointerDown,!0),this.domElement.addEventListener("pointerleave",this._onPointerOverOut,!0),this.domElement.addEventListener("pointerover",this._onPointerOverOut,!0),globalThis.addEventListener("pointerup",this._onPointerUp,!0)):(globalThis.document.addEventListener("mousemove",this._onPointerMove,!0),this.domElement.addEventListener("mousedown",this._onPointerDown,!0),this.domElement.addEventListener("mouseout",this._onPointerOverOut,!0),this.domElement.addEventListener("mouseover",this._onPointerOverOut,!0),globalThis.addEventListener("mouseup",this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this._onPointerDown,!0),this.domElement.addEventListener("touchend",this._onPointerUp,!0),this.domElement.addEventListener("touchmove",this._onPointerMove,!0))),this.domElement.addEventListener("wheel",this.onWheel,{passive:!0,capture:!0}),this._eventsAdded=!0}_removeEvents(){if(!this._eventsAdded||!this.domElement)return;I.removeTickerListener();const t=this.domElement.style;t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction="")),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this._onPointerMove,!0),this.domElement.removeEventListener("pointerdown",this._onPointerDown,!0),this.domElement.removeEventListener("pointerleave",this._onPointerOverOut,!0),this.domElement.removeEventListener("pointerover",this._onPointerOverOut,!0),globalThis.removeEventListener("pointerup",this._onPointerUp,!0)):(globalThis.document.removeEventListener("mousemove",this._onPointerMove,!0),this.domElement.removeEventListener("mousedown",this._onPointerDown,!0),this.domElement.removeEventListener("mouseout",this._onPointerOverOut,!0),this.domElement.removeEventListener("mouseover",this._onPointerOverOut,!0),globalThis.removeEventListener("mouseup",this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this._onPointerDown,!0),this.domElement.removeEventListener("touchend",this._onPointerUp,!0),this.domElement.removeEventListener("touchmove",this._onPointerMove,!0))),this.domElement.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this._eventsAdded=!1}mapPositionToPoint(t,e,s){const r=this.domElement.isConnected?this.domElement.getBoundingClientRect():{x:0,y:0,width:this.domElement.width,height:this.domElement.height,left:0,top:0},i=1/this.resolution;t.x=(e-r.left)*(this.domElement.width/r.width)*i,t.y=(s-r.top)*(this.domElement.height/r.height)*i}_normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t instanceof TouchEvent)for(let s=0,r=t.changedTouches.length;s<r;s++){const r=t.changedTouches[s];void 0===r.button&&(r.button=0),void 0===r.buttons&&(r.buttons=1),void 0===r.isPrimary&&(r.isPrimary=1===t.touches.length&&"touchstart"===t.type),void 0===r.width&&(r.width=r.radiusX||1),void 0===r.height&&(r.height=r.radiusY||1),void 0===r.tiltX&&(r.tiltX=0),void 0===r.tiltY&&(r.tiltY=0),void 0===r.pointerType&&(r.pointerType="touch"),void 0===r.pointerId&&(r.pointerId=r.identifier||0),void 0===r.pressure&&(r.pressure=r.force||.5),void 0===r.twist&&(r.twist=0),void 0===r.tangentialPressure&&(r.tangentialPressure=0),void 0===r.layerX&&(r.layerX=r.offsetX=r.clientX),void 0===r.layerY&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,r.type=t.type,e.push(r)}else if(!globalThis.MouseEvent||t instanceof MouseEvent&&!(this.supportsPointerEvents&&t instanceof globalThis.PointerEvent)){const s=t;void 0===s.isPrimary&&(s.isPrimary=!0),void 0===s.width&&(s.width=1),void 0===s.height&&(s.height=1),void 0===s.tiltX&&(s.tiltX=0),void 0===s.tiltY&&(s.tiltY=0),void 0===s.pointerType&&(s.pointerType="mouse"),void 0===s.pointerId&&(s.pointerId=1),void 0===s.pressure&&(s.pressure=.5),void 0===s.twist&&(s.twist=0),void 0===s.tangentialPressure&&(s.tangentialPressure=0),s.isNormalized=!0,e.push(s)}else e.push(t);return e}normalizeWheelEvent(t){const e=this._rootWheelEvent;return this._transferMouseData(e,t),e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,e.deltaMode=t.deltaMode,this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.nativeEvent=t,e.type=t.type,e}_bootstrapEvent(t,e){return t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this._transferMouseData(t,e),this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=N[t.type]||t.type),t}_transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null,t.shiftKey=e.shiftKey}};X.extension={name:"events",type:[r.Ag.WebGLSystem,r.Ag.CanvasSystem,r.Ag.WebGPUSystem],priority:-1},X.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let Y=X;const V={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return"dynamic"===this.eventMode||"static"===this.eventMode},set interactive(t){this.eventMode=t?"static":"passive"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??Y.defaultEventMode},set eventMode(t){this._internalEventMode=t},isInteractive(){return"static"===this.eventMode||"dynamic"===this.eventMode},interactiveChildren:!0,hitArea:null,addEventListener(t,e,s){const r="boolean"==typeof s&&s||"object"==typeof s&&s.capture,i="object"==typeof s?s.signal:void 0,n="object"==typeof s&&!0===s.once,a="function"==typeof e?void 0:e;t=r?`${t}capture`:t;const o="function"==typeof e?e:e.handleEvent,l=this;i&&i.addEventListener("abort",()=>{l.off(t,o,a)}),n?l.once(t,o,a):l.on(t,o,a)},removeEventListener(t,e,s){const r="function"==typeof e?void 0:e;t="boolean"==typeof s&&s||"object"==typeof s&&s.capture?`${t}capture`:t,e="function"==typeof e?e:e.handleEvent,this.off(t,e,r)},dispatchEvent(t){if(!(t instanceof h))throw new Error("Container cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=null,t.target=this,t.manager.dispatchEvent(t),!t.defaultPrevented}};r.XO.add(Y),r.XO.mixin(i.mc,V);class z{constructor(t){this._attachedDomElements=[],this._renderer=t,this._renderer.runners.postrender.add(this),this._renderer.runners.init.add(this),this._domElement=document.createElement("div"),this._domElement.style.position="absolute",this._domElement.style.top="0",this._domElement.style.left="0",this._domElement.style.pointerEvents="none",this._domElement.style.zIndex="1000"}init(){this._canvasObserver=new o({domElement:this._domElement,renderer:this._renderer})}addRenderable(t,e){this._attachedDomElements.includes(t)||this._attachedDomElements.push(t)}updateRenderable(t){}validateRenderable(t){return!0}postrender(){const t=this._attachedDomElements;if(0!==t.length){this._canvasObserver.ensureAttached();for(let e=0;e<t.length;e++){const s=t[e],r=s.element;if(!s.parent||s.globalDisplayStatus<7)r?.remove(),t.splice(e,1),e--;else{this._domElement.contains(r)||(r.style.position="absolute",r.style.pointerEvents="auto",this._domElement.appendChild(r));const t=s.worldTransform,e=s._anchor,i=s.width*e.x,n=s.height*e.y;r.style.transformOrigin=`${i}px ${n}px`,r.style.transform=`matrix(${t.a}, ${t.b}, ${t.c}, ${t.d}, ${t.tx-i}, ${t.ty-n})`,r.style.opacity=s.groupAlpha.toString()}}}else this._domElement.remove()}destroy(){this._renderer.runners.postrender.remove(this);for(let t=0;t<this._attachedDomElements.length;t++){const e=this._attachedDomElements[t];e.element?.remove()}this._attachedDomElements.length=0,this._domElement.remove(),this._canvasObserver.destroy(),this._renderer=null}}z.extension={type:[r.Ag.WebGLPipes,r.Ag.WebGPUPipes,r.Ag.CanvasPipes],name:"dom"},r.XO.add(z),s(2517),s(2542),s(3050),s(8427),s(6131),s(6934),s(966),s(6841),s(9797),s(4550),s(8122)},8714:function(t,e,s){var r;r=function(){return function(t){var e={};function s(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,s),i.l=!0,i.exports}return s.m=t,s.c=e,s.d=function(t,e,r){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(s.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)s.d(r,i,function(e){return t[e]}.bind(null,i));return r},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=20)}([function(t,e){var r={};t.exports=r,function(){r._baseDelta=1e3/60,r._nextId=0,r._seed=0,r._nowStartTime=+new Date,r._warnedOnce={},r._decomp=null,r.extend=function(t,e){var s,i;"boolean"==typeof e?(s=2,i=e):(s=1,i=!0);for(var n=s;n<arguments.length;n++){var a=arguments[n];if(a)for(var o in a)i&&a[o]&&a[o].constructor===Object?t[o]&&t[o].constructor!==Object?t[o]=a[o]:(t[o]=t[o]||{},r.extend(t[o],i,a[o])):t[o]=a[o]}return t},r.clone=function(t,e){return r.extend({},e,t)},r.keys=function(t){if(Object.keys)return Object.keys(t);var e=[];for(var s in t)e.push(s);return e},r.values=function(t){var e=[];if(Object.keys){for(var s=Object.keys(t),r=0;r<s.length;r++)e.push(t[s[r]]);return e}for(var i in t)e.push(t[i]);return e},r.get=function(t,e,s,r){e=e.split(".").slice(s,r);for(var i=0;i<e.length;i+=1)t=t[e[i]];return t},r.set=function(t,e,s,i,n){var a=e.split(".").slice(i,n);return r.get(t,e,0,-1)[a[a.length-1]]=s,s},r.shuffle=function(t){for(var e=t.length-1;e>0;e--){var s=Math.floor(r.random()*(e+1)),i=t[e];t[e]=t[s],t[s]=i}return t},r.choose=function(t){return t[Math.floor(r.random()*t.length)]},r.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},r.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},r.isFunction=function(t){return"function"==typeof t},r.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},r.isString=function(t){return"[object String]"===toString.call(t)},r.clamp=function(t,e,s){return t<e?e:t>s?s:t},r.sign=function(t){return t<0?-1:1},r.now=function(){if("undefined"!=typeof window&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return Date.now?Date.now():new Date-r._nowStartTime},r.random=function(e,s){return s=void 0!==s?s:1,(e=void 0!==e?e:0)+t()*(s-e)};var t=function(){return r._seed=(9301*r._seed+49297)%233280,r._seed/233280};r.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},r.logLevel=1,r.log=function(){console&&r.logLevel>0&&r.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.info=function(){console&&r.logLevel>0&&r.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.warn=function(){console&&r.logLevel>0&&r.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.warnOnce=function(){var t=Array.prototype.slice.call(arguments).join(" ");r._warnedOnce[t]||(r.warn(t),r._warnedOnce[t]=!0)},r.deprecated=function(t,e,s){t[e]=r.chain(function(){r.warnOnce("🔅 deprecated 🔅",s)},t[e])},r.nextId=function(){return r._nextId++},r.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var s=0;s<t.length;s++)if(t[s]===e)return s;return-1},r.map=function(t,e){if(t.map)return t.map(e);for(var s=[],r=0;r<t.length;r+=1)s.push(e(t[r]));return s},r.topologicalSort=function(t){var e=[],s=[],i=[];for(var n in t)s[n]||i[n]||r._topologicalSort(n,s,i,t,e);return e},r._topologicalSort=function(t,e,s,i,n){var a=i[t]||[];s[t]=!0;for(var o=0;o<a.length;o+=1){var l=a[o];s[l]||e[l]||r._topologicalSort(l,e,s,i,n)}s[t]=!1,e[t]=!0,n.push(t)},r.chain=function(){for(var t=[],e=0;e<arguments.length;e+=1){var s=arguments[e];s._chained?t.push.apply(t,s._chained):t.push(s)}var r=function(){for(var e,s=new Array(arguments.length),r=0,i=arguments.length;r<i;r++)s[r]=arguments[r];for(r=0;r<t.length;r+=1){var n=t[r].apply(e,s);void 0!==n&&(e=n)}return e};return r._chained=t,r},r.chainPathBefore=function(t,e,s){return r.set(t,e,r.chain(s,r.get(t,e)))},r.chainPathAfter=function(t,e,s){return r.set(t,e,r.chain(r.get(t,e),s))},r.setDecomp=function(t){r._decomp=t},r.getDecomp=function(){var t=r._decomp;try{t||"undefined"==typeof window||(t=window.decomp),t||void 0===s.g||(t=s.g.decomp)}catch(e){t=null}return t}}()},function(t,e){var s={};t.exports=s,s.create=function(t){var e={min:{x:0,y:0},max:{x:0,y:0}};return t&&s.update(e,t),e},s.update=function(t,e,s){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var r=0;r<e.length;r++){var i=e[r];i.x>t.max.x&&(t.max.x=i.x),i.x<t.min.x&&(t.min.x=i.x),i.y>t.max.y&&(t.max.y=i.y),i.y<t.min.y&&(t.min.y=i.y)}s&&(s.x>0?t.max.x+=s.x:t.min.x+=s.x,s.y>0?t.max.y+=s.y:t.min.y+=s.y)},s.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},s.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},s.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},s.shift=function(t,e){var s=t.max.x-t.min.x,r=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+s,t.min.y=e.y,t.max.y=e.y+r}},function(t,e){var s={};t.exports=s,s.create=function(t,e){return{x:t||0,y:e||0}},s.clone=function(t){return{x:t.x,y:t.y}},s.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},s.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},s.rotate=function(t,e,s){var r=Math.cos(e),i=Math.sin(e);s||(s={});var n=t.x*r-t.y*i;return s.y=t.x*i+t.y*r,s.x=n,s},s.rotateAbout=function(t,e,s,r){var i=Math.cos(e),n=Math.sin(e);r||(r={});var a=s.x+((t.x-s.x)*i-(t.y-s.y)*n);return r.y=s.y+((t.x-s.x)*n+(t.y-s.y)*i),r.x=a,r},s.normalise=function(t){var e=s.magnitude(t);return 0===e?{x:0,y:0}:{x:t.x/e,y:t.y/e}},s.dot=function(t,e){return t.x*e.x+t.y*e.y},s.cross=function(t,e){return t.x*e.y-t.y*e.x},s.cross3=function(t,e,s){return(e.x-t.x)*(s.y-t.y)-(e.y-t.y)*(s.x-t.x)},s.add=function(t,e,s){return s||(s={}),s.x=t.x+e.x,s.y=t.y+e.y,s},s.sub=function(t,e,s){return s||(s={}),s.x=t.x-e.x,s.y=t.y-e.y,s},s.mult=function(t,e){return{x:t.x*e,y:t.y*e}},s.div=function(t,e){return{x:t.x/e,y:t.y/e}},s.perp=function(t,e){return{x:(e=!0===e?-1:1)*-t.y,y:e*t.x}},s.neg=function(t){return{x:-t.x,y:-t.y}},s.angle=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},s._temp=[s.create(),s.create(),s.create(),s.create(),s.create(),s.create()]},function(t,e,s){var r={};t.exports=r;var i=s(2),n=s(0);r.create=function(t,e){for(var s=[],r=0;r<t.length;r++){var i=t[r],n={x:i.x,y:i.y,index:r,body:e,isInternal:!1};s.push(n)}return s},r.fromPath=function(t,e){var s=[];return t.replace(/L?\s*([-\d.e]+)[\s,]*([-\d.e]+)*/gi,function(t,e,r){s.push({x:parseFloat(e),y:parseFloat(r)})}),r.create(s,e)},r.centre=function(t){for(var e,s,n,a=r.area(t,!0),o={x:0,y:0},l=0;l<t.length;l++)n=(l+1)%t.length,e=i.cross(t[l],t[n]),s=i.mult(i.add(t[l],t[n]),e),o=i.add(o,s);return i.div(o,6*a)},r.mean=function(t){for(var e={x:0,y:0},s=0;s<t.length;s++)e.x+=t[s].x,e.y+=t[s].y;return i.div(e,t.length)},r.area=function(t,e){for(var s=0,r=t.length-1,i=0;i<t.length;i++)s+=(t[r].x-t[i].x)*(t[r].y+t[i].y),r=i;return e?s/2:Math.abs(s)/2},r.inertia=function(t,e){for(var s,r,n=0,a=0,o=t,l=0;l<o.length;l++)r=(l+1)%o.length,n+=(s=Math.abs(i.cross(o[r],o[l])))*(i.dot(o[r],o[r])+i.dot(o[r],o[l])+i.dot(o[l],o[l])),a+=s;return e/6*(n/a)},r.translate=function(t,e,s){s=void 0!==s?s:1;var r,i=t.length,n=e.x*s,a=e.y*s;for(r=0;r<i;r++)t[r].x+=n,t[r].y+=a;return t},r.rotate=function(t,e,s){if(0!==e){var r,i,n,a,o=Math.cos(e),l=Math.sin(e),h=s.x,c=s.y,u=t.length;for(a=0;a<u;a++)i=(r=t[a]).x-h,n=r.y-c,r.x=h+(i*o-n*l),r.y=c+(i*l+n*o);return t}},r.contains=function(t,e){for(var s,r=e.x,i=e.y,n=t.length,a=t[n-1],o=0;o<n;o++){if(s=t[o],(r-a.x)*(s.y-a.y)+(i-a.y)*(a.x-s.x)>0)return!1;a=s}return!0},r.scale=function(t,e,s,n){if(1===e&&1===s)return t;var a,o;n=n||r.centre(t);for(var l=0;l<t.length;l++)a=t[l],o=i.sub(a,n),t[l].x=n.x+o.x*e,t[l].y=n.y+o.y*s;return t},r.chamfer=function(t,e,s,r,a){e="number"==typeof e?[e]:e||[8],s=void 0!==s?s:-1,r=r||2,a=a||14;for(var o=[],l=0;l<t.length;l++){var h=t[l-1>=0?l-1:t.length-1],c=t[l],u=t[(l+1)%t.length],d=e[l<e.length?l:e.length-1];if(0!==d){var p=i.normalise({x:c.y-h.y,y:h.x-c.x}),f=i.normalise({x:u.y-c.y,y:c.x-u.x}),m=Math.sqrt(2*Math.pow(d,2)),g=i.mult(n.clone(p),d),x=i.normalise(i.mult(i.add(p,f),.5)),y=i.sub(c,i.mult(x,m)),v=s;-1===s&&(v=1.75*Math.pow(d,.32)),(v=n.clamp(v,r,a))%2==1&&(v+=1);for(var _=Math.acos(i.dot(p,f))/v,b=0;b<v;b++)o.push(i.add(i.rotate(g,_*b),y))}else o.push(c)}return o},r.clockwiseSort=function(t){var e=r.mean(t);return t.sort(function(t,s){return i.angle(e,t)-i.angle(e,s)}),t},r.isConvex=function(t){var e,s,r,i,n=0,a=t.length;if(a<3)return null;for(e=0;e<a;e++)if(r=(e+2)%a,i=(t[s=(e+1)%a].x-t[e].x)*(t[r].y-t[s].y),(i-=(t[s].y-t[e].y)*(t[r].x-t[s].x))<0?n|=1:i>0&&(n|=2),3===n)return!1;return 0!==n||null},r.hull=function(t){var e,s,r=[],n=[];for((t=t.slice(0)).sort(function(t,e){var s=t.x-e.x;return 0!==s?s:t.y-e.y}),s=0;s<t.length;s+=1){for(e=t[s];n.length>=2&&i.cross3(n[n.length-2],n[n.length-1],e)<=0;)n.pop();n.push(e)}for(s=t.length-1;s>=0;s-=1){for(e=t[s];r.length>=2&&i.cross3(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}return r.pop(),n.pop(),r.concat(n)}},function(t,e,s){var r={};t.exports=r;var i=s(3),n=s(2),a=s(7),o=s(0),l=s(1),h=s(11);!function(){r._timeCorrection=!0,r._inertiaScale=4,r._nextCollidingGroupId=1,r._nextNonCollidingGroupId=-1,r._nextCategory=1,r._baseDelta=1e3/60,r.create=function(e){var s={id:o.nextId(),type:"body",label:"Body",parts:[],plugin:{},angle:0,vertices:i.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"),position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,render:{visible:!0,opacity:1,strokeStyle:null,fillStyle:null,lineWidth:null,sprite:{xScale:1,yScale:1,xOffset:0,yOffset:0}},events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inertia:0,deltaTime:1e3/60,_original:null},r=o.extend(s,e);return t(r,e),r},r.nextGroup=function(t){return t?r._nextNonCollidingGroupId--:r._nextCollidingGroupId++},r.nextCategory=function(){return r._nextCategory=r._nextCategory<<1,r._nextCategory};var t=function(t,e){e=e||{},r.set(t,{bounds:t.bounds||l.create(t.vertices),positionPrev:t.positionPrev||n.clone(t.position),anglePrev:t.anglePrev||t.angle,vertices:t.vertices,parts:t.parts||[t],isStatic:t.isStatic,isSleeping:t.isSleeping,parent:t.parent||t}),i.rotate(t.vertices,t.angle,t.position),h.rotate(t.axes,t.angle),l.update(t.bounds,t.vertices,t.velocity),r.set(t,{axes:e.axes||t.axes,area:e.area||t.area,mass:e.mass||t.mass,inertia:e.inertia||t.inertia});var s=t.isStatic?"#14151f":o.choose(["#f19648","#f5d259","#f55a3c","#063e7b","#ececd1"]),a=t.isStatic?"#555":"#ccc",c=t.isStatic&&null===t.render.fillStyle?1:0;t.render.fillStyle=t.render.fillStyle||s,t.render.strokeStyle=t.render.strokeStyle||a,t.render.lineWidth=t.render.lineWidth||c,t.render.sprite.xOffset+=-(t.bounds.min.x-t.position.x)/(t.bounds.max.x-t.bounds.min.x),t.render.sprite.yOffset+=-(t.bounds.min.y-t.position.y)/(t.bounds.max.y-t.bounds.min.y)};r.set=function(t,e,s){var i;for(i in"string"==typeof e&&(i=e,(e={})[i]=s),e)if(Object.prototype.hasOwnProperty.call(e,i))switch(s=e[i],i){case"isStatic":r.setStatic(t,s);break;case"isSleeping":a.set(t,s);break;case"mass":r.setMass(t,s);break;case"density":r.setDensity(t,s);break;case"inertia":r.setInertia(t,s);break;case"vertices":r.setVertices(t,s);break;case"position":r.setPosition(t,s);break;case"angle":r.setAngle(t,s);break;case"velocity":r.setVelocity(t,s);break;case"angularVelocity":r.setAngularVelocity(t,s);break;case"speed":r.setSpeed(t,s);break;case"angularSpeed":r.setAngularSpeed(t,s);break;case"parts":r.setParts(t,s);break;case"centre":r.setCentre(t,s);break;default:t[i]=s}},r.setStatic=function(t,e){for(var s=0;s<t.parts.length;s++){var r=t.parts[s];e?(r.isStatic||(r._original={restitution:r.restitution,friction:r.friction,mass:r.mass,inertia:r.inertia,density:r.density,inverseMass:r.inverseMass,inverseInertia:r.inverseInertia}),r.restitution=0,r.friction=1,r.mass=r.inertia=r.density=1/0,r.inverseMass=r.inverseInertia=0,r.positionPrev.x=r.position.x,r.positionPrev.y=r.position.y,r.anglePrev=r.angle,r.angularVelocity=0,r.speed=0,r.angularSpeed=0,r.motion=0):r._original&&(r.restitution=r._original.restitution,r.friction=r._original.friction,r.mass=r._original.mass,r.inertia=r._original.inertia,r.density=r._original.density,r.inverseMass=r._original.inverseMass,r.inverseInertia=r._original.inverseInertia,r._original=null),r.isStatic=e}},r.setMass=function(t,e){var s=t.inertia/(t.mass/6);t.inertia=s*(e/6),t.inverseInertia=1/t.inertia,t.mass=e,t.inverseMass=1/t.mass,t.density=t.mass/t.area},r.setDensity=function(t,e){r.setMass(t,e*t.area),t.density=e},r.setInertia=function(t,e){t.inertia=e,t.inverseInertia=1/t.inertia},r.setVertices=function(t,e){e[0].body===t?t.vertices=e:t.vertices=i.create(e,t),t.axes=h.fromVertices(t.vertices),t.area=i.area(t.vertices),r.setMass(t,t.density*t.area);var s=i.centre(t.vertices);i.translate(t.vertices,s,-1),r.setInertia(t,r._inertiaScale*i.inertia(t.vertices,t.mass)),i.translate(t.vertices,t.position),l.update(t.bounds,t.vertices,t.velocity)},r.setParts=function(t,e,s){var n;for(e=e.slice(0),t.parts.length=0,t.parts.push(t),t.parent=t,n=0;n<e.length;n++){var a=e[n];a!==t&&(a.parent=t,t.parts.push(a))}if(1!==t.parts.length){if(s=void 0===s||s){var o=[];for(n=0;n<e.length;n++)o=o.concat(e[n].vertices);i.clockwiseSort(o);var l=i.hull(o),h=i.centre(l);r.setVertices(t,l),i.translate(t.vertices,h)}var c=r._totalProperties(t);t.area=c.area,t.parent=t,t.position.x=c.centre.x,t.position.y=c.centre.y,t.positionPrev.x=c.centre.x,t.positionPrev.y=c.centre.y,r.setMass(t,c.mass),r.setInertia(t,c.inertia),r.setPosition(t,c.centre)}},r.setCentre=function(t,e,s){s?(t.positionPrev.x+=e.x,t.positionPrev.y+=e.y,t.position.x+=e.x,t.position.y+=e.y):(t.positionPrev.x=e.x-(t.position.x-t.positionPrev.x),t.positionPrev.y=e.y-(t.position.y-t.positionPrev.y),t.position.x=e.x,t.position.y=e.y)},r.setPosition=function(t,e,s){var r=n.sub(e,t.position);s?(t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.velocity.x=r.x,t.velocity.y=r.y,t.speed=n.magnitude(r)):(t.positionPrev.x+=r.x,t.positionPrev.y+=r.y);for(var a=0;a<t.parts.length;a++){var o=t.parts[a];o.position.x+=r.x,o.position.y+=r.y,i.translate(o.vertices,r),l.update(o.bounds,o.vertices,t.velocity)}},r.setAngle=function(t,e,s){var r=e-t.angle;s?(t.anglePrev=t.angle,t.angularVelocity=r,t.angularSpeed=Math.abs(r)):t.anglePrev+=r;for(var a=0;a<t.parts.length;a++){var o=t.parts[a];o.angle+=r,i.rotate(o.vertices,r,t.position),h.rotate(o.axes,r),l.update(o.bounds,o.vertices,t.velocity),a>0&&n.rotateAbout(o.position,r,t.position,o.position)}},r.setVelocity=function(t,e){var s=t.deltaTime/r._baseDelta;t.positionPrev.x=t.position.x-e.x*s,t.positionPrev.y=t.position.y-e.y*s,t.velocity.x=(t.position.x-t.positionPrev.x)/s,t.velocity.y=(t.position.y-t.positionPrev.y)/s,t.speed=n.magnitude(t.velocity)},r.getVelocity=function(t){var e=r._baseDelta/t.deltaTime;return{x:(t.position.x-t.positionPrev.x)*e,y:(t.position.y-t.positionPrev.y)*e}},r.getSpeed=function(t){return n.magnitude(r.getVelocity(t))},r.setSpeed=function(t,e){r.setVelocity(t,n.mult(n.normalise(r.getVelocity(t)),e))},r.setAngularVelocity=function(t,e){var s=t.deltaTime/r._baseDelta;t.anglePrev=t.angle-e*s,t.angularVelocity=(t.angle-t.anglePrev)/s,t.angularSpeed=Math.abs(t.angularVelocity)},r.getAngularVelocity=function(t){return(t.angle-t.anglePrev)*r._baseDelta/t.deltaTime},r.getAngularSpeed=function(t){return Math.abs(r.getAngularVelocity(t))},r.setAngularSpeed=function(t,e){r.setAngularVelocity(t,o.sign(r.getAngularVelocity(t))*e)},r.translate=function(t,e,s){r.setPosition(t,n.add(t.position,e),s)},r.rotate=function(t,e,s,i){if(s){var n=Math.cos(e),a=Math.sin(e),o=t.position.x-s.x,l=t.position.y-s.y;r.setPosition(t,{x:s.x+(o*n-l*a),y:s.y+(o*a+l*n)},i),r.setAngle(t,t.angle+e,i)}else r.setAngle(t,t.angle+e,i)},r.scale=function(t,e,s,n){var a=0,o=0;n=n||t.position;for(var c=0;c<t.parts.length;c++){var u=t.parts[c];i.scale(u.vertices,e,s,n),u.axes=h.fromVertices(u.vertices),u.area=i.area(u.vertices),r.setMass(u,t.density*u.area),i.translate(u.vertices,{x:-u.position.x,y:-u.position.y}),r.setInertia(u,r._inertiaScale*i.inertia(u.vertices,u.mass)),i.translate(u.vertices,{x:u.position.x,y:u.position.y}),c>0&&(a+=u.area,o+=u.inertia),u.position.x=n.x+(u.position.x-n.x)*e,u.position.y=n.y+(u.position.y-n.y)*s,l.update(u.bounds,u.vertices,t.velocity)}t.parts.length>1&&(t.area=a,t.isStatic||(r.setMass(t,t.density*a),r.setInertia(t,o))),t.circleRadius&&(e===s?t.circleRadius*=e:t.circleRadius=null)},r.update=function(t,e){var s=(e=(void 0!==e?e:1e3/60)*t.timeScale)*e,a=r._timeCorrection?e/(t.deltaTime||e):1,c=1-t.frictionAir*(e/o._baseDelta),u=(t.position.x-t.positionPrev.x)*a,d=(t.position.y-t.positionPrev.y)*a;t.velocity.x=u*c+t.force.x/t.mass*s,t.velocity.y=d*c+t.force.y/t.mass*s,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.deltaTime=e,t.angularVelocity=(t.angle-t.anglePrev)*c*a+t.torque/t.inertia*s,t.anglePrev=t.angle,t.angle+=t.angularVelocity;for(var p=0;p<t.parts.length;p++){var f=t.parts[p];i.translate(f.vertices,t.velocity),p>0&&(f.position.x+=t.velocity.x,f.position.y+=t.velocity.y),0!==t.angularVelocity&&(i.rotate(f.vertices,t.angularVelocity,t.position),h.rotate(f.axes,t.angularVelocity),p>0&&n.rotateAbout(f.position,t.angularVelocity,t.position,f.position)),l.update(f.bounds,f.vertices,t.velocity)}},r.updateVelocities=function(t){var e=r._baseDelta/t.deltaTime,s=t.velocity;s.x=(t.position.x-t.positionPrev.x)*e,s.y=(t.position.y-t.positionPrev.y)*e,t.speed=Math.sqrt(s.x*s.x+s.y*s.y),t.angularVelocity=(t.angle-t.anglePrev)*e,t.angularSpeed=Math.abs(t.angularVelocity)},r.applyForce=function(t,e,s){var r=e.x-t.position.x,i=e.y-t.position.y;t.force.x+=s.x,t.force.y+=s.y,t.torque+=r*s.y-i*s.x},r._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},s=1===t.parts.length?0:1;s<t.parts.length;s++){var r=t.parts[s],i=r.mass!==1/0?r.mass:1;e.mass+=i,e.area+=r.area,e.inertia+=r.inertia,e.centre=n.add(e.centre,n.mult(r.position,i))}return e.centre=n.div(e.centre,e.mass),e}}()},function(t,e,s){var r={};t.exports=r;var i=s(0);r.on=function(t,e,s){for(var r,i=e.split(" "),n=0;n<i.length;n++)r=i[n],t.events=t.events||{},t.events[r]=t.events[r]||[],t.events[r].push(s);return s},r.off=function(t,e,s){if(e){"function"==typeof e&&(s=e,e=i.keys(t.events).join(" "));for(var r=e.split(" "),n=0;n<r.length;n++){var a=t.events[r[n]],o=[];if(s&&a)for(var l=0;l<a.length;l++)a[l]!==s&&o.push(a[l]);t.events[r[n]]=o}}else t.events={}},r.trigger=function(t,e,s){var r,n,a,o,l=t.events;if(l&&i.keys(l).length>0){s||(s={}),r=e.split(" ");for(var h=0;h<r.length;h++)if(a=l[n=r[h]]){(o=i.clone(s,!1)).name=n,o.source=t;for(var c=0;c<a.length;c++)a[c].apply(t,[o])}}}},function(t,e,s){var r={};t.exports=r;var i=s(5),n=s(0),a=s(1),o=s(4);r.create=function(t){return n.extend({id:n.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{},cache:{allBodies:null,allConstraints:null,allComposites:null}},t)},r.setModified=function(t,e,s,i){if(t.isModified=e,e&&t.cache&&(t.cache.allBodies=null,t.cache.allConstraints=null,t.cache.allComposites=null),s&&t.parent&&r.setModified(t.parent,e,s,i),i)for(var n=0;n<t.composites.length;n++){var a=t.composites[n];r.setModified(a,e,s,i)}},r.add=function(t,e){var s=[].concat(e);i.trigger(t,"beforeAdd",{object:e});for(var a=0;a<s.length;a++){var o=s[a];switch(o.type){case"body":if(o.parent!==o){n.warn("Composite.add: skipped adding a compound body part (you must add its parent instead)");break}r.addBody(t,o);break;case"constraint":r.addConstraint(t,o);break;case"composite":r.addComposite(t,o);break;case"mouseConstraint":r.addConstraint(t,o.constraint)}}return i.trigger(t,"afterAdd",{object:e}),t},r.remove=function(t,e,s){var n=[].concat(e);i.trigger(t,"beforeRemove",{object:e});for(var a=0;a<n.length;a++){var o=n[a];switch(o.type){case"body":r.removeBody(t,o,s);break;case"constraint":r.removeConstraint(t,o,s);break;case"composite":r.removeComposite(t,o,s);break;case"mouseConstraint":r.removeConstraint(t,o.constraint)}}return i.trigger(t,"afterRemove",{object:e}),t},r.addComposite=function(t,e){return t.composites.push(e),e.parent=t,r.setModified(t,!0,!0,!1),t},r.removeComposite=function(t,e,s){var i=n.indexOf(t.composites,e);if(-1!==i){var a=r.allBodies(e);r.removeCompositeAt(t,i);for(var o=0;o<a.length;o++)a[o].sleepCounter=0}if(s)for(o=0;o<t.composites.length;o++)r.removeComposite(t.composites[o],e,!0);return t},r.removeCompositeAt=function(t,e){return t.composites.splice(e,1),r.setModified(t,!0,!0,!1),t},r.addBody=function(t,e){return t.bodies.push(e),r.setModified(t,!0,!0,!1),t},r.removeBody=function(t,e,s){var i=n.indexOf(t.bodies,e);if(-1!==i&&(r.removeBodyAt(t,i),e.sleepCounter=0),s)for(var a=0;a<t.composites.length;a++)r.removeBody(t.composites[a],e,!0);return t},r.removeBodyAt=function(t,e){return t.bodies.splice(e,1),r.setModified(t,!0,!0,!1),t},r.addConstraint=function(t,e){return t.constraints.push(e),r.setModified(t,!0,!0,!1),t},r.removeConstraint=function(t,e,s){var i=n.indexOf(t.constraints,e);if(-1!==i&&r.removeConstraintAt(t,i),s)for(var a=0;a<t.composites.length;a++)r.removeConstraint(t.composites[a],e,!0);return t},r.removeConstraintAt=function(t,e){return t.constraints.splice(e,1),r.setModified(t,!0,!0,!1),t},r.clear=function(t,e,s){if(s)for(var i=0;i<t.composites.length;i++)r.clear(t.composites[i],e,!0);return e?t.bodies=t.bodies.filter(function(t){return t.isStatic}):t.bodies.length=0,t.constraints.length=0,t.composites.length=0,r.setModified(t,!0,!0,!1),t},r.allBodies=function(t){if(t.cache&&t.cache.allBodies)return t.cache.allBodies;for(var e=[].concat(t.bodies),s=0;s<t.composites.length;s++)e=e.concat(r.allBodies(t.composites[s]));return t.cache&&(t.cache.allBodies=e),e},r.allConstraints=function(t){if(t.cache&&t.cache.allConstraints)return t.cache.allConstraints;for(var e=[].concat(t.constraints),s=0;s<t.composites.length;s++)e=e.concat(r.allConstraints(t.composites[s]));return t.cache&&(t.cache.allConstraints=e),e},r.allComposites=function(t){if(t.cache&&t.cache.allComposites)return t.cache.allComposites;for(var e=[].concat(t.composites),s=0;s<t.composites.length;s++)e=e.concat(r.allComposites(t.composites[s]));return t.cache&&(t.cache.allComposites=e),e},r.get=function(t,e,s){var i,n;switch(s){case"body":i=r.allBodies(t);break;case"constraint":i=r.allConstraints(t);break;case"composite":i=r.allComposites(t).concat(t)}return i?0===(n=i.filter(function(t){return t.id.toString()===e.toString()})).length?null:n[0]:null},r.move=function(t,e,s){return r.remove(t,e),r.add(s,e),t},r.rebase=function(t){for(var e=r.allBodies(t).concat(r.allConstraints(t)).concat(r.allComposites(t)),s=0;s<e.length;s++)e[s].id=n.nextId();return t},r.translate=function(t,e,s){for(var i=s?r.allBodies(t):t.bodies,n=0;n<i.length;n++)o.translate(i[n],e);return t},r.rotate=function(t,e,s,i){for(var n=Math.cos(e),a=Math.sin(e),l=i?r.allBodies(t):t.bodies,h=0;h<l.length;h++){var c=l[h],u=c.position.x-s.x,d=c.position.y-s.y;o.setPosition(c,{x:s.x+(u*n-d*a),y:s.y+(u*a+d*n)}),o.rotate(c,e)}return t},r.scale=function(t,e,s,i,n){for(var a=n?r.allBodies(t):t.bodies,l=0;l<a.length;l++){var h=a[l],c=h.position.x-i.x,u=h.position.y-i.y;o.setPosition(h,{x:i.x+c*e,y:i.y+u*s}),o.scale(h,e,s)}return t},r.bounds=function(t){for(var e=r.allBodies(t),s=[],i=0;i<e.length;i+=1){var n=e[i];s.push(n.bounds.min,n.bounds.max)}return a.create(s)}},function(t,e,s){var r={};t.exports=r;var i=s(4),n=s(5),a=s(0);r._motionWakeThreshold=.18,r._motionSleepThreshold=.08,r._minBias=.9,r.update=function(t,e){for(var s=e/a._baseDelta,n=r._motionSleepThreshold,o=0;o<t.length;o++){var l=t[o],h=i.getSpeed(l),c=i.getAngularSpeed(l),u=h*h+c*c;if(0===l.force.x&&0===l.force.y){var d=Math.min(l.motion,u),p=Math.max(l.motion,u);l.motion=r._minBias*d+(1-r._minBias)*p,l.sleepThreshold>0&&l.motion<n?(l.sleepCounter+=1,l.sleepCounter>=l.sleepThreshold/s&&r.set(l,!0)):l.sleepCounter>0&&(l.sleepCounter-=1)}else r.set(l,!1)}},r.afterCollisions=function(t){for(var e=r._motionSleepThreshold,s=0;s<t.length;s++){var i=t[s];if(i.isActive){var n=i.collision,a=n.bodyA.parent,o=n.bodyB.parent;if(!(a.isSleeping&&o.isSleeping||a.isStatic||o.isStatic)&&(a.isSleeping||o.isSleeping)){var l=a.isSleeping&&!a.isStatic?a:o,h=l===a?o:a;!l.isStatic&&h.motion>e&&r.set(l,!1)}}}},r.set=function(t,e){var s=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,s||n.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,s&&n.trigger(t,"sleepEnd"))}},function(t,e,s){var r={};t.exports=r;var i,n,a,o=s(3),l=s(9);i=[],n={overlap:0,axis:null},a={overlap:0,axis:null},r.create=function(t,e){return{pair:null,collided:!1,bodyA:t,bodyB:e,parentA:t.parent,parentB:e.parent,depth:0,normal:{x:0,y:0},tangent:{x:0,y:0},penetration:{x:0,y:0},supports:[null,null],supportCount:0}},r.collides=function(t,e,s){if(r._overlapAxes(n,t.vertices,e.vertices,t.axes),n.overlap<=0)return null;if(r._overlapAxes(a,e.vertices,t.vertices,e.axes),a.overlap<=0)return null;var i,h,c=s&&s.table[l.id(t,e)];c?i=c.collision:((i=r.create(t,e)).collided=!0,i.bodyA=t.id<e.id?t:e,i.bodyB=t.id<e.id?e:t,i.parentA=i.bodyA.parent,i.parentB=i.bodyB.parent),t=i.bodyA,e=i.bodyB,h=n.overlap<a.overlap?n:a;var u=i.normal,d=i.tangent,p=i.penetration,f=i.supports,m=h.overlap,g=h.axis,x=g.x,y=g.y;x*(e.position.x-t.position.x)+y*(e.position.y-t.position.y)>=0&&(x=-x,y=-y),u.x=x,u.y=y,d.x=-y,d.y=x,p.x=x*m,p.y=y*m,i.depth=m;var v=r._findSupports(t,e,u,1),_=0;if(o.contains(t.vertices,v[0])&&(f[_++]=v[0]),o.contains(t.vertices,v[1])&&(f[_++]=v[1]),_<2){var b=r._findSupports(e,t,u,-1);o.contains(e.vertices,b[0])&&(f[_++]=b[0]),_<2&&o.contains(e.vertices,b[1])&&(f[_++]=b[1])}return 0===_&&(f[_++]=v[0]),i.supportCount=_,i},r._overlapAxes=function(t,e,s,r){var i,n,a,o,l,h,c=e.length,u=s.length,d=e[0].x,p=e[0].y,f=s[0].x,m=s[0].y,g=r.length,x=Number.MAX_VALUE,y=0;for(l=0;l<g;l++){var v=r[l],_=v.x,b=v.y,w=d*_+p*b,T=f*_+m*b,S=w,A=T;for(h=1;h<c;h+=1)(o=e[h].x*_+e[h].y*b)>S?S=o:o<w&&(w=o);for(h=1;h<u;h+=1)(o=s[h].x*_+s[h].y*b)>A?A=o:o<T&&(T=o);if((i=(n=S-T)<(a=A-w)?n:a)<x&&(x=i,y=l,i<=0))break}t.axis=r[y],t.overlap=x},r._findSupports=function(t,e,s,r){var n,a,o,l=e.vertices,h=l.length,c=t.position.x,u=t.position.y,d=s.x*r,p=s.y*r,f=l[0],m=f,g=d*(c-m.x)+p*(u-m.y);for(o=1;o<h;o+=1)(a=d*(c-(m=l[o]).x)+p*(u-m.y))<g&&(g=a,f=m);return g=d*(c-(n=l[(h+f.index-1)%h]).x)+p*(u-n.y),d*(c-(m=l[(f.index+1)%h]).x)+p*(u-m.y)<g?(i[0]=f,i[1]=m,i):(i[0]=f,i[1]=n,i)}},function(t,e,s){var r={};t.exports=r;var i=s(16);r.create=function(t,e){var s=t.bodyA,n=t.bodyB,a={id:r.id(s,n),bodyA:s,bodyB:n,collision:t,contacts:[i.create(),i.create()],contactCount:0,separation:0,isActive:!0,isSensor:s.isSensor||n.isSensor,timeCreated:e,timeUpdated:e,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return r.update(a,t,e),a},r.update=function(t,e,s){var r=e.supports,i=e.supportCount,n=t.contacts,a=e.parentA,o=e.parentB;t.isActive=!0,t.timeUpdated=s,t.collision=e,t.separation=e.depth,t.inverseMass=a.inverseMass+o.inverseMass,t.friction=a.friction<o.friction?a.friction:o.friction,t.frictionStatic=a.frictionStatic>o.frictionStatic?a.frictionStatic:o.frictionStatic,t.restitution=a.restitution>o.restitution?a.restitution:o.restitution,t.slop=a.slop>o.slop?a.slop:o.slop,t.contactCount=i,e.pair=t;var l=r[0],h=n[0],c=r[1],u=n[1];u.vertex!==l&&h.vertex!==c||(n[1]=h,n[0]=h=u,u=n[1]),h.vertex=l,u.vertex=c},r.setActive=function(t,e,s){e?(t.isActive=!0,t.timeUpdated=s):(t.isActive=!1,t.contactCount=0)},r.id=function(t,e){return t.id<e.id?t.id.toString(36)+":"+e.id.toString(36):e.id.toString(36)+":"+t.id.toString(36)}},function(t,e,s){var r={};t.exports=r;var i=s(3),n=s(2),a=s(7),o=s(1),l=s(11),h=s(0);r._warming=.4,r._torqueDampen=1,r._minLength=1e-6,r.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var s=e.bodyA?n.add(e.bodyA.position,e.pointA):e.pointA,r=e.bodyB?n.add(e.bodyB.position,e.pointB):e.pointB,i=n.magnitude(n.sub(s,r));e.length=void 0!==e.length?e.length:i,e.id=e.id||h.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(e.length>0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var a={visible:!0,lineWidth:2,strokeStyle:"#ffffff",type:"line",anchors:!0};return 0===e.length&&e.stiffness>.1?(a.type="pin",a.anchors=!1):e.stiffness<.9&&(a.type="spring"),e.render=h.extend(a,e.render),e},r.preSolveAll=function(t){for(var e=0;e<t.length;e+=1){var s=t[e],r=s.constraintImpulse;s.isStatic||0===r.x&&0===r.y&&0===r.angle||(s.position.x+=r.x,s.position.y+=r.y,s.angle+=r.angle)}},r.solveAll=function(t,e){for(var s=h.clamp(e/h._baseDelta,0,1),i=0;i<t.length;i+=1){var n=t[i],a=!n.bodyA||n.bodyA&&n.bodyA.isStatic,o=!n.bodyB||n.bodyB&&n.bodyB.isStatic;(a||o)&&r.solve(t[i],s)}for(i=0;i<t.length;i+=1)a=!(n=t[i]).bodyA||n.bodyA&&n.bodyA.isStatic,o=!n.bodyB||n.bodyB&&n.bodyB.isStatic,a||o||r.solve(t[i],s)},r.solve=function(t,e){var s=t.bodyA,i=t.bodyB,a=t.pointA,o=t.pointB;if(s||i){s&&!s.isStatic&&(n.rotate(a,s.angle-t.angleA,a),t.angleA=s.angle),i&&!i.isStatic&&(n.rotate(o,i.angle-t.angleB,o),t.angleB=i.angle);var l=a,h=o;if(s&&(l=n.add(s.position,a)),i&&(h=n.add(i.position,o)),l&&h){var c=n.sub(l,h),u=n.magnitude(c);u<r._minLength&&(u=r._minLength);var d,p,f,m,g,x=(u-t.length)/u,y=t.stiffness>=1||0===t.length?t.stiffness*e:t.stiffness*e*e,v=t.damping*e,_=n.mult(c,x*y),b=(s?s.inverseMass:0)+(i?i.inverseMass:0),w=b+((s?s.inverseInertia:0)+(i?i.inverseInertia:0));if(v>0){var T=n.create();f=n.div(c,u),g=n.sub(i&&n.sub(i.position,i.positionPrev)||T,s&&n.sub(s.position,s.positionPrev)||T),m=n.dot(f,g)}s&&!s.isStatic&&(p=s.inverseMass/b,s.constraintImpulse.x-=_.x*p,s.constraintImpulse.y-=_.y*p,s.position.x-=_.x*p,s.position.y-=_.y*p,v>0&&(s.positionPrev.x-=v*f.x*m*p,s.positionPrev.y-=v*f.y*m*p),d=n.cross(a,_)/w*r._torqueDampen*s.inverseInertia*(1-t.angularStiffness),s.constraintImpulse.angle-=d,s.angle-=d),i&&!i.isStatic&&(p=i.inverseMass/b,i.constraintImpulse.x+=_.x*p,i.constraintImpulse.y+=_.y*p,i.position.x+=_.x*p,i.position.y+=_.y*p,v>0&&(i.positionPrev.x+=v*f.x*m*p,i.positionPrev.y+=v*f.y*m*p),d=n.cross(o,_)/w*r._torqueDampen*i.inverseInertia*(1-t.angularStiffness),i.constraintImpulse.angle+=d,i.angle+=d)}}},r.postSolveAll=function(t){for(var e=0;e<t.length;e++){var s=t[e],h=s.constraintImpulse;if(!(s.isStatic||0===h.x&&0===h.y&&0===h.angle)){a.set(s,!1);for(var c=0;c<s.parts.length;c++){var u=s.parts[c];i.translate(u.vertices,h),c>0&&(u.position.x+=h.x,u.position.y+=h.y),0!==h.angle&&(i.rotate(u.vertices,h.angle,s.position),l.rotate(u.axes,h.angle),c>0&&n.rotateAbout(u.position,h.angle,s.position,u.position)),o.update(u.bounds,u.vertices,s.velocity)}h.angle*=r._warming,h.x*=r._warming,h.y*=r._warming}}},r.pointAWorld=function(t){return{x:(t.bodyA?t.bodyA.position.x:0)+(t.pointA?t.pointA.x:0),y:(t.bodyA?t.bodyA.position.y:0)+(t.pointA?t.pointA.y:0)}},r.pointBWorld=function(t){return{x:(t.bodyB?t.bodyB.position.x:0)+(t.pointB?t.pointB.x:0),y:(t.bodyB?t.bodyB.position.y:0)+(t.pointB?t.pointB.y:0)}},r.currentLength=function(t){var e=(t.bodyA?t.bodyA.position.x:0)+(t.pointA?t.pointA.x:0),s=(t.bodyA?t.bodyA.position.y:0)+(t.pointA?t.pointA.y:0),r=e-((t.bodyB?t.bodyB.position.x:0)+(t.pointB?t.pointB.x:0)),i=s-((t.bodyB?t.bodyB.position.y:0)+(t.pointB?t.pointB.y:0));return Math.sqrt(r*r+i*i)}},function(t,e,s){var r={};t.exports=r;var i=s(2),n=s(0);r.fromVertices=function(t){for(var e={},s=0;s<t.length;s++){var r=(s+1)%t.length,a=i.normalise({x:t[r].y-t[s].y,y:t[s].x-t[r].x}),o=0===a.y?1/0:a.x/a.y;e[o=o.toFixed(3).toString()]=a}return n.values(e)},r.rotate=function(t,e){if(0!==e)for(var s=Math.cos(e),r=Math.sin(e),i=0;i<t.length;i++){var n,a=t[i];n=a.x*s-a.y*r,a.y=a.x*r+a.y*s,a.x=n}}},function(t,e,s){var r={};t.exports=r;var i=s(3),n=s(0),a=s(4),o=s(1),l=s(2);r.rectangle=function(t,e,s,r,o){o=o||{};var l={label:"Rectangle Body",position:{x:t,y:e},vertices:i.fromPath("L 0 0 L "+s+" 0 L "+s+" "+r+" L 0 "+r)};if(o.chamfer){var h=o.chamfer;l.vertices=i.chamfer(l.vertices,h.radius,h.quality,h.qualityMin,h.qualityMax),delete o.chamfer}return a.create(n.extend({},l,o))},r.trapezoid=function(t,e,s,r,o,l){l=l||{},o>=1&&n.warn("Bodies.trapezoid: slope parameter must be < 1.");var h,c=s*(o*=.5),u=c+(1-2*o)*s,d=u+c;h=o<.5?"L 0 0 L "+c+" "+-r+" L "+u+" "+-r+" L "+d+" 0":"L 0 0 L "+u+" "+-r+" L "+d+" 0";var p={label:"Trapezoid Body",position:{x:t,y:e},vertices:i.fromPath(h)};if(l.chamfer){var f=l.chamfer;p.vertices=i.chamfer(p.vertices,f.radius,f.quality,f.qualityMin,f.qualityMax),delete l.chamfer}return a.create(n.extend({},p,l))},r.circle=function(t,e,s,i,a){i=i||{};var o={label:"Circle Body",circleRadius:s};a=a||25;var l=Math.ceil(Math.max(10,Math.min(a,s)));return l%2==1&&(l+=1),r.polygon(t,e,l,s,n.extend({},o,i))},r.polygon=function(t,e,s,o,l){if(l=l||{},s<3)return r.circle(t,e,o,l);for(var h=2*Math.PI/s,c="",u=.5*h,d=0;d<s;d+=1){var p=u+d*h,f=Math.cos(p)*o,m=Math.sin(p)*o;c+="L "+f.toFixed(3)+" "+m.toFixed(3)+" "}var g={label:"Polygon Body",position:{x:t,y:e},vertices:i.fromPath(c)};if(l.chamfer){var x=l.chamfer;g.vertices=i.chamfer(g.vertices,x.radius,x.quality,x.qualityMin,x.qualityMax),delete l.chamfer}return a.create(n.extend({},g,l))},r.fromVertices=function(t,e,s,r,h,c,u,d){var p,f,m,g,x,y,v,_,b,w,T=n.getDecomp();for(p=Boolean(T&&T.quickDecomp),r=r||{},m=[],h=void 0!==h&&h,c=void 0!==c?c:.01,u=void 0!==u?u:10,d=void 0!==d?d:.01,n.isArray(s[0])||(s=[s]),b=0;b<s.length;b+=1)if(x=s[b],!(g=i.isConvex(x))&&!p&&n.warnOnce("Bodies.fromVertices: Install the 'poly-decomp' library and use Common.setDecomp or provide 'decomp' as a global to decompose concave vertices."),g||!p)x=g?i.clockwiseSort(x):i.hull(x),m.push({position:{x:t,y:e},vertices:x});else{var S=x.map(function(t){return[t.x,t.y]});T.makeCCW(S),!1!==c&&T.removeCollinearPoints(S,c),!1!==d&&T.removeDuplicatePoints&&T.removeDuplicatePoints(S,d);var A=T.quickDecomp(S);for(y=0;y<A.length;y++){var C=A[y].map(function(t){return{x:t[0],y:t[1]}});u>0&&i.area(C)<u||m.push({position:i.centre(C),vertices:C})}}for(y=0;y<m.length;y++)m[y]=a.create(n.extend(m[y],r));if(h)for(y=0;y<m.length;y++){var P=m[y];for(v=y+1;v<m.length;v++){var E=m[v];if(o.overlaps(P.bounds,E.bounds)){var M=P.vertices,k=E.vertices;for(_=0;_<P.vertices.length;_++)for(w=0;w<E.vertices.length;w++){var R=l.magnitudeSquared(l.sub(M[(_+1)%M.length],k[w])),B=l.magnitudeSquared(l.sub(M[_],k[(w+1)%k.length]));R<5&&B<5&&(M[_].isInternal=!0,k[w].isInternal=!0)}}}}return m.length>1?(f=a.create(n.extend({parts:m.slice(0)},r)),a.setPosition(f,{x:t,y:e}),f):m[0]}},function(t,e,s){var r={};t.exports=r;var i=s(0),n=s(8);r.create=function(t){return i.extend({bodies:[],collisions:[],pairs:null},t)},r.setBodies=function(t,e){t.bodies=e.slice(0)},r.clear=function(t){t.bodies=[],t.collisions=[]},r.collisions=function(t){var e,s,i=t.pairs,a=t.bodies,o=a.length,l=r.canCollide,h=n.collides,c=t.collisions,u=0;for(a.sort(r._compareBoundsX),e=0;e<o;e++){var d=a[e],p=d.bounds,f=d.bounds.max.x,m=d.bounds.max.y,g=d.bounds.min.y,x=d.isStatic||d.isSleeping,y=d.parts.length,v=1===y;for(s=e+1;s<o;s++){var _=a[s];if((E=_.bounds).min.x>f)break;if(!(m<E.min.y||g>E.max.y)&&(!x||!_.isStatic&&!_.isSleeping)&&l(d.collisionFilter,_.collisionFilter)){var b=_.parts.length;if(v&&1===b)(C=h(d,_,i))&&(c[u++]=C);else for(var w=b>1?1:0,T=y>1?1:0;T<y;T++)for(var S=d.parts[T],A=(p=S.bounds,w);A<b;A++){var C,P=_.parts[A],E=P.bounds;p.min.x>E.max.x||p.max.x<E.min.x||p.max.y<E.min.y||p.min.y>E.max.y||(C=h(S,P,i))&&(c[u++]=C)}}}}return c.length!==u&&(c.length=u),c},r.canCollide=function(t,e){return t.group===e.group&&0!==t.group?t.group>0:0!==(t.mask&e.category)&&0!==(e.mask&t.category)},r._compareBoundsX=function(t,e){return t.bounds.min.x-e.bounds.min.x}},function(t,e,s){var r={};t.exports=r;var i=s(0);r.create=function(t){var e={};return t||i.log("Mouse.create: element was undefined, defaulting to document.body","warn"),e.element=t||document.body,e.absolute={x:0,y:0},e.position={x:0,y:0},e.mousedownPosition={x:0,y:0},e.mouseupPosition={x:0,y:0},e.offset={x:0,y:0},e.scale={x:1,y:1},e.wheelDelta=0,e.button=-1,e.pixelRatio=parseInt(e.element.getAttribute("data-pixel-ratio"),10)||1,e.sourceEvents={mousemove:null,mousedown:null,mouseup:null,mousewheel:null},e.mousemove=function(t){var s=r._getRelativeMousePosition(t,e.element,e.pixelRatio);t.changedTouches&&(e.button=0,t.preventDefault()),e.absolute.x=s.x,e.absolute.y=s.y,e.position.x=e.absolute.x*e.scale.x+e.offset.x,e.position.y=e.absolute.y*e.scale.y+e.offset.y,e.sourceEvents.mousemove=t},e.mousedown=function(t){var s=r._getRelativeMousePosition(t,e.element,e.pixelRatio);t.changedTouches?(e.button=0,t.preventDefault()):e.button=t.button,e.absolute.x=s.x,e.absolute.y=s.y,e.position.x=e.absolute.x*e.scale.x+e.offset.x,e.position.y=e.absolute.y*e.scale.y+e.offset.y,e.mousedownPosition.x=e.position.x,e.mousedownPosition.y=e.position.y,e.sourceEvents.mousedown=t},e.mouseup=function(t){var s=r._getRelativeMousePosition(t,e.element,e.pixelRatio);t.changedTouches&&t.preventDefault(),e.button=-1,e.absolute.x=s.x,e.absolute.y=s.y,e.position.x=e.absolute.x*e.scale.x+e.offset.x,e.position.y=e.absolute.y*e.scale.y+e.offset.y,e.mouseupPosition.x=e.position.x,e.mouseupPosition.y=e.position.y,e.sourceEvents.mouseup=t},e.mousewheel=function(t){e.wheelDelta=Math.max(-1,Math.min(1,t.wheelDelta||-t.detail)),t.preventDefault(),e.sourceEvents.mousewheel=t},r.setElement(e,e.element),e},r.setElement=function(t,e){t.element=e,e.addEventListener("mousemove",t.mousemove,{passive:!0}),e.addEventListener("mousedown",t.mousedown,{passive:!0}),e.addEventListener("mouseup",t.mouseup,{passive:!0}),e.addEventListener("wheel",t.mousewheel,{passive:!1}),e.addEventListener("touchmove",t.mousemove,{passive:!1}),e.addEventListener("touchstart",t.mousedown,{passive:!1}),e.addEventListener("touchend",t.mouseup,{passive:!1})},r.clearSourceEvents=function(t){t.sourceEvents.mousemove=null,t.sourceEvents.mousedown=null,t.sourceEvents.mouseup=null,t.sourceEvents.mousewheel=null,t.wheelDelta=0},r.setOffset=function(t,e){t.offset.x=e.x,t.offset.y=e.y,t.position.x=t.absolute.x*t.scale.x+t.offset.x,t.position.y=t.absolute.y*t.scale.y+t.offset.y},r.setScale=function(t,e){t.scale.x=e.x,t.scale.y=e.y,t.position.x=t.absolute.x*t.scale.x+t.offset.x,t.position.y=t.absolute.y*t.scale.y+t.offset.y},r._getRelativeMousePosition=function(t,e,s){var r,i,n=e.getBoundingClientRect(),a=document.documentElement||document.body.parentNode||document.body,o=void 0!==window.pageXOffset?window.pageXOffset:a.scrollLeft,l=void 0!==window.pageYOffset?window.pageYOffset:a.scrollTop,h=t.changedTouches;return h?(r=h[0].pageX-n.left-o,i=h[0].pageY-n.top-l):(r=t.pageX-n.left-o,i=t.pageY-n.top-l),{x:r/(e.clientWidth/(e.width||e.clientWidth)*s),y:i/(e.clientHeight/(e.height||e.clientHeight)*s)}}},function(t,e,s){var r={};t.exports=r;var i=s(0);r._registry={},r.register=function(t){if(r.isPlugin(t)||i.warn("Plugin.register:",r.toString(t),"does not implement all required fields."),t.name in r._registry){var e=r._registry[t.name],s=r.versionParse(t.version).number,n=r.versionParse(e.version).number;s>n?(i.warn("Plugin.register:",r.toString(e),"was upgraded to",r.toString(t)),r._registry[t.name]=t):s<n?i.warn("Plugin.register:",r.toString(e),"can not be downgraded to",r.toString(t)):t!==e&&i.warn("Plugin.register:",r.toString(t),"is already registered to different plugin object")}else r._registry[t.name]=t;return t},r.resolve=function(t){return r._registry[r.dependencyParse(t).name]},r.toString=function(t){return"string"==typeof t?t:(t.name||"anonymous")+"@"+(t.version||t.range||"0.0.0")},r.isPlugin=function(t){return t&&t.name&&t.version&&t.install},r.isUsed=function(t,e){return t.used.indexOf(e)>-1},r.isFor=function(t,e){var s=t.for&&r.dependencyParse(t.for);return!t.for||e.name===s.name&&r.versionSatisfies(e.version,s.range)},r.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var s=r.dependencies(t),n=i.topologicalSort(s),a=[],o=0;o<n.length;o+=1)if(n[o]!==t.name){var l=r.resolve(n[o]);l?r.isUsed(t,l.name)||(r.isFor(l,t)||(i.warn("Plugin.use:",r.toString(l),"is for",l.for,"but installed on",r.toString(t)+"."),l._warned=!0),l.install?l.install(t):(i.warn("Plugin.use:",r.toString(l),"does not specify an install function."),l._warned=!0),l._warned?(a.push("🔶 "+r.toString(l)),delete l._warned):a.push("✅ "+r.toString(l)),t.used.push(l.name)):a.push("❌ "+n[o])}a.length>0&&i.info(a.join(" "))}else i.warn("Plugin.use:",r.toString(t),"does not specify any dependencies to install.")},r.dependencies=function(t,e){var s=r.dependencyParse(t),n=s.name;if(!(n in(e=e||{}))){t=r.resolve(t)||t,e[n]=i.map(t.uses||[],function(e){r.isPlugin(e)&&r.register(e);var n=r.dependencyParse(e),a=r.resolve(e);return a&&!r.versionSatisfies(a.version,n.range)?(i.warn("Plugin.dependencies:",r.toString(a),"does not satisfy",r.toString(n),"used by",r.toString(s)+"."),a._warned=!0,t._warned=!0):a||(i.warn("Plugin.dependencies:",r.toString(e),"used by",r.toString(s),"could not be resolved."),t._warned=!0),n.name});for(var a=0;a<e[n].length;a+=1)r.dependencies(e[n][a],e);return e}},r.dependencyParse=function(t){return i.isString(t)?(/^[\w-]+(@(\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-+]+)?))?$/.test(t)||i.warn("Plugin.dependencyParse:",t,"is not a valid dependency string."),{name:t.split("@")[0],range:t.split("@")[1]||"*"}):{name:t.name,range:t.range||t.version}},r.versionParse=function(t){var e=/^(\*)|(\^|~|>=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;e.test(t)||i.warn("Plugin.versionParse:",t,"is not a valid version or range.");var s=e.exec(t),r=Number(s[4]),n=Number(s[5]),a=Number(s[6]);return{isRange:Boolean(s[1]||s[2]),version:s[3],range:t,operator:s[1]||s[2]||"",major:r,minor:n,patch:a,parts:[r,n,a],prerelease:s[7],number:1e8*r+1e4*n+a}},r.versionSatisfies=function(t,e){e=e||"*";var s=r.versionParse(e),i=r.versionParse(t);if(s.isRange){if("*"===s.operator||"*"===t)return!0;if(">"===s.operator)return i.number>s.number;if(">="===s.operator)return i.number>=s.number;if("~"===s.operator)return i.major===s.major&&i.minor===s.minor&&i.patch>=s.patch;if("^"===s.operator)return s.major>0?i.major===s.major&&i.number>=s.number:s.minor>0?i.minor===s.minor&&i.patch>=s.patch:i.patch===s.patch}return t===e||"*"===t}},function(t,e){var s={};t.exports=s,s.create=function(t){return{vertex:t,normalImpulse:0,tangentImpulse:0}}},function(t,e,s){var r={};t.exports=r;var i=s(7),n=s(18),a=s(13),o=s(19),l=s(5),h=s(6),c=s(10),u=s(0),d=s(4);r._deltaMax=1e3/60,r.create=function(t){t=t||{};var e=u.extend({positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},gravity:{x:0,y:1,scale:.001},timing:{timestamp:0,timeScale:1,lastDelta:0,lastElapsed:0,lastUpdatesPerFrame:0}},t);return e.world=t.world||h.create({label:"World"}),e.pairs=t.pairs||o.create(),e.detector=t.detector||a.create(),e.detector.pairs=e.pairs,e.grid={buckets:[]},e.world.gravity=e.gravity,e.broadphase=e.grid,e.metrics={},e},r.update=function(t,e){var s,d=u.now(),p=t.world,f=t.detector,m=t.pairs,g=t.timing,x=g.timestamp;e>r._deltaMax&&u.warnOnce("Matter.Engine.update: delta argument is recommended to be less than or equal to",r._deltaMax.toFixed(3),"ms."),e=void 0!==e?e:u._baseDelta,e*=g.timeScale,g.timestamp+=e,g.lastDelta=e;var y={timestamp:g.timestamp,delta:e};l.trigger(t,"beforeUpdate",y);var v=h.allBodies(p),_=h.allConstraints(p);for(p.isModified&&(a.setBodies(f,v),h.setModified(p,!1,!1,!0)),t.enableSleeping&&i.update(v,e),r._bodiesApplyGravity(v,t.gravity),e>0&&r._bodiesUpdate(v,e),l.trigger(t,"beforeSolve",y),c.preSolveAll(v),s=0;s<t.constraintIterations;s++)c.solveAll(_,e);c.postSolveAll(v);var b=a.collisions(f);o.update(m,b,x),t.enableSleeping&&i.afterCollisions(m.list),m.collisionStart.length>0&&l.trigger(t,"collisionStart",{pairs:m.collisionStart,timestamp:g.timestamp,delta:e});var w=u.clamp(20/t.positionIterations,0,1);for(n.preSolvePosition(m.list),s=0;s<t.positionIterations;s++)n.solvePosition(m.list,e,w);for(n.postSolvePosition(v),c.preSolveAll(v),s=0;s<t.constraintIterations;s++)c.solveAll(_,e);for(c.postSolveAll(v),n.preSolveVelocity(m.list),s=0;s<t.velocityIterations;s++)n.solveVelocity(m.list,e);return r._bodiesUpdateVelocities(v),m.collisionActive.length>0&&l.trigger(t,"collisionActive",{pairs:m.collisionActive,timestamp:g.timestamp,delta:e}),m.collisionEnd.length>0&&l.trigger(t,"collisionEnd",{pairs:m.collisionEnd,timestamp:g.timestamp,delta:e}),r._bodiesClearForces(v),l.trigger(t,"afterUpdate",y),t.timing.lastElapsed=u.now()-d,t},r.merge=function(t,e){if(u.extend(t,e),e.world){t.world=e.world,r.clear(t);for(var s=h.allBodies(t.world),n=0;n<s.length;n++){var a=s[n];i.set(a,!1),a.id=u.nextId()}}},r.clear=function(t){o.clear(t.pairs),a.clear(t.detector)},r._bodiesClearForces=function(t){for(var e=t.length,s=0;s<e;s++){var r=t[s];r.force.x=0,r.force.y=0,r.torque=0}},r._bodiesApplyGravity=function(t,e){var s=void 0!==e.scale?e.scale:.001,r=t.length;if((0!==e.x||0!==e.y)&&0!==s)for(var i=0;i<r;i++){var n=t[i];n.isStatic||n.isSleeping||(n.force.y+=n.mass*e.y*s,n.force.x+=n.mass*e.x*s)}},r._bodiesUpdate=function(t,e){for(var s=t.length,r=0;r<s;r++){var i=t[r];i.isStatic||i.isSleeping||d.update(i,e)}},r._bodiesUpdateVelocities=function(t){for(var e=t.length,s=0;s<e;s++)d.updateVelocities(t[s])}},function(t,e,s){var r={};t.exports=r;var i=s(3),n=s(0),a=s(1);r._restingThresh=2,r._restingThreshTangent=Math.sqrt(6),r._positionDampen=.9,r._positionWarming=.8,r._frictionNormalMultiplier=5,r._frictionMaxStatic=Number.MAX_VALUE,r.preSolvePosition=function(t){var e,s,r,i=t.length;for(e=0;e<i;e++)(s=t[e]).isActive&&(r=s.contactCount,s.collision.parentA.totalContacts+=r,s.collision.parentB.totalContacts+=r)},r.solvePosition=function(t,e,s){var i,a,o,l,h,c,u,d,p=r._positionDampen*(s||1),f=n.clamp(e/n._baseDelta,0,1),m=t.length;for(i=0;i<m;i++)(a=t[i]).isActive&&!a.isSensor&&(l=(o=a.collision).parentA,h=o.parentB,c=o.normal,a.separation=o.depth+c.x*(h.positionImpulse.x-l.positionImpulse.x)+c.y*(h.positionImpulse.y-l.positionImpulse.y));for(i=0;i<m;i++)(a=t[i]).isActive&&!a.isSensor&&(l=(o=a.collision).parentA,h=o.parentB,c=o.normal,d=a.separation-a.slop*f,(l.isStatic||h.isStatic)&&(d*=2),l.isStatic||l.isSleeping||(u=p/l.totalContacts,l.positionImpulse.x+=c.x*d*u,l.positionImpulse.y+=c.y*d*u),h.isStatic||h.isSleeping||(u=p/h.totalContacts,h.positionImpulse.x-=c.x*d*u,h.positionImpulse.y-=c.y*d*u))},r.postSolvePosition=function(t){for(var e=r._positionWarming,s=t.length,n=i.translate,o=a.update,l=0;l<s;l++){var h=t[l],c=h.positionImpulse,u=c.x,d=c.y,p=h.velocity;if(h.totalContacts=0,0!==u||0!==d){for(var f=0;f<h.parts.length;f++){var m=h.parts[f];n(m.vertices,c),o(m.bounds,m.vertices,p),m.position.x+=u,m.position.y+=d}h.positionPrev.x+=u,h.positionPrev.y+=d,u*p.x+d*p.y<0?(c.x=0,c.y=0):(c.x*=e,c.y*=e)}}},r.preSolveVelocity=function(t){var e,s,r=t.length;for(e=0;e<r;e++){var i=t[e];if(i.isActive&&!i.isSensor){var n=i.contacts,a=i.contactCount,o=i.collision,l=o.parentA,h=o.parentB,c=o.normal,u=o.tangent;for(s=0;s<a;s++){var d=n[s],p=d.vertex,f=d.normalImpulse,m=d.tangentImpulse;if(0!==f||0!==m){var g=c.x*f+u.x*m,x=c.y*f+u.y*m;l.isStatic||l.isSleeping||(l.positionPrev.x+=g*l.inverseMass,l.positionPrev.y+=x*l.inverseMass,l.anglePrev+=l.inverseInertia*((p.x-l.position.x)*x-(p.y-l.position.y)*g)),h.isStatic||h.isSleeping||(h.positionPrev.x-=g*h.inverseMass,h.positionPrev.y-=x*h.inverseMass,h.anglePrev-=h.inverseInertia*((p.x-h.position.x)*x-(p.y-h.position.y)*g))}}}}},r.solveVelocity=function(t,e){var s,i,a,o,l=e/n._baseDelta,h=l*l*l,c=-r._restingThresh*l,u=r._restingThreshTangent,d=r._frictionNormalMultiplier*l,p=r._frictionMaxStatic,f=t.length;for(a=0;a<f;a++){var m=t[a];if(m.isActive&&!m.isSensor){var g=m.collision,x=g.parentA,y=g.parentB,v=g.normal.x,_=g.normal.y,b=g.tangent.x,w=g.tangent.y,T=m.inverseMass,S=m.friction*m.frictionStatic*d,A=m.contacts,C=m.contactCount,P=1/C,E=x.position.x-x.positionPrev.x,M=x.position.y-x.positionPrev.y,k=x.angle-x.anglePrev,R=y.position.x-y.positionPrev.x,B=y.position.y-y.positionPrev.y,I=y.angle-y.anglePrev;for(o=0;o<C;o++){var F=A[o],D=F.vertex,O=D.x-x.position.x,G=D.y-x.position.y,U=D.x-y.position.x,L=D.y-y.position.y,N=E-G*k-(R-L*I),X=M+O*k-(B+U*I),Y=v*N+_*X,V=b*N+w*X,z=m.separation+Y,W=Math.min(z,1),H=(W=z<0?0:W)*S;V<-H||V>H?(i=V>0?V:-V,(s=m.friction*(V>0?1:-1)*h)<-i?s=-i:s>i&&(s=i)):(s=V,i=p);var j=O*_-G*v,q=U*_-L*v,$=P/(T+x.inverseInertia*j*j+y.inverseInertia*q*q),K=(1+m.restitution)*Y*$;if(s*=$,Y<c)F.normalImpulse=0;else{var Q=F.normalImpulse;F.normalImpulse+=K,F.normalImpulse>0&&(F.normalImpulse=0),K=F.normalImpulse-Q}if(V<-u||V>u)F.tangentImpulse=0;else{var Z=F.tangentImpulse;F.tangentImpulse+=s,F.tangentImpulse<-i&&(F.tangentImpulse=-i),F.tangentImpulse>i&&(F.tangentImpulse=i),s=F.tangentImpulse-Z}var J=v*K+b*s,tt=_*K+w*s;x.isStatic||x.isSleeping||(x.positionPrev.x+=J*x.inverseMass,x.positionPrev.y+=tt*x.inverseMass,x.anglePrev+=(O*tt-G*J)*x.inverseInertia),y.isStatic||y.isSleeping||(y.positionPrev.x-=J*y.inverseMass,y.positionPrev.y-=tt*y.inverseMass,y.anglePrev-=(U*tt-L*J)*y.inverseInertia)}}}}},function(t,e,s){var r={};t.exports=r;var i=s(9),n=s(0);r.create=function(t){return n.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},t)},r.update=function(t,e,s){var r,n,a,o=i.update,l=i.create,h=i.setActive,c=t.table,u=t.list,d=u.length,p=d,f=t.collisionStart,m=t.collisionEnd,g=t.collisionActive,x=e.length,y=0,v=0,_=0;for(a=0;a<x;a++)(n=(r=e[a]).pair)?(n.isActive&&(g[_++]=n),o(n,r,s)):(c[(n=l(r,s)).id]=n,f[y++]=n,u[p++]=n);for(p=0,d=u.length,a=0;a<d;a++)(n=u[a]).timeUpdated>=s?u[p++]=n:(h(n,!1,s),n.collision.bodyA.sleepCounter>0&&n.collision.bodyB.sleepCounter>0?u[p++]=n:(m[v++]=n,delete c[n.id]));u.length!==p&&(u.length=p),f.length!==y&&(f.length=y),m.length!==v&&(m.length=v),g.length!==_&&(g.length=_)},r.clear=function(t){return t.table={},t.list.length=0,t.collisionStart.length=0,t.collisionActive.length=0,t.collisionEnd.length=0,t}},function(t,e,s){var r=t.exports=s(21);r.Axes=s(11),r.Bodies=s(12),r.Body=s(4),r.Bounds=s(1),r.Collision=s(8),r.Common=s(0),r.Composite=s(6),r.Composites=s(22),r.Constraint=s(10),r.Contact=s(16),r.Detector=s(13),r.Engine=s(17),r.Events=s(5),r.Grid=s(23),r.Mouse=s(14),r.MouseConstraint=s(24),r.Pair=s(9),r.Pairs=s(19),r.Plugin=s(15),r.Query=s(25),r.Render=s(26),r.Resolver=s(18),r.Runner=s(27),r.SAT=s(28),r.Sleeping=s(7),r.Svg=s(29),r.Vector=s(2),r.Vertices=s(3),r.World=s(30),r.Engine.run=r.Runner.run,r.Common.deprecated(r.Engine,"run","Engine.run ➤ use Matter.Runner.run(engine) instead")},function(t,e,s){var r={};t.exports=r;var i=s(15),n=s(0);r.name="matter-js",r.version="0.20.0",r.uses=[],r.used=[],r.use=function(){i.use(r,Array.prototype.slice.call(arguments))},r.before=function(t,e){return t=t.replace(/^Matter./,""),n.chainPathBefore(r,t,e)},r.after=function(t,e){return t=t.replace(/^Matter./,""),n.chainPathAfter(r,t,e)}},function(t,e,s){var r={};t.exports=r;var i=s(6),n=s(10),a=s(0),o=s(4),l=s(12),h=a.deprecated;r.stack=function(t,e,s,r,n,a,l){for(var h,c=i.create({label:"Stack"}),u=t,d=e,p=0,f=0;f<r;f++){for(var m=0,g=0;g<s;g++){var x=l(u,d,g,f,h,p);if(x){var y=x.bounds.max.y-x.bounds.min.y,v=x.bounds.max.x-x.bounds.min.x;y>m&&(m=y),o.translate(x,{x:.5*v,y:.5*y}),u=x.bounds.max.x+n,i.addBody(c,x),h=x,p+=1}else u+=n}d+=m+a,u=t}return c},r.chain=function(t,e,s,r,o,l){for(var h=t.bodies,c=1;c<h.length;c++){var u=h[c-1],d=h[c],p=u.bounds.max.y-u.bounds.min.y,f=u.bounds.max.x-u.bounds.min.x,m=d.bounds.max.y-d.bounds.min.y,g={bodyA:u,pointA:{x:f*e,y:p*s},bodyB:d,pointB:{x:(d.bounds.max.x-d.bounds.min.x)*r,y:m*o}},x=a.extend(g,l);i.addConstraint(t,n.create(x))}return t.label+=" Chain",t},r.mesh=function(t,e,s,r,o){var l,h,c,u,d,p=t.bodies;for(l=0;l<s;l++){for(h=1;h<e;h++)c=p[h-1+l*e],u=p[h+l*e],i.addConstraint(t,n.create(a.extend({bodyA:c,bodyB:u},o)));if(l>0)for(h=0;h<e;h++)c=p[h+(l-1)*e],u=p[h+l*e],i.addConstraint(t,n.create(a.extend({bodyA:c,bodyB:u},o))),r&&h>0&&(d=p[h-1+(l-1)*e],i.addConstraint(t,n.create(a.extend({bodyA:d,bodyB:u},o)))),r&&h<e-1&&(d=p[h+1+(l-1)*e],i.addConstraint(t,n.create(a.extend({bodyA:d,bodyB:u},o))))}return t.label+=" Mesh",t},r.pyramid=function(t,e,s,i,n,a,l){return r.stack(t,e,s,i,n,a,function(e,r,a,h,c,u){var d=Math.min(i,Math.ceil(s/2)),p=c?c.bounds.max.x-c.bounds.min.x:0;if(!(h>d||a<(h=d-h)||a>s-1-h))return 1===u&&o.translate(c,{x:(a+(s%2==1?1:-1))*p,y:0}),l(t+(c?a*p:0)+a*n,r,a,h,c,u)})},r.newtonsCradle=function(t,e,s,r,a){for(var o=i.create({label:"Newtons Cradle"}),h=0;h<s;h++){var c=l.circle(t+h*(1.9*r),e+a,r,{inertia:1/0,restitution:1,friction:0,frictionAir:1e-4,slop:1}),u=n.create({pointA:{x:t+h*(1.9*r),y:e},bodyB:c});i.addBody(o,c),i.addConstraint(o,u)}return o},h(r,"newtonsCradle","Composites.newtonsCradle ➤ moved to newtonsCradle example"),r.car=function(t,e,s,r,a){var h=o.nextGroup(!0),c=.5*-s+20,u=.5*s-20,d=i.create({label:"Car"}),p=l.rectangle(t,e,s,r,{collisionFilter:{group:h},chamfer:{radius:.5*r},density:2e-4}),f=l.circle(t+c,e+0,a,{collisionFilter:{group:h},friction:.8}),m=l.circle(t+u,e+0,a,{collisionFilter:{group:h},friction:.8}),g=n.create({bodyB:p,pointB:{x:c,y:0},bodyA:f,stiffness:1,length:0}),x=n.create({bodyB:p,pointB:{x:u,y:0},bodyA:m,stiffness:1,length:0});return i.addBody(d,p),i.addBody(d,f),i.addBody(d,m),i.addConstraint(d,g),i.addConstraint(d,x),d},h(r,"car","Composites.car ➤ moved to car example"),r.softBody=function(t,e,s,i,n,o,h,c,u,d){u=a.extend({inertia:1/0},u),d=a.extend({stiffness:.2,render:{type:"line",anchors:!1}},d);var p=r.stack(t,e,s,i,n,o,function(t,e){return l.circle(t,e,c,u)});return r.mesh(p,s,i,h,d),p.label="Soft Body",p},h(r,"softBody","Composites.softBody ➤ moved to softBody and cloth examples")},function(t,e,s){var r={};t.exports=r;var i=s(9),n=s(0),a=n.deprecated;r.create=function(t){return n.extend({buckets:{},pairs:{},pairsList:[],bucketWidth:48,bucketHeight:48},t)},r.update=function(t,e,s,i){var n,a,o,l,h,c=s.world,u=t.buckets,d=!1;for(n=0;n<e.length;n++){var p=e[n];if((!p.isSleeping||i)&&(!c.bounds||!(p.bounds.max.x<c.bounds.min.x||p.bounds.min.x>c.bounds.max.x||p.bounds.max.y<c.bounds.min.y||p.bounds.min.y>c.bounds.max.y))){var f=r._getRegion(t,p);if(!p.region||f.id!==p.region.id||i){p.region&&!i||(p.region=f);var m=r._regionUnion(f,p.region);for(a=m.startCol;a<=m.endCol;a++)for(o=m.startRow;o<=m.endRow;o++){l=u[h=r._getBucketId(a,o)];var g=a>=f.startCol&&a<=f.endCol&&o>=f.startRow&&o<=f.endRow,x=a>=p.region.startCol&&a<=p.region.endCol&&o>=p.region.startRow&&o<=p.region.endRow;!g&&x&&x&&l&&r._bucketRemoveBody(t,l,p),(p.region===f||g&&!x||i)&&(l||(l=r._createBucket(u,h)),r._bucketAddBody(t,l,p))}p.region=f,d=!0}}}d&&(t.pairsList=r._createActivePairsList(t))},a(r,"update","Grid.update ➤ replaced by Matter.Detector"),r.clear=function(t){t.buckets={},t.pairs={},t.pairsList=[]},a(r,"clear","Grid.clear ➤ replaced by Matter.Detector"),r._regionUnion=function(t,e){var s=Math.min(t.startCol,e.startCol),i=Math.max(t.endCol,e.endCol),n=Math.min(t.startRow,e.startRow),a=Math.max(t.endRow,e.endRow);return r._createRegion(s,i,n,a)},r._getRegion=function(t,e){var s=e.bounds,i=Math.floor(s.min.x/t.bucketWidth),n=Math.floor(s.max.x/t.bucketWidth),a=Math.floor(s.min.y/t.bucketHeight),o=Math.floor(s.max.y/t.bucketHeight);return r._createRegion(i,n,a,o)},r._createRegion=function(t,e,s,r){return{id:t+","+e+","+s+","+r,startCol:t,endCol:e,startRow:s,endRow:r}},r._getBucketId=function(t,e){return"C"+t+"R"+e},r._createBucket=function(t,e){return t[e]=[]},r._bucketAddBody=function(t,e,s){var r,n=t.pairs,a=i.id,o=e.length;for(r=0;r<o;r++){var l=e[r];if(!(s.id===l.id||s.isStatic&&l.isStatic)){var h=a(s,l),c=n[h];c?c[2]+=1:n[h]=[s,l,1]}}e.push(s)},r._bucketRemoveBody=function(t,e,s){var r,a=t.pairs,o=i.id;e.splice(n.indexOf(e,s),1);var l=e.length;for(r=0;r<l;r++){var h=a[o(s,e[r])];h&&(h[2]-=1)}},r._createActivePairsList=function(t){var e,s,r=t.pairs,i=n.keys(r),a=i.length,o=[];for(s=0;s<a;s++)(e=r[i[s]])[2]>0?o.push(e):delete r[i[s]];return o}},function(t,e,s){var r={};t.exports=r;var i=s(3),n=s(7),a=s(14),o=s(5),l=s(13),h=s(10),c=s(6),u=s(0),d=s(1);r.create=function(t,e){var s=(t?t.mouse:null)||(e?e.mouse:null);s||(t&&t.render&&t.render.canvas?s=a.create(t.render.canvas):e&&e.element?s=a.create(e.element):(s=a.create(),u.warn("MouseConstraint.create: options.mouse was undefined, options.element was undefined, may not function as expected")));var i={type:"mouseConstraint",mouse:s,element:null,body:null,constraint:h.create({label:"Mouse Constraint",pointA:s.position,pointB:{x:0,y:0},length:.01,stiffness:.1,angularStiffness:1,render:{strokeStyle:"#90EE90",lineWidth:3}}),collisionFilter:{category:1,mask:4294967295,group:0}},n=u.extend(i,e);return o.on(t,"beforeUpdate",function(){var e=c.allBodies(t.world);r.update(n,e),r._triggerEvents(n)}),n},r.update=function(t,e){var s=t.mouse,r=t.constraint,a=t.body;if(0===s.button){if(r.bodyB)n.set(r.bodyB,!1),r.pointA=s.position;else for(var h=0;h<e.length;h++)if(a=e[h],d.contains(a.bounds,s.position)&&l.canCollide(a.collisionFilter,t.collisionFilter))for(var c=a.parts.length>1?1:0;c<a.parts.length;c++){var u=a.parts[c];if(i.contains(u.vertices,s.position)){r.pointA=s.position,r.bodyB=t.body=a,r.pointB={x:s.position.x-a.position.x,y:s.position.y-a.position.y},r.angleB=a.angle,n.set(a,!1),o.trigger(t,"startdrag",{mouse:s,body:a});break}}}else r.bodyB=t.body=null,r.pointB=null,a&&o.trigger(t,"enddrag",{mouse:s,body:a})},r._triggerEvents=function(t){var e=t.mouse,s=e.sourceEvents;s.mousemove&&o.trigger(t,"mousemove",{mouse:e}),s.mousedown&&o.trigger(t,"mousedown",{mouse:e}),s.mouseup&&o.trigger(t,"mouseup",{mouse:e}),a.clearSourceEvents(e)}},function(t,e,s){var r={};t.exports=r;var i=s(2),n=s(8),a=s(1),o=s(12),l=s(3);r.collides=function(t,e){for(var s=[],r=e.length,i=t.bounds,o=n.collides,l=a.overlaps,h=0;h<r;h++){var c=e[h],u=c.parts.length,d=1===u?0:1;if(l(c.bounds,i))for(var p=d;p<u;p++){var f=c.parts[p];if(l(f.bounds,i)){var m=o(f,t);if(m){s.push(m);break}}}}return s},r.ray=function(t,e,s,n){n=n||1e-100;for(var a=i.angle(e,s),l=i.magnitude(i.sub(e,s)),h=.5*(s.x+e.x),c=.5*(s.y+e.y),u=o.rectangle(h,c,l,n,{angle:a}),d=r.collides(u,t),p=0;p<d.length;p+=1){var f=d[p];f.body=f.bodyB=f.bodyA}return d},r.region=function(t,e,s){for(var r=[],i=0;i<t.length;i++){var n=t[i],o=a.overlaps(n.bounds,e);(o&&!s||!o&&s)&&r.push(n)}return r},r.point=function(t,e){for(var s=[],r=0;r<t.length;r++){var i=t[r];if(a.contains(i.bounds,e))for(var n=1===i.parts.length?0:1;n<i.parts.length;n++){var o=i.parts[n];if(a.contains(o.bounds,e)&&l.contains(o.vertices,e)){s.push(i);break}}}return s}},function(t,e,s){var r={};t.exports=r;var i=s(4),n=s(0),a=s(6),o=s(1),l=s(5),h=s(2),c=s(14);!function(){var t,e;"undefined"!=typeof window&&(t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(function(){t(n.now())},1e3/60)},e=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame),r._goodFps=30,r._goodDelta=1e3/60,r.create=function(t){var e={engine:null,element:null,canvas:null,mouse:null,frameRequestId:null,timing:{historySize:60,delta:0,deltaHistory:[],lastTime:0,lastTimestamp:0,lastElapsed:0,timestampElapsed:0,timestampElapsedHistory:[],engineDeltaHistory:[],engineElapsedHistory:[],engineUpdatesHistory:[],elapsedHistory:[]},options:{width:800,height:600,pixelRatio:1,background:"#14151f",wireframeBackground:"#14151f",wireframeStrokeStyle:"#bbb",hasBounds:!!t.bounds,enabled:!0,wireframes:!0,showSleeping:!0,showDebug:!1,showStats:!1,showPerformance:!1,showBounds:!1,showVelocity:!1,showCollisions:!1,showSeparations:!1,showAxes:!1,showPositions:!1,showAngleIndicator:!1,showIds:!1,showVertexNumbers:!1,showConvexHulls:!1,showInternalEdges:!1,showMousePosition:!1}},s=n.extend(e,t);return s.canvas&&(s.canvas.width=s.options.width||s.canvas.width,s.canvas.height=s.options.height||s.canvas.height),s.mouse=t.mouse,s.engine=t.engine,s.canvas=s.canvas||d(s.options.width,s.options.height),s.context=s.canvas.getContext("2d"),s.textures={},s.bounds=s.bounds||{min:{x:0,y:0},max:{x:s.canvas.width,y:s.canvas.height}},s.controller=r,s.options.showBroadphase=!1,1!==s.options.pixelRatio&&r.setPixelRatio(s,s.options.pixelRatio),n.isElement(s.element)&&s.element.appendChild(s.canvas),s},r.run=function(e){!function i(n){e.frameRequestId=t(i),s(e,n),r.world(e,n),e.context.setTransform(e.options.pixelRatio,0,0,e.options.pixelRatio,0,0),(e.options.showStats||e.options.showDebug)&&r.stats(e,e.context,n),(e.options.showPerformance||e.options.showDebug)&&r.performance(e,e.context,n),e.context.setTransform(1,0,0,1,0,0)}()},r.stop=function(t){e(t.frameRequestId)},r.setPixelRatio=function(t,e){var s=t.options,r=t.canvas;"auto"===e&&(e=p(r)),s.pixelRatio=e,r.setAttribute("data-pixel-ratio",e),r.width=s.width*e,r.height=s.height*e,r.style.width=s.width+"px",r.style.height=s.height+"px"},r.setSize=function(t,e,s){t.options.width=e,t.options.height=s,t.bounds.max.x=t.bounds.min.x+e,t.bounds.max.y=t.bounds.min.y+s,1!==t.options.pixelRatio?r.setPixelRatio(t,t.options.pixelRatio):(t.canvas.width=e,t.canvas.height=s)},r.lookAt=function(t,e,s,r){r=void 0===r||r,e=n.isArray(e)?e:[e],s=s||{x:0,y:0};for(var i={min:{x:1/0,y:1/0},max:{x:-1/0,y:-1/0}},a=0;a<e.length;a+=1){var o=e[a],l=o.bounds?o.bounds.min:o.min||o.position||o,h=o.bounds?o.bounds.max:o.max||o.position||o;l&&h&&(l.x<i.min.x&&(i.min.x=l.x),h.x>i.max.x&&(i.max.x=h.x),l.y<i.min.y&&(i.min.y=l.y),h.y>i.max.y&&(i.max.y=h.y))}var u=i.max.x-i.min.x+2*s.x,d=i.max.y-i.min.y+2*s.y,p=t.canvas.height,f=t.canvas.width/p,m=u/d,g=1,x=1;m>f?x=m/f:g=f/m,t.options.hasBounds=!0,t.bounds.min.x=i.min.x,t.bounds.max.x=i.min.x+u*g,t.bounds.min.y=i.min.y,t.bounds.max.y=i.min.y+d*x,r&&(t.bounds.min.x+=.5*u-u*g*.5,t.bounds.max.x+=.5*u-u*g*.5,t.bounds.min.y+=.5*d-d*x*.5,t.bounds.max.y+=.5*d-d*x*.5),t.bounds.min.x-=s.x,t.bounds.max.x-=s.x,t.bounds.min.y-=s.y,t.bounds.max.y-=s.y,t.mouse&&(c.setScale(t.mouse,{x:(t.bounds.max.x-t.bounds.min.x)/t.canvas.width,y:(t.bounds.max.y-t.bounds.min.y)/t.canvas.height}),c.setOffset(t.mouse,t.bounds.min))},r.startViewTransform=function(t){var e=t.bounds.max.x-t.bounds.min.x,s=t.bounds.max.y-t.bounds.min.y,r=e/t.options.width,i=s/t.options.height;t.context.setTransform(t.options.pixelRatio/r,0,0,t.options.pixelRatio/i,0,0),t.context.translate(-t.bounds.min.x,-t.bounds.min.y)},r.endViewTransform=function(t){t.context.setTransform(t.options.pixelRatio,0,0,t.options.pixelRatio,0,0)},r.world=function(t,e){var s,i=n.now(),u=t.engine,d=u.world,p=t.canvas,f=t.context,g=t.options,x=t.timing,y=a.allBodies(d),v=a.allConstraints(d),_=g.wireframes?g.wireframeBackground:g.background,b=[],w=[],T={timestamp:u.timing.timestamp};if(l.trigger(t,"beforeRender",T),t.currentBackground!==_&&m(t,_),f.globalCompositeOperation="source-in",f.fillStyle="transparent",f.fillRect(0,0,p.width,p.height),f.globalCompositeOperation="source-over",g.hasBounds){for(s=0;s<y.length;s++){var S=y[s];o.overlaps(S.bounds,t.bounds)&&b.push(S)}for(s=0;s<v.length;s++){var A=v[s],C=A.bodyA,P=A.bodyB,E=A.pointA,M=A.pointB;C&&(E=h.add(C.position,A.pointA)),P&&(M=h.add(P.position,A.pointB)),E&&M&&(o.contains(t.bounds,E)||o.contains(t.bounds,M))&&w.push(A)}r.startViewTransform(t),t.mouse&&(c.setScale(t.mouse,{x:(t.bounds.max.x-t.bounds.min.x)/t.options.width,y:(t.bounds.max.y-t.bounds.min.y)/t.options.height}),c.setOffset(t.mouse,t.bounds.min))}else w=v,b=y,1!==t.options.pixelRatio&&t.context.setTransform(t.options.pixelRatio,0,0,t.options.pixelRatio,0,0);!g.wireframes||u.enableSleeping&&g.showSleeping?r.bodies(t,b,f):(g.showConvexHulls&&r.bodyConvexHulls(t,b,f),r.bodyWireframes(t,b,f)),g.showBounds&&r.bodyBounds(t,b,f),(g.showAxes||g.showAngleIndicator)&&r.bodyAxes(t,b,f),g.showPositions&&r.bodyPositions(t,b,f),g.showVelocity&&r.bodyVelocity(t,b,f),g.showIds&&r.bodyIds(t,b,f),g.showSeparations&&r.separations(t,u.pairs.list,f),g.showCollisions&&r.collisions(t,u.pairs.list,f),g.showVertexNumbers&&r.vertexNumbers(t,b,f),g.showMousePosition&&r.mousePosition(t,t.mouse,f),r.constraints(w,f),g.hasBounds&&r.endViewTransform(t),l.trigger(t,"afterRender",T),x.lastElapsed=n.now()-i},r.stats=function(t,e,s){for(var r=t.engine,i=r.world,n=a.allBodies(i),o=0,l=0,h=0;h<n.length;h+=1)o+=n[h].parts.length;var c={Part:o,Body:n.length,Cons:a.allConstraints(i).length,Comp:a.allComposites(i).length,Pair:r.pairs.list.length};for(var u in e.fillStyle="#0e0f19",e.fillRect(l,0,302.5,44),e.font="12px Arial",e.textBaseline="top",e.textAlign="right",c){var d=c[u];e.fillStyle="#aaa",e.fillText(u,l+55,8),e.fillStyle="#eee",e.fillText(d,l+55,26),l+=55}},r.performance=function(t,e){var s=t.engine,i=t.timing,a=i.deltaHistory,o=i.elapsedHistory,l=i.timestampElapsedHistory,h=i.engineDeltaHistory,c=i.engineUpdatesHistory,d=i.engineElapsedHistory,p=s.timing.lastUpdatesPerFrame,f=s.timing.lastDelta,m=u(a),g=u(o),x=u(h),y=u(c),v=u(d),_=u(l)/m||0,b=Math.round(m/f),w=1e3/m||0,T=60,S=69;e.fillStyle="#0e0f19",e.fillRect(0,50,442,34),r.status(e,10,S,T,4,a.length,Math.round(w)+" fps",w/r._goodFps,function(t){return a[t]/m-1}),r.status(e,82,S,T,4,h.length,f.toFixed(2)+" dt",r._goodDelta/f,function(t){return h[t]/x-1}),r.status(e,154,S,T,4,c.length,p+" upf",Math.pow(n.clamp(y/b||1,0,1),4),function(t){return c[t]/y-1}),r.status(e,226,S,T,4,d.length,v.toFixed(2)+" ut",1-p*v/r._goodFps,function(t){return d[t]/v-1}),r.status(e,298,S,T,4,o.length,g.toFixed(2)+" rt",1-g/r._goodFps,function(t){return o[t]/g-1}),r.status(e,370,S,T,4,l.length,_.toFixed(2)+" x",_*_*_,function(t){return(l[t]/a[t]/_||0)-1})},r.status=function(t,e,s,r,i,a,o,l,h){t.strokeStyle="#888",t.fillStyle="#444",t.lineWidth=1,t.fillRect(e,s+7,r,1),t.beginPath(),t.moveTo(e,s+7-i*n.clamp(.4*h(0),-2,2));for(var c=0;c<r;c+=1)t.lineTo(e+c,s+7-(c<a?i*n.clamp(.4*h(c),-2,2):0));t.stroke(),t.fillStyle="hsl("+n.clamp(25+95*l,0,120)+",100%,60%)",t.fillRect(e,s-7,4,4),t.font="12px Arial",t.textBaseline="middle",t.textAlign="right",t.fillStyle="#eee",t.fillText(o,e+r,s-5)},r.constraints=function(t,e){for(var s=e,r=0;r<t.length;r++){var i=t[r];if(i.render.visible&&i.pointA&&i.pointB){var a,o,l=i.bodyA,c=i.bodyB;if(a=l?h.add(l.position,i.pointA):i.pointA,"pin"===i.render.type)s.beginPath(),s.arc(a.x,a.y,3,0,2*Math.PI),s.closePath();else{if(o=c?h.add(c.position,i.pointB):i.pointB,s.beginPath(),s.moveTo(a.x,a.y),"spring"===i.render.type)for(var u,d=h.sub(o,a),p=h.perp(h.normalise(d)),f=Math.ceil(n.clamp(i.length/5,12,20)),m=1;m<f;m+=1)u=m%2==0?1:-1,s.lineTo(a.x+d.x*(m/f)+p.x*u*4,a.y+d.y*(m/f)+p.y*u*4);s.lineTo(o.x,o.y)}i.render.lineWidth&&(s.lineWidth=i.render.lineWidth,s.strokeStyle=i.render.strokeStyle,s.stroke()),i.render.anchors&&(s.fillStyle=i.render.strokeStyle,s.beginPath(),s.arc(a.x,a.y,3,0,2*Math.PI),s.arc(o.x,o.y,3,0,2*Math.PI),s.closePath(),s.fill())}}},r.bodies=function(t,e,s){var r,i,n,a,o=s,l=(t.engine,t.options),h=l.showInternalEdges||!l.wireframes;for(n=0;n<e.length;n++)if((r=e[n]).render.visible)for(a=r.parts.length>1?1:0;a<r.parts.length;a++)if((i=r.parts[a]).render.visible){if(l.showSleeping&&r.isSleeping?o.globalAlpha=.5*i.render.opacity:1!==i.render.opacity&&(o.globalAlpha=i.render.opacity),i.render.sprite&&i.render.sprite.texture&&!l.wireframes){var c=i.render.sprite,u=f(t,c.texture);o.translate(i.position.x,i.position.y),o.rotate(i.angle),o.drawImage(u,u.width*-c.xOffset*c.xScale,u.height*-c.yOffset*c.yScale,u.width*c.xScale,u.height*c.yScale),o.rotate(-i.angle),o.translate(-i.position.x,-i.position.y)}else{if(i.circleRadius)o.beginPath(),o.arc(i.position.x,i.position.y,i.circleRadius,0,2*Math.PI);else{o.beginPath(),o.moveTo(i.vertices[0].x,i.vertices[0].y);for(var d=1;d<i.vertices.length;d++)!i.vertices[d-1].isInternal||h?o.lineTo(i.vertices[d].x,i.vertices[d].y):o.moveTo(i.vertices[d].x,i.vertices[d].y),i.vertices[d].isInternal&&!h&&o.moveTo(i.vertices[(d+1)%i.vertices.length].x,i.vertices[(d+1)%i.vertices.length].y);o.lineTo(i.vertices[0].x,i.vertices[0].y),o.closePath()}l.wireframes?(o.lineWidth=1,o.strokeStyle=t.options.wireframeStrokeStyle,o.stroke()):(o.fillStyle=i.render.fillStyle,i.render.lineWidth&&(o.lineWidth=i.render.lineWidth,o.strokeStyle=i.render.strokeStyle,o.stroke()),o.fill())}o.globalAlpha=1}},r.bodyWireframes=function(t,e,s){var r,i,n,a,o,l=s,h=t.options.showInternalEdges;for(l.beginPath(),n=0;n<e.length;n++)if((r=e[n]).render.visible)for(o=r.parts.length>1?1:0;o<r.parts.length;o++){for(i=r.parts[o],l.moveTo(i.vertices[0].x,i.vertices[0].y),a=1;a<i.vertices.length;a++)!i.vertices[a-1].isInternal||h?l.lineTo(i.vertices[a].x,i.vertices[a].y):l.moveTo(i.vertices[a].x,i.vertices[a].y),i.vertices[a].isInternal&&!h&&l.moveTo(i.vertices[(a+1)%i.vertices.length].x,i.vertices[(a+1)%i.vertices.length].y);l.lineTo(i.vertices[0].x,i.vertices[0].y)}l.lineWidth=1,l.strokeStyle=t.options.wireframeStrokeStyle,l.stroke()},r.bodyConvexHulls=function(t,e,s){var r,i,n,a=s;for(a.beginPath(),i=0;i<e.length;i++)if((r=e[i]).render.visible&&1!==r.parts.length){for(a.moveTo(r.vertices[0].x,r.vertices[0].y),n=1;n<r.vertices.length;n++)a.lineTo(r.vertices[n].x,r.vertices[n].y);a.lineTo(r.vertices[0].x,r.vertices[0].y)}a.lineWidth=1,a.strokeStyle="rgba(255,255,255,0.2)",a.stroke()},r.vertexNumbers=function(t,e,s){var r,i,n,a=s;for(r=0;r<e.length;r++){var o=e[r].parts;for(n=o.length>1?1:0;n<o.length;n++){var l=o[n];for(i=0;i<l.vertices.length;i++)a.fillStyle="rgba(255,255,255,0.2)",a.fillText(r+"_"+i,l.position.x+.8*(l.vertices[i].x-l.position.x),l.position.y+.8*(l.vertices[i].y-l.position.y))}}},r.mousePosition=function(t,e,s){var r=s;r.fillStyle="rgba(255,255,255,0.8)",r.fillText(e.position.x+" "+e.position.y,e.position.x+5,e.position.y-5)},r.bodyBounds=function(t,e,s){var r=s,i=(t.engine,t.options);r.beginPath();for(var n=0;n<e.length;n++)if(e[n].render.visible)for(var a=e[n].parts,o=a.length>1?1:0;o<a.length;o++){var l=a[o];r.rect(l.bounds.min.x,l.bounds.min.y,l.bounds.max.x-l.bounds.min.x,l.bounds.max.y-l.bounds.min.y)}i.wireframes?r.strokeStyle="rgba(255,255,255,0.08)":r.strokeStyle="rgba(0,0,0,0.1)",r.lineWidth=1,r.stroke()},r.bodyAxes=function(t,e,s){var r,i,n,a,o=s,l=(t.engine,t.options);for(o.beginPath(),i=0;i<e.length;i++){var h=e[i],c=h.parts;if(h.render.visible)if(l.showAxes)for(n=c.length>1?1:0;n<c.length;n++)for(r=c[n],a=0;a<r.axes.length;a++){var u=r.axes[a];o.moveTo(r.position.x,r.position.y),o.lineTo(r.position.x+20*u.x,r.position.y+20*u.y)}else for(n=c.length>1?1:0;n<c.length;n++)for(r=c[n],a=0;a<r.axes.length;a++)o.moveTo(r.position.x,r.position.y),o.lineTo((r.vertices[0].x+r.vertices[r.vertices.length-1].x)/2,(r.vertices[0].y+r.vertices[r.vertices.length-1].y)/2)}l.wireframes?(o.strokeStyle="indianred",o.lineWidth=1):(o.strokeStyle="rgba(255, 255, 255, 0.4)",o.globalCompositeOperation="overlay",o.lineWidth=2),o.stroke(),o.globalCompositeOperation="source-over"},r.bodyPositions=function(t,e,s){var r,i,n,a,o=s,l=(t.engine,t.options);for(o.beginPath(),n=0;n<e.length;n++)if((r=e[n]).render.visible)for(a=0;a<r.parts.length;a++)i=r.parts[a],o.arc(i.position.x,i.position.y,3,0,2*Math.PI,!1),o.closePath();for(l.wireframes?o.fillStyle="indianred":o.fillStyle="rgba(0,0,0,0.5)",o.fill(),o.beginPath(),n=0;n<e.length;n++)(r=e[n]).render.visible&&(o.arc(r.positionPrev.x,r.positionPrev.y,2,0,2*Math.PI,!1),o.closePath());o.fillStyle="rgba(255,165,0,0.8)",o.fill()},r.bodyVelocity=function(t,e,s){var r=s;r.beginPath();for(var n=0;n<e.length;n++){var a=e[n];if(a.render.visible){var o=i.getVelocity(a);r.moveTo(a.position.x,a.position.y),r.lineTo(a.position.x+o.x,a.position.y+o.y)}}r.lineWidth=3,r.strokeStyle="cornflowerblue",r.stroke()},r.bodyIds=function(t,e,s){var r,i,n=s;for(r=0;r<e.length;r++)if(e[r].render.visible){var a=e[r].parts;for(i=a.length>1?1:0;i<a.length;i++){var o=a[i];n.font="12px Arial",n.fillStyle="rgba(255,255,255,0.5)",n.fillText(o.id,o.position.x+10,o.position.y-10)}}},r.collisions=function(t,e,s){var r,i,n,a,o=s,l=t.options;for(o.beginPath(),n=0;n<e.length;n++)if((r=e[n]).isActive)for(i=r.collision,a=0;a<r.contactCount;a++){var h=r.contacts[a].vertex;o.rect(h.x-1.5,h.y-1.5,3.5,3.5)}for(l.wireframes?o.fillStyle="rgba(255,255,255,0.7)":o.fillStyle="orange",o.fill(),o.beginPath(),n=0;n<e.length;n++)if((r=e[n]).isActive&&(i=r.collision,r.contactCount>0)){var c=r.contacts[0].vertex.x,u=r.contacts[0].vertex.y;2===r.contactCount&&(c=(r.contacts[0].vertex.x+r.contacts[1].vertex.x)/2,u=(r.contacts[0].vertex.y+r.contacts[1].vertex.y)/2),i.bodyB===i.supports[0].body||!0===i.bodyA.isStatic?o.moveTo(c-8*i.normal.x,u-8*i.normal.y):o.moveTo(c+8*i.normal.x,u+8*i.normal.y),o.lineTo(c,u)}l.wireframes?o.strokeStyle="rgba(255,165,0,0.7)":o.strokeStyle="orange",o.lineWidth=1,o.stroke()},r.separations=function(t,e,s){var r,i,n,a,o,l=s,h=t.options;for(l.beginPath(),o=0;o<e.length;o++)if((r=e[o]).isActive){n=(i=r.collision).bodyA;var c=1;(a=i.bodyB).isStatic||n.isStatic||(c=.5),a.isStatic&&(c=0),l.moveTo(a.position.x,a.position.y),l.lineTo(a.position.x-i.penetration.x*c,a.position.y-i.penetration.y*c),c=1,a.isStatic||n.isStatic||(c=.5),n.isStatic&&(c=0),l.moveTo(n.position.x,n.position.y),l.lineTo(n.position.x+i.penetration.x*c,n.position.y+i.penetration.y*c)}h.wireframes?l.strokeStyle="rgba(255,165,0,0.5)":l.strokeStyle="orange",l.stroke()},r.inspector=function(t,e){t.engine;var s,r=t.selected,i=t.render,n=i.options;if(n.hasBounds){var a=i.bounds.max.x-i.bounds.min.x,o=i.bounds.max.y-i.bounds.min.y,l=a/i.options.width,h=o/i.options.height;e.scale(1/l,1/h),e.translate(-i.bounds.min.x,-i.bounds.min.y)}for(var c=0;c<r.length;c++){var u=r[c].data;switch(e.translate(.5,.5),e.lineWidth=1,e.strokeStyle="rgba(255,165,0,0.9)",e.setLineDash([1,2]),u.type){case"body":s=u.bounds,e.beginPath(),e.rect(Math.floor(s.min.x-3),Math.floor(s.min.y-3),Math.floor(s.max.x-s.min.x+6),Math.floor(s.max.y-s.min.y+6)),e.closePath(),e.stroke();break;case"constraint":var d=u.pointA;u.bodyA&&(d=u.pointB),e.beginPath(),e.arc(d.x,d.y,10,0,2*Math.PI),e.closePath(),e.stroke()}e.setLineDash([]),e.translate(-.5,-.5)}null!==t.selectStart&&(e.translate(.5,.5),e.lineWidth=1,e.strokeStyle="rgba(255,165,0,0.6)",e.fillStyle="rgba(255,165,0,0.1)",s=t.selectBounds,e.beginPath(),e.rect(Math.floor(s.min.x),Math.floor(s.min.y),Math.floor(s.max.x-s.min.x),Math.floor(s.max.y-s.min.y)),e.closePath(),e.stroke(),e.fill(),e.translate(-.5,-.5)),n.hasBounds&&e.setTransform(1,0,0,1,0,0)};var s=function(t,e){var s=t.engine,i=t.timing,n=i.historySize,a=s.timing.timestamp;i.delta=e-i.lastTime||r._goodDelta,i.lastTime=e,i.timestampElapsed=a-i.lastTimestamp||0,i.lastTimestamp=a,i.deltaHistory.unshift(i.delta),i.deltaHistory.length=Math.min(i.deltaHistory.length,n),i.engineDeltaHistory.unshift(s.timing.lastDelta),i.engineDeltaHistory.length=Math.min(i.engineDeltaHistory.length,n),i.timestampElapsedHistory.unshift(i.timestampElapsed),i.timestampElapsedHistory.length=Math.min(i.timestampElapsedHistory.length,n),i.engineUpdatesHistory.unshift(s.timing.lastUpdatesPerFrame),i.engineUpdatesHistory.length=Math.min(i.engineUpdatesHistory.length,n),i.engineElapsedHistory.unshift(s.timing.lastElapsed),i.engineElapsedHistory.length=Math.min(i.engineElapsedHistory.length,n),i.elapsedHistory.unshift(i.lastElapsed),i.elapsedHistory.length=Math.min(i.elapsedHistory.length,n)},u=function(t){for(var e=0,s=0;s<t.length;s+=1)e+=t[s];return e/t.length||0},d=function(t,e){var s=document.createElement("canvas");return s.width=t,s.height=e,s.oncontextmenu=function(){return!1},s.onselectstart=function(){return!1},s},p=function(t){var e=t.getContext("2d");return(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)},f=function(t,e){var s=t.textures[e];return s||((s=t.textures[e]=new Image).src=e,s)},m=function(t,e){var s=e;/(jpg|gif|png)$/.test(e)&&(s="url("+e+")"),t.canvas.style.background=s,t.canvas.style.backgroundSize="contain",t.currentBackground=e}}()},function(t,e,s){var r={};t.exports=r;var i=s(5),n=s(17),a=s(0);!function(){r._maxFrameDelta=1e3/15,r._frameDeltaFallback=1e3/60,r._timeBufferMargin=1.5,r._elapsedNextEstimate=1,r._smoothingLowerBound=.1,r._smoothingUpperBound=.9,r.create=function(t){var e=a.extend({delta:1e3/60,frameDelta:null,frameDeltaSmoothing:!0,frameDeltaSnapping:!0,frameDeltaHistory:[],frameDeltaHistorySize:100,frameRequestId:null,timeBuffer:0,timeLastTick:null,maxUpdates:null,maxFrameTime:1e3/30,lastUpdatesDeferred:0,enabled:!0},t);return e.fps=0,e},r.run=function(t,e){return t.timeBuffer=r._frameDeltaFallback,function s(i){t.frameRequestId=r._onNextFrame(t,s),i&&t.enabled&&r.tick(t,e,i)}(),t},r.tick=function(e,s,o){var l=a.now(),h=e.delta,c=0,u=o-e.timeLastTick;if((!u||!e.timeLastTick||u>Math.max(r._maxFrameDelta,e.maxFrameTime))&&(u=e.frameDelta||r._frameDeltaFallback),e.frameDeltaSmoothing){e.frameDeltaHistory.push(u),e.frameDeltaHistory=e.frameDeltaHistory.slice(-e.frameDeltaHistorySize);var d=e.frameDeltaHistory.slice(0).sort(),p=e.frameDeltaHistory.slice(d.length*r._smoothingLowerBound,d.length*r._smoothingUpperBound);u=t(p)||u}e.frameDeltaSnapping&&(u=1e3/Math.round(1e3/u)),e.frameDelta=u,e.timeLastTick=o,e.timeBuffer+=e.frameDelta,e.timeBuffer=a.clamp(e.timeBuffer,0,e.frameDelta+h*r._timeBufferMargin),e.lastUpdatesDeferred=0;var f=e.maxUpdates||Math.ceil(e.maxFrameTime/h),m={timestamp:s.timing.timestamp};i.trigger(e,"beforeTick",m),i.trigger(e,"tick",m);for(var g=a.now();h>0&&e.timeBuffer>=h*r._timeBufferMargin;){i.trigger(e,"beforeUpdate",m),n.update(s,h),i.trigger(e,"afterUpdate",m),e.timeBuffer-=h,c+=1;var x=a.now()-l,y=a.now()-g,v=x+r._elapsedNextEstimate*y/c;if(c>=f||v>e.maxFrameTime){e.lastUpdatesDeferred=Math.round(Math.max(0,e.timeBuffer/h-r._timeBufferMargin));break}}s.timing.lastUpdatesPerFrame=c,i.trigger(e,"afterTick",m),e.frameDeltaHistory.length>=100&&(e.lastUpdatesDeferred&&Math.round(e.frameDelta/h)>f?a.warnOnce("Matter.Runner: runner reached runner.maxUpdates, see docs."):e.lastUpdatesDeferred&&a.warnOnce("Matter.Runner: runner reached runner.maxFrameTime, see docs."),void 0!==e.isFixed&&a.warnOnce("Matter.Runner: runner.isFixed is now redundant, see docs."),(e.deltaMin||e.deltaMax)&&a.warnOnce("Matter.Runner: runner.deltaMin and runner.deltaMax were removed, see docs."),0!==e.fps&&a.warnOnce("Matter.Runner: runner.fps was replaced by runner.delta, see docs."))},r.stop=function(t){r._cancelNextFrame(t)},r._onNextFrame=function(t,e){if("undefined"==typeof window||!window.requestAnimationFrame)throw new Error("Matter.Runner: missing required global window.requestAnimationFrame.");return t.frameRequestId=window.requestAnimationFrame(e),t.frameRequestId},r._cancelNextFrame=function(t){if("undefined"==typeof window||!window.cancelAnimationFrame)throw new Error("Matter.Runner: missing required global window.cancelAnimationFrame.");window.cancelAnimationFrame(t.frameRequestId)};var t=function(t){for(var e=0,s=t.length,r=0;r<s;r+=1)e+=t[r];return e/s||0}}()},function(t,e,s){var r={};t.exports=r;var i=s(8),n=s(0).deprecated;r.collides=function(t,e){return i.collides(t,e)},n(r,"collides","SAT.collides ➤ replaced by Collision.collides")},function(t,e,s){var r={};t.exports=r,s(1);var i=s(0);r.pathToVertices=function(t,e){"undefined"==typeof window||"SVGPathSeg"in window||i.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var s,n,a,o,l,h,c,u,d,p,f,m=[],g=0,x=0,y=0;e=e||15;var v=function(t,e,s){var r=s%2==1&&s>1;if(!d||t!=d.x||e!=d.y){d&&r?(p=d.x,f=d.y):(p=0,f=0);var i={x:p+t,y:f+e};!r&&d||(d=i),m.push(i),x=p+t,y=f+e}},_=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":x=t.x,y=t.y;break;case"H":x=t.x;break;case"V":y=t.y}v(x,y,t.pathSegType)}};for(r._svgPathToAbsolute(t),a=t.getTotalLength(),h=[],s=0;s<t.pathSegList.numberOfItems;s+=1)h.push(t.pathSegList.getItem(s));for(c=h.concat();g<a;){if((l=h[t.getPathSegAtLength(g)])!=u){for(;c.length&&c[0]!=l;)_(c.shift());u=l}switch(l.pathSegTypeAsLetter.toUpperCase()){case"C":case"T":case"S":case"Q":case"A":o=t.getPointAtLength(g),v(o.x,o.y,0)}g+=e}for(s=0,n=c.length;s<n;++s)_(c[s]);return m},r._svgPathToAbsolute=function(t){for(var e,s,r,i,n,a,o=t.pathSegList,l=0,h=0,c=o.numberOfItems,u=0;u<c;++u){var d=o.getItem(u),p=d.pathSegTypeAsLetter;if(/[MLHVCSQTA]/.test(p))"x"in d&&(l=d.x),"y"in d&&(h=d.y);else switch("x1"in d&&(r=l+d.x1),"x2"in d&&(n=l+d.x2),"y1"in d&&(i=h+d.y1),"y2"in d&&(a=h+d.y2),"x"in d&&(l+=d.x),"y"in d&&(h+=d.y),p){case"m":o.replaceItem(t.createSVGPathSegMovetoAbs(l,h),u);break;case"l":o.replaceItem(t.createSVGPathSegLinetoAbs(l,h),u);break;case"h":o.replaceItem(t.createSVGPathSegLinetoHorizontalAbs(l),u);break;case"v":o.replaceItem(t.createSVGPathSegLinetoVerticalAbs(h),u);break;case"c":o.replaceItem(t.createSVGPathSegCurvetoCubicAbs(l,h,r,i,n,a),u);break;case"s":o.replaceItem(t.createSVGPathSegCurvetoCubicSmoothAbs(l,h,n,a),u);break;case"q":o.replaceItem(t.createSVGPathSegCurvetoQuadraticAbs(l,h,r,i),u);break;case"t":o.replaceItem(t.createSVGPathSegCurvetoQuadraticSmoothAbs(l,h),u);break;case"a":o.replaceItem(t.createSVGPathSegArcAbs(l,h,d.r1,d.r2,d.angle,d.largeArcFlag,d.sweepFlag),u);break;case"z":case"Z":l=e,h=s}"M"!=p&&"m"!=p||(e=l,s=h)}}},function(t,e,s){var r={};t.exports=r;var i=s(6);s(0),r.create=i.create,r.add=i.add,r.remove=i.remove,r.clear=i.clear,r.addComposite=i.addComposite,r.addBody=i.addBody,r.addConstraint=i.addConstraint}])},t.exports=r()},8725:(t,e,s)=>{"use strict";s.d(e,{A:()=>i});let r=null;class i{constructor(){r||(r=URL.createObjectURL(new Blob(['(function () {\n \'use strict\';\n\n const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=";\n async function checkImageBitmap() {\n try {\n if (typeof createImageBitmap !== "function")\n return false;\n const response = await fetch(WHITE_PNG);\n const imageBlob = await response.blob();\n const imageBitmap = await createImageBitmap(imageBlob);\n return imageBitmap.width === 1 && imageBitmap.height === 1;\n } catch (_e) {\n return false;\n }\n }\n void checkImageBitmap().then((result) => {\n self.postMessage(result);\n });\n\n})();\n'],{type:"application/javascript"}))),this.worker=new Worker(r)}}i.revokeObjectURL=function(){r&&(URL.revokeObjectURL(r),r=null)}},8730:t=>{"use strict";t.exports=JSON.parse('{"frames":{"idle-1":{"frame":{"x":0,"y":0,"w":100,"h":100}},"idle-2":{"frame":{"x":100,"y":0,"w":100,"h":100}},"idle-3":{"frame":{"x":200,"y":0,"w":100,"h":100}},"idle-4":{"frame":{"x":300,"y":0,"w":100,"h":100}},"idle-5":{"frame":{"x":400,"y":0,"w":100,"h":100}},"idle-6":{"frame":{"x":500,"y":0,"w":100,"h":100}},"walk-1":{"frame":{"x":0,"y":100,"w":100,"h":100}},"walk-2":{"frame":{"x":100,"y":100,"w":100,"h":100}},"walk-3":{"frame":{"x":200,"y":100,"w":100,"h":100}},"walk-4":{"frame":{"x":300,"y":100,"w":100,"h":100}},"walk-5":{"frame":{"x":400,"y":100,"w":100,"h":100}},"walk-6":{"frame":{"x":500,"y":100,"w":100,"h":100}},"walk-7":{"frame":{"x":600,"y":100,"w":100,"h":100}},"walk-8":{"frame":{"x":700,"y":100,"w":100,"h":100}},"attack1-1":{"frame":{"x":0,"y":200,"w":100,"h":100}},"attack1-2":{"frame":{"x":100,"y":200,"w":100,"h":100}},"attack1-3":{"frame":{"x":200,"y":200,"w":100,"h":100}},"attack1-4":{"frame":{"x":300,"y":200,"w":100,"h":100}},"attack1-5":{"frame":{"x":400,"y":200,"w":100,"h":100}},"attack1-6":{"frame":{"x":500,"y":200,"w":100,"h":100}},"attack2-1":{"frame":{"x":0,"y":300,"w":100,"h":100}},"attack2-2":{"frame":{"x":100,"y":300,"w":100,"h":100}},"attack2-3":{"frame":{"x":200,"y":300,"w":100,"h":100}},"attack2-4":{"frame":{"x":300,"y":300,"w":100,"h":100}},"attack2-5":{"frame":{"x":400,"y":300,"w":100,"h":100}},"attack2-6":{"frame":{"x":500,"y":300,"w":100,"h":100}},"die-1":{"frame":{"x":0,"y":500,"w":100,"h":100}},"die-2":{"frame":{"x":100,"y":500,"w":100,"h":100}},"die-3":{"frame":{"x":200,"y":500,"w":100,"h":100}},"die-4":{"frame":{"x":300,"y":500,"w":100,"h":100}}},"meta":{"scale":1},"animations":{"idle":["idle-1","idle-2","idle-3","idle-4","idle-5","idle-6"],"walk":["walk-1","walk-2","walk-3","walk-4","walk-5","walk-6","walk-7","walk-8"],"attack1":["attack1-1","attack1-2","attack1-3","attack1-4","attack1-5","attack1-6"],"attack2":["attack2-1","attack2-2","attack2-3","attack2-4","attack2-5","attack2-6"],"die":["die-1","die-2","die-3","die-4"]}}')},8742:(t,e,s)=>{"use strict";s(432),s(8847),s(3645),s(7635),s(2839)._},8826:(t,e,s)=>{"use strict";s.d(e,{f:()=>n});var r=s(166),i=s(992);class n extends r.Mtr{constructor(t){super({glProgram:(0,r.Ivi)({name:"dark-tint-batch",bits:[r.a4b,i.i,(0,r.PDq)(t),r.mx8]}),gpuProgram:(0,r.vfs)({name:"dark-tint-batch",bits:[r.FFI,i.R,(0,r._1d)(t),r.b3l]}),resources:{batchSamplers:(0,r.n2X)(t)}})}}},8840:(t,e,s)=>{"use strict";s.d(e,{C:()=>i});var r=s(192);class i extends r.R{interval;#Qt=0;#Zt;constructor(t,e){super(),this.interval=t,this.#Zt=e}update(t){super.update(t),this.#Qt+=t,this.#Qt>=this.interval&&(this.#Qt%=this.interval,this.#Zt())}}},8847:(t,e,s)=>{"use strict";s.d(e,{j:()=>n});var r=s(6793);class i extends r.a{async doLoad(t){const e=(async()=>{const e=await fetch(t);if(!e.ok)return void console.error(`Failed to load binary data: ${t}`);const s=await e.arrayBuffer(),r=new Uint8Array(s);if(this.loadingPromises.delete(t),this.hasActiveRef(t)){if(!this.cachedAssets.has(t))return this.cachedAssets.set(t,r),r;console.error(`Binary data already exists: ${t}`)}})();return this.loadingPromises.set(t,e),await e}}const n=new i},8851:(t,e,s)=>{"use strict";s.d(e,{W:()=>h});var r=s(9437),i=s(1753),n=s(4269),a=s(9739),o=s(8896);let l=0;const h=new class{constructor(t){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this.textureStyle=new o.n(this.textureOptions)}createTexture(t,e,s){const r=new n.v({...this.textureOptions,width:t,height:e,resolution:1,antialias:s,autoGarbageCollect:!1});return new a.g({source:r,label:"texturePool_"+l++})}getOptimalTexture(t,e,s=1,i){let n=Math.ceil(t*s-1e-6),a=Math.ceil(e*s-1e-6);n=(0,r.U5)(n),a=(0,r.U5)(a);const o=(n<<17)+(a<<1)+(i?1:0);this._texturePool[o]||(this._texturePool[o]=[]);let l=this._texturePool[o].pop();return l||(l=this.createTexture(n,a,i)),l.source._resolution=s,l.source.width=n/s,l.source.height=a/s,l.source.pixelWidth=n,l.source.pixelHeight=a,l.frame.x=0,l.frame.y=0,l.frame.width=t,l.frame.height=e,l.updateUvs(),this._poolKeyHash[l.uid]=o,l}getSameSizeTexture(t,e=!1){const s=t.source;return this.getOptimalTexture(t.width,t.height,s._resolution,e)}returnTexture(t,e=!1){const s=this._poolKeyHash[t.uid];e&&(t.source.style=this.textureStyle),this._texturePool[s].push(t)}clear(t){if(t=!1!==t)for(const t in this._texturePool){const e=this._texturePool[t];if(e)for(let t=0;t<e.length;t++)e[t].destroy(!0)}this._texturePool={}}};i.L.register(h)},8869:(t,e,s)=>{"use strict";s.d(e,{A:()=>a});var r=s(5423);function i(t){if("string"!=typeof t)throw new TypeError(`Path must be a string. Received ${JSON.stringify(t)}`)}function n(t){return t.split("?")[0].split("#")[0]}const a={toPosix:t=>t.replace(new RegExp("\\".replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),"/"),isUrl(t){return/^https?:/.test(this.toPosix(t))},isDataUrl:t=>/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(t),isBlobUrl:t=>t.startsWith("blob:"),hasProtocol(t){return/^[^/:]+:/.test(this.toPosix(t))},getProtocol(t){i(t),t=this.toPosix(t);const e=/^file:\/\/\//.exec(t);if(e)return e[0];const s=/^[^/:]+:\/{0,2}/.exec(t);return s?s[0]:""},toAbsolute(t,e,s){if(i(t),this.isDataUrl(t)||this.isBlobUrl(t))return t;const o=n(this.toPosix(e??r.e.get().getBaseUrl())),l=n(this.toPosix(s??this.rootname(o)));return(t=this.toPosix(t)).startsWith("/")?a.join(l,t.slice(1)):this.isAbsolute(t)?t:this.join(o,t)},normalize(t){if(i(t),0===t.length)return".";if(this.isDataUrl(t)||this.isBlobUrl(t))return t;let e="";const s=(t=this.toPosix(t)).startsWith("/");this.hasProtocol(t)&&(e=this.rootname(t),t=t.slice(e.length));const r=t.endsWith("/");return(t=function(t){let e="",s=0,r=-1,i=0,n=-1;for(let a=0;a<=t.length;++a){if(a<t.length)n=t.charCodeAt(a);else{if(47===n)break;n=47}if(47===n){if(r===a-1||1===i);else if(r!==a-1&&2===i){if(e.length<2||2!==s||46!==e.charCodeAt(e.length-1)||46!==e.charCodeAt(e.length-2))if(e.length>2){const t=e.lastIndexOf("/");if(t!==e.length-1){-1===t?(e="",s=0):(e=e.slice(0,t),s=e.length-1-e.lastIndexOf("/")),r=a,i=0;continue}}else if(2===e.length||1===e.length){e="",s=0,r=a,i=0;continue}}else e.length>0?e+=`/${t.slice(r+1,a)}`:e=t.slice(r+1,a),s=a-r-1;r=a,i=0}else 46===n&&-1!==i?++i:i=-1}return e}(t)).length>0&&r&&(t+="/"),s?`/${t}`:e+t},isAbsolute(t){return i(t),t=this.toPosix(t),!!this.hasProtocol(t)||t.startsWith("/")},join(...t){if(0===t.length)return".";let e;for(let s=0;s<t.length;++s){const r=t[s];if(i(r),r.length>0)if(void 0===e)e=r;else{const i=t[s-1]??"";this.joinExtensions.includes(this.extname(i).toLowerCase())?e+=`/../${r}`:e+=`/${r}`}}return void 0===e?".":this.normalize(e)},dirname(t){if(i(t),0===t.length)return".";let e=(t=this.toPosix(t)).charCodeAt(0);const s=47===e;let r=-1,n=!0;const a=this.getProtocol(t),o=t;for(let s=(t=t.slice(a.length)).length-1;s>=1;--s)if(e=t.charCodeAt(s),47===e){if(!n){r=s;break}}else n=!1;return-1===r?s?"/":this.isUrl(o)?a+t:a:s&&1===r?"//":a+t.slice(0,r)},rootname(t){i(t);let e="";if(e=(t=this.toPosix(t)).startsWith("/")?"/":this.getProtocol(t),this.isUrl(t)){const s=t.indexOf("/",e.length);e=-1!==s?t.slice(0,s):t,e.endsWith("/")||(e+="/")}return e},basename(t,e){i(t),e&&i(e),t=n(this.toPosix(t));let s,r=0,a=-1,o=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";let i=e.length-1,n=-1;for(s=t.length-1;s>=0;--s){const l=t.charCodeAt(s);if(47===l){if(!o){r=s+1;break}}else-1===n&&(o=!1,n=s+1),i>=0&&(l===e.charCodeAt(i)?-1===--i&&(a=s):(i=-1,a=n))}return r===a?a=n:-1===a&&(a=t.length),t.slice(r,a)}for(s=t.length-1;s>=0;--s)if(47===t.charCodeAt(s)){if(!o){r=s+1;break}}else-1===a&&(o=!1,a=s+1);return-1===a?"":t.slice(r,a)},extname(t){i(t);let e=-1,s=0,r=-1,a=!0,o=0;for(let i=(t=n(this.toPosix(t))).length-1;i>=0;--i){const n=t.charCodeAt(i);if(47!==n)-1===r&&(a=!1,r=i+1),46===n?-1===e?e=i:1!==o&&(o=1):-1!==e&&(o=-1);else if(!a){s=i+1;break}}return-1===e||-1===r||0===o||1===o&&e===r-1&&e===s+1?"":t.slice(e,r)},parse(t){i(t);const e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;let s=(t=n(this.toPosix(t))).charCodeAt(0);const r=this.isAbsolute(t);let a;e.root=this.rootname(t),a=r||this.hasProtocol(t)?1:0;let o=-1,l=0,h=-1,c=!0,u=t.length-1,d=0;for(;u>=a;--u)if(s=t.charCodeAt(u),47!==s)-1===h&&(c=!1,h=u+1),46===s?-1===o?o=u:1!==d&&(d=1):-1!==o&&(d=-1);else if(!c){l=u+1;break}return-1===o||-1===h||0===d||1===d&&o===h-1&&o===l+1?-1!==h&&(e.base=e.name=0===l&&r?t.slice(1,h):t.slice(l,h)):(0===l&&r?(e.name=t.slice(1,o),e.base=t.slice(1,h)):(e.name=t.slice(l,o),e.base=t.slice(l,h)),e.ext=t.slice(o,h)),e.dir=this.dirname(t),e},sep:"/",delimiter:":",joinExtensions:[".html"]}},8883:(t,e,s)=>{"use strict";let r;function i(){if("boolean"==typeof r)return r;try{const t=new Function("param1","param2","param3","return param1[param2] === param3;");r=!0===t({a:"b"},"a","b")}catch(t){r=!1}return r}s.d(e,{f:()=>i})},8894:(t,e,s)=>{"use strict";s.d(e,{V:()=>n});var r=s(5331),i=s(1347);class n{minX=0;minY=0;maxX=0;maxY=0;boundingBoxes=new Array;polygons=new Array;polygonPool=new i.bC(()=>i.Aq.newFloatArray(16));update(t,e){if(!t)throw new Error("skeleton cannot be null.");let s=this.boundingBoxes,n=this.polygons,a=this.polygonPool,o=t.slots,l=o.length;s.length=0,a.freeAll(n),n.length=0;for(let t=0;t<l;t++){let e=o[t];if(!e.bone.active)continue;let l=e.getAttachment();if(l instanceof r.b){let t=l;s.push(t);let r=a.obtain();r.length!=t.worldVerticesLength&&(r=i.Aq.newFloatArray(t.worldVerticesLength)),n.push(r),t.computeWorldVertices(e,0,t.worldVerticesLength,r,0,2)}}e?this.aabbCompute():(this.minX=Number.POSITIVE_INFINITY,this.minY=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.maxY=Number.NEGATIVE_INFINITY)}aabbCompute(){let t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=this.polygons;for(let n=0,a=i.length;n<a;n++){let a=i[n],o=a;for(let i=0,n=a.length;i<n;i+=2){let n=o[i],a=o[i+1];t=Math.min(t,n),e=Math.min(e,a),s=Math.max(s,n),r=Math.max(r,a)}}this.minX=t,this.minY=e,this.maxX=s,this.maxY=r}aabbContainsPoint(t,e){return t>=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,s,r){let i=this.minX,n=this.minY,a=this.maxX,o=this.maxY;if(t<=i&&s<=i||e<=n&&r<=n||t>=a&&s>=a||e>=o&&r>=o)return!1;let l=(r-e)/(s-t),h=l*(i-t)+e;if(h>n&&h<o)return!0;if(h=l*(a-t)+e,h>n&&h<o)return!0;let c=(n-e)/l+t;return c>i&&c<a||(c=(o-e)/l+t,c>i&&c<a)}aabbIntersectsSkeleton(t){return this.minX<t.maxX&&this.maxX>t.minX&&this.minY<t.maxY&&this.maxY>t.minY}containsPoint(t,e){let s=this.polygons;for(let r=0,i=s.length;r<i;r++)if(this.containsPointPolygon(s[r],t,e))return this.boundingBoxes[r];return null}containsPointPolygon(t,e,s){let r=t,i=t.length,n=i-2,a=!1;for(let t=0;t<i;t+=2){let i=r[t+1],o=r[n+1];if(i<s&&o>=s||o<s&&i>=s){let l=r[t];l+(s-i)/(o-i)*(r[n]-l)<e&&(a=!a)}n=t}return a}intersectsSegment(t,e,s,r){let i=this.polygons;for(let n=0,a=i.length;n<a;n++)if(this.intersectsSegmentPolygon(i[n],t,e,s,r))return this.boundingBoxes[n];return null}intersectsSegmentPolygon(t,e,s,r,i){let n=t,a=t.length,o=e-r,l=s-i,h=e*i-s*r,c=n[a-2],u=n[a-1];for(let t=0;t<a;t+=2){let a=n[t],d=n[t+1],p=c*d-u*a,f=c-a,m=u-d,g=o*m-l*f,x=(h*f-o*p)/g;if((x>=c&&x<=a||x>=a&&x<=c)&&(x>=e&&x<=r||x>=r&&x<=e)){let t=(h*m-l*p)/g;if((t>=u&&t<=d||t>=d&&t<=u)&&(t>=s&&t<=i||t>=i&&t<=s))return!0}c=a,u=d}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");let e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}}},8896:(t,e,s)=>{"use strict";s.d(e,{n:()=>l});var r=s(4872),i=s(9375),n=s(4696);const a=Object.create(null),o=class t extends r.A{constructor(e={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,e={...t.defaultOptions,...e},this.addressMode=e.addressMode,this.addressModeU=e.addressModeU??this.addressModeU,this.addressModeV=e.addressModeV??this.addressModeV,this.addressModeW=e.addressModeW??this.addressModeW,this.scaleMode=e.scaleMode,this.magFilter=e.magFilter??this.magFilter,this.minFilter=e.minFilter??this.minFilter,this.mipmapFilter=e.mipmapFilter??this.mipmapFilter,this.lodMinClamp=e.lodMinClamp,this.lodMaxClamp=e.lodMaxClamp,this.compare=e.compare,this.maxAnisotropy=e.maxAnisotropy??1}set addressMode(t){this.addressModeU=t,this.addressModeV=t,this.addressModeW=t}get addressMode(){return this.addressModeU}set wrapMode(t){(0,n.t6)(n.lj,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=t}get wrapMode(){return this.addressMode}set scaleMode(t){this.magFilter=t,this.minFilter=t,this.mipmapFilter=t}get scaleMode(){return this.magFilter}set maxAnisotropy(t){this._maxAnisotropy=Math.min(t,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this.emit("change",this),this._sharedResourceId=null}_generateResourceId(){const t=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=function(t){const e=a[t];return void 0===e&&(a[t]=(0,i.L)("resource")),e}(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};o.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let l=o},8900:(t,e,s)=>{"use strict";s.d(e,{l:()=>d});var r=s(5199),i=s(9390),n=s(1711),a=s(2255),o=s(1386),l=s(4269),h=s(9739),c=s(8955),u=s(2277);class d{constructor(t){this.rootViewPort=new i.M,this.viewport=new i.M,this.onRenderTargetChange=new a.C("onRenderTargetChange"),this.projectionMatrix=new r.u,this.defaultClearColor=[0,0,0,0],this._renderSurfaceToRenderTargetHash=new Map,this._gpuRenderTargetHash=Object.create(null),this._renderTargetStack=[],this._renderer=t,t.renderableGC.addManagedHash(this,"_gpuRenderTargetHash")}finishRenderPass(){this.adaptor.finishRenderPass(this.renderTarget)}renderStart({target:t,clear:e,clearColor:s,frame:r}){this._renderTargetStack.length=0,this.push(t,e,s,r),this.rootViewPort.copyFrom(this.viewport),this.rootRenderTarget=this.renderTarget,this.renderingToScreen=function(t){const e=t.colorTexture.source.resource;return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement&&document.body.contains(e)}(this.rootRenderTarget),this.adaptor.prerender?.(this.rootRenderTarget)}postrender(){this.adaptor.postrender?.(this.rootRenderTarget)}bind(t,e=!0,s,r){const i=this.getRenderTarget(t),n=this.renderTarget!==i;this.renderTarget=i,this.renderSurface=t;const a=this.getGpuRenderTarget(i);i.pixelWidth===a.width&&i.pixelHeight===a.height||(this.adaptor.resizeGpuRenderTarget(i),a.width=i.pixelWidth,a.height=i.pixelHeight);const o=i.colorTexture,l=this.viewport,c=o.pixelWidth,u=o.pixelHeight;if(!r&&t instanceof h.g&&(r=t.frame),r){const t=o._resolution;l.x=r.x*t+.5|0,l.y=r.y*t+.5|0,l.width=r.width*t+.5|0,l.height=r.height*t+.5|0}else l.x=0,l.y=0,l.width=c,l.height=u;return function(t,e,s,r,i,n){const a=n?1:-1;t.identity(),t.a=1/r*2,t.d=a*(1/i*2),t.tx=-1-0*t.a,t.ty=-a-0*t.d}(this.projectionMatrix,0,0,l.width/o.resolution,l.height/o.resolution,!i.isRoot),this.adaptor.startRenderPass(i,e,s,l),n&&this.onRenderTargetChange.emit(i),i}clear(t,e=n.u.ALL,s){e&&(t&&(t=this.getRenderTarget(t)),this.adaptor.clear(t||this.renderTarget,e,s,this.viewport))}contextChange(){this._gpuRenderTargetHash=Object.create(null)}push(t,e=n.u.ALL,s,r){const i=this.bind(t,e,s,r);return this._renderTargetStack.push({renderTarget:i,frame:r}),i}pop(){this._renderTargetStack.pop();const t=this._renderTargetStack[this._renderTargetStack.length-1];this.bind(t.renderTarget,!1,null,t.frame)}getRenderTarget(t){return t.isTexture&&(t=t.source),this._renderSurfaceToRenderTargetHash.get(t)??this._initRenderTarget(t)}copyToTexture(t,e,s,r,i){s.x<0&&(r.width+=s.x,i.x-=s.x,s.x=0),s.y<0&&(r.height+=s.y,i.y-=s.y,s.y=0);const{pixelWidth:n,pixelHeight:a}=t;return r.width=Math.min(r.width,n-s.x),r.height=Math.min(r.height,a-s.y),this.adaptor.copyToTexture(t,e,s,r,i)}ensureDepthStencil(){this.renderTarget.stencil||(this.renderTarget.stencil=!0,this.adaptor.startRenderPass(this.renderTarget,!1,null,this.viewport))}destroy(){this._renderer=null,this._renderSurfaceToRenderTargetHash.forEach((t,e)=>{t!==e&&t.destroy()}),this._renderSurfaceToRenderTargetHash.clear(),this._gpuRenderTargetHash=Object.create(null)}_initRenderTarget(t){let e=null;return o.q.test(t)&&(t=(0,c.c)(t).source),t instanceof u.O?e=t:t instanceof l.v&&(e=new u.O({colorTextures:[t]}),t.source instanceof o.q&&(e.isRoot=!0),t.once("destroy",()=>{e.destroy(),this._renderSurfaceToRenderTargetHash.delete(t);const s=this._gpuRenderTargetHash[e.uid];s&&(this._gpuRenderTargetHash[e.uid]=null,this.adaptor.destroyGpuRenderTarget(s))})),this._renderSurfaceToRenderTargetHash.set(t,e),e}getGpuRenderTarget(t){return this._gpuRenderTargetHash[t.uid]||(this._gpuRenderTargetHash[t.uid]=this.adaptor.initGpuRenderTarget(t))}resetState(){this.renderTarget=null,this.renderSurface=null}}},8955:(t,e,s)=>{"use strict";s.d(e,{c:()=>o});var r=s(1753),i=s(1386),n=s(9739);const a=new Map;function o(t,e){if(!a.has(t)){const s=new n.g({source:new i.q({resource:t,...e})}),r=()=>{a.get(t)===s&&a.delete(t)};s.once("destroy",r),s.source.once("destroy",r),a.set(t,s)}return a.get(t)}r.L.register(a)},8956:(t,e,s)=>{"use strict";s.d(e,{s:()=>i});var r=s(3590);function i(t,e){const{texture:s,bounds:i}=t,n=e._style._getFinalPadding();(0,r.y)(i,e._anchor,s);const a=e._anchor._x*n*2,o=e._anchor._y*n*2;i.minX-=n-a,i.minY-=n-o,i.maxX-=n-a,i.maxY-=n-o}},8979:(t,e,s)=>{"use strict";s.d(e,{O:()=>o});var r=s(8725),i=s(1055);let n,a=0;const o=new class{constructor(){this._initialized=!1,this._createdWorkers=0,this._workerPool=[],this._queue=[],this._resolveHash={}}isImageBitmapSupported(){return void 0!==this._isImageBitmapSupported||(this._isImageBitmapSupported=new Promise(t=>{const{worker:e}=new r.A;e.addEventListener("message",s=>{e.terminate(),r.A.revokeObjectURL(),t(s.data)})})),this._isImageBitmapSupported}loadImageBitmap(t,e){return this._run("loadImageBitmap",[t,e?.data?.alphaMode])}async _initWorkers(){this._initialized||(this._initialized=!0)}_getWorker(){void 0===n&&(n=navigator.hardwareConcurrency||4);let t=this._workerPool.pop();return!t&&this._createdWorkers<n&&(this._createdWorkers++,t=(new i.A).worker,t.addEventListener("message",t=>{this._complete(t.data),this._returnWorker(t.target),this._next()})),t}_returnWorker(t){this._workerPool.push(t)}_complete(t){void 0!==t.error?this._resolveHash[t.uuid].reject(t.error):this._resolveHash[t.uuid].resolve(t.data),this._resolveHash[t.uuid]=null}async _run(t,e){await this._initWorkers();const s=new Promise((s,r)=>{this._queue.push({id:t,arguments:e,resolve:s,reject:r})});return this._next(),s}_next(){if(!this._queue.length)return;const t=this._getWorker();if(!t)return;const e=this._queue.pop(),s=e.id;this._resolveHash[a]={resolve:e.resolve,reject:e.reject},t.postMessage({data:e.arguments,uuid:a++,id:s})}reset(){this._workerPool.forEach(t=>t.terminate()),this._workerPool.length=0,Object.values(this._resolveHash).forEach(({reject:t})=>{t?.(new Error("WorkerManager destroyed"))}),this._resolveHash={},this._queue.length=0,this._initialized=!1,this._createdWorkers=0}}},9031:(t,e,s)=>{"use strict";var r=s(166),i=s(2585),n=s(8034);const a={0:"normal",1:"add",2:"multiply",3:"screen"};class o{static extension={type:[r.AgS.WebGLPipes,r.AgS.WebGPUPipes,r.AgS.CanvasPipes],name:"spine"};renderer;gpuSpineData={};_destroyRenderableBound=this.destroyRenderable.bind(this);constructor(t){this.renderer=t}validateRenderable(t){if(t._validateAndTransformAttachments(),t.spineAttachmentsDirty)return!0;if(t.spineTexturesDirty){const e=t.skeleton.drawOrder,s=this.gpuSpineData[t.uid];for(let r=0,i=e.length;r<i;r++){const i=e[r],a=i.getAttachment();if(a instanceof n.Qb||a instanceof n.fj){const e=t._getCachedData(i,a),r=s.slotBatches[e.id],n=e.texture;if(n!==r.texture&&!r._batcher.checkAndUpdateTexture(r,n))return!0}}}return!1}addRenderable(t,e){const s=this._getSpineData(t),r=this.renderer.renderPipes.batch,o=t.skeleton.drawOrder,l=this.renderer._roundPixels|t._roundPixels;t._validateAndTransformAttachments(),t.spineAttachmentsDirty=!1,t.spineTexturesDirty=!1;for(let h=0,c=o.length;h<c;h++){const c=o[h],u=c.getAttachment(),d=a[c.data.blendMode];if(u instanceof n.Qb||u instanceof n.fj){const n=t._getCachedData(c,u),a=s.slotBatches[n.id]||=new i.a;a.setData(t,n,d,l),n.skipRender||r.addToBatch(a,e)}const p=t._slotsObject[c.data.name];if(p){const t=p.container;t.includeInBuild=!0,t.collectRenderables(e,this.renderer,null),t.includeInBuild=!1}}}updateRenderable(t){const e=this.gpuSpineData[t.uid];t._validateAndTransformAttachments(),t.spineAttachmentsDirty=!1,t.spineTexturesDirty=!1;const s=t.skeleton.drawOrder;for(let r=0,i=s.length;r<i;r++){const i=s[r],a=i.getAttachment();if((a instanceof n.Qb||a instanceof n.fj)&&!t._getCachedData(i,a).skipRender){const s=e.slotBatches[t._getCachedData(i,a).id];s._batcher?.updateElement(s)}}}destroyRenderable(t){this.gpuSpineData[t.uid]=null,t.off("destroyed",this._destroyRenderableBound)}destroy(){this.gpuSpineData=null,this.renderer=null}_getSpineData(t){return this.gpuSpineData[t.uid]||this._initMeshData(t)}_initMeshData(t){return this.gpuSpineData[t.uid]={slotBatches:{}},t.on("destroyed",this._destroyRenderableBound),this.gpuSpineData[t.uid]}}r.XOh.add(o)},9062:(t,e,s)=>{"use strict";function r(t,e){const s=t.byteLength/8|0,r=new Float64Array(t,0,s);new Float64Array(e,0,s).set(r);const i=t.byteLength-8*s;if(i>0){const r=new Uint8Array(t,8*s,i);new Uint8Array(e,8*s,i).set(r)}}s.d(e,{W:()=>r})},9064:(t,e,s)=>{"use strict";s.d(e,{Y:()=>n});var r=s(1347),i=s(4382);class n extends i.e{x=0;y=0;rotation=0;color=new r.Q1(.38,.94,0,1);constructor(t){super(t)}computeWorldPosition(t,e){return e.x=this.x*t.a+this.y*t.b+t.worldX,e.y=this.x*t.c+this.y*t.d+t.worldY,e}computeWorldRotation(t){const e=this.rotation*r.cj.degRad,s=Math.cos(e),i=Math.sin(e),n=s*t.a+i*t.b,a=s*t.c+i*t.d;return r.cj.atan2Deg(a,n)}copy(){let t=new n(this.name);return t.x=this.x,t.y=this.y,t.rotation=this.rotation,t.color.setFromColor(this.color),t}}},9067:(t,e,s)=>{"use strict";s.d(e,{p:()=>r});let r=!1},9087:function(t){var e;t.exports=((e=function(){function t(t){return i.appendChild(t.dom),t}function s(t){for(var e=0;e<i.children.length;e++)i.children[e].style.display=e===t?"block":"none";r=t}var r=0,i=document.createElement("div");i.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",i.addEventListener("click",function(t){t.preventDefault(),s(++r%i.children.length)},!1);var n=(performance||Date).now(),a=n,o=0,l=t(new e.Panel("FPS","#0ff","#002")),h=t(new e.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=t(new e.Panel("MB","#f08","#201"));return s(0),{REVISION:16,dom:i,addPanel:t,showPanel:s,begin:function(){n=(performance||Date).now()},end:function(){o++;var t=(performance||Date).now();if(h.update(t-n,200),t>a+1e3&&(l.update(1e3*o/(t-a),100),a=t,o=0,c)){var e=performance.memory;c.update(e.usedJSHeapSize/1048576,e.jsHeapSizeLimit/1048576)}return t},update:function(){n=this.end()},domElement:i,setMode:s}}).Panel=function(t,e,s){var r=1/0,i=0,n=Math.round,a=n(window.devicePixelRatio||1),o=80*a,l=48*a,h=3*a,c=2*a,u=3*a,d=15*a,p=74*a,f=30*a,m=document.createElement("canvas");m.width=o,m.height=l,m.style.cssText="width:80px;height:48px";var g=m.getContext("2d");return g.font="bold "+9*a+"px Helvetica,Arial,sans-serif",g.textBaseline="top",g.fillStyle=s,g.fillRect(0,0,o,l),g.fillStyle=e,g.fillText(t,h,c),g.fillRect(u,d,p,f),g.fillStyle=s,g.globalAlpha=.9,g.fillRect(u,d,p,f),{dom:m,update:function(l,x){r=Math.min(r,l),i=Math.max(i,l),g.fillStyle=s,g.globalAlpha=1,g.fillRect(0,0,o,d),g.fillStyle=e,g.fillText(n(l)+" "+t+" ("+n(r)+"-"+n(i)+")",h,c),g.drawImage(m,u+a,d,p-a,f,u,d,p-a,f),g.fillRect(u+p-a,d,a,f),g.fillStyle=s,g.globalAlpha=.9,g.fillRect(u+p-a,d,a,n((1-l/x)*f))}}},e)},9097:(t,e,s)=>{"use strict";s.d(e,{F:()=>l});var r=s(5423),i=s(1065),n=s(3761),a=s(4173),o=s(3463);const l={extension:{type:i.Ag.LoadParser,priority:o.T.Low},name:"loadJson",id:"json",test:t=>(0,n.s)(t,"application/json")||(0,a.W)(t,".json"),async load(t){const e=await r.e.get().fetch(t);return await e.json()}}},9107:(t,e,s)=>{"use strict";s.d(e,{A:()=>r,E:()=>m});var r,i=s(6552),n=s(7399),a=s(6861),o=s(7786),l=s(2866),h=s(528),c=s(6184),u=s(6108),d=s(6068),p=s(7957),f=s(1347);class m{static quadTriangles=[0,1,2,2,3,0];static yDown=!1;data;bones;slots;drawOrder;ikConstraints;transformConstraints;pathConstraints;physicsConstraints;_updateCache=new Array;skin=null;color;scaleX=1;_scaleY=1;get scaleY(){return m.yDown?-this._scaleY:this._scaleY}set scaleY(t){this._scaleY=t}x=0;y=0;time=0;constructor(t){if(!t)throw new Error("data cannot be null.");this.data=t,this.bones=new Array;for(let e=0;e<t.bones.length;e++){let s,r=t.bones[e];if(r.parent){let t=this.bones[r.parent.index];s=new l.$(r,this,t),t.children.push(s)}else s=new l.$(r,this,null);this.bones.push(s)}this.slots=new Array,this.drawOrder=new Array;for(let e=0;e<t.slots.length;e++){let s=t.slots[e],r=this.bones[s.boneData.index],i=new d.D(s,r);this.slots.push(i),this.drawOrder.push(i)}this.ikConstraints=new Array;for(let e=0;e<t.ikConstraints.length;e++){let s=t.ikConstraints[e];this.ikConstraints.push(new h.c(s,this))}this.transformConstraints=new Array;for(let e=0;e<t.transformConstraints.length;e++){let s=t.transformConstraints[e];this.transformConstraints.push(new p.U(s,this))}this.pathConstraints=new Array;for(let e=0;e<t.pathConstraints.length;e++){let s=t.pathConstraints[e];this.pathConstraints.push(new c.v(s,this))}this.physicsConstraints=new Array;for(let e=0;e<t.physicsConstraints.length;e++){let s=t.physicsConstraints[e];this.physicsConstraints.push(new u.N(s,this))}this.color=new f.Q1(1,1,1,1),this.updateCache()}updateCache(){this._updateCache.length=0;let t=this.bones;for(let e=0,s=t.length;e<s;e++){let s=t[e];s.sorted=s.data.skinRequired,s.active=!s.sorted}if(this.skin){let t=this.skin.bones;for(let e=0,s=this.skin.bones.length;e<s;e++){let s=this.bones[t[e].index];do{s.sorted=!1,s.active=!0,s=s.parent}while(s)}}let e=this.ikConstraints,s=this.transformConstraints,r=this.pathConstraints,i=this.physicsConstraints,n=e.length,a=s.length,o=r.length,l=this.physicsConstraints.length,h=n+a+o+l;t:for(let t=0;t<h;t++){for(let s=0;s<n;s++){let r=e[s];if(r.data.order==t){this.sortIkConstraint(r);continue t}}for(let e=0;e<a;e++){let r=s[e];if(r.data.order==t){this.sortTransformConstraint(r);continue t}}for(let e=0;e<o;e++){let s=r[e];if(s.data.order==t){this.sortPathConstraint(s);continue t}}for(let e=0;e<l;e++){const s=i[e];if(s.data.order==t){this.sortPhysicsConstraint(s);continue t}}}for(let e=0,s=t.length;e<s;e++)this.sortBone(t[e])}sortIkConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&f.Aq.contains(this.skin.constraints,t.data,!0)),!t.active)return;let e=t.target;this.sortBone(e);let s=t.bones,r=s[0];if(this.sortBone(r),1==s.length)this._updateCache.push(t),this.sortReset(r.children);else{let e=s[s.length-1];this.sortBone(e),this._updateCache.push(t),this.sortReset(r.children),e.sorted=!0}}sortPathConstraint(t){if(t.active=t.target.bone.isActive()&&(!t.data.skinRequired||this.skin&&f.Aq.contains(this.skin.constraints,t.data,!0)),!t.active)return;let e=t.target,s=e.data.index,r=e.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,s,r),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,s,r);for(let t=0,e=this.data.skins.length;t<e;t++)this.sortPathConstraintAttachment(this.data.skins[t],s,r);let i=e.getAttachment();i instanceof a.H&&this.sortPathConstraintAttachmentWith(i,r);let n=t.bones,o=n.length;for(let t=0;t<o;t++)this.sortBone(n[t]);this._updateCache.push(t);for(let t=0;t<o;t++)this.sortReset(n[t].children);for(let t=0;t<o;t++)n[t].sorted=!0}sortTransformConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&f.Aq.contains(this.skin.constraints,t.data,!0)),!t.active)return;this.sortBone(t.target);let e=t.bones,s=e.length;if(t.data.local)for(let t=0;t<s;t++){let s=e[t];this.sortBone(s.parent),this.sortBone(s)}else for(let t=0;t<s;t++)this.sortBone(e[t]);this._updateCache.push(t);for(let t=0;t<s;t++)this.sortReset(e[t].children);for(let t=0;t<s;t++)e[t].sorted=!0}sortPathConstraintAttachment(t,e,s){let r=t.attachments[e];if(r)for(let t in r)this.sortPathConstraintAttachmentWith(r[t],s)}sortPathConstraintAttachmentWith(t,e){if(!(t instanceof a.H))return;let s=t.bones;if(s){let t=this.bones;for(let e=0,r=s.length;e<r;){let r=s[e++];for(r+=e;e<r;)this.sortBone(t[s[e++]])}}else this.sortBone(e)}sortPhysicsConstraint(t){const e=t.bone;t.active=e.active&&(!t.data.skinRequired||null!=this.skin&&f.Aq.contains(this.skin.constraints,t.data,!0)),t.active&&(this.sortBone(e),this._updateCache.push(t),this.sortReset(e.children),e.sorted=!0)}sortBone(t){if(!t)return;if(t.sorted)return;let e=t.parent;e&&this.sortBone(e),t.sorted=!0,this._updateCache.push(t)}sortReset(t){for(let e=0,s=t.length;e<s;e++){let s=t[e];s.active&&(s.sorted&&this.sortReset(s.children),s.sorted=!1)}}updateWorldTransform(t){if(null==t)throw new Error("physics is undefined");let e=this.bones;for(let t=0,s=e.length;t<s;t++){let s=e[t];s.ax=s.x,s.ay=s.y,s.arotation=s.rotation,s.ascaleX=s.scaleX,s.ascaleY=s.scaleY,s.ashearX=s.shearX,s.ashearY=s.shearY}let s=this._updateCache;for(let e=0,r=s.length;e<r;e++)s[e].update(t)}updateWorldTransformWith(t,e){if(!e)throw new Error("parent cannot be null.");let s=this.bones;for(let t=1,e=s.length;t<e;t++){let e=s[t];e.ax=e.x,e.ay=e.y,e.arotation=e.rotation,e.ascaleX=e.scaleX,e.ascaleY=e.scaleY,e.ashearX=e.shearX,e.ashearY=e.shearY}let r=this.getRootBone();if(!r)throw new Error("Root bone must not be null.");let i=e.a,n=e.b,a=e.c,o=e.d;r.worldX=i*this.x+n*this.y+e.worldX,r.worldY=a*this.x+o*this.y+e.worldY;const l=(r.rotation+r.shearX)*f.cj.degRad,h=(r.rotation+90+r.shearY)*f.cj.degRad,c=Math.cos(l)*r.scaleX,u=Math.cos(h)*r.scaleY,d=Math.sin(l)*r.scaleX,p=Math.sin(h)*r.scaleY;r.a=(i*c+n*d)*this.scaleX,r.b=(i*u+n*p)*this.scaleX,r.c=(a*c+o*d)*this.scaleY,r.d=(a*u+o*p)*this.scaleY;let m=this._updateCache;for(let e=0,s=m.length;e<s;e++){let s=m[e];s!=r&&s.update(t)}}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){for(const t of this.bones)t.setToSetupPose();for(const t of this.ikConstraints)t.setToSetupPose();for(const t of this.transformConstraints)t.setToSetupPose();for(const t of this.pathConstraints)t.setToSetupPose();for(const t of this.physicsConstraints)t.setToSetupPose()}setSlotsToSetupPose(){let t=this.slots;f.Aq.arrayCopy(t,0,this.drawOrder,0,t.length);for(let e=0,s=t.length;e<s;e++)t[e].setToSetupPose()}getRootBone(){return 0==this.bones.length?null:this.bones[0]}findBone(t){if(!t)throw new Error("boneName cannot be null.");let e=this.bones;for(let s=0,r=e.length;s<r;s++){let r=e[s];if(r.data.name==t)return r}return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let e=this.slots;for(let s=0,r=e.length;s<r;s++){let r=e[s];if(r.data.name==t)return r}return null}setSkinByName(t){let e=this.data.findSkin(t);if(!e)throw new Error("Skin not found: "+t);this.setSkin(e)}setSkin(t){if(t!=this.skin){if(t)if(this.skin)t.attachAll(this,this.skin);else{let e=this.slots;for(let s=0,r=e.length;s<r;s++){let r=e[s],i=r.data.attachmentName;if(i){let e=t.getAttachment(s,i);e&&r.setAttachment(e)}}}this.skin=t,this.updateCache()}}getAttachmentByName(t,e){let s=this.data.findSlot(t);if(!s)throw new Error(`Can't find slot with name ${t}`);return this.getAttachment(s.index,e)}getAttachment(t,e){if(!e)throw new Error("attachmentName cannot be null.");if(this.skin){let s=this.skin.getAttachment(t,e);if(s)return s}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null}setAttachment(t,e){if(!t)throw new Error("slotName cannot be null.");let s=this.slots;for(let r=0,i=s.length;r<i;r++){let i=s[r];if(i.data.name==t){let s=null;if(e&&(s=this.getAttachment(r,e),!s))throw new Error("Attachment not found: "+e+", for slot: "+t);return void i.setAttachment(s)}}throw new Error("Slot not found: "+t)}findIkConstraint(t){if(!t)throw new Error("constraintName cannot be null.");return this.ikConstraints.find(e=>e.data.name==t)??null}findTransformConstraint(t){if(!t)throw new Error("constraintName cannot be null.");return this.transformConstraints.find(e=>e.data.name==t)??null}findPathConstraint(t){if(!t)throw new Error("constraintName cannot be null.");return this.pathConstraints.find(e=>e.data.name==t)??null}findPhysicsConstraint(t){if(null==t)throw new Error("constraintName cannot be null.");return this.physicsConstraints.find(e=>e.data.name==t)??null}getBoundsRect(t){let e=new f.I9,s=new f.I9;return this.getBounds(e,s,void 0,t),{x:e.x,y:e.y,width:s.x,height:s.y}}getBounds(t,e,s=new Array(2),r=null){if(!t)throw new Error("offset cannot be null.");if(!e)throw new Error("size cannot be null.");let a=this.drawOrder,l=Number.POSITIVE_INFINITY,h=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let t=0,e=a.length;t<e;t++){let e=a[t];if(!e.bone.active)continue;let d=0,p=null,g=null,x=e.getAttachment();if(x instanceof o.Q)d=8,p=f.Aq.setArraySize(s,d,0),x.computeWorldVertices(e,p,0,2),g=m.quadTriangles;else if(x instanceof n.f){let t=x;d=t.worldVerticesLength,p=f.Aq.setArraySize(s,d,0),t.computeWorldVertices(e,0,d,p,0,2),g=t.triangles}else if(x instanceof i.K&&null!=r){r.clipStart(e,x);continue}if(p&&g){null!=r&&r.isClipping()&&(r.clipTriangles(p,g,g.length),p=r.clippedVertices,d=r.clippedVertices.length);for(let t=0,e=p.length;t<e;t+=2){let e=p[t],s=p[t+1];l=Math.min(l,e),h=Math.min(h,s),c=Math.max(c,e),u=Math.max(u,s)}}null!=r&&r.clipEndWithSlot(e)}null!=r&&r.clipEnd(),t.set(l,h),e.set(c-l,u-h)}update(t){this.time+=t}physicsTranslate(t,e){const s=this.physicsConstraints;for(let r=0,i=s.length;r<i;r++)s[r].translate(t,e)}physicsRotate(t,e,s){const r=this.physicsConstraints;for(let i=0,n=r.length;i<n;i++)r[i].rotate(t,e,s)}}!function(t){t[t.none=0]="none",t[t.reset=1]="reset",t[t.update=2]="update",t[t.pose=3]="pose"}(r||(r={}))},9133:(t,e,s)=>{"use strict";s.d(e,{q:()=>n});var r=s(2414),i=s(1347);class n{triangulator=new r.R;clippingPolygon=new Array;clipOutput=new Array;clippedVertices=new Array;clippedUVs=new Array;clippedTriangles=new Array;scratch=new Array;clipAttachment=null;clippingPolygons=null;clipStart(t,e){if(this.clipAttachment)return 0;this.clipAttachment=e;let s=e.worldVerticesLength,r=i.Aq.setArraySize(this.clippingPolygon,s);e.computeWorldVertices(t,0,s,r,0,2);let a=this.clippingPolygon;n.makeClockwise(a);let o=this.clippingPolygons=this.triangulator.decompose(a,this.triangulator.triangulate(a));for(let t=0,e=o.length;t<e;t++){let e=o[t];n.makeClockwise(e),e.push(e[0]),e.push(e[1])}return o.length}clipEndWithSlot(t){this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()}clipEnd(){this.clipAttachment&&(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)}isClipping(){return null!=this.clipAttachment}clipTriangles(t,e,s,r,i,n,a,o){let l,h,c,u,d,p;"number"==typeof e?(l=s,h=r,c=i,u=n,d=a,p=o):(l=e,h=s,c=r,u=i,d=n,p=a),c&&u&&d&&"boolean"==typeof p?this.clipTrianglesRender(t,l,h,c,u,d,p):this.clipTrianglesNoRender(t,l,h)}clipTrianglesNoRender(t,e,s){let r=this.clipOutput,n=this.clippedVertices,a=this.clippedTriangles,o=this.clippingPolygons,l=o.length,h=0;n.length=0,a.length=0;for(let c=0;c<s;c+=3){let s=e[c]<<1,u=t[s],d=t[s+1];s=e[c+1]<<1;let p=t[s],f=t[s+1];s=e[c+2]<<1;let m=t[s],g=t[s+1];for(let t=0;t<l;t++){let e=n.length;if(!this.clip(u,d,p,f,m,g,o[t],r)){let t=i.Aq.setArraySize(n,e+6);t[e]=u,t[e+1]=d,t[e+2]=p,t[e+3]=f,t[e+4]=m,t[e+5]=g,e=a.length;let s=i.Aq.setArraySize(a,e+3);s[e]=h,s[e+1]=h+1,s[e+2]=h+2,h+=3;break}{let t=r.length;if(0==t)continue;let s=t>>1,o=this.clipOutput,l=i.Aq.setArraySize(n,e+2*s);for(let s=0;s<t;s+=2,e+=2){let t=o[s],r=o[s+1];l[e]=t,l[e+1]=r}e=a.length;let c=i.Aq.setArraySize(a,e+3*(s-2));s--;for(let t=1;t<s;t++,e+=3)c[e]=h,c[e+1]=h+t,c[e+2]=h+t+1;h+=s+1}}}}clipTrianglesRender(t,e,s,r,n,a,o){let l=this.clipOutput,h=this.clippedVertices,c=this.clippedTriangles,u=this.clippingPolygons,d=u.length,p=o?12:8,f=0;h.length=0,c.length=0;for(let m=0;m<s;m+=3){let s=e[m]<<1,g=t[s],x=t[s+1],y=r[s],v=r[s+1];s=e[m+1]<<1;let _=t[s],b=t[s+1],w=r[s],T=r[s+1];s=e[m+2]<<1;let S=t[s],A=t[s+1],C=r[s],P=r[s+1];for(let t=0;t<d;t++){let e=h.length;if(!this.clip(g,x,_,b,S,A,u[t],l)){let t=i.Aq.setArraySize(h,e+3*p);t[e]=g,t[e+1]=x,t[e+2]=n.r,t[e+3]=n.g,t[e+4]=n.b,t[e+5]=n.a,o?(t[e+6]=y,t[e+7]=v,t[e+8]=a.r,t[e+9]=a.g,t[e+10]=a.b,t[e+11]=a.a,t[e+12]=_,t[e+13]=b,t[e+14]=n.r,t[e+15]=n.g,t[e+16]=n.b,t[e+17]=n.a,t[e+18]=w,t[e+19]=T,t[e+20]=a.r,t[e+21]=a.g,t[e+22]=a.b,t[e+23]=a.a,t[e+24]=S,t[e+25]=A,t[e+26]=n.r,t[e+27]=n.g,t[e+28]=n.b,t[e+29]=n.a,t[e+30]=C,t[e+31]=P,t[e+32]=a.r,t[e+33]=a.g,t[e+34]=a.b,t[e+35]=a.a):(t[e+6]=y,t[e+7]=v,t[e+8]=_,t[e+9]=b,t[e+10]=n.r,t[e+11]=n.g,t[e+12]=n.b,t[e+13]=n.a,t[e+14]=w,t[e+15]=T,t[e+16]=S,t[e+17]=A,t[e+18]=n.r,t[e+19]=n.g,t[e+20]=n.b,t[e+21]=n.a,t[e+22]=C,t[e+23]=P),e=c.length;let s=i.Aq.setArraySize(c,e+3);s[e]=f,s[e+1]=f+1,s[e+2]=f+2,f+=3;break}{let t=l.length;if(0==t)continue;let s=b-A,r=S-_,u=g-S,d=A-x,m=1/(s*u+r*(x-A)),E=t>>1,M=this.clipOutput,k=i.Aq.setArraySize(h,e+E*p);for(let i=0;i<t;i+=2,e+=p){let t=M[i],l=M[i+1];k[e]=t,k[e+1]=l,k[e+2]=n.r,k[e+3]=n.g,k[e+4]=n.b,k[e+5]=n.a;let h=t-S,c=l-A,p=(s*h+r*c)*m,f=(d*h+u*c)*m,g=1-p-f;k[e+6]=y*p+w*f+C*g,k[e+7]=v*p+T*f+P*g,o&&(k[e+8]=a.r,k[e+9]=a.g,k[e+10]=a.b,k[e+11]=a.a)}e=c.length;let R=i.Aq.setArraySize(c,e+3*(E-2));E--;for(let t=1;t<E;t++,e+=3)R[e]=f,R[e+1]=f+t,R[e+2]=f+t+1;f+=E+1}}}}clipTrianglesUnpacked(t,e,s,r){let n=this.clipOutput,a=this.clippedVertices,o=this.clippedUVs,l=this.clippedTriangles,h=this.clippingPolygons,c=h.length,u=0;a.length=0,o.length=0,l.length=0;for(let d=0;d<s;d+=3){let s=e[d]<<1,p=t[s],f=t[s+1],m=r[s],g=r[s+1];s=e[d+1]<<1;let x=t[s],y=t[s+1],v=r[s],_=r[s+1];s=e[d+2]<<1;let b=t[s],w=t[s+1],T=r[s],S=r[s+1];for(let t=0;t<c;t++){let e=a.length;if(!this.clip(p,f,x,y,b,w,h[t],n)){let t=i.Aq.setArraySize(a,e+6);t[e]=p,t[e+1]=f,t[e+2]=x,t[e+3]=y,t[e+4]=b,t[e+5]=w;let s=i.Aq.setArraySize(o,e+6);s[e]=m,s[e+1]=g,s[e+2]=v,s[e+3]=_,s[e+4]=T,s[e+5]=S,e=l.length;let r=i.Aq.setArraySize(l,e+3);r[e]=u,r[e+1]=u+1,r[e+2]=u+2,u+=3;break}{let t=n.length;if(0==t)continue;let s=y-w,r=b-x,h=p-b,c=w-f,d=1/(s*h+r*(f-w)),A=t>>1,C=this.clipOutput,P=i.Aq.setArraySize(a,e+2*A),E=i.Aq.setArraySize(o,e+2*A);for(let i=0;i<t;i+=2,e+=2){let t=C[i],n=C[i+1];P[e]=t,P[e+1]=n;let a=t-b,o=n-w,l=(s*a+r*o)*d,u=(c*a+h*o)*d,p=1-l-u;E[e]=m*l+v*u+T*p,E[e+1]=g*l+_*u+S*p}e=l.length;let M=i.Aq.setArraySize(l,e+3*(A-2));A--;for(let t=1;t<A;t++,e+=3)M[e]=u,M[e+1]=u+t,M[e+2]=u+t+1;u+=A+1}}}}clip(t,e,s,r,i,n,a,o){let l,h=o,c=!1;a.length%4>=2?(l=o,o=this.scratch):l=this.scratch,l.length=0,l.push(t),l.push(e),l.push(s),l.push(r),l.push(i),l.push(n),l.push(t),l.push(e),o.length=0;let u=a.length-4,d=a;for(let t=0;;t+=2){let e=d[t],s=d[t+1],r=e-d[t+2],i=s-d[t+3],n=o.length,a=l;for(let t=0,n=l.length-2;t<n;){let n=a[t],l=a[t+1];t+=2;let h=a[t],u=a[t+1],d=i*(e-h)>r*(s-u),p=i*(e-n)-r*(s-l);if(p>0){if(d){o.push(h),o.push(u);continue}let t=h-n,e=u-l,s=p/(t*i-e*r);if(!(s>=0&&s<=1)){o.push(h),o.push(u);continue}o.push(n+t*s),o.push(l+e*s)}else if(d){let t=h-n,e=u-l,s=p/(t*i-e*r);if(!(s>=0&&s<=1)){o.push(h),o.push(u);continue}o.push(n+t*s),o.push(l+e*s),o.push(h),o.push(u)}c=!0}if(n==o.length)return h.length=0,!0;if(o.push(o[0]),o.push(o[1]),t==u)break;let p=o;(o=l).length=0,l=p}if(h!=o){h.length=0;for(let t=0,e=o.length-2;t<e;t++)h[t]=o[t]}else h.length=h.length-2;return c}static makeClockwise(t){let e=t,s=t.length,r=e[s-2]*e[1]-e[0]*e[s-1],i=0,n=0,a=0,o=0;for(let t=0,l=s-3;t<l;t+=2)i=e[t],n=e[t+1],a=e[t+2],o=e[t+3],r+=i*o-a*n;if(!(r<0))for(let t=0,r=s-2,i=s>>1;t<i;t+=2){let s=e[t],i=e[t+1],n=r-t;e[t]=e[n],e[t+1]=e[n+1],e[n]=s,e[n+1]=i}}}},9155:(t,e,s)=>{"use strict";s.d(e,{yE:()=>l});var r=s(166),i=s(8034);const n=new i.I9;i.EA.yDown=!0;const a=new i.qy,o=new i.bC(()=>new r.A1g);class l extends r.lZB{batched=!0;buildId=0;renderPipeId="spine";_didSpineUpdate=!1;beforeUpdateWorldTransforms=()=>{};afterUpdateWorldTransforms=()=>{};skeleton;state;skeletonBounds;darkTint=!1;_debug=void 0;_slotsObject=Object.create(null);clippingSlotToPixiMasks=Object.create(null);getSlotFromRef(t){let e;if(e="number"==typeof t?this.skeleton.slots[t]:"string"==typeof t?this.skeleton.findSlot(t):t,!e)throw new Error(`No slot found with the given slot reference: ${t}`);return e}spineAttachmentsDirty=!0;spineTexturesDirty=!0;_lastAttachments=[];_stateChanged=!0;attachmentCacheData=[];get debug(){return this._debug}set debug(t){this._debug&&this._debug.unregisterSpine(this),t&&t.registerSpine(this),this._debug=t}_autoUpdate=!1;get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t&&!this._autoUpdate?r.RvI.shared.add(this.internalUpdate,this):!t&&this._autoUpdate&&r.RvI.shared.remove(this.internalUpdate,this),this._autoUpdate=t}_boundsProvider;get boundsProvider(){return this._boundsProvider}set boundsProvider(t){this._boundsProvider=t,t&&(this._boundsDirty=!1),this.updateBounds()}hasNeverUpdated=!0;constructor(t){t instanceof i.Ym&&(t={skeletonData:t}),super({}),this.allowChildren=!0;const e=t instanceof i.Ym?t:t.skeletonData;this.skeleton=new i.EA(e),this.state=new i.oA(new i.Qq(e)),this.autoUpdate=t?.autoUpdate??!0,this.darkTint=void 0===t?.darkTint?this.skeleton.slots.some(t=>!!t.data.darkColor):t?.darkTint;const s=this.skeleton.slots;for(let t=0;t<s.length;t++)this.attachmentCacheData[t]=Object.create(null);this._boundsProvider=t.boundsProvider}update(t){this.internalUpdate(0,t)}internalUpdate(t,e){this._updateAndApplyState(e??r.RvI.shared.deltaMS/1e3)}get bounds(){return this._boundsDirty&&this.updateBounds(),this._bounds}setBonePosition(t,e){const s=t;if("string"==typeof t&&(t=this.skeleton.findBone(t)),!t)throw Error(`Cant set bone position, bone ${String(s)} not found`);if(n.set(e.x,e.y),t.parent){const e=t.parent.worldToLocal(n);t.x=e.x,t.y=-e.y}else t.x=n.x,t.y=n.y}getBonePosition(t,e){const s=t;return"string"==typeof t&&(t=this.skeleton.findBone(t)),t?(e||(e={x:0,y:0}),e.x=t.worldX,e.y=t.worldY,e):(console.error(`Cant set bone position! Bone ${String(s)} not found`),e)}_updateAndApplyState(t){this.hasNeverUpdated=!1,this.state.update(t),this.skeleton.update(t);const{skeleton:e}=this;this.state.apply(e),this.beforeUpdateWorldTransforms(this),e.updateWorldTransform(i.AQ.update),this.afterUpdateWorldTransforms(this),this.updateSlotObjects(),this._stateChanged=!0,this.onViewUpdate()}_validateAndTransformAttachments(){this._stateChanged&&(this._stateChanged=!1,this.validateAttachments(),this.transformAttachments())}validateAttachments(){const t=this.skeleton.drawOrder,e=this._lastAttachments;let s=0,r=!1;for(let i=0;i<t.length;i++){const n=t[i].getAttachment();n&&(n!==e[s]&&(r=!0,e[s]=n),s++)}s!==e.length&&(r=!0,e.length=s),this.spineAttachmentsDirty||=r}currentClippingSlot;updateAndSetPixiMask(t,e){const s=t.attachment;if(s&&s instanceof i.K$){const e=this.clippingSlotToPixiMasks[t.data.name]||={slot:t,vertices:new Array};return e.maskComputed=!1,void(this.currentClippingSlot=e)}let r=this.currentClippingSlot,n=this._slotsObject[t.data.name];if(r&&n){let t=r.mask;if(t||(t=o.obtain(),r.mask=t,this.addChild(t)),!r.maskComputed){let e=r.slot,s=e.attachment;r.maskComputed=!0;const i=s.worldVerticesLength,n=r.vertices;s.computeWorldVertices(e,0,i,n,0,2),t.clear().poly(n).stroke({width:0}).fill({alpha:.25})}n.container.mask=t}else n?.container.mask&&(n.container.mask=null);if(r&&r.slot.attachment.endSlot==t.data&&(this.currentClippingSlot=void 0),e){for(const t in this.clippingSlotToPixiMasks){const e=this.clippingSlotToPixiMasks[t];e.slot.attachment instanceof i.K$&&e.maskComputed||!e.mask||(this.removeChild(e.mask),o.free(e.mask),e.mask=void 0)}this.currentClippingSlot=void 0}}transformAttachments(){const t=this.skeleton.drawOrder;for(let e=0;e<t.length;e++){const s=t[e];this.updateAndSetPixiMask(s,e===t.length-1);const n=s.getAttachment();if(n)if(n instanceof i.fj||n instanceof i.Qb){const t=this._getCachedData(s,n);n instanceof i.Qb?n.computeWorldVertices(s,t.vertices,0,2):n.computeWorldVertices(s,0,n.worldVerticesLength,t.vertices,0,2),t.uvs.length<n.uvs.length&&(t.uvs=new Float32Array(n.uvs.length)),(0,r.Whu)(n.uvs.buffer,t.uvs.buffer);const e=s.bone.skeleton.color,o=s.color,l=n.color,h=e.a*o.a*l.a;if(t.color.set(e.r*o.r*l.r,e.g*o.g*l.g,e.b*o.b*l.b,h),0===this.alpha||0===h)t.skipRender=!0;else{s.darkColor&&t.darkColor.setFromColor(s.darkColor),t.skipRender=t.clipped=!1;const e=n.region?.texture.texture||r.gPd.EMPTY;t.texture!==e&&(t.texture=e,this.spineTexturesDirty=!0),a.isClipping()&&this.updateClippingData(t)}}else if(n instanceof i.K$){a.clipStart(s,n);continue}a.clipEndWithSlot(s)}a.clipEnd()}updateClippingData(t){t.clipped=!0,a.clipTrianglesUnpacked(t.vertices,t.indices,t.indices.length,t.uvs);const{clippedVertices:e,clippedUVs:s,clippedTriangles:r}=a,i=e.length/2,n=r.length;t.clippedData||(t.clippedData={vertices:new Float32Array(2*i),uvs:new Float32Array(2*i),vertexCount:i,indices:new Uint16Array(n),indicesCount:n},this.spineAttachmentsDirty=!0);const o=t.clippedData,l=o.vertexCount!==i||n!==o.indicesCount;t.skipRender=0===i,l&&(this.spineAttachmentsDirty=!0,o.vertexCount<i&&(o.vertices=new Float32Array(2*i),o.uvs=new Float32Array(2*i)),o.indices.length<n&&(o.indices=new Uint16Array(n)));const{vertices:h,uvs:c,indices:u}=o;for(let t=0;t<i;t++)h[2*t]=e[2*t],h[2*t+1]=e[2*t+1],c[2*t]=s[2*t],c[2*t+1]=s[2*t+1];o.vertexCount=i;for(let t=0;t<n;t++)u[t]!==r[t]&&(this.spineAttachmentsDirty=!0,u[t]=r[t]);o.indicesCount=n}updateSlotObjects(){for(const t in this._slotsObject){const e=this._slotsObject[t];e&&this.updateSlotObject(e)}}updateSlotObject(t){const{slot:e,container:s}=t,r=!t.followAttachmentTimeline||Boolean(e.attachment);if(s.visible=this.skeleton.drawOrder.includes(e)&&r,s.visible){let t=e.bone;s.position.set(t.worldX,t.worldY),s.angle=t.getWorldRotationX();let r=1,i=1;for(;t;)r*=t.scaleX,i*=t.scaleY,t=t.parent;r<0&&(s.angle-=180),s.scale.set(e.bone.getWorldScaleX()*Math.sign(r),e.bone.getWorldScaleY()*Math.sign(i)),s.alpha=this.skeleton.color.a*e.color.a}}_getCachedData(t,e){return this.attachmentCacheData[t.data.index][e.name]||this.initCachedData(t,e)}initCachedData(t,e){let s;return e instanceof i.Qb?(s=new Float32Array(8),this.attachmentCacheData[t.data.index][e.name]={id:`${t.data.index}-${e.name}`,vertices:s,clipped:!1,indices:[0,1,2,0,2,3],uvs:new Float32Array(e.uvs.length),color:new i.Q1(1,1,1,1),darkColor:new i.Q1(0,0,0,0),darkTint:this.darkTint,skipRender:!1,texture:e.region?.texture.texture}):(s=new Float32Array(e.worldVerticesLength),this.attachmentCacheData[t.data.index][e.name]={id:`${t.data.index}-${e.name}`,vertices:s,clipped:!1,indices:e.triangles,uvs:new Float32Array(e.uvs.length),color:new i.Q1(1,1,1,1),darkColor:new i.Q1(0,0,0,0),darkTint:this.darkTint,skipRender:!1,texture:e.region?.texture.texture}),this.attachmentCacheData[t.data.index][e.name]}onViewUpdate(){if(this._didViewChangeTick++,this._boundsProvider||(this._boundsDirty=!0),this.didViewUpdate)return;this.didViewUpdate=!0;const t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this),this.debug?.renderDebug(this)}addSlotObject(t,e,s){t=this.getSlotFromRef(t);for(const t in this._slotsObject)this._slotsObject[t]?.container===e&&this.removeSlotObject(this._slotsObject[t].slot);this.removeSlotObject(t),e.includeInBuild=!1,this.addChild(e);const r={container:e,slot:t,followAttachmentTimeline:s?.followAttachmentTimeline||!1};this._slotsObject[t.data.name]=r,this.updateSlotObject(r)}removeSlotObject(t){let e;if(t instanceof r.mcf){for(const s in this._slotsObject)if(this._slotsObject[s]?.container===t){this._slotsObject[s]=null,e=t;break}}else{const s=this.getSlotFromRef(t);e=this._slotsObject[s.data.name]?.container,this._slotsObject[s.data.name]=null}e&&(this.removeChild(e),e.includeInBuild=!0)}removeSlotObjects(){Object.entries(this._slotsObject).forEach(([t,e])=>{e&&e.container.removeFromParent(),delete this._slotsObject[t]})}getSlotObject(t){return t=this.getSlotFromRef(t),this._slotsObject[t.data.name]?.container}updateBounds(){this._boundsDirty=!1,this.skeletonBounds||=new i.VT;const t=this.skeletonBounds;if(t.update(this.skeleton,!0),this._boundsProvider){const t=this._boundsProvider.calculateBounds(this),e=this._bounds;e.clear(),e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height}else if(t.minX===1/0){this.hasNeverUpdated&&(this._updateAndApplyState(0),this._boundsDirty=!1),this._validateAndTransformAttachments();const t=this.skeleton.drawOrder,e=this._bounds;e.clear();for(let s=0;s<t.length;s++){const r=t[s],n=r.getAttachment();if(n&&(n instanceof i.Qb||n instanceof i.fj)){const t=this._getCachedData(r,n);e.addVertexData(t.vertices,0,t.vertices.length)}}}else this._bounds.minX=t.minX,this._bounds.minY=t.minY,this._bounds.maxX=t.maxX,this._bounds.maxY=t.maxY}addBounds(t){t.addBounds(this.bounds)}destroy(t=!1){super.destroy(t),r.RvI.shared.remove(this.internalUpdate,this),this.state.clearListeners(),this.debug=void 0,this.skeleton=null,this.state=null,this._slotsObject=null,this._lastAttachments.length=0,this.attachmentCacheData=null}skeletonToPixiWorldCoordinates(t){this.worldTransform.apply(t,t)}pixiWorldCoordinatesToSkeleton(t){this.worldTransform.applyInverse(t,t)}pixiWorldCoordinatesToBone(t,e){this.pixiWorldCoordinatesToSkeleton(t),e.parent?e.parent.worldToLocal(t):e.worldToLocal(t)}static from({skeleton:t,atlas:e,scale:s=1,darkTint:n,autoUpdate:a=!0,boundsProvider:o}){const h=`${t}-${e}-${s}`;if(r.l2R.has(h))return new l({skeletonData:r.l2R.get(h),darkTint:n,autoUpdate:a,boundsProvider:o});const c=r.sP.get(t),u=r.sP.get(e),d=new i.qd(u),p=c instanceof Uint8Array?new i.t7(d):new i.mI(d);p.scale=s;const f=p.readSkeletonData(c);return r.l2R.set(h,f),new l({skeletonData:f,darkTint:n,autoUpdate:a,boundsProvider:o})}}},9212:(t,e,s)=>{"use strict";s.d(e,{N:()=>r,P:()=>n});var r,i=s(1347);class n{index=0;name;boneData;color=new i.Q1(1,1,1,1);darkColor=null;attachmentName=null;blendMode=r.Normal;visible=!0;constructor(t,e,s){if(t<0)throw new Error("index must be >= 0.");if(!e)throw new Error("name cannot be null.");if(!s)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=s}}!function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(r||(r={}))},9250:(t,e,s)=>{"use strict";s.d(e,{g:()=>i});var r=s(8271);const i=[];i[r.K.NONE]=void 0,i[r.K.DISABLED]={stencilWriteMask:0,stencilReadMask:0},i[r.K.RENDERING_MASK_ADD]={stencilFront:{compare:"equal",passOp:"increment-clamp"},stencilBack:{compare:"equal",passOp:"increment-clamp"}},i[r.K.RENDERING_MASK_REMOVE]={stencilFront:{compare:"equal",passOp:"decrement-clamp"},stencilBack:{compare:"equal",passOp:"decrement-clamp"}},i[r.K.MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"equal",passOp:"keep"},stencilBack:{compare:"equal",passOp:"keep"}},i[r.K.INVERSE_MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"not-equal",passOp:"keep"},stencilBack:{compare:"not-equal",passOp:"keep"}}},9279:(t,e,s)=>{"use strict";s.d(e,{Y:()=>r});const r=(t,e)=>{const s=e.split("?")[1];return s&&(t+=`?${s}`),t}},9317:(t,e,s)=>{"use strict";s.d(e,{l:()=>n});var r=s(6793);class i extends r.a{async doLoad(t){const e=new Promise(e=>{const s=new Image;s.crossOrigin="anonymous",s.src=t,s.onload=()=>{if(this.loadingPromises.delete(t),this.hasActiveRef(t)){if(this.cachedAssets.has(t))return console.error(`Dom texture already loaded: ${t}`),void e(void 0);this.cachedAssets.set(t,s),e(s)}else e(void 0)},s.onerror=s=>{this.loadingPromises.delete(t),console.error(`Failed to load dom texture: ${t}`,s),e(void 0)}});return this.loadingPromises.set(t,e),await e}cleanup(t,e){e.remove()}}const n=new i},9359:(t,e,s)=>{"use strict";s.d(e,{v:()=>n});var r=s(4872),i=s(4696);class n extends r.A{constructor(){super(...arguments),this.chars=Object.create(null),this.lineHeight=0,this.fontFamily="",this.fontMetrics={fontSize:0,ascent:0,descent:0},this.baseLineOffset=0,this.distanceField={type:"none",range:0},this.pages=[],this.applyFillAsTint=!0,this.baseMeasurementFontSize=100,this.baseRenderedFontSize=100}get font(){return(0,i.t6)(i.lj,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return(0,i.t6)(i.lj,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return(0,i.t6)(i.lj,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return(0,i.t6)(i.lj,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return(0,i.t6)(i.lj,"BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),this.distanceField.type}destroy(t=!1){this.emit("destroy",this),this.removeAllListeners();for(const t in this.chars)this.chars[t].texture?.destroy();this.chars=null,t&&(this.pages.forEach(t=>t.texture.destroy(!0)),this.pages=null)}}},9375:(t,e,s)=>{"use strict";s.d(e,{L:()=>i});const r={default:-1};function i(t="default"){return void 0===r[t]&&(r[t]=-1),++r[t]}},9390:(t,e,s)=>{"use strict";s.d(e,{M:()=>n});var r=s(59);const i=[new r.b,new r.b,new r.b,new r.b];class n{constructor(t=0,e=0,s=0,r=0){this.type="rectangle",this.x=Number(t),this.y=Number(e),this.width=Number(s),this.height=Number(r)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new n(0,0,0,0)}clone(){return new n(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){return!(this.width<=0||this.height<=0)&&t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height}strokeContains(t,e,s,r=.5){const{width:i,height:n}=this;if(i<=0||n<=0)return!1;const a=this.x,o=this.y,l=s*(1-r),h=s-l;return t>=a-l&&t<=a+i+l&&e>=o-l&&e<=o+n+l&&!(t>a+h&&t<a+i-h&&e>o+h&&e<o+n-h)}intersects(t,e){if(!e){const e=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=e)return!1;const s=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>s}const s=this.left,r=this.right,n=this.top,a=this.bottom;if(r<=s||a<=n)return!1;const o=i[0].set(t.left,t.top),l=i[1].set(t.left,t.bottom),h=i[2].set(t.right,t.top),c=i[3].set(t.right,t.bottom);if(h.x<=o.x||l.y<=o.y)return!1;const u=Math.sign(e.a*e.d-e.b*e.c);if(0===u)return!1;if(e.apply(o,o),e.apply(l,l),e.apply(h,h),e.apply(c,c),Math.max(o.x,l.x,h.x,c.x)<=s||Math.min(o.x,l.x,h.x,c.x)>=r||Math.max(o.y,l.y,h.y,c.y)<=n||Math.min(o.y,l.y,h.y,c.y)>=a)return!1;const d=u*(l.y-o.y),p=u*(o.x-l.x),f=d*s+p*n,m=d*r+p*n,g=d*s+p*a,x=d*r+p*a;if(Math.max(f,m,g,x)<=d*o.x+p*o.y||Math.min(f,m,g,x)>=d*c.x+p*c.y)return!1;const y=u*(o.y-h.y),v=u*(h.x-o.x),_=y*s+v*n,b=y*r+v*n,w=y*s+v*a,T=y*r+v*a;return!(Math.max(_,b,w,T)<=y*o.x+v*o.y||Math.min(_,b,w,T)>=y*c.x+v*c.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this}fit(t){const e=Math.max(this.x,t.x),s=Math.min(this.x+this.width,t.x+t.width),r=Math.max(this.y,t.y),i=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(s-e,0),this.y=r,this.height=Math.max(i-r,0),this}ceil(t=1,e=.001){const s=Math.ceil((this.x+this.width-e)*t)/t,r=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=s-this.x,this.height=r-this.y,this}scale(t,e=t){return this.x*=t,this.y*=e,this.width*=t,this.height*=e,this}enlarge(t){const e=Math.min(this.x,t.x),s=Math.max(this.x+this.width,t.x+t.width),r=Math.min(this.y,t.y),i=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=s-e,this.y=r,this.height=i-r,this}getBounds(t){return t||(t=new n),t.copyFrom(this),t}containsRect(t){if(this.width<=0||this.height<=0)return!1;const e=t.x,s=t.y,r=t.x+t.width,i=t.y+t.height;return e>=this.x&&e<this.x+this.width&&s>=this.y&&s<this.y+this.height&&r>=this.x&&r<this.x+this.width&&i>=this.y&&i<this.y+this.height}set(t,e,s,r){return this.x=t,this.y=e,this.width=s,this.height=r,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}},9437:(t,e,s)=>{"use strict";function r(t){return t+=0===t?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)}function i(t){return!(t&t-1||!t)}s.d(e,{U5:()=>r,f3:()=>i})},9482:(t,e,s)=>{"use strict";function r(t,e,s){const r=(t>>24&255)/255;e[s++]=(255&t)/255*r,e[s++]=(t>>8&255)/255*r,e[s++]=(t>>16&255)/255*r,e[s++]=r}s.d(e,{V:()=>r})},9521:(t,e,s)=>{"use strict";s.d(e,{s:()=>a});var r=s(9739),i=s(7694),n=s(2445);function a(t,e,s){t.label=s,t._sourceOrigin=s;const a=new r.g({source:t,label:s}),o=()=>{delete e.promiseCache[s],n.l.has(s)&&n.l.remove(s)};return a.source.once("destroy",()=>{e.promiseCache[s]&&((0,i.R)("[Assets] A TextureSource managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the TextureSource."),o())}),a.once("destroy",()=>{t.destroyed||((0,i.R)("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),o())}),a}},9565:(t,e,s)=>{"use strict";s.d(e,{E:()=>o,f:()=>n});var r=s(5199),i=s(7882);function n(t,e,s){let n,l;return s.clear(),t.parent?e?n=t.parent.worldTransform:(l=i.u.get().identity(),n=o(t,l)):n=r.u.IDENTITY,a(t,s,n,e),l&&i.u.return(l),s.isValid||s.set(0,0,0,0),s}function a(t,e,s,n){if(!t.visible||!t.measurable)return;let o;n?o=t.worldTransform:(t.updateLocalTransform(),o=i.u.get(),o.appendFrom(t.localTransform,s));const l=e,h=!!t.effects.length;if(h&&(e=i.o.get().clear()),t.boundsArea)e.addRect(t.boundsArea,o);else{const s=t.bounds;s&&!s.isEmpty()&&(e.matrix=o,e.addBounds(s));for(let s=0;s<t.children.length;s++)a(t.children[s],e,o,n)}if(h){for(let s=0;s<t.effects.length;s++)t.effects[s].addBounds?.(e);l.addBounds(e,r.u.IDENTITY),i.o.return(e)}n||i.u.return(o)}function o(t,e){const s=t.parent;return s&&(o(s,e),s.updateLocalTransform(),e.append(s.localTransform)),e}},9586:(t,e,s)=>{"use strict";s.d(e,{P:()=>f});var r=s(5423),i=s(1065),n=s(5947),a=s(2885),o=s(3761),l=s(4173),h=s(8979),c=s(3463),u=s(9521);const d=[".jpeg",".jpg",".png",".webp",".avif"],p=["image/jpeg","image/png","image/webp","image/avif"],f={name:"loadTextures",id:"texture",extension:{type:i.Ag.LoadParser,priority:c.T.High,name:"loadTextures"},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test:t=>(0,o.s)(t,p)||(0,l.W)(t,d),async load(t,e,s){let i=null;i=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap?this.config.preferWorkers&&await h.O.isImageBitmapSupported()?await h.O.loadImageBitmap(t,e):await async function(t,e){const s=await r.e.get().fetch(t);if(!s.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${t}: ${s.status} ${s.statusText}`);const i=await s.blob();return"premultiplied-alpha"===e?.data?.alphaMode?createImageBitmap(i,{premultiplyAlpha:"none"}):createImageBitmap(i)}(t,e):await new Promise((e,s)=>{i=r.e.get().createImage(),i.crossOrigin=this.config.crossOrigin,i.src=t,i.complete?e(i):(i.onload=()=>{e(i)},i.onerror=s)});const o=new n.b({resource:i,alphaMode:"premultiply-alpha-on-upload",resolution:e.data?.resolution||(0,a.v)(t),...e.data});return(0,u.s)(o,s,t)},unload(t){t.destroy(!0)}}},9677:(t,e,s)=>{"use strict";s.d(e,{I:()=>C,v:()=>A});var r=s(5007),i=s(1790),n=s(7694);function a(t,e,s){if(t)for(const r in t){const i=e[r.toLocaleLowerCase()];if(i){let e=t[r];"header"===r&&(e=e.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),s&&i.push(`//----${s}----//`),i.push(e)}else(0,n.R)(`${r} placement hook does not exist in shader`)}}const o=/\{\{(.*?)\}\}/g;function l(t){const e={};return(t.match(o)?.map(t=>t.replace(/[{()}]/g,""))??[]).forEach(t=>{e[t]=[]}),e}function h(t,e){let s;const r=/@in\s+([^;]+);/g;for(;null!==(s=r.exec(t));)e.push(s[1])}function c(t,e,s=!1){const r=[];h(e,r),t.forEach(t=>{t.header&&h(t.header,r)});const i=r;s&&i.sort();const n=i.map((t,e)=>` @location(${e}) ${t},`).join("\n");let a=e.replace(/@in\s+[^;]+;\s*/g,"");return a=a.replace("{{in}}",`\n${n}\n`),a}function u(t,e){let s;const r=/@out\s+([^;]+);/g;for(;null!==(s=r.exec(t));)e.push(s[1])}function d(t,e){let s=t;for(const t in e){const r=e[t];s=r.join("\n").length?s.replace(`{{${t}}}`,`//-----${t} START-----//\n${r.join("\n")}\n//----${t} FINISH----//`):s.replace(`{{${t}}}`,"")}return s}const p=Object.create(null),f=new Map;let m=0;function g({template:t,bits:e}){const s=x(t,e);return p[s]||(p[s]=y(t.vertex,t.fragment,e)),p[s]}function x(t,e){return e.map(t=>(f.has(t)||f.set(t,m++),f.get(t))).sort((t,e)=>t-e).join("-")+t.vertex+t.fragment}function y(t,e,s){const r=l(t),i=l(e);return s.forEach(t=>{a(t.vertex,r,t.name),a(t.fragment,i,t.name)}),{vertex:d(t,r),fragment:d(e,i)}}const v="\n @in aPosition: vec2<f32>;\n @in aUV: vec2<f32>;\n\n @out @builtin(position) vPosition: vec4<f32>;\n @out vUV : vec2<f32>;\n @out vColor : vec4<f32>;\n\n {{header}}\n\n struct VSOutput {\n {{struct}}\n };\n\n @vertex\n fn main( {{in}} ) -> VSOutput {\n\n var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;\n var modelMatrix = mat3x3<f32>(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n var position = aPosition;\n var uv = aUV;\n\n {{start}}\n\n vColor = vec4<f32>(1., 1., 1., 1.);\n\n {{main}}\n\n vUV = uv;\n\n var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;\n\n vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0);\n\n vColor *= globalUniforms.uWorldColorAlpha;\n\n {{end}}\n\n {{return}}\n };\n",_="\n @in vUV : vec2<f32>;\n @in vColor : vec4<f32>;\n\n {{header}}\n\n @fragment\n fn main(\n {{in}}\n ) -> @location(0) vec4<f32> {\n\n {{start}}\n\n var outColor:vec4<f32>;\n\n {{main}}\n\n var finalColor:vec4<f32> = outColor * vColor;\n\n {{end}}\n\n return finalColor;\n };\n",b="\n in vec2 aPosition;\n in vec2 aUV;\n\n out vec4 vColor;\n out vec2 vUV;\n\n {{header}}\n\n void main(void){\n\n mat3 worldTransformMatrix = uWorldTransformMatrix;\n mat3 modelMatrix = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n vec2 position = aPosition;\n vec2 uv = aUV;\n\n {{start}}\n\n vColor = vec4(1.);\n\n {{main}}\n\n vUV = uv;\n\n mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;\n\n gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n\n vColor *= uWorldColorAlpha;\n\n {{end}}\n }\n",w="\n\n in vec4 vColor;\n in vec2 vUV;\n\n out vec4 finalColor;\n\n {{header}}\n\n void main(void) {\n\n {{start}}\n\n vec4 outColor;\n\n {{main}}\n\n finalColor = outColor * vColor;\n\n {{end}}\n }\n",T={name:"global-uniforms-bit",vertex:{header:"\n struct GlobalUniforms {\n uProjectionMatrix:mat3x3<f32>,\n uWorldTransformMatrix:mat3x3<f32>,\n uWorldColorAlpha: vec4<f32>,\n uResolution: vec2<f32>,\n }\n\n @group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;\n "}},S={name:"global-uniforms-bit",vertex:{header:"\n uniform mat3 uProjectionMatrix;\n uniform mat3 uWorldTransformMatrix;\n uniform vec4 uWorldColorAlpha;\n uniform vec2 uResolution;\n "}};function A({bits:t,name:e}){const s=function({template:t,bits:e}){const s=x(t,e);if(p[s])return p[s];const{vertex:r,fragment:i}=function(t,e){const s=e.map(t=>t.vertex).filter(t=>!!t),r=e.map(t=>t.fragment).filter(t=>!!t);let i=c(s,t.vertex,!0);return i=function(t,e){const s=[];u(e,s),t.forEach(t=>{t.header&&u(t.header,s)});let r=0;const i=s.sort().map(t=>t.indexOf("builtin")>-1?t:`@location(${r++}) ${t}`).join(",\n"),n=s.sort().map(t=>{return` var ${e=t,e.replace(/@.*?\s+/g,"")};`;var e}).join("\n"),a=`return VSOutput(\n ${s.sort().map(t=>` ${function(t){const e=/\b(\w+)\s*:/g.exec(t);return e?e[1]:""}(t)}`).join(",\n")});`;let o=e.replace(/@out\s+[^;]+;\s*/g,"");return o=o.replace("{{struct}}",`\n${i}\n`),o=o.replace("{{start}}",`\n${n}\n`),o=o.replace("{{return}}",`\n${a}\n`),o}(s,i),{vertex:i,fragment:c(r,t.fragment,!0)}}(t,e);return p[s]=y(r,i,e),p[s]}({template:{fragment:_,vertex:v},bits:[T,...t]});return i.B.from({name:e,vertex:{source:s.vertex,entryPoint:"main"},fragment:{source:s.fragment,entryPoint:"main"}})}function C({bits:t,name:e}){return new r.M({name:e,...g({template:{vertex:b,fragment:w},bits:[S,...t]})})}},9739:(t,e,s)=>{"use strict";s.d(e,{g:()=>d});var r=s(4872),i=s(769),n=s(9390),a=s(9375),o=s(4696);const l=()=>{};var h=s(6185),c=s(4269),u=s(1734);class d extends r.A{constructor({source:t,label:e,frame:s,orig:r,trim:i,defaultAnchor:o,defaultBorders:l,rotate:h,dynamic:u}={}){if(super(),this.uid=(0,a.L)("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new n.M,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=e,this.source=t?.source??new c.v,this.noFrame=!s,s)this.frame.copyFrom(s);else{const{width:t,height:e}=this._source;this.frame.width=t,this.frame.height=e}this.orig=r||this.frame,this.trim=i,this.rotate=h??0,this.defaultAnchor=o,this.defaultBorders=l,this.destroyed=!1,this.dynamic=u||!1,this.updateUvs()}set source(t){this._source&&this._source.off("resize",this.update,this),this._source=t,t.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new u.N(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:t,frame:e}=this,{width:s,height:r}=this._source,n=e.x/s,a=e.y/r,o=e.width/s,l=e.height/r;let h=this.rotate;if(h){const e=o/2,s=l/2,r=n+e,c=a+s;h=i.E.add(h,i.E.NW),t.x0=r+e*i.E.uX(h),t.y0=c+s*i.E.uY(h),h=i.E.add(h,2),t.x1=r+e*i.E.uX(h),t.y1=c+s*i.E.uY(h),h=i.E.add(h,2),t.x2=r+e*i.E.uX(h),t.y2=c+s*i.E.uY(h),h=i.E.add(h,2),t.x3=r+e*i.E.uX(h),t.y3=c+s*i.E.uY(h)}else t.x0=n,t.y0=a,t.x1=n+o,t.y1=a,t.x2=n+o,t.y2=a+l,t.x3=n,t.y3=a+l}destroy(t=!1){this._source&&t&&(this._source.destroy(),this._source=null),this._textureMatrix=null,this.destroyed=!0,this.emit("destroy",this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this)}get baseTexture(){return(0,o.t6)(o.lj,"Texture.baseTexture is now Texture.source"),this._source}}d.EMPTY=new d({label:"EMPTY",source:new c.v({label:"EMPTY"})}),d.EMPTY.destroy=l,d.WHITE=new d({source:new h.P({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"}),d.WHITE.destroy=l},9776:(t,e,s)=>{"use strict";s.d(e,{m:()=>a});var r=s(5199),i=s(9375);const n={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}};class a{constructor(t,e){this.uid=(0,i.L)("fillPattern"),this._tick=0,this.transform=new r.u,this.texture=t,this.transform.scale(1/t.frame.width,1/t.frame.height),e&&(t.source.style.addressModeU=n[e].addressModeU,t.source.style.addressModeV=n[e].addressModeV)}setTransform(t){const e=this.texture;this.transform.copyFrom(t),this.transform.invert(),this.transform.scale(1/e.frame.width,1/e.frame.height),this._tick++}get texture(){return this._texture}set texture(t){this._texture!==t&&(this._texture=t,this._tick++)}get styleKey(){return`fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(!0),this.texture=null}}},9797:(t,e,s)=>{"use strict";var r=s(1065),i=s(3769),n=s(7433),a=s(5153),o=s(9482),l=s(1228),h=s(1174),c=s(5199),u=s(9677),d=s(4405),p=s(7335),f=s(1657),m=s(4449),g=s(9739);const x={name:"tiling-bit",vertex:{header:"\n struct TilingUniforms {\n uMapCoord:mat3x3<f32>,\n uClampFrame:vec4<f32>,\n uClampOffset:vec2<f32>,\n uTextureTransform:mat3x3<f32>,\n uSizeAnchor:vec4<f32>\n };\n\n @group(2) @binding(0) var<uniform> tilingUniforms: TilingUniforms;\n @group(2) @binding(1) var uTexture: texture_2d<f32>;\n @group(2) @binding(2) var uSampler: sampler;\n ",main:"\n uv = (tilingUniforms.uTextureTransform * vec3(uv, 1.0)).xy;\n\n position = (position - tilingUniforms.uSizeAnchor.zw) * tilingUniforms.uSizeAnchor.xy;\n "},fragment:{header:"\n struct TilingUniforms {\n uMapCoord:mat3x3<f32>,\n uClampFrame:vec4<f32>,\n uClampOffset:vec2<f32>,\n uTextureTransform:mat3x3<f32>,\n uSizeAnchor:vec4<f32>\n };\n\n @group(2) @binding(0) var<uniform> tilingUniforms: TilingUniforms;\n @group(2) @binding(1) var uTexture: texture_2d<f32>;\n @group(2) @binding(2) var uSampler: sampler;\n ",main:"\n\n var coord = vUV + ceil(tilingUniforms.uClampOffset - vUV);\n coord = (tilingUniforms.uMapCoord * vec3(coord, 1.0)).xy;\n var unclamped = coord;\n coord = clamp(coord, tilingUniforms.uClampFrame.xy, tilingUniforms.uClampFrame.zw);\n\n var bias = 0.;\n\n if(unclamped.x == coord.x && unclamped.y == coord.y)\n {\n bias = -32.;\n }\n\n outColor = textureSampleBias(uTexture, uSampler, coord, bias);\n "}},y={name:"tiling-bit",vertex:{header:"\n uniform mat3 uTextureTransform;\n uniform vec4 uSizeAnchor;\n\n ",main:"\n uv = (uTextureTransform * vec3(aUV, 1.0)).xy;\n\n position = (position - uSizeAnchor.zw) * uSizeAnchor.xy;\n "},fragment:{header:"\n uniform sampler2D uTexture;\n uniform mat3 uMapCoord;\n uniform vec4 uClampFrame;\n uniform vec2 uClampOffset;\n ",main:"\n\n vec2 coord = vUV + ceil(uClampOffset - vUV);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n outColor = texture(uTexture, coord, unclamped == coord ? 0.0 : -32.0);// lod-bias very negative to force lod 0\n\n "}};let v,_;class b extends f.M{constructor(){v??(v=(0,u.v)({name:"tiling-sprite-shader",bits:[d.Ls,x,p.b]})),_??(_=(0,u.I)({name:"tiling-sprite-shader",bits:[d.mA,y,p.m]}));const t=new m.k({uMapCoord:{value:new c.u,type:"mat3x3<f32>"},uClampFrame:{value:new Float32Array([0,0,1,1]),type:"vec4<f32>"},uClampOffset:{value:new Float32Array([0,0]),type:"vec2<f32>"},uTextureTransform:{value:new c.u,type:"mat3x3<f32>"},uSizeAnchor:{value:new Float32Array([100,100,.5,.5]),type:"vec4<f32>"}});super({glProgram:_,gpuProgram:v,resources:{localUniforms:new m.k({uTransformMatrix:{value:new c.u,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),tilingUniforms:t,uTexture:g.g.EMPTY.source,uSampler:g.g.EMPTY.source.style}})}updateUniforms(t,e,s,r,i,n){const a=this.resources.tilingUniforms,o=n.width,l=n.height,h=n.textureMatrix,c=a.uniforms.uTextureTransform;c.set(s.a*o/t,s.b*o/e,s.c*l/t,s.d*l/e,s.tx/t,s.ty/e),c.invert(),a.uniforms.uMapCoord=h.mapCoord,a.uniforms.uClampFrame=h.uClampFrame,a.uniforms.uClampOffset=h.uClampOffset,a.uniforms.uTextureTransform=c,a.uniforms.uSizeAnchor[0]=t,a.uniforms.uSizeAnchor[1]=e,a.uniforms.uSizeAnchor[2]=r,a.uniforms.uSizeAnchor[3]=i,n&&(this.resources.uTexture=n.source,this.resources.uSampler=n.source.style)}}class w extends h.u{constructor(){super({positions:new Float32Array([0,0,1,0,1,1,0,1]),uvs:new Float32Array([0,0,1,0,1,1,0,1]),indices:new Uint32Array([0,1,2,0,2,3])})}}const T=new w;class S{constructor(){this.canBatch=!0,this.geometry=new h.u({indices:T.indices.slice(),positions:T.positions.slice(),uvs:T.uvs.slice()})}destroy(){this.geometry.destroy(),this.shader?.destroy()}}class A{constructor(t){this._state=n.U.default2d,this._renderer=t}validateRenderable(t){const e=this._getTilingSpriteData(t),s=e.canBatch;this._updateCanBatch(t);const r=e.canBatch;if(r&&r===s){const{batchableMesh:s}=e;return!s._batcher.checkAndUpdateTexture(s,t.texture)}return s!==r}addRenderable(t,e){const s=this._renderer.renderPipes.batch;this._updateCanBatch(t);const r=this._getTilingSpriteData(t),{geometry:i,canBatch:n}=r;if(n){r.batchableMesh||(r.batchableMesh=new l.U);const n=r.batchableMesh;t.didViewUpdate&&(this._updateBatchableMesh(t),n.geometry=i,n.renderable=t,n.transform=t.groupTransform,n.setTexture(t._texture)),n.roundPixels=this._renderer._roundPixels|t._roundPixels,s.addToBatch(n,e)}else s.break(e),r.shader||(r.shader=new b),this.updateRenderable(t),e.add(t)}execute(t){const{shader:e}=this._getTilingSpriteData(t);e.groups[0]=this._renderer.globalUniforms.bindGroup;const s=e.resources.localUniforms.uniforms;s.uTransformMatrix=t.groupTransform,s.uRound=this._renderer._roundPixels|t._roundPixels,(0,o.V)(t.groupColorAlpha,s.uColor,0),this._state.blendMode=(0,i.i)(t.groupBlendMode,t.texture._source),this._renderer.encoder.draw({geometry:T,shader:e,state:this._state})}updateRenderable(t){const e=this._getTilingSpriteData(t),{canBatch:s}=e;if(s){const{batchableMesh:s}=e;t.didViewUpdate&&this._updateBatchableMesh(t),s._batcher.updateElement(s)}else if(t.didViewUpdate){const{shader:s}=e;s.updateUniforms(t.width,t.height,t._tileTransform.matrix,t.anchor.x,t.anchor.y,t.texture)}}_getTilingSpriteData(t){return t._gpuData[this._renderer.uid]||this._initTilingSpriteData(t)}_initTilingSpriteData(t){const e=new S;return e.renderable=t,t._gpuData[this._renderer.uid]=e,e}_updateBatchableMesh(t){const e=this._getTilingSpriteData(t),{geometry:s}=e,r=t.texture.source.style;"repeat"!==r.addressMode&&(r.addressMode="repeat",r.update()),function(t,e){const s=t.texture,r=s.frame.width,i=s.frame.height;let n=0,a=0;t.applyAnchorToTexture&&(n=t.anchor.x,a=t.anchor.y),e[0]=e[6]=-n,e[2]=e[4]=1-n,e[1]=e[3]=-a,e[5]=e[7]=1-a;const o=c.u.shared;o.copyFrom(t._tileTransform.matrix),o.tx/=t.width,o.ty/=t.height,o.invert(),o.scale(t.width/r,t.height/i),function(t,e,s,r){let i=0;const n=t.length/2,a=r.a,o=r.b,l=r.c,h=r.d,c=r.tx,u=r.ty;for(s*=2;i<n;){const e=t[s],r=t[s+1];t[s]=a*e+l*r+c,t[s+1]=o*e+h*r+u,s+=2,i++}}(e,0,0,o)}(t,s.uvs),function(t,e){const s=t.anchor.x,r=t.anchor.y;e[0]=-s*t.width,e[1]=-r*t.height,e[2]=(1-s)*t.width,e[3]=-r*t.height,e[4]=(1-s)*t.width,e[5]=(1-r)*t.height,e[6]=-s*t.width,e[7]=(1-r)*t.height}(t,s.positions)}destroy(){this._renderer=null}_updateCanBatch(t){const e=this._getTilingSpriteData(t),s=t.texture;let r=!0;return this._renderer.type===a.W.WEBGL&&(r=this._renderer.context.supports.nonPowOf2wrapping),e.canBatch=s.textureMatrix.isSimple&&(r||s.source.isPowerOfTwo),e.canBatch}}A.extension={type:[r.Ag.WebGLPipes,r.Ag.WebGPUPipes,r.Ag.CanvasPipes],name:"tilingSprite"},r.XO.add(A)},9798:(t,e,s)=>{"use strict";s.d(e,{S:()=>r});var r=(t=>(t[t.MAP_READ=1]="MAP_READ",t[t.MAP_WRITE=2]="MAP_WRITE",t[t.COPY_SRC=4]="COPY_SRC",t[t.COPY_DST=8]="COPY_DST",t[t.INDEX=16]="INDEX",t[t.VERTEX=32]="VERTEX",t[t.UNIFORM=64]="UNIFORM",t[t.STORAGE=128]="STORAGE",t[t.INDIRECT=256]="INDIRECT",t[t.QUERY_RESOLVE=512]="QUERY_RESOLVE",t[t.STATIC=1024]="STATIC",t))(r||{})},9836:(t,e,s)=>{"use strict";s.d(e,{S:()=>r});const r={extension:{type:s(1065).Ag.Environment,name:"webworker",priority:0},test:()=>"undefined"!=typeof self&&void 0!==self.WorkerGlobalScope,load:async()=>{await Promise.resolve().then(s.bind(s,6516))}}},9935:(t,e,s)=>{"use strict";s(2839)._}},a={};function o(t){var e=a[t];if(void 0!==e)return e.exports;var s=a[t]={exports:{}};return n[t].call(s.exports,s,s.exports,o),s.exports}t="function"==typeof Symbol,e=t?Symbol("webpack queues"):"__webpack_queues__",s=t?Symbol("webpack exports"):"__webpack_exports__",r=t?Symbol("webpack error"):"__webpack_error__",i=t=>{t&&t.d<1&&(t.d=1,t.forEach(t=>t.r--),t.forEach(t=>t.r--?t.r++:t()))},o.a=(t,n,a)=>{var o;a&&((o=[]).d=-1);var l,h,c,u=new Set,d=t.exports,p=new Promise((t,e)=>{c=e,h=t});p[s]=d,p[e]=t=>(o&&t(o),u.forEach(t),p.catch(t=>{})),t.exports=p,n(t=>{var n;l=(t=>t.map(t=>{if(null!==t&&"object"==typeof t){if(t[e])return t;if(t.then){var n=[];n.d=0,t.then(t=>{a[s]=t,i(n)},t=>{a[r]=t,i(n)});var a={};return a[e]=t=>t(n),a}}var o={};return o[e]=t=>{},o[s]=t,o}))(t);var a=()=>l.map(t=>{if(t[r])throw t[r];return t[s]}),h=new Promise(t=>{(n=()=>t(a)).r=0;var s=t=>t!==o&&!u.has(t)&&(u.add(t),t&&!t.d&&(n.r++,t.push(n)));l.map(t=>t[e](s))});return n.r?h:a()},t=>(t?c(p[r]=t):h(d),i(o))),o&&o.d<0&&(o.d=0)},o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var s in e)o.o(e,s)&&!o.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o(2777)})();