@splinetool/runtime 2.0.2 → 2.0.4

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 (349) hide show
  1. package/build/boolean.js +24 -0
  2. package/build/boolean.js.br +0 -0
  3. package/build/boolean.js.gz +0 -0
  4. package/build/boolean.wasm +0 -0
  5. package/build/boolean.wasm.br +0 -0
  6. package/build/boolean.wasm.gz +0 -0
  7. package/build/hana-ui.js +78 -46
  8. package/build/hana-ui.js.br +0 -0
  9. package/build/hana-ui.js.gz +0 -0
  10. package/build/hana-ui.wasm +0 -0
  11. package/build/hana-ui.wasm.br +0 -0
  12. package/build/hana-ui.wasm.gz +0 -0
  13. package/build/runtime-aiAssistant-RMA2DMFU.js +1 -0
  14. package/build/runtime-aiAssistant-RMA2DMFU.js.br +0 -0
  15. package/build/runtime-aiAssistant-RMA2DMFU.js.gz +0 -0
  16. package/build/runtime-apiServices-KA4FEP5Y.js +1 -0
  17. package/build/runtime-apiServices-KA4FEP5Y.js.br +0 -0
  18. package/build/runtime-apiServices-KA4FEP5Y.js.gz +0 -0
  19. package/build/{runtime-audio-Y3GYW4YQ.js → runtime-audio-BQSRM3W2.js} +1 -1
  20. package/build/runtime-audio-BQSRM3W2.js.br +0 -0
  21. package/build/runtime-audio-BQSRM3W2.js.gz +0 -0
  22. package/build/runtime-chunk-2PT2WH66.js +1 -0
  23. package/build/runtime-chunk-2PT2WH66.js.br +0 -0
  24. package/build/runtime-chunk-2PT2WH66.js.gz +0 -0
  25. package/build/{runtime-chunk-P2XISQYQ.js → runtime-chunk-36FZTFCC.js} +1 -1
  26. package/build/runtime-chunk-36FZTFCC.js.br +0 -0
  27. package/build/runtime-chunk-36FZTFCC.js.gz +0 -0
  28. package/build/runtime-chunk-3J5YHSQW.js +1 -0
  29. package/build/runtime-chunk-3J5YHSQW.js.br +0 -0
  30. package/build/runtime-chunk-3J5YHSQW.js.gz +0 -0
  31. package/build/{runtime-chunk-FF5REN2J.js → runtime-chunk-4I22JDL6.js} +1 -1
  32. package/build/runtime-chunk-4I22JDL6.js.br +0 -0
  33. package/build/runtime-chunk-4I22JDL6.js.gz +0 -0
  34. package/build/{runtime-chunk-Z5OH244S.js → runtime-chunk-5XUI4Z6R.js} +1 -1
  35. package/build/runtime-chunk-5XUI4Z6R.js.br +0 -0
  36. package/build/runtime-chunk-5XUI4Z6R.js.gz +0 -0
  37. package/build/runtime-chunk-6UUF5VIS.js +1 -0
  38. package/build/runtime-chunk-6UUF5VIS.js.br +0 -0
  39. package/build/runtime-chunk-6UUF5VIS.js.gz +0 -0
  40. package/build/{runtime-chunk-P3254QGK.js → runtime-chunk-CIBY4YG3.js} +1 -1
  41. package/build/runtime-chunk-CIBY4YG3.js.br +0 -0
  42. package/build/runtime-chunk-CIBY4YG3.js.gz +0 -0
  43. package/build/{runtime-chunk-MRUNX43X.js → runtime-chunk-DKGQ6OYZ.js} +1 -1
  44. package/build/runtime-chunk-DKGQ6OYZ.js.br +0 -0
  45. package/build/runtime-chunk-DKGQ6OYZ.js.gz +0 -0
  46. package/build/{runtime-chunk-A2LYIKKC.js → runtime-chunk-DSJY3WL2.js} +1 -1
  47. package/build/{runtime-chunk-A2LYIKKC.js.br → runtime-chunk-DSJY3WL2.js.br} +0 -0
  48. package/build/runtime-chunk-DSJY3WL2.js.gz +0 -0
  49. package/build/{runtime-chunk-RQ3ZQR4P.js → runtime-chunk-ESZD4IRS.js} +1 -1
  50. package/build/runtime-chunk-ESZD4IRS.js.br +0 -0
  51. package/build/runtime-chunk-ESZD4IRS.js.gz +0 -0
  52. package/build/{runtime-chunk-OEXC34HT.js → runtime-chunk-GPACKOH2.js} +1 -1
  53. package/build/runtime-chunk-GPACKOH2.js.br +0 -0
  54. package/build/runtime-chunk-GPACKOH2.js.gz +0 -0
  55. package/build/{runtime-chunk-BJVCOW72.js → runtime-chunk-I5QFGBIU.js} +1 -1
  56. package/build/runtime-chunk-I5QFGBIU.js.br +0 -0
  57. package/build/runtime-chunk-I5QFGBIU.js.gz +0 -0
  58. package/build/{runtime-chunk-HJS3VFEN.js → runtime-chunk-JNSHQPHC.js} +1 -1
  59. package/build/runtime-chunk-JNSHQPHC.js.br +0 -0
  60. package/build/runtime-chunk-JNSHQPHC.js.gz +0 -0
  61. package/build/{runtime-chunk-JFYHGEDN.js → runtime-chunk-LT4UVXE2.js} +1 -1
  62. package/build/runtime-chunk-LT4UVXE2.js.br +0 -0
  63. package/build/runtime-chunk-LT4UVXE2.js.gz +0 -0
  64. package/build/{runtime-chunk-PPLLJM75.js → runtime-chunk-NTW4X3NC.js} +1 -1
  65. package/build/runtime-chunk-NTW4X3NC.js.br +0 -0
  66. package/build/runtime-chunk-NTW4X3NC.js.gz +0 -0
  67. package/build/runtime-chunk-OOC7YSI5.js +1 -0
  68. package/build/runtime-chunk-OOC7YSI5.js.br +0 -0
  69. package/build/runtime-chunk-OOC7YSI5.js.gz +0 -0
  70. package/build/runtime-chunk-QVC5UDJO.js +1 -0
  71. package/build/runtime-chunk-QVC5UDJO.js.br +0 -0
  72. package/build/runtime-chunk-QVC5UDJO.js.gz +0 -0
  73. package/build/runtime-chunk-R7NC6CZZ.js +1 -0
  74. package/build/runtime-chunk-R7NC6CZZ.js.br +0 -0
  75. package/build/runtime-chunk-R7NC6CZZ.js.gz +0 -0
  76. package/build/{runtime-chunk-VRVV54WH.js → runtime-chunk-RF63UVAU.js} +1 -1
  77. package/build/runtime-chunk-RF63UVAU.js.br +0 -0
  78. package/build/runtime-chunk-RF63UVAU.js.gz +0 -0
  79. package/build/{runtime-chunk-TDCFE5IE.js → runtime-chunk-SL64ZYCB.js} +1 -1
  80. package/build/runtime-chunk-SL64ZYCB.js.br +0 -0
  81. package/build/runtime-chunk-SL64ZYCB.js.gz +0 -0
  82. package/build/{runtime-chunk-I47C4XJU.js → runtime-chunk-TPKGBIJU.js} +1 -1
  83. package/build/runtime-chunk-TPKGBIJU.js.br +0 -0
  84. package/build/runtime-chunk-TPKGBIJU.js.gz +0 -0
  85. package/build/{runtime-chunk-LSURXI4Y.js → runtime-chunk-V5NUL7BL.js} +1 -1
  86. package/build/runtime-chunk-V5NUL7BL.js.br +1 -0
  87. package/build/runtime-chunk-V5NUL7BL.js.gz +0 -0
  88. package/build/{runtime-chunk-OLJVVNDS.js → runtime-chunk-V7XDOE2W.js} +1 -1
  89. package/build/runtime-chunk-V7XDOE2W.js.br +0 -0
  90. package/build/runtime-chunk-V7XDOE2W.js.gz +0 -0
  91. package/build/{runtime-chunk-QHPFAHXN.js → runtime-chunk-W4ZCHGLQ.js} +1 -1
  92. package/build/runtime-chunk-W4ZCHGLQ.js.br +0 -0
  93. package/build/runtime-chunk-W4ZCHGLQ.js.gz +0 -0
  94. package/build/runtime-chunk-WHKBOV2O.js +1 -0
  95. package/build/runtime-chunk-WHKBOV2O.js.br +0 -0
  96. package/build/runtime-chunk-WHKBOV2O.js.gz +0 -0
  97. package/build/{runtime-chunk-E6JCDSXC.js → runtime-chunk-WMWQXAOH.js} +1 -1
  98. package/build/runtime-chunk-WMWQXAOH.js.br +0 -0
  99. package/build/runtime-chunk-WMWQXAOH.js.gz +0 -0
  100. package/build/runtime-chunk-YFAATRJU.js +1 -0
  101. package/build/runtime-chunk-YFAATRJU.js.br +0 -0
  102. package/build/runtime-chunk-YFAATRJU.js.gz +0 -0
  103. package/build/runtime-chunk-ZJPGZKPX.js +1 -0
  104. package/build/runtime-chunk-ZJPGZKPX.js.br +0 -0
  105. package/build/runtime-chunk-ZJPGZKPX.js.gz +0 -0
  106. package/build/{runtime-chunk-2SYZJBYJ.js → runtime-chunk-ZMXEX5NX.js} +1 -1
  107. package/build/runtime-chunk-ZMXEX5NX.js.br +0 -0
  108. package/build/runtime-chunk-ZMXEX5NX.js.gz +0 -0
  109. package/build/{runtime-classicRuntime-AMAXBOXT.js → runtime-classicRuntime-UOZ6RID5.js} +1 -1
  110. package/build/runtime-classicRuntime-UOZ6RID5.js.br +0 -0
  111. package/build/runtime-classicRuntime-UOZ6RID5.js.gz +0 -0
  112. package/build/runtime-cloners-DALMNZYL.js +1 -0
  113. package/build/runtime-cloners-DALMNZYL.js.br +0 -0
  114. package/build/runtime-cloners-DALMNZYL.js.gz +0 -0
  115. package/build/{runtime-components-EPAMFKSB.js → runtime-components-IGNRKI6T.js} +1 -1
  116. package/build/runtime-components-IGNRKI6T.js.br +0 -0
  117. package/build/runtime-components-IGNRKI6T.js.gz +0 -0
  118. package/build/runtime-conditional-DCOFCW5I.js +1 -0
  119. package/build/runtime-conditional-DCOFCW5I.js.br +0 -0
  120. package/build/runtime-conditional-DCOFCW5I.js.gz +0 -0
  121. package/build/{runtime-createDestroy-HLHRAAC4.js → runtime-createDestroy-JLB7IIQL.js} +1 -1
  122. package/build/runtime-createDestroy-JLB7IIQL.js.br +0 -0
  123. package/build/runtime-createDestroy-JLB7IIQL.js.gz +0 -0
  124. package/build/{runtime-dragDrop-K6LWK7FL.js → runtime-dragDrop-ERDSNA3S.js} +1 -1
  125. package/build/runtime-dragDrop-ERDSNA3S.js.br +0 -0
  126. package/build/runtime-dragDrop-ERDSNA3S.js.gz +0 -0
  127. package/build/runtime-gameControls-XKOQVZZC.js +1 -0
  128. package/build/runtime-gameControls-XKOQVZZC.js.br +0 -0
  129. package/build/runtime-gameControls-XKOQVZZC.js.gz +0 -0
  130. package/build/runtime-hair-EOZHA2BH.js +1 -0
  131. package/build/runtime-hair-EOZHA2BH.js.br +0 -0
  132. package/build/runtime-hair-EOZHA2BH.js.gz +0 -0
  133. package/build/runtime-mergeStaticGeometries-4Y3LE3VX.js +1 -0
  134. package/build/runtime-mergeStaticGeometries-4Y3LE3VX.js.br +0 -0
  135. package/build/runtime-mergeStaticGeometries-4Y3LE3VX.js.gz +0 -0
  136. package/build/{runtime-miscActions-L7BIGLEB.js → runtime-miscActions-KIRLTM7C.js} +1 -1
  137. package/build/runtime-miscActions-KIRLTM7C.js.br +0 -0
  138. package/build/runtime-miscActions-KIRLTM7C.js.gz +0 -0
  139. package/build/runtime-mouseHover-WULIJFG2.js +1 -0
  140. package/build/runtime-mouseHover-WULIJFG2.js.br +0 -0
  141. package/build/runtime-mouseHover-WULIJFG2.js.gz +0 -0
  142. package/build/{runtime-particles-W7YEQWJI.js → runtime-particles-NNV35DLD.js} +1 -1
  143. package/build/runtime-particles-NNV35DLD.js.br +0 -0
  144. package/build/runtime-particles-NNV35DLD.js.gz +0 -0
  145. package/build/{runtime-paths-CK327WCT.js → runtime-paths-RRXZ3PXM.js} +1 -1
  146. package/build/runtime-paths-RRXZ3PXM.js.br +0 -0
  147. package/build/runtime-paths-RRXZ3PXM.js.gz +0 -0
  148. package/build/runtime-resize-V6LZSOZB.js +1 -0
  149. package/build/runtime-resize-V6LZSOZB.js.br +0 -0
  150. package/build/runtime-resize-V6LZSOZB.js.gz +0 -0
  151. package/build/{runtime-sceneTransition-7AG4A4P5.js → runtime-sceneTransition-CP5TI3VP.js} +1 -1
  152. package/build/runtime-sceneTransition-CP5TI3VP.js.br +0 -0
  153. package/build/runtime-sceneTransition-CP5TI3VP.js.gz +0 -0
  154. package/build/{runtime-scroll-MNQPPLQL.js → runtime-scroll-Q7VGS5NM.js} +1 -1
  155. package/build/runtime-scroll-Q7VGS5NM.js.br +0 -0
  156. package/build/runtime-scroll-Q7VGS5NM.js.gz +0 -0
  157. package/build/runtime-shapeBlends-UN7GGFRG.js +1 -0
  158. package/build/runtime-shapeBlends-UN7GGFRG.js.br +0 -0
  159. package/build/runtime-shapeBlends-UN7GGFRG.js.gz +0 -0
  160. package/build/{runtime-text-5RIKJ4US.js → runtime-text-N6XLUSM2.js} +1 -1
  161. package/build/runtime-text-N6XLUSM2.js.br +0 -0
  162. package/build/runtime-text-N6XLUSM2.js.gz +0 -0
  163. package/build/{runtime-textInputs-YBGYTAMD.js → runtime-textInputs-IW2E6BNU.js} +1 -1
  164. package/build/runtime-textInputs-IW2E6BNU.js.br +0 -0
  165. package/build/runtime-textInputs-IW2E6BNU.js.gz +0 -0
  166. package/build/runtime-timeline-JA2JZIS7.js +1 -0
  167. package/build/runtime-timeline-JA2JZIS7.js.br +0 -0
  168. package/build/runtime-timeline-JA2JZIS7.js.gz +0 -0
  169. package/build/{runtime-tracking-2BXFBQQY.js → runtime-tracking-M57J2PGK.js} +1 -1
  170. package/build/runtime-tracking-M57J2PGK.js.br +0 -0
  171. package/build/runtime-tracking-M57J2PGK.js.gz +0 -0
  172. package/build/{runtime-transitions-6PZW2QIW.js → runtime-transitions-PELRDE7B.js} +1 -1
  173. package/build/runtime-transitions-PELRDE7B.js.br +0 -0
  174. package/build/runtime-transitions-PELRDE7B.js.gz +0 -0
  175. package/build/runtime-ui2d-IOB5Y76W.js +1 -0
  176. package/build/runtime-ui2d-IOB5Y76W.js.br +0 -0
  177. package/build/runtime-ui2d-IOB5Y76W.js.gz +0 -0
  178. package/build/{runtime-variables-U36KPJ5V.js → runtime-variables-Q6Q2JCGI.js} +1 -1
  179. package/build/runtime-variables-Q6Q2JCGI.js.br +0 -0
  180. package/build/runtime-variables-Q6Q2JCGI.js.gz +0 -0
  181. package/build/{runtime-vectorShapes-4HPEEN3B.js → runtime-vectorShapes-ISY7MWHY.js} +1 -1
  182. package/build/runtime-vectorShapes-ISY7MWHY.js.br +0 -0
  183. package/build/runtime-vectorShapes-ISY7MWHY.js.gz +0 -0
  184. package/build/runtime-video-DUDXGADJ.js +1 -0
  185. package/build/runtime-video-DUDXGADJ.js.br +0 -0
  186. package/build/runtime-video-DUDXGADJ.js.gz +0 -0
  187. package/build/runtime-webgpu-4ZCV5EAD.js +1 -0
  188. package/build/runtime-webgpu-4ZCV5EAD.js.br +0 -0
  189. package/build/runtime-webgpu-4ZCV5EAD.js.gz +0 -0
  190. package/build/runtime.cjs +365 -365
  191. package/build/runtime.js +1 -1
  192. package/build/runtime.js.br +0 -0
  193. package/build/runtime.js.gz +0 -0
  194. package/build/runtime.standalone.js +1 -1
  195. package/build/runtime.standalone.js.br +0 -0
  196. package/build/runtime.standalone.js.gz +0 -0
  197. package/build/runtime.standalone.webgl.js +1 -1
  198. package/build/runtime.standalone.webgl.js.br +0 -0
  199. package/build/runtime.standalone.webgl.js.gz +0 -0
  200. package/build/runtime.standalone.webgpu.js +1 -1
  201. package/build/runtime.standalone.webgpu.js.br +0 -0
  202. package/build/runtime.standalone.webgpu.js.gz +0 -0
  203. package/build/runtime.standalone.webgpu.micro.js +1 -1
  204. package/build/runtime.standalone.webgpu.micro.js.br +0 -0
  205. package/build/runtime.standalone.webgpu.micro.js.gz +0 -0
  206. package/build/runtime.standalone.webgpu.min.js +1 -1
  207. package/build/runtime.standalone.webgpu.min.js.br +0 -0
  208. package/build/runtime.standalone.webgpu.min.js.gz +0 -0
  209. package/package.json +1 -1
  210. package/build/runtime-aiAssistant-XJVJ7TQB.js +0 -1
  211. package/build/runtime-aiAssistant-XJVJ7TQB.js.br +0 -0
  212. package/build/runtime-aiAssistant-XJVJ7TQB.js.gz +0 -0
  213. package/build/runtime-apiServices-KAO5SQJZ.js +0 -1
  214. package/build/runtime-apiServices-KAO5SQJZ.js.br +0 -0
  215. package/build/runtime-apiServices-KAO5SQJZ.js.gz +0 -0
  216. package/build/runtime-audio-Y3GYW4YQ.js.br +0 -0
  217. package/build/runtime-audio-Y3GYW4YQ.js.gz +0 -0
  218. package/build/runtime-chunk-2SYZJBYJ.js.br +0 -0
  219. package/build/runtime-chunk-2SYZJBYJ.js.gz +0 -0
  220. package/build/runtime-chunk-2Y73BLCY.js +0 -1
  221. package/build/runtime-chunk-2Y73BLCY.js.br +0 -0
  222. package/build/runtime-chunk-2Y73BLCY.js.gz +0 -0
  223. package/build/runtime-chunk-A2LYIKKC.js.gz +0 -0
  224. package/build/runtime-chunk-BJVCOW72.js.br +0 -0
  225. package/build/runtime-chunk-BJVCOW72.js.gz +0 -0
  226. package/build/runtime-chunk-CTHMLYOZ.js +0 -1
  227. package/build/runtime-chunk-CTHMLYOZ.js.br +0 -0
  228. package/build/runtime-chunk-CTHMLYOZ.js.gz +0 -0
  229. package/build/runtime-chunk-E6JCDSXC.js.br +0 -0
  230. package/build/runtime-chunk-E6JCDSXC.js.gz +0 -0
  231. package/build/runtime-chunk-FF5REN2J.js.br +0 -0
  232. package/build/runtime-chunk-FF5REN2J.js.gz +0 -0
  233. package/build/runtime-chunk-HJS3VFEN.js.br +0 -0
  234. package/build/runtime-chunk-HJS3VFEN.js.gz +0 -0
  235. package/build/runtime-chunk-HL3PBPHE.js +0 -1
  236. package/build/runtime-chunk-HL3PBPHE.js.br +0 -0
  237. package/build/runtime-chunk-HL3PBPHE.js.gz +0 -0
  238. package/build/runtime-chunk-I47C4XJU.js.br +0 -0
  239. package/build/runtime-chunk-I47C4XJU.js.gz +0 -0
  240. package/build/runtime-chunk-JFYHGEDN.js.br +0 -0
  241. package/build/runtime-chunk-JFYHGEDN.js.gz +0 -0
  242. package/build/runtime-chunk-K4FLB6Y7.js +0 -1
  243. package/build/runtime-chunk-K4FLB6Y7.js.br +0 -0
  244. package/build/runtime-chunk-K4FLB6Y7.js.gz +0 -0
  245. package/build/runtime-chunk-LSURXI4Y.js.br +0 -2
  246. package/build/runtime-chunk-LSURXI4Y.js.gz +0 -0
  247. package/build/runtime-chunk-MM75L5X4.js +0 -1
  248. package/build/runtime-chunk-MM75L5X4.js.br +0 -0
  249. package/build/runtime-chunk-MM75L5X4.js.gz +0 -0
  250. package/build/runtime-chunk-MRUNX43X.js.br +0 -0
  251. package/build/runtime-chunk-MRUNX43X.js.gz +0 -0
  252. package/build/runtime-chunk-OEXC34HT.js.br +0 -0
  253. package/build/runtime-chunk-OEXC34HT.js.gz +0 -0
  254. package/build/runtime-chunk-OLJVVNDS.js.br +0 -0
  255. package/build/runtime-chunk-OLJVVNDS.js.gz +0 -0
  256. package/build/runtime-chunk-P2XISQYQ.js.br +0 -0
  257. package/build/runtime-chunk-P2XISQYQ.js.gz +0 -0
  258. package/build/runtime-chunk-P3254QGK.js.br +0 -0
  259. package/build/runtime-chunk-P3254QGK.js.gz +0 -0
  260. package/build/runtime-chunk-PPLLJM75.js.br +0 -0
  261. package/build/runtime-chunk-PPLLJM75.js.gz +0 -0
  262. package/build/runtime-chunk-QHPFAHXN.js.br +0 -0
  263. package/build/runtime-chunk-QHPFAHXN.js.gz +0 -0
  264. package/build/runtime-chunk-QZ35BPGB.js +0 -1
  265. package/build/runtime-chunk-QZ35BPGB.js.br +0 -0
  266. package/build/runtime-chunk-QZ35BPGB.js.gz +0 -0
  267. package/build/runtime-chunk-RAX4YJZF.js +0 -1
  268. package/build/runtime-chunk-RAX4YJZF.js.br +0 -0
  269. package/build/runtime-chunk-RAX4YJZF.js.gz +0 -0
  270. package/build/runtime-chunk-RQ3ZQR4P.js.br +0 -0
  271. package/build/runtime-chunk-RQ3ZQR4P.js.gz +0 -0
  272. package/build/runtime-chunk-SKLNU6XK.js +0 -1
  273. package/build/runtime-chunk-SKLNU6XK.js.br +0 -0
  274. package/build/runtime-chunk-SKLNU6XK.js.gz +0 -0
  275. package/build/runtime-chunk-TDCFE5IE.js.br +0 -0
  276. package/build/runtime-chunk-TDCFE5IE.js.gz +0 -0
  277. package/build/runtime-chunk-VRVV54WH.js.br +0 -0
  278. package/build/runtime-chunk-VRVV54WH.js.gz +0 -0
  279. package/build/runtime-chunk-WSJURWOC.js +0 -1
  280. package/build/runtime-chunk-WSJURWOC.js.br +0 -0
  281. package/build/runtime-chunk-WSJURWOC.js.gz +0 -0
  282. package/build/runtime-chunk-Z5OH244S.js.br +0 -0
  283. package/build/runtime-chunk-Z5OH244S.js.gz +0 -0
  284. package/build/runtime-classicRuntime-AMAXBOXT.js.br +0 -0
  285. package/build/runtime-classicRuntime-AMAXBOXT.js.gz +0 -0
  286. package/build/runtime-cloners-4W3AOAQX.js +0 -1
  287. package/build/runtime-cloners-4W3AOAQX.js.br +0 -1
  288. package/build/runtime-cloners-4W3AOAQX.js.gz +0 -0
  289. package/build/runtime-components-EPAMFKSB.js.br +0 -0
  290. package/build/runtime-components-EPAMFKSB.js.gz +0 -0
  291. package/build/runtime-conditional-3A423CXW.js +0 -1
  292. package/build/runtime-conditional-3A423CXW.js.br +0 -0
  293. package/build/runtime-conditional-3A423CXW.js.gz +0 -0
  294. package/build/runtime-createDestroy-HLHRAAC4.js.br +0 -0
  295. package/build/runtime-createDestroy-HLHRAAC4.js.gz +0 -0
  296. package/build/runtime-dragDrop-K6LWK7FL.js.br +0 -0
  297. package/build/runtime-dragDrop-K6LWK7FL.js.gz +0 -0
  298. package/build/runtime-gameControls-ZJUUKNHM.js +0 -1
  299. package/build/runtime-gameControls-ZJUUKNHM.js.br +0 -0
  300. package/build/runtime-gameControls-ZJUUKNHM.js.gz +0 -0
  301. package/build/runtime-hair-AGUMVL55.js +0 -1
  302. package/build/runtime-hair-AGUMVL55.js.br +0 -3
  303. package/build/runtime-hair-AGUMVL55.js.gz +0 -0
  304. package/build/runtime-mergeStaticGeometries-AOGKOEBX.js +0 -1
  305. package/build/runtime-mergeStaticGeometries-AOGKOEBX.js.br +0 -0
  306. package/build/runtime-mergeStaticGeometries-AOGKOEBX.js.gz +0 -0
  307. package/build/runtime-miscActions-L7BIGLEB.js.br +0 -0
  308. package/build/runtime-miscActions-L7BIGLEB.js.gz +0 -0
  309. package/build/runtime-mouseHover-BI5SRQSQ.js +0 -1
  310. package/build/runtime-mouseHover-BI5SRQSQ.js.br +0 -0
  311. package/build/runtime-mouseHover-BI5SRQSQ.js.gz +0 -0
  312. package/build/runtime-particles-W7YEQWJI.js.br +0 -0
  313. package/build/runtime-particles-W7YEQWJI.js.gz +0 -0
  314. package/build/runtime-paths-CK327WCT.js.br +0 -0
  315. package/build/runtime-paths-CK327WCT.js.gz +0 -0
  316. package/build/runtime-resize-RUUW4IXW.js +0 -1
  317. package/build/runtime-resize-RUUW4IXW.js.br +0 -0
  318. package/build/runtime-resize-RUUW4IXW.js.gz +0 -0
  319. package/build/runtime-sceneTransition-7AG4A4P5.js.br +0 -0
  320. package/build/runtime-sceneTransition-7AG4A4P5.js.gz +0 -0
  321. package/build/runtime-scroll-MNQPPLQL.js.br +0 -0
  322. package/build/runtime-scroll-MNQPPLQL.js.gz +0 -0
  323. package/build/runtime-shapeBlends-IP5LZ63L.js +0 -1
  324. package/build/runtime-shapeBlends-IP5LZ63L.js.br +0 -0
  325. package/build/runtime-shapeBlends-IP5LZ63L.js.gz +0 -0
  326. package/build/runtime-text-5RIKJ4US.js.br +0 -0
  327. package/build/runtime-text-5RIKJ4US.js.gz +0 -0
  328. package/build/runtime-textInputs-YBGYTAMD.js.br +0 -0
  329. package/build/runtime-textInputs-YBGYTAMD.js.gz +0 -0
  330. package/build/runtime-timeline-32GBWMFJ.js +0 -1
  331. package/build/runtime-timeline-32GBWMFJ.js.br +0 -0
  332. package/build/runtime-timeline-32GBWMFJ.js.gz +0 -0
  333. package/build/runtime-tracking-2BXFBQQY.js.br +0 -0
  334. package/build/runtime-tracking-2BXFBQQY.js.gz +0 -0
  335. package/build/runtime-transitions-6PZW2QIW.js.br +0 -0
  336. package/build/runtime-transitions-6PZW2QIW.js.gz +0 -0
  337. package/build/runtime-ui2d-VEQUBXIE.js +0 -1
  338. package/build/runtime-ui2d-VEQUBXIE.js.br +0 -0
  339. package/build/runtime-ui2d-VEQUBXIE.js.gz +0 -0
  340. package/build/runtime-variables-U36KPJ5V.js.br +0 -0
  341. package/build/runtime-variables-U36KPJ5V.js.gz +0 -0
  342. package/build/runtime-vectorShapes-4HPEEN3B.js.br +0 -0
  343. package/build/runtime-vectorShapes-4HPEEN3B.js.gz +0 -0
  344. package/build/runtime-video-TZNR7MEM.js +0 -1
  345. package/build/runtime-video-TZNR7MEM.js.br +0 -0
  346. package/build/runtime-video-TZNR7MEM.js.gz +0 -0
  347. package/build/runtime-webgpu-YNY4OXCZ.js +0 -1
  348. package/build/runtime-webgpu-YNY4OXCZ.js.br +0 -0
  349. package/build/runtime-webgpu-YNY4OXCZ.js.gz +0 -0
