@splinetool/runtime 2.0.123 → 2.0.124

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 (329) hide show
  1. package/build/{runtime-bloom-MTFDC7ER.js → runtime-bloom-DVFHBWOB.js} +1 -1
  2. package/build/runtime-bloom-DVFHBWOB.js.br +0 -0
  3. package/build/runtime-bloom-DVFHBWOB.js.gz +0 -0
  4. package/build/{runtime-brightnessContrast-YXIZNFR6.js → runtime-brightnessContrast-HWFQFRLA.js} +1 -1
  5. package/build/runtime-brightnessContrast-HWFQFRLA.js.br +0 -0
  6. package/build/runtime-brightnessContrast-HWFQFRLA.js.gz +0 -0
  7. package/build/{runtime-chromaticAberration-DPZTGTJC.js → runtime-chromaticAberration-FZKTQ4IM.js} +1 -1
  8. package/build/runtime-chromaticAberration-FZKTQ4IM.js.br +0 -0
  9. package/build/runtime-chromaticAberration-FZKTQ4IM.js.gz +0 -0
  10. package/build/{runtime-chunk-X6SMMPOO.js → runtime-chunk-52L5HXRS.js} +1 -1
  11. package/build/runtime-chunk-52L5HXRS.js.br +0 -0
  12. package/build/runtime-chunk-52L5HXRS.js.gz +0 -0
  13. package/build/{runtime-chunk-6NZUY3NX.js → runtime-chunk-52XHS3BX.js} +1 -1
  14. package/build/runtime-chunk-52XHS3BX.js.br +0 -0
  15. package/build/runtime-chunk-52XHS3BX.js.gz +0 -0
  16. package/build/{runtime-chunk-4CCT57BJ.js → runtime-chunk-572KWUWI.js} +1 -1
  17. package/build/runtime-chunk-572KWUWI.js.br +0 -0
  18. package/build/runtime-chunk-572KWUWI.js.gz +0 -0
  19. package/build/{runtime-chunk-AFG7F56V.js → runtime-chunk-6MTJKHSU.js} +1 -1
  20. package/build/runtime-chunk-6MTJKHSU.js.br +0 -0
  21. package/build/runtime-chunk-6MTJKHSU.js.gz +0 -0
  22. package/build/{runtime-chunk-P7LY5VJF.js → runtime-chunk-6TUDCDM4.js} +1 -1
  23. package/build/runtime-chunk-6TUDCDM4.js.br +0 -0
  24. package/build/runtime-chunk-6TUDCDM4.js.gz +0 -0
  25. package/build/{runtime-chunk-MOV6HDQG.js → runtime-chunk-BTT6ICNO.js} +1 -1
  26. package/build/runtime-chunk-BTT6ICNO.js.br +0 -0
  27. package/build/runtime-chunk-BTT6ICNO.js.gz +0 -0
  28. package/build/{runtime-chunk-MKJIY6KV.js → runtime-chunk-BX43KXFS.js} +1 -1
  29. package/build/runtime-chunk-BX43KXFS.js.br +0 -0
  30. package/build/runtime-chunk-BX43KXFS.js.gz +0 -0
  31. package/build/{runtime-chunk-MXQFKZNI.js → runtime-chunk-CPSGTRIU.js} +1 -1
  32. package/build/runtime-chunk-CPSGTRIU.js.br +0 -0
  33. package/build/runtime-chunk-CPSGTRIU.js.gz +0 -0
  34. package/build/{runtime-chunk-DJCYPXS4.js → runtime-chunk-CXDAMTG7.js} +1 -1
  35. package/build/runtime-chunk-CXDAMTG7.js.br +0 -0
  36. package/build/runtime-chunk-CXDAMTG7.js.gz +0 -0
  37. package/build/{runtime-chunk-TY3IYRYE.js → runtime-chunk-ED2A7PP4.js} +1 -1
  38. package/build/runtime-chunk-ED2A7PP4.js.br +0 -0
  39. package/build/runtime-chunk-ED2A7PP4.js.gz +0 -0
  40. package/build/{runtime-chunk-5RKX6VXQ.js → runtime-chunk-EO3MYP4F.js} +1 -1
  41. package/build/{runtime-chunk-5RKX6VXQ.js.br → runtime-chunk-EO3MYP4F.js.br} +0 -0
  42. package/build/runtime-chunk-EO3MYP4F.js.gz +0 -0
  43. package/build/{runtime-chunk-N6B2CRAR.js → runtime-chunk-GD7NQHRN.js} +1 -1
  44. package/build/runtime-chunk-GD7NQHRN.js.br +0 -0
  45. package/build/runtime-chunk-GD7NQHRN.js.gz +0 -0
  46. package/build/{runtime-chunk-3Q4J5ROW.js → runtime-chunk-HFHERTRJ.js} +1 -1
  47. package/build/runtime-chunk-HFHERTRJ.js.br +0 -0
  48. package/build/{runtime-chunk-3Q4J5ROW.js.gz → runtime-chunk-HFHERTRJ.js.gz} +0 -0
  49. package/build/{runtime-chunk-W2OWSMDC.js → runtime-chunk-HO57WDLD.js} +1 -1
  50. package/build/runtime-chunk-HO57WDLD.js.br +0 -0
  51. package/build/{runtime-chunk-W2OWSMDC.js.gz → runtime-chunk-HO57WDLD.js.gz} +0 -0
  52. package/build/{runtime-chunk-OQCWMRSW.js → runtime-chunk-IIF6BGTE.js} +1 -1
  53. package/build/runtime-chunk-IIF6BGTE.js.br +0 -0
  54. package/build/runtime-chunk-IIF6BGTE.js.gz +0 -0
  55. package/build/{runtime-chunk-2ZZAZQTN.js → runtime-chunk-L2OWHEXV.js} +1 -1
  56. package/build/runtime-chunk-L2OWHEXV.js.br +0 -0
  57. package/build/runtime-chunk-L2OWHEXV.js.gz +0 -0
  58. package/build/{runtime-chunk-7OHCCGTO.js → runtime-chunk-MB67H2FU.js} +1 -1
  59. package/build/runtime-chunk-MB67H2FU.js.br +0 -0
  60. package/build/runtime-chunk-MB67H2FU.js.gz +0 -0
  61. package/build/{runtime-chunk-JQCHQ4ER.js → runtime-chunk-PMIN6YLE.js} +1 -1
  62. package/build/runtime-chunk-PMIN6YLE.js.br +0 -0
  63. package/build/runtime-chunk-PMIN6YLE.js.gz +0 -0
  64. package/build/{runtime-chunk-PZQ2H4BA.js → runtime-chunk-PYFOBRYQ.js} +1 -1
  65. package/build/runtime-chunk-PYFOBRYQ.js.br +0 -0
  66. package/build/runtime-chunk-PYFOBRYQ.js.gz +0 -0
  67. package/build/{runtime-chunk-CLDWHXJJ.js → runtime-chunk-RA5UBNOL.js} +1 -1
  68. package/build/runtime-chunk-RA5UBNOL.js.br +0 -0
  69. package/build/runtime-chunk-RA5UBNOL.js.gz +0 -0
  70. package/build/{runtime-chunk-C54LYWKE.js → runtime-chunk-RO7ZJXF7.js} +1 -1
  71. package/build/runtime-chunk-RO7ZJXF7.js.br +0 -0
  72. package/build/runtime-chunk-RO7ZJXF7.js.gz +0 -0
  73. package/build/{runtime-chunk-R3EYG5KF.js → runtime-chunk-SPZI3GXK.js} +1 -1
  74. package/build/runtime-chunk-SPZI3GXK.js.br +0 -0
  75. package/build/runtime-chunk-SPZI3GXK.js.gz +0 -0
  76. package/build/{runtime-chunk-DOGUWR2L.js → runtime-chunk-UU4RVNYR.js} +1 -1
  77. package/build/runtime-chunk-UU4RVNYR.js.br +0 -0
  78. package/build/runtime-chunk-UU4RVNYR.js.gz +0 -0
  79. package/build/{runtime-chunk-ERT6AFRF.js → runtime-chunk-VRSEKOAY.js} +1 -1
  80. package/build/runtime-chunk-VRSEKOAY.js.br +0 -0
  81. package/build/runtime-chunk-VRSEKOAY.js.gz +0 -0
  82. package/build/{runtime-chunk-NYHKYL7K.js → runtime-chunk-WHPDVM2L.js} +1 -1
  83. package/build/runtime-chunk-WHPDVM2L.js.br +0 -0
  84. package/build/runtime-chunk-WHPDVM2L.js.gz +0 -0
  85. package/build/{runtime-chunk-QJ4BBCAT.js → runtime-chunk-WJLC6EDK.js} +1 -1
  86. package/build/runtime-chunk-WJLC6EDK.js.br +0 -0
  87. package/build/runtime-chunk-WJLC6EDK.js.gz +0 -0
  88. package/build/{runtime-chunk-DO3TPFJ2.js → runtime-chunk-WUWFEW2T.js} +1 -1
  89. package/build/runtime-chunk-WUWFEW2T.js.br +0 -0
  90. package/build/runtime-chunk-WUWFEW2T.js.gz +0 -0
  91. package/build/{runtime-chunk-FL4HJTIV.js → runtime-chunk-XSRLFWNM.js} +1 -1
  92. package/build/runtime-chunk-XSRLFWNM.js.br +2 -0
  93. package/build/runtime-chunk-XSRLFWNM.js.gz +0 -0
  94. package/build/{runtime-classicRuntime-LDYJDIR6.js → runtime-classicRuntime-CRJSSD2G.js} +1 -1
  95. package/build/runtime-classicRuntime-CRJSSD2G.js.br +0 -0
  96. package/build/runtime-classicRuntime-CRJSSD2G.js.gz +0 -0
  97. package/build/{runtime-cloners-5UKOYERM.js → runtime-cloners-ROR7LHR7.js} +1 -1
  98. package/build/runtime-cloners-ROR7LHR7.js.br +1 -0
  99. package/build/runtime-cloners-ROR7LHR7.js.gz +0 -0
  100. package/build/{runtime-components-Q72F4GJN.js → runtime-components-IAJWOMNX.js} +1 -1
  101. package/build/runtime-components-IAJWOMNX.js.br +0 -0
  102. package/build/runtime-components-IAJWOMNX.js.gz +0 -0
  103. package/build/{runtime-createDestroy-NYPVZJK3.js → runtime-createDestroy-SGGSOQV7.js} +1 -1
  104. package/build/runtime-createDestroy-SGGSOQV7.js.br +0 -0
  105. package/build/runtime-createDestroy-SGGSOQV7.js.gz +0 -0
  106. package/build/{runtime-depthOfField-SC6THZD3.js → runtime-depthOfField-IVXPS6WV.js} +1 -1
  107. package/build/runtime-depthOfField-IVXPS6WV.js.br +0 -0
  108. package/build/runtime-depthOfField-IVXPS6WV.js.gz +0 -0
  109. package/build/{runtime-dragDrop-FTW7Y7BP.js → runtime-dragDrop-DIUK5RQB.js} +1 -1
  110. package/build/runtime-dragDrop-DIUK5RQB.js.br +0 -0
  111. package/build/runtime-dragDrop-DIUK5RQB.js.gz +0 -0
  112. package/build/{runtime-fxBloom-4HB5FTK3.js → runtime-fxBloom-F5CJCYLW.js} +1 -1
  113. package/build/runtime-fxBloom-F5CJCYLW.js.br +0 -0
  114. package/build/runtime-fxBloom-F5CJCYLW.js.gz +0 -0
  115. package/build/{runtime-fxDepthOfField-URCQCIRP.js → runtime-fxDepthOfField-O2HNRRG5.js} +1 -1
  116. package/build/runtime-fxDepthOfField-O2HNRRG5.js.br +0 -0
  117. package/build/runtime-fxDepthOfField-O2HNRRG5.js.gz +0 -0
  118. package/build/{runtime-gameControls-3DLBZLBK.js → runtime-gameControls-ERBN7JSZ.js} +1 -1
  119. package/build/runtime-gameControls-ERBN7JSZ.js.br +0 -0
  120. package/build/runtime-gameControls-ERBN7JSZ.js.gz +0 -0
  121. package/build/{runtime-hair-BUO7NHNF.js → runtime-hair-NTZJH4B3.js} +1 -1
  122. package/build/runtime-hair-NTZJH4B3.js.br +1 -0
  123. package/build/runtime-hair-NTZJH4B3.js.gz +0 -0
  124. package/build/{runtime-hueSaturation-FS6CRWZ5.js → runtime-hueSaturation-HZ26MFR3.js} +1 -1
  125. package/build/runtime-hueSaturation-HZ26MFR3.js.br +0 -0
  126. package/build/runtime-hueSaturation-HZ26MFR3.js.gz +0 -0
  127. package/build/{runtime-mergeStaticGeometries-QE3FFNBP.js → runtime-mergeStaticGeometries-NDVF7F46.js} +1 -1
  128. package/build/runtime-mergeStaticGeometries-NDVF7F46.js.br +0 -0
  129. package/build/runtime-mergeStaticGeometries-NDVF7F46.js.gz +0 -0
  130. package/build/{runtime-miscActions-2NTZVLGS.js → runtime-miscActions-MKTPF55J.js} +1 -1
  131. package/build/runtime-miscActions-MKTPF55J.js.br +0 -0
  132. package/build/runtime-miscActions-MKTPF55J.js.gz +0 -0
  133. package/build/{runtime-mouseHover-RBUSQ55V.js → runtime-mouseHover-XGXNPWN7.js} +1 -1
  134. package/build/runtime-mouseHover-XGXNPWN7.js.br +0 -0
  135. package/build/runtime-mouseHover-XGXNPWN7.js.gz +0 -0
  136. package/build/{runtime-noise-FSTUGJBX.js → runtime-noise-YI5BGDQU.js} +1 -1
  137. package/build/runtime-noise-YI5BGDQU.js.br +0 -0
  138. package/build/runtime-noise-YI5BGDQU.js.gz +0 -0
  139. package/build/{runtime-particles-M4RVYDCT.js → runtime-particles-VTCPE34Q.js} +1 -1
  140. package/build/runtime-particles-VTCPE34Q.js.br +0 -0
  141. package/build/runtime-particles-VTCPE34Q.js.gz +0 -0
  142. package/build/{runtime-paths-TCYUKIIU.js → runtime-paths-ISVKTEHJ.js} +1 -1
  143. package/build/runtime-paths-ISVKTEHJ.js.br +0 -0
  144. package/build/runtime-paths-ISVKTEHJ.js.gz +0 -0
  145. package/build/{runtime-pixelation-BXF4L42G.js → runtime-pixelation-GMNCU7I2.js} +1 -1
  146. package/build/runtime-pixelation-GMNCU7I2.js.br +0 -0
  147. package/build/runtime-pixelation-GMNCU7I2.js.gz +0 -0
  148. package/build/{runtime-resize-JOI3L7XJ.js → runtime-resize-CRHU2LAU.js} +1 -1
  149. package/build/runtime-resize-CRHU2LAU.js.br +0 -0
  150. package/build/runtime-resize-CRHU2LAU.js.gz +0 -0
  151. package/build/{runtime-sceneTransition-WCZ3L5ZZ.js → runtime-sceneTransition-VMOABRTP.js} +1 -1
  152. package/build/runtime-sceneTransition-VMOABRTP.js.br +0 -0
  153. package/build/runtime-sceneTransition-VMOABRTP.js.gz +0 -0
  154. package/build/{runtime-scroll-OOIYYKTK.js → runtime-scroll-F6ODKLM2.js} +1 -1
  155. package/build/runtime-scroll-F6ODKLM2.js.br +0 -0
  156. package/build/runtime-scroll-F6ODKLM2.js.gz +0 -0
  157. package/build/runtime-shapeBlends-PSNLJPBO.js +1 -0
  158. package/build/runtime-shapeBlends-PSNLJPBO.js.br +0 -0
  159. package/build/runtime-shapeBlends-PSNLJPBO.js.gz +0 -0
  160. package/build/{runtime-text-ZOVHZSQE.js → runtime-text-6NEG7VQF.js} +1 -1
  161. package/build/runtime-text-6NEG7VQF.js.br +0 -0
  162. package/build/runtime-text-6NEG7VQF.js.gz +0 -0
  163. package/build/{runtime-textInputs-JHNYKYEY.js → runtime-textInputs-IFCQP2QS.js} +1 -1
  164. package/build/runtime-textInputs-IFCQP2QS.js.br +0 -0
  165. package/build/runtime-textInputs-IFCQP2QS.js.gz +0 -0
  166. package/build/{runtime-timeline-H7XVA3G4.js → runtime-timeline-2XHFP5P3.js} +1 -1
  167. package/build/runtime-timeline-2XHFP5P3.js.br +0 -0
  168. package/build/runtime-timeline-2XHFP5P3.js.gz +0 -0
  169. package/build/{runtime-tracking-HHKQG7E6.js → runtime-tracking-IQCNEVYG.js} +1 -1
  170. package/build/runtime-tracking-IQCNEVYG.js.br +0 -0
  171. package/build/runtime-tracking-IQCNEVYG.js.gz +0 -0
  172. package/build/{runtime-transitions-S5HKMABM.js → runtime-transitions-NIQOYHZD.js} +1 -1
  173. package/build/runtime-transitions-NIQOYHZD.js.br +0 -0
  174. package/build/runtime-transitions-NIQOYHZD.js.gz +0 -0
  175. package/build/{runtime-ui2d-IUJJVWOF.js → runtime-ui2d-QCINIFZV.js} +1 -1
  176. package/build/runtime-ui2d-QCINIFZV.js.br +0 -0
  177. package/build/runtime-ui2d-QCINIFZV.js.gz +0 -0
  178. package/build/{runtime-vectorShapes-6YOGOL6H.js → runtime-vectorShapes-KO5RAHCG.js} +1 -1
  179. package/build/runtime-vectorShapes-KO5RAHCG.js.br +0 -0
  180. package/build/runtime-vectorShapes-KO5RAHCG.js.gz +0 -0
  181. package/build/{runtime-vignette-4FYDSJ6O.js → runtime-vignette-5U3YPYM4.js} +1 -1
  182. package/build/runtime-vignette-5U3YPYM4.js.br +0 -0
  183. package/build/runtime-vignette-5U3YPYM4.js.gz +0 -0
  184. package/build/runtime-webgpu-UZJHW7R7.js +1 -0
  185. package/build/runtime-webgpu-UZJHW7R7.js.br +0 -0
  186. package/build/runtime-webgpu-UZJHW7R7.js.gz +0 -0
  187. package/build/runtime.cjs +7 -7
  188. package/build/runtime.js +1 -1
  189. package/build/runtime.js.br +0 -0
  190. package/build/runtime.js.gz +0 -0
  191. package/build/runtime.standalone.js +1 -1
  192. package/build/runtime.standalone.js.br +0 -0
  193. package/build/runtime.standalone.js.gz +0 -0
  194. package/build/runtime.standalone.webgl.js +1 -1
  195. package/build/runtime.standalone.webgl.js.br +0 -0
  196. package/build/runtime.standalone.webgl.js.gz +0 -0
  197. package/build/runtime.standalone.webgpu.js +1 -1
  198. package/build/runtime.standalone.webgpu.js.br +0 -0
  199. package/build/runtime.standalone.webgpu.js.gz +0 -0
  200. package/build/runtime.standalone.webgpu.micro.js +1 -1
  201. package/build/runtime.standalone.webgpu.micro.js.br +0 -0
  202. package/build/runtime.standalone.webgpu.micro.js.gz +0 -0
  203. package/build/runtime.standalone.webgpu.min.js +1 -1
  204. package/build/runtime.standalone.webgpu.min.js.br +0 -0
  205. package/build/runtime.standalone.webgpu.min.js.gz +0 -0
  206. package/package.json +1 -1
  207. package/build/runtime-bloom-MTFDC7ER.js.br +0 -0
  208. package/build/runtime-bloom-MTFDC7ER.js.gz +0 -0
  209. package/build/runtime-brightnessContrast-YXIZNFR6.js.br +0 -0
  210. package/build/runtime-brightnessContrast-YXIZNFR6.js.gz +0 -0
  211. package/build/runtime-chromaticAberration-DPZTGTJC.js.br +0 -0
  212. package/build/runtime-chromaticAberration-DPZTGTJC.js.gz +0 -0
  213. package/build/runtime-chunk-2ZZAZQTN.js.br +0 -0
  214. package/build/runtime-chunk-2ZZAZQTN.js.gz +0 -0
  215. package/build/runtime-chunk-3Q4J5ROW.js.br +0 -0
  216. package/build/runtime-chunk-4CCT57BJ.js.br +0 -0
  217. package/build/runtime-chunk-4CCT57BJ.js.gz +0 -0
  218. package/build/runtime-chunk-5RKX6VXQ.js.gz +0 -0
  219. package/build/runtime-chunk-6NZUY3NX.js.br +0 -0
  220. package/build/runtime-chunk-6NZUY3NX.js.gz +0 -0
  221. package/build/runtime-chunk-7OHCCGTO.js.br +0 -0
  222. package/build/runtime-chunk-7OHCCGTO.js.gz +0 -0
  223. package/build/runtime-chunk-AFG7F56V.js.br +0 -0
  224. package/build/runtime-chunk-AFG7F56V.js.gz +0 -0
  225. package/build/runtime-chunk-C54LYWKE.js.br +0 -0
  226. package/build/runtime-chunk-C54LYWKE.js.gz +0 -0
  227. package/build/runtime-chunk-CLDWHXJJ.js.br +0 -0
  228. package/build/runtime-chunk-CLDWHXJJ.js.gz +0 -0
  229. package/build/runtime-chunk-DJCYPXS4.js.br +0 -0
  230. package/build/runtime-chunk-DJCYPXS4.js.gz +0 -0
  231. package/build/runtime-chunk-DO3TPFJ2.js.br +0 -0
  232. package/build/runtime-chunk-DO3TPFJ2.js.gz +0 -0
  233. package/build/runtime-chunk-DOGUWR2L.js.br +0 -0
  234. package/build/runtime-chunk-DOGUWR2L.js.gz +0 -0
  235. package/build/runtime-chunk-ERT6AFRF.js.br +0 -4
  236. package/build/runtime-chunk-ERT6AFRF.js.gz +0 -0
  237. package/build/runtime-chunk-FL4HJTIV.js.br +0 -1
  238. package/build/runtime-chunk-FL4HJTIV.js.gz +0 -0
  239. package/build/runtime-chunk-JQCHQ4ER.js.br +0 -0
  240. package/build/runtime-chunk-JQCHQ4ER.js.gz +0 -0
  241. package/build/runtime-chunk-MKJIY6KV.js.br +0 -0
  242. package/build/runtime-chunk-MKJIY6KV.js.gz +0 -0
  243. package/build/runtime-chunk-MOV6HDQG.js.br +0 -0
  244. package/build/runtime-chunk-MOV6HDQG.js.gz +0 -0
  245. package/build/runtime-chunk-MXQFKZNI.js.br +0 -0
  246. package/build/runtime-chunk-MXQFKZNI.js.gz +0 -0
  247. package/build/runtime-chunk-N6B2CRAR.js.br +0 -0
  248. package/build/runtime-chunk-N6B2CRAR.js.gz +0 -0
  249. package/build/runtime-chunk-NYHKYL7K.js.br +0 -0
  250. package/build/runtime-chunk-NYHKYL7K.js.gz +0 -0
  251. package/build/runtime-chunk-OQCWMRSW.js.br +0 -0
  252. package/build/runtime-chunk-OQCWMRSW.js.gz +0 -0
  253. package/build/runtime-chunk-P7LY5VJF.js.br +0 -0
  254. package/build/runtime-chunk-P7LY5VJF.js.gz +0 -0
  255. package/build/runtime-chunk-PZQ2H4BA.js.br +0 -0
  256. package/build/runtime-chunk-PZQ2H4BA.js.gz +0 -0
  257. package/build/runtime-chunk-QJ4BBCAT.js.br +0 -0
  258. package/build/runtime-chunk-QJ4BBCAT.js.gz +0 -0
  259. package/build/runtime-chunk-R3EYG5KF.js.br +0 -0
  260. package/build/runtime-chunk-R3EYG5KF.js.gz +0 -0
  261. package/build/runtime-chunk-TY3IYRYE.js.br +0 -0
  262. package/build/runtime-chunk-TY3IYRYE.js.gz +0 -0
  263. package/build/runtime-chunk-W2OWSMDC.js.br +0 -0
  264. package/build/runtime-chunk-X6SMMPOO.js.br +0 -0
  265. package/build/runtime-chunk-X6SMMPOO.js.gz +0 -0
  266. package/build/runtime-classicRuntime-LDYJDIR6.js.br +0 -0
  267. package/build/runtime-classicRuntime-LDYJDIR6.js.gz +0 -0
  268. package/build/runtime-cloners-5UKOYERM.js.br +0 -0
  269. package/build/runtime-cloners-5UKOYERM.js.gz +0 -0
  270. package/build/runtime-components-Q72F4GJN.js.br +0 -0
  271. package/build/runtime-components-Q72F4GJN.js.gz +0 -0
  272. package/build/runtime-createDestroy-NYPVZJK3.js.br +0 -0
  273. package/build/runtime-createDestroy-NYPVZJK3.js.gz +0 -0
  274. package/build/runtime-depthOfField-SC6THZD3.js.br +0 -0
  275. package/build/runtime-depthOfField-SC6THZD3.js.gz +0 -0
  276. package/build/runtime-dragDrop-FTW7Y7BP.js.br +0 -0
  277. package/build/runtime-dragDrop-FTW7Y7BP.js.gz +0 -0
  278. package/build/runtime-fxBloom-4HB5FTK3.js.br +0 -0
  279. package/build/runtime-fxBloom-4HB5FTK3.js.gz +0 -0
  280. package/build/runtime-fxDepthOfField-URCQCIRP.js.br +0 -0
  281. package/build/runtime-fxDepthOfField-URCQCIRP.js.gz +0 -0
  282. package/build/runtime-gameControls-3DLBZLBK.js.br +0 -0
  283. package/build/runtime-gameControls-3DLBZLBK.js.gz +0 -0
  284. package/build/runtime-hair-BUO7NHNF.js.br +0 -1
  285. package/build/runtime-hair-BUO7NHNF.js.gz +0 -0
  286. package/build/runtime-hueSaturation-FS6CRWZ5.js.br +0 -0
  287. package/build/runtime-hueSaturation-FS6CRWZ5.js.gz +0 -0
  288. package/build/runtime-mergeStaticGeometries-QE3FFNBP.js.br +0 -0
  289. package/build/runtime-mergeStaticGeometries-QE3FFNBP.js.gz +0 -0
  290. package/build/runtime-miscActions-2NTZVLGS.js.br +0 -0
  291. package/build/runtime-miscActions-2NTZVLGS.js.gz +0 -0
  292. package/build/runtime-mouseHover-RBUSQ55V.js.br +0 -0
  293. package/build/runtime-mouseHover-RBUSQ55V.js.gz +0 -0
  294. package/build/runtime-noise-FSTUGJBX.js.br +0 -0
  295. package/build/runtime-noise-FSTUGJBX.js.gz +0 -0
  296. package/build/runtime-particles-M4RVYDCT.js.br +0 -0
  297. package/build/runtime-particles-M4RVYDCT.js.gz +0 -0
  298. package/build/runtime-paths-TCYUKIIU.js.br +0 -0
  299. package/build/runtime-paths-TCYUKIIU.js.gz +0 -0
  300. package/build/runtime-pixelation-BXF4L42G.js.br +0 -0
  301. package/build/runtime-pixelation-BXF4L42G.js.gz +0 -0
  302. package/build/runtime-resize-JOI3L7XJ.js.br +0 -0
  303. package/build/runtime-resize-JOI3L7XJ.js.gz +0 -0
  304. package/build/runtime-sceneTransition-WCZ3L5ZZ.js.br +0 -0
  305. package/build/runtime-sceneTransition-WCZ3L5ZZ.js.gz +0 -0
  306. package/build/runtime-scroll-OOIYYKTK.js.br +0 -0
  307. package/build/runtime-scroll-OOIYYKTK.js.gz +0 -0
  308. package/build/runtime-shapeBlends-CNWTYEO4.js +0 -1
  309. package/build/runtime-shapeBlends-CNWTYEO4.js.br +0 -2
  310. package/build/runtime-shapeBlends-CNWTYEO4.js.gz +0 -0
  311. package/build/runtime-text-ZOVHZSQE.js.br +0 -0
  312. package/build/runtime-text-ZOVHZSQE.js.gz +0 -0
  313. package/build/runtime-textInputs-JHNYKYEY.js.br +0 -0
  314. package/build/runtime-textInputs-JHNYKYEY.js.gz +0 -0
  315. package/build/runtime-timeline-H7XVA3G4.js.br +0 -0
  316. package/build/runtime-timeline-H7XVA3G4.js.gz +0 -0
  317. package/build/runtime-tracking-HHKQG7E6.js.br +0 -0
  318. package/build/runtime-tracking-HHKQG7E6.js.gz +0 -0
  319. package/build/runtime-transitions-S5HKMABM.js.br +0 -0
  320. package/build/runtime-transitions-S5HKMABM.js.gz +0 -0
  321. package/build/runtime-ui2d-IUJJVWOF.js.br +0 -0
  322. package/build/runtime-ui2d-IUJJVWOF.js.gz +0 -0
  323. package/build/runtime-vectorShapes-6YOGOL6H.js.br +0 -0
  324. package/build/runtime-vectorShapes-6YOGOL6H.js.gz +0 -0
  325. package/build/runtime-vignette-4FYDSJ6O.js.br +0 -0
  326. package/build/runtime-vignette-4FYDSJ6O.js.gz +0 -0
  327. package/build/runtime-webgpu-CXYFPHFD.js +0 -1
  328. package/build/runtime-webgpu-CXYFPHFD.js.br +0 -0
  329. package/build/runtime-webgpu-CXYFPHFD.js.gz +0 -0