@@ -1 +0,0 @@
1
- import{a as e,b as t}from"./runtime-chunk-TDCFE5IE.js";import{c as s,d as o}from"./runtime-chunk-VRVV54WH.js";import{da as r}from"./runtime-chunk-CTHMLYOZ.js";import{h as a,o as i,p as n,q as h,r as d,t as l}from"./runtime-chunk-2Y73BLCY.js";import{Oc as m,bd as p,dd as u,ue as c}from"./runtime-chunk-VGN7YHB7.js";var g=new m,y=new m;function b(e){let t=!1;return e.scene.objects.traverse((e,s)=>{"BooleanGeometry"===s.geometry?.type&&(t=!0)}),t}var f,A=class extends r{constructor(e,t,s){super(e,t),this.data=t,this.meshSetAddresses=[],this.needsTransformForDownstream=!1,this.geometry=new u,this.onAfterRender=(e,t,s,o,r,a)=>{super.onAfterRender(e,t,s,o,r,a),this.recomputeBoolean()},this.geometry.userData.parameters={width:0,height:0,depth:0}}get booleanOp(){return this.data.geometry.operation}get phongAngle(){return this.data.geometry.phongAngle??45}get isLOD(){return this.recomputeBoolean(),!1}updateByPatchedOp(e,t,s){super.updateByPatchedOp(e,t,s),1===e.path.length&&"geometry"===e.path[0]&&0===e.type&&void 0!==e.props.operation&&(this.freeBooleanPointer(),this.resetBBoxNeedsUpdate())}freeBooleanPointer(){super.freeBooleanPointer(),this.geometry.dispose()}recomputeBoolean(s,o=!0){if(-1!==this.booleanMeshSetAddress&&!s)return;for(let e=0;e<this.children.length;e++){let t=this.children[e];t instanceof A&&!0===t.dataPatched.visible&&t.recomputeBoolean(!0===s,o)}this.meshSetAddresses=[];for(let e=0;e<this.children.length;e++){let t=this.children[e];if(t instanceof l&&!0===t.dataPatched.visible&&t.geometry.attributes.position?.count>0&&t.geometry.drawRange.count>0&&0!==t.booleanMeshSetAddress){g.multiplyMatrices(t.hiddenMatrix,t.matrix).multiply(t.pivotMatrix);try{if(-1===t.booleanMeshSetAddress){if((t.geometry.index??t.geometry.getAttribute("position")).count/3<15e5&&(t.booleanMeshSetAddress=i(t.geometry,!0===s,o)),-1===t.booleanMeshSetAddress)return;d(t.booleanMeshSetAddress,g),t.booleanMatrixInvOld.copy(g).invert(),t.booleanWasTransformed=!1}else t instanceof A&&!0===t.needsTransformForDownstream?(d(t.booleanMeshSetAddress,g),t.needsTransformForDownstream=!1):!0===t.booleanWasTransformed&&(d(t.booleanMeshSetAddress,y.multiplyMatrices(g,t.booleanMatrixInvOld)),t.booleanMatrixInvOld.copy(g).invert(),t.booleanWasTransformed=!1)}catch(e){console.error(e),t.booleanMeshSetAddress=0,t.geometry.userData.booleanOperationDidFail=!0;continue}this.meshSetAddresses.push(t.booleanMeshSetAddress),t.geometry.userData.booleanOperationDidFail=!1}}if(0===this.meshSetAddresses.length){if(0!==this.geometry.getAttribute("position")?.array.length){let e=this.geometry;e.dispose(),this.geometry=new u,this.geometry.userData=e.userData,this.geometry.boundingSphere=e.boundingSphere,this.geometry.setAttribute("position",new p([],3))}return void this.geometry.setDrawRange(0,0)}if(!0===s)return h(this.meshSetAddresses,this.booleanOp);let r=this.geometry;r.dispose(),this.geometry=new u,this.geometry.userData=r.userData,this.geometry.boundingSphere=r.boundingSphere;try{this.booleanMeshSetAddress=n(this.meshSetAddresses,this.booleanOp,this.geometry,this.phongAngle)}catch(e){this.booleanMeshSetAddress=0,this.geometry.userData.booleanOperationDidFail=!0,console.error(e)}this.booleanMatrixInvOld.copy(this.matrix).invert(),this.needsTransformForDownstream=!0,e(this),t(this)}dispose(){super.dispose(),this.geometry.dispose()}};(f||(f={})).is=function(e){return a.is(e)&&e instanceof c};var S=(e,t)=>class extends(o(e,t)){updateState_Light(e,t){if(this.updateState_Entity(e,t),void 0!==e.color&&(this.color=t.shared.color(e.color)),void 0!==e.intensity&&(this.intensity=e.intensity*Math.PI),void 0!==e.depth){let t=this.shadow;t.camera.far=e.depth,t.needsUpdate=!0}void 0!==e.shadows&&(this.castShadow=e.shadows)}},M=e=>e instanceof l,v=e=>null!==e&&e instanceof A,D=e=>s.is(e);export{b as a,A as b,f as c,S as d,M as e,v as f,D as g};
Binary file
Binary file
Binary file
Binary file
@@ -1 +0,0 @@
1
- import{a as r}from"./runtime-chunk-RAX4YJZF.js";import"./runtime-chunk-P3254QGK.js";import"./runtime-chunk-E6JCDSXC.js";import"./runtime-chunk-TDCFE5IE.js";import"./runtime-chunk-CTHMLYOZ.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{c as m}from"./runtime-chunk-2Y73BLCY.js";import"./runtime-chunk-QZ35BPGB.js";import"./runtime-chunk-4KZXQGUQ.js";import"./runtime-chunk-Z5OH244S.js";import{a as n}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-OW6T4XFV.js";import"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";m.Cloner=r,n("cloners");
@@ -1 +0,0 @@
1
- W`�ø�۴����n؜�݀�Etu���i�~��k�m��ȩ�Ir��P��AP�# �\�`�<��<^�r�>��F�H���S*���[����K8��E9,.�x� wΤ@F`�u�'�� �n#��1 �!R-X�w0��\n�hVCw�F�n���6O*@�~3���i]n9�TMq�R�Z��Ͳ8~D�O
@@ -1 +0,0 @@
1
- import{a as t,b as i}from"./runtime-chunk-DZNU62CT.js";import{f as a,g as s}from"./runtime-chunk-MM75L5X4.js";import{e as o}from"./runtime-chunk-4KZXQGUQ.js";import{a as n}from"./runtime-chunk-Z5OH244S.js";import{a as e}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-OW6T4XFV.js";import{Ec as c,Fc as r,Oc as h,Pc as d}from"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";var p=new r,f=new r,l=(new h,new r,new c,new r,new d,class{constructor(t,i,s,o,n){this.actionsIn=a(t,t.inActions,s,o,n,i),this.actionsOut=a(t,t.outActions,s,o,n,i)}disconnect(){s(this.actionsIn),s(this.actionsOut)}}),E=class extends l{constructor(t,i,a,s,o,n){super(i,a,s,o,n),this.id=t,this.data=i,this.object=a,this.stage="out",this.objects=[],this.onUpdateMatrixWorld=()=>{for(let t of this.objects)if(!t.visible)return;let t=p.setFromMatrixPosition(this.objects[0].matrixWorld),i=f.setFromMatrixPosition(this.objects[1].matrixWorld),a=t.distanceTo(i)<=this.distance?"in":"out";if(this.stage!==a){this.stage=a;let t="in"===a?this.actionsIn:this.actionsOut;t.Audio.forEach(t=>t.dispatchConditional()),t.Particles.forEach(t=>t.dispatchConditional()),t.Video.forEach(t=>t.dispatchConditional()),t.Link.forEach(t=>t.dispatch()),t.Create.forEach(t=>t.dispatch()),t.Destroy.forEach(t=>t.dispatch()),t.Reset.forEach(t=>t.dispatch()),t.Transition.forEach(t=>{t.object.currentTransitionEvent!==this&&(t.object.currentTransitionEvent=this),t.init()}),t.Transition.forEach(t=>t.play()),t.Animation.forEach(t=>t.play()),t.TimelineAnimation.forEach(t=>t.play()),t.SwitchCamera.forEach(t=>t.play()),t.SceneTransition.forEach(t=>t.dispatch()),t.SetVariable.forEach(t=>t.checkConditions()),t.SetVariable.forEach(t=>t.dispatch()),t.DynamicVariablePlay.forEach(t=>t.dispatch()),t.ClearLocalStorage.forEach(t=>t.dispatch()),t.UserAPI.forEach(t=>t.dispatch())}};let{distance:e,fromObject:c,toObject:r}=i.condition;this.distance=e;for(let t of[c,r]){if(!t)throw new Error("Missing property");let i=s.find(t);if(!i)throw new Error("Missing property");this.objects.push(i)}}connect(){window.setTimeout(()=>{this.objects.forEach(t=>{t.addEventListener("updateMatrixWorld",this.onUpdateMatrixWorld),t.addEventListener("updateMatrix",this.onUpdateMatrixWorld)}),this.onUpdateMatrixWorld()},0)}disconnect(){super.disconnect(),this.stage="out",this.objects.forEach(t=>{t.removeEventListener("updateMatrixWorld",this.onUpdateMatrixWorld),t.removeEventListener("updateMatrix",this.onUpdateMatrixWorld)})}},u=class extends l{constructor(t,i,a,s,o,n){super(i,a,s,o,n),this.id=t,this.data=i,this.object=a,this.onBegin=({target:t,state:i})=>{this.toState!==i&&(this.actionsOut.Audio.forEach(t=>t.dispatchConditional()),this.actionsOut.Particles.forEach(t=>t.dispatchConditional()),this.actionsOut.Video.forEach(t=>t.dispatchConditional()),this.actionsOut.Link.forEach(t=>t.dispatch()),this.actionsOut.Create.forEach(t=>t.dispatch()),this.actionsOut.Destroy.forEach(t=>t.dispatch()),this.actionsOut.Reset.forEach(t=>t.dispatch()),this.actionsIn.Transition.forEach(t=>t.pause()),this.object.currentTransitionEvent=this,this.actionsOut.Transition.forEach(t=>t.play()),this.actionsOut.Animation.forEach(t=>t.play()),this.actionsOut.TimelineAnimation.forEach(t=>t.play()),this.actionsIn.SwitchCamera.forEach(t=>t.pause()),this.actionsOut.SwitchCamera.forEach(t=>t.play()),this.actionsOut.SceneTransition.forEach(t=>t.dispatch()),this.actionsOut.SetVariable.forEach(t=>t.checkConditions()),this.actionsOut.SetVariable.forEach(t=>t.dispatch()),this.actionsOut.DynamicVariablePlay.forEach(t=>t.dispatch()),this.actionsOut.ClearLocalStorage.forEach(t=>t.dispatch()),this.actionsOut.UserAPI.forEach(t=>t.dispatch()))},this.onComplete=({target:t,state:i})=>{this.toState===i&&(this.actionsIn.Audio.forEach(t=>t.dispatchConditional()),this.actionsIn.Particles.forEach(t=>t.dispatchConditional()),this.actionsIn.Video.forEach(t=>t.dispatchConditional()),this.actionsIn.Link.forEach(t=>t.dispatch()),this.actionsIn.Create.forEach(t=>t.dispatch()),this.actionsIn.Destroy.forEach(t=>t.dispatch()),this.actionsIn.Reset.forEach(t=>t.dispatch()),this.actionsOut.Transition.forEach(t=>t.pause()),this.actionsOut.Transition.forEach(t=>t.pause()),this.object.currentTransitionEvent=this,this.actionsIn.Transition.forEach(t=>t.play()),this.actionsIn.Animation.forEach(t=>t.play()),this.actionsIn.TimelineAnimation.forEach(t=>t.play()),this.actionsOut.SwitchCamera.forEach(t=>t.pause()),this.actionsIn.SwitchCamera.forEach(t=>t.play()),this.actionsIn.SceneTransition.forEach(t=>t.dispatch()),this.actionsIn.SetVariable.forEach(t=>t.checkConditions()),this.actionsIn.SetVariable.forEach(t=>t.dispatch()),this.actionsIn.DynamicVariablePlay.forEach(t=>t.dispatch()),this.actionsOut.ClearLocalStorage.forEach(t=>t.dispatch()),this.actionsOut.UserAPI.forEach(t=>t.dispatch()))};let{condition:e}=i;if(!e.object)throw new Error("Missing property");let c=s.find(e.object)??s.scene.find2D(e.object);if(!c)throw new Error("Missing property");if(this.toObject=c,e.state&&!this.toObject.states?.[e.state])throw new Error("Missing property");this.toState=e.state}connect(){o(this.actionsOut).forEach(t=>{this.actionsOut[t]?.length&&this.toObject.addEventListener("beginState",this.onBegin)}),o(this.actionsIn).forEach(t=>{this.actionsIn[t]?.length&&this.toObject.addEventListener("completeState",this.onComplete)})}disconnect(){super.disconnect(),o(this.actionsOut).forEach(t=>{this.actionsIn[t]?.length&&this.toObject.removeEventListener("beginState",this.onBegin)}),o(this.actionsIn).forEach(t=>{this.actionsIn[t]?.length&&this.toObject.removeEventListener("completeState",this.onComplete)})}},m=class extends t{constructor(t,i){super(t),this.eventManager=i,this.eventsPerConditions={Comparison:[],Distance:[],State:[]},this.hasVideoAction=!1}connect(){super.connect();let{page:t,sharedAssets:i}=this.eventContext;t.traverseEntity(a=>{if(a.data?.events.length)for(let{id:s,data:o}of a.data.events)if(!o.disabled&&"Conditional"===o.type)try{let n;"Comparison"===o.condition.type||("Distance"===o.condition.type?n=new E(s,o,a,t,i,this.eventManager):"State"===o.condition.type&&(n=new u(s,o,a,t,i,this.eventManager))),n&&(this.eventsPerConditions[o.condition.type].push(n),(n.actionsIn.Video.length||n.actionsOut.Video.length)&&(this.hasVideoAction=!0))}catch(t){n&&console.error(t)}}),Object.values(this.eventsPerConditions).forEach(t=>t.forEach(t=>t.connect()))}disconnect(){super.disconnect(),Object.values(this.eventsPerConditions).forEach(t=>t.forEach(t=>t.disconnect()))}};i("Conditional",({eventContext:t,eventManager:i})=>new m(t,i)),e("conditional");
@@ -1 +0,0 @@
1
- import{a as t}from"./runtime-chunk-RAX4YJZF.js";import"./runtime-chunk-P3254QGK.js";import{c as e,d as i,f as o,g as s,i as n,k as r}from"./runtime-chunk-HL3PBPHE.js";import"./runtime-chunk-N2ZRGNPR.js";import{a}from"./runtime-chunk-VAVYZ35B.js";import{e as h,f as l,g as c}from"./runtime-chunk-FQNSP44B.js";import{a as d}from"./runtime-chunk-RQ3ZQR4P.js";import"./runtime-chunk-LSURXI4Y.js";import"./runtime-chunk-E6JCDSXC.js";import"./runtime-chunk-TDCFE5IE.js";import"./runtime-chunk-BJVCOW72.js";import"./runtime-chunk-VRVV54WH.js";import{$ as m,G as p,N as u,a as y,p as g}from"./runtime-chunk-CTHMLYOZ.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{f,g as v}from"./runtime-chunk-MM75L5X4.js";import{h as b}from"./runtime-chunk-2Y73BLCY.js";import"./runtime-chunk-QZ35BPGB.js";import"./runtime-chunk-4KZXQGUQ.js";import{a as x}from"./runtime-chunk-Z5OH244S.js";import{a as w}from"./runtime-chunk-TZCHGFVF.js";import{Ka as P,La as M,ea as E,g as S,ua as j}from"./runtime-chunk-OW6T4XFV.js";import{Bc as T,Cc as A,Dc as k,Ec as D,Fc as C,Oc as O,Pc as z,Re as R,Xc as F,Zc as _,dd as X,ld as W}from"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";var N=(t,e)=>{let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)},V=t=>t*(Math.PI/180),L=new Map,I=(t,e,i)=>{let o,s=e.split(/[ ,]+/g);for(let e=0;e<s.length;e+=1)o=s[e],t.addEventListener?t.addEventListener(o,i,!1):t.attachEvent&&t.attachEvent(o,i)},Q=(t,e,i)=>{let o,s=e.split(/[ ,]+/g);for(let e=0;e<s.length;e+=1)o=s[e],t.removeEventListener?t.removeEventListener(o,i):t.detachEvent&&t.detachEvent(o,i)},B=t=>(t.preventDefault(),t.type.match(/^touch/)?t.changedTouches:t),Y=()=>{if(!(typeof window>"u"))return{x:void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,y:void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop}},Z=(t,e)=>{e.top||e.right||e.bottom||e.left?(t.style.top=e.top,t.style.right=e.right,t.style.bottom=e.bottom,t.style.left=e.left):(t.style.left=e.x+"px",t.style.top=e.y+"px")},G=(t,e,i)=>{let o=q(t);for(let t in o)if(Object.prototype.hasOwnProperty.call(o,t))if("string"==typeof e)o[t]=e+" "+i;else{let s="";for(let t=0,o=e.length;t<o;t+=1)s+=e[t]+" "+i+", ";o[t]=s.slice(0,-2)}return o},q=t=>{let e={};return e[t]="",["webkit","Moz","o"].forEach(function(i){e[i+t.charAt(0).toUpperCase()+t.slice(1)]=""}),e},H=(t,e)=>{for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},U=(t,e)=>{if(t.length)for(let i=0,o=t.length;i<o;i+=1)e(t[i]);else e(t)};typeof window<"u"&&(K="ontouchstart"in window,J=!!window.PointerEvent,$=!!window.MSPointerEvent);var K,J,$,tt,et={start:"mousedown",move:"mousemove",end:"mouseup"},it={};function ot(){}J?tt={start:"pointerdown",move:"pointermove",end:"pointerup, pointercancel"}:$?tt={start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:K?(tt={start:"touchstart",move:"touchmove",end:"touchend, touchcancel"},it=et):tt=et,ot.prototype.on=function(t,e){var i,o=this,s=t.split(/[ ,]+/g);o._handlers_=o._handlers_||{};for(var n=0;n<s.length;n+=1)i=s[n],o._handlers_[i]=o._handlers_[i]||[],o._handlers_[i].push(e);return o},ot.prototype.off=function(t,e){var i=this;return i._handlers_=i._handlers_||{},void 0===t?i._handlers_={}:void 0===e?i._handlers_[t]=null:i._handlers_[t]&&i._handlers_[t].indexOf(e)>=0&&i._handlers_[t].splice(i._handlers_[t].indexOf(e),1),i},ot.prototype.trigger=function(t,e){var i,o=this,s=t.split(/[ ,]+/g);o._handlers_=o._handlers_||{};for(var n=0;n<s.length;n+=1)i=s[n],o._handlers_[i]&&o._handlers_[i].length&&o._handlers_[i].forEach(function(t){t.call(o,{type:i,target:o},e)})},ot.prototype.config=function(t){var e=this;e.options=e.defaults||{},t&&(e.options=((t,e)=>{let i={};for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&Object.prototype.hasOwnProperty.call(e,o)?i[o]=e[o]:Object.prototype.hasOwnProperty.call(t,o)&&(i[o]=t[o]);return i})(e.options,t))},ot.prototype.bindEvt=function(t,e){var i=this;return i._domHandlers_=i._domHandlers_||{},i._domHandlers_[e]=function(){"function"==typeof i["on"+e]?i["on"+e].apply(i,arguments):console.warn('[WARNING] : Missing "on'+e+'" handler.')},I(t,tt[e],i._domHandlers_[e]),it[e]&&I(t,it[e],i._domHandlers_[e]),i},ot.prototype.unbindEvt=function(t,e){var i=this;return i._domHandlers_=i._domHandlers_||{},Q(t,tt[e],i._domHandlers_[e]),it[e]&&Q(t,it[e],i._domHandlers_[e]),delete i._domHandlers_[e],this};var st=ot;function nt(t,e){return this.identifier=e.identifier,this.position=e.position,this.frontPosition=e.frontPosition,this.collection=t,this.defaults={size:100,threshold:.1,color:"white",fadeTime:250,dataOnly:!1,restJoystick:!0,restOpacity:1,mode:"dynamic",zone:document.body,lockX:!1,lockY:!1,shape:"circle"},this.config(e),"dynamic"===this.options.mode&&(this.options.restOpacity=0),this.id=nt.id,nt.id+=1,this.buildEl().stylize(),this.instance={el:this.ui.el,on:this.on.bind(this),off:this.off.bind(this),show:this.show.bind(this),hide:this.hide.bind(this),add:this.addToDom.bind(this),remove:this.removeFromDom.bind(this),destroy:this.destroy.bind(this),setPosition:this.setPosition.bind(this),resetDirection:this.resetDirection.bind(this),computeDirection:this.computeDirection.bind(this),trigger:this.trigger.bind(this),position:this.position,frontPosition:this.frontPosition,ui:this.ui,identifier:this.identifier,id:this.id,options:this.options},this.instance}nt.prototype=new st,nt.constructor=nt,nt.id=0,nt.prototype.buildEl=function(t){return this.ui={},this.options.dataOnly||(this.ui.el=document.createElement("div"),this.ui.back=document.createElement("div"),this.ui.front=document.createElement("div"),this.ui.el.className="nipple collection_"+this.collection.id,this.ui.back.className="back",this.ui.front.className="front",this.ui.el.setAttribute("id","nipple_"+this.collection.id+"_"+this.id),this.ui.el.appendChild(this.ui.back),this.ui.el.appendChild(this.ui.front)),this},nt.prototype.stylize=function(){if(this.options.dataOnly)return this;var t=this.options.fadeTime+"ms",e=(()=>{let t=q("borderRadius");for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(t[e]="50%");return t})(),i=G("transition","opacity",t),o={};return o.el={position:"absolute",opacity:this.options.restOpacity,display:"block",zIndex:999},o.back={position:"absolute",display:"block",width:this.options.size+"px",height:this.options.size+"px",marginLeft:-this.options.size/2+"px",marginTop:-this.options.size/2+"px",background:"rgba(255, 255, 255, .4)",border:"solid 2px rgba(0, 0, 0, .1)"},o.front={width:this.options.size/2+"px",height:this.options.size/2+"px",position:"absolute",display:"block",marginLeft:-this.options.size/4+"px",marginTop:-this.options.size/4+"px",background:"rgba(255, 255, 255, .8)",border:"solid 2px rgba(0, 0, 0, .1)"},H(o.el,i),"circle"===this.options.shape&&H(o.back,e),H(o.front,e),this.applyStyles(o),this},nt.prototype.applyStyles=function(t){for(var e in this.ui)if(Object.prototype.hasOwnProperty.call(this.ui,e))for(var i in t[e])this.ui[e].style[i]=t[e][i];return this},nt.prototype.addToDom=function(){return this.options.dataOnly||document.body.contains(this.ui.el)||this.options.zone.appendChild(this.ui.el),this},nt.prototype.removeFromDom=function(){return this.options.dataOnly||!document.body.contains(this.ui.el)||this.options.zone.removeChild(this.ui.el),this},nt.prototype.destroy=function(){clearTimeout(this.removeTimeout),clearTimeout(this.showTimeout),clearTimeout(this.restTimeout),this.trigger("destroyed",this.instance),this.removeFromDom(),this.off(),this.ui=null,this.instance=null,this.collection=null,this.options=null},nt.prototype.show=function(t){var e=this;return e.options.dataOnly||(clearTimeout(e.removeTimeout),clearTimeout(e.showTimeout),clearTimeout(e.restTimeout),e.addToDom(),e.restCallback(),setTimeout(function(){e.ui.el.style.opacity=1},0),e.showTimeout=setTimeout(function(){e.trigger("shown",e.instance),"function"==typeof t&&t.call(this)},e.options.fadeTime)),e},nt.prototype.hide=function(t){var e=this;if(e.options.dataOnly)return e;if(e.ui.el.style.opacity=e.options.restOpacity,clearTimeout(e.removeTimeout),clearTimeout(e.showTimeout),clearTimeout(e.restTimeout),e.removeTimeout=setTimeout(function(){var i="dynamic"===e.options.mode?"none":"block";e.ui.el.style.display=i,"function"==typeof t&&t.call(e),e.trigger("hidden",e.instance)},e.options.fadeTime),e.options.restJoystick){let i=e.options.restJoystick,o={};o.x=!0===i||!1!==i.x?0:e.instance.frontPosition.x,o.y=!0===i||!1!==i.y?0:e.instance.frontPosition.y,e.setPosition(t,o)}return e},nt.prototype.setPosition=function(t,e){var i=this;i.frontPosition={x:e.x,y:e.y};var o=i.options.fadeTime+"ms",s={};s.front=G("transition",["top","left"],o);var n={front:{}};n.front={left:i.frontPosition.x+"px",top:i.frontPosition.y+"px"},i.applyStyles(s),i.applyStyles(n),i.restTimeout=setTimeout(function(){"function"==typeof t&&t.call(i),i.restCallback()},i.options.fadeTime)},nt.prototype.restCallback=function(){var t=this,e={};e.front=G("transition","none",""),t.applyStyles(e),t.trigger("rested",t.instance)},nt.prototype.resetDirection=function(){this.direction={x:!1,y:!1,angle:!1}},nt.prototype.computeDirection=function(t){var e,i,o,s=t.angle.radian,n=Math.PI/4,r=Math.PI/2;if(s>n&&s<3*n&&!t.lockX?e="up":s>-n&&s<=n&&!t.lockY?e="left":s>3*-n&&s<=-n&&!t.lockX?e="down":t.lockY||(e="right"),t.lockY||(i=s>-r&&s<r?"left":"right"),t.lockX||(o=s>0?"up":"down"),t.force>this.options.threshold){var a,h={};for(a in this.direction)Object.prototype.hasOwnProperty.call(this.direction,a)&&(h[a]=this.direction[a]);var l={};for(a in this.direction={x:i,y:o,angle:e},t.direction=this.direction,h)h[a]===this.direction[a]&&(l[a]=!0);if(l.x&&l.y&&l.angle)return t;(!l.x||!l.y)&&this.trigger("plain",t),l.x||this.trigger("plain:"+i,t),l.y||this.trigger("plain:"+o,t),l.angle||this.trigger("dir dir:"+e,t)}else this.resetDirection();return t};var rt=nt;function at(t,e){var i=this;i.nipples=[],i.idles=[],i.actives=[],i.ids=[],i.pressureIntervals={},i.manager=t,i.id=at.id,at.id+=1,i.defaults={zone:document.body,multitouch:!1,maxNumberOfNipples:10,mode:"dynamic",position:{top:0,left:0},catchDistance:200,size:100,threshold:.1,color:"white",fadeTime:250,dataOnly:!1,restJoystick:!0,restOpacity:1,lockX:!1,lockY:!1,shape:"circle",dynamicPage:!1,follow:!1},i.config(e),("static"===i.options.mode||"semi"===i.options.mode)&&(i.options.multitouch=!1),i.options.multitouch||(i.options.maxNumberOfNipples=1);let o=getComputedStyle(i.options.zone.parentElement);return o&&"flex"===o.display&&(i.parentIsFlex=!0),i.updateBox(),i.prepareNipples(),i.bindings(),i.begin(),i.nipples}at.prototype=new st,at.constructor=at,at.id=0,at.prototype.prepareNipples=function(){var t=this,e=t.nipples;e.on=t.on.bind(t),e.off=t.off.bind(t),e.options=t.options,e.destroy=t.destroy.bind(t),e.ids=t.ids,e.id=t.id,e.processOnMove=t.processOnMove.bind(t),e.processOnEnd=t.processOnEnd.bind(t),e.get=function(t){if(void 0===t)return e[0];for(var i=0,o=e.length;i<o;i+=1)if(e[i].identifier===t)return e[i];return!1}},at.prototype.bindings=function(){var t=this;t.bindEvt(t.options.zone,"start"),t.options.zone.style.touchAction="none",t.options.zone.style.msTouchAction="none"},at.prototype.begin=function(){var t=this,e=t.options;if("static"===e.mode){var i=t.createNipple(e.position,t.manager.getIdentifier());i.add(),t.idles.push(i)}},at.prototype.createNipple=function(t,e){var i=this,o=i.manager.scroll,s={},n=i.options,r=i.parentIsFlex?o.x:o.x+i.box.left,a=i.parentIsFlex?o.y:o.y+i.box.top;if(t.x&&t.y)s={x:t.x-r,y:t.y-a};else if(t.top||t.right||t.bottom||t.left){var h=document.createElement("DIV");h.style.display="hidden",h.style.top=t.top,h.style.right=t.right,h.style.bottom=t.bottom,h.style.left=t.left,h.style.position="absolute",n.zone.appendChild(h);var l=h.getBoundingClientRect();n.zone.removeChild(h),s=t,t={x:l.left+o.x,y:l.top+o.y}}var c=new rt(i,{color:n.color,size:n.size,threshold:n.threshold,fadeTime:n.fadeTime,dataOnly:n.dataOnly,restJoystick:n.restJoystick,restOpacity:n.restOpacity,mode:n.mode,identifier:e,position:t,zone:n.zone,frontPosition:{x:0,y:0},shape:n.shape});return n.dataOnly||(Z(c.ui.el,s),Z(c.ui.front,c.frontPosition)),i.nipples.push(c),i.trigger("added "+c.identifier+":added",c),i.manager.trigger("added "+c.identifier+":added",c),i.bindNipple(c),c},at.prototype.updateBox=function(){this.box=this.options.zone.getBoundingClientRect()},at.prototype.bindNipple=function(t){var e,i=this,o=function(t,o){e=t.type+" "+o.id+":"+t.type,i.trigger(e,o)};t.on("destroyed",i.onDestroyed.bind(i)),t.on("shown hidden rested dir plain",o),t.on("dir:up dir:right dir:down dir:left",o),t.on("plain:up plain:right plain:down plain:left",o)},at.prototype.pressureFn=function(t,e,i){var o=this,s=0;clearInterval(o.pressureIntervals[i]),o.pressureIntervals[i]=setInterval(function(){var i=t.force||t.pressure||t.webkitForce||0;i!==s&&(e.trigger("pressure",i),o.trigger("pressure "+e.identifier+":pressure",i),s=i)}.bind(o),100)},at.prototype.onstart=function(t){var e=this,i=e.options,o=t;return t=B(t),e.updateBox(),U(t,function(s){e.actives.length<i.maxNumberOfNipples?e.processOnStart(s):o.type.match(/^touch/)&&(Object.keys(e.manager.ids).forEach(function(i){if(Object.values(o.touches).findIndex(function(t){return t.identifier===i})<0){var s=[t[0]];s.identifier=i,e.processOnEnd(s)}}),e.actives.length<i.maxNumberOfNipples&&e.processOnStart(s))}),e.manager.bindDocument(),!1},at.prototype.processOnStart=function(t){var e,i=this,o=i.options,s=i.manager.getIdentifier(t),n=t.force||t.pressure||t.webkitForce||0,r={x:t.pageX,y:t.pageY},a=i.getOrCreate(s,r);a.identifier!==s&&i.manager.removeIdentifier(a.identifier),a.identifier=s;var h=function(e){e.trigger("start",e),i.trigger("start "+e.id+":start",e),e.show(),n>0&&i.pressureFn(t,e,e.identifier),i.processOnMove(t)};if((e=i.idles.indexOf(a))>=0&&i.idles.splice(e,1),i.actives.push(a),i.ids.push(a.identifier),"semi"!==o.mode)h(a);else{if(!(N(r,a.position)<=o.catchDistance))return a.destroy(),void i.processOnStart(t);h(a)}return a},at.prototype.getOrCreate=function(t,e){var i,o=this,s=o.options;return/(semi|static)/.test(s.mode)?(i=o.idles[0])?(o.idles.splice(0,1),i):"semi"===s.mode?o.createNipple(e,t):(console.warn("Coudln't find the needed nipple."),!1):i=o.createNipple(e,t)},at.prototype.processOnMove=function(t){var e=this,i=e.options,o=e.manager.getIdentifier(t),s=e.nipples.get(o),n=e.manager.scroll;if((t=>isNaN(t.buttons)?0!==t.pressure:0!==t.buttons)(t)){if(!s)return console.error("Found zombie joystick with ID "+o),void e.manager.removeIdentifier(o);if(i.dynamicPage){var r=s.el.getBoundingClientRect();s.position={x:n.x+r.left,y:n.y+r.top}}s.identifier=o;var a=s.options.size/2,h={x:t.pageX,y:t.pageY};i.lockX&&(h.y=s.position.y),i.lockY&&(h.x=s.position.x);var l,c,d=N(h,s.position),m=((t,e)=>{let i=e.x-t.x,o=e.y-t.y;return(t=>t*(180/Math.PI))(Math.atan2(o,i))})(h,s.position),p=V(m),u=d/a,y={distance:d,position:h};if("circle"===s.options.shape?(l=Math.min(d,a),c=((t,e,i)=>{let o={x:0,y:0};return i=V(i),o.x=t.x-e*Math.cos(i),o.y=t.y-e*Math.sin(i),o})(s.position,l,m)):(c=((t,e,i)=>({x:Math.min(Math.max(t.x,e.x-i),e.x+i),y:Math.min(Math.max(t.y,e.y-i),e.y+i)}))(h,s.position,a),l=N(c,s.position)),i.follow){if(d>a){let t=h.x-c.x,i=h.y-c.y;s.position.x+=t,s.position.y+=i,s.el.style.top=s.position.y-(e.box.top+n.y)+"px",s.el.style.left=s.position.x-(e.box.left+n.x)+"px",d=N(h,s.position)}}else h=c,d=l;var g=h.x-s.position.x,f=h.y-s.position.y;s.frontPosition={x:g,y:f},i.dataOnly||Z(s.ui.front,s.frontPosition);var v={identifier:s.identifier,position:h,force:u,pressure:t.force||t.pressure||t.webkitForce||0,distance:d,angle:{radian:p,degree:m},vector:{x:g/a,y:-f/a},raw:y,instance:s,lockX:i.lockX,lockY:i.lockY};(v=s.computeDirection(v)).angle={radian:V(180-m),degree:180-m},s.trigger("move",v),e.trigger("move "+s.id+":move",v)}else this.processOnEnd(t)},at.prototype.processOnEnd=function(t){var e=this,i=e.options,o=e.manager.getIdentifier(t),s=e.nipples.get(o),n=e.manager.removeIdentifier(s.identifier);!s||(i.dataOnly||s.hide(function(){"dynamic"===i.mode&&(s.trigger("removed",s),e.trigger("removed "+s.id+":removed",s),e.manager.trigger("removed "+s.id+":removed",s),s.destroy())}),clearInterval(e.pressureIntervals[s.identifier]),s.resetDirection(),s.trigger("end",s),e.trigger("end "+s.id+":end",s),e.ids.indexOf(s.identifier)>=0&&e.ids.splice(e.ids.indexOf(s.identifier),1),e.actives.indexOf(s)>=0&&e.actives.splice(e.actives.indexOf(s),1),/(semi|static)/.test(i.mode)?e.idles.push(s):e.nipples.indexOf(s)>=0&&e.nipples.splice(e.nipples.indexOf(s),1),e.manager.unbindDocument(),/(semi|static)/.test(i.mode)&&(e.manager.ids[n.id]=n.identifier))},at.prototype.onDestroyed=function(t,e){var i=this;i.nipples.indexOf(e)>=0&&i.nipples.splice(i.nipples.indexOf(e),1),i.actives.indexOf(e)>=0&&i.actives.splice(i.actives.indexOf(e),1),i.idles.indexOf(e)>=0&&i.idles.splice(i.idles.indexOf(e),1),i.ids.indexOf(e.identifier)>=0&&i.ids.splice(i.ids.indexOf(e.identifier),1),i.manager.removeIdentifier(e.identifier),i.manager.unbindDocument()},at.prototype.destroy=function(){var t=this;for(var e in t.unbindEvt(t.options.zone,"start"),t.nipples.forEach(function(t){t.destroy()}),t.pressureIntervals)Object.prototype.hasOwnProperty.call(t.pressureIntervals,e)&&clearInterval(t.pressureIntervals[e]);t.trigger("destroyed",t.nipples),t.manager.unbindDocument(),t.off(),t.pressureIntervals={},t.nipples=[],t.idles=[],t.actives=[],t.ids=[],t.manager=null};var ht=at;function lt(t){var e=this;e.ids={},e.index=0,e.collections=[],e.scroll=Y(),e._windowBound=!1,e.config(t),e.prepareCollections();var i=function(){var t;e.collections.forEach(function(i){i.forEach(function(i){t=i.el.getBoundingClientRect(),i.position={x:e.scroll.x+t.left,y:e.scroll.y+t.top}})})};return e._onResize=function(){(t=>{L.has(t)&&clearTimeout(L.get(t)),L.set(t,setTimeout(function(){L.delete(t),t()},100))})(i)},e._onScroll=function(){e.scroll=Y()},e.collections}lt.prototype=new st,lt.constructor=lt,lt.prototype.prepareCollections=function(){var t=this;t.collections.create=t.create.bind(t),t.collections.on=t.on.bind(t),t.collections.off=t.off.bind(t),t.collections.destroy=t.destroy.bind(t),t.collections.get=function(e){var i;return t.collections.every(function(t){return!(i=t.get(e))}),i}},lt.prototype.create=function(t){return this.createCollection(t)},lt.prototype.bindWindowEvents=function(){var t=this;t._windowBound||typeof window>"u"||(t._windowBound=!0,I(window,"resize",t._onResize),I(window,"scroll",t._onScroll))},lt.prototype.unbindWindowEvents=function(){var t=this;!t._windowBound||typeof window>"u"||(t._windowBound=!1,Q(window,"resize",t._onResize),Q(window,"scroll",t._onScroll))},lt.prototype.createCollection=function(t){var e=this,i=new ht(e,t);return e.bindCollection(i),e.collections.push(i),e.bindWindowEvents(),i},lt.prototype.bindCollection=function(t){var e,i=this,o=function(t,o){e=t.type+" "+o.id+":"+t.type,i.trigger(e,o)};t.on("destroyed",i.onDestroyed.bind(i)),t.on("shown hidden rested dir plain",o),t.on("dir:up dir:right dir:down dir:left",o),t.on("plain:up plain:right plain:down plain:left",o)},lt.prototype.bindDocument=function(){var t=this;t.binded||(t.bindEvt(document,"move").bindEvt(document,"end"),t.binded=!0)},lt.prototype.unbindDocument=function(t){var e=this;(!Object.keys(e.ids).length||!0===t)&&(e.unbindEvt(document,"move").unbindEvt(document,"end"),e.binded=!1)},lt.prototype.getIdentifier=function(t){var e;return t?void 0===(e=void 0===t.identifier?t.pointerId:t.identifier)&&(e=this.latest||0):e=this.index,void 0===this.ids[e]&&(this.ids[e]=this.index,this.index+=1),this.latest=e,this.ids[e]},lt.prototype.removeIdentifier=function(t){var e={};for(var i in this.ids)if(this.ids[i]===t){e.id=i,e.identifier=this.ids[i],delete this.ids[i];break}return e},lt.prototype.onmove=function(t){return this.onAny("move",t),!1},lt.prototype.onend=function(t){return this.onAny("end",t),!1},lt.prototype.oncancel=function(t){return this.onAny("end",t),!1},lt.prototype.onAny=function(t,e){var i,o=this,s="processOn"+t.charAt(0).toUpperCase()+t.slice(1);e=B(e);var n=function(t,e,i){i.ids.indexOf(e)>=0&&(i[s](t),t._found_=!0)};return U(e,function(t){i=o.getIdentifier(t),U(o.collections,n.bind(null,t,i)),t._found_||o.removeIdentifier(i)}),!1},lt.prototype.destroy=function(){var t=this;t.unbindDocument(!0),t.unbindWindowEvents(),t.ids={},t.index=0,t.collections.forEach(function(t){t.destroy()}),t.collections=[],t.off()},lt.prototype.onDestroyed=function(t,e){var i=this;if(i.collections.indexOf(e)<0)return!1;i.collections.splice(i.collections.indexOf(e),1),0===i.collections.length&&i.unbindWindowEvents()};var ct=lt,dt=null;function mt(){return dt||(dt=new ct),dt}var pt={create:function(t){return mt().create(t)},destroy:function(){dt&&(dt.destroy(),dt=null)},get factory(){return mt()}},ut=.02,yt=new C,gt=new C,ft=new C,vt=new C,bt=new C,xt=new C,wt=new O,Pt=new O,Mt=new O,Et=new D,St=new D,jt=new z(0,0,0,"YXZ"),Tt=new C(1,0,0),At=new C(0,1,0),kt=new C(0,0,1),Dt=new C(1,1,1),Ct=[],Ot=t=>Ct[t]??(Ct[t]=new C),zt=new C,Rt=new C,Ft=new C,_t=new C,Xt=new D,Wt=new C,Nt=new D,Vt=new R,Lt=new F,It={type:"requestRender"},Qt={type:"updateMatrix"},Bt=class extends T{constructor(t,i,o,s,n,r,a,m,p){super(),this.object=t,this.domElement=i,this.data=o,this.gloabalPhysics=s,this.controlsManager=n,this.cameraFollow=r,this.camera=a,this.page=m,this.sharedAssets=p,this.enableDamping=!0,this.hiddenMatrix0=new O,this.target0=new C,this.zoom0=1,this.rotForce=1,this.moveForce=1,this.pixelsPerMeter=e,this.euler0=new z(0,0,0,"YXZ"),this.position0Cam=new C,this.quat0Cam=new D,this.scale0Cam=new C,this.hiddenMatrix0Cam=new O,this.threshEndTranslate=.01,this.threshEndRotate=1e-8,this.threshEndRotVel=.005,this.collider={type:"capsule",radius:40,segment:new R(new C(0,-40,0),new C(0,40,0)),matrix:new O,position:new C,rotation:new D},this.euler=new z(0,0,0,"YXZ"),this.eulerDelta=new C,this.lastPosition=new C,this.lastCameraQuaternion=new D,this.lastCameraPosition=new C,this.PI_2=Math.PI/2,this.prevMouse=new k,this.velocityTarget=new C,this.velocity=new C,this.directionXZ=new C,this.rotVelocityStick=new C,this.rotVelocityTarget=new C,this.rotVelocity=new C,this.rotDirection=new C,this.nonColliderRotOffset=new O,this.nonColliderPosOffset=new O,this.firstPointerId=-1,this.rot=new C,this.path=[],this.movementState={moveNegZ:0,movePosZ:0,moveNegX:0,movePosX:0,moveNegY:0,movePosY:0,rotPosX:0,rotNegX:0,rotPosY:0,rotNegY:0,jump:0,run:0},this.onObject=!1,this.actionState={},this.keyAssignments=[["moveNegZ","W"],["moveNegX","A"],["movePosZ","S"],["movePosX","D"],["rotPosX","ArrowUp"],["rotPosY","ArrowLeft"],["rotNegX","ArrowDown"],["rotNegY","ArrowRight"],["jump"," "]],this.collisionEnabled=!0,this.offsetMatrix=new O,this.objectToTarget=new C,this.objectToTarget0=new C,this.objectToCamXZ=new C,this.objectToCamXZ0=new C,this.targetToCamera=new C,this.targetToCamera0=new C,this.cameraPolarAxis0=new C,this.targetPos=new C,this.targetQuat=new D,this.lerpFactorPos=(new C).setScalar(.3),this.lerpFactorPosStart=.3,this.lerpFactorPosEnd=.3,this.lerpFactorRotStart=.3,this.lerpFactorRotEnd=.3,this.lerpFactorPosCamera=.3,this.lerpFactorRotCamera=.3,this.objXZQuat=new D,this.objXZQuatInv=new D,this.objXZRotMat=new O,this.isFirstPerson=!1,this.didHit=!1,this.groundVelocity=new C,this.pushedVelocity=new C,this.groundYRotation=0,this.objectRealQuat=new D,this.colliderWorldQuat=new D,this.groundNormal=new C,this.groundTilt=new D,this.groundTiltInv=new D,this.lastHitObj=null,this.isFirstFrame=!0,this.rotationAccumWhenOrientWithCamera=0,this.navMeshPathDest=null,this.position=new C,this.quaternion=new D,this.scale=new C,this.initialAction=!0,this.onPointerDown=t=>{!(t.target===this.domElement||t.target instanceof HTMLElement&&"SPLINE-VIEWER"===t.target.tagName&&t.target.shadowRoot?.contains(this.domElement))||-1!==this.firstPointerId||(this.firstPointerId=t.pointerId,this.domElement.ownerDocument.addEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this.onPointerUp),"keys"!==this.rotBy&&!h&&!l&&this.domElement.requestPointerLock(),this.prevMouse.set(t.clientX,t.clientY))},this.onPointerUp=t=>{this.firstPointerId=-1,this.domElement.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this.onPointerUp),"mouse"===t.pointerType&&this.domElement.ownerDocument.exitPointerLock()},this.onPointerMove=t=>{if(t.pointerId!==this.firstPointerId)return;let e=t.clientX-this.prevMouse.x,i=t.clientY-this.prevMouse.y;this.prevMouse.set(t.clientX,t.clientY),"mouse"===t.pointerType&&"keys"!==this.rotBy&&(l&&c<15.5&&!h?(this.eulerDelta.y=-e*this.mouseOrbitSensitivity,this.eulerDelta.x=-i*this.mouseOrbitSensitivity):(this.eulerDelta.y=-t.movementX*this.mouseOrbitSensitivity,this.eulerDelta.x=-t.movementY*this.mouseOrbitSensitivity)),"mouse"!==t.pointerType&&"drag"===this.rotByTouch&&(this.eulerDelta.y=-e*this.mouseOrbitSensitivity*5,this.eulerDelta.x=-i*this.mouseOrbitSensitivity*5),this.controlsManager.requestRender()},this.onPointerlockChange=t=>{this.domElement.ownerDocument.pointerLockElement===this.domElement?Bt.isLocked=!0:Bt.isLocked=!1},this.onPointerlockError=()=>{console.error("SPE.GameControls: Unable to use Pointer Lock API")},this.handleVisibilityChange=()=>{if(document?.hidden)for(let t in this.movementState)this.movementState[t]=0},this.onKeyDown=t=>{!(t.target instanceof HTMLInputElement)&&("ArrowLeft"===t.code||"ArrowUp"===t.code||"ArrowRight"===t.code||"ArrowDown"===t.code||"Space"===t.code)&&t.preventDefault();for(let e of this.keyAssignments)if(t.key.toUpperCase()===e[1]||t.key===e[1]){this.movementState[e[0]]=1;break}this.controlsManager.requestRender()},this.onKeyUp=t=>{for(let e of this.keyAssignments)if(t.key.toUpperCase()===e[1]||t.key===e[1]||t.code.slice(3,t.code.length).toUpperCase()===e[1]){this.movementState[e[0]]=0;break}},this.copyVRGamePadValues=(t,e)=>{for(let i=2;i<4;i++){let o=t.axes[i];0===e?2===i?this.movementState.movePosX=o:this.movementState.movePosZ=o:(t.buttons[3].pressed?this.movementState.jump=1:this.movementState.jump=0,2===i?this.movementState.rotPosY=o:"fly"===this.moveMode&&(this.movementState.moveNegY=o))}},this.sharedGameControlGlobals=n.sharedGameControlGlobals,t===a&&(this.isFirstPerson=!0),this.hiddenMatrix0.copy(this.object.hiddenMatrix),this.object.parent?this.object.hiddenMatrix.copy(this.object.parent.matrixWorld).invert():this.object.hiddenMatrix.identity(),this.object.matrix.copy(this.object.matrixWorld),this.object.matrix.decompose(this.position,this.quaternion,this.scale),this.euler0.setFromQuaternion(this.quaternion,"YXZ");let y=this.euler0.clone(),f=y.y;if(this.objectRealQuat.copy(this.quaternion),y.y=0,this.quaternion.setFromEuler(y),this.objXZQuat.copy(this.quaternion),this.objXZQuatInv.copy(this.objXZQuat).invert(),this.objXZRotMat.makeRotationFromQuaternion(this.quaternion),y.set(0,f,0),this.quaternion.setFromEuler(y),this.rot.setFromEuler(y),this.object.matrixAutoUpdate=!1,(this.isFirstPerson||!0===this.cameraFollow)&&(this.target0.copy(this.camera.getTarget()),this.zoom0=this.camera.zoom),!0===this.cameraFollow){this.position0Cam.copy(this.camera.position),this.quat0Cam.copy(this.camera.quaternion),this.scale0Cam.copy(this.camera.scale),this.hiddenMatrix0Cam.copy(this.camera.hiddenMatrix),this.camera.parent?(this.camera.hiddenMatrix.copy(this.camera?.parent.matrixWorld),this.camera.matrix.copy(this.camera.matrixWorld)):this.camera.hiddenMatrix.identity(),this.camera.matrix.copy(this.camera.matrixWorld),this.camera.matrix.decompose(this.camera.position,this.camera.quaternion,this.camera.scale),this.camera.matrixAutoUpdate=!1,this.offsetMatrix.copy(this.object.matrix).invert().multiply(this.camera.matrix);let t,e=new C(0,0,-1).applyQuaternion(this.camera.quaternion),i=(new C).subVectors(this.position,this.camera.position);this.objectToCamXZ.copy(i),this.objectToCamXZ.y=0,this.objectToCamXZ0.copy(this.objectToCamXZ),Math.abs(e.y)<1e-6?(i.y=0,e.y=0,t=i.projectOnVector(e)):t=i.y/e.y>0?e.multiplyScalar(i.y/e.y):e.multiplyScalar(i.length()),this.targetToCamera0.copy(t).negate();let o=this.camera.position.clone().add(t);this.objectToTarget0.subVectors(o,this.position);let s=(new z).setFromQuaternion(this.camera.quaternion,"YXZ");this.cameraPolarOffset=-s.x,s.x=0,s.z=0,s.y-=Math.PI/2,this.cameraPolarAxis0.set(0,0,-1).applyEuler(s)}if(this.object instanceof d&&(this.object.matrixAutoUpdate=!1),this.euler.setFromQuaternion(this.quaternion,"YXZ"),this.rotByTouch=o.rotByTouch??"joystick",this.rotBy=o.rotBy??"keys",this.rotationMode=o.rotationMode??"normal",this.moveMode=o.moveMode??"walk",this.collisionEnabled=o.collisionEnabled,this.speedTranslate=1*(o.speedTranslate??250),this.speedOrbit=.025*(o.speedRotate??100),this.mouseOrbitSensitivity=16e-6*(o.speedRotate??100),this.keyAssignments=o.keyAssignments.map(t=>{let e=[t[0],t[1]];return"▲"===e[1]?e[1]="ArrowUp":"◀"===e[1]?e[1]="ArrowLeft":"▼"===e[1]?e[1]="ArrowDown":"▶"===e[1]?e[1]="ArrowRight":"⇧"===e[1]?e[1]="Shift":"↵"===e[1]?e[1]="Enter":"Space"===e[1]?e[1]=" ":"⌘"===e[1]?e[1]="Meta":"Ctrl"===e[1]?e[1]="Control":"Esc"===e[1]&&(e[1]="Escape"),e}),"mouse"===o.rotBy){let t;t=this.keyAssignments.findIndex(t=>"rotNegX"===t[0]),-1!==t&&(this.keyAssignments[t][1]=""),t=this.keyAssignments.findIndex(t=>"rotPosX"===t[0]),-1!==t&&(this.keyAssignments[t][1]=""),t=this.keyAssignments.findIndex(t=>"rotPosY"===t[0]),-1!==t&&(this.keyAssignments[t][1]=""),t=this.keyAssignments.findIndex(t=>"rotNegY"===t[0]),-1!==t&&(this.keyAssignments[t][1]="")}this.lerpFactorPosStart=1-.02**(1/(60*(o.delayPos[0]??.3))),this.lerpFactorPosEnd=1-.02**(1/(60*(o.delayPos[1]??.3))),this.lerpFactorPos.setScalar(this.lerpFactorPosStart),this.lerpFactorRotStart=1-.02**(1/(60*(o.delayRot[0]??.3))),this.lerpFactorRotEnd=1-.02**(1/(60*(o.delayRot[1]??.3))),this.lerpFactorPosCamera=1-.02**(1/(60*(o.delayPosCamera??.3))),this.lerpFactorRotCamera=1-.02**(1/(60*(o.delayRotCamera??.3))),this.gravity=12*(this.gloabalPhysics.gravity??j.defaultData.gravity),this.usePhysics=this.gloabalPhysics.usePhysics??j.defaultData.usePhysics,this.jumpPower=20*o.jumpPower,this.resetYPosition=this.position.y+Math.abs(o.resetYPosition)*(this.gravity>0?1:-1),this.alignToGround=o.alignToGround??!1,this.orientMode=o.autoOrientMove?o.orientMode:"none",this.orientWith=o.orientWith??M.defaultDataThirdPerson.orientWith,this.slopeThresh=65*Math.PI/180,"capsule"===o.collider.type?(this.collider.radius=o.collider.radius,this.collider.segment.start.y=o.collider.height/2-o.collider.radius,this.collider.segment.end.y=-this.collider.segment.start.y,this.offset=o.collider.height*ut/this.pixelsPerMeter,this.stepThresh=.3*o.collider.height/this.pixelsPerMeter,this.colliderHeight=o.collider.height):"sphere"===o.collider.type?(this.collider.radius=o.collider.radius,this.collider.segment.start.y=0,this.collider.segment.end.y=0,this.offset=2*o.collider.radius*ut/this.pixelsPerMeter,this.stepThresh=2*o.collider.radius*.3/this.pixelsPerMeter,this.colliderHeight=2*o.collider.radius):(this.offset=o.collider.height*ut/this.pixelsPerMeter,this.stepThresh=.3*o.collider.height/this.pixelsPerMeter,this.colliderHeight=o.collider.height),this.collider.type=o.collider.type;let v=(new C).fromArray(o.collider.position.map(t=>"number"==typeof t?t:0)),b=(new D).setFromEuler((new z).fromArray([...o.collider.rotation.map(t=>"number"==typeof t?t:0),"XYZ"]));this.collider.position.copy(v).multiply(this.scale),this.collider.rotation.copy(b),this.collider.matrix.compose(v,b,Dt),void 0!==o.cameraXAxis&&(this.cameraXAxis=o.cameraXAxis,this.cameraYAxis=o.cameraYAxis,this.minPolarAngle=o.cameraRotXLimits[0],this.maxPolarAngle=o.cameraRotXLimits[1],this.minAzimuthAngleRel=o.cameraRotYLimits[0],this.maxAzimuthAngleRel=o.cameraRotYLimits[1]),this.forwardDir=o.forwardDirection??"-z",this.isFirstPerson&&(this.forwardDir="-z"),this.runMultiplier=o.runMultiplier??2;let x=2*o.navmesh.destinationHelperRadius;if(x>0){let t=new S;t.push({fi:0,data:{...E.defaultData("light","phong"),alpha:0},id:"layer1"}),t.push({fi:0,data:{...E.defaultData("color"),color:o.navmesh.destinationHelperColor,alpha:o.navmesh.destinationHelperColor.a},id:"layer2"});let e=u({layers:t},{scene:this.page.scene,shared:this.sharedAssets});this.navMeshPathDest=new W(g.create({parameters:{width:x,height:x/10,hollow:.7}}),e),this.navMeshPathDest.material.userData.opacity0=o.navmesh.destinationHelperColor.a}this.activate()}reset(t=!1){if(this.object.hiddenMatrix.copy(this.hiddenMatrix0),t){this.object.updateMatrix(),this.object.updateMatrixWorld(),this.object.matrix.copy(this.object.matrixWorld),this.object.matrix.decompose(this.position,this.quaternion,this.scale),this.object.parent?this.object.hiddenMatrix.copy(this.object.parent.matrixWorld).invert():this.object.hiddenMatrix.identity();let t=(new z).setFromQuaternion(this.quaternion,"YXZ"),e=t.y;this.objectRealQuat.copy(this.quaternion),t.y=0,this.quaternion.setFromEuler(t),this.objXZQuat.copy(this.quaternion),this.objXZQuatInv.copy(this.objXZQuat).invert(),this.objXZRotMat.makeRotationFromQuaternion(this.quaternion),t.set(0,e,0),this.quaternion.setFromEuler(t),this.rot.setFromEuler(t),this.euler.setFromQuaternion(this.quaternion,"YXZ"),this.velocityTarget.set(0,0,0),this.velocity.set(0,0,0)}else this.object instanceof d?this.object.matrixAutoUpdate=!0:this.object.updateMatrix();!0===this.cameraFollow&&(this.camera.quaternion.copy(this.quat0Cam),this.camera.position.copy(this.position0Cam),this.camera.scale.copy(this.scale0Cam),this.camera.hiddenMatrix.copy(this.hiddenMatrix0Cam),this.camera.matrixAutoUpdate=!0),this.controlsManager.requestRender()}activate(){this.instantiateActions(),this.domElement.ownerDocument.addEventListener("pointerdown",this.onPointerDown),this.domElement.ownerDocument.addEventListener("keydown",this.onKeyDown),this.domElement.ownerDocument.addEventListener("keyup",this.onKeyUp),this.domElement.ownerDocument.addEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.addEventListener("pointerlockerror",this.onPointerlockError),this.domElement.ownerDocument.addEventListener("visibilitychange",this.handleVisibilityChange)}deactivate(){this.disposeActions(),this.domElement.ownerDocument.removeEventListener("pointerdown",this.onPointerDown),this.domElement.ownerDocument.removeEventListener("keydown",this.onKeyDown),this.domElement.ownerDocument.removeEventListener("keyup",this.onKeyUp),this.domElement.ownerDocument.removeEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.removeEventListener("pointerlockerror",this.onPointerlockError),this.domElement.ownerDocument.removeEventListener("visibilitychange",this.handleVisibilityChange)}dispose(){this.deactivate(),this.navMeshPathDest?.parent&&this.page.remove(this.navMeshPathDest)}instantiateActions(){let t=this.data,e=this.sharedAssets;void 0!==t.gameActions&&(this.actions={},P.list.forEach(i=>{this.actions[i]=f({...t,disabled:!1,type:"GameControl"},t.gameActions[i],this.page,e,this.controlsManager.eventManager,this.object)})),this.dispatchStopEvent("move"),this.dispatchStopEvent("run"),this.dispatchStopEvent("jump"),this.dispatchStartEvent("idle"),this.initialAction&&(this.initialAction=!1)}disposeActions(){this.initialAction=!1,this.dispatchStopEvent("idle"),this.dispatchStopEvent("move"),this.dispatchStopEvent("run"),this.dispatchStopEvent("jump"),v(this.actions.idle),v(this.actions.move),v(this.actions.run),v(this.actions.jump)}dispatchStartEvent(t){void 0!==this.actions[t]&&(this.actionState[t]||(this.actionState[t]=!0,this.actions[t].Transition.forEach(t=>{t.play()}),this.actions[t].Animation.forEach(t=>{t.play(!1===this.initialAction)}),this.actions[t].TimelineAnimation.forEach(t=>{t.play()}),this.actions[t].Create.forEach(t=>{t.dispatchStart()}),this.actions[t].Audio.forEach(t=>{t.dispatchGameControl("start")}),this.actions[t].Particles.forEach(t=>{t.dispatchGameControl("start")})))}dispatchStopEvent(t){void 0!==this.actions[t]&&(!this.actionState[t]||(this.actionState[t]=!1,this.actions[t].Transition.forEach(t=>{t.stop(),null!==t.object.currentState&&t.object.changeSelectedState(null,{scene:this.page.scene,shared:this.sharedAssets})}),this.actions[t].TimelineAnimation.forEach(t=>{t.stop()}),this.actions[t].Create.forEach(t=>{t.dispatchStop()}),this.actions[t].Audio.forEach(t=>{t.dispatchGameControl("stop")}),this.actions[t].Particles.forEach(t=>{t.dispatchGameControl("stop")})))}get colliderWorldPosition(){return vt.copy(this.collider.position).applyQuaternion(this.objectRealQuat).add(this.position)}update(t){if(this.gravity<0?this.position.y<this.resetYPosition:this.position.y>this.resetYPosition)return this.reset(!0),!0;this.sharedGameControlGlobals.gamePads.forEach(this.copyVRGamePadValues);let e=(this.isFirstFrame?16.6:t)/1e3;this.isFirstFrame&&(this.isFirstFrame=!1);let i=60*e,o=!1;if(this.groundYRotation=0,this.groundVelocity.set(0,0,0),this.usePhysics&&this.collisionEnabled&&this.object.rigidBody?.collider(0).shape){let t=bt.set(0,(0===this.velocity.y?this.pixelsPerMeter*Math.max(Math.abs(this.gravity)/120,1)*(this.gravity>0?1:-1):this.velocity.y)*e,0).divideScalar(this.pixelsPerMeter),i=this.sharedGameControlGlobals.rapierWorld.castShape(this.colliderWorldPosition.divideScalar(this.pixelsPerMeter),this.colliderWorldQuat,t,this.object.rigidBody?.collider(0).shape,0,1,!1,8,void 0,void 0,this.object.rigidBody);if(i){this.onObject=!0,this.groundNormal.set(i.normal2.x,i.normal2.y,i.normal2.z).applyQuaternion(this.colliderWorldQuat).negate(),this.alignToGround&&this.groundTiltAdjustment(this.groundNormal),Math.acos(this.groundNormal.y)<this.slopeThresh&&(o=!0),0===i.collider.parent()?.bodyType()&&Math.acos(this.groundNormal.y)*(180/Math.PI)>45&&(this.onObject=!1);let t=i.collider.parent(),s=null!==t&&t.isKinematic()?t:null,n=null===s?void 0:this.sharedGameControlGlobals.kinematicBodyToEntity.get(s.handle);if(null!==s&&n?.userData.isFollowingObj!==this.object.uuid){let t=this.object.getWorldPosition(vt).add(this.collider.position).divideScalar(this.pixelsPerMeter),i=s.velocityAtPoint(t);this.groundVelocity.set(i.x,i.y,i.z).multiplyScalar(this.pixelsPerMeter),this.groundYRotation=s.angvel().y*e}}else this.onObject=!1}if("walk"===this.moveMode&&this.collisionEnabled&&(1===this.movementState.jump&&this.onObject&&(this.velocityTarget.y=this.jumpPower,this.movementState.jump=0,this.dispatchStopEvent("idle"),this.dispatchStopEvent("move"),this.dispatchStopEvent("run"),this.dispatchStopEvent("jump"),this.dispatchStartEvent("jump"),this.onObject=!1),this.onObject?this.velocityTarget.y/=2:this.velocityTarget.y+=this.gravity*i),"fly"===this.moveMode&&(this.velocityTarget.y=(this.movementState.movePosY-this.movementState.moveNegY)*this.speedTranslate),this.directionXZ.z=this.movementState.movePosZ-this.movementState.moveNegZ,this.directionXZ.x=this.movementState.movePosX-this.movementState.moveNegX,"+z"===this.forwardDir&&this.directionXZ.multiplyScalar(-1),this.directionXZ.manhattanLength()>0&&(this.path=[]),this.navMeshPathDest){let t=this.navMeshPathDest.material;if("walk"===this.moveMode&&this.path.length>1){this.navMeshPathDest.position.copy(this.path[this.path.length-1]),this.navMeshPathDest.parent||this.page.add(this.navMeshPathDest);let e=vt.subVectors(this.path[1],this.position),i=bt.subVectors(this.path[1],this.path[0]);e.dot(i)<0?this.path.shift():(this.directionXZ.x=i.x,this.directionXZ.z=i.z),t.opacity=t.userData.opacity0}else t.opacity-=.05*t.userData.opacity0,this.navMeshPathDest.material.opacity<=0&&this.navMeshPathDest.parent&&this.page.remove(this.navMeshPathDest)}this.directionXZ.normalize(),this.movementState.run?this.moveForce=this.runMultiplier:this.moveForce=1,this.velocityTarget.z=this.directionXZ.z*this.speedTranslate*this.moveForce,this.velocityTarget.x=this.directionXZ.x*this.speedTranslate*this.moveForce,("walk"===this.moveMode?this.velocityTarget.x+this.velocityTarget.z===0:0===this.velocityTarget.manhattanLength())?this.lerpFactorPos.setScalar(this.lerpFactorPosEnd):this.lerpFactorPos.setScalar(this.lerpFactorPosStart),"walk"===this.moveMode&&(this.lerpFactorPos.y=1),!1===this.didHit&&0===this.pushedVelocity.manhattanLength()||!1===this.usePhysics?(this.velocity.x+=(this.velocityTarget.x-this.velocity.x)*(1-(1-this.lerpFactorPos.x)**i),this.velocity.y+=(this.velocityTarget.y-this.velocity.y)*(1-(1-this.lerpFactorPos.y)**i),this.velocity.z+=(this.velocityTarget.z-this.velocity.z)*(1-(1-this.lerpFactorPos.z)**i)):this.velocity.copy(this.velocityTarget),("walk"===this.moveMode?this.velocity.x**2+this.velocity.z**2<this.speedTranslate:this.velocity.lengthSq()<this.speedTranslate)?(this.dispatchStopEvent("move"),this.dispatchStopEvent("run"),this.onObject&&(this.dispatchStopEvent("jump"),this.dispatchStartEvent("idle"))):(this.dispatchStopEvent("idle"),(this.onObject||"fly"===this.moveMode)&&(this.dispatchStopEvent("jump"),this.movementState.run?(this.dispatchStopEvent("move"),this.dispatchStartEvent("run")):(this.dispatchStopEvent("run"),this.dispatchStartEvent("move"))));let n=ft.copy(this.velocity);if("none"!==this.orientMode&&!1===this.isFirstPerson){let t=bt.copy(n);t.y=0,n.set(0,n.y,t.length()*("+z"===this.forwardDir?1:-1))}if(this.directionXZ.manhattanLength()>0&&"none"!==this.orientMode&&!1===this.isFirstPerson)if("camera"===this.orientWith&&this.path.length<=1){let t=vt;this.camera.getWorldDirection(t);let e=xt.copy(At).multiplyScalar(t.dot(At));t.sub(e);let i=bt.copy(this.directionXZ);i.x*=-1,this.rot.y=t.angleTo(i)*(t.cross(i).y>0?-1:1)+this.rotationAccumWhenOrientWithCamera}else this.rot.y=(this.path.length>1?0:this.euler.y)+Math.atan2(-this.directionXZ.z,this.directionXZ.x)+Math.PI/2*("+z"===this.forwardDir?1:-1);if(jt.setFromVector3(this.rot),"walk"===this.moveMode&&(jt.x=0),n.applyEuler(jt),o&&(St.setFromUnitVectors(At,this.groundNormal),n.applyQuaternion(St)),!0===this.usePhysics&&this.object.rigidBody){this.pushedVelocity.set(0,0,0);let t=0;for(let i of this.sharedGameControlGlobals.entitiesWithTransformAnim){if(void 0===i.rigidBody||void 0===i.prevQ)continue;(i.hasNonUniformScale?i.matrixWorldRigid:i.matrixWorld).decompose(zt,Xt,Rt);let o=this.object.getWorldPosition(Ft).add(this.collider.position).sub(zt);Nt.copy(i.prevQ).invert().premultiply(Xt);let r=xt.subVectors(zt,i.prevT).add(_t.copy(o).applyQuaternion(Nt).sub(o)).divideScalar(e).divideScalar(this.pixelsPerMeter),a=i.rigidBody.collider(0).castCollider(r,this.object.rigidBody.collider(0),vt.copy(n).divideScalar(this.pixelsPerMeter),0,e,!1);r.multiplyScalar(this.pixelsPerMeter);let h=b.is(i)?i:i.object;if(null!==a&&this.lastHitObj!==h){let t;i instanceof m&&(t=i);let e=this.sharedGameControlGlobals.entityToCollisionEvents[h.uuid];if(e)for(let i of e)"character"===i.data.target&&(i.dispatch(t),h.dispatchEvent(s));this.lastHitObj=h}null!==a&&(Math.abs(r.x)>Math.abs(this.pushedVelocity.x)&&(this.pushedVelocity.x=r.x),Math.abs(r.y)>Math.abs(this.pushedVelocity.y)&&(this.pushedVelocity.y=r.y),Math.abs(r.z)>Math.abs(this.pushedVelocity.z)&&(this.pushedVelocity.z=r.z),Ot(t++).copy(a.normal1).applyQuaternion(i.quaternion))}if(t>0){for(let e=0;e<t;e++){let t=Ot(e),i=t.dot(n);i<0&&n.addScaledVector(t,-i)}n.add(this.pushedVelocity)}else n.add(this.groundVelocity)}if(this.rotDirection.y=Number(this.movementState.rotPosY)-Number(this.movementState.rotNegY),this.rotDirection.x=Number(this.movementState.rotPosX)-Number(this.movementState.rotNegX),this.rotDirection.normalize(),"normal"===this.rotationMode&&(this.movementState.rotPosX||this.movementState.rotNegX)||"steer"===this.rotationMode&&(this.movementState.rotPosX||this.movementState.rotNegX)&&(this.movementState.movePosZ||this.movementState.moveNegZ||"walk"===this.moveMode)?this.rotVelocityStick.x=-this.rotDirection.x*this.speedOrbit*this.rotForce:this.rotVelocityStick.x=0,"normal"===this.rotationMode&&(this.movementState.rotPosY||this.movementState.rotNegY)||"steer"===this.rotationMode&&(this.movementState.rotPosY||this.movementState.rotNegY)&&(this.movementState.movePosZ||this.movementState.moveNegZ)?this.rotVelocityStick.y=-this.rotDirection.y*this.speedOrbit*this.rotForce:this.rotVelocityStick.y=0,this.rotVelocityTarget.subVectors(this.eulerDelta.divideScalar(e),this.rotVelocityStick),0===this.rotVelocityTarget.manhattanLength()?this.rotVelocity.lerp(this.rotVelocityTarget,1-(1-this.lerpFactorRotEnd)**i):this.rotVelocity.lerp(this.rotVelocityTarget,1-(1-this.lerpFactorRotStart)**i),this.euler.x+=this.rotVelocity.x*e,this.euler.y+=this.rotVelocity.y*e+this.groundYRotation,0===this.rotVelocityTarget.y&&0===this.directionXZ.manhattanLength()?this.rotationAccumWhenOrientWithCamera=0:(!1===this.cameraFollow||"Locked"===this.cameraYAxis)&&(this.rotationAccumWhenOrientWithCamera+=this.rotVelocity.y*e),!1===this.isFirstPerson&&"none"!==this.orientMode&&this.directionXZ.manhattanLength()>0){if("radial"===this.orientMode){this.objectToCamXZ.copy(this.objectToCamXZ0).applyAxisAngle(At,this.euler.y-this.euler0.y);let t=bt.copy(this.objectToCamXZ).normalize(),i=xt.copy(n).multiplyScalar(e);i.y=0;let o=i.sub(vt.copy(t).multiplyScalar(i.dot(t))).cross(t).y;this.euler.y-=Math.atan2(o,this.objectToCamXZ.length())}}else this.rot.y+=this.rotVelocity.y*e+this.groundYRotation,0!==this.rotVelocityTarget.y&&(!1===this.cameraFollow||"Locked"===this.cameraYAxis)&&(this.euler.y=this.rot.y);if(!0===this.cameraFollow&&("walk"===this.moveMode?"Limit"===this.cameraXAxis?this.euler.x=A.clamp(this.euler.x,-this.maxPolarAngle+this.cameraPolarOffset+1e-6,-this.minPolarAngle+this.cameraPolarOffset-1e-6):this.euler.x=A.clamp(this.euler.x,-this.PI_2+this.cameraPolarOffset,this.PI_2+this.cameraPolarOffset):"Limit"===this.cameraXAxis&&(this.euler.x=A.clamp(this.euler.x,-this.PI_2,this.PI_2))),"fly"===this.moveMode?this.rot.x=this.euler.x:this.isFirstPerson&&(jt.copy(this.euler),jt.y=0,this.nonColliderRotOffset.makeRotationFromEuler(jt)),Et.setFromAxisAngle(Tt,this.rot.x),St.setFromAxisAngle(At,this.rot.y),St.multiply(Et),Et.setFromAxisAngle(kt,this.rot.z),St.multiply(Et),this.quaternion.copy(St),this.objectRealQuat.multiplyQuaternions(this.quaternion,this.objXZQuat),this.colliderWorldQuat.copy(this.objectRealQuat).multiply(this.collider.rotation),this.collisionEnabled)if(this.usePhysics&&this.object.rigidBody?.collider(0).shape){let t=bt.copy(n).multiplyScalar(e/this.pixelsPerMeter),i=null;this.didHit=!1;let o=new C;for(let e=0;e<5;e++){let n=t.length(),r=xt.copy(t).normalize();if(i=this.sharedGameControlGlobals.rapierWorld.castShape(this.colliderWorldPosition.divideScalar(this.pixelsPerMeter).add(o),this.colliderWorldQuat,r,this.object.rigidBody.collider(0).shape,0,n,!1,12,void 0,void 0,this.object.rigidBody),null===i){0===e&&0!==this.directionXZ.manhattanLength()&&(this.lastHitObj=null),o.add(t);break}{this.didHit=!0;let a=this.sharedGameControlGlobals.colliderToEntity.get(i.collider.handle);if(a!==this.lastHitObj&&0===e){this.lastHitObj=a;let t=this.sharedGameControlGlobals.entityToCollisionEvents[a?.uuid];if(t)for(let e of t)if("character"===e.data.target){let t,o=(this.sharedGameControlGlobals.rapierWorld?.getCollider(i.collider.handle))._parent;if(a.cloner)for(let e of a.cloner.children)if(e.rigidBody===o){t=e;break}e.dispatch(t),a.dispatchEvent(s)}}let h=yt.set(i.normal2.x,i.normal2.y,i.normal2.z).applyQuaternion(this.colliderWorldQuat),l=gt.copy(r).multiplyScalar(i.time_of_impact).dot(h),c=i.time_of_impact;if(0===c&&(this.position.y+=this.offset*this.pixelsPerMeter),l>this.offset&&(c=i.time_of_impact*(l-this.offset)/l,o.addScaledVector(r,c)),t.copy(r).multiplyScalar(n-c),Math.acos(-h.y)>this.slopeThresh){let e=this.colliderWorldPosition.divideScalar(this.pixelsPerMeter).add(o),s=xt.copy(i.witness2).applyQuaternion(this.colliderWorldQuat);s.y=0;let n=e.add(s);n.y+=this.stepThresh;let r=this.sharedGameControlGlobals.rapierWorld.castShape(n,this.colliderWorldQuat,t,this.object.rigidBody?.collider(0).shape,0,1,!1,12,void 0,void 0,this.object.rigidBody);null!==r&&0===r.time_of_impact&&(h.y=0,h.normalize())}t.addScaledVector(h,-t.dot(h))}}this.position.addScaledVector(o,this.pixelsPerMeter),vt.copy(this.position).divideScalar(this.pixelsPerMeter),Et.copy(this.quaternion).premultiply(this.groundTilt).multiply(this.objXZQuat);let r=this.object.rigidBody,a=void 0!==r&&Wt.copy(vt).sub(r.translation()).lengthSq()>1;void 0!==r&&(a?(r.setTranslation(vt,!0),r.setRotation(Et,!0)):(r.setNextKinematicTranslation(vt),r.setNextKinematicRotation(Et)))}else{let t=this.onObject?1:5,i=n.multiplyScalar(e/t);for(let o=0;o<t;o++)this.position.add(i),this.collisionAdjustment(e/t)}else this.position.addScaledVector(n,e);if("walk"===this.moveMode&&this.onObject&&(this.velocityTarget.y=0,this.velocity.y=0),this.quaternion.premultiply(this.groundTilt).multiply(this.objXZQuat),this.object.matrix.compose(this.position,this.quaternion,this.scale),this.object.matrixWorldNeedsUpdate=!0,this.object.matrix.multiply(this.nonColliderPosOffset).multiply(this.nonColliderRotOffset),this.quaternion.premultiply(this.groundTiltInv).multiply(this.objXZQuatInv),!0===this.cameraFollow){this.updateFollowArms();let t=this.objectToTarget.add(this.position),e=this.targetToCamera.add(t);wt.lookAt(e,t,At).setPosition(e),wt.decompose(this.targetPos,this.targetQuat,vt),this.camera.quaternion.slerp(this.targetQuat,1-(1-this.lerpFactorRotCamera)**i),this.camera.position.lerp(this.targetPos,1-(1-this.lerpFactorPosCamera)**i),this.camera.updateMatrix(),this.camera.updateMatrixWorld(),"Limit"===this.cameraYAxis&&"cartesian"===this.orientMode&&(this.euler.y=A.clamp(this.euler.y,this.minAzimuthAngleRel,this.maxAzimuthAngleRel)),this.euler.x=A.clamp(this.euler.x,-this.PI_2+(this.cameraPolarOffset<0?this.cameraPolarOffset:0),this.PI_2+(this.cameraPolarOffset>0?this.cameraPolarOffset:0))}return this.eulerDelta.set(0,0,0),this.object.dispatchEvent(Qt),!(this.path.length<2&&this.lastPosition.distanceToSquared(this.position)<this.threshEndTranslate&&Math.abs(this.rotVelocity.x)<this.threshEndRotVel&&Math.abs(this.rotVelocity.y)<this.threshEndRotVel&&(void 0===this.camera||this.isFirstPerson||this.lastCameraPosition.distanceToSquared(this.camera.position)<this.threshEndTranslate&&8*(1-this.lastCameraQuaternion.dot(this.camera.quaternion))<this.threshEndRotate)&&("fly"===this.moveMode||!0===this.onObject||!1===this.collisionEnabled)&&(null===this.navMeshPathDest||this.navMeshPathDest.material.opacity<-.04*this.navMeshPathDest?.material?.userData.opacity0)||(this.camera&&(this.lastCameraPosition.copy(this.camera.position),this.lastCameraQuaternion.copy(this.camera.quaternion)),this.lastPosition.copy(this.position),this.object.dispatchEvent(It),0))}updateFollowArms(){this.objectToTarget.copy(this.objectToTarget0),this.targetToCamera.copy(this.targetToCamera0);let t,e=Et.setFromAxisAngle(At,"Limit"===this.cameraYAxis&&"radial"!==this.orientMode?A.clamp(this.euler.y-this.euler0.y,this.minAzimuthAngleRel,this.maxAzimuthAngleRel):this.euler.y-this.euler0.y);("Locked"!==this.cameraYAxis||"radial"===this.orientMode)&&this.objectToTarget.applyQuaternion(e),t="Limit"===this.cameraXAxis?A.clamp(this.euler.x,-this.maxPolarAngle+this.cameraPolarOffset+1e-6,-this.minPolarAngle+this.cameraPolarOffset-1e-6):A.clamp(this.euler.x,-this.PI_2+this.cameraPolarOffset+1e-6,this.PI_2+this.cameraPolarOffset-1e-6);let i=vt.copy(this.cameraPolarAxis0);("Locked"!==this.cameraYAxis||"radial"===this.orientMode)&&i.applyQuaternion(e);let o=St.setFromAxisAngle(i,t);"Locked"!==this.cameraYAxis&&this.targetToCamera.applyQuaternion(e),"Locked"!==this.cameraXAxis&&this.targetToCamera.applyQuaternion(o)}groundTiltAdjustment(t){180*At.angleTo(t)/Math.PI<15||180*At.angleTo(t)/Math.PI>85?Et.identity():Et.setFromUnitVectors(At,t),this.groundTilt.slerp(Et,.06),this.groundTiltInv.copy(this.groundTilt).invert()}collisionAdjustment(t){let e=gt.set(0,0,0);this.object.matrix.compose(this.position,this.quaternion,this.scale);let i=wt.multiplyMatrices(this.object.matrix,this.objXZRotMat).multiply(this.collider.matrix).decompose(vt,Et,bt).compose(vt,Et,Dt);this.sharedGameControlGlobals.entitiesWithTransformAnim.forEach(t=>{if(t===this.object||t.isDescendantOf(this.object)||!t.bvhGeometry||!t.bvhGeometry.boundsTree)return;Lt.makeEmpty(),t.updateMatrixWorldRigid();let o=t.matrixWorldRigid,s=Pt.copy(o).invert(),n=Mt.copy(Pt).multiply(i);Vt.copy(this.collider.segment),Vt.start.applyMatrix4(n),Vt.end.applyMatrix4(n);let r=yt.copy(this.position).applyMatrix4(s);Lt.expandByPoint(Vt.start),Lt.expandByPoint(Vt.end),Lt.min.addScalar(-this.collider.radius),Lt.max.addScalar(this.collider.radius),t.bvhGeometry.boundsTree.shapecast({boundsTraverseOrder:t=>t.distanceToPoint(Vt.end),intersectsBounds:t=>t.intersectsBox(Lt),intersectsTriangle:t=>{let i=vt,s=bt,n=t.closestPointToSegment(Vt,i,s);if(n<this.collider.radius){let t=this.collider.radius-n,a=s.sub(i).normalize(),h=xt.copy(r);h.addScaledVector(a,t);let l=h.applyMatrix4(o).sub(this.position);e.add(l),Vt.start.addScaledVector(a,t),Vt.end.addScaledVector(a,t)}}})}),Lt.makeEmpty(),Vt.copy(this.collider.segment),Vt.start.applyMatrix4(i),Vt.end.applyMatrix4(i),Lt.expandByPoint(Vt.start),Lt.expandByPoint(Vt.end),Lt.min.addScalar(-this.collider.radius),Lt.max.addScalar(this.collider.radius),this.sharedGameControlGlobals.staticMeshBVH?.shapecast({boundsTraverseOrder:t=>t.distanceToPoint(Vt.end),intersectsBounds:t=>t.intersectsBox(Lt),intersectsTriangle:t=>{let i=vt,o=bt,s=t.closestPointToSegment(Vt,i,o);if(s<this.collider.radius){let t=this.collider.radius-s,n=o.sub(i).normalize();this.alignToGround&&this.groundTiltAdjustment(n),e.addScaledVector(n,t),Vt.start.addScaledVector(n,t),Vt.end.addScaledVector(n,t)}}}),this.onObject=Math.abs(e.y)>Math.abs(t*this.velocity.y*.25),this.onObject&&this.dispatchStopEvent("jump");let o=Math.max(0,e.length()-1e-5);e.normalize().multiplyScalar(o),this.position.add(e)}pause(){this.firstPointerId=-1,this.movementState={moveNegZ:0,movePosZ:0,moveNegX:0,movePosX:0,moveNegY:0,movePosY:0,rotPosX:0,rotNegX:0,rotPosY:0,rotNegY:0,jump:0,run:0},this.deactivate()}resume(){this.activate()}},Yt=Bt;Yt.isLocked=!1;var Zt,Gt,qt,Ht=x?typeof window<"u"?window.location.href:"":"https://cdn.spline.design/@splinetool/runtime@2.0.2/build/",Ut=`\n(async function() {\n\tconst [wasmImport, wasmBinary] = await Promise.all([\n\t\timport('${Ht}' + 'navmesh.js'),\n\t\tfetch('${Ht}' + 'navmesh.wasm').then((res) => res.arrayBuffer()),\n\t]);\n\tconst wasmModule = wasmImport.default;\n\tself.module = await wasmModule({ wasmBinary });\n\tpostMessage('ready');\n})();\n`,Kt={cs:6,ch:2,walkableSlopeAngle:90,walkableHeight:20,walkableClimb:5,walkableRadius:0,maxEdgeLen:12,maxSimplificationError:1.3,minRegionArea:8,mergeRegionArea:20,maxVertsPerPoly:6,detailSampleDist:6,detailSampleMaxError:1};r.then(t=>{Zt=t,Gt=new t.Vec3,qt=new t.Vec3});var Jt=new C,$t=class{constructor(e=!1,i=!1){this.usePhysics=e,this.isExport=i,this.onPointerDown=t=>{if(1!==a.length)return;let{raycaster:e,page:i}=this.eventContext;this.eventContext.updateRaycaster(t);let o=i.raycastWithClones(e);if(0!==o.length){if(this.gameControl){let t=Jt.copy(this.gameControl.colliderWorldPosition);t.y-=this.gameControl.colliderHeight/2,this.gameControl.path=this.computePath(t,o[0].point)}this.eventContext.requestRender()}},this.traverseWithPhysics=(e,i)=>s=>{let r;if(s instanceof t){if(!s.objectForSample)return!0===s.object.dataPatched.physics.fusedBody&&"dynamic"===s.object.dataPatched.physics.rigidBody||void 0;if(s.objectForSample.dataPatched.physics.fusedBody)return;r=s.object}else if(s instanceof m)r=s.object;else if(r=s,!1===r.dataPatched.cloner?.disabled&&r.dataPatched.cloner?.hideBase&&!0!==r.dataPatched.physics?.fusedBody)return!0;if(i&&!r.userData.navmesh)return;let a=r.dataPatched;if(!a.visible&&!0!==a.physics?.enabled)return!0;s.updateMatrixWorldRigid();let h=n(a),l=r.userData.hasDestroy,c=r.userData.hasDrag,d=!1,p=!1;for(let t of a.events)!0!==t.data.disabled&&("GameControl"===t.data.type?d=!0:"Follow"===t.data.type&&(p=!0));if(d||h||p||l||c)return!0;if(this.usePhysics&&"dynamic"===a.physics?.rigidBody){if(this.usePhysics&&a.physics?.fusedBody)return!0}else if("geometry"in s&&s.geometry&&e.push(o(s.geometry,s.matrixWorld)),this.usePhysics&&a.physics?.fusedBody)return s.traverseObject((i,s)=>{if(0===s)return;let n;if(i instanceof t){if(!i.objectForSample)return!0===i.object.dataPatched.physics.fusedBody&&"dynamic"===i.object.dataPatched.physics.rigidBody||void 0;if(i.objectForSample.dataPatched.physics.fusedBody)return;n=i.object}else if(i instanceof m)n=i.object;else if(n=i,i.dataPatched.cloner?.hideBase)return!0;let r=n.dataPatched;if(!r.visible&&!0!==r.physics?.enabled)return!0;"geometry"in i&&i.geometry&&e.push(o(i.geometry,i.matrixWorld))}),!0},this.traverseNoPhysics=(e,i)=>s=>{let r;if(s instanceof t)return;r=s instanceof m?s.object:s;let a=r.dataPatched;if("visibility"===a.physics.enabled?!a.visible:!a.physics.enabled)return!0;if(i&&!r.userData.navmesh)return;let h=s.geometry,l=!0===r.userData.hasDestroy,c=!0===r.userData.hasDrag;if(n(a)||l||c||r.dataPatched.events.some(t=>!0!==t.data.disabled&&"GameControl"===t.data.type))return!0;h&&e.push(o(h,s.matrixWorld))},this.navmeshWasm=Zt,this.navMesh=new this.navmeshWasm.NavMesh,this._workerURL=URL.createObjectURL(new Blob([(i?Ut:"\n(async function() {\n\tconst [wasmImport, wasmBinary] = await Promise.all([\n\t\timport(self.location.origin + '/_libraries/navmesh.js'),\n\t\tfetch(self.location.origin + '/_libraries/navmesh.wasm').then((res) => res.arrayBuffer()),\n\t]);\n\tconst wasmModule = wasmImport.default;\n\tself.module = await wasmModule({ wasmBinary });\n\tpostMessage('ready');\n})();\n")+"\n\nonmessage = function(messageEvent) {\n\tconst meshData = messageEvent.data;\n\tconst positions = meshData[0];\n\tconst offset = meshData[1];\n\tconst indices = meshData[2];\n\tconst indicesLength = meshData[3];\n\tconst parameters = meshData[4];\n\n\tconst module = self.module;\n\tconst rc = new module.rcConfig();\n\trc.cs = parameters.cs;\n\trc.ch = parameters.ch;\n\trc.borderSize = parameters.borderSize ? parameters.borderSize : 0;\n\trc.tileSize = parameters.tileSize ? parameters.tileSize : 0;\n\trc.walkableSlopeAngle = parameters.walkableSlopeAngle;\n\trc.walkableHeight = parameters.walkableHeight;\n\trc.walkableClimb = parameters.walkableClimb;\n\trc.walkableRadius = parameters.walkableRadius;\n\trc.maxEdgeLen = parameters.maxEdgeLen;\n\trc.maxSimplificationError = parameters.maxSimplificationError;\n\trc.minRegionArea = parameters.minRegionArea;\n\trc.mergeRegionArea = parameters.mergeRegionArea;\n\trc.maxVertsPerPoly = parameters.maxVertsPerPoly;\n\trc.detailSampleDist = parameters.detailSampleDist;\n\trc.detailSampleMaxError = parameters.detailSampleMaxError;\n\n\tif (!self.navMesh) {\n\t\tself.navMesh = new module.NavMesh();\n\t}\n\tself.navMesh.build(positions, offset, indices, indicesLength, rc);\n\n\tconst navmeshData = navMesh.getNavmeshData();\n\tconst arrView = new Uint8Array(module.HEAPU8.buffer, navmeshData.dataPointer, navmeshData.size);\n\tconst ret = new Uint8Array(navmeshData.size);\n\tret.set(arrView);\n\tnavMesh.freeNavmeshData(navmeshData);\n\n\tpostMessage(ret);\n}\n"])),this._worker=new Worker(this._workerURL),this.whenWorkerReady=new Promise(t=>{this._worker.addEventListener("message",()=>t(),{once:!0})})}init(t,e,i){this.gameControl=e,this.eventContext=i,this.setDefaultQueryExtent((new C).setScalar(t.ch*t.walkableRadius*1.2)),this._worker.onmessage=()=>{this.createNavMesh(i.page,t,t=>{this.buildFromNavmeshData(t.data)})},this.eventContext.renderer.domElement.addEventListener("pointerdown",this.onPointerDown)}createNavMesh(t,e,i){e.objects.forEach(e=>{let i=t.scene.find(e);i.traverseEntity(t=>{t.userData.navmesh=!0}),i.cloner?.traverseObject(t=>{t.userData.navmesh=!0})});let o=[],s=(this.usePhysics?this.traverseWithPhysics:this.traverseNoPhysics)(o,"custom"===e.zones);if(t.traverseChildren(s),e.objects.forEach(e=>{let i=t.scene.find(e);i.traverseEntity(t=>{t.userData.navmesh=void 0}),i.cloner?.traverseObject(t=>{t.userData.navmesh=void 0})}),0===o.length)return!1;let n=y(o),{positions:r,triIndices:a}=p(n.getAttribute("position"),n.getIndex());return this._worker.postMessage([r,r.length/3,a,a.length,{...Kt,...e}]),this._worker.onmessage=i,!0}createDebugNavGeometry(){let t,e,i=this.navMesh.getDebugNavMesh(),o=i.getTriangleCount(),s=new Uint32Array(3*o),n=new Float32Array(3*o*3);for(t=0;t<3*o;t++)s[t]=t;for(t=0;t<o;t++)for(e=0;e<3;e++){let o=i.getTriangle(t).getPoint(e);n[9*t+3*e+0]=o.x,n[9*t+3*e+1]=o.y,n[9*t+3*e+2]=o.z}let r=new X;return r.setIndex(new _(s,1)),r.setAttribute("position",new _(n,3)),r}getClosestPoint(t){return Gt.x=t.x,Gt.y=t.y,Gt.z=t.z,this.navMesh.getClosestPoint(Gt)}getClosestPointToRef(t,e){Gt.x=t.x,Gt.y=t.y,Gt.z=t.z;let i=this.navMesh.getClosestPoint(Gt);e.set(i.x,i.y,i.z)}getRandomPointAround(t,e){return Gt.x=t.x,Gt.y=t.y,Gt.z=t.z,this.navMesh.getRandomPointAround(Gt,e)}getRandomPointAroundToRef(t,e,i){Gt.x=t.x,Gt.y=t.y,Gt.z=t.z;let o=this.navMesh.getRandomPointAround(Gt,e);i.set(o.x,o.y,o.z)}moveAlong(t,e){return Gt.x=t.x,Gt.y=t.y,Gt.z=t.z,qt.x=e.x,qt.y=e.y,qt.z=e.z,this.navMesh.moveAlong(Gt,qt)}moveAlongToRef(t,e,i){return Gt.x=t.x,Gt.y=t.y,Gt.z=t.z,qt.x=e.x,qt.y=e.y,qt.z=e.z,this.navMesh.moveAlong(Gt,qt)}computePath(t,e){let i=this.getClosestPoint(e);if(qt.x=i.x,qt.y=i.y,qt.z=i.z,Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)+Math.pow(e.z-i.z,2))>this.getDefaultQueryExtent().y)return[];this.getClosestPoint(t);let o=this.navMesh.computePath(Gt,qt),s=o.getPointCount(),n=[];for(let t=0;t<s;t++){let e=o.getPoint(t);n.push(new C(e.x,e.y,e.z))}return n}createCrowd(t,e){return new te(this,t,e)}setDefaultQueryExtent(t){Gt.x=t.x,Gt.y=t.y,Gt.z=t.z,this.navMesh.setDefaultQueryExtent(Gt)}getDefaultQueryExtent(){return this.navMesh.getDefaultQueryExtent()}buildFromNavmeshData(t){let e=t.length*t.BYTES_PER_ELEMENT,i=this.navmeshWasm._malloc(e),o=new Uint8Array(this.navmeshWasm.HEAPU8.buffer,i,e);o.set(t);let s=new this.navmeshWasm.NavmeshData;s.dataPointer=o.byteOffset,s.size=t.length,this.navMesh.buildFromNavmeshData(s),this.navmeshWasm._free(o.byteOffset)}getNavmeshData(){let t=this.navMesh.getNavmeshData(),e=new Uint8Array(this.navmeshWasm.HEAPU8.buffer,t.dataPointer,t.size),i=new Uint8Array(t.size);return i.set(e),this.navMesh.freeNavmeshData(t),i}getDefaultQueryExtentToRef(t){let e=this.navMesh.getDefaultQueryExtent();t.set(e.x,e.y,e.z)}dispose(){this.navMesh.destroy(),this._worker.terminate(),URL.revokeObjectURL(this._workerURL),this.eventContext?.renderer.domElement.removeEventListener("pointerdown",this.onPointerDown)}addCylinderObstacle(t,e,i){return Gt.x=t.x,Gt.y=t.y,Gt.z=t.z,this.navMesh.addCylinderObstacle(Gt,e,i)}addBoxObstacle(t,e,i){return Gt.x=t.x,Gt.y=t.y,Gt.z=t.z,qt.x=e.x,qt.y=e.y,qt.z=e.z,this.navMesh.addBoxObstacle(Gt,qt,i)}removeObstacle(t){this.navMesh.removeObstacle(t)}isSupported(){return void 0!==this.navmeshWasm}},te=class{constructor(t,e,i){this.navmeshWasmWrapper=t,this.transforms=[],this.agents=new Array,this.reachRadii=new Array,this._agentDestinationArmed=new Array,this._agentDestination=new Array,this.crowd=new this.navmeshWasmWrapper.navmeshWasm.Crowd(e,i,this.navmeshWasmWrapper.navMesh.getNavMesh())}onReachTarget(t,e){}addAgent(t,e,i){let o=new this.navmeshWasmWrapper.navmeshWasm.dtCrowdAgentParams;o.radius=e.radius,o.height=e.height,o.maxAcceleration=e.maxAcceleration,o.maxSpeed=e.maxSpeed,o.collisionQueryRange=e.collisionQueryRange,o.pathOptimizationRange=e.pathOptimizationRange,o.separationWeight=e.separationWeight,o.updateFlags=7,o.obstacleAvoidanceType=0,o.queryFilterType=0,o.userData=0;let s=this.crowd.addAgent(new this.navmeshWasmWrapper.navmeshWasm.Vec3(t.x,t.y,t.z),o);return this.transforms.push(i),this.agents.push(s),this.reachRadii.push(e.reachRadius?e.reachRadius:e.radius),this._agentDestinationArmed.push(!1),this._agentDestination.push(new C(0,0,0)),s}getAgentPosition(t){return this.crowd.getAgentPosition(t)}getAgentPositionToRef(t,e){let i=this.crowd.getAgentPosition(t);e.set(i.x,i.y,i.z)}getAgentVelocity(t){return this.crowd.getAgentVelocity(t)}getAgentVelocityToRef(t,e){let i=this.crowd.getAgentVelocity(t);e.set(i.x,i.y,i.z)}getAgentNextTargetPath(t){return this.crowd.getAgentNextTargetPath(t)}getAgentNextTargetPathToRef(t,e){let i=this.crowd.getAgentNextTargetPath(t);e.set(i.x,i.y,i.z)}getAgentState(t){return this.crowd.getAgentState(t)}overOffmeshConnection(t){return this.crowd.overOffmeshConnection(t)}agentGoto(t,e){this.crowd.agentGoto(t,new this.navmeshWasmWrapper.navmeshWasm.Vec3(e.x,e.y,e.z));let i=this.agents.indexOf(t);i>-1&&(this._agentDestinationArmed[i]=!0,this._agentDestination[i].set(e.x,e.y,e.z))}agentTeleport(t,e){this.crowd.agentTeleport(t,new this.navmeshWasmWrapper.navmeshWasm.Vec3(e.x,e.y,e.z))}updateAgentParameters(t,e){let i=this.crowd.getAgentParameters(t);void 0!==e.radius&&(i.radius=e.radius),void 0!==e.height&&(i.height=e.height),void 0!==e.maxAcceleration&&(i.maxAcceleration=e.maxAcceleration),void 0!==e.maxSpeed&&(i.maxSpeed=e.maxSpeed),void 0!==e.collisionQueryRange&&(i.collisionQueryRange=e.collisionQueryRange),void 0!==e.pathOptimizationRange&&(i.pathOptimizationRange=e.pathOptimizationRange),void 0!==e.separationWeight&&(i.separationWeight=e.separationWeight),this.crowd.setAgentParameters(t,i)}removeAgent(t){this.crowd.removeAgent(t);let e=this.agents.indexOf(t);e>-1&&(this.agents.splice(e,1),this.transforms.splice(e,1),this.reachRadii.splice(e,1),this._agentDestinationArmed.splice(e,1),this._agentDestination.splice(e,1))}getAgents(){return this.agents}update(t){if(this.navmeshWasmWrapper.navMesh.update(),t<=.001)return;let e=1/60;{let i=Math.floor(t/e);i>10&&(i=10),i<1&&(i=1);let o=t/i;for(let t=0;t<i;t++)this.crowd.update(o)}for(let t=0;t<this.agents.length;t++){let e=this.agents[t],i=this.getAgentPosition(e);if(this.transforms[t].copy(i),this._agentDestinationArmed[t]){let o=i.x-this._agentDestination[t].x,s=i.z-this._agentDestination[t].z,n=this.reachRadii[t],r=this._agentDestination[t].y-this.reachRadii[t],a=this._agentDestination[t].y+this.reachRadii[t],h=o*o+s*s;i.y>r&&i.y<a&&h<n*n&&(this.onReachTarget(e,this._agentDestination[t]),this._agentDestinationArmed[t]=!1)}}}setDefaultQueryExtent(t){let e=new this.navmeshWasmWrapper.navmeshWasm.Vec3(t.x,t.y,t.z);this.crowd.setDefaultQueryExtent(e)}getDefaultQueryExtent(){return this.crowd.getDefaultQueryExtent()}getDefaultQueryExtentToRef(t){let e=this.crowd.getDefaultQueryExtent();t.set(e.x,e.y,e.z)}getCorners(t){let e,i=this.crowd.getCorners(t),o=i.getPointCount(),s=[];for(e=0;e<o;e++){let t=i.getPoint(e);s.push(new C(t.x,t.y,t.z))}return s}dispose(){this.crowd.destroy()}};i({setup:function(t){let{manager:e,camera:i}=t,o=!1,s=5,n=8,r=9,a="drag",l=e.page.data.publish.gameControlObject,c=null!==l?e.page.find(l):null,d=null;if(c)for(let t of c.data.events){if(t.data.disabled||"GameControl"!==t.data.type)continue;let i=c;for(;e.usePhysics&&null!==(i=i.parent)?.parent;)i.data.physics;t.data.collisionEnabled&&(e.needsCollisionDetection=!0),null===d&&(d=t.data)}if(c&&d&&(!0===c.data.visible||!0===c.data.physics.enabled)){o=o||d.camera===i.uuid||c.uuid===i.uuid;let l=new Yt(c,t.renderer.domElement,d,t.eventContext.page.data.globalPhysics,e,c.uuid!==i.uuid&&d.camera===i.uuid,i,e.page,t.sharedAssets);e.gameControl=l,s=d.joystickPosLoc,n=d.joystickRotLoc,r=d.jumpTouchButtonLoc,a=d.rotByTouch,h&&d.touchControl&&(e.joystickToGameControls[s]="pos","walk"===d.moveMode&&(e.joystickToGameControls[r]="jmp"),"joystick"===a&&(e.joystickToGameControls[n]="rot"))}if(e.gameControl&&e.gameControl.data.navmesh.enabled){let i=e.gameControl.data;if(!e.navigationMeshWrapper){let o;e.navigationMeshWrapper=new $t(e.usePhysics,t.isExport),o="sphere"===i.collider.type?2*i.collider.radius:i.collider.height,o=Math.floor(o/i.navmesh.ch-1),e.navigationMeshWrapper.init({...i.navmesh,walkableHeight:o},e.gameControl,t.eventContext)}}return o},createJoysticks:function(t,e,i){t.joystickToGameControls.forEach((o,s)=>{let n=document.body.appendChild(document.createElement("div")),[r,a,h]=t.eventManager.eventContext.publish.joystickSizeAndXYOffset[s],l=(e-5*r)/4+r,c={},d="jmp"===o,m=d?0:r;s<10?(s<5?c.top=m/2:c.bottom=m/2,c.left=m/2+s%5*l):10===s?(c.left=m/2,c.top=i/2):(c.right=m/2,c.top=i/2),c.top?c.top-=a[1]:c.bottom+=a[1],c.left?c.left+=a[0]:c.right-=a[0];for(let t in c)c[t]+="px";if(d){let e=n.appendChild(document.createElement("div"));Object.assign(e.style,c,{position:"absolute",width:r+"px",height:r+"px",backgroundColor:`rgba(255,255,255,${"show"===h?.4:0})`,zIndex:"9999",borderRadius:r+"px",border:"show"===h?"solid 2px rgba(0, 0, 0, .1)":"none",display:"flex",alignItems:"center",justifyContent:"center",touchAction:"none"});let i=r/16*16*.4;return"show"===h&&(e.innerHTML=`\n\t\t\t\t\t\t<svg width="${i}" height="${.4*r}" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t\t\t<path d="M2 10L8 4L14 10" stroke="black" stroke-opacity="40%" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t`),e.addEventListener("pointerdown",()=>{t.gameControl.movementState.jump=1,t.requestRender()}),e.addEventListener("touchend",t=>t.preventDefault()),void(t.joysticks[s]=[void 0,n])}let p={zone:n,mode:"static",position:c,size:r};"hide"===h&&(p.restOpacity=0);let u=pt.create(p);u.on("move",(e,i)=>{let s=t.gameControl;"pos"===o?i.force<.2?s.moveForce=0:(s.movementState.movePosZ=Math.sin(-i.angle.radian),s.movementState.movePosX=Math.cos(-i.angle.radian),i.force>1.2?s.movementState.run=1:s.movementState.run=0,i.force<.3?s.moveForce=(i.force-.2)/.1:s.moveForce=1):"rot"===o&&(i.force<.2?s.rotForce=0:(s.movementState.rotPosX=i.vector.y,s.movementState.rotPosY=-i.vector.x,i.force<.3?s.rotForce=(i.force-.2)/.1:s.rotForce=1)),t.requestRender()}),u.on("end",(e,i)=>{let s=t.gameControl;"pos"===o?(s.movementState.movePosZ=0,s.movementState.movePosX=0,s.moveForce=1):"rot"===o&&(s.movementState.rotPosX=0,s.movementState.rotPosY=0,s.rotForce=1)}),t.joysticks[s]=[u,n]})}}),w("game-controls");
@@ -1 +0,0 @@
1
- import{k as r}from"./runtime-chunk-HJS3VFEN.js";import"./runtime-chunk-2Y73BLCY.js";import"./runtime-chunk-QZ35BPGB.js";import"./runtime-chunk-4KZXQGUQ.js";import"./runtime-chunk-Z5OH244S.js";import{a as i,d as m}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-OW6T4XFV.js";import"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";m("Hair",(i,m,n)=>new r(i,m,n)),i("hair");
@@ -1,3 +0,0 @@
1
- ���tc=7U��np^l�|�A�RKNC[��&��y��y��>H�%�q����Y�O��y�=�oS?n\`\ק|��;��@�8��s�N{��&�+�w;�M̊}풩S;oR���7�t�%<�>M�9��E�l�gxNj��N����d������H
2
- �KS>_
3
- L���!
Binary file
@@ -1 +0,0 @@
1
- import{b as e}from"./runtime-chunk-E6JCDSXC.js";import"./runtime-chunk-TDCFE5IE.js";import{a as r}from"./runtime-chunk-CTHMLYOZ.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{t}from"./runtime-chunk-2Y73BLCY.js";import"./runtime-chunk-QZ35BPGB.js";import"./runtime-chunk-4KZXQGUQ.js";import"./runtime-chunk-Z5OH244S.js";import"./runtime-chunk-TZCHGFVF.js";import{fa as i}from"./runtime-chunk-OW6T4XFV.js";import{ld as n}from"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";function a(e){let r;if(e.index)for(let t=0;t<e.index.array.length;t+=3)r=e.index.array[t],e.index.array[t]=e.index.array[t+2],e.index.array[t+2]=r}function o(r){return r instanceof e?"SubdivObject":"NonParametricGeometry"===r.geometry.type?"NonParametric":"Mesh"}function l(e,l){let s=function(e,r){let n={};return e.traverseEntity(e=>{if(!e.visible||!(e instanceof t)||"Mesh"!==e.type||Array.isArray(e.material)||e.states&&Object.keys(e.states).length)return;let a=e.parent;for(;a;){if(a instanceof t&&e.states&&Object.keys(e.states).length)return;a=a.parent}let l=e.material.uuid,s=r.shared.materials[l];if(s){if(!i.isMergable(s))return}else{let t=r.scene.objects.get(e.uuid)?.data;if(t&&"material"in t&&"string"!=typeof t.material){if(!i.isMergable(t.material))return;l=i.getHash(t.material)}}n[l]||(n[l]={});let u=n[l][o(e)];if(u){if(u.push(e),e.cloner)for(let r of e.cloner.children)u.push(r)}else if(n[l][o(e)]=[e],e.cloner)for(let r of e.cloner.children)n[l][o(e)].push(r)}),n}(l,e),u=function(e){let r=0;return Object.values(e).forEach(e=>{Object.values(e).forEach(e=>{let t=e.length;t>r&&(r=t)})}),r}(s),c=new Array(u),m=0,f=new Array(u),h=0,d=new Array(u),p=0,j=new Array(u),y=0;for(let[e,i]of Object.entries(s))for(let u of Object.values(i)){if(h=0,p=0,u.forEach(e=>{e instanceof t&&(f[h++]=e.geometry.clone(),d[p++]=e)}),p<2)continue;for(let e=0;e<p;e++)d[e].updateWorldMatrix(!0,!1),f[e].applyMatrix4(d[e].matrixWorld),d[e].matrixWorld.determinant()<0&&a(f[e]);let i=r(f.slice(0,h),!1);if(i){let r;"SubdivObject"===e?(console.warn("Turning subdiv object into mesh"),r=new n(i,d[0].material)):r=new n(i,d[0].material),r.castShadow=d[0].castShadow,r.receiveShadow=d[0].receiveShadow,l.add(r);let a=e=>{y=0;for(let r of e)r.children&&a(r.children),r instanceof t&&(Array.isArray(r.material)||s[r.material.uuid]&&s[r.material.uuid][o(r)]&&s[r.material.uuid][o(r)].length>1||(j[y++]=r));for(let e=0;e<y;e++)l.attach(j[e])};for(let e=0;e<p;e++){let r=d[e];a(r.children),c[m++]=r}}}for(let e=0;e<m;e++)c[e].removeFromParent()}export{l as mergeStaticGeometries,a as reverseWindingOrder};
@@ -1 +0,0 @@
1
- import{a as t,b as e,c as s,d as i}from"./runtime-chunk-QHPFAHXN.js";import"./runtime-chunk-P2XISQYQ.js";import{a as n}from"./runtime-chunk-NBYTQLIB.js";import{h as r}from"./runtime-chunk-I47C4XJU.js";import"./runtime-chunk-A2LYIKKC.js";import"./runtime-chunk-WSJURWOC.js";import"./runtime-chunk-TU4KDRKR.js";import{a as o,b as a}from"./runtime-chunk-DZNU62CT.js";import{a as h}from"./runtime-chunk-VAVYZ35B.js";import{e as c}from"./runtime-chunk-FQNSP44B.js";import"./runtime-chunk-RQ3ZQR4P.js";import"./runtime-chunk-TDCFE5IE.js";import"./runtime-chunk-BJVCOW72.js";import"./runtime-chunk-VRVV54WH.js";import"./runtime-chunk-CTHMLYOZ.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{f as u,g as m}from"./runtime-chunk-MM75L5X4.js";import"./runtime-chunk-2Y73BLCY.js";import{e as v,f as p}from"./runtime-chunk-QZ35BPGB.js";import"./runtime-chunk-4KZXQGUQ.js";import{a as d}from"./runtime-chunk-Z5OH244S.js";import{a as E}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-OW6T4XFV.js";import"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";var f=class{constructor(t,e,s,i,n,r){this.id=t,this.data=e,this.object=s,this.entered=!1,this.actions=u(e,e.actions,i,n,r,s)}disconnect(){m(this.actions)}dispatchEnter(){this.actions.Transition.forEach(t=>{t.object.currentTransitionEvent!==this&&(t.object.currentTransitionEvent=this,t.init())}),this.entered||(this.entered=!0,this.actions.TimelineAnimation.forEach(t=>t.playFromCurrent()),this.actions.Transition.forEach(t=>t.playFromCurrent()),this.actions.Animation.forEach(t=>t.play()),this.actions.Create.forEach(t=>t.dispatchStart()),this.actions.Particles.forEach(t=>t.dispatchBasic()),this.actions.Destroy.forEach(t=>t.dispatch()),this.actions.SwitchCamera.forEach(t=>t.playFromCurrent()),this.actions.SceneTransition.forEach(t=>t.dispatch()),this.actions.SetVariable.forEach(t=>t.checkConditions()),this.actions.SetVariable.forEach(t=>t.dispatch()),this.actions.DynamicVariablePlay.forEach(t=>t.dispatch()),this.actions.ClearLocalStorage.forEach(t=>t.dispatch()),this.actions.UserAPI.forEach(t=>t.dispatch()))}dispatchLeave(){this.actions.Transition.forEach(t=>{t.object.currentTransitionEvent!==this&&(t.object.currentTransitionEvent=this,t.init())}),this.entered&&(this.entered=!1,this.actions.TimelineAnimation.forEach(t=>t.reverseFromCurrent()),this.actions.Create.forEach(t=>t.dispatchStop()),this.actions.Transition.forEach(t=>t.reverseFromCurrent()),this.actions.Particles.forEach(t=>t.reverseFromCurrent()),this.actions.SwitchCamera.forEach(t=>t.reverseFromCurrent()))}dispatchUserEvent(t){this.actions.Transition.forEach(t=>{t.object.currentTransitionEvent!==this&&(t.object.currentTransitionEvent=this,t.init())}),t?(this.actions.Transition.forEach(t=>t.reverseFromCurrent()),this.actions.Particles.forEach(t=>t.reverseFromCurrent()),this.actions.Animation.forEach(t=>t.reverseFromCurrent()),this.actions.TimelineAnimation.forEach(t=>t.reverseFromCurrent()),this.actions.SwitchCamera.forEach(t=>t.reverseFromCurrent())):(this.actions.Transition.forEach(t=>t.playFromCurrent()),this.actions.Animation.forEach(t=>t.playFromCurrent()),this.actions.TimelineAnimation.forEach(t=>t.playFromCurrent()),this.actions.Create.forEach(t=>t.dispatch()),this.actions.Particles.forEach(t=>t.dispatchBasic()),this.actions.Destroy.forEach(t=>t.dispatch()),this.actions.SwitchCamera.forEach(t=>t.playFromCurrent())),this.actions.SceneTransition.forEach(t=>t.dispatch()),this.actions.SetVariable.forEach(t=>t.checkConditions()),this.actions.SetVariable.forEach(t=>t.dispatch()),this.actions.DynamicVariablePlay.forEach(t=>t.dispatch()),this.actions.ClearLocalStorage.forEach(t=>t.dispatch()),this.actions.UserAPI.forEach(t=>t.dispatch())}},j=class extends o{constructor(t,e){super(t),this.eventManager=e,this.eventsPerObjects={},this.objects=[],this.objects2D=[],this._prevObjects=[],this.onMouseDown=t=>{h.length>1||(this.eventContext.updateRaycaster(t),this.handleMouseHoverEvent())},this.onMouseUp=t=>{h.length>1||this.handleMouseHoverEvent(!0)},this.onMouseMove=t=>{h.length>1||(this.eventContext.updateRaycaster(t),this.handleMouseHoverEvent())},this.onUserEvent=({eventName:t,target:e,reverse:s})=>{if(!t||!e)return;let i=n(t);i&&"MouseHover"===i&&(e.dispatchEvent({type:"beginEvent",eventName:"MouseHover"}),this.eventsPerObjects[e.uuid]?.forEach(t=>t.dispatchUserEvent(s)))}}connect(){let{page:t,sharedAssets:e}=this.eventContext,s=(s,i)=>{if(s.visible&&s.data?.events.length){for(let{id:i,data:n}of s.data.events)if(!n.disabled&&"MouseHover"===n.type)try{let r=new f(i,n,s,t,e,this.eventManager);this.eventsPerObjects[s.uuid]?this.eventsPerObjects[s.uuid].push(r):this.eventsPerObjects[s.uuid]=[r]}catch(t){d&&console.error(t)}this.eventsPerObjects[s.uuid]?.length&&this.objects.push(v(s)?i:s)}};if(t.traverseEntity(t=>{(p(t)||t instanceof r)&&t.frame?.traverse(e=>{s(e,t)}),s(t)}),!this.objects.length)return;let{domElement:i}=this.eventContext;this.domEventsNeeded.clear(),c&&(this.domEventsNeeded.add("pointerdown"),i.addEventListener("pointerdown",this.onMouseDown),this.domEventsNeeded.add("pointerup"),i.addEventListener("pointerup",this.onMouseUp)),this.domEventsNeeded.add("pointermove"),i.addEventListener("pointermove",this.onMouseMove),this.objects.forEach(t=>{t.addEventListener("userEvent",this.onUserEvent)})}disconnect(){if(!this.objects.length)return;let{domElement:t}=this.eventContext;this.domEventsNeeded.clear(),c&&(t.removeEventListener("pointerdown",this.onMouseDown),t.removeEventListener("pointerup",this.onMouseUp)),t.removeEventListener("pointermove",this.onMouseMove),Object.values(this.eventsPerObjects).forEach(t=>{t.forEach(t=>{t.disconnect()})}),this.objects.forEach(t=>{t.removeEventListener("userEvent",this.onUserEvent)})}handleMouseHoverEvent(n=!1){let r=[];if(!n){let{stopRaycast:n,raycaster:o,page:a,pointerScreen:h}=this.eventContext,c=!1;if(a.uiCanvas&&(c=s(a,[h.x,h.y],Object.keys(this.eventsPerObjects),t=>{r.push(t)})),n&&!c){let i=t(o,a,this.objects);r=e(i),i.forEach(t=>{p(t.object)&&s(t.object,[t?.uv?.x??0,t?.uv?.y??0],Object.keys(this.eventsPerObjects),t=>{r.push(t)})})}else this.objects.forEach(t=>{let e=i(o,t);e&&(r.push(t),p(t)&&s(t,[e?.uv?.x??0,e?.uv?.y??0],Object.keys(this.eventsPerObjects),t=>{r.push(t)}))})}this._prevObjects.length&&this._prevObjects.forEach(t=>{r.includes(t)||(t.dispatchEvent({type:"beginEvent",eventName:"MouseHover"}),this.eventsPerObjects[t.uuid]?.forEach(t=>t.dispatchLeave()))}),r.length&&r.forEach(t=>{t.dispatchEvent({type:"beginEvent",eventName:"MouseHover"}),this.eventsPerObjects[t.uuid]?.forEach(t=>t.dispatchEnter())}),this._prevObjects=r}};a("MouseHover",({eventContext:t,eventManager:e})=>new j(t,e)),E("mousehover");
Binary file
Binary file
@@ -1 +0,0 @@
1
- import{h as t}from"./runtime-chunk-I47C4XJU.js";import"./runtime-chunk-A2LYIKKC.js";import"./runtime-chunk-WSJURWOC.js";import"./runtime-chunk-TU4KDRKR.js";import{a as i,b as s}from"./runtime-chunk-DZNU62CT.js";import"./runtime-chunk-RQ3ZQR4P.js";import"./runtime-chunk-TDCFE5IE.js";import"./runtime-chunk-VRVV54WH.js";import"./runtime-chunk-CTHMLYOZ.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{f as e,g as a}from"./runtime-chunk-MM75L5X4.js";import"./runtime-chunk-2Y73BLCY.js";import{f as n}from"./runtime-chunk-QZ35BPGB.js";import"./runtime-chunk-4KZXQGUQ.js";import{a as r}from"./runtime-chunk-Z5OH244S.js";import{a as o}from"./runtime-chunk-TZCHGFVF.js";import{u as c}from"./runtime-chunk-OW6T4XFV.js";import"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";var h=class{constructor(t,i,s,a,n,r,o,c){this.eventId=t,this.id=i,this.data=s,this.dataEvent=a,this.object=n,this.stage=!1,this.actions=e(a,s.actions,r,o,c,n)}disconnect(){a(this.actions)}dispatchIn(){this.actions.Audio.forEach(t=>t.dispatchBasic()),this.actions.Particles.forEach(t=>t.dispatchBasic()),this.actions.Video.forEach(t=>t.dispatchBasic()),this.actions.Create.forEach(t=>t.dispatch()),this.actions.Destroy.forEach(t=>t.dispatch()),this.actions.Reset.forEach(t=>t.dispatch()),this.actions.Link.forEach(t=>t.dispatch()),this.actions.Transition.forEach(t=>{t.object.currentTransitionEvent!==this&&(t.object.currentTransitionEvent=this,t.init())}),this.actions.Transition.forEach(t=>t.toggle()),this.actions.Animation.forEach(t=>t.play()),this.actions.SwitchCamera.forEach(t=>t.play()),this.actions.SceneTransition.forEach(t=>t.dispatch()),this.actions.SetVariable.forEach(t=>t.checkConditions()),this.actions.SetVariable.forEach(t=>t.dispatch()),this.actions.DynamicVariablePlay.forEach(t=>t.dispatch()),this.actions.ClearLocalStorage.forEach(t=>t.dispatch()),this.actions.UserAPI.forEach(t=>t.dispatch())}dispatchOut(){this.actions.Transition.forEach(t=>{t.toggle()})}},m=class extends i{constructor(t,i){super(t),this.eventManager=i,this.breakpoints=[],this.resize=(t,i)=>{this.breakpoints.forEach(s=>{let e,a=c.deviceToSize(s.data.size),n="horizontal"===s.dataEvent.orientation?t:i;switch(s.data.operator){case"<":e=n<a[0];break;case">":e=n>a[0];break;case"<>":e=n>a[0]&&n<a[1]}s.stage!==e&&(s.stage=e,s.stage?s.dispatchIn():s.dispatchOut())})},this.onResizeObserver=new ResizeObserver(t=>{for(let i of t){let{width:t,height:s}=i.contentRect;this.resize(t,s)}})}connect(){let{page:i,sharedAssets:s,domElement:e}=this.eventContext;this.onResizeObserver.observe(e);let a=t=>{if(t.visible&&t.data?.events.length)for(let{data:e,id:a}of t.data.events)e.disabled||"Resize"===e.type&&e.breakpoints.forEach(({data:n,id:o})=>{try{let r=new h(a,o,n,e,t,i,s,this.eventManager);this.breakpoints.push(r)}catch(t){r&&console.error(t)}})};i.traverseEntity(i=>{(n(i)||i instanceof t)&&i.frame?.traverse(t=>{a(t)}),a(i)})}disconnect(){this.onResizeObserver.disconnect(),this.breakpoints.forEach(t=>{t.disconnect()}),this.breakpoints=[]}};s("Resize",({eventContext:t,eventManager:i})=>new m(t,i)),o("resize");
Binary file
Binary file
Binary file
Binary file
@@ -1 +0,0 @@
1
- import{k as m}from"./runtime-chunk-FF5REN2J.js";import"./runtime-chunk-RAX4YJZF.js";import"./runtime-chunk-P3254QGK.js";import"./runtime-chunk-LSURXI4Y.js";import"./runtime-chunk-E6JCDSXC.js";import"./runtime-chunk-TDCFE5IE.js";import"./runtime-chunk-BJVCOW72.js";import"./runtime-chunk-VRVV54WH.js";import"./runtime-chunk-CTHMLYOZ.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import"./runtime-chunk-2Y73BLCY.js";import"./runtime-chunk-QZ35BPGB.js";import"./runtime-chunk-4KZXQGUQ.js";import"./runtime-chunk-Z5OH244S.js";import{a as n,f as r}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-OW6T4XFV.js";import"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";r("ShapeBlendGeometry",(n,r,t)=>new m(n,r,t)),n("shape-blends");
Binary file
Binary file
@@ -1 +0,0 @@
1
- import{a as t,b as e,c as i,d as a,e as n,f as s,h as r,i as o}from"./runtime-chunk-SKLNU6XK.js";import"./runtime-chunk-K4FLB6Y7.js";import"./runtime-chunk-NTUTXO7Q.js";import{a as l}from"./runtime-chunk-R43XZP65.js";import{a as d}from"./runtime-chunk-2SYZJBYJ.js";import{a as h,b as u}from"./runtime-chunk-A2LYIKKC.js";import"./runtime-chunk-WSJURWOC.js";import"./runtime-chunk-FTVQTRM7.js";import{a as c}from"./runtime-chunk-RQ3ZQR4P.js";import"./runtime-chunk-E6JCDSXC.js";import"./runtime-chunk-TDCFE5IE.js";import"./runtime-chunk-VRVV54WH.js";import{Y as m,ca as p}from"./runtime-chunk-CTHMLYOZ.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{b as g,e as f}from"./runtime-chunk-MM75L5X4.js";import"./runtime-chunk-2Y73BLCY.js";import{d as y}from"./runtime-chunk-QZ35BPGB.js";import"./runtime-chunk-4KZXQGUQ.js";import{a as v,h as x,i as M,j as C}from"./runtime-chunk-Z5OH244S.js";import{a as b}from"./runtime-chunk-TZCHGFVF.js";import{A as k,B as N,C as j,D as T,E as O,q as w,z as F}from"./runtime-chunk-OW6T4XFV.js";import{Bc as E,Cc as A}from"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";var L=0;function P(){L++}function I(t,e){return(e.epoch!==L||e.t!==t.t||e.index!==t.index)&&(e.epoch=L,e.t=t.t,e.index=t.index,!0)}function D(t,e,i,a){if(e){let n={},s=[...e.keyframes??[]].sort((t,e)=>t.data.time-e.data.time);if("data"in t){let e=s[0];e&&i?.(e.data.value,t),n={index:[],t:[]};for(let t=0;t<s.length-1;t++){let e=s[t],i=s[t+1]??e,a={duration:1e3*(i?.data?.time-e.data.time),delay:0===t?1e3*s[0].data.time:0};n.t.push({...a,value:t%2==0?1:0,easing:M(e.data.easing.type,{control1:x(e.data.easing.cubicControls?.control1,[0,0]),control2:x(i.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters)}),n.index.push({...a,value:t,easing:"linear"})}if(s.length>1){let e={t:0,index:0},r={t:NaN,index:NaN};return{targets:e,...n,update:()=>{if(!I(e,r))return;let n=Math.ceil(e.index),o=n%2==0?e.t:1-e.t,l=s?.[Math.min(n,s.length-1)].data.value,d=s?.[Math.min(n,s.length-1)+1]?.data.value,h={},u={};if(Object.keys(l).length>0&&Object.keys(d).length>0)for(let e in t.data)if(e in l&&e in d){let t=_(l[e],d[e],o,a);void 0!==t&&(h[e]=t,u[e]={start:l,end:d,t:o})}i?.({...h},t,u)}}}}}}function _(t,e,i,a){if("string"==typeof t&&a&&(t=a.color(t)),"string"==typeof e&&a&&(e=a.color(e)),"number"==typeof t)return A.lerp(t,e,i);if(O.is(t))return O.lerp(t,e,i);if(T.is(t))return T.lerp(t,e,i);if(Array.isArray(t))return(t.length>e.length?e:t).map((a,n)=>{if(Array.isArray(a)){let a=t[n].length>e[n].length?e[n].length:t[n].length;return(4===a?N:3===a?k:F).lerp(t[n],e[n],i)}return A.lerp(t[n],e[n],i)});if("object"==typeof t&&null!==t){let n={};for(let s in t){let r=_(t[s],e[s],i,a);void 0!==r&&(n[s]=r)}return n}}var S=new Map,H=new Map,B=class extends E{constructor(s,g,f,b,k,N,T){super(),this.id=s,this.data=g,this.scene=f,this.sharedAssets=b,this.object=k,this.eventType=N,this.actionCondition=T,this.toggleIsForward=!1,this._finished=!1,this.hasPlayedOnce=!1,this._shouldForwardLoop=!1,this._shouldPauseOnNextLoopComplete=!1,this.hiddenMatrixOverrides=[],this._onLoopComplete=()=>{this._shouldPauseOnNextLoopComplete&&(this.timeline.pause(),this._shouldPauseOnNextLoopComplete=!1)};try{let s=r(this.data);"number"==typeof s.loop&&s.loop--,this.timeline=l.timeline({...s,autoplay:!1}),this._shouldForwardLoop=!0===s.loop||"number"==typeof s.loop&&s.loop>1;let g=this.sharedAssets.data.timelineAnimations[this.data.timeline].mapping;Object.entries(g).forEach(([s,r])=>{let o=this.scene.find(s);if(!o)return;let l=o.data.timelineAnimations[r];if(!l)return;let g=o.data.states.data(r);g?.hiddenMatrix&&16===g.hiddenMatrix.length&&!j.isEqual(g.hiddenMatrix,o.data.hiddenMatrix)&&this.hiddenMatrixOverrides.push({objId:s,original:o.hiddenMatrix.clone(),state:g.hiddenMatrix});let v=function(n,s,r,o){let l=[];return s.properties.forEach(s=>{let g=s.data.path?.[0];if(g&&["position","rotation","scale"].includes(g)){let t=function(t,e=()=>{}){let i=[];for(let a of C){let n=[...t.keyframes??[]].filter(t=>void 0!==t.data.value[a]).sort((t,e)=>t.data.time-e.data.time),s=n[0];s&&e?.(s.data.value);let r={index:[],t:[]};for(let t=0;t<n.length-1;t++){let e=n[t],i=n[t+1]??e,a={duration:1e3*(i?.data?.time-e.data.time),delay:0===t?1e3*n[0].data.time:0};r.t.push({...a,value:t%2==0?1:0,easing:M(e.data.easing.type,{control1:x(e.data.easing.cubicControls?.control1,[0,0]),control2:x(i.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters)}),r.index.push({...a,value:t,easing:"linear"})}if(n.length>1){let t={t:0,index:0},s={t:NaN,index:NaN};i.push({targets:t,...r,update:()=>{if(!I(t,s))return;let i=Math.ceil(t.index),r=i%2==0?t.t:1-t.t,o=n?.[i].data.value,l=n?.[i+1]?.data.value;void 0!==o&&void 0!==l&&e?.({[a]:o[a]+(l[a]-o[a])*r})}})}}return i}(s.data,r?.[g]);t&&l.push(...t)}if(g&&"shape size"===g&&"geometry"in n){let t=function(t,e,i){let a=[];for(let t of C){let n={},s=[...e.keyframes??[]].filter(e=>void 0!==e.data.value[t]).sort((t,e)=>t.data.time-e.data.time),r=s[0];r&&i?.(r.data.value),n={index:[],t:[]};for(let t=0;t<s.length-1;t++){let e=s[t],i=s[t+1]??e,a={duration:1e3*(i?.data?.time-e.data.time),delay:0===t?1e3*s[0].data.time:0};n.t.push({...a,value:t%2==0?1:0,easing:M(e.data.easing.type,{control1:x(e.data.easing.cubicControls?.control1,[0,0]),control2:x(i.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters)}),n.index.push({...a,value:t,easing:"linear"})}if(s.length>1){let e={t:0,index:0},r={t:NaN,index:NaN};a.push({targets:e,...n,update:()=>{if(!I(e,r))return;let a=Math.ceil(e.index),n=a%2==0?e.t:1-e.t,o=s?.[a].data.value,l=s?.[a+1]?.data.value;void 0!==o&&void 0!==l&&i?.({[t]:o[t]+(l[t]-o[t])*n})}})}}return a}(0,s.data,r?.shapeSize);t&&l.push(...t)}if(g&&"path extrusion"===g&&y(n)){let e=function(e,i,a){let n={},s=[...i.keyframes??[]].sort((t,e)=>t.data.time-e.data.time),r=s[0];r&&a?.(e,r.data.value),n={index:[],t:[]};for(let t=0;t<s.length-1;t++){let e=s[t],i=s[t+1]??e,a={duration:1e3*(i?.data?.time-e.data.time),delay:0===t?1e3*s[0].data.time:0};n.t.push({...a,value:t%2==0?1:0,easing:M(e.data.easing.type,{control1:x(e.data.easing.cubicControls?.control1,[0,0]),control2:x(i.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters)}),n.index.push({...a,value:t,easing:"linear"})}if(s.length>1){let i={t:0,index:0},r={t:NaN,index:NaN};return{targets:i,...n,update:()=>{if(!I(i,r))return;let n=Math.ceil(i.index),o=n%2==0?i.t:1-i.t,l=s?.[Math.min(n,s.length-1)].data.value,d=s?.[Math.min(n,s.length-1)+1]?.data.value;a?.(e,t(e,l,d,o))}}}}(n,s.data,r?.pathExtrusion);e&&l.push(e)}if(g&&"path snapping"===g&&n.data.pathSnapping){let t=function(t,i,a){let n={},s=[...i.keyframes??[]].sort((t,e)=>t.data.time-e.data.time),r=s[0];r&&a?.(r.data.value),n={index:[],t:[]};for(let t=0;t<s.length-1;t++){let e=s[t],i=s[t+1]??e,a={duration:1e3*(i?.data?.time-e.data.time),delay:0===t?1e3*s[0].data.time:0};n.t.push({...a,value:t%2==0?1:0,easing:M(e.data.easing.type,{control1:x(e.data.easing.cubicControls?.control1,[0,0]),control2:x(i.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters)}),n.index.push({...a,value:t,easing:"linear"})}if(s.length>1){let i={t:0,index:0},r={t:NaN,index:NaN};return{targets:i,...n,update:()=>{if(!I(i,r))return;let n=Math.ceil(i.index),o=n%2==0?i.t:1-i.t,l=s?.[Math.min(n,s.length-1)].data.value,d=s?.[Math.min(n,s.length-1)+1]?.data.value;a?.(e(t,l,d,o))}}}}(n,s.data,r?.pathSnapping);t&&l.push(t)}if(g&&"material"===g&&"Mesh"===n.type&&"material"in n){let t=p(n.material)?n.material:void 0;if(t){let e=s.data.id;if(e){let i=(s.data.keyframes??[]).some(t=>m(t.data.value?.noiseStrength)),a=t.ensureRainbowNoiseCompiled,n=e=>{i&&"function"==typeof a&&a.call(t,e)};n(e);let d=t.getLayerByUuid(e);if(d){let t=D(d,s.data,r?.material,o);t&&l.push(t)}else{let e=s.data.type;for(let i of t.getLayersOfType(e))n(i.uuid);let i=t.getLayersOfType(e);if(i)for(let t of i){let e=D(t,s.data,r?.material,o);e&&l.push(e)}}}}}if(g&&"opacity"===g&&"Mesh"===n.type&&"material"in n){let t=function(t,e){if(t){let i={},a=[...t.keyframes??[]].sort((t,e)=>t.data.time-e.data.time),n=a[0];n&&e?.(n.data.value),i={index:[],t:[]};for(let t=0;t<a.length-1;t++){let e=a[t],n=a[t+1]??e,s={duration:1e3*(n?.data?.time-e.data.time),delay:0===t?1e3*a[0].data.time:0};i.t.push({...s,value:t%2==0?1:0,easing:M(e.data.easing.type,{control1:x(e.data.easing.cubicControls?.control1,[0,0]),control2:x(n.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters)}),i.index.push({...s,value:t,easing:"linear"})}if(a.length>1){let t={t:0,index:0},n={t:NaN,index:NaN};return{targets:t,...i,update:()=>{if(!I(t,n))return;let i=Math.ceil(t.index),s=i%2==0?t.t:1-t.t,r=a?.[Math.min(i,a.length-1)].data.value,o=a?.[Math.min(i,a.length-1)+1]?.data.value;e?.(A.lerp(r,o,s))}}}}}(s.data,r?.opacity);t&&l.push(t)}if(g&&"cloner"===g){let t=function(t,e,n){let s={},r=[...e.keyframes??[]].sort((t,e)=>t.data.time-e.data.time),o=r[0];o&&n?.(t,o.data.value,o.data.value),s={index:[],t:[]};for(let t=0;t<r.length-1;t++){let e=r[t],i=r[t+1]??e,a={duration:1e3*(i?.data?.time-e.data.time),delay:0===t?1e3*r[0].data.time:0};s.t.push({...a,value:t%2==0?1:0,easing:M(e.data.easing.type,{control1:x(e.data.easing.cubicControls?.control1,[0,0]),control2:x(i.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters)}),s.index.push({...a,value:t,easing:"linear"})}if(r.length>1){let e={t:0,index:0},o={t:NaN,index:NaN};return{targets:e,...s,update:()=>{if(!I(e,o))return;let s=Math.ceil(e.index),l=s%2==0?e.t:1-e.t,d=r?.[Math.min(s,r.length-1)].data.value,h=r?.[Math.min(s,r.length-1)+1]?.data.value;n?.(t,d.randomnessObject?void 0:i(d,h,l,t),d.randomnessObject?a(d,h,l,t):void 0)}}}}(n,s.data,r?.cloner);t&&l.push(t)}if(g&&"camera"===g&&n instanceof c){let t=function(t,e,i,a){if(e){let n={[a]:[]},s=[...e.keyframes??[]].sort((t,e)=>t.data.time-e.data.time),r=s[0];r&&(t[a]=r.data.value,i?.(a,r.data.value));for(let t=0;t<s.length-1;t++){let e=s[t];if(!Number.isFinite(e.data.value))continue;let i=s[t+1]??e;n[a].push({value:i.data.value,easing:M(e.data.easing.type,{control1:x(e.data.easing.cubicControls?.control1,[0,0]),control2:x(i.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters),duration:1e3*(i?.data?.time-e.data.time),delay:0===t?1e3*s[0].data.time:0})}if(s.length>1)return{targets:t,...n,update:()=>{i?.(a,t[a])}}}}(n,s.data,r?.camera,"zoom");t&&l.push(t)}if(g&&"light"===g&&(n instanceof h||n instanceof d||n instanceof u)){let t=function(t,e,i,a,n){if(e){let s={},r=[...e.keyframes??[]].sort((t,e)=>t.data.time-e.data.time),o=r[0];if(o){let e=o.data.value;t[a]=e,i?.(a,e)}s={index:[],t:[]};for(let t=0;t<r.length-1;t++){let e=r[t],i=r[t+1]??e,a={duration:1e3*(i?.data?.time-e.data.time),delay:0===t?1e3*r[0].data.time:0};s.t.push({...a,value:t%2==0?1:0,easing:M(e.data.easing.type,{control1:x(e.data.easing.cubicControls?.control1,[0,0]),control2:x(i.data.easing.cubicControls?.control2,[1,1])},e.data.easing.springParameters)}),s.index.push({...a,value:t,easing:"linear"})}if(r.length>1){let t={t:0,index:0},e={t:NaN,index:NaN};return{targets:t,...s,update:()=>{if(!I(t,e))return;let s=Math.ceil(t.index),o=s%2==0?t.t:1-t.t,l=r?.[Math.min(s,r.length-1)].data.value,d=r?.[Math.min(s,r.length-1)+1]?.data.value;i?.(a,_(l,d,o,n))}}}}}(n,s.data,r?.light,s.data.path[1],o);t&&l.push(t)}}),l}(o,{...l},n(o,{scene:f,shared:b}),this.sharedAssets),k=("start"===this.data.delayDirection?this.data.delay:0)+("start-end"===this.data.delayDirection?this.data.delay:0)+("start-once"===this.data.delayDirection?this.data.delay:0);v.forEach(t=>{this.timeline.add(t,k)}),this.timeline.duration=1e3*l.to+k}),this.timeline.delay=0,this.timeline.duration+=("start"===this.data.delayDirection?this.data.delay:0)+("end"===this.data.delayDirection?this.data.delay:0)+("start-end"===this.data.delayDirection?2*this.data.delay:0)+("start-once"===this.data.delayDirection?2*this.data.delay:0),this.timeline.finished.then(()=>{Object.keys(g).forEach(t=>{let e=this.scene.find(t);e instanceof c&&e.dispatchEvent(o)}),this._finished=!0}),this.timeline.loopComplete=this._onLoopComplete}catch(t){throw v&&console.error(t),new Error("Missing property")}k&&(H.has(k.uuid)?H.get(k.uuid).push(this):H.set(k.uuid,[this])),S.set(s,this)}get playing(){return!1===this.timeline.paused}get finished(){return this._finished}get paused(){return this.timeline.paused}applyStateHiddenMatrices(){for(let{objId:t,state:e}of this.hiddenMatrixOverrides){let i=this.scene.find(t);i&&i.hiddenMatrix.fromArray(e)}}restoreOriginalHiddenMatrices(){for(let{objId:t,original:e}of this.hiddenMatrixOverrides){let i=this.scene.find(t);i&&i.hiddenMatrix.copy(e)}}play(){let t=void 0!==this.eventType&&w(this.eventType)&&"Once"===this.data.runMode&&this.hasPlayedOnce&&this.paused&&this.timeline.currentTime>0&&!this._finished;if(void 0!==this.eventType&&w(this.eventType)&&"Once"===this.data.runMode&&this.hasPlayedOnce&&!t||void 0===this.eventType&&this._finished)return!1;this.hasPlayedOnce=!0,this.applyStateHiddenMatrices();let e=this.sharedAssets.data.timelineAnimations[this.data.timeline].mapping;Object.keys(e).forEach(t=>{let e=this.scene.find(t);e instanceof c&&e.dispatchEvent(s)}),P(),this.paused&&this.timeline.currentTime>0?this.timeline.play():this.timeline.restart()}pauseTimeline(){this.paused||this.timeline.pause()}pause(){this.pauseTimeline()}stop(){this.pauseTimeline(),this.seek(0),this.timeline.reset(),this.restoreOriginalHiddenMatrices(),this._finished=!1}seek(t){this.timeline.seek(t*this.timeline.duration,!0)}toggle(t){let e=this.paused&&this.timeline.currentTime>0&&this.timeline.currentTime<this.timeline.duration;if(void 0!==t?this.toggleIsForward=t:e||(this.toggleIsForward=!this.toggleIsForward),this.playing){if(!this.toggleIsForward&&this.timeline.reversed&&this._shouldForwardLoop&&this.timeline.remaining%2==1)return void(this._shouldPauseOnNextLoopComplete=!0);this.timeline.reverse(this.timeline.duration-this.timeline.currentTime),this._shouldForwardLoop&&this.timeline.loop&&this.timeline.reversed&&(this._shouldPauseOnNextLoopComplete=!0)}else this.applyStateHiddenMatrices(),P(),(!this.toggleIsForward!==this.timeline.reversed||!this.toggleIsForward&&this.timeline.reversed&&"alternate"===this.timeline.direction)&&this.timeline.reverse(),"number"==typeof this.timeline.loop&&"number"==typeof this.timeline.remaining&&this.timeline.remaining<this.timeline.loop&&this.toggleIsForward&&(this.timeline.remaining=this.timeline.loop),this.timeline.play()}playFromCurrent(){this.toggle(!0)}reverseFromCurrent(){this.toggle(!1)}dispose(){this.pauseTimeline(),this.restoreOriginalHiddenMatrices()}},Y=class{constructor(t){this.data=t}dispatch(){this.data.playTimeline?this.pauseTimeline(this.data.playTimeline):this.data.object?this.pauseAllTimelinesFromObject(this.data.object):this.pauseAllTimelines()}pauseTimeline(t){let e=this.getTimelineActions(t);!e.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{e.forEach(t=>{t[this.data.interaction]()}),this.disposeDelay()},this.data.delay)):e.forEach(t=>{t[this.data.interaction]()}))}getTimelineActions(t){let e=S.get(t);return e?[e]:[...S.values()].filter(e=>e.data.timeline===t)}pauseAllTimelinesFromObject(t){let e=H.get(t);!e?.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{e.forEach(t=>t[this.data.interaction]()),this.disposeDelay()},this.data.delay)):e.forEach(t=>t[this.data.interaction]()))}pauseAllTimelines(){let t=[...H.values()];!t.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{t.forEach(t=>{t.forEach(t=>{t[this.data.interaction]()})}),this.disposeDelay()},this.data.delay)):t.forEach(t=>{t.forEach(t=>{t[this.data.interaction]()})}))}disposeDelay(){clearTimeout(this.timeoutId),delete this.timeoutId}dispose(){clearTimeout(this.timeoutId),delete this.timeoutId}},Z=class{constructor(t,e,i,a,n,s,r){this.data=e;let o="interaction"in e?e.interaction:"play";if("play"===o||void 0===o)this.interaction=new B(t,e,i,a,n,s,r);else{if("pause"!==o&&"stop"!==o)throw new Error("Missing property");this.interaction=new Y(e)}}get playing(){return this.interaction instanceof B&&this.interaction.playing}get finished(){return!(this.interaction instanceof B)||this.interaction.finished}get paused(){return!(this.interaction instanceof B)||this.interaction.paused}play(){if(this.interaction instanceof B)return this.interaction.play();this.interaction.dispatch()}stop(){this.interaction instanceof B&&this.interaction.stop()}seek(t){this.interaction instanceof B&&this.interaction.seek(t)}toggle(t){this.interaction instanceof B?this.interaction.toggle(t):this.interaction.dispatch()}playFromCurrent(){this.interaction instanceof B?this.interaction.playFromCurrent():this.interaction.dispatch()}dispatchConditional(){this.interaction instanceof B?f(this.interaction.sharedAssets,this.interaction.actionCondition)&&this.interaction.playFromCurrent():this.interaction.dispatch()}reverseFromCurrent(){this.interaction instanceof B&&this.interaction.reverseFromCurrent()}dispose(){this.interaction.dispose()}};g("TimelineAnimation",({id:t,data:e,page:i,shared:a,object:n,eventType:s,actionCondition:r})=>new Z(t,e,i.scene,a,n,s,r)),b("timeline");
@@ -1 +0,0 @@
1
- import{a as e}from"./runtime-chunk-CVUJ3GMH.js";import{a as t,b as i,c as r,d as a,f as s,g as n,h,i as d,j as o,k as m,l as c,m as l,n as u}from"./runtime-chunk-K4FLB6Y7.js";import"./runtime-chunk-NTUTXO7Q.js";import"./runtime-chunk-FTVQTRM7.js";import{I as p,ea as f}from"./runtime-chunk-CTHMLYOZ.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{b as v}from"./runtime-chunk-2Y73BLCY.js";import"./runtime-chunk-QZ35BPGB.js";import"./runtime-chunk-4KZXQGUQ.js";import{f as g,g as y}from"./runtime-chunk-Z5OH244S.js";import{a as w,f as O,j as P}from"./runtime-chunk-TZCHGFVF.js";import{E as j}from"./runtime-chunk-OW6T4XFV.js";import{Ae as b,Ba as x,Bd as R,Cc as S,Lc as F,Le as T,bd as H,ce as B,dd as I,ld as W}from"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";function D(e,t,i,r){return r?i:2048/Math.max(1,e,t)}var M=new b(-1,1,1,-1,0,1),U=new class extends I{constructor(){super(),this.setAttribute("position",new H([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new H([0,2,0,0,2,0],2))}},E=new B({defines:{},uniforms:{tDiffuse:new T(null)},vertexShader:"\n\tvarying vec2 vUv;\n\tvoid main() {\n\t\tvUv = uv;\n\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t}",fragmentShader:"\n\tuniform sampler2D tDiffuse;\n\tvarying vec2 vUv;\n\tvoid main() {\n\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\tgl_FragColor = texel;\n\t}"}),G=new class{constructor(e){this._mesh=new W(U,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,M)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}(E),z=null,k=null,C=t.identity(),_=class{constructor(t,i,r,s){var n;this.uuid=t,this.width=i,this.height=r,this.context=s,this.enabled=!0,this.isScreenSpace=!1,this.dpr=window.devicePixelRatio,this.isFrameDirty=!1,this.onRenderRequestedDownstream=()=>{this.isFrameDirty=!0,this.isScreenSpace||e(this),this.context.shared.requestRender()},this._innerApplySize=()=>{let e=this.width,t=this.height;this.renderer.dpr=D(e,t,this.dpr,this.isScreenSpace),this.renderer.setSize(e,t)},this.onFrameOverrideObjectEvent=e=>{if(void 0!==e.target?.uuid){let t=this.frameRoot?.find(e.target.uuid);t&&t.dispatchEvent({...e,target:t})}},this.scene2d=new l(S.generateUUID(),y.defaultData,{dpr:window.devicePixelRatio,shared:s.shared}),this.canvas=(null===z&&(z=document.createElement("canvas")),z),this.renderer=(n=this.canvas,null===k&&(k=new a(n)),k),this.promise=this.init(),this.renderTarget=new F(1,1,{type:x,stencilBuffer:!1,depthBuffer:!1}),s.shared.addUIBuffer(this.uuid,this.renderTarget),this.textureHolder=s.shared.uiBuffer(this.uuid)}get canvasTexture(){return this._canvasTexture||(this._canvasTexture=new R(this.canvas)),this._canvasTexture}async init(){await this.renderer.init()}render(e){if(this.isFrameDirty){if(this.isFrameDirty=!1,this._innerApplySize(),this.renderer.clear(),this.frameOverride?.draw(this.renderer),this.renderer.render(),this.canvasTexture.needsUpdate=!0,e.blitTextureToTarget)e.blitTextureToTarget(this.canvasTexture,this.renderTarget);else{E.uniforms.tDiffuse.value=this.canvasTexture;let t=e.getRenderTarget();e.setRenderTarget(this.renderTarget),e.clear(),G.render(e),e.setRenderTarget(t)}this.textureHolder?.setNeedsUpdate(!0)}}updateEntity2DByOp(e,t,i,r){this.scene2d.updateEntityByOp(e,t,i,r),this.applySize()}updateTreeByOp(e,t){this.scene2d.updateTreeByOp(e,t),this.applySize()}applyOverrides(e){if(this.frameOverride&&this.frameRoot){this.frameOverride.position=[0,0],this.frameOverride.rotation=0;let t=e?.width??this.width,i=e?.height??this.height;this.frameOverride.width=t,this.frameOverride.height=i,this.frameOverride.localMatrix=C,this.isScreenSpace&&(this.frameOverride.fill.color=j.from0to1([0,0,0,0])),this.frameOverride.data={...this.frameOverride.data,width:t,height:i},L({objectOverride:this.frameOverride,objectRoot:this.frameRoot,newParentWidth:this.frameOverride.width,newParentHeight:this.frameOverride.height,initialParentWidth:this.frameRoot.width,initialParentHeight:this.frameRoot.height}),this.frameOverride.updateWorldMatrix(!0,!1,!0)}}applySize(e,t=window.devicePixelRatio){let i=Math.max(1,e?.width??this.width),r=Math.max(1,e?.height??this.height);this.dpr=t,this.width=i,this.height=r,this._innerApplySize();let a=function(e,t,i,r){let a=D(e,t,i,r),s=Math.max(i,512/Math.min(e,t)),n=Math.min(s,a);return{width:Math.max(1,Math.ceil(e*n)),height:Math.max(1,Math.ceil(t*n))}}(i,r,t,this.isScreenSpace);this.renderTarget.setSize(a.width,a.height),this._canvasTexture?.dispose(),this._canvasTexture=void 0,this.applyOverrides(e),this.frameOverride?.requestRender()}applyFrame(e){let t=this.context.scene.find2D(e);if(t&&t instanceof o)return this.disposeFrameOverride(),this.frameRoot=t,this.frameOverride=t.clone({dpr:this.renderer.dpr,shared:this.context.shared}),this.scene2d.add(this.frameOverride),this.applySize(),this.frame?.addEventListener("render",this.onRenderRequestedDownstream),this.frameOverride.traverse(e=>{e.addEventListener("beginState",this.onFrameOverrideObjectEvent)}),this.frameOverride.traverse(e=>{e.addEventListener("completeState",this.onFrameOverrideObjectEvent)}),this.frame?.requestRender(),t}get frame(){return this.frameOverride}get frameId(){return this.frame?.uuid}find(e){return this.scene2d.find(e)}get texture(){return this.textureHolder?.getTexture(1001)}disposeFrameOverride(){this.frameOverride?.removeEventListener("render",this.onRenderRequestedDownstream),this.frameOverride?.traverse(e=>{e.removeEventListener("beginStateChange",this.onFrameOverrideObjectEvent)}),this.frameOverride?.traverse(e=>{e.removeEventListener("completeState",this.onFrameOverrideObjectEvent)}),this.frameOverride&&this.scene2d.remove(this.frameOverride)}};function L({objectOverride:e,objectRoot:t,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s}){if(e instanceof o&&t instanceof o||e instanceof d&&t instanceof d)for(let n=0,h=e.children.length;n<h;n++){let h=e.children[n],d=t.children[n];h&&d&&h.uuid===d.uuid&&V({objectOverride:h,objectRoot:d,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s})}}function V({objectOverride:e,objectRoot:t,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s}){let[n,h]=function(e){if(A(e))return[e.width,e.height];if(e instanceof m){let[t,i]=e.getHalfSize();return[2*t,2*i]}if(e instanceof d){let[t,i]=e.recursiveBBox.getHalfSize();return[2*t,2*i]}return[0,0]}(t),{width:o,height:l,position:p}=u({constraints:e.data,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s,objectInitialWidth:n,objectInitialHeight:h,objectInitialPosition:t.position});if(e.position=p,e.data={...e.data,position:p},e.states)for(let n in e.states)q({stateId:n,objectOverride:e,objectRoot:t,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s});if(A(e)||e instanceof d)A(e)&&(e.width=o,e.height=l,e.data={...e.data,width:o,height:l}),L({objectOverride:e,objectRoot:t,newParentWidth:o,newParentHeight:l,initialParentWidth:n,initialParentHeight:h});else if(e instanceof m){let i=t,r=0!==n?o/n:1,a=0!==h?l/h:1;e.path=c(i.path,r,a),e.data={...e.data,path:e.path}}}function q({stateId:e,objectOverride:t,objectRoot:i,newParentWidth:r,newParentHeight:a,initialParentWidth:s,initialParentHeight:n}){let h=t.states?.[e],d=i.states?.[e];if(h&&d){let{width:i,height:o,position:m}=u({constraints:t.data,newParentWidth:r,newParentHeight:a,initialParentWidth:s,initialParentHeight:n,objectInitialWidth:g.isResizeable(d)?d.width:0,objectInitialHeight:g.isResizeable(d)?d.height:0,objectInitialPosition:d.position});Object.assign(t.states[e],{position:m}),g.isResizeable(h)&&Object.assign(t.states[e],{width:i,height:o})}}function A(e){return e instanceof n||e instanceof o||e instanceof s||e instanceof h}var Y=class extends f{constructor(e,t,i){super(e,t,i),this.isUIObject=!0,this.uiCanvas=new _(e+"-canvas",t.geometry.width,t.geometry.height,i),this.uiCanvas.promise.then(()=>{this.applyFrame(this.dataPatched.geometry.frame,i.shared)})}updateByPatchedOpGeometry(e,t,i){super.updateByPatchedOpGeometry(e,t,i),0===e.type&&(void 0!==e.props.frame&&this.applyFrame(e.props.frame,i.shared),(void 0!==e.props.width||void 0!==e.props.height)&&this.applySize(e.props,i.shared))}applySize(e,t){let i=e?.width??this.dataPatched.geometry.width,r=e?.height??this.dataPatched.geometry.height;this.uiCanvas.applySize({width:i,height:r}),this.applyGeometryParametersFromFrame(t)}applyFrame(e,t){this.uiCanvas.applyFrame(e),this.applyGeometryParametersFromFrame(t),this.applyMaterialParametersFromFrame({shared:t})}applyGeometryParametersFromFrame(e){let t=this.frame;t&&(Object.assign(this.data,{geometry:Object.assign(this.data.geometry,{cornerRadius:t.cornerRadius,cornerType:0})}),Object.assign(this.dataPatched,{geometry:Object.assign(this.dataPatched.geometry,{cornerRadius:t.cornerRadius,cornerType:0})}),this.localGeometry?.dispose(),this.localGeometry=p(this.dataPatched.geometry,e,this.data.flatShading,this))}applyMaterialParametersFromFrame(e){let t=this.frame;if(t){let i=t.data.backgroundBlur;Object.assign(this.data.material.layers[0].data.texture,{image:this.uiCanvas.uuid}),Object.assign(this.data.material.layers[1].data,{roughness:i.radius,alpha:i.enabled?1:0}),Object.assign(this.dataPatched.material.layers[0].data.texture,{image:this.uiCanvas.uuid}),Object.assign(this.dataPatched.material.layers[1].data,{roughness:i.radius,alpha:i.enabled?1:0}),this.material.reset?.(this.dataPatched.material,e,!0)}}updateEntity2DByOp(e,t,i,r){this.uiCanvas.updateEntity2DByOp(e,t,i,r),e===this.frameId&&0===t.type&&(void 0!==t.props.cornerRadius?this.applyGeometryParametersFromFrame(r):v(t.path,["backgroundBlur"])&&this.applyMaterialParametersFromFrame({shared:r}))}get frame(){return this.uiCanvas.frame}get frameId(){return this.frame?.uuid}removeInteractionGeometry(e){super.removeInteractionGeometry(e),this.applySize({},e)}updateGeometryInteractions(e,t){super.updateGeometryInteractions(e,t),this.applySize({width:e.width,height:e.height},t);let i={...this.data.geometry,...e};this.localGeometry?.dispose(),this.localGeometry=p(i,t,this.data.flatShading,this)}};O("UIGeometry",(e,t,i)=>new Y(e,t,i)),P({Scene2D:l,UICanvas:_,loadHanaUIRUNTIME:r,setHanaUIWasmUrl:i}),w("ui-2d");
Binary file
Binary file
@@ -1 +0,0 @@
1
- import{c as t}from"./runtime-chunk-FQNSP44B.js";import{b as i,e}from"./runtime-chunk-MM75L5X4.js";import{e as s}from"./runtime-chunk-QZ35BPGB.js";import"./runtime-chunk-Z5OH244S.js";import{a}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-OW6T4XFV.js";import"./runtime-chunk-VGN7YHB7.js";import"./runtime-chunk-ML3Z74BL.js";var o=new Map,n=new Map,d=class{constructor(i,e,s){this.data=e,this.isPlayVideoAction=!0,this.delay=0,this.status="stopped";let{layerId:a,loop:d,volume:h,delay:l}=e;if(this.object=s,void 0===a)throw new Error("Missing property");let r=function(t,i){let e;if("material"in t){let s=t.material;e=Array.isArray(s)?t.material[0].layers.find(t=>t.uuid===i):t.material.layers.find(t=>t.uuid===i)}if(e)return e.color.texture.image.img instanceof HTMLVideoElement?e.color.texture.image.img:void 0}(s,a);r&&(this.videoElement=r,this.videoElement.loop=d===1/0,t&&(this.videoElement.autoplay=!0),void 0!==h&&(this.videoElement.volume=h)),void 0!==l&&(this.delay=l),n.has(s.uuid)?n.get(s.uuid).push(this):n.set(s.uuid,[this]),o.set(i,this),this.pause()}mute(){!this.videoElement||(this.videoElement.muted=!0)}unMute(){!this.videoElement||(this.videoElement.muted=!1)}play(t){if(!this.videoElement)return;let i=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);t?(this.mute(),this.delay+=150):i?(this.mute(),window.setTimeout(()=>{this.unMute()},100)):this.unMute(),this.delayTimerId=window.setTimeout(()=>{if(!this.videoElement)return;let t=this.videoElement.play();void 0!==t&&t.then(t=>{}).catch(t=>{this.play()}),this.clearDelay()},this.delay),this.status="playing"}clearDelay(){this.delayTimerId&&(clearTimeout(this.delayTimerId),delete this.delayTimerId)}pause(){!this.videoElement||(this.videoElement.pause(),this.status="paused")}stop(){!this.videoElement||(this.videoElement.pause(),this.videoElement.currentTime=0,this.status="stopped",this.clearDelay())}seek(t){return new Promise(i=>{if(!this.videoElement)return i();let e=this.videoElement.duration;if(e>0){let i=t%e;this.videoElement.currentTime=i}this.videoElement.addEventListener("seeked",()=>i(),{once:!0})})}playByToggle(){"stop"===this.data.toggle?"playing"===this.status?this.stop():(this.stop(),this.play()):"pause"===this.data.toggle?"playing"===this.status?this.pause():this.play():(this.stop(),this.play())}dispose(){!this.videoElement||(this.stop(),this.videoElement.muted=!0)}},h=class{constructor(t){this.data=t,this.isPauseVideoAction=!0}dispatch(){this.data.playVideo?this.pauseVideo(this.data.playVideo):this.data.object?this.pauseAllVideosFromObject(this.data.object):this.pauseAllVideos()}pauseVideo(t){let i=o.get(t);!i||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{i[this.data.interaction](),this.disposeDelay()},this.data.delay)):i[this.data.interaction]())}pauseAllVideosFromObject(t){let i=n.get(t);!i?.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{i.forEach(t=>t[this.data.interaction]()),this.disposeDelay()},this.data.delay)):i.forEach(t=>t[this.data.interaction]()))}pauseAllVideos(){let t=[...n.values()];!t.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{t.forEach(t=>{t.forEach(t=>{t[this.data.interaction]()})}),this.disposeDelay()},this.data.delay)):t.forEach(t=>{t.forEach(t=>{t[this.data.interaction]()})}))}disposeDelay(){clearTimeout(this.timeoutId),delete this.timeoutId}dispose(){clearTimeout(this.timeoutId),delete this.timeoutId}},l=class{constructor(t,i,e,s,a){if(this.data=i,this.shared=s,this.condition=a,"play"===i.interaction)this.interaction=new d(t,i,e);else{if("pause"!==i.interaction&&"stop"!==i.interaction)throw new Error("Missing property");this.interaction=new h(i)}}dispatchBasic(){if(!1===e(this.shared,this.condition))return!1;this.interaction instanceof d?this.interaction.playByToggle():this.interaction.dispatch()}dispatchConditional(){if(!1===e(this.shared,this.condition))return!1;this.interaction instanceof d?this.interaction.play():this.interaction.dispatch()}dispose(){this.interaction.dispose()}};i("Video",({id:t,data:i,object:e,shared:a,actionCondition:o})=>s(e)?null:new l(t,i,e,a,o)),a("video");
Binary file
Binary file