@@ -1 +1 @@
1
- import{a as t}from"./runtime-chunk-X6SMMPOO.js";import{a as e,b as i}from"./runtime-chunk-DZNU62CT.js";import{a as s}from"./runtime-chunk-VAVYZ35B.js";import{c as n}from"./runtime-chunk-FQNSP44B.js";import"./runtime-chunk-JQCHQ4ER.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import"./runtime-chunk-W2OWSMDC.js";import"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-R5WCGKXX.js";import{a as r,f as a}from"./runtime-chunk-TZCHGFVF.js";import{D as o,Ia as h}from"./runtime-chunk-CSILWFMF.js";import{Fc as l,Hc as p,Ic as u,Uc as d,Xc as c,Xd as g,dd as m,fd as v,l as x,md as I,nd as y,td as M}from"./runtime-chunk-KPOUV3HD.js";import"./runtime-chunk-ML3Z74BL.js";var f=class extends t{constructor(t,e,i){super(t,e,i),this.data=e}},C=class extends d{constructor(){super(),this.caretIndex=0,this._caretVisibleAlpha=1,this._selectionVisibleAlpha=.3,this.current={start:0,end:void 0},this.matrixAutoUpdate=!1,this.caretMesh=new y(new g(1,1),new I({transparent:!0,opacity:0,side:x})),this.add(this.caretMesh),this.selectionMesh=new y(new g(1,1),new I({color:2857471,transparent:!0,depthTest:!1,depthWrite:!1,opacity:0,side:x})),this.add(this.selectionMesh),this.hide()}get caretHeight(){return this.object?.AD??0}show(t){this.visible=!0,this.object=t,this.caretMesh.scale.set(1,this.caretHeight,1),this.caretMesh.position.y=.5*-this.caretHeight,this.setCaretPosition(this.caretIndex),this.update()}hide(){this.visible=!1}update(){if(void 0===this.object)return;this.updateHelperMatrix();let{depth:t}=this.object.geometry.userData.parameters;this.caretMesh.position.z=t,this.selectionMesh.position.z=t}updateHelperMatrix(){if(void 0===this.object)return;let t=this.object,e=t.parent;null!==e&&e.updateWorldMatrix(!0,!1),t.matrixAutoUpdate&&t.updateMatrix(),null!==e?(this.matrixWorld.copy(e.matrixWorld),this.matrixWorld.multiplyMatrices(this.matrixWorld,t.matrix)):this.matrixWorld.copy(t.matrix),this.matrix.copy(this.matrixWorld);for(let t of this.children)t.matrixWorld.copy(this.matrixWorld);t.updateWorldMatrix(!0,!0)}setCaretColor(t){let e=this.caretMesh.material;e.color.setRGB(t.r,t.g,t.b);let i=this._caretVisibleAlpha===e.opacity;this._caretVisibleAlpha=t.a,i&&(e.opacity=this._caretVisibleAlpha)}setSelectionColor(t){this.selectionMesh.material.color.setRGB(t.r,t.g,t.b)}setCaretPosition(t,e={}){if(void 0===this.object)return;this.caretIndex=t;let i=this.object.wrappedText,[s,n]=_(i,t),[r,a]=t>0?_(i,t-1):[null,null];"\n"===(t>0&&i.length?i[r].charAt(a):null)&&(s++,n=0),this.current.start=t,this.current.end=void 0;let[o,h]=b(this.object,s,n),{AD:l,descender:p}=this.object,u=p+.5*l,{width:d,height:c,depth:g}=this.object.geometry.userData.parameters,m="string"==typeof d?0:d,v="string"==typeof c?0:c;this.caretMesh.scale.set(1,this.caretHeight,1),this.caretMesh.position.set(o-.5*m,h+u+.5*v,g),this.hideSelectionMesh(),this.showCaretMesh()}setSelection(t,e){if(void 0===this.object)return;let i=this.object.wrappedText;this.current.start=t,this.current.end=e;let s=[],n=[],r=function(t,e,i){let[s,n]=_(t,e),[r,a]=_(t,i),o=[];n>=t[s].length&&(s++,n=0);for(let e=s;e<=r;e++){let i=t[e],h=e===s?n:0,l=e===r?a:i.length;o.push([e,h,l])}return o}(i,t,e),{lineHeight:a,AD:o,descender:h}=this.object,l=h+.5*o-.5*a;for(let[t,e,i]of r)if(e!==i){let[r,o]=b(this.object,t,e),[h,p]=b(this.object,t,i),u=o,d=p;u+=l,d+=l,d+=a;let c=s.length/3;s.push(r,u,0),s.push(h,u,0),s.push(h,d,0),s.push(r,d,0),n.push(c+0,c+1,c+2),n.push(c+2,c+3,c+0)}let p=new v;p.setIndex(n),p.setAttribute("position",new m(s,3));let{width:u,height:d,depth:c}=this.object.geometry.userData.parameters,g="string"==typeof u?0:u,x="string"==typeof d?0:d;this.selectionMesh.geometry.dispose(),this.selectionMesh.geometry=p,this.selectionMesh.position.x=.5*-g,this.selectionMesh.position.y=.5*x,this.selectionMesh.position.z=c,this.showSelectionMesh(),this.hideCaretMesh()}getSelectionFromPosition(t,e,i="previous"){if(void 0===this.object||void 0===this.object.font)return;let s=this.object.wrappedText,n=s.length,r=this.object.lineHeight,a=n*r,{height:o,verticalAlign:h}=this.object.geometry.userData.parameters,l="string"==typeof o?0:o,p=0;3===h?p=l-a:2===h&&(p=.5*l-.5*a);let u=Math.min(Math.floor(Math.max(Math.min(-e-p,a),0)/r),n-1),d=this.object.charCoords[u],c=this.object.charWidths[u],g=0,m=!1;if("previous"===i){for(let e=0;e<d.length;e++)if(d[e][0]+.5*c[e]-t>0){g=e,m=!0;break}}else if("closest"===i){let e=1/0;for(let i=0;i<d.length;i++){let s=d[i][0]+.5*c[i],n=Math.abs(s-t);n<e&&(e=n,g=i,m=!0)}}else for(let e=0;e<d.length;e++){let i=d[e][0],s=d[e][0]+c[e];if(t>=i&&t<s){g=e,m=!0;break}}return m||(g=d.length),{index:this.getGlobalIndexFromLineAndCharIndexes(s,u,g),lineIndex:u,characterIndex:g}}getGlobalIndexFromLineAndCharIndexes(t,e,i){return t.slice(0,e).reduce((t,e)=>t+e.length,0)+i}showSelectionMesh(){this.selectionMesh.material.opacity=this._selectionVisibleAlpha}hideSelectionMesh(){this.selectionMesh.material.opacity=0}showCaretMesh(){this.caretMesh.material.opacity=this._caretVisibleAlpha}hideCaretMesh(){this.caretMesh.material.opacity=0}};function b(t,e,i){let{charCoords:s,charWidths:n,initialOffsetY:r,lineHeight:a}=t;if(s[e]&&0===s[e].length||0===s.length){let i=0,{horizontalAlign:s}=t.data.geometry,n=t.wrappedText,{width:o}=t.geometry.userData.parameters;return 1===n.length&&0===n[0].length&&(3===s?i=.5*o:2===s&&(i=o)),[i,r-a*e]}let o=s[e];if(void 0===o||0===o.length)return[0,0];let[h,l]=o[Math.min(i,o.length-1)],p=h;return i>=o.length&&(p+=n[e][i-1]),[p,l]}function _(t,e){let i=0;for(let s=0;s<t.length;s++){let n=t[s],r=e-i;if(r<=n.length)return[s,r];i+=n.length}return[Math.max(0,t.length-1),t[t.length-1]?.length??0]}function w(t,e){return"string"==typeof t?e.data.colors[t]:t}function k(t){return t.colors[0]}var E=class{constructor(){this._clickCount=0,this._lastTime=0,this._lastPosition=[0,0],this._delay=500,this._distance=2,this._onMouseDown=t=>{let e=[t.clientX,t.clientY],i=(new Date).getTime();if(this._clickCount>0){let t=e[0]-this._lastPosition[0],i=e[1]-this._lastPosition[1];Math.sqrt(t*t+i*i)>this._distance&&(this._clickCount=0)}this._lastPosition=e,this._clickCount=i-this._lastTime>this._delay?1:this._clickCount+1,this._lastTime=i},this._onMouseUp=t=>{}}start(t,e=500,i=2){this._target&&this.stop(),this.reset(),this._delay=e,this._distance=i,this._target=t,this._target.addEventListener("pointerdown",this._onMouseDown,!1),this._target.addEventListener("pointerup",this._onMouseUp,!1)}stop(){this._target&&(this._target.removeEventListener("pointerdown",this._onMouseDown,!1),this._target.removeEventListener("pointerup",this._onMouseUp,!1),this._target=void 0)}get clickCount(){return this._clickCount}reset(){this._clickCount=0,this._lastTime=0,this._lastPosition=[0,0]}},j=new p(0,0,1),D=new p,T=new p,S=new u,L=class{constructor(t,e,i,s,n){this.containerScene=t,this.raycaster=e,this.sharedAssets=i,this.requestRender=s,this.onExit=n,this.htmlInput=null,this.virtualInput=null,this.helper=new C,this.doubleClickHandler=new E,this.isDragging=!1,this.plane=new M,this.caretInterval=0,this.planeIntersection=new p,this.projected=new l,this._lastIndex=0,this._isFirstDragMove=!1,this.selectionOnDragStart=0,this.onTextMaterialChanged=()=>{let t=this.virtualInput?.data;if(void 0!==this.virtualInput&&t){let e=t.material,i=function(t,e){let i=o.fromHex(3223857),s=.8;for(let n of t.layers){if("light"===n.data.type||"displace"===n.data.type||"fresnel"===n.data.type||"dust"===n.data.type||"matcap"===n.data.type||"texture"===n.data.type||"toon"===n.data.type||"outline"===n.data.type||"transmission"===n.data.type||"noise"===n.data.type||"vertexColor"===n.data.type)continue;let t="string"==typeof n.data.alpha?Number(e.getVariable(n.data.alpha)):n.data.alpha;if("color"===n.data.type&&t>.3){i=w(n.data.color,e),s=t;break}if(("depth"===n.data.type||"gradient"===n.data.type)&&t>.3){let t=k(n.data);i={r:t[0],g:t[1],b:t[2]},s="string"==typeof n.data.alpha?1:n.data.alpha;break}}return{...i,a:s}}("string"==typeof e?this.sharedAssets.data.materials[e]:e,this.sharedAssets);this.helper.setCaretColor(i)}},this.stopAnimateTextCursor=()=>{clearInterval(this.caretInterval),this.helper&&(this.helper.caretMesh.visible=!1)},this.startAnimateTextCursor=()=>{this.stopAnimateTextCursor(),this.helper&&(this.helper.caretMesh.visible=!0,this.caretInterval=setInterval(()=>{this.helper&&(this.helper.caretMesh.visible=!this.helper.caretMesh.visible),this.requestRender()},600))},this.handleCaretUpdate=t=>{if(!this.htmlInput||!this.virtualInput)return;let e=this.helper,i="ArrowLeft"===t?.key||"ArrowRight"===t?.key,s="ArrowUp"===t?.key||"ArrowDown"===t?.key;this.htmlInput.selectionStart===this.htmlInput.selectionEnd?(e.setCaretPosition(this.htmlInput.selectionStart,{horizontalKeyMove:i,verticalKeyMove:s}),this.startAnimateTextCursor()):e.setSelection(this.htmlInput.selectionStart,this.htmlInput.selectionEnd),this.requestRender()},this.containerScene.add(this.helper)}createInput(){return this.htmlInput=function(){let t=document.createElement("textarea");return t.style.position="fixed",t.style.top="200px",t.style.left="400px",t.style.zIndex="-1",t.style.border="1px solid rgba(255,0,0,0.5)",t.style.width="10px",t.style.height="500px",t.style.color="white",t.style.opacity="0.5",t.style.background="transparent",t.style.display="none",t.style.margin="0px",t.style.padding="0px",t.style.boxSizing="content-box",t.style.pointerEvents="none",t}(),this.htmlInput}connect(){}disconnect(){this.stopAnimateTextCursor(),this.helper.hide(),this.htmlInput?.remove(),this.doubleClickHandler.stop()}handleMouseDown(){if(!this.htmlInput||!this.virtualInput)return!0;this.getPointOnPlane();let t=this.doubleClickHandler.clickCount,e=this.helper.getSelectionFromPosition(this.projected.x,this.projected.y,t>1?"inside":"previous")??{index:0,lineIndex:0,characterIndex:0},{lineIndex:i}=e,{index:s,characterIndex:n}=e;this.virtualInput?.wrappedText?.length&&"\n"===this.virtualInput.wrappedText[i][Math.max(0,n-1)]&&(s--,n--),this._lastIndex=s,this._isFirstDragMove=!0;let r=this.checkClickedObject();if(1===t){if(null===r)return this.onExit(this.virtualInput),!0;this.selectionOnDragStart=s,this.isDragging=!0,this.setInputSelection(s)}else r===this.virtualInput&&(2===t?this.selectClosestWord(i,n):t>2&&(this.setInputSelection(0,this.htmlInput.value.length),this.doubleClickHandler.reset()))}handleMouseUp(){this.applyRangeToTextInput(),this.isDragging=!1,this._isFirstDragMove=!1}handleMouseMove(){!this.virtualInput||(this._isFirstDragMove&&this.doubleClickHandler.clickCount>1&&(this.selectionOnDragStart=this._lastIndex,this.isDragging=!0,this.setInputSelection(this._lastIndex)),this._isFirstDragMove=!1,this.getPointOnPlane(),this.applyRangeToTextInput())}focus(t){if(this.virtualInput=t,this.updateTextInputStyles(),this.htmlInput)if(t){let t=this.data?.geometry.text;this.htmlInput.value="string"==typeof t?"":t?.textValue.toString()??""}else this.htmlInput.value=""}blur(){}get data(){let{virtualInput:t}=this;if(t)return t.dataPatched}applyRangeToTextInput(){if(!this.isDragging||!this.virtualInput||!this.htmlInput)return;let t=this.selectionOnDragStart,{index:e,lineIndex:i,characterIndex:s}=this.helper.getSelectionFromPosition(this.projected.x,this.projected.y,this.doubleClickHandler.clickCount>2?"inside":"previous")??{index:0},n=e;void 0!==i&&void 0!==s&&"\n"===this.virtualInput?.wrappedText[i][s-1]&&n--,this.htmlInput.setSelectionRange(Math.min(t,n),Math.max(t,n))}checkClickedObject(){if(this.virtualInput){let t=this.raycaster.intersectObject(this.virtualInput,!1);if(t.length>0){let e=t[0];if(e.object instanceof f)return e.object}}return null}selectClosestWord(t,e){if(!this.virtualInput)return;let i=this.virtualInput.wrappedText,s=i[t],n=e+1,r=e;" "!==s[e]&&(n=this.findNextCharOccurence(s,e,"forward"," "),r=this.findNextCharOccurence(s,e,"backward"," "),r>0&&r++,n>=s.length-1&&t===i.length-1&&n++);let a=this.helper,o=a.getGlobalIndexFromLineAndCharIndexes(i,t,r),h=a.getGlobalIndexFromLineAndCharIndexes(i,t,n);this.setInputSelection(o,h)}findNextCharOccurence(t,e,i,s=" "){let n=Math.max(0,t.length-1),r="forward"===i?n:0,a="forward"===i?1:-1,o=Math.max(Math.min(e,n),0);for(;o!==r;)if(o+=a,t.charAt(o)===s)return o;return r}getPointOnPlane(){let t=this.virtualInput?.data;if(this.virtualInput&&t&&this.raycaster.ray.intersectsPlane(this.plane)){null===this.planeIntersection&&(this.planeIntersection=new p);let e=this.raycaster.ray.intersectPlane(this.plane,this.planeIntersection);if(e){this.planeIntersection.copy(this.virtualInput.worldToLocal(e));let i="number"==typeof t.geometry.width?t.geometry.width:1,s="number"==typeof t.geometry.height?t.geometry.height:1;this.projected.set(e.x+.5*i,e.y-.5*s)}}}updatePlane(){let t=this.virtualInput?.data;this.virtualInput&&t&&(S.getNormalMatrix(this.virtualInput.matrixWorld),D.copy(j).applyMatrix3(S).normalize(),this.virtualInput.localToWorld(T.set(0,0,t.geometry.depth)),this.plane.setFromNormalAndCoplanarPoint(D,T))}setInputSelection(t,e=t){this.htmlInput?.setSelectionRange(t,e),n&&this.htmlInput?.focus(),setTimeout(()=>{this.htmlInput?.focus()})}updateTextInputStyles(){let t=this.virtualInput?.data;var e;this.virtualInput&&t&&this.htmlInput&&(this.htmlInput.style.fontSize=t.geometry.fontSize+"px",this.htmlInput.style.letterSpacing=t.geometry.letterSpacing*t.geometry.fontSize+"px",this.htmlInput.style.lineHeight=t.geometry.fontSize*t.geometry.lineHeight+"px",this.htmlInput.style.width=t.geometry.width+"px",this.htmlInput.style.height=t.geometry.height+"px",this.htmlInput.style.textAlign=4===(e=t.geometry.horizontalAlign)?"justify":2===e?"right":3===e?"center":"left")}},A=(t,e)=>{if("string"==typeof t){let i=e.data(t);if(i)return A(i.value,e)}return h.getDisplayedValue(t)};function U(t,e){let i=t.text,s="";if("string"==typeof i){let t=e.variables.data(s);t&&(s=A(t.value,e.variables))}else s=i.textValue.toString();return s}var H=class extends e{constructor(t,e){super(t),this.eventManager=e,this._textInputs=[],this.sceneHelpers=new c,this.helper=new C,this._onMouseDownFocusIn=t=>{if(s.length>1)return;this.eventContext.updateRaycaster(t);let e=null;if(this.eventContext.raycaster)for(let t of this._textInputs)if(this.eventContext.raycaster.intersectObject(t,!0).length>0){e=t;break}this.focusOnTextInput(e),this._onCaretUpdate(),this._onMouseUp(),this.textInputManager.doubleClickHandler.start(this.eventContext.domElement),this.textInputManager.doubleClickHandler._onMouseDown(t),this._onMouseDown(t)},this.onExit=()=>{let{virtualInput:t}=this.textInputManager;if(null===t)return;let e=this.textInputManager.htmlInput;this.helper.hide(),e?.setSelectionRange(e.value.length,e.value.length),this.eventManager.controlsManager.orbitControls&&(this.eventManager.controlsManager.orbitControls.enabled=!0);let{domElement:i}=this.eventContext;i.removeEventListener("pointerdown",this._onMouseDown,!1),i.removeEventListener("pointerup",this._onMouseUp,!1),i.removeEventListener("pointermove",this._onMouseMove,!1),window.removeEventListener("keydown",this._onKeyPress),this.textInputManager.doubleClickHandler.reset(),i.addEventListener("pointerdown",this._onMouseDownFocusIn),this.eventContext.renderer.sceneHelpersOnTop=void 0,this.eventContext.renderer.pipeline.disableHelpers()},this._onMouseDown=t=>{this.eventContext.updateRaycaster(t),this.textInputManager.handleMouseDown(),this.textInputManager.virtualInput&&this.eventContext.raycaster.intersectObject(this.textInputManager.virtualInput,!0).length>0&&this.eventManager.controlsManager.orbitControls&&(this.eventManager.controlsManager.orbitControls.enabled=!1)},this._onMouseUp=()=>{this.textInputManager.handleMouseUp(),this.eventManager.controlsManager.orbitControls&&!this.eventManager.controlsManager.orbitControls.enabled&&(this.eventManager.controlsManager.orbitControls.enabled=!0)},this._onMouseMove=t=>{this.eventContext.updateRaycaster(t),this.textInputManager.handleMouseMove()},this._onTextEdit=t=>{let{htmlInput:e,virtualInput:i,helper:s}=this.textInputManager;if(!e||!i)return;let n=e.value;i.textGeometry.setText(n,this.eventContext.sharedAssets).then(()=>{this.eventContext.requestRender()});let r=i.data;s.update();let a=r.geometry.text;if("string"==typeof a){let t=a;this.eventContext.sharedAssets.updateVariable(t,{textValue:n})}this.textInputManager.updateTextInputStyles(),this._onCaretUpdate()},this._onCaretUpdate=t=>{this.textInputManager.handleCaretUpdate(t)},this._onKeyPress=t=>{"Escape"===t.key&&this.onExit()},this.textInputManager=new L(this.sceneHelpers,t.raycaster,t.sharedAssets,t.requestRender,this.onExit)}connect(){let t=[];if(this.eventContext.scene.traverseEntity(e=>{e instanceof f&&t.push(e)}),this._textInputs=t,0===t.length)return;let{domElement:e}=this.eventContext;e.addEventListener("pointerdown",this._onMouseDownFocusIn),this.textInputManager.connect();let i=this.textInputManager.createInput();document.body.appendChild(i),i.style.display="none",i.addEventListener("keyup",this._onCaretUpdate),i.addEventListener("keydown",this._onCaretUpdate),i.addEventListener("beforeinput",this._onCaretUpdate),i.addEventListener("paste",this._onCaretUpdate),i.addEventListener("cut",this._onCaretUpdate),i.addEventListener("select",this._onCaretUpdate),i.addEventListener("selectstart",this._onCaretUpdate)}disconnect(){let t=this.textInputManager.htmlInput,{domElement:e,sharedAssets:i}=this.eventContext;e.removeEventListener("pointerdown",this._onMouseDownFocusIn),t?.removeEventListener("keyup",this._onCaretUpdate),t?.removeEventListener("keydown",this._onCaretUpdate),t?.removeEventListener("beforeinput",this._onCaretUpdate),t?.removeEventListener("paste",this._onCaretUpdate),t?.removeEventListener("cut",this._onCaretUpdate),t?.removeEventListener("select",this._onCaretUpdate),t?.removeEventListener("selectstart",this._onCaretUpdate),this._textInputs.forEach(t=>{let e=U(t.data.geometry,this.eventContext.sharedAssets.data);t.textGeometry.setText(e,i)}),e.removeEventListener("pointerdown",this._onMouseDown,!1),e.removeEventListener("pointerup",this._onMouseUp,!1),e.removeEventListener("pointermove",this._onMouseMove,!1),window.removeEventListener("keydown",this._onKeyPress),this.eventContext.renderer.sceneHelpersOnTop=void 0,this.eventContext.renderer.pipeline.disableHelpers(),this.textInputManager.disconnect()}focusOnTextInput(t){this.textInputManager.focus(t),this.textInputManager.onTextMaterialChanged();let e=this.textInputManager.htmlInput;if(!e||null===t)return;this.textInputManager.updateTextInputStyles(),this.eventContext.renderer.sceneHelpersOnTop=this.sceneHelpers,this.eventContext.renderer.pipeline.enableHelpers(),this.textInputManager.isDragging=!1;let i=U(t.textGeometry.userData.parameters,this.eventContext.sharedAssets.data);e.value=i,e.setSelectionRange(0,0),this.textInputManager.helper.show(t),e.style.display="block",e.addEventListener("input",this._onTextEdit),this.textInputManager.updatePlane();let{domElement:s}=this.eventContext;s.removeEventListener("pointerdown",this._onMouseDownFocusIn),s.addEventListener("pointerdown",this._onMouseDown,!1),s.addEventListener("pointerup",this._onMouseUp,!1),s.addEventListener("pointermove",this._onMouseMove,!1),window.addEventListener("keydown",this._onKeyPress)}};i("Textfields",({eventContext:t,eventManager:e})=>new H(t,e)),a("InputGeometry",(t,e,i)=>new f(t,e,i)),r("textinputs");
1
+ import{a as t}from"./runtime-chunk-52L5HXRS.js";import{a as e,b as i}from"./runtime-chunk-DZNU62CT.js";import{a as s}from"./runtime-chunk-VAVYZ35B.js";import{c as n}from"./runtime-chunk-FQNSP44B.js";import"./runtime-chunk-PMIN6YLE.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import"./runtime-chunk-HO57WDLD.js";import"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-R5WCGKXX.js";import{a as r,f as a}from"./runtime-chunk-TZCHGFVF.js";import{D as o,Ia as h}from"./runtime-chunk-CSILWFMF.js";import{Fc as l,Hc as p,Ic as u,Uc as d,Xc as c,Xd as g,dd as m,fd as v,l as x,md as I,nd as y,td as M}from"./runtime-chunk-KPOUV3HD.js";import"./runtime-chunk-ML3Z74BL.js";var f=class extends t{constructor(t,e,i){super(t,e,i),this.data=e}},C=class extends d{constructor(){super(),this.caretIndex=0,this._caretVisibleAlpha=1,this._selectionVisibleAlpha=.3,this.current={start:0,end:void 0},this.matrixAutoUpdate=!1,this.caretMesh=new y(new g(1,1),new I({transparent:!0,opacity:0,side:x})),this.add(this.caretMesh),this.selectionMesh=new y(new g(1,1),new I({color:2857471,transparent:!0,depthTest:!1,depthWrite:!1,opacity:0,side:x})),this.add(this.selectionMesh),this.hide()}get caretHeight(){return this.object?.AD??0}show(t){this.visible=!0,this.object=t,this.caretMesh.scale.set(1,this.caretHeight,1),this.caretMesh.position.y=.5*-this.caretHeight,this.setCaretPosition(this.caretIndex),this.update()}hide(){this.visible=!1}update(){if(void 0===this.object)return;this.updateHelperMatrix();let{depth:t}=this.object.geometry.userData.parameters;this.caretMesh.position.z=t,this.selectionMesh.position.z=t}updateHelperMatrix(){if(void 0===this.object)return;let t=this.object,e=t.parent;null!==e&&e.updateWorldMatrix(!0,!1),t.matrixAutoUpdate&&t.updateMatrix(),null!==e?(this.matrixWorld.copy(e.matrixWorld),this.matrixWorld.multiplyMatrices(this.matrixWorld,t.matrix)):this.matrixWorld.copy(t.matrix),this.matrix.copy(this.matrixWorld);for(let t of this.children)t.matrixWorld.copy(this.matrixWorld);t.updateWorldMatrix(!0,!0)}setCaretColor(t){let e=this.caretMesh.material;e.color.setRGB(t.r,t.g,t.b);let i=this._caretVisibleAlpha===e.opacity;this._caretVisibleAlpha=t.a,i&&(e.opacity=this._caretVisibleAlpha)}setSelectionColor(t){this.selectionMesh.material.color.setRGB(t.r,t.g,t.b)}setCaretPosition(t,e={}){if(void 0===this.object)return;this.caretIndex=t;let i=this.object.wrappedText,[s,n]=_(i,t),[r,a]=t>0?_(i,t-1):[null,null];"\n"===(t>0&&i.length?i[r].charAt(a):null)&&(s++,n=0),this.current.start=t,this.current.end=void 0;let[o,h]=b(this.object,s,n),{AD:l,descender:p}=this.object,u=p+.5*l,{width:d,height:c,depth:g}=this.object.geometry.userData.parameters,m="string"==typeof d?0:d,v="string"==typeof c?0:c;this.caretMesh.scale.set(1,this.caretHeight,1),this.caretMesh.position.set(o-.5*m,h+u+.5*v,g),this.hideSelectionMesh(),this.showCaretMesh()}setSelection(t,e){if(void 0===this.object)return;let i=this.object.wrappedText;this.current.start=t,this.current.end=e;let s=[],n=[],r=function(t,e,i){let[s,n]=_(t,e),[r,a]=_(t,i),o=[];n>=t[s].length&&(s++,n=0);for(let e=s;e<=r;e++){let i=t[e],h=e===s?n:0,l=e===r?a:i.length;o.push([e,h,l])}return o}(i,t,e),{lineHeight:a,AD:o,descender:h}=this.object,l=h+.5*o-.5*a;for(let[t,e,i]of r)if(e!==i){let[r,o]=b(this.object,t,e),[h,p]=b(this.object,t,i),u=o,d=p;u+=l,d+=l,d+=a;let c=s.length/3;s.push(r,u,0),s.push(h,u,0),s.push(h,d,0),s.push(r,d,0),n.push(c+0,c+1,c+2),n.push(c+2,c+3,c+0)}let p=new v;p.setIndex(n),p.setAttribute("position",new m(s,3));let{width:u,height:d,depth:c}=this.object.geometry.userData.parameters,g="string"==typeof u?0:u,x="string"==typeof d?0:d;this.selectionMesh.geometry.dispose(),this.selectionMesh.geometry=p,this.selectionMesh.position.x=.5*-g,this.selectionMesh.position.y=.5*x,this.selectionMesh.position.z=c,this.showSelectionMesh(),this.hideCaretMesh()}getSelectionFromPosition(t,e,i="previous"){if(void 0===this.object||void 0===this.object.font)return;let s=this.object.wrappedText,n=s.length,r=this.object.lineHeight,a=n*r,{height:o,verticalAlign:h}=this.object.geometry.userData.parameters,l="string"==typeof o?0:o,p=0;3===h?p=l-a:2===h&&(p=.5*l-.5*a);let u=Math.min(Math.floor(Math.max(Math.min(-e-p,a),0)/r),n-1),d=this.object.charCoords[u],c=this.object.charWidths[u],g=0,m=!1;if("previous"===i){for(let e=0;e<d.length;e++)if(d[e][0]+.5*c[e]-t>0){g=e,m=!0;break}}else if("closest"===i){let e=1/0;for(let i=0;i<d.length;i++){let s=d[i][0]+.5*c[i],n=Math.abs(s-t);n<e&&(e=n,g=i,m=!0)}}else for(let e=0;e<d.length;e++){let i=d[e][0],s=d[e][0]+c[e];if(t>=i&&t<s){g=e,m=!0;break}}return m||(g=d.length),{index:this.getGlobalIndexFromLineAndCharIndexes(s,u,g),lineIndex:u,characterIndex:g}}getGlobalIndexFromLineAndCharIndexes(t,e,i){return t.slice(0,e).reduce((t,e)=>t+e.length,0)+i}showSelectionMesh(){this.selectionMesh.material.opacity=this._selectionVisibleAlpha}hideSelectionMesh(){this.selectionMesh.material.opacity=0}showCaretMesh(){this.caretMesh.material.opacity=this._caretVisibleAlpha}hideCaretMesh(){this.caretMesh.material.opacity=0}};function b(t,e,i){let{charCoords:s,charWidths:n,initialOffsetY:r,lineHeight:a}=t;if(s[e]&&0===s[e].length||0===s.length){let i=0,{horizontalAlign:s}=t.data.geometry,n=t.wrappedText,{width:o}=t.geometry.userData.parameters;return 1===n.length&&0===n[0].length&&(3===s?i=.5*o:2===s&&(i=o)),[i,r-a*e]}let o=s[e];if(void 0===o||0===o.length)return[0,0];let[h,l]=o[Math.min(i,o.length-1)],p=h;return i>=o.length&&(p+=n[e][i-1]),[p,l]}function _(t,e){let i=0;for(let s=0;s<t.length;s++){let n=t[s],r=e-i;if(r<=n.length)return[s,r];i+=n.length}return[Math.max(0,t.length-1),t[t.length-1]?.length??0]}function w(t,e){return"string"==typeof t?e.data.colors[t]:t}function k(t){return t.colors[0]}var E=class{constructor(){this._clickCount=0,this._lastTime=0,this._lastPosition=[0,0],this._delay=500,this._distance=2,this._onMouseDown=t=>{let e=[t.clientX,t.clientY],i=(new Date).getTime();if(this._clickCount>0){let t=e[0]-this._lastPosition[0],i=e[1]-this._lastPosition[1];Math.sqrt(t*t+i*i)>this._distance&&(this._clickCount=0)}this._lastPosition=e,this._clickCount=i-this._lastTime>this._delay?1:this._clickCount+1,this._lastTime=i},this._onMouseUp=t=>{}}start(t,e=500,i=2){this._target&&this.stop(),this.reset(),this._delay=e,this._distance=i,this._target=t,this._target.addEventListener("pointerdown",this._onMouseDown,!1),this._target.addEventListener("pointerup",this._onMouseUp,!1)}stop(){this._target&&(this._target.removeEventListener("pointerdown",this._onMouseDown,!1),this._target.removeEventListener("pointerup",this._onMouseUp,!1),this._target=void 0)}get clickCount(){return this._clickCount}reset(){this._clickCount=0,this._lastTime=0,this._lastPosition=[0,0]}},j=new p(0,0,1),D=new p,L=new p,T=new u,S=class{constructor(t,e,i,s,n){this.containerScene=t,this.raycaster=e,this.sharedAssets=i,this.requestRender=s,this.onExit=n,this.htmlInput=null,this.virtualInput=null,this.helper=new C,this.doubleClickHandler=new E,this.isDragging=!1,this.plane=new M,this.caretInterval=0,this.planeIntersection=new p,this.projected=new l,this._lastIndex=0,this._isFirstDragMove=!1,this.selectionOnDragStart=0,this.onTextMaterialChanged=()=>{let t=this.virtualInput?.data;if(void 0!==this.virtualInput&&t){let e=t.material,i=function(t,e){let i=o.fromHex(3223857),s=.8;for(let n of t.layers){if("light"===n.data.type||"displace"===n.data.type||"fresnel"===n.data.type||"dust"===n.data.type||"matcap"===n.data.type||"texture"===n.data.type||"toon"===n.data.type||"outline"===n.data.type||"transmission"===n.data.type||"noise"===n.data.type||"vertexColor"===n.data.type)continue;let t="string"==typeof n.data.alpha?Number(e.getVariable(n.data.alpha)):n.data.alpha;if("color"===n.data.type&&t>.3){i=w(n.data.color,e),s=t;break}if(("depth"===n.data.type||"gradient"===n.data.type)&&t>.3){let t=k(n.data);i={r:t[0],g:t[1],b:t[2]},s="string"==typeof n.data.alpha?1:n.data.alpha;break}}return{...i,a:s}}("string"==typeof e?this.sharedAssets.data.materials[e]:e,this.sharedAssets);this.helper.setCaretColor(i)}},this.stopAnimateTextCursor=()=>{clearInterval(this.caretInterval),this.helper&&(this.helper.caretMesh.visible=!1)},this.startAnimateTextCursor=()=>{this.stopAnimateTextCursor(),this.helper&&(this.helper.caretMesh.visible=!0,this.caretInterval=setInterval(()=>{this.helper&&(this.helper.caretMesh.visible=!this.helper.caretMesh.visible),this.requestRender()},600))},this.handleCaretUpdate=t=>{if(!this.htmlInput||!this.virtualInput)return;let e=this.helper,i="ArrowLeft"===t?.key||"ArrowRight"===t?.key,s="ArrowUp"===t?.key||"ArrowDown"===t?.key;this.htmlInput.selectionStart===this.htmlInput.selectionEnd?(e.setCaretPosition(this.htmlInput.selectionStart,{horizontalKeyMove:i,verticalKeyMove:s}),this.startAnimateTextCursor()):e.setSelection(this.htmlInput.selectionStart,this.htmlInput.selectionEnd),this.requestRender()},this.containerScene.add(this.helper)}createInput(){return this.htmlInput=function(){let t=document.createElement("textarea");return t.style.position="fixed",t.style.top="200px",t.style.left="400px",t.style.zIndex="-1",t.style.border="1px solid rgba(255,0,0,0.5)",t.style.width="10px",t.style.height="500px",t.style.color="white",t.style.opacity="0.5",t.style.background="transparent",t.style.display="none",t.style.margin="0px",t.style.padding="0px",t.style.boxSizing="content-box",t.style.pointerEvents="none",t}(),this.htmlInput}connect(){}disconnect(){this.stopAnimateTextCursor(),this.helper.hide(),this.htmlInput?.remove(),this.doubleClickHandler.stop()}handleMouseDown(){if(!this.htmlInput||!this.virtualInput)return!0;this.getPointOnPlane();let t=this.doubleClickHandler.clickCount,e=this.helper.getSelectionFromPosition(this.projected.x,this.projected.y,t>1?"inside":"previous")??{index:0,lineIndex:0,characterIndex:0},{lineIndex:i}=e,{index:s,characterIndex:n}=e;this.virtualInput?.wrappedText?.length&&"\n"===this.virtualInput.wrappedText[i][Math.max(0,n-1)]&&(s--,n--),this._lastIndex=s,this._isFirstDragMove=!0;let r=this.checkClickedObject();if(1===t){if(null===r)return this.onExit(this.virtualInput),!0;this.selectionOnDragStart=s,this.isDragging=!0,this.setInputSelection(s)}else r===this.virtualInput&&(2===t?this.selectClosestWord(i,n):t>2&&(this.setInputSelection(0,this.htmlInput.value.length),this.doubleClickHandler.reset()))}handleMouseUp(){this.applyRangeToTextInput(),this.isDragging=!1,this._isFirstDragMove=!1}handleMouseMove(){!this.virtualInput||(this._isFirstDragMove&&this.doubleClickHandler.clickCount>1&&(this.selectionOnDragStart=this._lastIndex,this.isDragging=!0,this.setInputSelection(this._lastIndex)),this._isFirstDragMove=!1,this.getPointOnPlane(),this.applyRangeToTextInput())}focus(t){if(this.virtualInput=t,this.updateTextInputStyles(),this.htmlInput)if(t){let t=this.data?.geometry.text;this.htmlInput.value="string"==typeof t?"":t?.textValue.toString()??""}else this.htmlInput.value=""}blur(){}get data(){let{virtualInput:t}=this;if(t)return t.dataPatched}applyRangeToTextInput(){if(!this.isDragging||!this.virtualInput||!this.htmlInput)return;let t=this.selectionOnDragStart,{index:e,lineIndex:i,characterIndex:s}=this.helper.getSelectionFromPosition(this.projected.x,this.projected.y,this.doubleClickHandler.clickCount>2?"inside":"previous")??{index:0},n=e;void 0!==i&&void 0!==s&&"\n"===this.virtualInput?.wrappedText[i][s-1]&&n--,this.htmlInput.setSelectionRange(Math.min(t,n),Math.max(t,n))}checkClickedObject(){if(this.virtualInput){let t=this.raycaster.intersectObject(this.virtualInput,!1);if(t.length>0){let e=t[0];if(e.object instanceof f)return e.object}}return null}selectClosestWord(t,e){if(!this.virtualInput)return;let i=this.virtualInput.wrappedText,s=i[t],n=e+1,r=e;" "!==s[e]&&(n=this.findNextCharOccurence(s,e,"forward"," "),r=this.findNextCharOccurence(s,e,"backward"," "),r>0&&r++,n>=s.length-1&&t===i.length-1&&n++);let a=this.helper,o=a.getGlobalIndexFromLineAndCharIndexes(i,t,r),h=a.getGlobalIndexFromLineAndCharIndexes(i,t,n);this.setInputSelection(o,h)}findNextCharOccurence(t,e,i,s=" "){let n=Math.max(0,t.length-1),r="forward"===i?n:0,a="forward"===i?1:-1,o=Math.max(Math.min(e,n),0);for(;o!==r;)if(o+=a,t.charAt(o)===s)return o;return r}getPointOnPlane(){let t=this.virtualInput?.data;if(this.virtualInput&&t&&this.raycaster.ray.intersectsPlane(this.plane)){null===this.planeIntersection&&(this.planeIntersection=new p);let e=this.raycaster.ray.intersectPlane(this.plane,this.planeIntersection);if(e){this.planeIntersection.copy(this.virtualInput.worldToLocal(e));let i="number"==typeof t.geometry.width?t.geometry.width:1,s="number"==typeof t.geometry.height?t.geometry.height:1;this.projected.set(e.x+.5*i,e.y-.5*s)}}}updatePlane(){let t=this.virtualInput?.data;this.virtualInput&&t&&(T.getNormalMatrix(this.virtualInput.matrixWorld),D.copy(j).applyMatrix3(T).normalize(),this.virtualInput.localToWorld(L.set(0,0,t.geometry.depth)),this.plane.setFromNormalAndCoplanarPoint(D,L))}setInputSelection(t,e=t){this.htmlInput?.setSelectionRange(t,e),n&&this.htmlInput?.focus(),setTimeout(()=>{this.htmlInput?.focus()})}updateTextInputStyles(){let t=this.virtualInput?.data;var e;this.virtualInput&&t&&this.htmlInput&&(this.htmlInput.style.fontSize=t.geometry.fontSize+"px",this.htmlInput.style.letterSpacing=t.geometry.letterSpacing*t.geometry.fontSize+"px",this.htmlInput.style.lineHeight=t.geometry.fontSize*t.geometry.lineHeight+"px",this.htmlInput.style.width=t.geometry.width+"px",this.htmlInput.style.height=t.geometry.height+"px",this.htmlInput.style.textAlign=4===(e=t.geometry.horizontalAlign)?"justify":2===e?"right":3===e?"center":"left")}},A=(t,e)=>{if("string"==typeof t){let i=e.data(t);if(i)return A(i.value,e)}return h.getDisplayedValue(t)};function U(t,e){let i=t.text,s="";if("string"==typeof i){let t=e.variables.data(s);t&&(s=A(t.value,e.variables))}else s=i.textValue.toString();return s}var H=class extends e{constructor(t,e){super(t),this.eventManager=e,this._textInputs=[],this.sceneHelpers=new c,this.helper=new C,this._onMouseDownFocusIn=t=>{if(s.length>1)return;this.eventContext.updateRaycaster(t);let e=null;if(this.eventContext.raycaster)for(let t of this._textInputs)if(this.eventContext.raycaster.intersectObject(t,!0).length>0){e=t;break}this.focusOnTextInput(e),this._onCaretUpdate(),this._onMouseUp(),this.textInputManager.doubleClickHandler.start(this.eventContext.domElement),this.textInputManager.doubleClickHandler._onMouseDown(t),this._onMouseDown(t)},this.onExit=()=>{let{virtualInput:t}=this.textInputManager;if(null===t)return;let e=this.textInputManager.htmlInput;this.helper.hide(),e?.setSelectionRange(e.value.length,e.value.length),this.eventManager.controlsManager.orbitControls&&(this.eventManager.controlsManager.orbitControls.enabled=!0);let{domElement:i}=this.eventContext;i.removeEventListener("pointerdown",this._onMouseDown,!1),i.removeEventListener("pointerup",this._onMouseUp,!1),i.removeEventListener("pointermove",this._onMouseMove,!1),window.removeEventListener("keydown",this._onKeyPress),this.textInputManager.doubleClickHandler.reset(),i.addEventListener("pointerdown",this._onMouseDownFocusIn),this.eventContext.renderer.sceneHelpersOnTop=void 0,this.eventContext.renderer.pipeline.disableHelpers()},this._onMouseDown=t=>{this.eventContext.updateRaycaster(t),this.textInputManager.handleMouseDown(),this.textInputManager.virtualInput&&this.eventContext.raycaster.intersectObject(this.textInputManager.virtualInput,!0).length>0&&this.eventManager.controlsManager.orbitControls&&(this.eventManager.controlsManager.orbitControls.enabled=!1)},this._onMouseUp=()=>{this.textInputManager.handleMouseUp(),this.eventManager.controlsManager.orbitControls&&!this.eventManager.controlsManager.orbitControls.enabled&&(this.eventManager.controlsManager.orbitControls.enabled=!0)},this._onMouseMove=t=>{this.eventContext.updateRaycaster(t),this.textInputManager.handleMouseMove()},this._onTextEdit=t=>{let{htmlInput:e,virtualInput:i,helper:s}=this.textInputManager;if(!e||!i)return;let n=e.value;i.textGeometry.setText(n,this.eventContext.sharedAssets).then(()=>{this.eventContext.requestRender()});let r=i.data;s.update();let a=r.geometry.text;if("string"==typeof a){let t=a;this.eventContext.sharedAssets.updateVariable(t,{textValue:n})}this.textInputManager.updateTextInputStyles(),this._onCaretUpdate()},this._onCaretUpdate=t=>{this.textInputManager.handleCaretUpdate(t)},this._onKeyPress=t=>{"Escape"===t.key&&this.onExit()},this.textInputManager=new S(this.sceneHelpers,t.raycaster,t.sharedAssets,t.requestRender,this.onExit)}connect(){let t=[];if(this.eventContext.scene.traverseEntity(e=>{e instanceof f&&t.push(e)}),this._textInputs=t,0===t.length)return;let{domElement:e}=this.eventContext;e.addEventListener("pointerdown",this._onMouseDownFocusIn),this.textInputManager.connect();let i=this.textInputManager.createInput();document.body.appendChild(i),i.style.display="none",i.addEventListener("keyup",this._onCaretUpdate),i.addEventListener("keydown",this._onCaretUpdate),i.addEventListener("beforeinput",this._onCaretUpdate),i.addEventListener("paste",this._onCaretUpdate),i.addEventListener("cut",this._onCaretUpdate),i.addEventListener("select",this._onCaretUpdate),i.addEventListener("selectstart",this._onCaretUpdate)}disconnect(){let t=this.textInputManager.htmlInput,{domElement:e,sharedAssets:i}=this.eventContext;e.removeEventListener("pointerdown",this._onMouseDownFocusIn),t?.removeEventListener("keyup",this._onCaretUpdate),t?.removeEventListener("keydown",this._onCaretUpdate),t?.removeEventListener("beforeinput",this._onCaretUpdate),t?.removeEventListener("paste",this._onCaretUpdate),t?.removeEventListener("cut",this._onCaretUpdate),t?.removeEventListener("select",this._onCaretUpdate),t?.removeEventListener("selectstart",this._onCaretUpdate),this._textInputs.forEach(t=>{let e=U(t.data.geometry,this.eventContext.sharedAssets.data);t.textGeometry.setText(e,i)}),e.removeEventListener("pointerdown",this._onMouseDown,!1),e.removeEventListener("pointerup",this._onMouseUp,!1),e.removeEventListener("pointermove",this._onMouseMove,!1),window.removeEventListener("keydown",this._onKeyPress),this.eventContext.renderer.sceneHelpersOnTop=void 0,this.eventContext.renderer.pipeline.disableHelpers(),this.textInputManager.disconnect()}focusOnTextInput(t){this.textInputManager.focus(t),this.textInputManager.onTextMaterialChanged();let e=this.textInputManager.htmlInput;if(!e||null===t)return;this.textInputManager.updateTextInputStyles(),this.eventContext.renderer.sceneHelpersOnTop=this.sceneHelpers,this.eventContext.renderer.pipeline.enableHelpers(),this.textInputManager.isDragging=!1;let i=U(t.textGeometry.userData.parameters,this.eventContext.sharedAssets.data);e.value=i,e.setSelectionRange(0,0),this.textInputManager.helper.show(t),e.style.display="block",e.addEventListener("input",this._onTextEdit),this.textInputManager.updatePlane();let{domElement:s}=this.eventContext;s.removeEventListener("pointerdown",this._onMouseDownFocusIn),s.addEventListener("pointerdown",this._onMouseDown,!1),s.addEventListener("pointerup",this._onMouseUp,!1),s.addEventListener("pointermove",this._onMouseMove,!1),window.addEventListener("keydown",this._onKeyPress)}};i("Textfields",({eventContext:t,eventManager:e})=>new H(t,e)),a("InputGeometry",(t,e,i)=>new f(t,e,i)),r("textinputs");
@@ -1 +1 @@
1
- import{b as e,c as t,d as i,e as a,f as s,i as n}from"./runtime-chunk-R3EYG5KF.js";import"./runtime-chunk-7OHCCGTO.js";import"./runtime-chunk-NTUTXO7Q.js";import"./runtime-chunk-HD7WF3XN.js";import{a as r}from"./runtime-chunk-6NZUY3NX.js";import{a as o}from"./runtime-chunk-GGSUJEGZ.js";import"./runtime-chunk-FTVQTRM7.js";import{a as l,b as h}from"./runtime-chunk-DOGUWR2L.js";import{a as c}from"./runtime-chunk-CLDWHXJJ.js";import"./runtime-chunk-4CCT57BJ.js";import"./runtime-chunk-OQCWMRSW.js";import"./runtime-chunk-TY3IYRYE.js";import{Z as d,fa as u,la as p,na as f}from"./runtime-chunk-JQCHQ4ER.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{b as m,e as y}from"./runtime-chunk-NWUMV7YK.js";import{v as g}from"./runtime-chunk-W2OWSMDC.js";import"./runtime-chunk-RTLL6WIB.js";import{d as v}from"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-R5WCGKXX.js";import{a as k}from"./runtime-chunk-TZCHGFVF.js";import{A as T,B as D,D as b,E as x,Ga as j,La as C,Ma as E,Na as O,Xa as w,Ya as A,ma as I,p as M,wa as F,z as N}from"./runtime-chunk-CSILWFMF.js";import{Dc as S,Ec as _}from"./runtime-chunk-KPOUV3HD.js";import"./runtime-chunk-ML3Z74BL.js";var R=Math.fround;function G(e){return"pingpong"===e||"pingpong-rewind"===e}var L=class{constructor(e){this.config=e,this.effectiveCycleDuration=this.cycleDuration(0)}layout(e){let{config:t}=this;if(G(t.direction)&&e%2==1)return{startDelay:0,endDelay:0};switch(t.delayDirection){case"start-once":return 0===e?{startDelay:t.delay,endDelay:0}:{startDelay:0,endDelay:0};case"start":return{startDelay:t.delay,endDelay:0};case"end":return{startDelay:0,endDelay:t.delay};default:return{startDelay:t.delay,endDelay:t.delay}}}cycleDuration(e){let{config:t}=this,{startDelay:i,endDelay:a}=this.layout(e);return R(t.duration+i+a)}get totalDuration(){let{config:e}=this;if(-1===e.repeat)return 1/0;let t=0;for(let i=0;i<=e.repeat;i++)t=R(t+this.cycleDuration(i));return t}isFinished(e){return e>=this.totalDuration}resolve(e){let t,i,{config:a}=this,s=R(e);if("start-once"===a.delayDirection){let e=R(a.delay+a.duration);if(s<e)t=0,i=s;else{let n=R(s-e);t=1+Math.floor(R(n/a.duration)),i=R(n%a.duration)}}else if(G(a.direction)){let e=this.cycleDuration(0),n=R(e+a.duration),r=Math.floor(R(s/n)),o=R(s%n);o<e?(t=2*r,i=o):(t=2*r+1,i=R(o-e))}else{let e=this.cycleDuration(0);t=Math.floor(R(s/e)),i=R(s%e)}if(-1!==a.repeat&&t>=a.repeat+1)return null;let n,{startDelay:r}=this.layout(t),o=G(a.direction)&&t%2==1,l=r,h=R(l+a.duration);if(i<l)n=o?a.duration:0;else if(i>=h)n=o?0:a.duration;else{let e=R(i-l);n=o?R(a.duration-e):e}return{cycleIndex:t,localTime:n,isReverse:o}}};function W(e){return{easing:e.type,control1:C(e.cubicControls?.control1,[0,0]),control2:C(e.cubicControls?.control2,[1,1]),...e.springParameters}}function U(e,t){let i=[];for(let a of e??[]){let e=t(a.data);void 0!==e&&i.push({time:a.data.time,ease:W(a.data.easing),value:e})}return{keyframes:A(i)}}function z(e,t){if(0===e.keyframes.length)return;let{index0:i,index1:a,t:s}=w(e.keyframes,t),n=e.read;if(n&&n.index0===i&&n.index1===a&&n.t===s)return;let r={index0:i,index1:a,from:e.keyframes[i].value,to:e.keyframes[a].value,t:s};return e.read=r,r}function B(e){e.read=void 0}function P(e,t,i){return e+(t-e)*i}function X(e,t,i){!e||(e[t]={...e[t],...i})}function Y(s,n,o,u,p,m,y){let k=()=>{y.transform=!0,y.bounds=!0,y.boolean=!0,y.render=!0};switch(s.on){case"position":case"scale":{let e=z(s.track,o);if(!e)return;let t=P(e.from,e.to,e.t);return n[s.on][s.axis]=t,X(m,s.on,{[s.axis]:t}),void k()}case"rotation":{let e=z(s.track,o);if(!e)return;let t=P(e.from,e.to,e.t);return n.rotation[s.axis]=t*_.DEG2RAD,X(m,"rotation",{[s.axis]:t}),void k()}case"shapeSize":{let e=z(s.track,o);if(!(e&&n instanceof f))return;let t=P(e.from,e.to,e.t);return n.userData.value={...n.userData.value,[s.axis]:t},X(m,"shapeSize",{[s.axis]:t}),y.size=!0,y.bounds=!0,y.boolean=!0,void(y.render=!0)}case"opacity":{let e=z(s.track,o);if(!e||!(n instanceof g)||Array.isArray(n.material))return;let t=n.material.getLayersOfType("light")[0];if(void 0===t)return;let i=_.lerp(e.from,e.to,e.t),r=n.material,l=e.to>=1&&(1===e.t||e.from>=1);return r.setTransparent(!l||d(r.data,u.shared),u.scene),a("alphaOverride",t,{alphaOverride:i},{alphaOverride:i+1},0,u.shared),m&&(m.opacity=i),void(y.render=!0)}case"material":{let e=z(s.track,o);if(!e||0===Object.keys(e.from).length||0===Object.keys(e.to).length)return;let{layer:t}=s,i={};for(let s in t.data){if(!(s in e.from)||!(s in e.to))continue;let r=H(e.from[s],e.to[s],e.t,p);if(void 0===r)continue;i[s]=r;let o=t.getValue(s);void 0!==o&&("alpha"===s&&"number"==typeof o&&o>0&&n instanceof g&&!Array.isArray(n.material)&&(n.material.transparent=!0),a(s,t,e.from,e.to,e.t,u.shared))}return X(m,"material",{[t.uuid]:i}),void(y.render=!0)}case"light":{let e=z(s.track,o);if(!e||!(n instanceof l||n instanceof r||n instanceof h))return;let t=H(e.from,e.to,e.t,p);return n[s.field]=t,X(m,"light",{[s.field]:t}),void(y.render=!0)}case"camera":{let e=z(s.track,o);if(!(e&&n instanceof c))return;let t=P(e.from,e.to,e.t);return n[s.field]=t,void X(m,"camera",{[s.field]:t})}case"cloner":{let e=z(s.track,o);if(!e)return;let a=n.cloner?.parameters,r=t(a,e.from,e.to,e.t);return i(a,r),X(m,"cloner",r),y.cloner=!0,y.boolean=!0,void(y.render=!0)}case"pathExtrusion":{let t=z(s.track,o);if(!t||!v(n))return;let i=e(I,t.from,t.to,t.t),a=n.geometry.userData.parameters;return a.extrusion={...a.extrusion,...i},X(m,"pathExtrusion",i),n.updateGeometryInteractions({extrusion:{...a.extrusion}},u.shared),y.bounds=!0,y.boolean=!0,void(y.render=!0)}case"pathSnapping":{let t=z(s.track,o);if(!t)return;let i=n,a=e(F,t.from,t.to,t.t);return i.userData.pathSnapping={...i.userData.pathSnapping,...a},X(m,"pathSnapping",a),i.updatePathSnapping(i.userData.pathSnapping),void(y.render=!0)}}}function H(e,t,i,a){if("string"==typeof e&&a&&(e=a.color(e)),"string"==typeof t&&a&&(t=a.color(t)),"number"==typeof e)return _.lerp(e,t,i);if(x.is(e))return x.lerp(e,t,i);if(b.is(e))return b.lerp(e,t,i);if(Array.isArray(e))return(e.length>t.length?t:e).map((a,s)=>{if(Array.isArray(a)){let a=e[s].length>t[s].length?t[s].length:e[s].length;return(4===a?D:3===a?T:N).lerp(e[s],t[s],i)}return _.lerp(e[s],t[s],i)});if("object"==typeof e&&null!==e){let s={};for(let n in e){let r=H(e[n],t[n],i,a);void 0!==r&&(s[n]=r)}return s}}var V=new Map,J=new Map,K=class extends S{constructor(e,t,i,a,s,n){super(),this.id=e,this.data=t,this.scene=i,this.sharedAssets=a,this.object=s,this.eventType=n,this.evaluators=[],this.elapsed=0,this.lastTime=null,this.direction=1,this._playing=!1,this._finished=!1,this.hasPlayedOnce=!1,this.pauseOnNextCycleEnd=!1,this.lastCycleIndex=0;try{let e=j.findTimeline(this.scene.data.objects,this.data.timeline),t=e.duration;this.animatedObjectIds=Object.keys(e.objectTimelines),this.animatedObjectIds.forEach(s=>{let n=this.scene.find(s);if(!n)return;let o=e.objectTimelines[s];!o||this.evaluators.push(function(e,t,i,a,s){let n=function(e,t){let i=[];return E.groupKeyframes(t.keyframes).forEach(t=>{let a=t.path?.[0],s=t.path[1],n=()=>U(t.keyframes,e=>e.value);switch(a){case"position":case"rotation":case"scale":return void(s&&O.includes(s)&&i.push({on:a,axis:s,track:n()}));case"shape size":return void(s&&O.includes(s)&&"geometry"in e&&i.push({on:"shapeSize",axis:s,track:n()}));case"path extrusion":return void(v(e)&&i.push({on:"pathExtrusion",track:U(t.keyframes,e=>e.value)}));case"path snapping":return void(e.data.pathSnapping&&i.push({on:"pathSnapping",track:U(t.keyframes,e=>e.value)}));case"material":return void("Mesh"===e.type&&"material"in e&&function(e,t){let i=p(e.material)?e.material:void 0,a=t.layerId;if(!i||!a)return[];let s=t.keyframes.some(e=>u(e.data.value?.noiseStrength)),n=i.ensureRainbowNoiseCompiled,r=e=>{s&&"function"==typeof n&&n.call(i,e)},o=e=>"data"in e?[{on:"material",layer:e,track:U(t.keyframes,e=>e.value)}]:[];r(a);let l=i.getLayerByUuid(a);if(l)return o(l);let h=t.path[1];for(let e of i.getLayersOfType(h))r(e.uuid);return(i.getLayersOfType(h)??[]).flatMap(o)}(e,t).forEach(e=>i.push(e)));case"opacity":return void("Mesh"===e.type&&"material"in e&&i.push({on:"opacity",track:n()}));case"cloner":return void i.push({on:"cloner",track:U(t.keyframes,e=>e.value)});case"camera":return void(e instanceof c&&i.push({on:"camera",field:"zoom",track:n()}));case"light":return void((e instanceof l||e instanceof r||e instanceof h)&&i.push({on:"light",field:t.path[1],track:U(t.keyframes,e=>e.value)}))}}),i}(e,t);return{duration:i,evaluate(t,i){e.resetBBoxNeedsUpdate();let r={transform:!1,size:!1,cloner:!1,bounds:!1,boolean:!1,render:!1};for(let o of n)Y(o,e,t,a,s,i,r);!function(e,t,i){if(t.size&&e instanceof f){let{x:t,y:a,z:s}=e.userData.value;e.updateGeometryInteractions({width:t,height:a,depth:s},i.shared)}t.cloner&&e.cloner?.update(i),t.transform&&e.updateMatrix(),t.bounds&&e.resetBBoxNeedsUpdate(),t.boolean&&e instanceof f&&e.invalidateDownstreamBooleanData(),t.render&&e.dispatchEvent({type:"requestRender"})}(e,r,a)},invalidate(){for(let e of n)B(e.track)}}}(n,{...o},t,{scene:i,shared:a},this.sharedAssets))}),this.schedule=new L((o=this.data,{duration:t,delay:R(o.delay/1e3),delayDirection:o.delayDirection??"start-end",direction:o.direction??"normal",repeat:o.repeat}))}catch(e){throw new Error("Missing property")}var o;s&&(J.has(s.uuid)?J.get(s.uuid).push(this):J.set(s.uuid,[this])),V.set(e,this)}get playing(){return this._playing}get finished(){return this._finished}get paused(){return!this._playing}update(e){null!==this.lastTime&&(this.elapsed=Math.max(0,this.elapsed+(e-this.lastTime)*this.direction)),this.lastTime=e,this.applyAtElapsed()}applyAtElapsed(){if(-1===this.direction&&0===this.elapsed)return void this.pause();let e=this.schedule.resolve(this.elapsed);if(e){if(e.cycleIndex!==this.lastCycleIndex&&(this.lastCycleIndex=e.cycleIndex,this.pauseOnNextCycleEnd))return this.pauseOnNextCycleEnd=!1,void this.pause();for(let t of this.evaluators)t.evaluate(e.localTime)}else 1===this.direction&&this.schedule.isFinished(this.elapsed)&&this.finish()}finish(){this.pause(),this._finished=!0,this.animatedObjectIds.forEach(e=>{let t=this.scene.find(e);t instanceof c&&t.dispatchEvent(n)})}startTicking(){this._playing=!0,this.lastTime=null;for(let e of this.evaluators)e.invalidate();o.add(this)}play(){let e=void 0!==this.eventType&&M(this.eventType)&&"Once"===this.data.runMode&&this.hasPlayedOnce&&this.paused&&this.elapsed>0&&!this._finished;if(void 0!==this.eventType&&M(this.eventType)&&"Once"===this.data.runMode&&this.hasPlayedOnce&&!e||void 0===this.eventType&&this._finished)return!1;this.hasPlayedOnce=!0,this.animatedObjectIds.forEach(e=>{let t=this.scene.find(e);t instanceof c&&t.dispatchEvent(s)}),!e&&(0===this.elapsed||this._finished)&&(this.elapsed=0,this.lastCycleIndex=0,this._finished=!1),this.direction=1,this.startTicking()}pause(){this._playing=!1,this.lastTime=null,o.remove(this)}rewind(){this.pause(),this.elapsed=0,this.lastCycleIndex=0}stop(){this.rewind(),this.applyAtElapsed(),this._finished=!1}pauseAndRewind(){this.rewind(),this.direction=1,this.pauseOnNextCycleEnd=!1,this._finished=!1}seek(e){let t=this.schedule.totalDuration;this.elapsed=e*(Number.isFinite(t)?t:this.schedule.effectiveCycleDuration);for(let e of this.evaluators)e.invalidate();this.applyAtElapsed()}toggle(e){let t=e??-1===this.direction;this._playing&&this.direction===(t?1:-1)?t&&(this.pauseOnNextCycleEnd=!1):(t?(this._finished&&(this.elapsed=0,this.lastCycleIndex=0,this._finished=!1),this.direction=1,this.pauseOnNextCycleEnd=!1):(this.direction=this.schedule.resolve(this.elapsed)?.isReverse?1:-1,this.pauseOnNextCycleEnd=!0),this.startTicking())}playFromCurrent(){this.toggle(!0)}reverseFromCurrent(){this.toggle(!1)}dispose(){this.pause()}},Q=class{constructor(e){this.data=e}dispatch(){this.data.playTimeline?this.pauseTimeline(this.data.playTimeline):this.data.object?this.pauseAllTimelinesFromObject(this.data.object):this.pauseAllTimelines()}pauseTimeline(e){let t=this.getTimelineActions(e);!t.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{t.forEach(e=>{e[this.data.interaction]()}),this.disposeDelay()},this.data.delay)):t.forEach(e=>{e[this.data.interaction]()}))}getTimelineActions(e){let t=V.get(e);return t?[t]:[...V.values()].filter(t=>t.data.timeline===e)}pauseAllTimelinesFromObject(e){let t=J.get(e);!t?.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{t.forEach(e=>e[this.data.interaction]()),this.disposeDelay()},this.data.delay)):t.forEach(e=>e[this.data.interaction]()))}pauseAllTimelines(){let e=[...J.values()];!e.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{e.forEach(e=>{e.forEach(e=>{e[this.data.interaction]()})}),this.disposeDelay()},this.data.delay)):e.forEach(e=>{e.forEach(e=>{e[this.data.interaction]()})}))}disposeDelay(){clearTimeout(this.timeoutId),delete this.timeoutId}dispose(){clearTimeout(this.timeoutId),delete this.timeoutId}},Z=class{constructor(e,t,i,a,s,n,r){this.data=t,this.sharedAssets=a,this.actionCondition=r;let o="interaction"in t?t.interaction:"play";if("play"===o||void 0===o)this.interaction=new K(e,t,i,a,s,n);else{if("pause"!==o&&"stop"!==o)throw new Error("Missing property");this.interaction=new Q(t)}}get playing(){return this.interaction instanceof K&&this.interaction.playing}get finished(){return!(this.interaction instanceof K)||this.interaction.finished}get paused(){return!(this.interaction instanceof K)||this.interaction.paused}branchTaken(){return y(this.sharedAssets,this.actionCondition)}play(){return!!this.branchTaken()&&(this.interaction instanceof K?this.interaction.play():void this.interaction.dispatch())}get animatedObjectIds(){return this.interaction instanceof K?this.interaction.animatedObjectIds:[]}pauseAndRewind(){this.interaction instanceof K&&this.interaction.pauseAndRewind()}stop(){this.interaction instanceof K&&this.interaction.stop()}seek(e){!this.branchTaken()||this.interaction instanceof K&&this.interaction.seek(e)}toggle(e){!this.branchTaken()||(this.interaction instanceof K?this.interaction.toggle(e):this.interaction.dispatch())}playFromCurrent(){!this.branchTaken()||(this.interaction instanceof K?this.interaction.playFromCurrent():this.interaction.dispatch())}dispatchConditional(){this.playFromCurrent()}reverseFromCurrent(){!this.branchTaken()||this.interaction instanceof K&&this.interaction.reverseFromCurrent()}dispose(){this.interaction.dispose()}};m("TimelineAnimation",({id:e,data:t,page:i,shared:a,object:s,eventType:n,actionCondition:r})=>new Z(e,t,i.scene,a,s,n,r)),k("timeline");
1
+ import{b as e,c as t,d as i,e as a,f as s,i as n}from"./runtime-chunk-SPZI3GXK.js";import"./runtime-chunk-MB67H2FU.js";import"./runtime-chunk-NTUTXO7Q.js";import"./runtime-chunk-HD7WF3XN.js";import{a as r}from"./runtime-chunk-52XHS3BX.js";import{a as o}from"./runtime-chunk-GGSUJEGZ.js";import"./runtime-chunk-FTVQTRM7.js";import{a as l,b as h}from"./runtime-chunk-UU4RVNYR.js";import{a as c}from"./runtime-chunk-RA5UBNOL.js";import"./runtime-chunk-572KWUWI.js";import"./runtime-chunk-IIF6BGTE.js";import"./runtime-chunk-ED2A7PP4.js";import{Z as d,fa as u,la as p,na as f}from"./runtime-chunk-PMIN6YLE.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{b as m,e as y}from"./runtime-chunk-NWUMV7YK.js";import{v as g}from"./runtime-chunk-HO57WDLD.js";import"./runtime-chunk-RTLL6WIB.js";import{d as v}from"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-R5WCGKXX.js";import{a as k}from"./runtime-chunk-TZCHGFVF.js";import{A as D,B as T,D as b,E as x,Ga as j,La as E,Ma as O,Na as C,Xa as I,Ya as w,ma as A,p as M,wa as F,z as N}from"./runtime-chunk-CSILWFMF.js";import{Dc as S,Ec as _}from"./runtime-chunk-KPOUV3HD.js";import"./runtime-chunk-ML3Z74BL.js";var R=Math.fround;function U(e){return"pingpong"===e||"pingpong-rewind"===e}var B=class{constructor(e){this.config=e,this.effectiveCycleDuration=this.cycleDuration(0)}layout(e){let{config:t}=this;if(U(t.direction)&&e%2==1)return{startDelay:0,endDelay:0};switch(t.delayDirection){case"start-once":return 0===e?{startDelay:t.delay,endDelay:0}:{startDelay:0,endDelay:0};case"start":return{startDelay:t.delay,endDelay:0};case"end":return{startDelay:0,endDelay:t.delay};default:return{startDelay:t.delay,endDelay:t.delay}}}cycleDuration(e){let{config:t}=this,{startDelay:i,endDelay:a}=this.layout(e);return R(t.duration+i+a)}get totalDuration(){let{config:e}=this;if(-1===e.repeat)return 1/0;let t=0;for(let i=0;i<=e.repeat;i++)t=R(t+this.cycleDuration(i));return t}isFinished(e){return e>=this.totalDuration}resolve(e){let t,i,{config:a}=this,s=R(e);if("start-once"===a.delayDirection){let e=R(a.delay+a.duration);if(s<e)t=0,i=s;else{let n=R(s-e);t=1+Math.floor(R(n/a.duration)),i=R(n%a.duration)}}else if(U(a.direction)){let e=this.cycleDuration(0),n=R(e+a.duration),r=Math.floor(R(s/n)),o=R(s%n);o<e?(t=2*r,i=o):(t=2*r+1,i=R(o-e))}else{let e=this.cycleDuration(0);t=Math.floor(R(s/e)),i=R(s%e)}if(-1!==a.repeat&&t>=a.repeat+1)return null;let n,{startDelay:r}=this.layout(t),o=U(a.direction)&&t%2==1,l=r,h=R(l+a.duration);if(i<l)n=o?a.duration:0;else if(i>=h)n=o?0:a.duration;else{let e=R(i-l);n=o?R(a.duration-e):e}return{cycleIndex:t,localTime:n,isReverse:o}}};function L(e){return{easing:e.type,control1:E(e.cubicControls?.control1,[0,0]),control2:E(e.cubicControls?.control2,[1,1]),...e.springParameters}}function P(e,t){let i=[];for(let a of e??[]){let e=t(a.data);void 0!==e&&i.push({time:a.data.time,ease:L(a.data.easing),value:e})}return{keyframes:w(i)}}function G(e,t){if(0===e.keyframes.length)return;let{index0:i,index1:a,t:s}=I(e.keyframes,t),n=e.read;if(n&&n.index0===i&&n.index1===a&&n.t===s)return;let r={index0:i,index1:a,from:e.keyframes[i].value,to:e.keyframes[a].value,t:s};return e.read=r,r}function z(e){e.read=void 0}function W(e,t,i){return e+(t-e)*i}function X(e,t,i){!e||(e[t]={...e[t],...i})}function H(s,n,o,u,p,m,y){let k=()=>{y.transform=!0,y.bounds=!0,y.boolean=!0,y.render=!0};switch(s.on){case"position":case"scale":{let e=G(s.track,o);if(!e)return;let t=W(e.from,e.to,e.t);return n[s.on][s.axis]=t,X(m,s.on,{[s.axis]:t}),void k()}case"rotation":{let e=G(s.track,o);if(!e)return;let t=W(e.from,e.to,e.t);return n.rotation[s.axis]=t*_.DEG2RAD,X(m,"rotation",{[s.axis]:t}),void k()}case"shapeSize":{let e=G(s.track,o);if(!(e&&n instanceof f))return;let t=W(e.from,e.to,e.t);return n.userData.value={...n.userData.value,[s.axis]:t},X(m,"shapeSize",{[s.axis]:t}),y.size=!0,y.bounds=!0,y.boolean=!0,void(y.render=!0)}case"opacity":{let e=G(s.track,o);if(!e||!(n instanceof g)||Array.isArray(n.material))return;let t=n.material.getLayersOfType("light")[0];if(void 0===t)return;let i=_.lerp(e.from,e.to,e.t),r=n.material,l=e.to>=1&&(1===e.t||e.from>=1);return r.setTransparent(!l||d(r.data,u.shared),u.scene),a("alphaOverride",t,{alphaOverride:i},{alphaOverride:i+1},0,u.shared),m&&(m.opacity=i),void(y.render=!0)}case"material":{let e=G(s.track,o);if(!e||0===Object.keys(e.from).length||0===Object.keys(e.to).length)return;let{layer:t}=s,i={};for(let s in t.data){if(!(s in e.from)||!(s in e.to))continue;let r=V(e.from[s],e.to[s],e.t,p);if(void 0===r)continue;i[s]=r;let o=t.getValue(s);void 0!==o&&("alpha"===s&&"number"==typeof o&&o>0&&n instanceof g&&!Array.isArray(n.material)&&(n.material.transparent=!0),a(s,t,e.from,e.to,e.t,u.shared))}return X(m,"material",{[t.uuid]:i}),void(y.render=!0)}case"light":{let e=G(s.track,o);if(!e||!(n instanceof l||n instanceof r||n instanceof h))return;let t=V(e.from,e.to,e.t,p);return n[s.field]=t,X(m,"light",{[s.field]:t}),void(y.render=!0)}case"camera":{let e=G(s.track,o);if(!(e&&n instanceof c))return;let t=W(e.from,e.to,e.t);return n[s.field]=t,void X(m,"camera",{[s.field]:t})}case"cloner":{let e=G(s.track,o);if(!e)return;let a=n.cloner?.parameters,r=t(a,e.from,e.to,e.t);return i(a,r),X(m,"cloner",r),y.cloner=!0,y.boolean=!0,void(y.render=!0)}case"pathExtrusion":{let t=G(s.track,o);if(!t||!v(n))return;let i=e(A,t.from,t.to,t.t),a=n.geometry.userData.parameters;return a.extrusion={...a.extrusion,...i},X(m,"pathExtrusion",i),n.updateGeometryInteractions({extrusion:{...a.extrusion}},u.shared),y.bounds=!0,y.boolean=!0,void(y.render=!0)}case"pathSnapping":{let t=G(s.track,o);if(!t)return;let i=n,a=e(F,t.from,t.to,t.t);return i.userData.pathSnapping={...i.userData.pathSnapping,...a},X(m,"pathSnapping",a),i.updatePathSnapping(i.userData.pathSnapping),void(y.render=!0)}}}function V(e,t,i,a){if("string"==typeof e&&a&&(e=a.color(e)),"string"==typeof t&&a&&(t=a.color(t)),"number"==typeof e)return _.lerp(e,t,i);if(x.is(e))return x.lerp(e,t,i);if(b.is(e))return b.lerp(e,t,i);if(Array.isArray(e))return(e.length>t.length?t:e).map((a,s)=>{if(Array.isArray(a)){let a=e[s].length>t[s].length?t[s].length:e[s].length;return(4===a?T:3===a?D:N).lerp(e[s],t[s],i)}return _.lerp(e[s],t[s],i)});if("object"==typeof e&&null!==e){let s={};for(let n in e){let r=V(e[n],t[n],i,a);void 0!==r&&(s[n]=r)}return s}}var K=new Map,Y=new Map,Z=class extends S{constructor(e,t,i,a,s,n){super(),this.id=e,this.data=t,this.scene=i,this.sharedAssets=a,this.object=s,this.eventType=n,this.evaluators=[],this.elapsed=0,this.lastTime=null,this.direction=1,this._playing=!1,this._finished=!1,this.hasPlayedOnce=!1,this.pauseOnNextCycleEnd=!1,this.lastCycleIndex=0;try{let e=j.findTimeline(this.scene.data.objects,this.data.timeline),t=e.duration;this.animatedObjectIds=Object.keys(e.objectTimelines),this.animatedObjectIds.forEach(s=>{let n=this.scene.find(s);if(!n)return;let o=e.objectTimelines[s];!o||this.evaluators.push(function(e,t,i,a,s){let n=function(e,t){let i=[];return O.groupKeyframes(t.keyframes).forEach(t=>{let a=t.path?.[0],s=t.path[1],n=()=>P(t.keyframes,e=>e.value);switch(a){case"position":case"rotation":case"scale":return void(s&&C.includes(s)&&i.push({on:a,axis:s,track:n()}));case"shape size":return void(s&&C.includes(s)&&"geometry"in e&&i.push({on:"shapeSize",axis:s,track:n()}));case"path extrusion":return void(v(e)&&i.push({on:"pathExtrusion",track:P(t.keyframes,e=>e.value)}));case"path snapping":return void(e.data.pathSnapping&&i.push({on:"pathSnapping",track:P(t.keyframes,e=>e.value)}));case"material":return void("Mesh"===e.type&&"material"in e&&function(e,t){let i=p(e.material)?e.material:void 0,a=t.layerId;if(!i||!a)return[];let s=t.keyframes.some(e=>u(e.data.value?.noiseStrength)),n=i.ensureRainbowNoiseCompiled,r=e=>{s&&"function"==typeof n&&n.call(i,e)},o=e=>"data"in e?[{on:"material",layer:e,track:P(t.keyframes,e=>e.value)}]:[];r(a);let l=i.getLayerByUuid(a);if(l)return o(l);let h=t.path[1];for(let e of i.getLayersOfType(h))r(e.uuid);return(i.getLayersOfType(h)??[]).flatMap(o)}(e,t).forEach(e=>i.push(e)));case"opacity":return void("Mesh"===e.type&&"material"in e&&i.push({on:"opacity",track:n()}));case"cloner":return void i.push({on:"cloner",track:P(t.keyframes,e=>e.value)});case"camera":return void(e instanceof c&&i.push({on:"camera",field:"zoom",track:n()}));case"light":return void((e instanceof l||e instanceof r||e instanceof h)&&i.push({on:"light",field:t.path[1],track:P(t.keyframes,e=>e.value)}))}}),i}(e,t);return{duration:i,evaluate(t,i){e.resetBBoxNeedsUpdate();let r={transform:!1,size:!1,cloner:!1,bounds:!1,boolean:!1,render:!1};for(let o of n)H(o,e,t,a,s,i,r);!function(e,t,i){if(t.size&&e instanceof f){let{x:t,y:a,z:s}=e.userData.value;e.updateGeometryInteractions({width:t,height:a,depth:s},i.shared)}t.cloner&&e.cloner?.update(i),t.transform&&e.updateMatrix(),t.bounds&&e.resetBBoxNeedsUpdate(),t.boolean&&e instanceof f&&e.invalidateDownstreamBooleanData(),t.render&&e.dispatchEvent({type:"requestRender"})}(e,r,a)},invalidate(){for(let e of n)z(e.track)}}}(n,{...o},t,{scene:i,shared:a},this.sharedAssets))}),this.schedule=new B((o=this.data,{duration:t,delay:R(o.delay/1e3),delayDirection:o.delayDirection??"start-end",direction:o.direction??"normal",repeat:o.repeat}))}catch(e){throw new Error("Missing property")}var o;s&&(Y.has(s.uuid)?Y.get(s.uuid).push(this):Y.set(s.uuid,[this])),K.set(e,this)}get playing(){return this._playing}get finished(){return this._finished}get paused(){return!this._playing}update(e){null!==this.lastTime&&(this.elapsed=Math.max(0,this.elapsed+(e-this.lastTime)*this.direction)),this.lastTime=e,this.applyAtElapsed()}applyAtElapsed(){if(-1===this.direction&&0===this.elapsed)return void this.pause();let e=this.schedule.resolve(this.elapsed);if(e){if(e.cycleIndex!==this.lastCycleIndex&&(this.lastCycleIndex=e.cycleIndex,this.pauseOnNextCycleEnd))return this.pauseOnNextCycleEnd=!1,void this.pause();for(let t of this.evaluators)t.evaluate(e.localTime)}else 1===this.direction&&this.schedule.isFinished(this.elapsed)&&this.finish()}finish(){this.pause(),this._finished=!0,this.animatedObjectIds.forEach(e=>{let t=this.scene.find(e);t instanceof c&&t.dispatchEvent(n)})}startTicking(){this._playing=!0,this.lastTime=null;for(let e of this.evaluators)e.invalidate();o.add(this)}play(){let e=void 0!==this.eventType&&M(this.eventType)&&"Once"===this.data.runMode&&this.hasPlayedOnce&&this.paused&&this.elapsed>0&&!this._finished;if(void 0!==this.eventType&&M(this.eventType)&&"Once"===this.data.runMode&&this.hasPlayedOnce&&!e||void 0===this.eventType&&this._finished)return!1;this.hasPlayedOnce=!0,this.animatedObjectIds.forEach(e=>{let t=this.scene.find(e);t instanceof c&&t.dispatchEvent(s)}),!e&&(0===this.elapsed||this._finished)&&(this.elapsed=0,this.lastCycleIndex=0,this._finished=!1),this.direction=1,this.startTicking()}pause(){this._playing=!1,this.lastTime=null,o.remove(this)}rewind(){this.pause(),this.elapsed=0,this.lastCycleIndex=0}stop(){this.rewind(),this.applyAtElapsed(),this._finished=!1}pauseAndRewind(){this.rewind(),this.direction=1,this.pauseOnNextCycleEnd=!1,this._finished=!1}seek(e){let t=this.schedule.totalDuration;this.elapsed=e*(Number.isFinite(t)?t:this.schedule.effectiveCycleDuration);for(let e of this.evaluators)e.invalidate();this.applyAtElapsed()}toggle(e){let t=e??-1===this.direction;this._playing&&this.direction===(t?1:-1)?t&&(this.pauseOnNextCycleEnd=!1):(t?(this._finished&&(this.elapsed=0,this.lastCycleIndex=0,this._finished=!1),this.direction=1,this.pauseOnNextCycleEnd=!1):(this.direction=this.schedule.resolve(this.elapsed)?.isReverse?1:-1,this.pauseOnNextCycleEnd=!0),this.startTicking())}playFromCurrent(){this.toggle(!0)}reverseFromCurrent(){this.toggle(!1)}dispose(){this.pause()}},Q=class{constructor(e){this.data=e}dispatch(){this.data.playTimeline?this.pauseTimeline(this.data.playTimeline):this.data.object?this.pauseAllTimelinesFromObject(this.data.object):this.pauseAllTimelines()}pauseTimeline(e){let t=this.getTimelineActions(e);!t.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{t.forEach(e=>{e[this.data.interaction]()}),this.disposeDelay()},this.data.delay)):t.forEach(e=>{e[this.data.interaction]()}))}getTimelineActions(e){let t=K.get(e);return t?[t]:[...K.values()].filter(t=>t.data.timeline===e)}pauseAllTimelinesFromObject(e){let t=Y.get(e);!t?.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{t.forEach(e=>e[this.data.interaction]()),this.disposeDelay()},this.data.delay)):t.forEach(e=>e[this.data.interaction]()))}pauseAllTimelines(){let e=[...Y.values()];!e.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{e.forEach(e=>{e.forEach(e=>{e[this.data.interaction]()})}),this.disposeDelay()},this.data.delay)):e.forEach(e=>{e.forEach(e=>{e[this.data.interaction]()})}))}disposeDelay(){clearTimeout(this.timeoutId),delete this.timeoutId}dispose(){clearTimeout(this.timeoutId),delete this.timeoutId}},q=class{constructor(e,t,i,a,s,n,r){this.data=t,this.sharedAssets=a,this.actionCondition=r;let o="interaction"in t?t.interaction:"play";if("play"===o||void 0===o)this.interaction=new Z(e,t,i,a,s,n);else{if("pause"!==o&&"stop"!==o)throw new Error("Missing property");this.interaction=new Q(t)}}get playing(){return this.interaction instanceof Z&&this.interaction.playing}get finished(){return!(this.interaction instanceof Z)||this.interaction.finished}get paused(){return!(this.interaction instanceof Z)||this.interaction.paused}branchTaken(){return y(this.sharedAssets,this.actionCondition)}play(){return!!this.branchTaken()&&(this.interaction instanceof Z?this.interaction.play():void this.interaction.dispatch())}get animatedObjectIds(){return this.interaction instanceof Z?this.interaction.animatedObjectIds:[]}pauseAndRewind(){this.interaction instanceof Z&&this.interaction.pauseAndRewind()}stop(){this.interaction instanceof Z&&this.interaction.stop()}seek(e){!this.branchTaken()||this.interaction instanceof Z&&this.interaction.seek(e)}toggle(e){!this.branchTaken()||(this.interaction instanceof Z?this.interaction.toggle(e):this.interaction.dispatch())}playFromCurrent(){!this.branchTaken()||(this.interaction instanceof Z?this.interaction.playFromCurrent():this.interaction.dispatch())}dispatchConditional(){this.playFromCurrent()}reverseFromCurrent(){!this.branchTaken()||this.interaction instanceof Z&&this.interaction.reverseFromCurrent()}dispose(){this.interaction.dispose()}};m("TimelineAnimation",({id:e,data:t,page:i,shared:a,object:s,eventType:n,actionCondition:r})=>new q(e,t,i.scene,a,s,n,r)),k("timeline");
@@ -1 +1 @@
1
- import{a as e}from"./runtime-chunk-NBYTQLIB.js";import{a as t,b as n}from"./runtime-chunk-DZNU62CT.js";import{a as i}from"./runtime-chunk-VAVYZ35B.js";import{e as s}from"./runtime-chunk-FQNSP44B.js";import{h as a}from"./runtime-chunk-DO3TPFJ2.js";import"./runtime-chunk-DOGUWR2L.js";import{h as o}from"./runtime-chunk-CLDWHXJJ.js";import"./runtime-chunk-TU4KDRKR.js";import"./runtime-chunk-OQCWMRSW.js";import"./runtime-chunk-TY3IYRYE.js";import"./runtime-chunk-JQCHQ4ER.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{f as r,g as d}from"./runtime-chunk-NWUMV7YK.js";import{v as l}from"./runtime-chunk-W2OWSMDC.js";import"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-R5WCGKXX.js";import{a as h}from"./runtime-chunk-TZCHGFVF.js";import{Ra as u,s as c,t as p}from"./runtime-chunk-CSILWFMF.js";import{Fc as m,Gc as v,Hc as g,Pe as w,Qc as f,td as E}from"./runtime-chunk-KPOUV3HD.js";import"./runtime-chunk-ML3Z74BL.js";var y=new g,M=new g,x=new g,L=new g,F=new E,D={type:"requestRender"},C=function(){let e=new g,t=new g;return(n,i,s)=>s>0?(e.subVectors(n,i),e.length()<=s?n:t.copy(i).add(e.normalize().multiplyScalar(s))):i}(),P=function(){let e=new f;return(t,n)=>{t.position.copy(n),t.parent instanceof a||(e.copy(t.parent.matrixWorld).invert(),t.position.applyMatrix4(e)),t.updateMatrix(),t.hasNonUniformScale&&(t.updateMatrixWorld(),t.updateMatrixWorldRigid()),t instanceof l&&o(t.parent)&&t.invalidateDownstreamBooleanData(!0)}}(),b=class{constructor(e,t,n,i,s,a){this.data=e,this.id=t,this.object=n,this.paused=!1,this.currentDampingFactor=1,this.snapComplete=!1,this.isReset=!1,this.worldPosition0=new g,this.timeoutId=null,this.delayFinished=!0,this.wasOutside=!1,this.data={...c.defaultData,...e,...void 0===e.resetOnPointerLeave&&{resetOnPointerLeave:!1}},void 0===e.target||"cursor"===e.target||(this.target=i.scene.findInInstance(e.target,n)??i.find(e.target)),this.data.dampingFactor&&(this.currentDampingFactor=this.data.dampingFactor),this.resetDampingFactor=80/this.data.resetSpeed+1,this.object.getWorldPosition(this.worldPosition0),this.actions=r(e,e.actions,i,s,a,n)}},j=class extends t{constructor(e,t){super(e),this.eventManager=t,this.events=[],this.pairOfEventListeners=[],this.onMouseMove=e=>{if(!(i.length>1)){this.eventContext.updateRaycaster(e);for(let e of this.events)void 0===e.target&&this.updateSingleEvent(e)}},this.onMouseEnter=e=>{for(let e of this.events)void 0===e.target&&(e.isReset=!1,e.currentDampingFactor=e.data.dampingFactor)},this.onMouseLeave=e=>{for(let e of this.events)void 0===e.target&&(e.data.resetOnPointerLeave&&(e.isReset=!0,e.currentDampingFactor=e.resetDampingFactor),this.updateSingleEvent(e))},this.onTargetChange=e=>()=>{this.updateSingleEvent(e)}}connect(){let{page:e}=this.eventContext;if(e.traverseEntity(t=>{let n=t.data?.events.find(e=>"Follow"===e.data.type&&!e.data.disabled);n&&(!e.data.globalPhysics.usePhysics||"dynamic"!==t.dataPatched.physics?.rigidBody)&&this.events.push(new b(n.data,n.id,t,e,this.eventContext.sharedAssets,this.eventManager))}),!this.events.length)return;let{domElement:t,eventElement:n}=this.eventContext;this.domEventsNeeded.clear(),s&&(this.domEventsNeeded.add("pointerdown"),t.addEventListener("pointerdown",this.onMouseMove)),this.domEventsNeeded.add("pointermove"),n.addEventListener("pointermove",this.onMouseMove),this.eventContext.useWindowEvents||(t.addEventListener("pointerenter",this.onMouseEnter),t.addEventListener("pointerleave",this.onMouseLeave));for(let e of this.events)if(void 0!==e.target){let t=e.target,n=this.onTargetChange(e);this.pairOfEventListeners.push([t,n]),t.addEventListener("requestRender",n)}}disconnect(){if(!this.events.length)return;let{domElement:e,eventElement:t}=this.eventContext;this.domEventsNeeded.clear(),s&&e.removeEventListener("pointerdown",this.onMouseMove),t.removeEventListener("pointermove",this.onMouseMove),e.removeEventListener("pointerenter",this.onMouseEnter),e.removeEventListener("pointerleave",this.onMouseLeave);for(let[e,t]of this.pairOfEventListeners)e.removeEventListener("requestRender",t);for(let e of this.events)e.paused=!0,e.isReset=!1,d(e.actions)}onAnimationFrameDamping(){for(let e of this.events)e.paused||this.updateSingleEvent(e,!0)}updateSingleEvent(e,t=!1){this.events.forEach(e=>{e.actions.Create.forEach(e=>{e.dispatchThrottled()})});let{plane:n,limitDistance:i,limitDistanceEnabled:s}=e.data;if(e.object.getWorldPosition(x),e.isReset)L.copy(e.worldPosition0);else if(e.target)e.target.getWorldPosition(L);else{let{getCamera:e,raycaster:t}=this.eventContext;if("custom"===n?(e().getWorldDirection(M),M.negate(),y.copy(M)):"xy"===n?y.set(0,0,1):"xz"===n?y.set(0,1,0):"yz"===n&&y.set(1,0,0),F.setFromNormalAndCoplanarPoint(y,x),!t.ray.intersectPlane(F,L))return}if(!e.isReset)if(L.distanceTo(e.worldPosition0)>i&&s&&e.target){if(e.snapComplete=!1,e.data.snapDelay&&(e.delayFinished=!1,typeof window<"u"&&null!==e.timeoutId&&(window.clearTimeout(e.timeoutId),e.timeoutId=null)),e.wasOutside=!0,!e.data.resetAfterDistanceLimit)return;L.copy(e.worldPosition0),e.currentDampingFactor=e.resetDampingFactor}else if(e.wasOutside&&(e.data.snapDelay&&typeof window<"u"&&(e.timeoutId=window.setTimeout(()=>{e.delayFinished=!0,e.paused=!1,this.updateSingleEvent(e)},1e3*e.data.snapDelay)),e.currentDampingFactor=e.data.dampingFactor,e.wasOutside=!1),!1===e.delayFinished)return;!1===e.data.enabledTranslation[0]&&(L.x=x.x),!1===e.data.enabledTranslation[1]&&(L.y=x.y),!1===e.data.enabledTranslation[2]&&(L.z=x.z);let a=C(x,L,e.wasOutside?0:e.data.maxDelta);if(e.currentDampingFactor>1){let n=y.subVectors(a,x).divideScalar(e.currentDampingFactor);x.add(n),t&&P(e.object,x),e.paused=n.length()<.01}else P(e.object,a),e.paused=!0;e.object?.dispatchEvent({type:"beginEvent",eventName:"Follow"}),e.object.dispatchEvent(D)}},W=new g,R=new g,S=new f,O=new v,k=new v,N=new v,Q=new v,z=new m,T=new w,I=new g,U=new g,V=new g,q=new g,A=new E,B={type:"requestRender"},Y={type:"changeRotation"},H=["x","y","z"],X=function(){let e=new f;return function(t,n){null!==t.parent?e.copy(t.parent.matrixWorld):e.identity(),n.premultiply(u(e).invert()),t.rotation.setFromRotationMatrix(n),t.updateMatrix(),t instanceof l&&o(t.parent)&&t.invalidateDownstreamBooleanData(!0)}}(),K=class{constructor(e,t,n,i){this.id=t,this.object=n,this.paused=!1,this.currentDampingFactor=1,this.isReset=!1,this.worldQuaternion0=new v,this.aim=new v,this.lastPosition=new g,this.lastParentWorld=new f,this.timeoutId=null,this.delayFinished=!0,this.wasOutside=!1,this.data={...p.defaultData,...e,...void 0===e.resetOnPointerLeave&&{resetOnPointerLeave:!1}},void 0===e.target||"cursor"===e.target||(this.target=i.scene.findInInstance(e.target,n)??i.find(e.target)),this.data.dampingFactor&&(this.currentDampingFactor=this.data.dampingFactor),this.object.getWorldQuaternion(this.worldQuaternion0),isNaN(this.worldQuaternion0.x)&&(this.worldQuaternion0.x=0),isNaN(this.worldQuaternion0.y)&&(this.worldQuaternion0.y=0),isNaN(this.worldQuaternion0.z)&&(this.worldQuaternion0.z=0),isNaN(this.worldQuaternion0.w)&&(this.worldQuaternion0.w=1),this.aim.copy(this.worldQuaternion0),this.base0=n.rotation.clone(),this.base=n.rotation.clone(),this.written=n.rotation.clone(),this.lastPosition.copy(n.position),n.parent&&this.lastParentWorld.copy(n.parent.matrixWorld),this.resetDampingFactor=80/this.data.resetSpeed+1}},G=class extends t{constructor(){super(...arguments),this.events=[],this.pairOfEventListeners=[],this.pairOfUserEventListeners=[],this.lastCameraWorld=new f,this.lastCameraProjection=new f,this.onMouseMove=e=>{if(!(i.length>1)){this._lastMouseEvent=e,this.eventContext.updateRaycaster(e);for(let e of this.events)void 0===e.target&&this.updateSingleEvent(e)}},this.onMouseEnter=e=>{for(let e of this.events)void 0===e.target&&(e.isReset=!1,e.currentDampingFactor=e.data.dampingFactor)},this.onMouseLeave=e=>{for(let e of this.events)void 0===e.target&&(e.data.resetOnPointerLeave&&(e.isReset=!0,e.currentDampingFactor=e.resetDampingFactor),this.updateSingleEvent(e))},this.onScroll=e=>{if(this._lastMouseEvent){let e=new PointerEvent("pointermove",{clientX:this._lastMouseEvent.clientX,clientY:this._lastMouseEvent.clientY,bubbles:!0,cancelable:!0,view:window});this.eventContext.eventElement.dispatchEvent(e)}},this.onTargetChange=e=>()=>{this.updateSingleEvent(e)},this.createUserEventListener=t=>({eventName:n,target:i})=>{if(!n||!i)return;let s=e(n);s&&"LookAt"===s&&this.updateSingleEvent(t)}}connect(){let{page:e}=this.eventContext;if(e.traverseEntity(t=>{let n=t.data?.events.find(e=>"LookAt"===e.data.type&&!e.data.disabled);n&&(!e.data.globalPhysics.usePhysics||"dynamic"!==t.dataPatched.physics?.rigidBody)&&this.events.push(new K(n.data,n.id,t,e))}),!this.events.length)return;let{domElement:t,eventElement:n}=this.eventContext;this.domEventsNeeded.clear(),s&&(this.domEventsNeeded.add("pointerdown"),t.addEventListener("pointerdown",this.onMouseMove)),this.domEventsNeeded.add("pointermove"),n.addEventListener("pointermove",this.onMouseMove),this.eventContext.useWindowEvents?n.addEventListener("scroll",this.onScroll):(t.addEventListener("pointerenter",this.onMouseEnter),t.addEventListener("pointerleave",this.onMouseLeave));for(let e of this.events){if(void 0!==e.target){let t=this.onTargetChange(e),n=e.target;this.pairOfEventListeners.push([n,t]),n.addEventListener("requestRender",t)}let t=this.createUserEventListener(e),n=e.object;this.pairOfUserEventListeners.push([n,t]),n.addEventListener("userEvent",t)}}disconnect(){if(!this.events.length)return;let{domElement:e,eventElement:t}=this.eventContext;this.domEventsNeeded.clear(),s&&e.removeEventListener("pointerdown",this.onMouseMove),t.removeEventListener("pointermove",this.onMouseMove),e.removeEventListener("pointerenter",this.onMouseEnter),e.removeEventListener("pointerleave",this.onMouseLeave),t.removeEventListener("scroll",this.onScroll);for(let[e,t]of this.pairOfEventListeners)e.removeEventListener("requestRender",t);for(let[e,t]of this.pairOfUserEventListeners)e.removeEventListener("userEvent",t);for(let e of this.events)e.paused=!0,e.isReset=!1}onAnimationFrameDamping(){let e=this.cameraMoved();for(let t of this.events)t.paused&&(this.objectMoved(t)||e&&!t.target)&&(t.paused=!1),!t.paused&&this.updateSingleEvent(t)}cameraMoved(){let e=this.eventContext.getCamera();return!(!e||(e.updateWorldMatrix(!0,!1),e===this.lastCamera&&this.lastCameraWorld.equals(e.matrixWorld)&&this.lastCameraProjection.equals(e.projectionMatrix))||(this.lastCamera=e,this.lastCameraWorld.copy(e.matrixWorld),this.lastCameraProjection.copy(e.projectionMatrix),0))}objectMoved(e){let{object:t}=e;return!t.rotation.equals(e.written)||!t.position.equals(e.lastPosition)||!!t.parent&&(t.parent.updateWorldMatrix(!0,!1),!t.parent.matrixWorld.equals(e.lastParentWorld))}updateSingleEvent(e){let{tilt:t,axis:n,distance:i,plane:s,limitDistance:a,enabledRotation:o,limitDistanceEnabled:r}=e.data,{getCamera:d}=this.eventContext,{object:l,target:h}=e,u=!1;for(let t of H)l.rotation[t]!==e.written[t]&&(e.base[t]=l.rotation[t],u=!0);if(l.getWorldPosition(I),e.lastPosition.copy(l.position),l.parent&&e.lastParentWorld.copy(l.parent.matrixWorld),!e.isReset)if(e.target)e.target.getWorldPosition(U);else{let t=d();t.updateWorldMatrix(!0,!1);let{x:n,y:a}=this.eventContext.pointerWorld;if(T.setFromCamera(z.set(n,a),t),"custom"===s?(t.getWorldDirection(R),R.negate(),A.setFromNormalAndCoplanarPoint(R,I)):("xy"===s?W.set(0,0,1):"xz"===s?W.set(0,1,0):"yz"===s&&W.set(1,0,0),A.setFromNormalAndCoplanarPoint(W,I)),!T.ray.intersectPlane(A,U))return this.hold(e,u);i>0&&("custom"===s||void 0===s)&&U.addScaledVector(R,i)}if(e.isReset||(h?"target"===t?V.copy(h.up).applyMatrix4(S.extractRotation(h.matrixWorld)).normalize():o.some(e=>!1===e)?("x"===n?(q.set(0,0,1),!1===o[2]&&q.set(0,1,0)):"y"===n?(q.set(1,0,0),!1===o[0]&&q.set(0,0,1)):(q.set(0,1,0),!1===o[1]&&q.set(1,0,0)),V.copy(q).applyQuaternion(e.worldQuaternion0).normalize()):V.set(0,1,0):"custom"===s?V.set(0,1,0):V.copy(W)),e.isReset)k.copy(e.worldQuaternion0);else if(I.distanceTo(U)>a&&r&&h){if(e.data.snapDelay&&(e.delayFinished=!1,typeof window<"u"&&null!==e.timeoutId&&(window.clearTimeout(e.timeoutId),e.timeoutId=null)),e.wasOutside=!0,!e.data.resetAfterDistanceLimit)return this.hold(e,u);k.copy(e.worldQuaternion0),e.currentDampingFactor=e.resetDampingFactor}else{if(e.wasOutside&&(e.data.snapDelay&&typeof window<"u"&&(e.timeoutId=window.setTimeout(()=>{e.delayFinished=!0,e.paused=!1,this.updateSingleEvent(e)},1e3*e.data.snapDelay)),e.currentDampingFactor=e.data.dampingFactor,e.wasOutside=!1),!1===e.delayFinished)return this.hold(e,u);(function(e,t,n,i,s,a){let o=S.elements;_.subVectors(t,n),0===_.lengthSq()&&(_.z=1),_.normalize(),Z.crossVectors(i,_),0===Z.lengthSq()&&(1===Math.abs(i.z)?_.x+=1e-4:_.z+=1e-4,_.normalize(),Z.crossVectors(i,_)),Z.normalize(),J.crossVectors(_,Z),"x"===s?1===a.z?[Z,J,_]=[_,Z,J]:(Z.negate(),[Z,_]=[_,Z]):"y"===s?1===a.x?[Z,J,_]=[J,_,Z]:(Z.negate(),[J,_]=[_,J]):1===a.x&&(Z.negate(),[Z,J]=[J,Z]),o[0]=Z.x,o[4]=J.x,o[8]=_.x,o[1]=Z.y,o[5]=J.y,o[9]=_.y,o[2]=Z.z,o[6]=J.z,o[10]=_.z})(0,U,I,V,n,q),k.setFromRotationMatrix(S),O.setFromUnitVectors(q.applyQuaternion(k),V),o.some(e=>!1===e)&&"target"!==t&&k.premultiply(O).normalize()}e.currentDampingFactor>1?(e.aim.slerp(k,1/e.currentDampingFactor),e.paused=8*(1-Math.abs(e.aim.dot(k)))<1e-6):(e.aim.copy(k),e.paused=!0),this.write(e)}hold(e,t){e.paused=!0,t&&this.write(e)}write(e){let{object:t}=e;Q.setFromEuler(e.base0).invert().multiply(N.setFromEuler(e.base)),O.copy(e.aim).multiply(Q),X(t,S.makeRotationFromQuaternion(O)),e.written.copy(t.rotation),e.object?.dispatchEvent({type:"beginEvent",eventName:"LookAt"}),t.dispatchEvent(B),t.dispatchEvent(Y)}},J=new g,Z=new g,_=new g;n("Follow",({eventContext:e,eventManager:t})=>new j(e,t)),n("LookAt",({eventContext:e})=>new G(e)),h("tracking");
1
+ import{a as e}from"./runtime-chunk-NBYTQLIB.js";import{a as t,b as n}from"./runtime-chunk-DZNU62CT.js";import{a as i}from"./runtime-chunk-VAVYZ35B.js";import{e as s}from"./runtime-chunk-FQNSP44B.js";import{h as a}from"./runtime-chunk-WUWFEW2T.js";import"./runtime-chunk-UU4RVNYR.js";import{h as o}from"./runtime-chunk-RA5UBNOL.js";import"./runtime-chunk-TU4KDRKR.js";import"./runtime-chunk-IIF6BGTE.js";import"./runtime-chunk-ED2A7PP4.js";import"./runtime-chunk-PMIN6YLE.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{f as r,g as d}from"./runtime-chunk-NWUMV7YK.js";import{v as l}from"./runtime-chunk-HO57WDLD.js";import"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-R5WCGKXX.js";import{a as h}from"./runtime-chunk-TZCHGFVF.js";import{Ra as u,s as c,t as p}from"./runtime-chunk-CSILWFMF.js";import{Fc as m,Gc as v,Hc as g,Pe as w,Qc as f,td as E}from"./runtime-chunk-KPOUV3HD.js";import"./runtime-chunk-ML3Z74BL.js";var y=new g,x=new g,L=new g,M=new g,F=new E,D={type:"requestRender"},P=function(){let e=new g,t=new g;return(n,i,s)=>s>0?(e.subVectors(n,i),e.length()<=s?n:t.copy(i).add(e.normalize().multiplyScalar(s))):i}(),C=function(){let e=new f;return(t,n)=>{t.position.copy(n),t.parent instanceof a||(e.copy(t.parent.matrixWorld).invert(),t.position.applyMatrix4(e)),t.updateMatrix(),t.hasNonUniformScale&&(t.updateMatrixWorld(),t.updateMatrixWorldRigid()),t instanceof l&&o(t.parent)&&t.invalidateDownstreamBooleanData(!0)}}(),b=class{constructor(e,t,n,i,s,a){this.data=e,this.id=t,this.object=n,this.paused=!1,this.currentDampingFactor=1,this.snapComplete=!1,this.isReset=!1,this.worldPosition0=new g,this.timeoutId=null,this.delayFinished=!0,this.wasOutside=!1,this.data={...c.defaultData,...e,...void 0===e.resetOnPointerLeave&&{resetOnPointerLeave:!1}},void 0===e.target||"cursor"===e.target||(this.target=i.scene.findInInstance(e.target,n)??i.find(e.target)),this.data.dampingFactor&&(this.currentDampingFactor=this.data.dampingFactor),this.resetDampingFactor=80/this.data.resetSpeed+1,this.object.getWorldPosition(this.worldPosition0),this.actions=r(e,e.actions,i,s,a,n)}},j=class extends t{constructor(e,t){super(e),this.eventManager=t,this.events=[],this.pairOfEventListeners=[],this.onMouseMove=e=>{if(!(i.length>1)){this.eventContext.updateRaycaster(e);for(let e of this.events)void 0===e.target&&this.updateSingleEvent(e)}},this.onMouseEnter=e=>{for(let e of this.events)void 0===e.target&&(e.isReset=!1,e.currentDampingFactor=e.data.dampingFactor)},this.onMouseLeave=e=>{for(let e of this.events)void 0===e.target&&(e.data.resetOnPointerLeave&&(e.isReset=!0,e.currentDampingFactor=e.resetDampingFactor),this.updateSingleEvent(e))},this.onTargetChange=e=>()=>{this.updateSingleEvent(e)}}connect(){let{page:e}=this.eventContext;if(e.traverseEntity(t=>{let n=t.data?.events.find(e=>"Follow"===e.data.type&&!e.data.disabled);n&&(!e.data.globalPhysics.usePhysics||"dynamic"!==t.dataPatched.physics?.rigidBody)&&this.events.push(new b(n.data,n.id,t,e,this.eventContext.sharedAssets,this.eventManager))}),!this.events.length)return;let{domElement:t,eventElement:n}=this.eventContext;this.domEventsNeeded.clear(),s&&(this.domEventsNeeded.add("pointerdown"),t.addEventListener("pointerdown",this.onMouseMove)),this.domEventsNeeded.add("pointermove"),n.addEventListener("pointermove",this.onMouseMove),this.eventContext.useWindowEvents||(t.addEventListener("pointerenter",this.onMouseEnter),t.addEventListener("pointerleave",this.onMouseLeave));for(let e of this.events)if(void 0!==e.target){let t=e.target,n=this.onTargetChange(e);this.pairOfEventListeners.push([t,n]),t.addEventListener("requestRender",n)}}disconnect(){if(!this.events.length)return;let{domElement:e,eventElement:t}=this.eventContext;this.domEventsNeeded.clear(),s&&e.removeEventListener("pointerdown",this.onMouseMove),t.removeEventListener("pointermove",this.onMouseMove),e.removeEventListener("pointerenter",this.onMouseEnter),e.removeEventListener("pointerleave",this.onMouseLeave);for(let[e,t]of this.pairOfEventListeners)e.removeEventListener("requestRender",t);for(let e of this.events)e.paused=!0,e.isReset=!1,d(e.actions)}onAnimationFrameDamping(){for(let e of this.events)e.paused||this.updateSingleEvent(e,!0)}updateSingleEvent(e,t=!1){this.events.forEach(e=>{e.actions.Create.forEach(e=>{e.dispatchThrottled()})});let{plane:n,limitDistance:i,limitDistanceEnabled:s}=e.data;if(e.object.getWorldPosition(L),e.isReset)M.copy(e.worldPosition0);else if(e.target)e.target.getWorldPosition(M);else{let{getCamera:e,raycaster:t}=this.eventContext;if("custom"===n?(e().getWorldDirection(x),x.negate(),y.copy(x)):"xy"===n?y.set(0,0,1):"xz"===n?y.set(0,1,0):"yz"===n&&y.set(1,0,0),F.setFromNormalAndCoplanarPoint(y,L),!t.ray.intersectPlane(F,M))return}if(!e.isReset)if(M.distanceTo(e.worldPosition0)>i&&s&&e.target){if(e.snapComplete=!1,e.data.snapDelay&&(e.delayFinished=!1,typeof window<"u"&&null!==e.timeoutId&&(window.clearTimeout(e.timeoutId),e.timeoutId=null)),e.wasOutside=!0,!e.data.resetAfterDistanceLimit)return;M.copy(e.worldPosition0),e.currentDampingFactor=e.resetDampingFactor}else if(e.wasOutside&&(e.data.snapDelay&&typeof window<"u"&&(e.timeoutId=window.setTimeout(()=>{e.delayFinished=!0,e.paused=!1,this.updateSingleEvent(e)},1e3*e.data.snapDelay)),e.currentDampingFactor=e.data.dampingFactor,e.wasOutside=!1),!1===e.delayFinished)return;!1===e.data.enabledTranslation[0]&&(M.x=L.x),!1===e.data.enabledTranslation[1]&&(M.y=L.y),!1===e.data.enabledTranslation[2]&&(M.z=L.z);let a=P(L,M,e.wasOutside?0:e.data.maxDelta);if(e.currentDampingFactor>1){let n=y.subVectors(a,L).divideScalar(e.currentDampingFactor);L.add(n),t&&C(e.object,L),e.paused=n.length()<.01}else C(e.object,a),e.paused=!0;e.object?.dispatchEvent({type:"beginEvent",eventName:"Follow"}),e.object.dispatchEvent(D)}},W=new g,R=new g,N=new f,k=new v,S=new v,O=new v,z=new v,T=new m,Q=new w,I=new g,U=new g,A=new g,V=new g,q=new E,B={type:"requestRender"},Y={type:"changeRotation"},H=["x","y","z"],K=function(){let e=new f;return function(t,n){null!==t.parent?e.copy(t.parent.matrixWorld):e.identity(),n.premultiply(u(e).invert()),t.rotation.setFromRotationMatrix(n),t.updateMatrix(),t instanceof l&&o(t.parent)&&t.invalidateDownstreamBooleanData(!0)}}(),X=class{constructor(e,t,n,i){this.id=t,this.object=n,this.paused=!1,this.currentDampingFactor=1,this.isReset=!1,this.worldQuaternion0=new v,this.aim=new v,this.lastPosition=new g,this.lastParentWorld=new f,this.timeoutId=null,this.delayFinished=!0,this.wasOutside=!1,this.data={...p.defaultData,...e,...void 0===e.resetOnPointerLeave&&{resetOnPointerLeave:!1}},void 0===e.target||"cursor"===e.target||(this.target=i.scene.findInInstance(e.target,n)??i.find(e.target)),this.data.dampingFactor&&(this.currentDampingFactor=this.data.dampingFactor),this.object.getWorldQuaternion(this.worldQuaternion0),isNaN(this.worldQuaternion0.x)&&(this.worldQuaternion0.x=0),isNaN(this.worldQuaternion0.y)&&(this.worldQuaternion0.y=0),isNaN(this.worldQuaternion0.z)&&(this.worldQuaternion0.z=0),isNaN(this.worldQuaternion0.w)&&(this.worldQuaternion0.w=1),this.aim.copy(this.worldQuaternion0),this.base0=n.rotation.clone(),this.base=n.rotation.clone(),this.written=n.rotation.clone(),this.lastPosition.copy(n.position),n.parent&&this.lastParentWorld.copy(n.parent.matrixWorld),this.resetDampingFactor=80/this.data.resetSpeed+1}},G=class extends t{constructor(){super(...arguments),this.events=[],this.pairOfEventListeners=[],this.pairOfUserEventListeners=[],this.lastCameraWorld=new f,this.lastCameraProjection=new f,this.onMouseMove=e=>{if(!(i.length>1)){this._lastMouseEvent=e,this.eventContext.updateRaycaster(e);for(let e of this.events)void 0===e.target&&this.updateSingleEvent(e)}},this.onMouseEnter=e=>{for(let e of this.events)void 0===e.target&&(e.isReset=!1,e.currentDampingFactor=e.data.dampingFactor)},this.onMouseLeave=e=>{for(let e of this.events)void 0===e.target&&(e.data.resetOnPointerLeave&&(e.isReset=!0,e.currentDampingFactor=e.resetDampingFactor),this.updateSingleEvent(e))},this.onScroll=e=>{if(this._lastMouseEvent){let e=new PointerEvent("pointermove",{clientX:this._lastMouseEvent.clientX,clientY:this._lastMouseEvent.clientY,bubbles:!0,cancelable:!0,view:window});this.eventContext.eventElement.dispatchEvent(e)}},this.onTargetChange=e=>()=>{this.updateSingleEvent(e)},this.createUserEventListener=t=>({eventName:n,target:i})=>{if(!n||!i)return;let s=e(n);s&&"LookAt"===s&&this.updateSingleEvent(t)}}connect(){let{page:e}=this.eventContext;if(e.traverseEntity(t=>{let n=t.data?.events.find(e=>"LookAt"===e.data.type&&!e.data.disabled);n&&(!e.data.globalPhysics.usePhysics||"dynamic"!==t.dataPatched.physics?.rigidBody)&&this.events.push(new X(n.data,n.id,t,e))}),!this.events.length)return;let{domElement:t,eventElement:n}=this.eventContext;this.domEventsNeeded.clear(),s&&(this.domEventsNeeded.add("pointerdown"),t.addEventListener("pointerdown",this.onMouseMove)),this.domEventsNeeded.add("pointermove"),n.addEventListener("pointermove",this.onMouseMove),this.eventContext.useWindowEvents?n.addEventListener("scroll",this.onScroll):(t.addEventListener("pointerenter",this.onMouseEnter),t.addEventListener("pointerleave",this.onMouseLeave));for(let e of this.events){if(void 0!==e.target){let t=this.onTargetChange(e),n=e.target;this.pairOfEventListeners.push([n,t]),n.addEventListener("requestRender",t)}let t=this.createUserEventListener(e),n=e.object;this.pairOfUserEventListeners.push([n,t]),n.addEventListener("userEvent",t)}}disconnect(){if(!this.events.length)return;let{domElement:e,eventElement:t}=this.eventContext;this.domEventsNeeded.clear(),s&&e.removeEventListener("pointerdown",this.onMouseMove),t.removeEventListener("pointermove",this.onMouseMove),e.removeEventListener("pointerenter",this.onMouseEnter),e.removeEventListener("pointerleave",this.onMouseLeave),t.removeEventListener("scroll",this.onScroll);for(let[e,t]of this.pairOfEventListeners)e.removeEventListener("requestRender",t);for(let[e,t]of this.pairOfUserEventListeners)e.removeEventListener("userEvent",t);for(let e of this.events)e.paused=!0,e.isReset=!1}onAnimationFrameDamping(){let e=this.cameraMoved();for(let t of this.events)t.paused&&(this.objectMoved(t)||e&&!t.target)&&(t.paused=!1),!t.paused&&this.updateSingleEvent(t)}cameraMoved(){let e=this.eventContext.getCamera();return!(!e||(e.updateWorldMatrix(!0,!1),e===this.lastCamera&&this.lastCameraWorld.equals(e.matrixWorld)&&this.lastCameraProjection.equals(e.projectionMatrix))||(this.lastCamera=e,this.lastCameraWorld.copy(e.matrixWorld),this.lastCameraProjection.copy(e.projectionMatrix),0))}objectMoved(e){let{object:t}=e;return!t.rotation.equals(e.written)||!t.position.equals(e.lastPosition)||!!t.parent&&(t.parent.updateWorldMatrix(!0,!1),!t.parent.matrixWorld.equals(e.lastParentWorld))}updateSingleEvent(e){let{tilt:t,axis:n,distance:i,plane:s,limitDistance:a,enabledRotation:o,limitDistanceEnabled:r}=e.data,{getCamera:d}=this.eventContext,{object:l,target:h}=e,u=!1;for(let t of H)l.rotation[t]!==e.written[t]&&(e.base[t]=l.rotation[t],u=!0);if(l.getWorldPosition(I),e.lastPosition.copy(l.position),l.parent&&e.lastParentWorld.copy(l.parent.matrixWorld),!e.isReset)if(e.target)e.target.getWorldPosition(U);else{let t=d();t.updateWorldMatrix(!0,!1);let{x:n,y:a}=this.eventContext.pointerWorld;if(Q.setFromCamera(T.set(n,a),t),"custom"===s?(t.getWorldDirection(R),R.negate(),q.setFromNormalAndCoplanarPoint(R,I)):("xy"===s?W.set(0,0,1):"xz"===s?W.set(0,1,0):"yz"===s&&W.set(1,0,0),q.setFromNormalAndCoplanarPoint(W,I)),!Q.ray.intersectPlane(q,U))return this.hold(e,u);i>0&&("custom"===s||void 0===s)&&U.addScaledVector(R,i)}if(e.isReset||(h?"target"===t?A.copy(h.up).applyMatrix4(N.extractRotation(h.matrixWorld)).normalize():o.some(e=>!1===e)?("x"===n?(V.set(0,0,1),!1===o[2]&&V.set(0,1,0)):"y"===n?(V.set(1,0,0),!1===o[0]&&V.set(0,0,1)):(V.set(0,1,0),!1===o[1]&&V.set(1,0,0)),A.copy(V).applyQuaternion(e.worldQuaternion0).normalize()):A.set(0,1,0):"custom"===s?A.set(0,1,0):A.copy(W)),e.isReset)S.copy(e.worldQuaternion0);else if(I.distanceTo(U)>a&&r&&h){if(e.data.snapDelay&&(e.delayFinished=!1,typeof window<"u"&&null!==e.timeoutId&&(window.clearTimeout(e.timeoutId),e.timeoutId=null)),e.wasOutside=!0,!e.data.resetAfterDistanceLimit)return this.hold(e,u);S.copy(e.worldQuaternion0),e.currentDampingFactor=e.resetDampingFactor}else{if(e.wasOutside&&(e.data.snapDelay&&typeof window<"u"&&(e.timeoutId=window.setTimeout(()=>{e.delayFinished=!0,e.paused=!1,this.updateSingleEvent(e)},1e3*e.data.snapDelay)),e.currentDampingFactor=e.data.dampingFactor,e.wasOutside=!1),!1===e.delayFinished)return this.hold(e,u);(function(e,t,n,i,s,a){let o=N.elements;J.subVectors(t,n),0===J.lengthSq()&&(J.z=1),J.normalize(),_.crossVectors(i,J),0===_.lengthSq()&&(1===Math.abs(i.z)?J.x+=1e-4:J.z+=1e-4,J.normalize(),_.crossVectors(i,J)),_.normalize(),Z.crossVectors(J,_),"x"===s?1===a.z?[_,Z,J]=[J,_,Z]:(_.negate(),[_,J]=[J,_]):"y"===s?1===a.x?[_,Z,J]=[Z,J,_]:(_.negate(),[Z,J]=[J,Z]):1===a.x&&(_.negate(),[_,Z]=[Z,_]),o[0]=_.x,o[4]=Z.x,o[8]=J.x,o[1]=_.y,o[5]=Z.y,o[9]=J.y,o[2]=_.z,o[6]=Z.z,o[10]=J.z})(0,U,I,A,n,V),S.setFromRotationMatrix(N),k.setFromUnitVectors(V.applyQuaternion(S),A),o.some(e=>!1===e)&&"target"!==t&&S.premultiply(k).normalize()}e.currentDampingFactor>1?(e.aim.slerp(S,1/e.currentDampingFactor),e.paused=8*(1-Math.abs(e.aim.dot(S)))<1e-6):(e.aim.copy(S),e.paused=!0),this.write(e)}hold(e,t){e.paused=!0,t&&this.write(e)}write(e){let{object:t}=e;z.setFromEuler(e.base0).invert().multiply(O.setFromEuler(e.base)),k.copy(e.aim).multiply(z),K(t,N.makeRotationFromQuaternion(k)),e.written.copy(t.rotation),e.object?.dispatchEvent({type:"beginEvent",eventName:"LookAt"}),t.dispatchEvent(B),t.dispatchEvent(Y)}},Z=new g,_=new g,J=new g;n("Follow",({eventContext:e,eventManager:t})=>new j(e,t)),n("LookAt",({eventContext:e})=>new G(e)),h("tracking");
@@ -1 +1 @@
1
- import{h as t,j as i,k as e,l as s,m as n}from"./runtime-chunk-R3EYG5KF.js";import"./runtime-chunk-7OHCCGTO.js";import"./runtime-chunk-NTUTXO7Q.js";import{a as r,b as a,e as o,g as h}from"./runtime-chunk-67A7TMAH.js";import"./runtime-chunk-HD7WF3XN.js";import{a as c}from"./runtime-chunk-GGSUJEGZ.js";import"./runtime-chunk-FTVQTRM7.js";import{a as d}from"./runtime-chunk-CLDWHXJJ.js";import"./runtime-chunk-4CCT57BJ.js";import"./runtime-chunk-OQCWMRSW.js";import"./runtime-chunk-TY3IYRYE.js";import"./runtime-chunk-JQCHQ4ER.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{b as l,e as u}from"./runtime-chunk-NWUMV7YK.js";import"./runtime-chunk-W2OWSMDC.js";import"./runtime-chunk-RTLL6WIB.js";import{e as m}from"./runtime-chunk-2PT2WH66.js";import{a as p}from"./runtime-chunk-R5WCGKXX.js";import{a as g}from"./runtime-chunk-TZCHGFVF.js";import{p as A}from"./runtime-chunk-CSILWFMF.js";import{Dc as j,Ec as f}from"./runtime-chunk-KPOUV3HD.js";import"./runtime-chunk-ML3Z74BL.js";function y(t){let i=t.tweens[0]?.data;return{delay:i?.delay??t.delay,delayDirection:i?.delayDirection??"start-once",direction:i?.direction??t.direction,repeat:i?.repeat??t.repeat}}var w={state:null,duration:0,delay:0,delayDirection:"start-once",direction:"normal",repeat:0,easing:0},C=class extends j{constructor(t,i,s,n,r,a,o){if(super(),this.eventType=t,this.data=i,this.page=s,this.shared=n,this.condition=r,this.runModeOverride=a,this.tweens=[],this.hasPlayedOnce=!1,this.inert=e,!i.object)throw new Error("Missing property");let h=this.page.scene.findFrom(i.object,o)??this.page.uiCanvas?.find(i.object)??this.page.scene.find2DInUIObjects(i.object);if(!h)throw new Error("Missing property");if(!h.states)throw new Error("Missing property");if(this.object=h,i.tweens.length<2)throw new Error("Missing property");this.init()}get playing(){return!0===this.runner?.isPlaying}get animating(){return!0===this.runner?.isAnimating}get claimTime(){return this.runner?.claimTime}get contested(){let t=this.object.previousAction;return null!==t&&t!==this&&t.animating}init(){this.initialCurrentState=i(this.object,this.object.currentState).id,this.build()}shouldReinit(){return!!u(this.shared,this.condition)||!(this.animating&&!this.loopsForever)}get loopsForever(){return-1===y(this.data).repeat||this.data.tweens.some((t,i)=>i>0&&-1===t.data.repeat)}get runMode(){return void 0!==this.runModeOverride?this.runModeOverride:A(this.eventType)?this.data.runMode:"Repeat"}get currentState(){return"Toggle"===this.runMode?this.initialCurrentState:this.object.currentState}get opensOnCurrent(){return void 0===this.data.tweens[0].data.state&&"Toggle"!==this.runMode}build(){let i=this.data.tweens,e=[];try{let t=i[0].data.state;void 0!==t&&e.push(new n(this.object,t,t,w,this.shared,this.data.allowSlerp??!1,this.page,{},()=>this.inert));for(let t=1;t<i.length;t++){let s=i[t-1],r=i[t];e.push(new n(this.object,void 0===s.data.state?this.currentState:s.data.state,void 0===r.data.state?this.currentState:r.data.state,r.data,this.shared,this.data.allowSlerp??!1,this.page,{},()=>this.inert))}}catch(t){return void(t instanceof Error&&console.error(t.message))}this.tweens=e,this.syncInert(),this.runner=new h({...t(y(this.data)),runMode:this.runMode},e.map(t=>t.runner),{claim:t=>this.claimObject(t),assignCurrentState:()=>this.rebindTweens(),isOwner:()=>this.object.previousAction===this})}claimObject(t){if(this.object.previousAction===this)return!1;let i=this.object.previousAction;if(!0===i?.animating){if(void 0!==t&&void 0!==i.claimTime&&i.claimTime>t)return!1;i.pause()}return this.object.previousAction=this,!0}rebindTweens(){for(let t of this.tweens)try{t.rebind()}catch(t){t instanceof Error&&console.error(t.message)}this.syncInert(),this.object instanceof d&&this.object.wasMovedByUser&&(this.object.wasMovedByUser=!1)}syncInert(){let t=this.tweens.flatMap(t=>t.endpointData);if(this.opensOnCurrent&&t.length>0){let e=i(this.object,this.object.currentState);e&&(t[0]=e.data)}this.inert=this.notMovedByOwner(s(t));for(let t of this.tweens)t.refresh()}notMovedByOwner(t){let i=this.object.previousAction;if(0===t.size||null===i||i===this||!i.animating)return t;let e=i.leavesAlone;return new Set([...t].filter(t=>e.has(t)))}get leavesAlone(){return this.inert}update(t){this.runner?.update(t),!0!==this.runner?.isPlaying&&c.remove(this)}branchTaken(){return u(this.shared,this.condition)}play(){if(!this.branchTaken()||"Once"===this.runMode&&this.hasPlayedOnce)return!1;this.hasPlayedOnce=!0,this.start()}start(){!this.runner||(this.runner.play(c.time),this.runner.isPlaying&&c.add(this))}pause(){this.runner?.stop(),c.remove(this)}stop(){this.pause();let t=void 0===this.data.tweens[0].data.state?this.initialCurrentState:this.data.tweens[0].data.state;m(this.object)?this.object.changeSelectedState(t,{shared:this.shared}):this.object.changeSelectedState(t,{scene:this.page.scene,shared:this.shared}),this.object.currentState=t}seek(t){if(!1===u(this.shared,this.condition))return!1;this.runner?.seek(t)}playDirected(t){if(!1===u(this.shared,this.condition))return!1;!this.runner||(this.runner.playDirected(c.time,t),this.runner.isPlaying&&c.add(this))}playFromCurrent(){this.playDirected(!0)}reverseFromCurrent(){this.playDirected(!1)}dispose(){this.pause()}},b=new Map;function T(t,i){if(void 0===i)return;let e=t.scene.find(i);return e?a(e):i}var v=class extends j{constructor(t,i,e,s,n){super(),this.page=i,this.animationControls=e,this.shared=s,this.condition=n,this.startOnceDelay=0,this.toggleIsForward=!1;let a=T(i,t.object)??t.object;this.data={...t,object:a};let o=this.animationControls.clipIdToAction[t.clipId+"/"+a];if(this.duration=o?.getClip()?.duration??1,this.data.crop2){let t=r(o?.getClip());this.leftFrameTime=this.data.crop2[0]/(t-1)*this.duration,this.rightFrameTime=this.data.crop2[1]/(t-1)*this.duration}else{let t=o?.getClip()?.tracks[0]?.times.length;t&&t>1?(this.leftFrameTime=this.data.crop[0]/t*this.duration,this.rightFrameTime=this.data.crop[1]/t*this.duration):(this.leftFrameTime=0,this.rightFrameTime=this.duration)}this.startOnceDelay=t.delay;let h=b.get(a);h||(h=new Set,b.set(a,h)),h.add(this)}get playing(){return this.threeAnimAction?.isRunning()??!1}cancelPending(){window.clearTimeout(this.timeoutId),delete this.timeoutId}resume(){let t=this.animationControls.clipIdToAction[this.data.clipId+"/"+this.data.object];return!(!t||!this.animationControls.resumeClip(t)||(this.threeAnimAction=t,0))}play(t=!1){if(!1===u(this.shared,this.condition))return!1;window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{this.resume()||(this.threeAnimAction=this.animationControls.play(this.data),this.threeAnimAction&&this.animationControls.startClip(this.threeAnimAction,this.data.object,{start:this.leftFrameTime,end:this.rightFrameTime,fade:t?.2:0}))},this.startOnceDelay)}pause(){this.threeAnimAction&&(this.threeAnimAction.paused=!0),this.cancelPending()}stop(){this.threeAnimAction?.fadeOut(.2)}seek(t){this.threeAnimAction=this.animationControls.play(this.data),this.threeAnimAction&&(this.threeAnimAction.paused=!0,this.threeAnimAction.time=f.clamp(this.threeAnimAction.time+1/60*t,this.leftFrameTime,this.rightFrameTime-16e-5),this.animationControls.needsUpdate=!0,this.animationControls.requestRender())}toggle(t,i=!1){if(!1===u(this.shared,this.condition))return!1;this.toggleIsForward=t??!this.toggleIsForward,this.threeAnimAction&&(this.threeAnimAction._loopCount=0),this.playing||this.resume()?this.threeAnimAction&&(this.threeAnimAction.timeScale=this.toggleIsForward?1:-1,this.toggleIsForward?(this.threeAnimAction._clip.start=this.leftFrameTime,this.threeAnimAction._clip.duration=this.rightFrameTime):(this.threeAnimAction._clip.start=this.rightFrameTime,this.threeAnimAction._clip.duration=this.leftFrameTime)):this.timeoutId=window.setTimeout(()=>{if(this.threeAnimAction=this.animationControls.play(this.data),!this.threeAnimAction)return;let[t,e]=this.toggleIsForward?[this.leftFrameTime,this.rightFrameTime]:[this.rightFrameTime,this.leftFrameTime];this.threeAnimAction.time=t,this.threeAnimAction._clip.start=t,this.threeAnimAction._clip.duration=e,this.threeAnimAction.timeScale=this.toggleIsForward?1:-1,this.animationControls.replaceOtherClips(this.threeAnimAction,this.data.object,i?.2:0)},this.startOnceDelay)}playFromCurrent(){this.toggle(!0)}reverseFromCurrent(){this.toggle(!1)}dispose(){let t=this.animationControls.clipIdToAction[this.data.clipId+"/"+this.data.object]?.getClip();t&&(t.duration=this.duration),this.pause();let i=b.get(this.data.object);i&&(i.delete(this),0===i.size&&b.delete(this.data.object))}},F=class{constructor(t,i,e){this.data=t,this.page=i,this.animationControls=e,this.objectId=T(i,t.object)}dispatch(){this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{this.apply(),this.disposeDelay()},this.data.delay)):this.apply()}targetsClip(t,i){return!(void 0!==this.objectId&&i!==this.objectId||this.data.clipId&&t!==this.data.clipId)}apply(){(void 0!==this.objectId?[b.get(this.objectId)]:[...b.values()]).forEach(t=>{t?.forEach(t=>{this.targetsClip(t.data.clipId,t.data.object)&&t.cancelPending()})}),this.animationControls.holdClips(this.data.interaction,(t,i)=>this.targetsClip(t,i))}disposeDelay(){clearTimeout(this.timeoutId),delete this.timeoutId}dispose(){this.disposeDelay()}},I=class{constructor(t,i,e,s,n){p.isPause(t)?this.interaction=new F(t,i,e):this.interaction=new v(t,i,e,s,n)}get data(){return this.interaction.data}get playing(){return this.interaction instanceof v&&this.interaction.playing}play(t=!1){if(this.interaction instanceof v)return this.interaction.play(t);this.interaction.dispatch()}pause(){this.interaction instanceof v&&this.interaction.pause()}stop(){this.interaction instanceof v&&this.interaction.stop()}seek(t){this.interaction instanceof v&&this.interaction.seek(t)}toggle(t,i=!1){if(this.interaction instanceof v)return this.interaction.toggle(t,i);this.interaction.dispatch()}playFromCurrent(){this.interaction instanceof v?this.interaction.playFromCurrent():this.interaction.dispatch()}reverseFromCurrent(){this.interaction instanceof v&&this.interaction.reverseFromCurrent()}dispose(){this.interaction.dispose()}};o(n),l("Transition",({eventType:t,data:i,page:e,shared:s,actionCondition:n,runModeOverride:r,object:a})=>new C(t,i,e,s,n,r,a)),l("Animation",({data:t,page:i,eventManager:e,shared:s,actionCondition:n})=>new I(t,i,e.animationControls,s,n)),g("transitions");
1
+ import{h as t,j as i,k as e,l as s,m as n}from"./runtime-chunk-SPZI3GXK.js";import"./runtime-chunk-MB67H2FU.js";import"./runtime-chunk-NTUTXO7Q.js";import{a as r,b as a,e as o,g as h}from"./runtime-chunk-67A7TMAH.js";import"./runtime-chunk-HD7WF3XN.js";import{a as c}from"./runtime-chunk-GGSUJEGZ.js";import"./runtime-chunk-FTVQTRM7.js";import{a as d}from"./runtime-chunk-RA5UBNOL.js";import"./runtime-chunk-572KWUWI.js";import"./runtime-chunk-IIF6BGTE.js";import"./runtime-chunk-ED2A7PP4.js";import"./runtime-chunk-PMIN6YLE.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{b as l,e as u}from"./runtime-chunk-NWUMV7YK.js";import"./runtime-chunk-HO57WDLD.js";import"./runtime-chunk-RTLL6WIB.js";import{e as m}from"./runtime-chunk-2PT2WH66.js";import{a as p}from"./runtime-chunk-R5WCGKXX.js";import{a as g}from"./runtime-chunk-TZCHGFVF.js";import{p as A}from"./runtime-chunk-CSILWFMF.js";import{Dc as j,Ec as f}from"./runtime-chunk-KPOUV3HD.js";import"./runtime-chunk-ML3Z74BL.js";function y(t){let i=t.tweens[0]?.data;return{delay:i?.delay??t.delay,delayDirection:i?.delayDirection??"start-once",direction:i?.direction??t.direction,repeat:i?.repeat??t.repeat}}var w={state:null,duration:0,delay:0,delayDirection:"start-once",direction:"normal",repeat:0,easing:0},b=class extends j{constructor(t,i,s,n,r,a,o){if(super(),this.eventType=t,this.data=i,this.page=s,this.shared=n,this.condition=r,this.runModeOverride=a,this.tweens=[],this.hasPlayedOnce=!1,this.inert=e,!i.object)throw new Error("Missing property");let h=this.page.scene.findFrom(i.object,o)??this.page.uiCanvas?.find(i.object)??this.page.scene.find2DInUIObjects(i.object);if(!h)throw new Error("Missing property");if(!h.states)throw new Error("Missing property");if(this.object=h,i.tweens.length<2)throw new Error("Missing property");this.init()}get playing(){return!0===this.runner?.isPlaying}get animating(){return!0===this.runner?.isAnimating}get claimTime(){return this.runner?.claimTime}get contested(){let t=this.object.previousAction;return null!==t&&t!==this&&t.animating}init(){this.initialCurrentState=i(this.object,this.object.currentState).id,this.build()}shouldReinit(){return!!u(this.shared,this.condition)||!(this.animating&&!this.loopsForever)}get loopsForever(){return-1===y(this.data).repeat||this.data.tweens.some((t,i)=>i>0&&-1===t.data.repeat)}get runMode(){return void 0!==this.runModeOverride?this.runModeOverride:A(this.eventType)?this.data.runMode:"Repeat"}get currentState(){return"Toggle"===this.runMode?this.initialCurrentState:this.object.currentState}get opensOnCurrent(){return void 0===this.data.tweens[0].data.state&&"Toggle"!==this.runMode}build(){let i=this.data.tweens,e=[];try{let t=i[0].data.state;void 0!==t&&e.push(new n(this.object,t,t,w,this.shared,this.data.allowSlerp??!1,this.page,{},()=>this.inert));for(let t=1;t<i.length;t++){let s=i[t-1],r=i[t];e.push(new n(this.object,void 0===s.data.state?this.currentState:s.data.state,void 0===r.data.state?this.currentState:r.data.state,r.data,this.shared,this.data.allowSlerp??!1,this.page,{},()=>this.inert))}}catch(t){return void(t instanceof Error&&console.error(t.message))}this.tweens=e,this.syncInert(),this.runner=new h({...t(y(this.data)),runMode:this.runMode},e.map(t=>t.runner),{claim:t=>this.claimObject(t),assignCurrentState:()=>this.rebindTweens(),isOwner:()=>this.object.previousAction===this})}claimObject(t){if(this.object.previousAction===this)return!1;let i=this.object.previousAction;if(!0===i?.animating){if(void 0!==t&&void 0!==i.claimTime&&i.claimTime>t)return!1;i.pause()}return this.object.previousAction=this,!0}rebindTweens(){for(let t of this.tweens)try{t.rebind()}catch(t){t instanceof Error&&console.error(t.message)}this.syncInert(),this.object instanceof d&&this.object.wasMovedByUser&&(this.object.wasMovedByUser=!1)}syncInert(){let t=this.tweens.flatMap(t=>t.endpointData);if(this.opensOnCurrent&&t.length>0){let e=i(this.object,this.object.currentState);e&&(t[0]=e.data)}this.inert=this.notMovedByOwner(s(t));for(let t of this.tweens)t.refresh()}notMovedByOwner(t){let i=this.object.previousAction;if(0===t.size||null===i||i===this||!i.animating)return t;let e=i.leavesAlone;return new Set([...t].filter(t=>e.has(t)))}get leavesAlone(){return this.inert}update(t){this.runner?.update(t),!0!==this.runner?.isPlaying&&c.remove(this)}branchTaken(){return u(this.shared,this.condition)}play(){if(!this.branchTaken()||"Once"===this.runMode&&this.hasPlayedOnce)return!1;this.hasPlayedOnce=!0,this.start()}start(){!this.runner||(this.runner.play(c.time),this.runner.isPlaying&&c.add(this))}pause(){this.runner?.stop(),c.remove(this)}stop(){this.pause();let t=void 0===this.data.tweens[0].data.state?this.initialCurrentState:this.data.tweens[0].data.state;m(this.object)?this.object.changeSelectedState(t,{shared:this.shared}):this.object.changeSelectedState(t,{scene:this.page.scene,shared:this.shared}),this.object.currentState=t}seek(t){if(!1===u(this.shared,this.condition))return!1;this.runner?.seek(t)}playDirected(t){if(!1===u(this.shared,this.condition))return!1;!this.runner||(this.runner.playDirected(c.time,t),this.runner.isPlaying&&c.add(this))}playFromCurrent(){this.playDirected(!0)}reverseFromCurrent(){this.playDirected(!1)}dispose(){this.pause()}},T=new Map;function C(t,i){if(void 0===i)return;let e=t.scene.find(i);return e?a(e):i}var v=class extends j{constructor(t,i,e,s,n){super(),this.page=i,this.animationControls=e,this.shared=s,this.condition=n,this.startOnceDelay=0,this.toggleIsForward=!1;let a=C(i,t.object)??t.object;this.data={...t,object:a};let o=this.animationControls.clipIdToAction[t.clipId+"/"+a];if(this.duration=o?.getClip()?.duration??1,this.data.crop2){let t=r(o?.getClip());this.leftFrameTime=this.data.crop2[0]/(t-1)*this.duration,this.rightFrameTime=this.data.crop2[1]/(t-1)*this.duration}else{let t=o?.getClip()?.tracks[0]?.times.length;t&&t>1?(this.leftFrameTime=this.data.crop[0]/t*this.duration,this.rightFrameTime=this.data.crop[1]/t*this.duration):(this.leftFrameTime=0,this.rightFrameTime=this.duration)}this.startOnceDelay=t.delay;let h=T.get(a);h||(h=new Set,T.set(a,h)),h.add(this)}get playing(){return this.threeAnimAction?.isRunning()??!1}cancelPending(){window.clearTimeout(this.timeoutId),delete this.timeoutId}resume(){let t=this.animationControls.clipIdToAction[this.data.clipId+"/"+this.data.object];return!(!t||!this.animationControls.resumeClip(t)||(this.threeAnimAction=t,0))}play(t=!1){if(!1===u(this.shared,this.condition))return!1;window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{this.resume()||(this.threeAnimAction=this.animationControls.play(this.data),this.threeAnimAction&&this.animationControls.startClip(this.threeAnimAction,this.data.object,{start:this.leftFrameTime,end:this.rightFrameTime,fade:t?.2:0}))},this.startOnceDelay)}pause(){this.threeAnimAction&&(this.threeAnimAction.paused=!0),this.cancelPending()}stop(){this.threeAnimAction?.fadeOut(.2)}seek(t){this.threeAnimAction=this.animationControls.play(this.data),this.threeAnimAction&&(this.threeAnimAction.paused=!0,this.threeAnimAction.time=f.clamp(this.threeAnimAction.time+1/60*t,this.leftFrameTime,this.rightFrameTime-16e-5),this.animationControls.needsUpdate=!0,this.animationControls.requestRender())}toggle(t,i=!1){if(!1===u(this.shared,this.condition))return!1;this.toggleIsForward=t??!this.toggleIsForward,this.threeAnimAction&&(this.threeAnimAction._loopCount=0),this.playing||this.resume()?this.threeAnimAction&&(this.threeAnimAction.timeScale=this.toggleIsForward?1:-1,this.toggleIsForward?(this.threeAnimAction._clip.start=this.leftFrameTime,this.threeAnimAction._clip.duration=this.rightFrameTime):(this.threeAnimAction._clip.start=this.rightFrameTime,this.threeAnimAction._clip.duration=this.leftFrameTime)):this.timeoutId=window.setTimeout(()=>{if(this.threeAnimAction=this.animationControls.play(this.data),!this.threeAnimAction)return;let[t,e]=this.toggleIsForward?[this.leftFrameTime,this.rightFrameTime]:[this.rightFrameTime,this.leftFrameTime];this.threeAnimAction.time=t,this.threeAnimAction._clip.start=t,this.threeAnimAction._clip.duration=e,this.threeAnimAction.timeScale=this.toggleIsForward?1:-1,this.animationControls.replaceOtherClips(this.threeAnimAction,this.data.object,i?.2:0)},this.startOnceDelay)}playFromCurrent(){this.toggle(!0)}reverseFromCurrent(){this.toggle(!1)}dispose(){let t=this.animationControls.clipIdToAction[this.data.clipId+"/"+this.data.object]?.getClip();t&&(t.duration=this.duration),this.pause();let i=T.get(this.data.object);i&&(i.delete(this),0===i.size&&T.delete(this.data.object))}},F=class{constructor(t,i,e){this.data=t,this.page=i,this.animationControls=e,this.objectId=C(i,t.object)}dispatch(){this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{this.apply(),this.disposeDelay()},this.data.delay)):this.apply()}targetsClip(t,i){return!(void 0!==this.objectId&&i!==this.objectId||this.data.clipId&&t!==this.data.clipId)}apply(){(void 0!==this.objectId?[T.get(this.objectId)]:[...T.values()]).forEach(t=>{t?.forEach(t=>{this.targetsClip(t.data.clipId,t.data.object)&&t.cancelPending()})}),this.animationControls.holdClips(this.data.interaction,(t,i)=>this.targetsClip(t,i))}disposeDelay(){clearTimeout(this.timeoutId),delete this.timeoutId}dispose(){this.disposeDelay()}},I=class{constructor(t,i,e,s,n){p.isPause(t)?this.interaction=new F(t,i,e):this.interaction=new v(t,i,e,s,n)}get data(){return this.interaction.data}get playing(){return this.interaction instanceof v&&this.interaction.playing}play(t=!1){if(this.interaction instanceof v)return this.interaction.play(t);this.interaction.dispatch()}pause(){this.interaction instanceof v&&this.interaction.pause()}stop(){this.interaction instanceof v&&this.interaction.stop()}seek(t){this.interaction instanceof v&&this.interaction.seek(t)}toggle(t,i=!1){if(this.interaction instanceof v)return this.interaction.toggle(t,i);this.interaction.dispatch()}playFromCurrent(){this.interaction instanceof v?this.interaction.playFromCurrent():this.interaction.dispatch()}reverseFromCurrent(){this.interaction instanceof v&&this.interaction.reverseFromCurrent()}dispose(){this.interaction.dispose()}};o(n),l("Transition",({eventType:t,data:i,page:e,shared:s,actionCondition:n,runModeOverride:r,object:a})=>new b(t,i,e,s,n,r,a)),l("Animation",({data:t,page:i,eventManager:e,shared:s,actionCondition:n})=>new I(t,i,e.animationControls,s,n)),g("transitions");
@@ -1 +1 @@
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 u,n as l}from"./runtime-chunk-7OHCCGTO.js";import"./runtime-chunk-NTUTXO7Q.js";import"./runtime-chunk-FTVQTRM7.js";import{N as p,na as f}from"./runtime-chunk-JQCHQ4ER.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{b as v}from"./runtime-chunk-W2OWSMDC.js";import"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import{e as g,f as y}from"./runtime-chunk-R5WCGKXX.js";import{a as w,f as O,j as P}from"./runtime-chunk-TZCHGFVF.js";import{E as j}from"./runtime-chunk-CSILWFMF.js";import{Ba as b,Ce as R,Dd as x,Ec as S,Nc as F,Ne as T,dd as H,ee as W,fd as D,nd as I}from"./runtime-chunk-KPOUV3HD.js";import"./runtime-chunk-ML3Z74BL.js";function M(e,t,i,r){return r?i:2048/Math.max(1,e,t)}var E=new R(-1,1,1,-1,0,1),U=new class extends D{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))}},z=new W({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}"}),B=new class{constructor(e){this._mesh=new I(U,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,E)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}(z),C=null,G=null,k=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=M(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 u(S.generateUUID(),y.defaultData,{dpr:window.devicePixelRatio,shared:s.shared}),this.canvas=(null===C&&(C=document.createElement("canvas")),C),this.renderer=(n=this.canvas,null===G&&(G=new a(n)),G),this.promise=this.init(),this.renderTarget=new F(1,1,{type:b,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 x(this.canvas)),this._canvasTexture}async init(){await this.renderer.init(),this.renderer.uiFontReady?.then(()=>{this.frameOverride&&this.onRenderRequestedDownstream()})}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{z.uniforms.tDiffuse.value=this.canvasTexture;let t=e.getRenderTarget();e.setRenderTarget(this.renderTarget),e.clear(),B.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=k,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=M(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),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("beginState",this.onFrameOverrideObjectEvent),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&&q({objectOverride:h,objectRoot:d,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s})}}function q({objectOverride:e,objectRoot:t,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s}){let[n,h]=function(e){if(V(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:u,position:p}=l({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)N({stateId:n,objectOverride:e,objectRoot:t,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s});if(V(e)||e instanceof d)V(e)&&(e.width=o,e.height=u,e.data={...e.data,width:o,height:u}),L({objectOverride:e,objectRoot:t,newParentWidth:o,newParentHeight:u,initialParentWidth:n,initialParentHeight:h});else if(e instanceof m){let i=t,r=0!==n?o/n:1,a=0!==h?u/h:1;e.path=c(i.path,r,a),e.data={...e.data,path:e.path}}}function N({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}=l({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 V(e){return e instanceof n||e instanceof o||e instanceof s||e instanceof h}var A=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 A(e,t,i)),P({Scene2D:u,UICanvas:_,loadHanaUIRUNTIME:r,setHanaUIWasmUrl:i}),w("ui-2d");
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 u,n as l}from"./runtime-chunk-MB67H2FU.js";import"./runtime-chunk-NTUTXO7Q.js";import"./runtime-chunk-FTVQTRM7.js";import{N as p,na as f}from"./runtime-chunk-PMIN6YLE.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{b as v}from"./runtime-chunk-HO57WDLD.js";import"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import{e as g,f as y}from"./runtime-chunk-R5WCGKXX.js";import{a as w,f as O,j as P}from"./runtime-chunk-TZCHGFVF.js";import{E as j}from"./runtime-chunk-CSILWFMF.js";import{Ba as b,Ce as R,Dd as x,Ec as F,Nc as S,Ne as T,dd as H,ee as D,fd as W,nd as I}from"./runtime-chunk-KPOUV3HD.js";import"./runtime-chunk-ML3Z74BL.js";function M(e,t,i,r){return r?i:2048/Math.max(1,e,t)}var E=new R(-1,1,1,-1,0,1),U=new class extends W{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))}},B=new D({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}"}),z=new class{constructor(e){this._mesh=new I(U,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,E)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}(B),k=null,G=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=M(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 u(F.generateUUID(),y.defaultData,{dpr:window.devicePixelRatio,shared:s.shared}),this.canvas=(null===k&&(k=document.createElement("canvas")),k),this.renderer=(n=this.canvas,null===G&&(G=new a(n)),G),this.promise=this.init(),this.renderTarget=new S(1,1,{type:b,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 x(this.canvas)),this._canvasTexture}async init(){await this.renderer.init(),this.renderer.uiFontReady?.then(()=>{this.frameOverride&&this.onRenderRequestedDownstream()})}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{B.uniforms.tDiffuse.value=this.canvasTexture;let t=e.getRenderTarget();e.setRenderTarget(this.renderTarget),e.clear(),z.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=M(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),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("beginState",this.onFrameOverrideObjectEvent),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&&N({objectOverride:h,objectRoot:d,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s})}}function N({objectOverride:e,objectRoot:t,newParentWidth:i,newParentHeight:r,initialParentWidth:a,initialParentHeight:s}){let[n,h]=function(e){if(V(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:u,position:p}=l({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(V(e)||e instanceof d)V(e)&&(e.width=o,e.height=u,e.data={...e.data,width:o,height:u}),L({objectOverride:e,objectRoot:t,newParentWidth:o,newParentHeight:u,initialParentWidth:n,initialParentHeight:h});else if(e instanceof m){let i=t,r=0!==n?o/n:1,a=0!==h?u/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}=l({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 V(e){return e instanceof n||e instanceof o||e instanceof s||e instanceof h}var A=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 A(e,t,i)),P({Scene2D:u,UICanvas:_,loadHanaUIRUNTIME:r,setHanaUIWasmUrl:i}),w("ui-2d");
@@ -1 +1 @@
1
- import{na as t}from"./runtime-chunk-JQCHQ4ER.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{u as e}from"./runtime-chunk-W2OWSMDC.js";import"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-R5WCGKXX.js";import{a as r,f as i}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-CSILWFMF.js";import"./runtime-chunk-KPOUV3HD.js";import"./runtime-chunk-ML3Z74BL.js";var n=class extends t{get forceComputeSize(){return!0}get shape(){return this.geometry.userData.shape}updateEntityBoxSize(t,r){let i=this.geometry.getAttribute("position");void 0!==i?e(i,this.geometry.drawRange.start,this.geometry.drawRange.count<1/0?this.geometry.drawRange.count:i.count,t,r):super.updateEntityBoxSize(t,r)}};i("VectorGeometry",(t,e,r)=>new n(t,e,r)),r("vector-shapes");
1
+ import{na as t}from"./runtime-chunk-PMIN6YLE.js";import"./runtime-chunk-4YV3EXSU.js";import"./runtime-chunk-NSD7DU3P.js";import{u as e}from"./runtime-chunk-HO57WDLD.js";import"./runtime-chunk-RTLL6WIB.js";import"./runtime-chunk-2PT2WH66.js";import"./runtime-chunk-R5WCGKXX.js";import{a as r,f as i}from"./runtime-chunk-TZCHGFVF.js";import"./runtime-chunk-CSILWFMF.js";import"./runtime-chunk-KPOUV3HD.js";import"./runtime-chunk-ML3Z74BL.js";var n=class extends t{get forceComputeSize(){return!0}get shape(){return this.geometry.userData.shape}updateEntityBoxSize(t,r){let i=this.geometry.getAttribute("position");void 0!==i?e(i,this.geometry.drawRange.start,this.geometry.drawRange.count<1/0?this.geometry.drawRange.count:i.count,t,r):super.updateEntityBoxSize(t,r)}};i("VectorGeometry",(t,e,r)=>new n(t,e,r)),r("vector-shapes");
@@ -1 +1 @@
1
- import{a as e}from"./runtime-chunk-ERT6AFRF.js";import"./runtime-chunk-QJ4BBCAT.js";import{a as t}from"./runtime-chunk-UIRA2CWJ.js";import"./runtime-chunk-NYHKYL7K.js";import{Db as n,Dc as r,Hc as a,Ne as o,Qc as i,Vc as s,Xc as c,ye as y}from"./runtime-chunk-KPOUV3HD.js";import"./runtime-chunk-ML3Z74BL.js";new y,new s,new Float32Array([255/256/256**3,255/256/65536,255/256/256,255/256]);var l=new Map([[0,null],[1,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}"],[2,"vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}"],[3,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}"],[4,"float blend(const in float x,const in float y){return(y==0.0)?y:max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[5,"float blend(const in float x,const in float y){return(y==1.0)?y:min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[6,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}"],[7,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}"],[8,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}"],[9,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}"],[10,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}"],[11,"float blend(const in float x,const in float y){return(y>0.0)?min(x/y,1.0):1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[12,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}"],[13,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}"],[14,"float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[15,"float blend(const in float x,const in float y){return(y==1.0)?y:min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[16,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}"],[17,"float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[18,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}"]]),u=class extends r{constructor(e,t=1){super(),this.f=e,this.opacity=new o(t)}getOpacity(){return this.opacity.value}setOpacity(e){this.opacity.value=e}get blendFunction(){return this.f}set blendFunction(e){this.f=e,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(e){this.blendFunction=e}getShaderCode(){return l.get(this.blendFunction)}},d=class extends r{constructor(e,t,{attributes:n=0,blendFunction:r=16,defines:a=new Map,uniforms:o=new Map,extensions:i=null,vertexShader:s=null}={}){super(),this.name=e,this.renderer=null,this.attributes=n,this.fragmentShader=t,this.vertexShader=s,this.defines=a,this.uniforms=o,this.extensions=i,this.blendMode=new u(r),this.blendMode.addEventListener("change",e=>this.setChanged())}getName(){return this.name}setRenderer(e){this.renderer=e}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(e){this.attributes=e,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(e){this.fragmentShader=e,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(e){this.vertexShader=e,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(e,t=n){}update(e,t,n){}setSize(e,t){}initialize(e,t,n){}dispose(){for(let e of Object.keys(this)){let t=this[e];if(null!==t&&"object"==typeof t&&"function"==typeof t.dispose){if(t instanceof c||t===this.renderer)continue;this[e].dispose()}}}},f=(new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10]),new a,new i,new s,Math.PI,new a,new a,0),x=class extends d{constructor({blendFunction:e=13,technique:t=f,eskil:n=!1,offset:r=.5,darkness:a=.5}={}){super("VignetteEffect","uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb;\n#if VIGNETTE_TECHNIQUE == 0\nfloat d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset));\n#else\nvec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord));\n#endif\noutputColor=vec4(color,inputColor.a);}",{blendFunction:e,defines:new Map([["VIGNETTE_TECHNIQUE",t.toFixed(0)]]),uniforms:new Map([["offset",new o(r)],["darkness",new o(a)]])})}get technique(){return Number(this.defines.get("VIGNETTE_TECHNIQUE"))}set technique(e){this.technique!==e&&(this.defines.set("VIGNETTE_TECHNIQUE",e.toFixed(0)),this.setChanged())}get eskil(){return 1===this.technique}set eskil(e){this.technique=e?1:f}getTechnique(){return this.technique}setTechnique(e){this.technique=e}get offset(){return this.uniforms.get("offset").value}set offset(e){this.uniforms.get("offset").value=e}getOffset(){return this.offset}setOffset(e){this.offset=e}get darkness(){return this.uniforms.get("darkness").value}set darkness(e){this.uniforms.get("darkness").value=e}getDarkness(){return this.darkness}setDarkness(e){this.darkness=e}};function w(e,t,n){return e+(t-e)*n}function h(e,t,n,r){let a=w(e,t,.75),o=w(n,r,.75);return w(a,o,.875)}new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array(2),new Float32Array(2),new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125]),new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4]),new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3]),new Map([[h(0,0,0,0),new Float32Array([0,0,0,0])],[h(0,0,0,1),new Float32Array([0,0,0,1])],[h(0,0,1,0),new Float32Array([0,0,1,0])],[h(0,0,1,1),new Float32Array([0,0,1,1])],[h(0,1,0,0),new Float32Array([0,1,0,0])],[h(0,1,0,1),new Float32Array([0,1,0,1])],[h(0,1,1,0),new Float32Array([0,1,1,0])],[h(0,1,1,1),new Float32Array([0,1,1,1])],[h(1,0,0,0),new Float32Array([1,0,0,0])],[h(1,0,0,1),new Float32Array([1,0,0,1])],[h(1,0,1,0),new Float32Array([1,0,1,0])],[h(1,0,1,1),new Float32Array([1,0,1,1])],[h(1,1,0,0),new Float32Array([1,1,0,0])],[h(1,1,0,1),new Float32Array([1,1,0,1])],[h(1,1,1,0),new Float32Array([1,1,1,0])],[h(1,1,1,1),new Float32Array([1,1,1,1])]]);var v=class extends e{constructor(){super(x)}get eskil(){return this.effect.eskil}set eskil(e){this.effect.eskil=e}get darkness(){return this.effect.uniforms.get("darkness").value}set darkness(e){this.effect.uniforms.get("darkness").value=e}get offset(){return this.effect.uniforms.get("offset").value}set offset(e){this.effect.uniforms.get("offset").value=e}};t("vignette",()=>new v);
1
+ import{a as e}from"./runtime-chunk-VRSEKOAY.js";import"./runtime-chunk-WJLC6EDK.js";import{a as t}from"./runtime-chunk-UIRA2CWJ.js";import"./runtime-chunk-WHPDVM2L.js";import{Db as n,Dc as r,Hc as a,Ne as o,Qc as i,Vc as s,Xc as c,ye as y}from"./runtime-chunk-KPOUV3HD.js";import"./runtime-chunk-ML3Z74BL.js";new y,new s,new Float32Array([255/256/256**3,255/256/65536,255/256/256,255/256]);var l=new Map([[0,null],[1,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}"],[2,"vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}"],[3,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}"],[4,"float blend(const in float x,const in float y){return(y==0.0)?y:max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[5,"float blend(const in float x,const in float y){return(y==1.0)?y:min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[6,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}"],[7,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}"],[8,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}"],[9,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}"],[10,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}"],[11,"float blend(const in float x,const in float y){return(y>0.0)?min(x/y,1.0):1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[12,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}"],[13,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}"],[14,"float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[15,"float blend(const in float x,const in float y){return(y==1.0)?y:min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[16,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}"],[17,"float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[18,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}"]]),u=class extends r{constructor(e,t=1){super(),this.f=e,this.opacity=new o(t)}getOpacity(){return this.opacity.value}setOpacity(e){this.opacity.value=e}get blendFunction(){return this.f}set blendFunction(e){this.f=e,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(e){this.blendFunction=e}getShaderCode(){return l.get(this.blendFunction)}},d=class extends r{constructor(e,t,{attributes:n=0,blendFunction:r=16,defines:a=new Map,uniforms:o=new Map,extensions:i=null,vertexShader:s=null}={}){super(),this.name=e,this.renderer=null,this.attributes=n,this.fragmentShader=t,this.vertexShader=s,this.defines=a,this.uniforms=o,this.extensions=i,this.blendMode=new u(r),this.blendMode.addEventListener("change",e=>this.setChanged())}getName(){return this.name}setRenderer(e){this.renderer=e}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(e){this.attributes=e,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(e){this.fragmentShader=e,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(e){this.vertexShader=e,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(e,t=n){}update(e,t,n){}setSize(e,t){}initialize(e,t,n){}dispose(){for(let e of Object.keys(this)){let t=this[e];if(null!==t&&"object"==typeof t&&"function"==typeof t.dispose){if(t instanceof c||t===this.renderer)continue;this[e].dispose()}}}},f=(new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10]),new a,new i,new s,Math.PI,new a,new a,0),x=class extends d{constructor({blendFunction:e=13,technique:t=f,eskil:n=!1,offset:r=.5,darkness:a=.5}={}){super("VignetteEffect","uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb;\n#if VIGNETTE_TECHNIQUE == 0\nfloat d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset));\n#else\nvec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord));\n#endif\noutputColor=vec4(color,inputColor.a);}",{blendFunction:e,defines:new Map([["VIGNETTE_TECHNIQUE",t.toFixed(0)]]),uniforms:new Map([["offset",new o(r)],["darkness",new o(a)]])})}get technique(){return Number(this.defines.get("VIGNETTE_TECHNIQUE"))}set technique(e){this.technique!==e&&(this.defines.set("VIGNETTE_TECHNIQUE",e.toFixed(0)),this.setChanged())}get eskil(){return 1===this.technique}set eskil(e){this.technique=e?1:f}getTechnique(){return this.technique}setTechnique(e){this.technique=e}get offset(){return this.uniforms.get("offset").value}set offset(e){this.uniforms.get("offset").value=e}getOffset(){return this.offset}setOffset(e){this.offset=e}get darkness(){return this.uniforms.get("darkness").value}set darkness(e){this.uniforms.get("darkness").value=e}getDarkness(){return this.darkness}setDarkness(e){this.darkness=e}};function w(e,t,n){return e+(t-e)*n}function h(e,t,n,r){let a=w(e,t,.75),o=w(n,r,.75);return w(a,o,.875)}new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array(2),new Float32Array(2),new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125]),new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4]),new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3]),new Map([[h(0,0,0,0),new Float32Array([0,0,0,0])],[h(0,0,0,1),new Float32Array([0,0,0,1])],[h(0,0,1,0),new Float32Array([0,0,1,0])],[h(0,0,1,1),new Float32Array([0,0,1,1])],[h(0,1,0,0),new Float32Array([0,1,0,0])],[h(0,1,0,1),new Float32Array([0,1,0,1])],[h(0,1,1,0),new Float32Array([0,1,1,0])],[h(0,1,1,1),new Float32Array([0,1,1,1])],[h(1,0,0,0),new Float32Array([1,0,0,0])],[h(1,0,0,1),new Float32Array([1,0,0,1])],[h(1,0,1,0),new Float32Array([1,0,1,0])],[h(1,0,1,1),new Float32Array([1,0,1,1])],[h(1,1,0,0),new Float32Array([1,1,0,0])],[h(1,1,0,1),new Float32Array([1,1,0,1])],[h(1,1,1,0),new Float32Array([1,1,1,0])],[h(1,1,1,1),new Float32Array([1,1,1,1])]]);var v=class extends e{constructor(){super(x)}get eskil(){return this.effect.eskil}set eskil(e){this.effect.eskil=e}get darkness(){return this.effect.uniforms.get("darkness").value}set darkness(e){this.effect.uniforms.get("darkness").value=e}get offset(){return this.effect.uniforms.get("offset").value}set offset(e){this.effect.uniforms.get("offset").value=e}};t("vignette",()=>new v);